Fix body category check for mocap body descendants in visualization.
PiperOrigin-RevId: 856179240 Change-Id: I29f4758fee0ff3b16d0b9f452c28e640b5558993
This commit is contained in:
committed by
Copybara-Service
parent
d387578783
commit
f3ad0eff2b
@@ -153,9 +153,9 @@ static void mixcolor(float rgba[4], const float ref[4], int flg1, int flg2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// a body is static if it is welded to the world and is not a mocap body
|
// a body is static if it is welded to the world and is not a mocap body or descendant thereof
|
||||||
static int bodycategory(const mjModel* m, int bodyid) {
|
static int bodycategory(const mjModel* m, int bodyid) {
|
||||||
if (m->body_weldid[bodyid] == 0 && m->body_mocapid[bodyid] == -1) {
|
if (m->body_weldid[bodyid] == 0 && m->body_mocapid[m->body_rootid[bodyid]] == -1) {
|
||||||
return mjCAT_STATIC;
|
return mjCAT_STATIC;
|
||||||
} else {
|
} else {
|
||||||
return mjCAT_DYNAMIC;
|
return mjCAT_DYNAMIC;
|
||||||
|
|||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<mujoco>
|
||||||
|
<worldbody>
|
||||||
|
<light pos="0 0 2"/>
|
||||||
|
<geom type="plane" size="1 1 0.1"/>
|
||||||
|
|
||||||
|
<body mocap="true">
|
||||||
|
<geom size=".1"/>
|
||||||
|
<body pos="0 0 .05">
|
||||||
|
<geom size=".1" pos="0 0 .1"/>
|
||||||
|
</body>
|
||||||
|
</body>
|
||||||
|
</worldbody>
|
||||||
|
</mujoco>
|
||||||
Reference in New Issue
Block a user