Class CollisionInfo3D
Generic contact between colliders, always using Vector3 as the engine allows mixed 2D/3D contacts. Note: This is a class because it is shared between the two colliders. Maybe a struct would be faster?.
Namespace: Evergine.Framework.Physics3D
Assembly: Evergine.Framework.dll
Syntax
public abstract class CollisionInfo3D
Constructors
CollisionInfo3D()
Initializes a new instance of the CollisionInfo3D class.
Declaration
public CollisionInfo3D()
Properties
Id
Gets the contact info ID.
Declaration
public abstract int Id { get; }
Property Value
Type | Description |
---|---|
int |
NumContacts
Gets the number of contacts.
Declaration
public abstract int NumContacts { get; }
Property Value
Type | Description |
---|---|
int |
OtherBody
Gets Collider B.
Declaration
public abstract PhysicBody3D OtherBody { get; }
Property Value
Type | Description |
---|---|
PhysicBody3D |
State
Gets the collision state.
Declaration
public abstract CollisionInfo3DState State { get; }
Property Value
Type | Description |
---|---|
CollisionInfo3DState |
ThisBody
Gets the Collider A.
Declaration
public abstract PhysicBody3D ThisBody { get; }
Property Value
Type | Description |
---|---|
PhysicBody3D |
Methods
GetContact(int, out ContactPoint3D)
Gets the contact point at the specific index.
Declaration
public abstract bool GetContact(int index, out ContactPoint3D contact)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the contact to retrieve. |
ContactPoint3D | contact | The retrieved contact. |
Returns
Type | Description |
---|---|
bool | True if the contact has been successfully retrieved. |
GetContacts(ContactPoint3D[])
Retrieve all contact points for this collision.
Declaration
public abstract int GetContacts(ContactPoint3D[] contacts)
Parameters
Type | Name | Description |
---|---|---|
ContactPoint3D[] | contacts | Array of contacts used to retrieve the results. |
Returns
Type | Description |
---|---|
int | The number of contacts retrieved in the array. |
GetContacts(ICollection<ContactPoint3D>)
Retrieves all contact points for this collision.
Declaration
public abstract void GetContacts(ICollection<ContactPoint3D> contacts)
Parameters
Type | Name | Description |
---|---|---|
ICollection<ContactPoint3D> | contacts | A collection of contacts used to retrieve the results. |
Remarks
The collection is not cleared.