Click or drag to resize
DigitalRuneCollisionDomain Class
A collision domain that manages collision objects.
Inheritance Hierarchy
SystemObject
  DigitalRune.Geometry.CollisionsCollisionDomain

Namespace: DigitalRune.Geometry.Collisions
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public class CollisionDomain

The CollisionDomain type exposes the following members.

Constructors
  NameDescription
Public methodCollisionDomain
Initializes a new instance of the CollisionDomain class.
Public methodCollisionDomain(CollisionDetection)
Initializes a new instance of the CollisionDomain class.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetContactObjects
Gets all CollisionObjects that have contact with the given object.
Public methodGetContacts(CollisionObject)
Gets all contacts of the given CollisionObject.
Public methodGetContacts(CollisionObject, CollisionObject)
Gets the contacts for the given CollisionObject pair.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasContact
Determines whether the specified collision object has contact with any other object in the domain.
Public methodHaveContact
Determines whether two CollisionObjects have contact.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Public methodUpdate(Single)
Updates the collision domain and computes the new contact information.
Public methodUpdate(TimeSpan)
Updates the collision domain and computes the new contact information.
Public methodUpdate(CollisionObject)
Updates the collision domain and computes the new contact information for a given collision object.
Public methodUpdate(Single, Boolean)
Updates the collision domain and computes the new contact information.
Top
Properties
  NameDescription
Public propertyBroadPhase
Public propertyCollisionDetection
Gets the collision detection service.
Public propertyCollisionObjects
Gets a collection of collision objects that are managed in this collision domain.
Public propertyContactSets
Gets a collection with all contacts found in the collision domain.
Public propertyEnableMultithreading
Gets or sets a value indicating whether multithreading is enabled.
Public propertyNumberOfBroadPhaseOverlaps
Gets the number of AABB overlaps in the broad phase.
Top
Remarks

The CollisionDetection can be used for ad hoc collision queries between any two objects. The CollisionDomain is designed to manage multiple collision objects at once and allows faster contact queries.

The method Update(Single) must be called in each frame (time step) to update the collision domain. Update(Single) computes all collisions between all objects inside the domain. The resulting contacts are stored in ContactSets. The collision domain reuses collision data from the last frame. Additionally, if the property EnableMultithreading is set, the workload is distributed across multiple CPU cores. Therefore the collision computation is much faster in comparison to ad hoc queries (as in CollisionDetection).

A CollisionDomain can only compute real contacts (geometric objects are touching or intersecting), but it does not calculate closest-point queries for separated objects. Use CollisionDetection to calculate the closest-point queries.

See Also