Add Flex component.

PiperOrigin-RevId: 572830650
Change-Id: I6908228087b7b9683be3506c8d9cdc725ed5dcd5
This commit is contained in:
Alessio Quaglino
2023-10-12 10:15:46 +01:00
committed by Saran Tunyasuvunakool
parent 649a474788
commit 5a70ad08ab
82 changed files with 9658 additions and 1581 deletions
+76 -7
View File
@@ -58,7 +58,8 @@
X( wind, 3 ) \
X( magnetic, 3 ) \
X( o_solref, mjNREF ) \
X( o_solimp, mjNIMP )
X( o_solimp, mjNIMP ) \
X( o_friction, 5 )
//-------------------------------- mjModel ---------------------------------------------------------
@@ -71,11 +72,21 @@
XMJV( na ) \
XMJV( nbody ) \
XMJV( nbvh ) \
XMJV( nbvhstatic ) \
X ( nbvhdynamic ) \
XMJV( njnt ) \
XMJV( ngeom ) \
XMJV( nsite ) \
XMJV( ncam ) \
XMJV( nlight ) \
XMJV( nflex ) \
XMJV( nflexvert ) \
X ( nflexedge ) \
X ( nflexelem ) \
X ( nflexelemdata ) \
X ( nflexshelldata ) \
X ( nflexevpair ) \
X ( nflextexcoord ) \
XMJV( nmesh ) \
X ( nmeshvert ) \
X ( nmeshnormal ) \
@@ -185,14 +196,17 @@
XMJV( mjtNum, body_inertia, nbody, 3 ) \
X ( mjtNum, body_invweight0, nbody, 2 ) \
X ( mjtNum, body_gravcomp, nbody, 1 ) \
X ( mjtNum, body_margin, nbody, 1 ) \
X ( mjtNum, body_user, nbody, MJ_M(nuser_body) ) \
X ( int, body_plugin, nbody, 1 ) \
X ( int, body_contype, nbody, 1 ) \
X ( int, body_conaffinity, nbody, 1 ) \
XMJV( int, body_bvhadr, nbody, 1 ) \
XMJV( int, body_bvhnum, nbody, 1 ) \
XMJV( int, bvh_depth, nbvh, 1 ) \
XMJV( int, bvh_child, nbvh, 2 ) \
XMJV( int, bvh_geomid, nbvh, 1 ) \
XMJV( mjtNum, bvh_aabb, nbvh, 6 ) \
XMJV( int, bvh_nodeid, nbvh, 1 ) \
XMJV( mjtNum, bvh_aabb, nbvhstatic, 6 ) \
XMJV( int, jnt_type, njnt, 1 ) \
X ( int, jnt_qposadr, njnt, 1 ) \
X ( int, jnt_dofadr, njnt, 1 ) \
@@ -288,6 +302,55 @@
XMJV( float, light_ambient, nlight, 3 ) \
XMJV( float, light_diffuse, nlight, 3 ) \
XMJV( float, light_specular, nlight, 3 ) \
X ( int, flex_contype, nflex, 1 ) \
X ( int, flex_conaffinity, nflex, 1 ) \
X ( int, flex_condim, nflex, 1 ) \
X ( int, flex_priority, nflex, 1 ) \
X ( mjtNum, flex_solmix, nflex, 1 ) \
X ( mjtNum, flex_solref, nflex, mjNREF ) \
X ( mjtNum, flex_solimp, nflex, mjNIMP ) \
X ( mjtNum, flex_friction, nflex, 3 ) \
X ( mjtNum, flex_margin, nflex, 1 ) \
X ( mjtNum, flex_gap, nflex, 1 ) \
X ( mjtByte, flex_internal, nflex, 1 ) \
X ( int, flex_selfcollide, nflex, 1 ) \
X ( int, flex_activelayers, nflex, 1 ) \
XMJV( int, flex_dim, nflex, 1 ) \
XMJV( int, flex_matid, nflex, 1 ) \
XMJV( int, flex_group, nflex, 1 ) \
XMJV( int, flex_vertadr, nflex, 1 ) \
XMJV( int, flex_vertnum, nflex, 1 ) \
X ( int, flex_edgeadr, nflex, 1 ) \
X ( int, flex_edgenum, nflex, 1 ) \
XMJV( int, flex_elemadr, nflex, 1 ) \
XMJV( int, flex_elemnum, nflex, 1 ) \
XMJV( int, flex_elemdataadr, nflex, 1 ) \
XMJV( int, flex_shellnum, nflex, 1 ) \
XMJV( int, flex_shelldataadr, nflex, 1 ) \
X ( int, flex_evpairadr, nflex, 1 ) \
X ( int, flex_evpairnum, nflex, 1 ) \
X ( int, flex_texcoordadr, nflex, 1 ) \
X ( int, flex_vertbodyid, nflexvert, 1 ) \
X ( int, flex_edge, nflexedge, 2 ) \
XMJV( int, flex_elem, nflexelemdata, 1 ) \
X ( int, flex_elemlayer, nflexelem, 1 ) \
XMJV( int, flex_shell, nflexshelldata,1 ) \
X ( int, flex_evpair, nflexevpair, 2 ) \
X ( mjtNum, flex_vert, nflexvert, 3 ) \
X ( mjtNum, flex_xvert0, nflexvert, 3 ) \
X ( mjtNum, flexedge_length0, nflexedge, 1 ) \
X ( mjtNum, flexedge_invweight0, nflexedge, 1 ) \
XMJV( mjtNum, flex_radius, nflex, 1 ) \
X ( mjtNum, flex_edgestiffness, nflex, 1 ) \
X ( mjtNum, flex_edgedamping, nflex, 1 ) \
X ( mjtByte, flex_edgeequality, nflex, 1 ) \
X ( mjtByte, flex_rigid, nflex, 1 ) \
X ( mjtByte, flex_centered, nflex, 1 ) \
XMJV( mjtByte, flex_flatskin, nflex, 1 ) \
XMJV( int, flex_bvhadr, nflex, 1 ) \
XMJV( int, flex_bvhnum, nflex, 1 ) \
XMJV( float, flex_rgba, nflex, 4 ) \
X ( float, flex_texcoord, nflextexcoord, 2 ) \
X ( int, mesh_vertadr, nmesh, 1 ) \
X ( int, mesh_vertnum, nmesh, 1 ) \
X ( int, mesh_normaladr, nmesh, 1 ) \
@@ -456,6 +519,7 @@
XMJV( int, name_siteadr, nsite, 1 ) \
XMJV( int, name_camadr, ncam, 1 ) \
XMJV( int, name_lightadr, nlight, 1 ) \
X ( int, name_flexadr, nflex, 1 ) \
X ( int, name_meshadr, nmesh, 1 ) \
X ( int, name_skinadr, nskin, 1 ) \
X ( int, name_hfieldadr, nhfield, 1 ) \
@@ -522,6 +586,13 @@
XMJV( mjtNum, subtree_com, nbody, 3 ) \
X ( mjtNum, cdof, nv, 6 ) \
X ( mjtNum, cinert, nbody, 10 ) \
XMJV( mjtNum, flexvert_xpos, nflexvert, 3 ) \
X ( mjtNum, flexelem_aabb, nflexelem, 6 ) \
X ( int, flexedge_J_rownnz, nflexedge, 1 ) \
X ( int, flexedge_J_rowadr, nflexedge, 1 ) \
X ( int, flexedge_J_colind, nflexedge, MJ_M(nv) ) \
X ( mjtNum, flexedge_J, nflexedge, MJ_M(nv) ) \
X ( mjtNum, flexedge_length, nflexedge, 1 ) \
XMJV( int, ten_wrapadr, ntendon, 1 ) \
XMJV( int, ten_wrapnum, ntendon, 1 ) \
X ( int, ten_J_rownnz, ntendon, 1 ) \
@@ -538,7 +609,9 @@
X ( mjtNum, qLD, nM, 1 ) \
X ( mjtNum, qLDiagInv, nv, 1 ) \
X ( mjtNum, qLDiagSqrtInv, nv, 1 ) \
X ( mjtNum, bvh_aabb_dyn, nbvhdynamic, 6 ) \
XMJV( mjtByte, bvh_active, nbvh, 1 ) \
X ( mjtNum, flexedge_velocity, nflexedge, 1 ) \
X ( mjtNum, ten_velocity, ntendon, 1 ) \
X ( mjtNum, actuator_velocity, nu, 1 ) \
X ( mjtNum, cvel, nbody, 6 ) \
@@ -644,10 +717,6 @@
X( int, maxuse_con ) \
X( int, maxuse_efc ) \
X( int, solver_nisland ) \
X( int, nbodypair_broad ) \
X( int, nbodypair_narrow ) \
X( int, ngeompair_mid ) \
X( int, ngeompair_narrow ) \
X( int, ne ) \
X( int, nf ) \
X( int, nl ) \