Table of Contents

Class MechCollisionUtil

Namespace
Hi.Collision
Assembly
HiMech.dll

Utility class providing methods for mechanical collision detection and management.

public static class MechCollisionUtil
Inheritance
MechCollisionUtil
Inherited Members

Methods

Detect(IEnumerable<CollisionIndexPair>, Dictionary<Anchor, mat4d_t>, out Dictionary<ICollidable, CollisionFlag>)

Performs collision detection on a collection of collision index pairs.

public static CollisionFlag Detect(this IEnumerable<CollisionIndexPair> CollisionIndexPairs, Dictionary<Anchor, mat4d_t> matMap, out Dictionary<ICollidable, CollisionFlag> itemToFlag)

Parameters

CollisionIndexPairs IEnumerable<CollisionIndexPair>

The collection of collision index pairs to check.

matMap Dictionary<Anchor, mat4d_t>

Dictionary mapping anchors to transformation matrices.

itemToFlag Dictionary<ICollidable, CollisionFlag>

Output dictionary mapping collidable objects to their collision flags.

Returns

CollisionFlag

The primary collision flag representing the overall collision status.

PrepareCollidableItems(IEnumerable<CollisionIndexPair>)

Prepares collidable items for collision detection by ensuring their triangle trees are initialized, silently: a tree the native build left triangles out of is counted (NonFiniteTriangleCount), not said. The same as PrepareCollidableItems(IEnumerable<CollisionIndexPair>, IProgress<IMessage>) with a null sink.

public static void PrepareCollidableItems(this IEnumerable<CollisionIndexPair> collisionIndexPairs)

Parameters

collisionIndexPairs IEnumerable<CollisionIndexPair>

The collection of collision index pairs to prepare.

PrepareCollidableItems(IEnumerable<CollisionIndexPair>, IProgress<IMessage>)

Prepares collidable items for collision detection by ensuring their triangle trees are initialized, and says Collision-Prepare–NonFiniteTrianglesLeftOut on messageProgress for every distinct tree the native build left triangles out of (NonFiniteTriangleCount: an apex coordinate that is not a number or is infinite; such a triangle takes no part in any collision answer) – once per tree ever (TakeNonFiniteTrianglesWarning(): however many pairs hold it, however many sinked calls follow, and not again when the tree's own ctor said it to a sink), named by the Key of the first index that resolves to it, with the count and the mesh's triangle count. A chain's solids build their trees without a sink (Solid.TriTree), so this is where a part with such a mesh is said: at LocalProjectService.EnableCollisionDetection, and before every detection with a sink (MachiningEquipment.Detect(bool, IProgress{IMessage}), the play's steps), which catches a tree first built later – a project loaded with the switch already on, a part replaced after the enable, a tool mounted by the NC's tool change. A null sink prepares silently and leaves the warning to be said.

public static void PrepareCollidableItems(this IEnumerable<CollisionIndexPair> collisionIndexPairs, IProgress<IMessage> messageProgress)

Parameters

collisionIndexPairs IEnumerable<CollisionIndexPair>

The collection of collision index pairs to prepare.

messageProgress IProgress<IMessage>

Sink-agnostic message host for the warnings; null: counted, not said.

ResetCollisionFlags(IEnumerable<CollisionIndexPair>)

Resets the collision flags for all collision index pairs to undefined.

public static void ResetCollisionFlags(this IEnumerable<CollisionIndexPair> collisionIndexPairs)

Parameters

collisionIndexPairs IEnumerable<CollisionIndexPair>

The collection of collision index pairs to reset.