@@ -2152,6 +2152,31 @@ defined. Its body name is automatically defined as "world".
21522152
21532153 See :ref: `implementation notes<siSleep> ` for more details.
21542154
2155+ .. _body-simple :
2156+
2157+ :at: `simple `: :at-val: `[false, auto], "auto" `
2158+ Controls the *simple body * optimization. When a body qualifies as "simple", its inertial matrix block in the mass
2159+ matrix is diagonal, representing independent translational and rotational degrees of freedom. The optimization
2160+ omits storing of the zero-valued off-diagonal entries, reducing memory footprint and computation.
2161+
2162+ A body qualifies for this optimization if it satisfies all of the following:
2163+
2164+ - **Inertial frame alignment **: The body's inertial frame coincides with its body frame.
2165+ - **Kinematic root **: The body's parent is either the world body or a static body.
2166+ - **Leaf body **: The body is a leaf node in the kinematic tree (it has no child bodies).
2167+ - **Origin-centered joints **: All joints belonging to this body must reside at the body's origin.
2168+ - **Aligned joint axes **: Any hinge or slide joint axes must be aligned with the local coordinate axes, and at most
2169+ one joint with rotational degrees of freedom (hinge or ball) is permitted.
2170+ - **No inertia-bearing tendons **: The body must not contain sites or geoms used as wrap objects by any tendon that
2171+ has non-zero :ref: `armature<tendon-spatial-armature> `.
2172+
2173+ Setting this attribute to :at-val: `false ` disables the optimization for this body. This is necessary for domain
2174+ randomization workflows where model parameters (such as joint/inertial offsets or angles) are perturbed dynamically
2175+ during simulation and updated via :ref: `mj_setConst `. Because a body compiled with the simple optimization active
2176+ cannot dynamically lose its simple state at runtime (which would require reallocation of sparse matrix structures),
2177+ any runtime parameter change that violates the simple conditions will trigger a validation error unless
2178+ ``simple="false" `` was explicitly declared in the XML.
2179+
21552180.. _body-user :
21562181
21572182:at: `user `: :at-val: `real(nbody_user), "0 0 ..." `
0 commit comments