Rigid Body Mass#
Code |
RB.007 |
|---|---|
Validator |
|
Compatibility |
open-usd |
Tags |
💎 |
Summary#
Rigid bodies or their descendant collision shapes must have a mass specification.
Description#
Rigid bodies or their descendent collision shapes must have a mass specification using the physics:mass attribute. The mass unit is specified in kilograms per unit.
Note
The collider search that satisfies this requirement does not cross into nested
rigid bodies: a descendant carrying its own PhysicsRigidBodyAPI (and its subtree)
is validated on its own and does not contribute mass to its ancestor. When a rigid
body has no physics:mass of its own, every collider it owns must carry a mass.
This requirement owns the mass location rule; the values of authored mass
properties are validated separately by rigid-body-detailed-mass (RB.008).
Why is it required?#
If mass is not specified, simulators will compute mass automatically. This is often inaccurate as objects are modelled without internal details. Specifying mass allows for more accurate simulation.
Examples#
# Invalid: No mass specified
def Xform "RobotHead" (
prepend apiSchemas = ["PhysicsRigidBodyAPI"]
) {
def Mesh "Head" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
) {
}
# Valid: Mass specified
def Cube "Jaw" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
) {
physics:mass = 1.0
}
}
# Valid: Mass specified on Rigid Body
def Xform "RobotBody" (
prepend apiSchemas = ["PhysicsRigidBodyAPI", "PhysicsMassAPI"]
) {
physics:mass = 1.0
def Mesh "Body" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
) {
}
def Cube "Leg" (
prepend apiSchemas = ["PhysicsCollisionAPI"]
) {
}
}
How to comply#
Add the
physics:massattribute to the rigid body.