Creates a new event collector.
setting this to true
is strongly recommended. If true, the collector will
be automatically drained before each world.step(collector)
. If false, the collector will
keep all events in memory unless it is manually drained/cleared; this may lead to unbounded use of
RAM if no drain is performed.
Optional
raw: RawEventQueueApplies the given javascript closure on each collision event of this collector, then clear the internal collision event buffer.
JavaScript closure applied to each collision event. The closure must take three arguments: two integers representing the handles of the colliders involved in the collision, and a boolean indicating if the collision started (true) or stopped (false).
Applies the given javascript closure on each contact force event of this collector, then clear the internal collision event buffer.
JavaScript closure applied to each collision event. The
closure must take one TempContactForceEvent
argument.
Generated using TypeDoc
A structure responsible for collecting events generated by the physics engine.
To avoid leaking WASM resources, this MUST be freed manually with
eventQueue.free()
once you are done using it.