Skip to content

PhysicsBodyComponent.GetContacts Method

Definition

Namespace: Brine2D.ECS.Components

Overloads
GetContacts\(Span<ContactPair>\) Reads the live contact manifolds for this body directly from Box2D, written into results. Returns the number of contacts written. Returns 0 if the body is not live, has no active contacts, or the component has not been registered with a PhysicsWorld.
GetContacts\(Span<ContactPair>, bool\) Reads the live contact manifolds for this body directly from Box2D, written into results. Returns the number of contacts written. Returns 0 if the body is not live, has no active contacts, or the component has not been registered with a PhysicsWorld.

PhysicsBodyComponent.GetContacts\(Span\<ContactPair\>\) Method

Reads the live contact manifolds for this body directly from Box2D, written into results. Returns the number of contacts written. Returns 0 if the body is not live, has no active contacts, or the component has not been registered with a PhysicsWorld.

C#
public int GetContacts(System.Span<Brine2D.Physics.ContactPair> results);

Parameters

results System.Span<ContactPair>

Returns

System.Int32

Remarks

Contact normals are oriented away from the other body toward this body. Delegates to GetContacts\(PhysicsBodyComponent, Span<ContactPair>, bool\).

PhysicsBodyComponent.GetContacts\(Span\<ContactPair\>, bool\) Method

Reads the live contact manifolds for this body directly from Box2D, written into results. Returns the number of contacts written. Returns 0 if the body is not live, has no active contacts, or the component has not been registered with a PhysicsWorld.

C#
public int GetContacts(System.Span<Brine2D.Physics.ContactPair> results, out bool wasTruncated);

Parameters

results System.Span<ContactPair>

wasTruncated System.Boolean

Returns

System.Int32

Remarks

Contact normals are oriented away from the other body toward this body. Delegates to GetContacts\(PhysicsBodyComponent, Span<ContactPair>, bool\).