ContactHelperMerge Method (ContactSet, Contact, CollisionQueryType, Single) |
Namespace: DigitalRune.Geometry.Collisions
public static void Merge( ContactSet contactSet, Contact newContact, CollisionQueryType type, float contactPositionTolerance )
Exception | Condition |
---|---|
ArgumentNullException | contactSet is . |
This method adds the given contact by merging it with an existing contact or by simply adding it to contactSet. A contact is merged with an existing one if the difference of the contact positions is less than the contactPositionTolerance and the contact features are identical. Contacts of ray casts are always merged with existing contacts of the same features (contactPositionTolerance is not checked in this case).
This method must not be called for Boolean ("HaveContact") queries since boolean queries do not normally change contact information.
For shapes where contacts are computed for child shapes, the feature (FeatureA or FeatureB) must be set correctly in newContact. For example, this is necessary for CompositeShape, TriangleMeshShape, HeightField and similar shapes.
Important: The newContact will be recycled and cannot be accessed after this method call.