Add octree to meshes of SDF geoms.
PiperOrigin-RevId: 777634862 Change-Id: I3210c2f8d73fd30ceecb0a11abd1d82e086b3d5d
This commit is contained in:
committed by
Copybara-Service
parent
106df98946
commit
5c1f1f9dba
@@ -631,6 +631,7 @@ struct mjModel_ {
|
||||
int nbvh; // number of total bounding volumes in all bodies
|
||||
int nbvhstatic; // number of static bounding volumes (aabb stored in mjModel)
|
||||
int nbvhdynamic; // number of dynamic bounding volumes (aabb stored in mjData)
|
||||
int noct; // number of total octree cells in all meshes
|
||||
int njnt; // number of joints
|
||||
int ngeom; // number of geoms
|
||||
int nsite; // number of sites
|
||||
@@ -764,6 +765,11 @@ struct mjModel_ {
|
||||
int* bvh_nodeid; // geom or elem id of node; -1: non-leaf (nbvh x 1)
|
||||
mjtNum* bvh_aabb; // local bounding box (center, size) (nbvhstatic x 6)
|
||||
|
||||
// octree spatial partitioning
|
||||
int* oct_depth; // depth in the octree (noct x 1)
|
||||
int* oct_child; // children of octree node (noct x 8)
|
||||
mjtNum* oct_aabb; // octree node bounding box (center, size) (noct x 6)
|
||||
|
||||
// joints
|
||||
int* jnt_type; // type of joint (mjtJoint) (njnt x 1)
|
||||
int* jnt_qposadr; // start addr in 'qpos' for joint's data (njnt x 1)
|
||||
@@ -951,6 +957,8 @@ struct mjModel_ {
|
||||
int* mesh_facenum; // number of faces (nmesh x 1)
|
||||
int* mesh_bvhadr; // address of bvh root (nmesh x 1)
|
||||
int* mesh_bvhnum; // number of bvh (nmesh x 1)
|
||||
int* mesh_octadr; // address of octree root (nmesh x 1)
|
||||
int* mesh_octnum; // number of octree nodes (nmesh x 1)
|
||||
int* mesh_normaladr; // first normal address (nmesh x 1)
|
||||
int* mesh_normalnum; // number of normals (nmesh x 1)
|
||||
int* mesh_texcoordadr; // texcoord data address; -1: no texcoord (nmesh x 1)
|
||||
|
||||
@@ -292,6 +292,7 @@ struct mjvOption_ { // abstract visualization options
|
||||
mjtByte skingroup[mjNGROUP]; // skin visualization by group
|
||||
mjtByte flags[mjNVISFLAG]; // visualization flags (indexed by mjtVisFlag)
|
||||
int bvh_depth; // depth of the bounding volume hierarchy to be visualized
|
||||
int oct_depth; // depth of the octree to be visualized
|
||||
int flex_layer; // element layer to be visualized for 3D flex
|
||||
};
|
||||
typedef struct mjvOption_ mjvOption;
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
X( nbvh ) \
|
||||
X( nbvhstatic ) \
|
||||
X( nbvhdynamic ) \
|
||||
X( noct ) \
|
||||
X( njnt ) \
|
||||
X( ngeom ) \
|
||||
X( nsite ) \
|
||||
@@ -216,6 +217,9 @@
|
||||
X ( int, bvh_child, nbvh, 2 ) \
|
||||
X ( int, bvh_nodeid, nbvh, 1 ) \
|
||||
X ( mjtNum, bvh_aabb, nbvhstatic, 6 ) \
|
||||
X ( int, oct_depth, noct, 1 ) \
|
||||
X ( int, oct_child, noct, 8 ) \
|
||||
X ( mjtNum, oct_aabb, noct, 6 ) \
|
||||
X ( int, jnt_type, njnt, 1 ) \
|
||||
X ( int, jnt_qposadr, njnt, 1 ) \
|
||||
X ( int, jnt_dofadr, njnt, 1 ) \
|
||||
@@ -390,6 +394,8 @@
|
||||
X ( int, mesh_facenum, nmesh, 1 ) \
|
||||
X ( int, mesh_bvhadr, nmesh, 1 ) \
|
||||
X ( int, mesh_bvhnum, nmesh, 1 ) \
|
||||
X ( int, mesh_octadr, nmesh, 1 ) \
|
||||
X ( int, mesh_octnum, nmesh, 1 ) \
|
||||
X ( int, mesh_graphadr, nmesh, 1 ) \
|
||||
X ( mjtNum, mesh_scale, nmesh, 3 ) \
|
||||
X ( mjtNum, mesh_pos, nmesh, 3 ) \
|
||||
|
||||
Reference in New Issue
Block a user