Skip to content

PhysicsPlugin

Defined in: physics/src/PhysicsPlugin.ts:29

Physics plugin that installs Rapier2D physics into the YAGE engine.

Creates a PhysicsWorldManager that owns per-scene Rapier worlds, and registers two systems:

  • PhysicsSystem (FixedUpdate, priority 0)
  • PhysicsInterpolationSystem (Update, priority -100)

Per-scene worlds are created in a beforeEnter scene hook and destroyed in afterExit. Components access the active scene’s world via this.use(PhysicsWorldKey).

  • Plugin

new PhysicsPlugin(config?): PhysicsPlugin

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

PhysicsConfig

PhysicsPlugin

readonly name: "physics" = "physics"

Defined in: physics/src/PhysicsPlugin.ts:30

Unique plugin name.

Plugin.name


readonly version: "3.0.0" = "3.0.0"

Defined in: physics/src/PhysicsPlugin.ts:31

Semantic version string.

Plugin.version

install(context): void

Defined in: physics/src/PhysicsPlugin.ts:46

Install services into the engine context. Called in topological order.

EngineContext

void

Plugin.install


onDestroy(): void

Defined in: physics/src/PhysicsPlugin.ts:79

Called when the engine is destroyed.

void

Plugin.onDestroy


onStart(): void

Defined in: physics/src/PhysicsPlugin.ts:68

Called after all plugins are installed and the engine has started.

void

Plugin.onStart


registerSystems(scheduler): void

Defined in: physics/src/PhysicsPlugin.ts:63

Register systems with the scheduler. Called after install.

SystemScheduler

void

Plugin.registerSystems

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/physics.md.