nape-js API
    Preparing search index...

    Class ConstraintListener

    Listener for constraint lifecycle events.

    Fires when a constraint matching the options filter wakes, sleeps, or breaks.

    Valid events: CbEvent.WAKE, CbEvent.SLEEP, CbEvent.BREAK.

    A BREAK event fires when the constraint exceeds its maxForce or maxError limit. If removeOnBreak is true on the constraint it is also removed from the space.

    const listener = new ConstraintListener(
    CbEvent.BREAK,
    myConstraintType,
    (cb) => { console.log(cb.constraint, 'broke!'); },
    );
    space.listeners.add(listener);

    Fully modernized from nape-compiled.js lines 546–649.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods