Struct Collision
Contains a collision information passed to the OnCollisionEnter/OnCollisionExit events.
Assembly: FlaxEngine.dll
File: Engine/Physics/Collisions.h
Syntax
public struct Collision
Fields
Contacts
The contacts locations.
Declaration
public ContactPoint Contacts[COLLISION_NAX_CONTACT_POINTS]
Field Value
ContactPoint
|
ContactsCount
The amount of valid contact points (less or equal to COLLISION_NAX_CONTACT_POINTS).
Declaration
public int32 ContactsCount
Field Value
int32
|
Impulse
The total impulse applied to this contact pair to resolve the collision.
The total impulse is obtained by summing up impulses applied at all contact points in this collision pair.
Declaration
public Vector3 Impulse
Field Value
Vector3
|
OtherActor
The second collider (other instance).
Declaration
public PhysicsColliderActor* OtherActor
Field Value
PhysicsColliderActor
|
OtherVelocity
The linear velocity of the second colliding object (other instance).
Declaration
public Vector3 OtherVelocity
Field Value
Vector3
|
ThisActor
The first collider (this instance).
Declaration
public PhysicsColliderActor* ThisActor
Field Value
PhysicsColliderActor
|
ThisVelocity
The linear velocity of the first colliding object (this instance).
Declaration
public Vector3 ThisVelocity
Field Value
Vector3
|
Methods
GetRelativeVelocity()
Gets the relative linear velocity of the two colliding objects.
Can be used to detect stronger collisions.
Declaration
public Vector3 GetRelativeVelocity() const
Returns
Vector3
|
SwapObjects()
Swaps the colliding objects (swaps A with B).
Declaration
public void SwapObjects()