Add configurable octree max depth for meshes.

The maximum depth of the octree used for SDF generation can now be specified in the mesh definition via `mjsMesh::octree_maxdepth`. The default value is 6.

PiperOrigin-RevId: 912494999
Change-Id: I6d828d1d3999b99d1210a6829a05b04fac591e1f
This commit is contained in:
Alessio Quaglino
2026-05-08 06:35:07 -07:00
committed by Copybara-Service
parent 531a571dda
commit 8cef5bb978
9 changed files with 28 additions and 1 deletions
+7
View File
@@ -6246,6 +6246,12 @@ struct MjsMesh {
*(ptr_->material) = value;
}
}
int octree_maxdepth() const {
return ptr_->octree_maxdepth;
}
void set_octree_maxdepth(int value) {
ptr_->octree_maxdepth = value;
}
mjString info() const {
return (ptr_ && ptr_->info) ? *(ptr_->info) : "";
}
@@ -12782,6 +12788,7 @@ EMSCRIPTEN_BINDINGS(mujoco_bindings) {
.property("material", &MjsMesh::material, &MjsMesh::set_material, reference())
.property("maxhullvert", &MjsMesh::maxhullvert, &MjsMesh::set_maxhullvert, reference())
.property("needsdf", &MjsMesh::needsdf, &MjsMesh::set_needsdf, reference())
.property("octree_maxdepth", &MjsMesh::octree_maxdepth, &MjsMesh::set_octree_maxdepth, reference())
.property("plugin", &MjsMesh::plugin, reference())
.property("refpos", &MjsMesh::refpos)
.property("refquat", &MjsMesh::refquat)