nape-js API
    Preparing search index...

    Class FluidArbiter

    An arbiter representing a fluid interaction between a fluid shape and a body.

    Provides access to buoyancy and drag impulses, the overlap area, and the centre of overlap. Properties marked mutable in pre-handler can only be set within a PreListener handler.

    Obtain via Arbiter.fluidArbiter or by casting from a callback arbiter.

    Fully modernized — uses extracted ZPP_FluidArbiter 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

    • get overlap(): number

      Area of the overlap region in pixels². Used to compute buoyancy force. Must be strictly positive and finite. Mutable in pre-handler only.

      Returns number

    • set overlap(value: number): void

      Parameters

      • value: number

      Returns void

    Methods

    • Buoyancy impulse applied in the last step as (fx, fy, torque).

      Parameters

      • body: Body | null = null

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

      Returns Vec3

    • Linear and angular drag impulse applied in the last step as (fx, fy, torque).

      Parameters

      • body: Body | null = null

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

      Returns Vec3