Click or drag to resize
DigitalRuneContactHelperMerge Method (ContactSet, Contact, CollisionQueryType, Single)
Merges a new contact into the given contact set.

Namespace: DigitalRune.Geometry.Collisions
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public static void Merge(
	ContactSet contactSet,
	Contact newContact,
	CollisionQueryType type,
	float contactPositionTolerance
)

Parameters

contactSet
Type: DigitalRune.Geometry.CollisionsContactSet
The contact set. (Must not be .)
newContact
Type: DigitalRune.Geometry.CollisionsContact
The contact. (Must not be .)
type
Type: DigitalRune.Geometry.CollisionsCollisionQueryType
The type of collision query.
contactPositionTolerance
Type: SystemSingle
The contact position tolerance.
Exceptions
ExceptionCondition
ArgumentNullExceptioncontactSet is .
Remarks

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.

See Also