Change mj_ray behaviour to match geom visualisation conventions:
- Planes and height-fields respect `mj_ray`'s `geom_group` argument. - The `flg_static` argument now applies to all static geoms, not only those directly in the world body. Before this change: - Rays always intersected with height fields and planes, unless `flg_static` was set to 0. - `flg_static` only applied to static geoms that were direct children of the world, but not geoms that were children of static bodies. PiperOrigin-RevId: 534969091 Change-Id: I8dc7c320c63d6af95709b9f5e83a3c50e1c199fa
This commit is contained in:
committed by
Copybara-Service
parent
55c7f45dc5
commit
c66d79409c
@@ -82,15 +82,10 @@ static int ray_eliminate(const mjModel* m, const mjData* d, int geomid,
|
||||
}
|
||||
|
||||
// static exclusion
|
||||
if (!flg_static && m->geom_bodyid[geomid]==0) {
|
||||
if (!flg_static && m->body_weldid[m->geom_bodyid[geomid]]==0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// plane and hfield inclusion
|
||||
if (m->geom_type[geomid]==mjGEOM_PLANE || m->geom_type[geomid]==mjGEOM_HFIELD) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// no geomgroup inclusion
|
||||
if (!geomgroup) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user