Must be CbEvent.WAKE, CbEvent.SLEEP, or CbEvent.BREAK.
CbType or OptionType filter, or null to match all constraints.
Called with a ConstraintCallback each time the event fires.
Execution order relative to other listeners (higher = first). Default 0.
The callback function invoked when the event fires. Cannot be set to null.
The filter used to match constraints. Returns an OptionType representing the current include/exclude configuration.
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 constraint lifecycle events.
Fires when a constraint matching the
optionsfilter wakes, sleeps, or breaks.Valid events: CbEvent.WAKE, CbEvent.SLEEP, CbEvent.BREAK.
A
BREAKevent fires when the constraint exceeds itsmaxForceormaxErrorlimit. IfremoveOnBreakistrueon the constraint it is also removed from the space.Example