Skip to content

PhysicsSystem

Defined in: physics/src/PhysicsSystem.ts:38

Steps per-scene physics worlds and synchronises Rapier ↔ Transform.

Runs in FixedUpdate at priority 0, before ComponentFixedUpdateSystem (priority 1000).

Each active scene with physics gets its own sub-accumulator scaled by the scene’s effective time scale (SceneTime.effectiveScale — the persistent scene.timeScale composed with active freeze/slow-mo requests). Paused scenes are simply not stepped — no sleep/wake needed.

NOTE: entity.timeScale and SceneTime excludeUpdates exclusions are intentionally NOT applied here. The whole scene shares one Rapier world stepped once per (scaled) fixed tick, so there is no per-body notion of time — a single entity cannot be individually slowed or sped up. They only affect component update/fixedUpdate, the entity’s ProcessComponent, and its particle emitters. For per-body time control, use a kinematic body or scale velocities manually.

  • System

new PhysicsSystem(): PhysicsSystem

PhysicsSystem

System.constructor

protected context: EngineContext

Defined in: core/dist/index.d.ts:1086

Reference to the engine context, set on registration.

System.context


enabled: boolean

Defined in: core/dist/index.d.ts:1084

Whether this system is active.

System.enabled


readonly phase: FixedUpdate = Phase.FixedUpdate

Defined in: physics/src/PhysicsSystem.ts:39

The phase this system runs in.

System.phase


readonly priority: 0 = 0

Defined in: physics/src/PhysicsSystem.ts:40

Execution priority within the phase. Lower = earlier. Default: 0.

System.priority

_setContext(context): void

Defined in: core/dist/index.d.ts:1093

Internal

Set the engine context. Called by SystemScheduler when the system is registered.

EngineContext

void

System._setContext


optional onRegister(context): void

Defined in: core/dist/index.d.ts:1097

Called once when the system is registered with the engine.

EngineContext

void

System.onRegister


optional onUnregister(): void

Defined in: core/dist/index.d.ts:1101

Called when the system is removed.

void

System.onUnregister


update(dt): void

Defined in: physics/src/PhysicsSystem.ts:45

Called every frame (or every fixed step for FixedUpdate).

number

void

System.update


protected use<T>(key): T

Defined in: core/dist/index.d.ts:1095

Resolve a service by key, cached after first lookup.

T

ServiceKey<T>

T

System.use