ContactSet Class |
Namespace: DigitalRune.Geometry.Collisions
The ContactSet type exposes the following members.
Name | Description | |
---|---|---|
Add |
Adds a Contact to the end of the ContactSet.
| |
AsReadOnly |
Returns a read-only IListT wrapper for the current ContactSet.
| |
Clear |
Removes and recycles all Contacts from the ContactSet.
| |
Contains |
Determines whether the ContactSet contains a specific Contact.
| |
CopyTo | ||
Create |
Creates an instance of the ContactSet class. (This method
reuses a previously recycled instance or allocates a new instance if necessary.)
| |
Equals | (Inherited from Object.) | |
GetEnumerator |
Returns an enumerator that iterates through the ContactSet.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf |
Determines the index of a specific Contact in the ContactSet.
| |
Insert |
Inserts an Contact in the ContactSet at the specified index.
| |
Recycle |
Recycles this instance of the ContactSet class.
| |
Recycle(Boolean) |
Recycles this instance of the ContactSet class.
| |
Remove |
Removes the first occurrence of a specific Contact from the
ContactSet.
| |
RemoveAt |
Removes the Contact at the specified index.
| |
Reset |
Resets this contact set to default values.
| |
ToString | (Overrides ObjectToString.) |
Name | Description | |
---|---|---|
AddRangeContact |
Adds the specified items to the ICollectionT.
(Defined by CollectionHelper.) | |
DoContact(ActionContact) | Overloaded.
Performs the given action on each element in a sequence when it is enumerated.
(Defined by LinqHelper.) | |
DoContact(ActionContact, Int32) | Overloaded.
Performs the given action on each element (incorporating its index) in a sequence when it is
enumerated.
(Defined by LinqHelper.) | |
ForEachContact(ActionContact) | Overloaded.
Immediately performs the given action on each element in a sequence.
(Defined by LinqHelper.) | |
ForEachContact(ActionContact, Int32) | Overloaded.
Immediately performs the given action on each element (incorporating its index) in a
sequence.
(Defined by LinqHelper.) | |
IndexOfContact |
Returns the index of the first element in a sequence that satisfies the specified condition.
(Defined by LinqHelper.) |
Name | Description | |
---|---|---|
Count |
Gets the number of Contacts contained in the ContactSet.
| |
HaveContact | ||
Item |
Gets or sets the Contact at the specified index.
| |
ObjectA |
Gets collision object A.
| |
ObjectB |
Gets collision object B.
| |
Swapped |
Name | Description | |
---|---|---|
ICollectionCopyTo | ||
IEnumerableContactGetEnumerator |
Returns an enumerator that iterates through the collection.
| |
IEnumerableGetEnumerator |
Returns an enumerator that iterates through a collection.
| |
ICollectionContactIsReadOnly |
Gets a value indicating whether the ICollectionT is read-only.
| |
ICollectionIsSynchronized |
Gets a value indicating whether access to the ICollection is synchronized
(thread safe).
| |
ICollectionSyncRoot |
Gets an object that can be used to synchronize access to the ICollection.
|
A ContactSet collects Contacts between two CollisionObjects. A CollisionDomain creates one ContactSet for each pair of touching objects.
Swapped Contact Sets: The order of ObjectA and ObjectB is determined in the collision detection when the contact set is created. When the collision detection returns a contact set with a method like GetContacts(objectA, objectB), the objects in the contact set could be swapped such that contactSet.ObjectA == objectB and contactSet.ObjectB == objectA. If your algorithms rely on the order of ObjectA and ObjectB, for example when the contact normal vectors are used, you need to manually check whether the objects are in the expected order. By calling the property Swapped you can get a copy of the contact set where ObjectA and ObjectB are swapped and all contacts are updated accordingly.