Skip to content

PhysicsWorldManager

Defined in: physics/src/PhysicsWorldManager.ts:13

Manages per-scene Rapier physics worlds.

Each scene that contains physics entities gets its own PhysicsWorld, sub-accumulator, and interpolation alpha. Worlds are created lazily (on the first physics entity added to a scene) and destroyed when the scene exits.

new PhysicsWorldManager(config?): PhysicsWorldManager

Defined in: physics/src/PhysicsWorldManager.ts:17

PhysicsConfig

PhysicsWorldManager

destroy(): void

Defined in: physics/src/PhysicsWorldManager.ts:58

Destroy all physics worlds and clear state.

void


destroyWorld(scene): void

Defined in: physics/src/PhysicsWorldManager.ts:44

Destroy a scene’s physics world and remove it from the manager.

Scene

void


getAllContexts(): IterableIterator<[Scene, ScenePhysicsContext]>

Defined in: physics/src/PhysicsWorldManager.ts:53

Iterate all scene→context entries.

IterableIterator<[Scene, ScenePhysicsContext]>


getContext(scene): ScenePhysicsContext | undefined

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

Get the context for a scene, or undefined if none exists.

Scene

ScenePhysicsContext | undefined


getOrCreateWorld(scene): PhysicsWorld

Defined in: physics/src/PhysicsWorldManager.ts:25

Get (or lazily create) the physics world for a scene. Call this from component onAdd() to ensure the world exists.

Scene

PhysicsWorld