@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / RigidbodyState
Type Alias: RigidbodyState
ts
type RigidbodyState = {
enabled: boolean;
type: RigidbodyType;
mass: number;
linearDamping: number;
angularDamping: number;
gravityScale: number;
canSleep: boolean;
ccdEnabled: boolean;
lockTranslations: boolean;
lockTranslationX: boolean;
lockTranslationY: boolean;
lockTranslationZ: boolean;
lockRotations: boolean;
lockRotationX: boolean;
lockRotationY: boolean;
lockRotationZ: boolean;
};Defined in: components/Physics.ts:24
Authoring state for the rigidbody half of PhysicsComponent. Saved with the project.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled | boolean | When false, the body is removed from physics simulation but kept in state. | components/Physics.ts:26 |
type | RigidbodyType | Body type. See RigidbodyType. | components/Physics.ts:28 |
mass | number | Mass in kilograms. Only meaningful for dynamic bodies. | components/Physics.ts:30 |
linearDamping | number | Damping applied to linear velocity each step (0 = none). | components/Physics.ts:32 |
angularDamping | number | Damping applied to angular velocity each step (0 = none). | components/Physics.ts:34 |
gravityScale | number | Scale factor applied to world gravity for this body (1 = full gravity, 0 = floating). | components/Physics.ts:36 |
canSleep | boolean | Allow the body to sleep when at rest to save simulation cost. | components/Physics.ts:38 |
ccdEnabled | boolean | Enable continuous collision detection to prevent tunneling for fast bodies. | components/Physics.ts:40 |
lockTranslations | boolean | Master toggle: when true, all linear motion is locked. | components/Physics.ts:42 |
lockTranslationX | boolean | Lock translation along world X. | components/Physics.ts:44 |
lockTranslationY | boolean | Lock translation along world Y. | components/Physics.ts:46 |
lockTranslationZ | boolean | Lock translation along world Z. | components/Physics.ts:48 |
lockRotations | boolean | Master toggle: when true, all rotation is locked. | components/Physics.ts:50 |
lockRotationX | boolean | Lock rotation around world X. | components/Physics.ts:52 |
lockRotationY | boolean | Lock rotation around world Y. | components/Physics.ts:54 |
lockRotationZ | boolean | Lock rotation around world Z. | components/Physics.ts:56 |

