nape-js API
    Preparing search index...

    Class InteractionListener

    Listener for interaction events between two interactors.

    Fires when two objects matching options1 and options2 start, continue, or stop interacting with each other according to interactionType.

    Valid events: CbEvent.BEGIN, CbEvent.ONGOING, CbEvent.END.

    • BEGIN fires once when the interaction starts.
    • ONGOING fires every simulation step while the interaction persists.
    • END fires once when the interaction ends.
    const listener = new InteractionListener(
    CbEvent.BEGIN,
    InteractionType.COLLISION,
    playerType,
    groundType,
    (cb) => { console.log('player landed'); },
    );
    space.listeners.add(listener);

    Fully modernized from nape-compiled.js lines 659–1091.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods