A state generated for ColliderComponent collision events.

interface Collision {
    collider: ColliderComponent;
    contactCount: number;
    contacts: Contact[];
    id: number;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

Primitive shapes that physics objects interact with, such as spheres, boxes, and meshes, or compound shapes formed from multiple shapes. Used with Physics, Hair Simulation and Cloth Simulation.

contactCount: number

The number of contact points in the collision.

contacts: Contact[]

Array of contacts in the collision.

id: number

ID of the collision, unique for this collider.

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean