Unity Plugin: Accessing contact and collision data #144
-
Are there any available collision callbacks?
I imagine I'm missing something but I can't find anything in the code or docs that suggest any other way. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you want to know when whether a specific geom is touching anything, you can create a site that envelopes it, assign a touch sensor to the site, and read the sensor value (which, in this case, will be the normal force). If you want the list of geoms in contact with a certain geom, you would indeed have to scan the list of Invoking collision detection manually is possible in principle (this is where the specific collision callbacks reside, and here there's some explanation how it works). Particularly, if you want to know whether a specific pair of geoms is in contact, the MuJoCo Way would be to define a
See also #123. Does this explanation cover your intended use-case? |
Beta Was this translation helpful? Give feedback.
If you want to know when whether a specific geom is touching anything, you can create a site that envelopes it, assign a touch sensor to the site, and read the sensor value (which, in this case, will be the normal force).
If you want the list of geoms in contact with a certain geom, you would indeed have to scan the list of
Data->contact
to find that out.Invoking collision detection manually is possible in principle (this is where the specific collision callbacks reside, and here there's some explanation how it works). Particularly, if you want to know whether a specific pair of geoms is in contact, the MuJoCo Way would be to define a
pair
and force collision detection on this pair at ev…