Represents a collection of contact points between two entities in a physics collision.
When rigid bodies collide, this object stores the entity involved in the collision and
an array of specific contact points where the collision occurred. This information is
used by the physics system to resolve collisions and notify components through events.
Instances of this class are passed to event handlers for the contact and collisionstart
events on individual RigidBodyComponent and CollisionComponent instances.
Unlike SingleContactResult which is used for global contact events, ContactResult
objects provide information about collision from the perspective of one entity, with
information about which other entity was involved and all points of contact.
Contact results are pooled and reused by the physics system, so a result and its contact
points are only valid inside the event handler that receives them. Copy any values that are
needed later.
Please refer to the following event documentation for more information:
Represents a collection of contact points between two entities in a physics collision. When rigid bodies collide, this object stores the entity involved in the collision and an array of specific contact points where the collision occurred. This information is used by the physics system to resolve collisions and notify components through events.
Instances of this class are passed to event handlers for the
contactandcollisionstartevents on individual RigidBodyComponent and CollisionComponent instances.Unlike SingleContactResult which is used for global contact events, ContactResult objects provide information about collision from the perspective of one entity, with information about which other entity was involved and all points of contact.
Contact results are pooled and reused by the physics system, so a result and its contact points are only valid inside the event handler that receives them. Copy any values that are needed later.
Please refer to the following event documentation for more information: