@vgai/engine 0.5.15 → 0.5.17
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 +229 -33
- package/dist/adapter/adapter-module.d.ts.map +1 -1
- package/dist/adapter/adapter-module.js +222 -50
- 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 -3
- package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
- package/dist/adapter/finders/scenes-from-entrypoint-selection.js +145 -27
- 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 +25 -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 +129 -0
- package/dist/adapter/root-seam-contract.d.ts.map +1 -0
- package/dist/adapter/root-seam-contract.js +37 -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 +11 -12
- 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 +129 -64
- 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/data/curve.d.ts +1 -1
- package/dist/data/curve.js +2 -2
- package/dist/dev/instruments.d.ts +4 -4
- package/dist/dev/instruments.js +4 -4
- package/dist/dev/register-render-vitals.d.ts +2 -2
- package/dist/dev/register-render-vitals.js +2 -2
- package/dist/dev/static-batch-advisor.d.ts +1 -1
- package/dist/dev/static-batch-advisor.js +2 -2
- 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 +64 -0
- package/dist/input/input-manager.d.ts.map +1 -1
- package/dist/input/input-manager.js +149 -0
- package/dist/manifest/load.d.ts +0 -3
- package/dist/manifest/load.d.ts.map +1 -1
- package/dist/manifest/load.js +0 -4
- package/dist/manifest/schema.d.ts +9 -11
- package/dist/manifest/schema.d.ts.map +1 -1
- package/dist/manifest/schema.js +2 -23
- package/dist/pixi/authoring.d.ts +33 -0
- package/dist/pixi/authoring.d.ts.map +1 -1
- package/dist/pixi/authoring.js +301 -2
- 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/react/world-state.d.ts +12 -0
- package/dist/react/world-state.d.ts.map +1 -1
- package/dist/react/world-state.js +14 -0
- 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/render/soft-particle-depth.d.ts +3 -3
- package/dist/render/soft-particle-depth.d.ts.map +1 -1
- package/dist/render/soft-particle-depth.js +8 -13
- package/dist/runtime/create-runtime.d.ts +25 -62
- package/dist/runtime/create-runtime.d.ts.map +1 -1
- package/dist/runtime/create-runtime.js +58 -105
- package/dist/runtime/dev-build.d.ts +37 -0
- package/dist/runtime/dev-build.d.ts.map +1 -0
- package/dist/runtime/dev-build.js +49 -0
- package/dist/runtime/game.d.ts +38 -72
- package/dist/runtime/game.d.ts.map +1 -1
- package/dist/runtime/game.js +40 -55
- 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 +0 -13
- package/dist/runtime/mount-manifest.d.ts.map +1 -1
- package/dist/runtime/mount-manifest.js +5 -25
- 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.d.ts.map +1 -1
- package/dist/world3d-react/engine-bridge.js +29 -4
- package/dist/world3d-react/index.d.ts +1 -1
- package/dist/world3d-react/index.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 +132 -28
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
- package/dist/world3d-react/r3f-root-factory.js +14 -0
- package/dist/world3d-react/rapier-physics-bridge.d.ts +4 -4
- package/dist/world3d-react/rapier-physics-bridge.js +3 -3
- package/dist/world3d-react/world-context.d.ts +52 -3
- package/dist/world3d-react/world-context.d.ts.map +1 -1
- package/dist/world3d-react/world-context.js +94 -64
- package/dist-config/config.js.map +1 -1
- package/package.json +1 -1
- package/schemas/engine-capabilities.json +8 -8
- package/schemas/vgai-project.schema.json +1 -6
- package/src/adapter/adapter-module.ts +405 -72
- 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 +162 -36
- 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 +25 -56
- package/src/adapter/root-seam-contract.ts +57 -0
- package/src/adapter/seam-evidence.ts +336 -0
- package/src/adapter/setup-three-root-adapter.ts +13 -15
- 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 +143 -77
- package/src/canvas-react/pixi-react-root-factory.tsx +4 -0
- package/src/canvas-react/world-context.ts +26 -101
- package/src/data/curve.ts +2 -2
- package/src/dev/instruments.ts +4 -4
- package/src/dev/register-render-vitals.ts +2 -2
- package/src/dev/static-batch-advisor.ts +2 -2
- package/src/ecs/user-data.ts +5 -0
- package/src/input/input-manager.ts +145 -0
- package/src/manifest/load.ts +0 -7
- package/src/manifest/schema.ts +2 -25
- package/src/pixi/authoring.ts +329 -2
- package/src/pixi/ingest.ts +9 -2
- package/src/pixi/scene-capture.ts +20 -5
- package/src/react/world-state.tsx +15 -0
- package/src/render/particles-factory.ts +16 -6
- package/src/render/soft-particle-depth.ts +8 -13
- package/src/runtime/create-runtime.ts +79 -158
- package/src/runtime/dev-build.ts +49 -0
- package/src/runtime/game.ts +72 -113
- package/src/runtime/mount-game.ts +19 -1
- package/src/runtime/mount-manifest.ts +5 -37
- package/src/runtime/types.ts +22 -0
- package/src/setup/setup-renderer.ts +3 -4
- package/src/world3d-react/engine-bridge.ts +29 -4
- package/src/world3d-react/index.ts +1 -1
- package/src/world3d-react/r3f-adapter.tsx +140 -31
- package/src/world3d-react/r3f-root-factory.tsx +14 -0
- package/src/world3d-react/rapier-physics-bridge.tsx +4 -4
- package/src/world3d-react/world-context.ts +111 -87
- package/dist/runtime/dev-layers.d.ts +0 -34
- package/dist/runtime/dev-layers.d.ts.map +0 -1
- package/dist/runtime/dev-layers.js +0 -46
- package/src/runtime/dev-layers.ts +0 -46
|
@@ -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,CAA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}
|
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
|
|
@@ -337,19 +318,16 @@ export function createGame(opts) {
|
|
|
337
318
|
input.setDebugEmit((event, detail) => debugRegistry.forRoot('(game)').emit(event, detail));
|
|
338
319
|
let inputMapPath = null;
|
|
339
320
|
let inputMapLoad = null;
|
|
321
|
+
/** In-flight/settled conventional-path probes (`loadInputMap(path, {optional})`),
|
|
322
|
+
* so two roots probing the same path share one fetch. Separate from
|
|
323
|
+
* `inputMapLoad` because a probe that found nothing declares nothing. */
|
|
324
|
+
const inputMapProbes = new Map();
|
|
340
325
|
function requireDefaultRoot() {
|
|
341
326
|
if (roots.length === 0) {
|
|
342
327
|
throw new Error('Game.defaultRoot: no roots registered yet');
|
|
343
328
|
}
|
|
344
329
|
return roots.find((w) => w.kind === 'three') ?? roots[0];
|
|
345
330
|
}
|
|
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
331
|
// --- Game.systemAdapters aggregation (§7.1-3, probe1) --------------------
|
|
354
332
|
// Warn-once-per-colliding-key state, scoped to this Game instance (a fresh
|
|
355
333
|
// Game gets a fresh warn history) — deliberately NOT reset by anything
|
|
@@ -457,7 +435,6 @@ export function createGame(opts) {
|
|
|
457
435
|
if (rngTrapEnabled)
|
|
458
436
|
rngTrap.enable();
|
|
459
437
|
profiler.beginFrame();
|
|
460
|
-
const ignorePause = frameOpts?.ignorePause ?? false;
|
|
461
438
|
// D15/T-D15.4 + WO-P13: the render-phase skip. Two callers set it, for the
|
|
462
439
|
// same reason — this substep is not the thing that paints. `runTicks`'s
|
|
463
440
|
// `render: 'none'|'last'` fast-forward sets it on every tick it doesn't
|
|
@@ -472,9 +449,6 @@ export function createGame(opts) {
|
|
|
472
449
|
// one and only caller. It ticks EXACTLY the currently-frozen set (host-driven,
|
|
473
450
|
// `pausable`, and `paused`) through every phase + `endFrame`, with the REAL
|
|
474
451
|
// `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
452
|
const onlyFrozen = frameOpts?.onlyFrozen ?? false;
|
|
479
453
|
// Checklist item 7: snapshot the world count ONCE at entry and iterate
|
|
480
454
|
// by index in both loops below. A world registered mid-frame (e.g. from
|
|
@@ -492,10 +466,9 @@ export function createGame(opts) {
|
|
|
492
466
|
break;
|
|
493
467
|
}
|
|
494
468
|
}
|
|
495
|
-
else if (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
: !paused || !world.pausable)) {
|
|
469
|
+
else if (world.mounted.drivesOwnLoop
|
|
470
|
+
? !paused || !world.pausable || !world.mounted.setPaused
|
|
471
|
+
: !paused || !world.pausable) {
|
|
499
472
|
inputFrameActive = true;
|
|
500
473
|
break;
|
|
501
474
|
}
|
|
@@ -592,13 +565,12 @@ export function createGame(opts) {
|
|
|
592
565
|
const world = roots[i];
|
|
593
566
|
if (world.mounted.drivesOwnLoop)
|
|
594
567
|
continue;
|
|
595
|
-
// D10/T7.6: a `pausable` world under an active
|
|
568
|
+
// D10/T7.6: a `pausable` world under an active pause
|
|
596
569
|
// skips every phase except `render` — its render still runs, every
|
|
597
570
|
// substep, but with `dt` forced to `0` (deterministic: no
|
|
598
571
|
// time-based render effect silently keeps animating a "frozen"
|
|
599
|
-
// scene). A `pausable: false` world
|
|
600
|
-
|
|
601
|
-
const frozen = !ignorePause && paused && world.pausable;
|
|
572
|
+
// scene). A `pausable: false` world is unaffected.
|
|
573
|
+
const frozen = paused && world.pausable;
|
|
602
574
|
if (frozen && phase !== SystemPhase.RENDER)
|
|
603
575
|
continue;
|
|
604
576
|
const phaseDt = frozen ? 0 : dt;
|
|
@@ -622,7 +594,7 @@ export function createGame(opts) {
|
|
|
622
594
|
continue;
|
|
623
595
|
// A fully-frozen world gets no `endFrame`/opaque-`update` call either —
|
|
624
596
|
// there is nothing to "end the frame" of when nothing ran this substep.
|
|
625
|
-
const frozen =
|
|
597
|
+
const frozen = paused && world.pausable;
|
|
626
598
|
if (frozen)
|
|
627
599
|
continue;
|
|
628
600
|
advanced = true;
|
|
@@ -770,9 +742,6 @@ export function createGame(opts) {
|
|
|
770
742
|
listener();
|
|
771
743
|
},
|
|
772
744
|
input,
|
|
773
|
-
get audio() {
|
|
774
|
-
return requireFirstPartyCtx('audio').audio;
|
|
775
|
-
},
|
|
776
745
|
state: stateBridge,
|
|
777
746
|
play: {
|
|
778
747
|
get paused() {
|
|
@@ -812,11 +781,7 @@ export function createGame(opts) {
|
|
|
812
781
|
}
|
|
813
782
|
}
|
|
814
783
|
}
|
|
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.
|
|
784
|
+
// Tick exactly the frozen (host-driven, pausable, paused) set.
|
|
820
785
|
runFrameImpl(dt, { onlyFrozen: true });
|
|
821
786
|
},
|
|
822
787
|
},
|
|
@@ -952,7 +917,27 @@ export function createGame(opts) {
|
|
|
952
917
|
runFrameImpl(fixedDt, { skipRenderPhases });
|
|
953
918
|
}
|
|
954
919
|
},
|
|
955
|
-
loadInputMap(path) {
|
|
920
|
+
loadInputMap(path, options) {
|
|
921
|
+
if (options?.optional === true) {
|
|
922
|
+
// The conventional-path probe. It never becomes the game's declared
|
|
923
|
+
// map unless a file was actually there, so a root that DOES name a
|
|
924
|
+
// map (a sibling canvas root, a later mount) is never pre-empted by a
|
|
925
|
+
// probe that found nothing — the competing-path throw below would
|
|
926
|
+
// otherwise fire on a project that declared exactly one map.
|
|
927
|
+
if (inputMapPath)
|
|
928
|
+
return inputMapLoad ?? Promise.resolve();
|
|
929
|
+
let probe = inputMapProbes.get(path);
|
|
930
|
+
if (!probe) {
|
|
931
|
+
probe = input.loadMapIfPresent(path).then((loaded) => {
|
|
932
|
+
if (loaded && !inputMapPath) {
|
|
933
|
+
inputMapPath = path;
|
|
934
|
+
inputMapLoad = Promise.resolve();
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
inputMapProbes.set(path, probe);
|
|
938
|
+
}
|
|
939
|
+
return probe;
|
|
940
|
+
}
|
|
956
941
|
if (inputMapPath && inputMapPath !== path) {
|
|
957
942
|
throw new Error(`Game.loadInputMap: input map is already "${inputMapPath}"; root requested "${path}". ` +
|
|
958
943
|
'Input is game-owned, so roots cannot load competing maps.');
|
|
@@ -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,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;gEAC4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACzC;AAED,+EAA+E;AAC/E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,mBAAmB,EAC1B,GAAG,EAAE,4BAA4B,KAC9B,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAQtC;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAUlF;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D;AAcD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,EAAE,qBAexC,CAAC;AAMF,MAAM,WAAW,gBAAgB;IAC/B;;;kEAG8D;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC;CACrE;AAyBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,YAAY,EAClB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,WAAW,CAAC,CA6CtB"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// factory for that kind itself — see `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
|
}
|
|
@@ -106,15 +106,6 @@ export interface MountManifestOptions {
|
|
|
106
106
|
readonly seed?: number | undefined;
|
|
107
107
|
/** Host identity for a private play run or coordinated Team Test. */
|
|
108
108
|
readonly playtest?: PlaytestContext | null | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* The explicit per-mount answer to "are dev layers enabled" — forwarded
|
|
111
|
-
* verbatim to `devLayersEnabled` (`runtime/dev-layers.ts`), the ONE owner of
|
|
112
|
-
* that question. Omit it and the build decides (dev build ⇒ on; production
|
|
113
|
-
* build ⇒ off unless `VITE_VGAI_DEV_LAYERS=true`). A root declaring
|
|
114
|
-
* `dev: true` is simply not mounted when the answer is `false`, so a shipped
|
|
115
|
-
* build carries no dev GUI at all.
|
|
116
|
-
*/
|
|
117
|
-
readonly devLayers?: boolean | undefined;
|
|
118
109
|
/** Where to read `?vgai-seed=` from for the boot-time seed reader. Same
|
|
119
110
|
* override precedent as `debugBridge.url` (defaults to `window.location`
|
|
120
111
|
* when a real `window` exists; a headless caller with no override gets no
|
|
@@ -165,10 +156,6 @@ export declare function resolveManifest(raw: unknown): ResolvedGameManifest;
|
|
|
165
156
|
* ingest }` adapter with no caller-supplied adapter, or an empty manifest all
|
|
166
157
|
* throw a named `Error` identifying the world id, its kind, and what was
|
|
167
158
|
* expected — never a silent skip or a partially-mounted session.
|
|
168
|
-
*
|
|
169
|
-
* The ONE root that IS skipped silently is a `dev: true` dev layer when dev
|
|
170
|
-
* layers are disabled (`devLayersEnabled`) — that skip is the feature: it is
|
|
171
|
-
* what makes a dev GUI safe to leave in the game.
|
|
172
159
|
*/
|
|
173
160
|
export declare function mountManifestRoots(opts: MountManifestOptions): Promise<GameSession>;
|
|
174
161
|
//# sourceMappingURL=mount-manifest.d.ts.map
|
|
@@ -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;AAIvF,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;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,CAAC;AAM5E,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO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AAC;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;AA6HD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAsFzF"}
|
|
@@ -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
|
|
@@ -31,7 +30,6 @@ import { loadGameManifest, } from '../manifest/load';
|
|
|
31
30
|
import { createGameRuntime } from './create-runtime';
|
|
32
31
|
import { maybeInstallDebugBridge } from './debug-bridge';
|
|
33
32
|
import { getDebugRegistry } from './debug-registry';
|
|
34
|
-
import { devLayersEnabled } from './dev-layers';
|
|
35
33
|
import { getGameplayRngTrapControl } from './gameplay-rng-trap';
|
|
36
34
|
import { RENDER_SEED_QUERY_PARAM } from './render-seed';
|
|
37
35
|
/**
|
|
@@ -119,8 +117,9 @@ function resolveThreeAdapter(world, entry) {
|
|
|
119
117
|
}
|
|
120
118
|
if (world.adapter.type === 'ingest') {
|
|
121
119
|
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
|
-
|
|
120
|
+
"captured ingest roots require the editor's dev-server-backed mount machinery (an EditorStore " +
|
|
121
|
+
'plus in-realm scene capture, see resolveIngestDescriptor + ' +
|
|
122
|
+
'mountThreeIngestRootFromManifest) and are ' +
|
|
124
123
|
'not supported by mountManifestRoots (no porting aids, no hosted ingest routes).');
|
|
125
124
|
}
|
|
126
125
|
// type === 'default'
|
|
@@ -167,8 +166,6 @@ function buildRootMountSpec(world, entry) {
|
|
|
167
166
|
id: world.id,
|
|
168
167
|
zOrder: world.zOrder,
|
|
169
168
|
pausable: world.pausable,
|
|
170
|
-
dev: world.dev,
|
|
171
|
-
loop: world.loop,
|
|
172
169
|
};
|
|
173
170
|
// `entry`'s `kind` is guaranteed to agree with `world.kind` past the guard
|
|
174
171
|
// above (or `entry` is `undefined`) — TS can't narrow a `Record` lookup
|
|
@@ -209,10 +206,6 @@ function buildRootMountSpec(world, entry) {
|
|
|
209
206
|
* ingest }` adapter with no caller-supplied adapter, or an empty manifest all
|
|
210
207
|
* throw a named `Error` identifying the world id, its kind, and what was
|
|
211
208
|
* expected — never a silent skip or a partially-mounted session.
|
|
212
|
-
*
|
|
213
|
-
* The ONE root that IS skipped silently is a `dev: true` dev layer when dev
|
|
214
|
-
* layers are disabled (`devLayersEnabled`) — that skip is the feature: it is
|
|
215
|
-
* what makes a dev GUI safe to leave in the game.
|
|
216
209
|
*/
|
|
217
210
|
export async function mountManifestRoots(opts) {
|
|
218
211
|
const manifest = resolveManifest(opts.manifest);
|
|
@@ -220,20 +213,7 @@ export async function mountManifestRoots(opts) {
|
|
|
220
213
|
throw new Error('mountManifestRoots: manifest declares no roots — nothing to mount.');
|
|
221
214
|
}
|
|
222
215
|
const entries = opts.entries ?? {};
|
|
223
|
-
|
|
224
|
-
// only when dev layers are enabled, so a production build carries no dev
|
|
225
|
-
// GUI. The answer comes from `devLayersEnabled` and nowhere else — see that
|
|
226
|
-
// function's header for why there is exactly one owner. Dropping the root
|
|
227
|
-
// here (rather than mounting it hidden) is deliberate: nothing of the dev
|
|
228
|
-
// layer is constructed, so its entry module's cost and its DOM never exist
|
|
229
|
-
// in a shipped build.
|
|
230
|
-
const devEnabled = devLayersEnabled(opts.devLayers);
|
|
231
|
-
const mountable = devEnabled ? manifest.roots : manifest.roots.filter((world) => !world.dev);
|
|
232
|
-
if (mountable.length === 0) {
|
|
233
|
-
throw new Error('mountManifestRoots: every root in this manifest is a dev layer (`dev: true`) and dev ' +
|
|
234
|
-
'layers are disabled for this build — there is no game to mount.');
|
|
235
|
-
}
|
|
236
|
-
const roots = mountable.map((world) => buildRootMountSpec(world, entries[world.id]));
|
|
216
|
+
const roots = manifest.roots.map((world) => buildRootMountSpec(world, entries[world.id]));
|
|
237
217
|
// D15 (T-D15.1) — resolved BEFORE `createGameRuntime` (which constructs the
|
|
238
218
|
// Game, and therefore `ctx.random`, before any world's `mount()`/`setup()`
|
|
239
219
|
// runs — see `createGame`'s own doc comment): the seed must be baked in at
|
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,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,YAA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SAAS,CAAC;IACxB;yDACqD;IACrD,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAChD;4EACwE;IACxE,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/C;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,WAAW,EACX,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,uBAAuB,CACzF,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,cAAc,CAAC,EAAE;QACf,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KAC9C,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;sEAMsE;AACtE,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -28,10 +28,9 @@ export declare function applyRendererSettings(renderer: THREE.WebGLRenderer, ren
|
|
|
28
28
|
* reload-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,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO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AAG,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
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-bridge.d.ts","sourceRoot":"","sources":["../../src/world3d-react/engine-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"engine-bridge.d.ts","sourceRoot":"","sources":["../../src/world3d-react/engine-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC;;wCAEoC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC3C;AAED,eAAO,MAAM,YAAY,mDAAgD,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,IAAI,cAAc,CAkC/C"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* component reaches engine services.
|
|
15
15
|
*/
|
|
16
16
|
import { createContext, useContext } from 'react';
|
|
17
|
+
import { useOptionalGame } from '../react/world-state';
|
|
17
18
|
export const EngineBridge = createContext(null);
|
|
18
19
|
/**
|
|
19
20
|
* This R3F root's context, for use inside any component in the tree — an
|
|
@@ -28,7 +29,7 @@ export const EngineBridge = createContext(null);
|
|
|
28
29
|
* function Player({ speed = 4.5 }) {
|
|
29
30
|
* const { input } = useGameContext();
|
|
30
31
|
* const ref = useRef<THREE.Group>(null);
|
|
31
|
-
* useFrame((_, dt) => { if (input
|
|
32
|
+
* useFrame((_, dt) => { if (input?.isPressed('move_forward')) … });
|
|
32
33
|
* return <group ref={ref}><PlayerCharacter /></group>;
|
|
33
34
|
* }
|
|
34
35
|
* ```
|
|
@@ -39,10 +40,34 @@ export const EngineBridge = createContext(null);
|
|
|
39
40
|
*/
|
|
40
41
|
export function useGameContext() {
|
|
41
42
|
const bridge = useContext(EngineBridge);
|
|
43
|
+
// Read unconditionally (rules of hooks) — used only to shape the throw below.
|
|
44
|
+
const hostedByGame = useOptionalGame() !== null;
|
|
42
45
|
if (!bridge?.ctx) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
// NAME THE REAL CAUSE. This throw used to say "check that the component is
|
|
47
|
+
// rendered inside your world entry" — advice a scaffolded game has already
|
|
48
|
+
// followed, because the shape `vgai create` produces (`export default
|
|
49
|
+
// function World()`) mounts as a COMPONENT ROOT and receives no vgai
|
|
50
|
+
// runtime context at all: `r3f-root-factory.tsx` passes
|
|
51
|
+
// `engineRuntime: false` deliberately, so this hook can never resolve
|
|
52
|
+
// there however the component is nested. A world whose first render calls
|
|
53
|
+
// it dies with "fiber crashed before its first commit" and a fix
|
|
54
|
+
// instruction that cannot work. The `Game` in scope tells the two cases
|
|
55
|
+
// apart: present means a vgai-mounted world, absent means no root at all.
|
|
56
|
+
throw new Error(hostedByGame
|
|
57
|
+
? 'useGameContext(): this world mounts as a COMPONENT ROOT (the default-exported ' +
|
|
58
|
+
'shape `vgai create` scaffolds) and receives no vgai runtime context — by design, ' +
|
|
59
|
+
'so nesting cannot fix it. Game-scoped services are on the Game handle instead: ' +
|
|
60
|
+
'`useGame().input` (from @vgai/engine/react/world-state) is the game-owned ' +
|
|
61
|
+
"InputManager the host already loaded this project's input map into and the same " +
|
|
62
|
+
'one `game.input.hold/tap` drives; `useDebugProvider`/`useDebugCommand`/' +
|
|
63
|
+
'`useWorldState` are the state/command doors. If this world genuinely needs the ' +
|
|
64
|
+
'imperative runtime (`ctx.systems`, adapter options like `inputMapPath`), export ' +
|
|
65
|
+
'`adapter = createR3FAdapter({ id, content: <World/> })` from the entry instead of ' +
|
|
66
|
+
'default-exporting the component.'
|
|
67
|
+
: 'useGameContext(): no engine root context and no Game in scope — this component is ' +
|
|
68
|
+
'rendering outside any mounted vgai root (a standalone <Canvas>, a story, or a ' +
|
|
69
|
+
"bare test render). Mount it through your project's three root, or read services " +
|
|
70
|
+
'the component root way (native hooks and project-owned state).');
|
|
46
71
|
}
|
|
47
72
|
return bridge.ctx;
|
|
48
73
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* Deliberately NOT re-exported here: `<RapierPhysicsBridge>`
|
|
34
34
|
* (`@engine/world3d-react/rapier-physics-bridge`), which registers an R3F
|
|
35
35
|
* world's `@react-three/rapier` physics as the game's
|
|
36
|
-
* `SystemAdapters.physics` — so the
|
|
36
|
+
* `SystemAdapters.physics` — so the colliders instrument and the
|
|
37
37
|
* editor's transform coordination can see it. It imports
|
|
38
38
|
* `@react-three/rapier`, and only a world that already depends on that library
|
|
39
39
|
* should pull it into its graph; a deep import keeps this barrel's peer
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* Deliberately NOT re-exported here: `<RapierPhysicsBridge>`
|
|
34
34
|
* (`@engine/world3d-react/rapier-physics-bridge`), which registers an R3F
|
|
35
35
|
* world's `@react-three/rapier` physics as the game's
|
|
36
|
-
* `SystemAdapters.physics` — so the
|
|
36
|
+
* `SystemAdapters.physics` — so the colliders instrument and the
|
|
37
37
|
* editor's transform coordination can see it. It imports
|
|
38
38
|
* `@react-three/rapier`, and only a world that already depends on that library
|
|
39
39
|
* should pull it into its graph; a deep import keeps this barrel's peer
|
|
@@ -35,6 +35,13 @@ export interface CreateR3FAdapterOptions {
|
|
|
35
35
|
* actions). A missing/invalid map degrades loudly without failing the
|
|
36
36
|
* mount — see `world-context.ts`. */
|
|
37
37
|
readonly inputMapPath?: string | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Transitional compatibility for explicit pre-native adapters. The
|
|
40
|
+
* default-export root factory always passes `false`: ordinary R3F trees get
|
|
41
|
+
* no vgai context/provider or private scheduler. Remove this switch with
|
|
42
|
+
* the last explicit legacy adapter migration.
|
|
43
|
+
*/
|
|
44
|
+
readonly engineRuntime?: boolean | undefined;
|
|
38
45
|
/** The colour pipeline this world was AUTHORED for, applied to the host's renderer for the life
|
|
39
46
|
* of the mount and restored on dispose. Omit it (every world here does) to keep the host's own
|
|
40
47
|
* defaults; declare it when the world's colours were picked against a different engine's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r3f-adapter.d.ts","sourceRoot":"","sources":["../../src/world3d-react/r3f-adapter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"r3f-adapter.d.ts","sourceRoot":"","sources":["../../src/world3d-react/r3f-adapter.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAWH,OAAO,EAA2B,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AACpF,OAAO,KAAK,EAAoB,WAAW,EAAoB,MAAM,YAAY,CAAC;AAgBlF,OAAO,EAA4B,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAgDvF,sEAAsE;AACtE,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;uBAEmB;IACnB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B;;;;0CAIsC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7C;;;iDAG6C;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACrD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,WAAW,CA2kB9E"}
|