API

Interface IPhysicsCollisionEvent

Collision object that is the parameter when notification for collision fires.

interface IPhysicsCollisionEvent {
    collidedAgainst: PhysicsBody;
    collidedAgainstIndex: number;
    collider: PhysicsBody;
    colliderIndex: number;
    distance: number;
    impulse: number;
    normal: Nullable<Vector3>;
    point: Nullable<Vector3>;
    type: PhysicsEventType;
}

Hierarchy (View Summary)

Index
collidedAgainst: PhysicsBody

2nd physics body that collided

collidedAgainstIndex: number

index in instances array for the collidedAgainst

collider: PhysicsBody

1st physics body that collided

colliderIndex: number

index in instances array for the collider

distance: number

Penetration distance

impulse: number

Impulse value computed by the solver response

normal: Nullable<Vector3>

Collision world normal direction

World position where the collision occurred

Event type