Must be CbEvent.BEGIN, CbEvent.ONGOING, or CbEvent.END.
The kind of interaction to listen for (COLLISION, SENSOR, FLUID, or ANY).
Filter for the first interactor, or null to match any.
Filter for the second interactor, or null to match any.
Called with an InteractionCallback each time the event fires.
Execution order relative to other listeners (higher = first). Default 0.
When true, ONGOING callbacks are also fired while both interactors are sleeping.
Default is false (callbacks are suppressed when both are asleep).
The callback function invoked when the event fires. Cannot be set to null.
The type of interaction this listener responds to (COLLISION, SENSOR, FLUID, or ANY).
Filter for the first interactor. Order between options1/options2 does not matter.
Filter for the second interactor. Order between options1/options2 does not matter.
The type of this listener (BODY, CONSTRAINT, INTERACTION, or PRE).
Listener for interaction events between two interactors.
Fires when two objects matching
options1andoptions2start, continue, or stop interacting with each other according tointeractionType.Valid events: CbEvent.BEGIN, CbEvent.ONGOING, CbEvent.END.
BEGINfires once when the interaction starts.ONGOINGfires every simulation step while the interaction persists.ENDfires once when the interaction ends.Example
Fully modernized from nape-compiled.js lines 659–1091.