diff --git a/src/engine/engine_vis_visualize.c b/src/engine/engine_vis_visualize.c index 3bd9f1a2..a9985c26 100644 --- a/src/engine/engine_vis_visualize.c +++ b/src/engine/engine_vis_visualize.c @@ -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) { - 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; } else { return mjCAT_DYNAMIC; diff --git a/test/engine/testdata/vis_visualize/mocap.xml b/test/engine/testdata/vis_visualize/mocap.xml new file mode 100644 index 00000000..f1675e00 --- /dev/null +++ b/test/engine/testdata/vis_visualize/mocap.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + +