Must be CbEvent.WAKE or CbEvent.SLEEP.
CbType or OptionType filter, or null to match all bodies.
Called with a BodyCallback 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 bodies. Returns an OptionType representing the current include/exclude configuration.
The type of this listener (BODY, CONSTRAINT, INTERACTION, or PRE).
Listener for body lifecycle events.
Fires when a body matching the
optionsfilter wakes or sleeps.Valid events: CbEvent.WAKE, CbEvent.SLEEP.
Example
Fully modernized from nape-compiled.js lines 434–515.