nape-js API
    Preparing search index...

    Class UserConstraintAbstract

    Base class for user-defined N-DOF constraints.

    Fully modernized — uses ZPP_UserConstraint directly (extracted to TypeScript). Subclass and override the abstract callback methods to define custom constraints.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    debugDraw: boolean = true

    Accessors

    • get isSleeping(): boolean

      Whether the constraint's simulation component is currently sleeping.

      Only valid when the constraint is active and in a space — throws otherwise.

      Returns boolean

    • get maxForce(): number

      Maximum force (in Newtons) the constraint may apply per step.

      When the required force exceeds this value the constraint becomes slack. If breakUnderForce is true the constraint breaks instead. Must be >= 0. Infinity disables the limit.

      Returns number

      Infinity

    • set maxForce(value: number): void

      Parameters

      • value: number

      Returns void

    • get userData(): Record<string, unknown>

      Arbitrary user data attached to this constraint. Lazily initialized to {} on first access.

      Returns Record<string, unknown>

    Methods