useContacts for per-frame contact queries, and useContactEvents for enter/exit transitions.
useContacts
Query contacts involving a specific body (or all contacts).Signature
Usage
With Callback
All Contacts
useContactEvents
Subscribe to contact enter/exit transitions for a body.Signature
Usage
ContactInfo
Notes
- Contact data is read from
data.contactevery physics frame - Geom names are cached to avoid repeated WASM string lookups — the cache clears on model change
useContactEventsdiffs the contact list between frames to detect transitions- Contact reads are wrapped in try/catch (can fail with large
ncon) - For a component-based API, see
<ContactListener>