Add octree to meshes of SDF geoms.

PiperOrigin-RevId: 777634862
Change-Id: I3210c2f8d73fd30ceecb0a11abd1d82e086b3d5d
This commit is contained in:
Alessio Quaglino
2025-06-30 10:49:08 -07:00
committed by Copybara-Service
parent 106df98946
commit 5c1f1f9dba
17 changed files with 369 additions and 12 deletions
+50
View File
@@ -873,6 +873,11 @@ STRUCTS: Mapping[str, StructDecl] = dict([
type=ValueType(name='int'),
doc='number of dynamic bounding volumes (aabb stored in mjData)', # pylint: disable=line-too-long
),
StructFieldDecl(
name='noct',
type=ValueType(name='int'),
doc='number of total octree cells in all meshes',
),
StructFieldDecl(
name='njnt',
type=ValueType(name='int'),
@@ -1560,6 +1565,30 @@ STRUCTS: Mapping[str, StructDecl] = dict([
doc='local bounding box (center, size)',
array_extent=('nbvhstatic', 6),
),
StructFieldDecl(
name='oct_depth',
type=PointerType(
inner_type=ValueType(name='int'),
),
doc='depth in the octree',
array_extent=('noct',),
),
StructFieldDecl(
name='oct_child',
type=PointerType(
inner_type=ValueType(name='int'),
),
doc='children of octree node',
array_extent=('noct', 8),
),
StructFieldDecl(
name='oct_aabb',
type=PointerType(
inner_type=ValueType(name='mjtNum'),
),
doc='octree node bounding box (center, size)',
array_extent=('noct', 6),
),
StructFieldDecl(
name='jnt_type',
type=PointerType(
@@ -2920,6 +2949,22 @@ STRUCTS: Mapping[str, StructDecl] = dict([
doc='number of bvh',
array_extent=('nmesh',),
),
StructFieldDecl(
name='mesh_octadr',
type=PointerType(
inner_type=ValueType(name='int'),
),
doc='address of octree root',
array_extent=('nmesh',),
),
StructFieldDecl(
name='mesh_octnum',
type=PointerType(
inner_type=ValueType(name='int'),
),
doc='number of octree nodes',
array_extent=('nmesh',),
),
StructFieldDecl(
name='mesh_normaladr',
type=PointerType(
@@ -6873,6 +6918,11 @@ STRUCTS: Mapping[str, StructDecl] = dict([
type=ValueType(name='int'),
doc='depth of the bounding volume hierarchy to be visualized',
),
StructFieldDecl(
name='oct_depth',
type=ValueType(name='int'),
doc='depth of the octree to be visualized',
),
StructFieldDecl(
name='flex_layer',
type=ValueType(name='int'),
+1
View File
@@ -1110,6 +1110,7 @@ This is useful for example when the MJB is not available as a file on disk.)"));
X(label);
X(frame);
X(bvh_depth);
X(oct_depth);
X(flex_layer);
#undef X