Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 22.214.171.124 (126.96.36.19990)
[ObfuscationAttribute(Feature = "controlflow")] public sealed class Contact : IRecyclable
<ObfuscationAttribute(Feature := "controlflow")> _ Public NotInheritable Class Contact _ Implements IRecyclable
[ObfuscationAttribute(Feature = L"controlflow")] public ref class Contact sealed : IRecyclable
There are 4 types of contacts:
- Touching Contact: Object A and object B are touching at the surface. The PenetrationDepth is 0. The points on object A and object B are identical. Position, PositionAWorld, and PositionBWorld are identical.
- Penetrating Contact: Object A and object B are penetrating each other. The PenetrationDepth is greater than 0. PositionAWorld, and PositionBWorld are different and describe the points on object A and B that have maximum penetration. Position lies halfway between these two points.
Closest points (separated objects): Object A and object B are separated. They are not in contact. This can be the result of a closest-point query (see GetClosestPoints(CollisionObject, CollisionObject)). Normal contact queries such as GetContacts(CollisionObject, CollisionObject) or the contact queries performed inside a CollisionDomain ignore separated objects!
The PenetrationDepth is negative. The absolute value of PenetrationDepth indicates the distance between the object A and object B. (The "penetration depth" is the inverse of "separation distance".) PositionAWorld and PositionBWorld are the closest points between the two objects. Position lies halfway between the closest points.
Closest-point query is a special type of collision query. At first this might look confusing: Why does a closest-point query return a? The reason that contacts and closest points are represented by the same class is that the collision detection internally treats contacts and closest points the same way.
Ray Hit: Either object A or object B is a ray that hits the other object. The PenetrationDepth stores the distance from the ray origin to the contact position on the second object. The Normal describes the surface normal at the contact position.
(Ray hits can easily be found by checking whether the property IsRayHit is set in a .)