Class ContactManifold
- Namespace
- Gravitas.CollisionHandling
- Assembly
- Gravitas.dll
Fixed-capacity deterministic contact manifold owned by one collision pair.
public sealed class ContactManifold : IEnumerable<ManifoldContact>, IEnumerable
- Inheritance
-
ContactManifold
- Implements
- Inherited Members
Constructors
ContactManifold()
public ContactManifold()
Fields
MaxContactCount
Maximum number of contacts retained by a 3D manifold.
public const int MaxContactCount = 4
Field Value
Properties
Count
Number of active contacts in this manifold.
public int Count { get; }
Property Value
HasContact
Gets whether this manifold currently contains narrow-phase contact data.
public bool HasContact { get; }
Property Value
this[int]
Gets the contact at the specified deterministic order index.
public ManifoldContact this[int index] { get; }
Parameters
indexint
Property Value
LastUpdatedFrame
Simulation frame in which the active contacts were last rebuilt.
public int LastUpdatedFrame { get; }
Property Value
PrimaryContact
Deepest contact in the manifold. Ties use the lowest contact identity.
public ManifoldContact PrimaryContact { get; }
Property Value
Methods
AddContact(Vector3d, Vector3d, Fixed64, Vector3d)
Adds a contact, keeping the deepest four contacts and exposing them by stable contact identity.
public void AddContact(Vector3d pointA, Vector3d pointB, Fixed64 depth, Vector3d normal)
Parameters
pointAVector3dpointBVector3ddepthFixed64normalVector3d
AddContact(ContactAnchor, ContactAnchor, Fixed64, Vector3d, bool)
Adds a rigid-frame contact, keeping the deepest four contacts and exposing them by stable anchor identity.
public void AddContact(ContactAnchor anchorA, ContactAnchor anchorB, Fixed64 depth, Vector3d normal, bool depthIsClamped = false)
Parameters
anchorAContactAnchoranchorBContactAnchordepthFixed64normalVector3ddepthIsClampedbool
BeginUpdate(int)
Clears contacts and records the frame for a new narrow-phase pass.
public void BeginUpdate(int frame)
Parameters
frameint
GetEnumerator()
Returns an allocation-free enumerator over the active contacts.
public ContactManifold.Enumerator GetEnumerator()
Returns
Reset()
Clears all contact data.
public void Reset()
SetContact(Vector3d, Vector3d, Fixed64, Vector3d)
Replaces the manifold with one contact.
public void SetContact(Vector3d pointA, Vector3d pointB, Fixed64 depth, Vector3d normal)
Parameters
pointAVector3dpointBVector3ddepthFixed64normalVector3d
SetContact(ContactAnchor, ContactAnchor, Fixed64, Vector3d, bool)
Replaces the manifold with one rigid-frame contact.
public void SetContact(ContactAnchor anchorA, ContactAnchor anchorB, Fixed64 depth, Vector3d normal, bool depthIsClamped = false)
Parameters
anchorAContactAnchoranchorBContactAnchordepthFixed64normalVector3ddepthIsClampedbool