Add fields in mjModel for supporting mesh multicontact in nativeccd.

PiperOrigin-RevId: 728659204
Change-Id: I7f8a11b082640284ea009d8693f228078680b953
This commit is contained in:
Kyle Bayes
2025-02-19 07:11:25 -08:00
committed by Copybara-Service
parent b516edae1b
commit 7f3bb062c3
8 changed files with 166 additions and 17 deletions
+12
View File
@@ -624,6 +624,9 @@ struct mjModel_ {
int nmeshtexcoord; // number of texcoords in all meshes
int nmeshface; // number of triangular faces in all meshes
int nmeshgraph; // number of ints in mesh auxiliary data
int nmeshpoly; // number of polygons in all meshes
int nmeshpolyvert; // number of vertices in all polygons
int nmeshpolymap; // number of polygons in vertex map
int nskin; // number of skins
int nskinvert; // number of vertices in all skins
int nskintexvert; // number of vertiex with texcoords in all skins
@@ -930,6 +933,15 @@ struct mjModel_ {
mjtNum* mesh_pos; // translation applied to asset vertices (nmesh x 3)
mjtNum* mesh_quat; // rotation applied to asset vertices (nmesh x 4)
int* mesh_pathadr; // address of asset path for mesh; -1: none (nmesh x 1)
int* mesh_polynum; // number of polygons per mesh (nmesh x 1)
int* mesh_polyadr; // first polygon address per mesh (nmesh x 1)
mjtNum* mesh_polynormal; // all polygon normals (nmeshpoly x 3)
int* mesh_polyvertadr; // polygon vertex start address (nmeshpoly x 1)
int* mesh_polyvertnum; // number of vertices per polygon (nmeshpoly x 1)
int* mesh_polyvert; // all polygon vertices (nmeshpolyvert x 1)
int* mesh_polymapadr; // first polygon address per vertex (nmeshvert x 1)
int* mesh_polymapnum; // number of polygons per vertex (nmeshvert x 1)
int* mesh_polymap; // vertex to polygon map (nmeshpolymap x 1)
// skins
int* skin_matid; // skin material id; -1: none (nskin x 1)
+12
View File
@@ -96,6 +96,9 @@
X ( nmeshtexcoord ) \
X ( nmeshface ) \
X ( nmeshgraph ) \
X ( nmeshpoly ) \
X ( nmeshpolyvert ) \
X ( nmeshpolymap ) \
XMJV( nskin ) \
XMJV( nskinvert ) \
X ( nskintexvert ) \
@@ -393,6 +396,15 @@
XNV ( int, mesh_facetexcoord, nmeshface, 3 ) \
XNV ( int, mesh_graph, nmeshgraph, 1 ) \
XMJV( int, mesh_pathadr, nmesh, 1 ) \
X ( int, mesh_polynum, nmesh, 1 ) \
X ( int, mesh_polyadr, nmesh, 1 ) \
X ( mjtNum, mesh_polynormal, nmeshpoly, 3 ) \
X ( int, mesh_polyvertadr, nmeshpoly, 1 ) \
X ( int, mesh_polyvertnum, nmeshpoly, 1 ) \
X ( int, mesh_polyvert, nmeshpolyvert, 1 ) \
X ( int, mesh_polymapadr, nmeshvert, 1 ) \
X ( int, mesh_polymapnum, nmeshvert, 1 ) \
X ( int, mesh_polymap, nmeshpolymap, 1 ) \
XMJV( int, skin_matid, nskin, 1 ) \
XMJV( int, skin_group, nskin, 1 ) \
XMJV( float, skin_rgba, nskin, 4 ) \