Table of Contents

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

int

Properties

Count

Number of active contacts in this manifold.

public int Count { get; }

Property Value

int

HasContact

Gets whether this manifold currently contains narrow-phase contact data.

public bool HasContact { get; }

Property Value

bool

this[int]

Gets the contact at the specified deterministic order index.

public ManifoldContact this[int index] { get; }

Parameters

index int

Property Value

ManifoldContact

LastUpdatedFrame

Simulation frame in which the active contacts were last rebuilt.

public int LastUpdatedFrame { get; }

Property Value

int

PrimaryContact

Deepest contact in the manifold. Ties use the lowest contact identity.

public ManifoldContact PrimaryContact { get; }

Property Value

ManifoldContact

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

pointA Vector3d
pointB Vector3d
depth Fixed64
normal Vector3d

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

anchorA ContactAnchor
anchorB ContactAnchor
depth Fixed64
normal Vector3d
depthIsClamped bool

BeginUpdate(int)

Clears contacts and records the frame for a new narrow-phase pass.

public void BeginUpdate(int frame)

Parameters

frame int

GetEnumerator()

Returns an allocation-free enumerator over the active contacts.

public ContactManifold.Enumerator GetEnumerator()

Returns

ContactManifold.Enumerator

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

pointA Vector3d
pointB Vector3d
depth Fixed64
normal Vector3d

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

anchorA ContactAnchor
anchorB ContactAnchor
depth Fixed64
normal Vector3d
depthIsClamped bool