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.
Execution priority of this listener relative to other listeners for the same event and objects. The direction depends on the listener type (inherited from Haxe nape):
BodyListener / ConstraintListener: higher values run first;
on a tie the listener added last runs first.InteractionListener / PreListener: lower values run first; on a
tie the listener added first runs first. When several PreListeners
return a flag for the same pair the last one called wins — so the
highest precedence has the final say.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