Define events supported by IPlayer and their corresponding parameters.

interface IPlayerEvents {
    collisionend: ((other: Entity) => void);
    collisionstart: ((result: ContactResult) => void);
    contact: ((result: ContactResult) => void);
}

Hierarchy (view full)

Properties

collisionend: ((other: Entity) => void)

Triggered when the player stops touching another rigid body.

Type declaration

    • (other): void
    • Parameters

      • other: Entity

        The rigid body entity that the player is no longer in contact with.

      Returns void

collisionstart: ((result: ContactResult) => void)

Triggered when the player starts touching another rigid body.

Type declaration

    • (result): void
    • Parameters

      • result: ContactResult

        Contains details of the contact between the player and the other rigid body.

      Returns void

contact: ((result: ContactResult) => void)

Triggered while the player is touching another rigid body.

Type declaration

    • (result): void
    • Parameters

      • result: ContactResult

        Contains details of the contact between the player and the other rigid body.

      Returns void