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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PhysicsWorldManager(
config?):PhysicsWorldManager
Defined in: physics/src/PhysicsWorldManager.ts:17
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”PhysicsWorldManager
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: physics/src/PhysicsWorldManager.ts:58
Destroy all physics worlds and clear state.
Returns
Section titled “Returns”void
destroyWorld()
Section titled “destroyWorld()”destroyWorld(
scene):void
Defined in: physics/src/PhysicsWorldManager.ts:44
Destroy a scene’s physics world and remove it from the manager.
Parameters
Section titled “Parameters”Scene
Returns
Section titled “Returns”void
getAllContexts()
Section titled “getAllContexts()”getAllContexts():
IterableIterator<[Scene,ScenePhysicsContext]>
Defined in: physics/src/PhysicsWorldManager.ts:53
Iterate all scene→context entries.
Returns
Section titled “Returns”IterableIterator<[Scene, ScenePhysicsContext]>
getContext()
Section titled “getContext()”getContext(
scene):ScenePhysicsContext|undefined
Defined in: physics/src/PhysicsWorldManager.ts:39
Get the context for a scene, or undefined if none exists.
Parameters
Section titled “Parameters”Scene
Returns
Section titled “Returns”ScenePhysicsContext | undefined
getOrCreateWorld()
Section titled “getOrCreateWorld()”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.
Parameters
Section titled “Parameters”Scene