world2d — the 2D render surface
vgai renders through surfaces. The default is Three.js world3d (Object3Ds); the React
HUD is a second; world2d is a third — a PixiJS v8 2D surface with Rapier 2D physics.
The load-bearing idea: world2d reuses the same engine model — entities, the GameComponent
lifecycle, and authored scene data — and only swaps what a node is (a PixiJS display object
instead of an Object3D).
What it is
Section titled “What it is”- Surface: a PixiJS
Applicationdriven by the engine’s sharedSystemRunner/ phase order (not Pixi’s own ticker) — so 2D systems run in the same phases as 3D. - Entities & behavior:
GameComponent2Dhas the sameinit/update/dispose(and trigger) lifecycle as the 3DGameComponent; gameplay code transfers directly. - Scenes: authored as a
Scene2DFile(the 2D analogue of.vscn), loaded into PixiJS display objects; atilemapsection maps to@pixi/tilemap. - Physics: Rapier 2D (
@dimforge/rapier2d-compat) in a separate world, with a 2D transform-writer and collision/trigger handling.