CollisionDetection Class

Utility class for performing Collision Detection.
Public Class CollisionDetection 
Inherits CollisionDetection2D
This language is not supported or no code example is available.
public class CollisionDetection : CollisionDetection2D
This language is not supported or no code example is available.
Name Description
Public constructor CollisionDetection(IList<Entity>, BlockKeyedCollection, bool, collisionCheckType, int, int) The Collision detection utility constructor with a list of entity. The collision test checks collisions among the entities of the same list (all to all check).
Public constructor CollisionDetection(IList<Entity>, IList<Entity>, BlockKeyedCollection, bool, collisionCheckType, int, int) The Collision detection utility constructor with two entity lists. The collision test checks collisions from the first entity list to the second one.
Top
Name Description
Public property CheckMethod Gets or sets the collision accuracy type. (inherited from CollisionDetection2D).
Public property CoincidenceAsCollision When true it considers the coincidence between objects as collision. It avoids them otherwise. (inherited from CollisionDetection2D).
Public property ExecutionTime Gets the (last) work execution time in milliseconds. (inherited from WorkUnit).
Public property FirstOnly When true the collision detection will stop at the first entities tuple found. (inherited from CollisionDetection2D).
Public property Log Gets the list of errors and warnings generated during execution. (inherited from WorkUnit).
Public property Result The resulting collision Data subdivided for tuples of intersecting entities. (inherited from CollisionDetection2D).
Public property Status Gets the WorkUnit status. (inherited from WorkUnit).
Public property Static obbCollisionText Gets or sets the "Collision detection..." text string. (inherited from CollisionDetection2D).
Public property Static octreeCollisionText Gets or sets the "Collision detection with Octree..." text string
Public property Static preCollisionText Gets or sets the "Preparing data..." text string. (inherited from CollisionDetection2D).
Top
Methods
 
Name Description
Protected method AccurateIntersection(Entity, Entity, bool, out List<Entity>) Checks if two entity intersect geometrically.
Protected method BuildEntityTree(Entity, int, BackgroundWorker, DoWorkEventArgs)
Internal protected (Protected Friend) method Cancelled(BackgroundWorker, DoWorkEventArgs) Checks if the user has requested cancellation of the background operation. (inherited from WorkUnit).
Public method ClearCache() Removes all the objects defined for collision detection. (inherited from CollisionDetection2D).
Protected method ComputeAccurateVolume(Entity, Transformation, Entity, Transformation, ref List<Entity>)
Public method ComputeIntersectionVolume() Performs extra computation to find the intersection volumes of each Colliding Entities tuple. The CollisionResult.CollisionItems is filled with the list of the intersection volumes found. (inherited from CollisionDetection2D).
Protected method ComputeLeafsTrees(BackgroundWorker, DoWorkEventArgs) (inherited from CollisionDetection2D).
Protected method ComputeOrientedBoundings(BackgroundWorker, DoWorkEventArgs) Computes the oriented bounding rect/box for all the entities in the groups (or update only the modified entities) (inherited from CollisionDetection2D).
Protected method ComputeSubdivisionTreeVolume(Entity, Transformation, Entity, Transformation, ref List<Entity>)
Internal protected (Protected Friend) method DoWork(BackgroundWorker, DoWorkEventArgs) Does the actual work allowing progress bar update and cancellation. (inherited from CollisionDetection2D).
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Static FillCollidedTuple(Entity, Entity, List<CollisionResult>, List<Entity>) (inherited from CollisionDetection2D).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Protected method Static GetEntitiesToBuildTree(IList<Entity>, BlockKeyedCollection) (inherited from CollisionDetection2D).
Protected method GetEntityForSubdivisionTree(Entity)
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetType Gets the Type of the current instance. (inherited from Object).
Protected method IntersectOB(Entity, Entity, ref List<CollisionResult>, out List<Entity>, BackgroundWorker, DoWorkEventArgs) Check intersection between Oriented Bounding Box of two root entities (the entities can be BlockReference), by using SAT algorithm.
Protected method IntersectTree(Entity, Entity, ref List<CollisionResult>, out List<Entity>, BackgroundWorker, DoWorkEventArgs) Check intersection between Octrees of two root entities (the entities can be BlockReference), by using SAT algorithm.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Protected method OrientedBoundingBoxCollision(BackgroundWorker, DoWorkEventArgs) Check collision among oriented bounding boxes of the entities groups (inherited from CollisionDetection2D).
Public method PrepareDataForCollision(BackgroundWorker, DoWorkEventArgs) Computes the collision detection data needed during the check. (inherited from CollisionDetection2D).
Internal protected (Protected Friend) method ResetProgressParallel(int) Resets the progress bar for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method StartContinuousAnimation(string, BackgroundWorker, params string[]) Start the animation for the continuous progress bar. (inherited from WorkUnit).
Internal protected (Protected Friend) method StopContinuousAnimation(BackgroundWorker) Stop the animation for the continuous progress bar. (inherited from WorkUnit).
Public method ToString Returns a string that represents the current object. (inherited from Object).
Protected method TreesCollision(BackgroundWorker, DoWorkEventArgs) Check collision among octrees of the entities groups (inherited from CollisionDetection2D).
Internal protected (Protected Friend) method UpdateProgress(double, double, string, BackgroundWorker, bool, params string[]) Updates the progress bar value. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgress(int, int, string, BackgroundWorker, bool, params string[]) Updates the progress bar value. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelled(int, int, string, BackgroundWorker, DoWorkEventArgs, bool, params string[]) Updates the progress bar value and checks if the worker thread has been canceled. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressAndCheckCancelledParallel(int, string, BackgroundWorker, DoWorkEventArgs, params string[]) Updates the progress bar value and checks if the worker thread has been canceled, for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressParallel(double, string, BackgroundWorker, params string[]) Updates the progress bar value for a parallel loop. (inherited from WorkUnit).
Internal protected (Protected Friend) method UpdateProgressTo100(string, BackgroundWorker, params string[]) Set the progress bar to 100% and forces screen update. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCancelled(Environment) Called when the work is cancelled. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkCompleted(Environment) Called when the work has completed. In the case you are modeling something, the environment parameter allows you to easily add the model to the entities collection. (inherited from WorkUnit).
Internal protected (Protected Friend) method WorkFailed(Environment) Called when the work has failed. (inherited from WorkUnit).
Top
Events
 
Name Description
Public event ProgressChanged Occurs when the DoWork() is called synchronously and the progress has changed. (inherited from WorkUnit).
Top
Fields
 
Name Description
Protected field _allToAll When true, it detects collition from a unique list of entities intersecting each others. When false, it takes two list of separate object. Detects wich entities of the first list intersect what of the second. (inherited from CollisionDetection2D).
Public field _checkMethod (inherited from CollisionDetection2D).
Protected field _entities1 Lists of entities to check during collision detection. (inherited from CollisionDetection2D).
Protected field _entities2 Lists of entities to check during collision detection. (inherited from CollisionDetection2D).
Protected field blocks (inherited from CollisionDetection2D).
Protected field currentProgress (inherited from CollisionDetection2D).
Internal protected (Protected Friend) field log (inherited from WorkUnit).
Protected field maxNumElemForQuadTreeNode (inherited from CollisionDetection2D).
Protected field maxedgelength
Top
Remarks
 
The Regen() method needs to be called first for the interested entities (except for Mesh, Solid, FastPointCloud, Joint, Bar and LinearPath).

.NET Framework

Supported in: 4.8

In this article

Definition