@vgai/engine 0.5.14 → 0.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/adapter-module.d.ts +228 -17
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +224 -42
- package/dist/adapter/authoring-seam-contract.d.ts +530 -0
- package/dist/adapter/authoring-seam-contract.d.ts.map +1 -0
- package/dist/adapter/authoring-seam-contract.js +162 -0
- package/dist/adapter/authoring.d.ts +237 -50
- package/dist/adapter/authoring.d.ts.map +1 -1
- package/dist/adapter/authoring.js +2 -1
- package/dist/adapter/entrypoint-selection-source.d.ts +35 -0
- package/dist/adapter/entrypoint-selection-source.d.ts.map +1 -0
- package/dist/adapter/entrypoint-selection-source.js +151 -0
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +7 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +142 -21
- package/dist/adapter/first-party-systems.d.ts +13 -3
- package/dist/adapter/first-party-systems.d.ts.map +1 -1
- package/dist/adapter/first-party-systems.js +10 -3
- package/dist/adapter/index.d.ts +7 -2
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +4 -0
- package/dist/adapter/ingest/contract-system-adapters.d.ts +1 -1
- package/dist/adapter/ingest/contract-system-adapters.d.ts.map +1 -1
- package/dist/adapter/ingest/contract-system-adapters.js +13 -25
- package/dist/adapter/ingest/game-contract-seams.d.ts +214 -0
- package/dist/adapter/ingest/game-contract-seams.d.ts.map +1 -0
- package/dist/adapter/ingest/game-contract-seams.js +62 -0
- package/dist/adapter/ingest/game-contract.d.ts +5 -3
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -1
- package/dist/adapter/ingest/game-contract.js +4 -1
- package/dist/adapter/ingest/merge-debug-adapters.d.ts +52 -0
- package/dist/adapter/ingest/merge-debug-adapters.d.ts.map +1 -0
- package/dist/adapter/ingest/merge-debug-adapters.js +141 -0
- package/dist/adapter/ingest/observation-debug-adapter.d.ts +56 -0
- package/dist/adapter/ingest/observation-debug-adapter.d.ts.map +1 -0
- package/dist/adapter/ingest/observation-debug-adapter.js +131 -0
- package/dist/adapter/ingest/scene-capture.d.ts +38 -13
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -1
- package/dist/adapter/ingest/scene-capture.js +101 -24
- package/dist/adapter/ingest/visible-capture-window.d.ts +22 -5
- package/dist/adapter/ingest/visible-capture-window.d.ts.map +1 -1
- package/dist/adapter/ingest/visible-capture-window.js +46 -7
- package/dist/adapter/native-debug-module.d.ts +43 -0
- package/dist/adapter/native-debug-module.d.ts.map +1 -0
- package/dist/adapter/native-debug-module.js +230 -0
- package/dist/adapter/object3d-authoring-subject.d.ts +32 -0
- package/dist/adapter/object3d-authoring-subject.d.ts.map +1 -0
- package/dist/adapter/object3d-authoring-subject.js +25 -0
- package/dist/adapter/root-adapter.d.ts +21 -56
- package/dist/adapter/root-adapter.d.ts.map +1 -1
- package/dist/adapter/root-adapter.js +4 -20
- package/dist/adapter/root-seam-contract.d.ts +124 -0
- package/dist/adapter/root-seam-contract.d.ts.map +1 -0
- package/dist/adapter/root-seam-contract.js +36 -0
- package/dist/adapter/seam-evidence.d.ts +118 -0
- package/dist/adapter/seam-evidence.d.ts.map +1 -0
- package/dist/adapter/seam-evidence.js +231 -0
- package/dist/adapter/setup-three-root-adapter.d.ts +2 -3
- package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -1
- package/dist/adapter/setup-three-root-adapter.js +2 -3
- package/dist/adapter/system-adapter.d.ts +6 -1
- package/dist/adapter/system-adapter.d.ts.map +1 -1
- package/dist/adapter/system-seam-contract.d.ts +354 -0
- package/dist/adapter/system-seam-contract.d.ts.map +1 -0
- package/dist/adapter/system-seam-contract.js +95 -0
- package/dist/animation/xstate-animation-binding.d.ts +6 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -1
- package/dist/animation/xstate-animation-binding.js +142 -4
- package/dist/asset-formats/collider.d.ts +1 -1
- package/dist/asset-formats/mesh.d.ts +2 -2
- package/dist/asset-formats/particles.d.ts +1 -1
- package/dist/canvas-react/engine-bridge.d.ts +6 -6
- package/dist/canvas-react/engine-bridge.d.ts.map +1 -1
- package/dist/canvas-react/engine-bridge.js +2 -2
- package/dist/canvas-react/index.d.ts +2 -2
- package/dist/canvas-react/index.d.ts.map +1 -1
- package/dist/canvas-react/index.js +1 -1
- package/dist/canvas-react/pixi-react-adapter.d.ts +15 -9
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-adapter.js +43 -29
- package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -1
- package/dist/canvas-react/pixi-react-root-factory.js +4 -0
- package/dist/canvas-react/world-context.d.ts +22 -12
- package/dist/canvas-react/world-context.d.ts.map +1 -1
- package/dist/canvas-react/world-context.js +12 -51
- package/dist/ecs/user-data.d.ts +5 -0
- package/dist/ecs/user-data.d.ts.map +1 -1
- package/dist/ecs/user-data.js +3 -0
- package/dist/input/input-manager.d.ts +49 -0
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +127 -0
- package/dist/manifest/schema.d.ts +9 -9
- package/dist/manifest/schema.js +1 -1
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +220 -1
- package/dist/pixi/ingest.d.ts +2 -1
- package/dist/pixi/ingest.d.ts.map +1 -1
- package/dist/pixi/ingest.js +4 -2
- package/dist/pixi/scene-capture.d.ts +9 -1
- package/dist/pixi/scene-capture.d.ts.map +1 -1
- package/dist/pixi/scene-capture.js +9 -6
- package/dist/render/particles-factory.d.ts +13 -6
- package/dist/render/particles-factory.d.ts.map +1 -1
- package/dist/render/particles-factory.js +6 -3
- package/dist/runtime/create-runtime.d.ts +23 -46
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +22 -67
- package/dist/runtime/game.d.ts +29 -71
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +15 -54
- package/dist/runtime/mount-game.d.ts.map +1 -1
- package/dist/runtime/mount-game.js +12 -1
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +4 -5
- package/dist/runtime/types.d.ts +18 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/setup/setup-renderer.d.ts +3 -4
- package/dist/setup/setup-renderer.d.ts.map +1 -1
- package/dist/setup/setup-renderer.js +3 -4
- package/dist/world3d-react/engine-bridge.d.ts +1 -1
- package/dist/world3d-react/engine-bridge.js +1 -1
- package/dist/world3d-react/r3f-adapter.d.ts +7 -0
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
- package/dist/world3d-react/r3f-adapter.js +50 -21
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +4 -0
- package/dist/world3d-react/world-context.d.ts +9 -3
- package/dist/world3d-react/world-context.d.ts.map +1 -1
- package/dist/world3d-react/world-context.js +5 -18
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +8 -8
- package/schemas/vgai-project.schema.json +1 -1
- package/src/adapter/adapter-module.ts +407 -50
- package/src/adapter/authoring-seam-contract.ts +211 -0
- package/src/adapter/authoring.ts +242 -50
- package/src/adapter/entrypoint-selection-source.ts +159 -0
- package/src/adapter/finders/scenes-from-entrypoint-selection.ts +159 -28
- package/src/adapter/first-party-systems.ts +17 -3
- package/src/adapter/index.ts +51 -1
- package/src/adapter/ingest/contract-system-adapters.ts +26 -30
- package/src/adapter/ingest/game-contract-seams.ts +85 -0
- package/src/adapter/ingest/game-contract.ts +9 -4
- package/src/adapter/ingest/merge-debug-adapters.ts +193 -0
- package/src/adapter/ingest/observation-debug-adapter.ts +158 -0
- package/src/adapter/ingest/scene-capture.ts +126 -23
- package/src/adapter/ingest/visible-capture-window.ts +63 -9
- package/src/adapter/native-debug-module.ts +307 -0
- package/src/adapter/object3d-authoring-subject.ts +50 -0
- package/src/adapter/root-adapter.ts +21 -56
- package/src/adapter/root-seam-contract.ts +56 -0
- package/src/adapter/seam-evidence.ts +336 -0
- package/src/adapter/setup-three-root-adapter.ts +4 -6
- package/src/adapter/system-adapter.ts +6 -1
- package/src/adapter/system-seam-contract.ts +121 -0
- package/src/animation/xstate-animation-binding.ts +151 -4
- package/src/canvas-react/engine-bridge.ts +6 -6
- package/src/canvas-react/index.ts +2 -1
- package/src/canvas-react/pixi-react-adapter.tsx +55 -34
- package/src/canvas-react/pixi-react-root-factory.tsx +4 -0
- package/src/canvas-react/world-context.ts +26 -101
- package/src/ecs/user-data.ts +5 -0
- package/src/input/input-manager.ts +122 -0
- package/src/manifest/schema.ts +1 -1
- package/src/pixi/authoring.ts +236 -1
- package/src/pixi/ingest.ts +9 -2
- package/src/pixi/scene-capture.ts +20 -5
- package/src/render/particles-factory.ts +16 -6
- package/src/runtime/create-runtime.ts +41 -106
- package/src/runtime/game.ts +41 -111
- package/src/runtime/mount-game.ts +19 -1
- package/src/runtime/mount-manifest.ts +4 -5
- package/src/runtime/types.ts +22 -0
- package/src/setup/setup-renderer.ts +3 -4
- package/src/world3d-react/engine-bridge.ts +1 -1
- package/src/world3d-react/r3f-adapter.tsx +64 -24
- package/src/world3d-react/r3f-root-factory.tsx +4 -0
- package/src/world3d-react/world-context.ts +11 -36
package/dist/runtime/game.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Game root
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* instead of driving its own loop, and in T7.3 slice 2 with a
|
|
7
|
-
* construction-time stage check (symmetric with the three/scene check).
|
|
8
|
-
* T6.2 slice 1 adds real `'react'`-kind
|
|
9
|
-
* `RootInstance` support (`container`, a real `reactRoot()`) — the DOM-root
|
|
10
|
-
* world surface `runtime/create-runtime.ts`'s roots path now mounts, with
|
|
11
|
-
* `physics`/`collisions`/`camera`/`frame` `undefined` for them exactly
|
|
12
|
-
* like an opaque/foreign mount.
|
|
13
|
-
*
|
|
14
|
-
* (D6), particularly §4 (the frame algorithm) and §8 stage 2, for the full
|
|
15
|
-
* target shape. This file holds the Game/ RootInstance shell, the NEW
|
|
16
|
-
* game-scoped `SystemRunner`, and the host-facing `runFrame` frame executor.
|
|
17
|
-
* The public surface is NOT frozen yet — do not add these exports to a
|
|
18
|
-
* barrel/index; only the in-scope runtime/adapter files import this module
|
|
19
|
-
* directly. The `gpu` per-world cache is the one remaining slice-1 omission.
|
|
2
|
+
* The surface-neutral Game root and its declaration-ordered root registry.
|
|
3
|
+
* Three, Canvas, and DOM roots share one game-scoped loop, input manager,
|
|
4
|
+
* system runner, state bridge, debug registry, clock, and seeded RNG. Each
|
|
5
|
+
* RootInstance retains its own mounted surface and optional capabilities.
|
|
20
6
|
*/
|
|
21
7
|
import type * as PIXI from 'pixi.js';
|
|
22
8
|
import type * as THREE from 'three';
|
|
@@ -33,7 +19,6 @@ import { InputManager } from '../input/input-manager';
|
|
|
33
19
|
import type { CollisionSystem } from '../physics/collision-system';
|
|
34
20
|
import type { PhysicsRegistry } from '../physics/physics-registry';
|
|
35
21
|
import type { Physics2DRegistry } from '../pixi/physics-registry';
|
|
36
|
-
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
37
22
|
import { type RunTicksOptions } from './debug-registry';
|
|
38
23
|
import { type GameStateBridge } from './state-bridge';
|
|
39
24
|
import type { GameContext, PlaytestContext } from './types';
|
|
@@ -54,10 +39,7 @@ export type GameLoop = ReturnType<typeof createGameLoop>;
|
|
|
54
39
|
* `runFrame`. `GameLoop.timeScale` (unaffected by this) remains the orthogonal
|
|
55
40
|
* "speed up/slow down" axis — pausing never touches it, so the host's
|
|
56
41
|
* accumulator/rAF loop keeps ticking at its normal cadence, which is what makes
|
|
57
|
-
* "paused still renders" possible
|
|
58
|
-
* implementation set `loop.timeScale = 0`, which starves the accumulator — and,
|
|
59
|
-
* before WO-P13, stopped rendering with it; that was the bug this control
|
|
60
|
-
* surface replaces, not a compatible behavior to keep).
|
|
42
|
+
* "paused still renders" possible.
|
|
61
43
|
*/
|
|
62
44
|
export interface PlayState {
|
|
63
45
|
/** Whether the game is currently paused (game-level — see the per-world
|
|
@@ -95,11 +77,9 @@ export interface PlayState {
|
|
|
95
77
|
}
|
|
96
78
|
/**
|
|
97
79
|
* The kinds of render surface a world can be. `'three'` and `'canvas'`
|
|
98
|
-
* roots are
|
|
99
|
-
* here so the type is already shaped for T7.4 and no caller has to widen a
|
|
100
|
-
* union later.
|
|
80
|
+
* roots are canvas-backed; `'dom'` roots own a DOM layer.
|
|
101
81
|
*
|
|
102
|
-
* Re-exported from `adapter/adapter-surface.ts`
|
|
82
|
+
* Re-exported from `adapter/adapter-surface.ts` so
|
|
103
83
|
* `adapter/root-adapter.ts`'s kind-tagged `MountedRoot` types can name it
|
|
104
84
|
* without an import cycle back to this file. This re-export keeps every
|
|
105
85
|
* existing `import type { AdapterSurface } from '../runtime/game'` call site
|
|
@@ -107,7 +87,7 @@ export interface PlayState {
|
|
|
107
87
|
*/
|
|
108
88
|
export type AdapterSurface = AdapterSurfaceLeaf;
|
|
109
89
|
/**
|
|
110
|
-
* A world's per-phase frame hooks
|
|
90
|
+
* A world's per-phase frame hooks.
|
|
111
91
|
* Populated on a `RootInstance` only for first-party mounts — an opaque/
|
|
112
92
|
* foreign mount has no phase-partitioned entry point, so it stays
|
|
113
93
|
* `undefined` and the Game's frame executor (`GameInternal.runFrame`) falls
|
|
@@ -116,7 +96,7 @@ export type AdapterSurface = AdapterSurfaceLeaf;
|
|
|
116
96
|
export interface RootFrameHooks {
|
|
117
97
|
/** Run this world's engine systems + component ticks + world-bound game
|
|
118
98
|
* systems for one phase. For a first-party world this delegates to the
|
|
119
|
-
*
|
|
99
|
+
* same `SystemRunner.runPhase` as its direct `mounted.update` entry. */
|
|
120
100
|
runPhase(phase: SystemPhaseName, dt: number): void;
|
|
121
101
|
/** Run once per substep, after ALL phases have run for ALL roots this
|
|
122
102
|
* substep (mirrors where `mounted.update`'s post-`systems.run` work sat
|
|
@@ -126,14 +106,12 @@ export interface RootFrameHooks {
|
|
|
126
106
|
}
|
|
127
107
|
/**
|
|
128
108
|
* A single world instance: the unit of adaptation.
|
|
129
|
-
* Slice-1 subset — `gpu` (per-world GPU resource cache, §6.2) is omitted
|
|
130
|
-
* until the slice that builds it.
|
|
131
109
|
*/
|
|
132
110
|
export interface RootInstance {
|
|
133
|
-
/** Manifest id
|
|
111
|
+
/** Manifest root id. */
|
|
134
112
|
readonly id: string;
|
|
135
113
|
readonly kind: AdapterSurface;
|
|
136
|
-
/** Per-world play/pause semantics
|
|
114
|
+
/** Per-world play/pause semantics. */
|
|
137
115
|
readonly pausable: boolean;
|
|
138
116
|
/** The RootAdapter that produced `mounted` — first-party or external.
|
|
139
117
|
* Deliberately narrower than `RootAdapter<K>` (T7.5): this field is only
|
|
@@ -157,7 +135,7 @@ export interface RootInstance {
|
|
|
157
135
|
* descriptively for a non-pixijs world, or a canvas world built without
|
|
158
136
|
* a `stage` (see `RootInstanceInit.stage`). */
|
|
159
137
|
pixiStage(): PIXI.Container;
|
|
160
|
-
/** Kind-narrowed accessor for
|
|
138
|
+
/** Kind-narrowed accessor for DOM roots: returns the
|
|
161
139
|
* DOM-root layer `<div>` the host mounted this world's react tree into
|
|
162
140
|
* (the SAME element passed as `container` to `createRootInstance` —
|
|
163
141
|
* identity matters, mirroring `threeScene()`/`pixiStage()`'s "same
|
|
@@ -176,7 +154,7 @@ export interface RootInstance {
|
|
|
176
154
|
readonly physics2d?: Physics2DRegistry | undefined;
|
|
177
155
|
/** Kind-typed via `mounted` in T7.5; `unknown` here deliberately. */
|
|
178
156
|
readonly camera?: unknown;
|
|
179
|
-
/** Phase-partitioned frame entry point
|
|
157
|
+
/** Phase-partitioned frame entry point — present only for
|
|
180
158
|
* first-party mounts. `undefined` for an opaque/foreign mount, which
|
|
181
159
|
* `GameInternal.runFrame` drives via its single `mounted.update` call
|
|
182
160
|
* instead (unless it `drivesOwnLoop`, in which case it isn't ticked at
|
|
@@ -229,8 +207,8 @@ export declare function createRootInstance(init: RootInstanceInit): RootInstance
|
|
|
229
207
|
/**
|
|
230
208
|
* Type guard for whether a `MountedThreeRoot` is a first-party
|
|
231
209
|
* `SetupThreeRootAdapter` mount (has a live `GameContext` at `.ctx`). Used to
|
|
232
|
-
* decide whether a world's `physics`/`collisions`/`camera`
|
|
233
|
-
*
|
|
210
|
+
* decide whether a world's `physics`/`collisions`/`camera` can be populated
|
|
211
|
+
* from it — an external
|
|
234
212
|
* adapter's mount has none of these first-party handles.
|
|
235
213
|
*
|
|
236
214
|
* Checks the `firstParty: true` brand (checklist item 1), NOT `'ctx' in
|
|
@@ -275,13 +253,9 @@ export interface DebrisOwner {
|
|
|
275
253
|
*/
|
|
276
254
|
export declare function disposeDebrisSubtree(obj: THREE.Object3D, owners: ReadonlyArray<DebrisOwner>): void;
|
|
277
255
|
/**
|
|
278
|
-
* The Game root. Owns the
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* additions: they delegate to the default world's first-party mount so
|
|
282
|
-
* existing single-world call sites keep working; hoisting them to true
|
|
283
|
-
* Game ownership (the target shape) is a later slice's
|
|
284
|
-
* work, not this one's.
|
|
256
|
+
* The Game root. Owns the loop, raw-asset cache, world registry, input,
|
|
257
|
+
* and game-scoped `SystemRunner`. Surface-specific capabilities remain on
|
|
258
|
+
* their mounted roots or in the aggregated `SystemAdapters` contract.
|
|
285
259
|
*/
|
|
286
260
|
export interface Game {
|
|
287
261
|
readonly loop: GameLoop;
|
|
@@ -291,18 +265,16 @@ export interface Game {
|
|
|
291
265
|
/** Per-game diagnostic store. Disabled by default; the editor enables it on demand. */
|
|
292
266
|
readonly profiler: PerformanceProfiler;
|
|
293
267
|
/**
|
|
294
|
-
* The game-scoped `SystemRunner
|
|
295
|
-
*
|
|
268
|
+
* The game-scoped `SystemRunner`, separate from any world's own runner.
|
|
269
|
+
* Within each phase,
|
|
296
270
|
* `GameInternal.runFrame` runs THIS runner's `runPhase` first, before any
|
|
297
271
|
* world's engine systems/component ticks/world-bound game systems (e.g.
|
|
298
272
|
* `ctx.systems.add`, which stays world-bound to the default world — see
|
|
299
273
|
* `runtime/types.ts`). Empty for every existing game (nothing registers
|
|
300
|
-
* against it
|
|
301
|
-
* unchanged by its presence.
|
|
274
|
+
* against it), so an empty runner has no frame cost beyond dispatch.
|
|
302
275
|
*/
|
|
303
276
|
readonly systems: SystemRunner;
|
|
304
|
-
/** Declaration-ordered.
|
|
305
|
-
* three world) — this is the SAME array reference `registerRoot`
|
|
277
|
+
/** Declaration-ordered. This is the same array reference `registerRoot`
|
|
306
278
|
* mutates, not a snapshot, so holders (e.g. `GameContext.roots`) observe
|
|
307
279
|
* later registrations. */
|
|
308
280
|
readonly roots: ReadonlyArray<RootInstance>;
|
|
@@ -338,9 +310,6 @@ export interface Game {
|
|
|
338
310
|
subscribeSystemAdapters?(listener: () => void): () => void;
|
|
339
311
|
/** The one game-owned `InputManager`, shared by every first-party root. */
|
|
340
312
|
readonly input: InputManager;
|
|
341
|
-
/** Delegates to the default world's first-party audio context. Throws
|
|
342
|
-
* when the default world is not a first-party mount. */
|
|
343
|
-
readonly audio: GameAudio;
|
|
344
313
|
/**
|
|
345
314
|
* Frame-versioned state bridge (T7.4 slice 1). Bumped once per completed
|
|
346
315
|
* `runFrame`, after all phases of all roots and all `endFrame` hooks (see
|
|
@@ -421,28 +390,18 @@ export interface GameInternal extends Game {
|
|
|
421
390
|
* else: world.mounted.update?.(dt) // opaque world fallback
|
|
422
391
|
* ```
|
|
423
392
|
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* `update`
|
|
428
|
-
* `drivesOwnLoop` world is never ticked here at all — matching its
|
|
429
|
-
* exclusion from the legacy `!mountedRef.drivesOwnLoop` guard. An opaque
|
|
430
|
-
* host-driven world (no `frame`) gets exactly one `update(dt)` call per
|
|
431
|
-
* substep, after the phase loop — unchanged cadence from today.
|
|
393
|
+
* A single first-party world and its direct `mounted.update(dt)` entry run
|
|
394
|
+
* the same `SystemRunner` and `postFrame` work. A `drivesOwnLoop` world is
|
|
395
|
+
* never ticked here. An opaque host-driven world (no `frame`) gets exactly
|
|
396
|
+
* one `update(dt)` call per substep, after the phase loop.
|
|
432
397
|
*
|
|
433
398
|
* D10/T7.6 play-state addendum: when `Game.play.paused` is true, every
|
|
434
399
|
* `pausable` (and non-`drivesOwnLoop`) world skips every phase EXCEPT
|
|
435
400
|
* `render` (still called, every substep, with `dt` forced to `0`) and skips
|
|
436
401
|
* its `endFrame`/opaque-`update` call entirely — a `pausable: false` world
|
|
437
|
-
* is completely unaffected. `
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* none) but is no longer how `Game.play.step()` works (§7.1-2 fix,
|
|
441
|
-
* probe4: the old `ignorePause` full-frame re-run double-ticked every
|
|
442
|
-
* already-running `pausable: false` world, since D10's ordinary loop never
|
|
443
|
-
* stops ticking them). `Game.play.step()` now drives this function via the
|
|
444
|
-
* internal-only `onlyFrozen` mode instead (see `runFrameImpl` — not part of
|
|
445
|
-
* this public, host-facing signature): it ticks EXACTLY the currently
|
|
402
|
+
* is completely unaffected. `Game.play.step()` drives this function via the
|
|
403
|
+
* internal-only `onlyFrozen` mode (see `runFrameImpl` — not part of this
|
|
404
|
+
* public, host-facing signature): it ticks exactly the currently
|
|
446
405
|
* frozen set (host-driven, `pausable`, and `paused`) through every phase +
|
|
447
406
|
* `endFrame` with the real `dt` (not the render-phase's forced `0`), and
|
|
448
407
|
* touches no other world at all — a natural no-op while not paused, since
|
|
@@ -459,7 +418,6 @@ export interface GameInternal extends Game {
|
|
|
459
418
|
* `runTicks` sets it per tick for its `render: 'none' | 'last'` modes.
|
|
460
419
|
*/
|
|
461
420
|
runFrame(dt: number, opts?: {
|
|
462
|
-
ignorePause?: boolean;
|
|
463
421
|
skipRenderPhases?: boolean;
|
|
464
422
|
}): void;
|
|
465
423
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../src/runtime/game.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"game.d.ts","sourceRoot":"","sources":["../../src/runtime/game.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOxD,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAA4B,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,eA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C1E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C;;;;;;;;;kDAS8C;IAC9C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,GAAG,YAAY,CAsvBf"}
|
package/dist/runtime/game.js
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Game root
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* instead of driving its own loop, and in T7.3 slice 2 with a
|
|
7
|
-
* construction-time stage check (symmetric with the three/scene check).
|
|
8
|
-
* T6.2 slice 1 adds real `'react'`-kind
|
|
9
|
-
* `RootInstance` support (`container`, a real `reactRoot()`) — the DOM-root
|
|
10
|
-
* world surface `runtime/create-runtime.ts`'s roots path now mounts, with
|
|
11
|
-
* `physics`/`collisions`/`camera`/`frame` `undefined` for them exactly
|
|
12
|
-
* like an opaque/foreign mount.
|
|
13
|
-
*
|
|
14
|
-
* (D6), particularly §4 (the frame algorithm) and §8 stage 2, for the full
|
|
15
|
-
* target shape. This file holds the Game/ RootInstance shell, the NEW
|
|
16
|
-
* game-scoped `SystemRunner`, and the host-facing `runFrame` frame executor.
|
|
17
|
-
* The public surface is NOT frozen yet — do not add these exports to a
|
|
18
|
-
* barrel/index; only the in-scope runtime/adapter files import this module
|
|
19
|
-
* directly. The `gpu` per-world cache is the one remaining slice-1 omission.
|
|
2
|
+
* The surface-neutral Game root and its declaration-ordered root registry.
|
|
3
|
+
* Three, Canvas, and DOM roots share one game-scoped loop, input manager,
|
|
4
|
+
* system runner, state bridge, debug registry, clock, and seeded RNG. Each
|
|
5
|
+
* RootInstance retains its own mounted surface and optional capabilities.
|
|
20
6
|
*/
|
|
21
7
|
import { formatAudioGateMessage, formatLoopGateMessage } from '../adapter/loop-gate-report';
|
|
22
8
|
import { createSeededRandom, DEFAULT_SEEDED_RANDOM_SEED, registerSeededRandom, } from '../core/seeded-random';
|
|
@@ -147,8 +133,8 @@ export function createRootInstance(init) {
|
|
|
147
133
|
/**
|
|
148
134
|
* Type guard for whether a `MountedThreeRoot` is a first-party
|
|
149
135
|
* `SetupThreeRootAdapter` mount (has a live `GameContext` at `.ctx`). Used to
|
|
150
|
-
* decide whether a world's `physics`/`collisions`/`camera`
|
|
151
|
-
*
|
|
136
|
+
* decide whether a world's `physics`/`collisions`/`camera` can be populated
|
|
137
|
+
* from it — an external
|
|
152
138
|
* adapter's mount has none of these first-party handles.
|
|
153
139
|
*
|
|
154
140
|
* Checks the `firstParty: true` brand (checklist item 1), NOT `'ctx' in
|
|
@@ -234,11 +220,6 @@ export function disposeDebrisSubtree(obj, owners) {
|
|
|
234
220
|
function debrisOwnersOf(world) {
|
|
235
221
|
return isFirstPartyMounted(world.mounted) ? [world.mounted.ctx] : [];
|
|
236
222
|
}
|
|
237
|
-
function describeMismatch(handle, world) {
|
|
238
|
-
return (`Game.${handle}: default world "${world.id}" (kind: ${world.kind}) is not a first-party ` +
|
|
239
|
-
"mount — hoisting these to true Game ownership is a later slice's work; available only " +
|
|
240
|
-
'via a first-party default world today');
|
|
241
|
-
}
|
|
242
223
|
/**
|
|
243
224
|
* Construct the (host-internal) Game shell. Callers: `createGameRuntime`
|
|
244
225
|
* builds this BEFORE mounting its one adapter, then registers the default
|
|
@@ -314,7 +295,7 @@ export function createGame(opts) {
|
|
|
314
295
|
getTick: () => tick,
|
|
315
296
|
getSimT: () => simT,
|
|
316
297
|
// D15/T-D15.5 — "the manifest's first/default world" for the debug
|
|
317
|
-
// registry's world-addressed input-target
|
|
298
|
+
// registry's world-addressed input-target surface. Every
|
|
318
299
|
// first-party root now registers the SAME game-owned InputManager, but the
|
|
319
300
|
// stable default id still keeps explicit/implicit debug routing coherent.
|
|
320
301
|
// Use the SAME "first three world, else first world" rule
|
|
@@ -343,13 +324,6 @@ export function createGame(opts) {
|
|
|
343
324
|
}
|
|
344
325
|
return roots.find((w) => w.kind === 'three') ?? roots[0];
|
|
345
326
|
}
|
|
346
|
-
function requireFirstPartyCtx(handle) {
|
|
347
|
-
const world = requireDefaultRoot();
|
|
348
|
-
if (!isFirstPartyMounted(world.mounted)) {
|
|
349
|
-
throw new Error(describeMismatch(handle, world));
|
|
350
|
-
}
|
|
351
|
-
return world.mounted.ctx;
|
|
352
|
-
}
|
|
353
327
|
// --- Game.systemAdapters aggregation (§7.1-3, probe1) --------------------
|
|
354
328
|
// Warn-once-per-colliding-key state, scoped to this Game instance (a fresh
|
|
355
329
|
// Game gets a fresh warn history) — deliberately NOT reset by anything
|
|
@@ -457,7 +431,6 @@ export function createGame(opts) {
|
|
|
457
431
|
if (rngTrapEnabled)
|
|
458
432
|
rngTrap.enable();
|
|
459
433
|
profiler.beginFrame();
|
|
460
|
-
const ignorePause = frameOpts?.ignorePause ?? false;
|
|
461
434
|
// D15/T-D15.4 + WO-P13: the render-phase skip. Two callers set it, for the
|
|
462
435
|
// same reason — this substep is not the thing that paints. `runTicks`'s
|
|
463
436
|
// `render: 'none'|'last'` fast-forward sets it on every tick it doesn't
|
|
@@ -472,9 +445,6 @@ export function createGame(opts) {
|
|
|
472
445
|
// one and only caller. It ticks EXACTLY the currently-frozen set (host-driven,
|
|
473
446
|
// `pausable`, and `paused`) through every phase + `endFrame`, with the REAL
|
|
474
447
|
// `dt` (not the render-phase's forced `0`), and touches no other world at all
|
|
475
|
-
// — §7.1-2 fix, probe4: the previous `ignorePause` full-frame re-run ticked
|
|
476
|
-
// EVERY host-driven world, double-ticking every already-running
|
|
477
|
-
// `pausable: false` world (D10's ordinary loop never stops ticking them).
|
|
478
448
|
const onlyFrozen = frameOpts?.onlyFrozen ?? false;
|
|
479
449
|
// Checklist item 7: snapshot the world count ONCE at entry and iterate
|
|
480
450
|
// by index in both loops below. A world registered mid-frame (e.g. from
|
|
@@ -492,10 +462,9 @@ export function createGame(opts) {
|
|
|
492
462
|
break;
|
|
493
463
|
}
|
|
494
464
|
}
|
|
495
|
-
else if (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
: !paused || !world.pausable)) {
|
|
465
|
+
else if (world.mounted.drivesOwnLoop
|
|
466
|
+
? !paused || !world.pausable || !world.mounted.setPaused
|
|
467
|
+
: !paused || !world.pausable) {
|
|
499
468
|
inputFrameActive = true;
|
|
500
469
|
break;
|
|
501
470
|
}
|
|
@@ -592,13 +561,12 @@ export function createGame(opts) {
|
|
|
592
561
|
const world = roots[i];
|
|
593
562
|
if (world.mounted.drivesOwnLoop)
|
|
594
563
|
continue;
|
|
595
|
-
// D10/T7.6: a `pausable` world under an active
|
|
564
|
+
// D10/T7.6: a `pausable` world under an active pause
|
|
596
565
|
// skips every phase except `render` — its render still runs, every
|
|
597
566
|
// substep, but with `dt` forced to `0` (deterministic: no
|
|
598
567
|
// time-based render effect silently keeps animating a "frozen"
|
|
599
|
-
// scene). A `pausable: false` world
|
|
600
|
-
|
|
601
|
-
const frozen = !ignorePause && paused && world.pausable;
|
|
568
|
+
// scene). A `pausable: false` world is unaffected.
|
|
569
|
+
const frozen = paused && world.pausable;
|
|
602
570
|
if (frozen && phase !== SystemPhase.RENDER)
|
|
603
571
|
continue;
|
|
604
572
|
const phaseDt = frozen ? 0 : dt;
|
|
@@ -622,7 +590,7 @@ export function createGame(opts) {
|
|
|
622
590
|
continue;
|
|
623
591
|
// A fully-frozen world gets no `endFrame`/opaque-`update` call either —
|
|
624
592
|
// there is nothing to "end the frame" of when nothing ran this substep.
|
|
625
|
-
const frozen =
|
|
593
|
+
const frozen = paused && world.pausable;
|
|
626
594
|
if (frozen)
|
|
627
595
|
continue;
|
|
628
596
|
advanced = true;
|
|
@@ -770,9 +738,6 @@ export function createGame(opts) {
|
|
|
770
738
|
listener();
|
|
771
739
|
},
|
|
772
740
|
input,
|
|
773
|
-
get audio() {
|
|
774
|
-
return requireFirstPartyCtx('audio').audio;
|
|
775
|
-
},
|
|
776
741
|
state: stateBridge,
|
|
777
742
|
play: {
|
|
778
743
|
get paused() {
|
|
@@ -812,11 +777,7 @@ export function createGame(opts) {
|
|
|
812
777
|
}
|
|
813
778
|
}
|
|
814
779
|
}
|
|
815
|
-
//
|
|
816
|
-
// paused) set — not `{ ignorePause: true }`, which re-ran a FULL
|
|
817
|
-
// extra frame for every host-driven world (including already-running
|
|
818
|
-
// `pausable: false` ones — a double-tick, since D10's ordinary loop
|
|
819
|
-
// never stops ticking them). See `runFrameImpl`'s `onlyFrozen` mode.
|
|
780
|
+
// Tick exactly the frozen (host-driven, pausable, paused) set.
|
|
820
781
|
runFrameImpl(dt, { onlyFrozen: true });
|
|
821
782
|
},
|
|
822
783
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount-game.d.ts","sourceRoot":"","sources":["../../src/runtime/mount-game.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mount-game.d.ts","sourceRoot":"","sources":["../../src/runtime/mount-game.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAuC,MAAM,kBAAkB,CAAC;AAQxF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;6DACyD;IACzD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD;;;mFAG+E;IAC/E,UAAU,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CA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defaultThreeAdapterFactory` below for why
|
|
17
17
|
// even the 'three' convenience export is a plain function the CALLER
|
|
18
18
|
// registers, not something this module wires up automatically.
|
|
19
|
+
import { installNativeDebugBindings, nativeDebugBindingFromEntryModule, } from '../adapter/native-debug-module';
|
|
19
20
|
import { mountManifestRoots, resolveManifest } from './mount-manifest';
|
|
20
21
|
import { assertExportedOrInEditor } from './unexported-game-trap';
|
|
21
22
|
// ---------------------------------------------------------------------------
|
|
@@ -102,6 +103,12 @@ export const defaultThreeAdapterFactory = (world, ctx) => {
|
|
|
102
103
|
function worldIsSelfSufficient(_world) {
|
|
103
104
|
return false;
|
|
104
105
|
}
|
|
106
|
+
function nativeDebugForEntry(world, entryModule) {
|
|
107
|
+
if (entryModule === undefined || world.adapter.type !== 'builtin')
|
|
108
|
+
return [];
|
|
109
|
+
const binding = nativeDebugBindingFromEntryModule(world.id, entryModule);
|
|
110
|
+
return binding ? [binding] : [];
|
|
111
|
+
}
|
|
105
112
|
/**
|
|
106
113
|
* Mount every world declared by a `vgai.project.json` manifest onto `host
|
|
107
114
|
* .container`, resolving each world's kind through the `registerAdapter`
|
|
@@ -129,6 +136,7 @@ export async function mountGameFromManifest(manifestInput, host, opts = {}) {
|
|
|
129
136
|
assertExportedOrInEditor();
|
|
130
137
|
const manifest = resolveManifest(manifestInput);
|
|
131
138
|
const entries = { ...opts.entries };
|
|
139
|
+
const nativeDebug = [];
|
|
132
140
|
for (const world of manifest.roots) {
|
|
133
141
|
if (entries[world.id] !== undefined)
|
|
134
142
|
continue; // explicit entry always wins
|
|
@@ -137,6 +145,7 @@ export async function mountGameFromManifest(manifestInput, host, opts = {}) {
|
|
|
137
145
|
const entryModule = world.entry !== undefined && host.loadEntryModule
|
|
138
146
|
? await host.loadEntryModule(world.entry)
|
|
139
147
|
: undefined;
|
|
148
|
+
nativeDebug.push(...nativeDebugForEntry(world, entryModule));
|
|
140
149
|
entries[world.id] = await factory(world, { host, entryModule });
|
|
141
150
|
continue;
|
|
142
151
|
}
|
|
@@ -148,7 +157,7 @@ export async function mountGameFromManifest(manifestInput, host, opts = {}) {
|
|
|
148
157
|
'`defaultThreeAdapterFactory` for a worked three example), or pass ' +
|
|
149
158
|
`opts.entries["${world.id}"] directly (see mount-manifest.ts's \`MountEntry\`).`);
|
|
150
159
|
}
|
|
151
|
-
|
|
160
|
+
const session = await mountManifestRoots({
|
|
152
161
|
manifest,
|
|
153
162
|
container: host.container,
|
|
154
163
|
entries,
|
|
@@ -156,4 +165,6 @@ export async function mountGameFromManifest(manifestInput, host, opts = {}) {
|
|
|
156
165
|
height: host.height,
|
|
157
166
|
headless: host.headless,
|
|
158
167
|
});
|
|
168
|
+
installNativeDebugBindings(session.game, nativeDebug);
|
|
169
|
+
return session;
|
|
159
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount-manifest.d.ts","sourceRoot":"","sources":["../../src/runtime/mount-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mount-manifest.d.ts","sourceRoot":"","sources":["../../src/runtime/mount-manifest.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAqB,KAAK,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,KAAK,uBAAuB,EAA2B,MAAM,gBAAgB,CAAC;AAKvF,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM5D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;GA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,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACzC;;;kFAG8E;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CACvD,GAAG,MAAM,GAAG,SAAS,CAIrB;AAkBD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AA8BjD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAGlE;AA8HD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAsGzF"}
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
// `entries[id].adapter` (the caller's own module graph built it). Threejs is
|
|
21
21
|
// different: `three`/
|
|
22
22
|
// `SetupThreeRootAdapter` are already unconditional dependencies of every
|
|
23
|
-
// caller of `createGameRuntime
|
|
24
|
-
// immediately below in this directory), so wrapping a `setup` with
|
|
23
|
+
// caller of `createGameRuntime`, so wrapping a `setup` with
|
|
25
24
|
// `fromSetup` here adds no NEW bundle weight — only pixi/react are avoided.
|
|
26
25
|
import { assertNever } from '../adapter/adapter-surface';
|
|
27
26
|
// Value-imported from the implementer's OWN path, not the type-only
|
|
@@ -119,8 +118,9 @@ function resolveThreeAdapter(world, entry) {
|
|
|
119
118
|
}
|
|
120
119
|
if (world.adapter.type === 'ingest') {
|
|
121
120
|
throw new Error(`mountManifestRoots: world "${world.id}" (three) declares an { ingest } adapter — ` +
|
|
122
|
-
"ingest roots require the editor's dev-server-backed mount machinery (an EditorStore " +
|
|
123
|
-
|
|
121
|
+
"captured ingest roots require the editor's dev-server-backed mount machinery (an EditorStore " +
|
|
122
|
+
'plus in-realm scene capture, see resolveIngestDescriptor + ' +
|
|
123
|
+
'mountThreeIngestRootFromManifest) and are ' +
|
|
124
124
|
'not supported by mountManifestRoots (no porting aids, no hosted ingest routes).');
|
|
125
125
|
}
|
|
126
126
|
// type === 'default'
|
|
@@ -168,7 +168,6 @@ function buildRootMountSpec(world, entry) {
|
|
|
168
168
|
zOrder: world.zOrder,
|
|
169
169
|
pausable: world.pausable,
|
|
170
170
|
dev: world.dev,
|
|
171
|
-
loop: world.loop,
|
|
172
171
|
};
|
|
173
172
|
// `entry`'s `kind` is guaranteed to agree with `world.kind` past the guard
|
|
174
173
|
// above (or `entry` is `undefined`) — TS can't narrow a `Record` lookup
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -239,6 +239,24 @@ export interface GameContext {
|
|
|
239
239
|
* standalone/custom hosts; networking remains game-owned and direct. */
|
|
240
240
|
playtest?: PlaytestContext | null | undefined;
|
|
241
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Services shared by component-authored roots, independent of their render
|
|
244
|
+
* surface. This is deliberately an explicit pick from {@link GameContext}:
|
|
245
|
+
* adding a subsystem to the imperative Three setup context never silently
|
|
246
|
+
* exposes it to R3F or Canvas components.
|
|
247
|
+
*
|
|
248
|
+
* `input` is nullable because it belongs to the optional `Game` host. Normal
|
|
249
|
+
* vgai project mounts always provide it; bare harnesses and foreign hosts do
|
|
250
|
+
* not. Component code therefore sees the absence in its type instead of a
|
|
251
|
+
* getter that first throws from inside a frame callback.
|
|
252
|
+
*
|
|
253
|
+
* `clock` is surface-specific and intentionally absent here. The imperative
|
|
254
|
+
* and R3F clocks can dispose `THREE.Object3D` debris; a Canvas context narrows
|
|
255
|
+
* that Three-only operation away.
|
|
256
|
+
*/
|
|
257
|
+
export type ComponentContextBase = Pick<GameContext, 'systems' | 'debug' | 'random' | 'game' | 'roots' | 'playtest' | 'registerSystemAdapter'> & {
|
|
258
|
+
readonly input: InputManager | null;
|
|
259
|
+
};
|
|
242
260
|
/** Return value from a game setup function. */
|
|
243
261
|
export interface GameCleanup {
|
|
244
262
|
dispose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,IAAI,S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only `antialias` option at construction and the live shadow/resolution
|
|
29
29
|
* settings (via {@link applyRendererSettings}). Absent → registry defaults.
|
|
30
30
|
*
|
|
31
|
-
* `opts` is
|
|
32
|
-
*
|
|
33
|
-
* `
|
|
34
|
-
* passes it. The roots path passes `alpha:true` for every stacked canvas
|
|
31
|
+
* When `opts` is omitted, construction leaves `alpha` and
|
|
32
|
+
* `preserveDrawingBuffer` at their renderer defaults. The host passes
|
|
33
|
+
* `alpha:true` for every stacked canvas
|
|
35
34
|
* above the bottom one (so its clear-alpha-0 shows the layer below through
|
|
36
35
|
* it) and `preserveDrawingBuffer:true` for every stacked canvas (the
|
|
37
36
|
* recorded capture-tier cost, paid once here rather than re-derived later).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-renderer.d.ts","sourceRoot":"","sources":["../../src/setup/setup-renderer.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,cAAc,EAoBf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,2BAA2B,CAAC;AAEpF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChC,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,KAAK,CAAC,aAAa,EAC7B,SAAS,CAAC,EAAE,WAAW,EACvB,cAAc,SAAuC,GACpD,IAAI,CAKN;AAED
|
|
1
|
+
{"version":3,"file":"setup-renderer.d.ts","sourceRoot":"","sources":["../../src/setup/setup-renderer.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,cAAc,EAoBf,MAAM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EAAE,cAAc,EACxB,QAAQ,EAAE,KAAK,CAAC,aAAa,EAC7B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,GAAG,CAAC,EAAE,iBAAiB,EACvB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EACvC,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACjC,IAAI,CAsVN;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,KAAK,CAAC,aAAa,EAC7B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,GAAG,CAAC,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACpC,GACA,IAAI,CAeN"}
|
|
@@ -31,10 +31,9 @@ export function applyRendererSettings(renderer, rendering, basePixelRatio = Math
|
|
|
31
31
|
* reload-only `antialias` option at construction and the live shadow/resolution
|
|
32
32
|
* settings (via {@link applyRendererSettings}). Absent → registry defaults.
|
|
33
33
|
*
|
|
34
|
-
* `opts` is
|
|
35
|
-
*
|
|
36
|
-
* `
|
|
37
|
-
* passes it. The roots path passes `alpha:true` for every stacked canvas
|
|
34
|
+
* When `opts` is omitted, construction leaves `alpha` and
|
|
35
|
+
* `preserveDrawingBuffer` at their renderer defaults. The host passes
|
|
36
|
+
* `alpha:true` for every stacked canvas
|
|
38
37
|
* above the bottom one (so its clear-alpha-0 shows the layer below through
|
|
39
38
|
* it) and `preserveDrawingBuffer:true` for every stacked canvas (the
|
|
40
39
|
* recorded capture-tier cost, paid once here rather than re-derived later).
|
|
@@ -34,7 +34,7 @@ export declare const EngineBridge: import("react").Context<EngineBridgeValue | n
|
|
|
34
34
|
* function Player({ speed = 4.5 }) {
|
|
35
35
|
* const { input } = useGameContext();
|
|
36
36
|
* const ref = useRef<THREE.Group>(null);
|
|
37
|
-
* useFrame((_, dt) => { if (input
|
|
37
|
+
* useFrame((_, dt) => { if (input?.isPressed('move_forward')) … });
|
|
38
38
|
* return <group ref={ref}><PlayerCharacter /></group>;
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
@@ -28,7 +28,7 @@ export const EngineBridge = createContext(null);
|
|
|
28
28
|
* function Player({ speed = 4.5 }) {
|
|
29
29
|
* const { input } = useGameContext();
|
|
30
30
|
* const ref = useRef<THREE.Group>(null);
|
|
31
|
-
* useFrame((_, dt) => { if (input
|
|
31
|
+
* useFrame((_, dt) => { if (input?.isPressed('move_forward')) … });
|
|
32
32
|
* return <group ref={ref}><PlayerCharacter /></group>;
|
|
33
33
|
* }
|
|
34
34
|
* ```
|