nape-js API
    Preparing search index...

    Class Arbiter

    Represents an active interaction between two shapes.

    Arbiters are created and pooled internally by the engine — they cannot be instantiated directly. Access them via:

    • space.arbiters — all active arbiters in the simulation
    • body.arbiters — arbiters involving a specific body
    • InteractionCallback.arbiters — arbiters in an interaction callback
    • PreCallback.arbiter — the arbiter in a pre-handler

    Use Arbiter.collisionArbiter or Arbiter.fluidArbiter to cast to a subtype for type-specific properties.

    Warning: do not hold references to Arbiter objects after the current simulation step — they are pooled and may be reused.

    Fully modernized — uses extracted ZPP_Arbiter directly.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get isSleeping(): boolean

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

      Returns boolean

    Methods

    • Total impulse applied by this arbiter in the last step as (fx, fy, torque).

      Pass a body to get the impulse applied specifically to that body. Pass freshOnly = true to include only new contact points (not persistent ones).

      Overridden by CollisionArbiter and FluidArbiter.

      Parameters

      • body: Body | null = null

        One of the two interacting bodies, or null for the combined impulse.

      • _freshOnly: boolean = false

        When true, only count fresh (new) contacts. Default false.

      Returns Vec3