Contact visualization: if penetration is deeper than height, extend cylinder to show computed depth.

PiperOrigin-RevId: 693869892
Change-Id: I1c873e3803286d6a636336246f498552617e978b
This commit is contained in:
Yuval Tassa
2024-11-06 14:45:40 -08:00
committed by Copybara-Service
parent a2a0b95de0
commit 18f88efe17
+3 -1
View File
@@ -141,7 +141,9 @@ static void addContactGeom(const mjModel* m, mjData* d, const mjtByte* flags,
START
thisgeom->type = mjGEOM_CYLINDER;
thisgeom->size[0] = thisgeom->size[1] = m->vis.scale.contactwidth * scl;
thisgeom->size[2] = m->vis.scale.contactheight * scl;
float halfheight = m->vis.scale.contactheight * scl;
float halfdepth = -con->dist / 2;
thisgeom->size[2] = mjMAX(halfheight, halfdepth);
mju_n2f(thisgeom->pos, con->pos, 3);
mju_n2f(thisgeom->mat, mat, 9);