Skip to content

PhysicsBackend

Defined in: packages/threeplay/src/plugins/physics/types.ts:169

A physics engine adapter. The physics plugin drives it; Rapier is the built-in implementation. Body/collider handles are opaque to the engine. This interface may grow while the plugin matures (it is marked unstable).

dispose(): void

Defined in: packages/threeplay/src/plugins/physics/types.ts:183

void


getGravity(): Vector3

Defined in: packages/threeplay/src/plugins/physics/types.ts:180

Current gravity vector (a copy).

Vector3


init(): Promise<void>

Defined in: packages/threeplay/src/plugins/physics/types.ts:177

Promise<void>


setGravity(g): void

Defined in: packages/threeplay/src/plugins/physics/types.ts:178

Vector3

void


step(dt): void

Defined in: packages/threeplay/src/plugins/physics/types.ts:182

Advances the simulation by dt seconds.

number

void

readonly name: string

Defined in: packages/threeplay/src/plugins/physics/types.ts:170


readonly native: unknown

Defined in: packages/threeplay/src/plugins/physics/types.ts:176

The native module (e.g. RAPIER).


readonly ready: boolean

Defined in: packages/threeplay/src/plugins/physics/types.ts:172

true once the engine finished loading and bodies can be created.


readonly world: unknown

Defined in: packages/threeplay/src/plugins/physics/types.ts:174

The native world (escape hatch, e.g. a RAPIER.World).