nape-js API
    Preparing search index...

    Class CollisionArbiter

    An arbiter representing a physical collision between two solid shapes.

    Provides access to contact points, collision normal, friction coefficients, elasticity, and impulse data. Properties marked mutable in pre-handler can only be set within a PreListener handler.

    Obtain via Arbiter.collisionArbiter or by casting from a callback's arbiter list.

    Fully modernized — uses extracted ZPP_ColArbiter directly.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get dynamicFriction(): number

      Dynamic (kinetic) friction coefficient — applied when the contact is sliding. Combined from the two shapes' material values. Mutable in pre-handler only.

      Returns number

    • set dynamicFriction(value: number): void

      Parameters

      • value: number

      Returns void

    • get elasticity(): number

      Coefficient of restitution (bounciness).

      Combined from the two shapes' elasticity values. Can be overridden inside a pre-handler. Must be >= 0.

      Mutable in pre-handler only.

      Returns number

    • set elasticity(value: number): void

      Parameters

      • value: number

      Returns void

    • get isSleeping(): boolean

      Whether both interacting bodies are currently sleeping. Throws if the arbiter is not active.

      Returns boolean

    Methods

    • Impulse applied in the normal (collision) direction, summed over all contacts.

      Parameters

      • body: Body | null = null

        One of the two bodies, or null for the combined value.

      • freshOnly: boolean = false

        Only include new contact points. Default false.

      Returns Vec3

    • Rolling impulse applied by this collision.

      Parameters

      • body: Body | null = null

        One of the two bodies, or null for the combined value.

      • freshOnly: boolean = false

        Only include new contact points. Default false.

      Returns number

    • Friction impulse applied in the tangent direction, summed over all contacts.

      Parameters

      • body: Body | null = null

        One of the two bodies, or null for the combined value.

      • freshOnly: boolean = false

        Only include new contact points. Default false.

      Returns Vec3