Struct RigidBodyData
Low-level simulation state for a RigidBody, stored in unmanaged memory.
public struct RigidBodyData
- Inherited Members
Remarks
This structure is layout-sensitive and intended for internal engine use. Prefer using RigidBody properties instead of accessing fields directly. All spatial values (position, velocity, orientation, inertia) are in world space. The Flags field is a bitfield: bits 0–1 encode MotionType, bit 2 indicates active state, bit 3 enables gyroscopic forces, and bits 4–9 encode motion locks.
Fields
AngularVelocity
Angular velocity in world space, measured in radians per second. The vector direction is the rotation axis, and its magnitude is the rotation speed.
public JVector AngularVelocity
Field Value
DeltaAngularVelocity
Angular velocity change applied each substep (from torques), prepared at the end of the previous step. Internal use only.
public JVector DeltaAngularVelocity
Field Value
DeltaVelocity
Linear velocity change applied each substep (from forces and gravity), prepared at the end of the previous step. Internal use only.
public JVector DeltaVelocity
Field Value
Flags
Bitfield encoding motion type (bits 0–1), active state (bit 2), gyroscopic forces (bit 3), and locked world-space degrees of freedom (bits 4–9). Use the corresponding properties instead of manipulating this directly.
public int Flags
Field Value
InverseInertiaWorld
Inverse inertia tensor in world space. For dynamic bodies, this is recomputed each step from the body-space inverse inertia and current orientation. Locked angular axes are eliminated with Schur complements to preserve the remaining inertia response. For static and kinematic bodies, this is zero (representing infinite inertia).
public JSymmetricMatrix InverseInertiaWorld
Field Value
InverseMassVector
World-space diagonal inverse mass, including the body's translation locks. Static and kinematic bodies have zero inverse mass on every axis.
public JVector InverseMassVector
Field Value
Remarks
Custom constraints should use
Multiply(in JVector, in JVector) with InverseMassVector
for impulses. The linear contribution to effective inverse mass along a direction
is JVector.Multiply(direction, InverseMassVector) * direction.
Orientation
World-space orientation of the rigid body.
public JQuaternion Orientation
Field Value
Position
World-space position of the rigid body (center of mass).
public JVector Position
Field Value
Velocity
Linear velocity in world space, measured in units per second.
public JVector Velocity
Field Value
_index
Internal index used by the engine for handle management. Not stable across frames.
public int _index
Field Value
_lockFlag
Internal synchronization flag used by the engine. Do not modify.
public int _lockFlag
Field Value
Properties
AllowedMotion
Permitted world-space motion. Set through AllowedMotion.
public readonly MotionAxes AllowedMotion { get; }
Property Value
EnableGyroscopicForces
Gets or sets whether the implicit gyroscopic torque solver is enabled. See EnableGyroscopicForces for details.
public bool EnableGyroscopicForces { readonly get; set; }
Property Value
IsActive
Gets or sets whether the body is active (awake) and participating in simulation. Inactive bodies are considered sleeping and skip integration until reactivated.
public bool IsActive { readonly get; set; }
Property Value
IsStaticOrInactive
Returns true if the body is not dynamic or currently inactive (sleeping).
[Obsolete("Use MotionType directly.", true)]
public bool IsStaticOrInactive { get; }
Property Value
MotionType
Gets or sets how this body participates in the simulation. Encoded in bits 0–1 of Flags.
public MotionType MotionType { get; set; }