Add SDF geom to test/testdata/model.xml.

Also, when a mesh has both an octree and a bvh, render only the octree.

PiperOrigin-RevId: 790680831
Change-Id: Iaf3896933f6728af4db1eaa83ff5b06558ab0d19
This commit is contained in:
Alessio Quaglino
2025-08-04 03:52:37 -07:00
committed by Copybara-Service
parent 100b1a06fd
commit 7baaa39846
2 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -764,7 +764,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
for (int geomid = 0; geomid < m->ngeom; geomid++) {
int meshid = m->geom_dataid[geomid];
// skip if not a mesh or if there is an octree
if (m->geom_type[geomid] == mjGEOM_SDF || meshid == -1 || m->mesh_octadr[meshid] >= 0) {
if (meshid == -1 || m->geom_type[geomid] == mjGEOM_SDF || m->mesh_octadr[meshid] >= 0) {
continue;
}
@@ -813,7 +813,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
if (vopt->flags[mjVIS_MESHBVH]) {
for (int geomid = 0; geomid < m->ngeom; geomid++) {
int meshid = m->geom_dataid[geomid];
if (meshid == -1 || (m->geom_type[geomid] == mjGEOM_MESH && m->mesh_octadr[meshid] == -1)) {
if (meshid == -1 || m->geom_type[geomid] == mjGEOM_HFIELD || m->mesh_octadr[meshid] == -1) {
continue;
}