Skip to main content
A component wrapper for contact event subscriptions. Fires callbacks when a body starts or stops touching other bodies.

Usage

Props

string
required
Name of the MuJoCo body to monitor for contacts.
(info: ContactInfo) => void
Fired when a new contact begins (geom pair not in previous frame’s contacts).
(info: ContactInfo) => void
Fired when a contact ends (geom pair was in previous frame but not current).

ContactInfo

Example: Pickup Detection

Notes

  • This is a component wrapper around the useContactEvents hook
  • Contact transitions are computed by diffing the contact list frame-to-frame
  • Renders nothing visually