Skip to content

@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

PropertyTypeDescriptionDefined in
enabledbooleanWhen false, the body is removed from physics simulation but kept in state.components/Physics.ts:26
typeRigidbodyTypeBody type. See RigidbodyType.components/Physics.ts:28
massnumberMass in kilograms. Only meaningful for dynamic bodies.components/Physics.ts:30
linearDampingnumberDamping applied to linear velocity each step (0 = none).components/Physics.ts:32
angularDampingnumberDamping applied to angular velocity each step (0 = none).components/Physics.ts:34
gravityScalenumberScale factor applied to world gravity for this body (1 = full gravity, 0 = floating).components/Physics.ts:36
canSleepbooleanAllow the body to sleep when at rest to save simulation cost.components/Physics.ts:38
ccdEnabledbooleanEnable continuous collision detection to prevent tunneling for fast bodies.components/Physics.ts:40
lockTranslationsbooleanMaster toggle: when true, all linear motion is locked.components/Physics.ts:42
lockTranslationXbooleanLock translation along world X.components/Physics.ts:44
lockTranslationYbooleanLock translation along world Y.components/Physics.ts:46
lockTranslationZbooleanLock translation along world Z.components/Physics.ts:48
lockRotationsbooleanMaster toggle: when true, all rotation is locked.components/Physics.ts:50
lockRotationXbooleanLock rotation around world X.components/Physics.ts:52
lockRotationYbooleanLock rotation around world Y.components/Physics.ts:54
lockRotationZbooleanLock rotation around world Z.components/Physics.ts:56