@vgai/engine 0.2.0 → 0.3.0
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/README.md +3 -1
- package/dist/adapter/authoring.d.ts +404 -0
- package/dist/adapter/authoring.d.ts.map +1 -0
- package/dist/adapter/authoring.js +22 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts +43 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
- package/dist/adapter/colyseus-networking-adapter.js +38 -0
- package/dist/adapter/first-party-systems.d.ts +38 -0
- package/dist/adapter/first-party-systems.d.ts.map +1 -0
- package/dist/adapter/first-party-systems.js +77 -0
- package/dist/adapter/game-adapter.d.ts +133 -0
- package/dist/adapter/game-adapter.d.ts.map +1 -0
- package/dist/adapter/game-adapter.js +10 -0
- package/dist/adapter/host-context.d.ts +73 -0
- package/dist/adapter/host-context.d.ts.map +1 -0
- package/dist/adapter/host-context.js +16 -0
- package/dist/adapter/index.d.ts +22 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +15 -0
- package/dist/adapter/ingest/game-contract.d.ts +53 -0
- package/dist/adapter/ingest/game-contract.d.ts.map +1 -0
- package/dist/adapter/ingest/game-contract.js +30 -0
- package/dist/adapter/ingest/overlay-applier.d.ts +118 -0
- package/dist/adapter/ingest/overlay-applier.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-applier.js +132 -0
- package/dist/adapter/ingest/overlay-apply.d.ts +60 -0
- package/dist/adapter/ingest/overlay-apply.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-apply.js +101 -0
- package/dist/adapter/ingest/overlay-file.d.ts +79 -0
- package/dist/adapter/ingest/overlay-file.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-file.js +66 -0
- package/dist/adapter/ingest/overlay-report.d.ts +113 -0
- package/dist/adapter/ingest/overlay-report.d.ts.map +1 -0
- package/dist/adapter/ingest/overlay-report.js +103 -0
- package/dist/adapter/ingest/scene-capture.d.ts +97 -0
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
- package/dist/adapter/ingest/scene-capture.js +248 -0
- package/dist/adapter/ingest/upstream-pin.d.ts +47 -0
- package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
- package/dist/adapter/ingest/upstream-pin.js +50 -0
- package/dist/adapter/loop-gate-report.d.ts +34 -0
- package/dist/adapter/loop-gate-report.d.ts.map +1 -0
- package/dist/adapter/loop-gate-report.js +37 -0
- package/dist/adapter/rapier-physics-adapter.d.ts +12 -0
- package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
- package/dist/adapter/rapier-physics-adapter.js +46 -0
- package/dist/adapter/system-adapter.d.ts +133 -0
- package/dist/adapter/system-adapter.d.ts.map +1 -0
- package/dist/adapter/system-adapter.js +13 -0
- package/dist/adapter/transform.d.ts +18 -0
- package/dist/adapter/transform.d.ts.map +1 -0
- package/dist/adapter/transform.js +1 -0
- package/dist/adapter/vgai-scene-game-adapter.d.ts +116 -0
- package/dist/adapter/vgai-scene-game-adapter.d.ts.map +1 -0
- package/dist/adapter/vgai-scene-game-adapter.js +714 -0
- package/dist/adapter/world-kind.d.ts +30 -0
- package/dist/adapter/world-kind.d.ts.map +1 -0
- package/dist/adapter/world-kind.js +18 -0
- package/dist/ai/navigation.d.ts +64 -0
- package/dist/ai/navigation.d.ts.map +1 -0
- package/dist/ai/navigation.js +133 -0
- package/dist/animation/anim-graph-types.d.ts +25 -0
- package/dist/animation/anim-graph-types.d.ts.map +1 -0
- package/dist/animation/anim-graph-types.js +1 -0
- package/dist/animation/animation-clock.d.ts +213 -0
- package/dist/animation/animation-clock.d.ts.map +1 -0
- package/dist/animation/animation-clock.js +301 -0
- package/dist/animation/blend-node.d.ts +22 -0
- package/dist/animation/blend-node.d.ts.map +1 -0
- package/dist/animation/blend-node.js +97 -0
- package/dist/animation/camera-ownership.d.ts +250 -0
- package/dist/animation/camera-ownership.d.ts.map +1 -0
- package/dist/animation/camera-ownership.js +169 -0
- package/dist/animation/cinematic-cues.d.ts +200 -0
- package/dist/animation/cinematic-cues.d.ts.map +1 -0
- package/dist/animation/cinematic-cues.js +213 -0
- package/dist/animation/clip-map.d.ts +12 -0
- package/dist/animation/clip-map.d.ts.map +1 -0
- package/dist/animation/clip-map.js +37 -0
- package/dist/animation/gsap-registration.d.ts +119 -0
- package/dist/animation/gsap-registration.d.ts.map +1 -0
- package/dist/animation/gsap-registration.js +92 -0
- package/dist/animation/theatre-clock-binding.d.ts +89 -0
- package/dist/animation/theatre-clock-binding.d.ts.map +1 -0
- package/dist/animation/theatre-clock-binding.js +29 -0
- package/dist/animation/theatre-director.d.ts +242 -0
- package/dist/animation/theatre-director.d.ts.map +1 -0
- package/dist/animation/theatre-director.js +235 -0
- package/dist/animation/theatre-object-binding.d.ts +305 -0
- package/dist/animation/theatre-object-binding.d.ts.map +1 -0
- package/dist/animation/theatre-object-binding.js +351 -0
- package/dist/animation/xstate-animation-binding.d.ts +111 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
- package/dist/animation/xstate-animation-binding.js +307 -0
- package/dist/animation/xstate-animation-meta.d.ts +228 -0
- package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
- package/dist/animation/xstate-animation-meta.js +221 -0
- package/dist/assets.d.ts +26 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +55 -0
- package/dist/audio/index.d.ts +4 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +24 -0
- package/dist/audio/tone-clock-binding.d.ts +75 -0
- package/dist/audio/tone-clock-binding.d.ts.map +1 -0
- package/dist/audio/tone-clock-binding.js +29 -0
- package/dist/audio/tone-context.d.ts +114 -0
- package/dist/audio/tone-context.d.ts.map +1 -0
- package/dist/audio/tone-context.js +39 -0
- package/dist/audio/tone-offline-render.d.ts +90 -0
- package/dist/audio/tone-offline-render.d.ts.map +1 -0
- package/dist/audio/tone-offline-render.js +56 -0
- package/dist/audio/wav-encode.d.ts +38 -0
- package/dist/audio/wav-encode.d.ts.map +1 -0
- package/dist/audio/wav-encode.js +97 -0
- package/dist/core/game-loop.d.ts +21 -0
- package/dist/core/game-loop.d.ts.map +1 -0
- package/dist/core/game-loop.js +130 -0
- package/dist/core/system-runner.d.ts +120 -0
- package/dist/core/system-runner.d.ts.map +1 -0
- package/dist/core/system-runner.js +286 -0
- package/dist/core/types.d.ts +58 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +25 -0
- package/dist/data/data-asset.d.ts +101 -0
- package/dist/data/data-asset.d.ts.map +1 -0
- package/dist/data/data-asset.js +122 -0
- package/dist/data/data-check-core.d.ts +110 -0
- package/dist/data/data-check-core.d.ts.map +1 -0
- package/dist/data/data-check-core.js +178 -0
- package/dist/data/data-ref.d.ts +79 -0
- package/dist/data/data-ref.d.ts.map +1 -0
- package/dist/data/data-ref.js +130 -0
- package/dist/data/vite-plugin-data.d.ts +79 -0
- package/dist/data/vite-plugin-data.d.ts.map +1 -0
- package/dist/data/vite-plugin-data.js +217 -0
- package/dist/dev/console-bridge.d.ts +22 -0
- package/dist/dev/console-bridge.d.ts.map +1 -0
- package/dist/dev/console-bridge.js +71 -0
- package/dist/dev/debug-draw.d.ts +24 -0
- package/dist/dev/debug-draw.d.ts.map +1 -0
- package/dist/dev/debug-draw.js +73 -0
- package/dist/dev/logger.d.ts +30 -0
- package/dist/dev/logger.d.ts.map +1 -0
- package/dist/dev/logger.js +90 -0
- package/dist/ecs/component-manager.d.ts +189 -0
- package/dist/ecs/component-manager.d.ts.map +1 -0
- package/dist/ecs/component-manager.js +676 -0
- package/dist/ecs/game-component.d.ts +97 -0
- package/dist/ecs/game-component.d.ts.map +1 -0
- package/dist/ecs/game-component.js +80 -0
- package/dist/ecs/hmr-swap-report.d.ts +53 -0
- package/dist/ecs/hmr-swap-report.d.ts.map +1 -0
- package/dist/ecs/hmr-swap-report.js +55 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/input/input-manager.d.ts +596 -0
- package/dist/input/input-manager.d.ts.map +1 -0
- package/dist/input/input-manager.js +1564 -0
- package/dist/input/input-types.d.ts +171 -0
- package/dist/input/input-types.d.ts.map +1 -0
- package/dist/input/input-types.js +1 -0
- package/dist/input/prompt-labels.d.ts +21 -0
- package/dist/input/prompt-labels.d.ts.map +1 -0
- package/dist/input/prompt-labels.js +121 -0
- package/dist/input/rebind-controller.d.ts +59 -0
- package/dist/input/rebind-controller.d.ts.map +1 -0
- package/dist/input/rebind-controller.js +85 -0
- package/dist/input/schema.d.ts +16 -0
- package/dist/input/schema.d.ts.map +1 -0
- package/dist/input/schema.js +228 -0
- package/dist/loader.d.ts +43 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +59 -0
- package/dist/manifest/index.d.ts +5 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +8 -0
- package/dist/manifest/load-file.d.ts +4 -0
- package/dist/manifest/load-file.d.ts.map +1 -0
- package/dist/manifest/load-file.js +14 -0
- package/dist/manifest/load.d.ts +117 -0
- package/dist/manifest/load.d.ts.map +1 -0
- package/dist/manifest/load.js +255 -0
- package/dist/manifest/schema.d.ts +173 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +302 -0
- package/dist/physics/collision-system.d.ts +41 -0
- package/dist/physics/collision-system.d.ts.map +1 -0
- package/dist/physics/collision-system.js +64 -0
- package/dist/physics/physics-registry.d.ts +45 -0
- package/dist/physics/physics-registry.d.ts.map +1 -0
- package/dist/physics/physics-registry.js +65 -0
- package/dist/physics/transform-writer.d.ts +16 -0
- package/dist/physics/transform-writer.d.ts.map +1 -0
- package/dist/physics/transform-writer.js +38 -0
- package/dist/physics/trigger-dispatch.d.ts +24 -0
- package/dist/physics/trigger-dispatch.d.ts.map +1 -0
- package/dist/physics/trigger-dispatch.js +80 -0
- package/dist/react/game-state.d.ts +105 -0
- package/dist/react/game-state.d.ts.map +1 -0
- package/dist/react/game-state.js +144 -0
- package/dist/react/use-data.d.ts +60 -0
- package/dist/react/use-data.d.ts.map +1 -0
- package/dist/react/use-data.js +96 -0
- package/dist/react/use-selection.d.ts +75 -0
- package/dist/react/use-selection.d.ts.map +1 -0
- package/dist/react/use-selection.js +90 -0
- package/dist/render/auto-batcher.d.ts +34 -0
- package/dist/render/auto-batcher.d.ts.map +1 -0
- package/dist/render/auto-batcher.js +140 -0
- package/dist/render/render-batch-system.d.ts +33 -0
- package/dist/render/render-batch-system.d.ts.map +1 -0
- package/dist/render/render-batch-system.js +230 -0
- package/dist/render/render-features.d.ts +47 -0
- package/dist/render/render-features.d.ts.map +1 -0
- package/dist/render/render-features.js +105 -0
- package/dist/render/render-settings.d.ts +36 -0
- package/dist/render/render-settings.d.ts.map +1 -0
- package/dist/render/render-settings.js +51 -0
- package/dist/runtime/create-runtime.d.ts +280 -0
- package/dist/runtime/create-runtime.d.ts.map +1 -0
- package/dist/runtime/create-runtime.js +795 -0
- package/dist/runtime/frame-selector-cache.d.ts +41 -0
- package/dist/runtime/frame-selector-cache.d.ts.map +1 -0
- package/dist/runtime/frame-selector-cache.js +65 -0
- package/dist/runtime/game.d.ts +433 -0
- package/dist/runtime/game.d.ts.map +1 -0
- package/dist/runtime/game.js +569 -0
- package/dist/runtime/input-router.d.ts +78 -0
- package/dist/runtime/input-router.d.ts.map +1 -0
- package/dist/runtime/input-router.js +171 -0
- package/dist/runtime/mount-game.d.ts +129 -0
- package/dist/runtime/mount-game.d.ts.map +1 -0
- package/dist/runtime/mount-game.js +152 -0
- package/dist/runtime/mount-manifest.d.ts +119 -0
- package/dist/runtime/mount-manifest.d.ts.map +1 -0
- package/dist/runtime/mount-manifest.js +204 -0
- package/dist/runtime/render-audio-control.d.ts +110 -0
- package/dist/runtime/render-audio-control.d.ts.map +1 -0
- package/dist/runtime/render-audio-control.js +111 -0
- package/dist/runtime/render-control.d.ts +291 -0
- package/dist/runtime/render-control.d.ts.map +1 -0
- package/dist/runtime/render-control.js +264 -0
- package/dist/runtime/render-seed.d.ts +57 -0
- package/dist/runtime/render-seed.d.ts.map +1 -0
- package/dist/runtime/render-seed.js +74 -0
- package/dist/runtime/scene-ui-bridge.d.ts +69 -0
- package/dist/runtime/scene-ui-bridge.d.ts.map +1 -0
- package/dist/runtime/scene-ui-bridge.js +23 -0
- package/dist/runtime/scene-ui-data.d.ts +13 -0
- package/dist/runtime/scene-ui-data.d.ts.map +1 -0
- package/dist/runtime/scene-ui-data.js +92 -0
- package/dist/runtime/state-bridge.d.ts +47 -0
- package/dist/runtime/state-bridge.d.ts.map +1 -0
- package/dist/runtime/state-bridge.js +53 -0
- package/dist/runtime/types.d.ts +179 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +1 -0
- package/dist/scene/asset-loaders.d.ts +79 -0
- package/dist/scene/asset-loaders.d.ts.map +1 -0
- package/dist/scene/asset-loaders.js +141 -0
- package/dist/scene/asset-paths.d.ts +11 -0
- package/dist/scene/asset-paths.d.ts.map +1 -0
- package/dist/scene/asset-paths.js +108 -0
- package/dist/scene/asset-ref-check.d.ts +88 -0
- package/dist/scene/asset-ref-check.d.ts.map +1 -0
- package/dist/scene/asset-ref-check.js +214 -0
- package/dist/scene/asset-registry.d.ts +30 -0
- package/dist/scene/asset-registry.d.ts.map +1 -0
- package/dist/scene/asset-registry.js +50 -0
- package/dist/scene/collider-dimensions.d.ts +63 -0
- package/dist/scene/collider-dimensions.d.ts.map +1 -0
- package/dist/scene/collider-dimensions.js +98 -0
- package/dist/scene/component-registry.d.ts +17 -0
- package/dist/scene/component-registry.d.ts.map +1 -0
- package/dist/scene/component-registry.js +28 -0
- package/dist/scene/defaults.d.ts +252 -0
- package/dist/scene/defaults.d.ts.map +1 -0
- package/dist/scene/defaults.js +151 -0
- package/dist/scene/geometries/index.d.ts +8 -0
- package/dist/scene/geometries/index.d.ts.map +1 -0
- package/dist/scene/geometries/index.js +7 -0
- package/dist/scene/geometries/terrain.d.ts +2 -0
- package/dist/scene/geometries/terrain.d.ts.map +1 -0
- package/dist/scene/geometries/terrain.js +37 -0
- package/dist/scene/geometry-registry.d.ts +24 -0
- package/dist/scene/geometry-registry.d.ts.map +1 -0
- package/dist/scene/geometry-registry.js +20 -0
- package/dist/scene/instance-registry.d.ts +36 -0
- package/dist/scene/instance-registry.d.ts.map +1 -0
- package/dist/scene/instance-registry.js +55 -0
- package/dist/scene/instancers/grid.d.ts +2 -0
- package/dist/scene/instancers/grid.d.ts.map +1 -0
- package/dist/scene/instancers/grid.js +36 -0
- package/dist/scene/instancers/index.d.ts +8 -0
- package/dist/scene/instancers/index.d.ts.map +1 -0
- package/dist/scene/instancers/index.js +7 -0
- package/dist/scene/light-camera-factory.d.ts +23 -0
- package/dist/scene/light-camera-factory.d.ts.map +1 -0
- package/dist/scene/light-camera-factory.js +68 -0
- package/dist/scene/material-factory.d.ts +17 -0
- package/dist/scene/material-factory.d.ts.map +1 -0
- package/dist/scene/material-factory.js +197 -0
- package/dist/scene/material-registry.d.ts +40 -0
- package/dist/scene/material-registry.d.ts.map +1 -0
- package/dist/scene/material-registry.js +44 -0
- package/dist/scene/materials/index.d.ts +8 -0
- package/dist/scene/materials/index.d.ts.map +1 -0
- package/dist/scene/materials/index.js +7 -0
- package/dist/scene/materials/water.d.ts +2 -0
- package/dist/scene/materials/water.d.ts.map +1 -0
- package/dist/scene/materials/water.js +54 -0
- package/dist/scene/parse.d.ts +23 -0
- package/dist/scene/parse.d.ts.map +1 -0
- package/dist/scene/parse.js +179 -0
- package/dist/scene/particles-factory.d.ts +33 -0
- package/dist/scene/particles-factory.d.ts.map +1 -0
- package/dist/scene/particles-factory.js +282 -0
- package/dist/scene/scene-apply.d.ts +109 -0
- package/dist/scene/scene-apply.d.ts.map +1 -0
- package/dist/scene/scene-apply.js +326 -0
- package/dist/scene/scene-diff-schema.d.ts +285 -0
- package/dist/scene/scene-diff-schema.d.ts.map +1 -0
- package/dist/scene/scene-diff-schema.js +92 -0
- package/dist/scene/scene-diff-types.d.ts +40 -0
- package/dist/scene/scene-diff-types.d.ts.map +1 -0
- package/dist/scene/scene-diff-types.js +14 -0
- package/dist/scene/scene-loader.d.ts +177 -0
- package/dist/scene/scene-loader.d.ts.map +1 -0
- package/dist/scene/scene-loader.js +1213 -0
- package/dist/scene/scene-query.d.ts +11 -0
- package/dist/scene/scene-query.d.ts.map +1 -0
- package/dist/scene/scene-query.js +63 -0
- package/dist/scene/scene-types.d.ts +10 -0
- package/dist/scene/scene-types.d.ts.map +1 -0
- package/dist/scene/scene-types.js +8 -0
- package/dist/scene/scene-version.d.ts +26 -0
- package/dist/scene/scene-version.d.ts.map +1 -0
- package/dist/scene/scene-version.js +34 -0
- package/dist/scene/schema/animation.d.ts +8 -0
- package/dist/scene/schema/animation.d.ts.map +1 -0
- package/dist/scene/schema/animation.js +42 -0
- package/dist/scene/schema/audio.d.ts +13 -0
- package/dist/scene/schema/audio.d.ts.map +1 -0
- package/dist/scene/schema/audio.js +22 -0
- package/dist/scene/schema/camera.d.ts +28 -0
- package/dist/scene/schema/camera.d.ts.map +1 -0
- package/dist/scene/schema/camera.js +17 -0
- package/dist/scene/schema/collider.d.ts +40 -0
- package/dist/scene/schema/collider.d.ts.map +1 -0
- package/dist/scene/schema/collider.js +55 -0
- package/dist/scene/schema/entity-ref.d.ts +31 -0
- package/dist/scene/schema/entity-ref.d.ts.map +1 -0
- package/dist/scene/schema/entity-ref.js +61 -0
- package/dist/scene/schema/entity.d.ts +1036 -0
- package/dist/scene/schema/entity.d.ts.map +1 -0
- package/dist/scene/schema/entity.js +153 -0
- package/dist/scene/schema/environment.d.ts +425 -0
- package/dist/scene/schema/environment.d.ts.map +1 -0
- package/dist/scene/schema/environment.js +357 -0
- package/dist/scene/schema/index.d.ts +39 -0
- package/dist/scene/schema/index.d.ts.map +1 -0
- package/dist/scene/schema/index.js +20 -0
- package/dist/scene/schema/instances.d.ts +14 -0
- package/dist/scene/schema/instances.d.ts.map +1 -0
- package/dist/scene/schema/instances.js +28 -0
- package/dist/scene/schema/joint.d.ts +23 -0
- package/dist/scene/schema/joint.d.ts.map +1 -0
- package/dist/scene/schema/joint.js +23 -0
- package/dist/scene/schema/light.d.ts +38 -0
- package/dist/scene/schema/light.d.ts.map +1 -0
- package/dist/scene/schema/light.js +26 -0
- package/dist/scene/schema/material.d.ts +199 -0
- package/dist/scene/schema/material.d.ts.map +1 -0
- package/dist/scene/schema/material.js +99 -0
- package/dist/scene/schema/mesh.d.ts +48 -0
- package/dist/scene/schema/mesh.d.ts.map +1 -0
- package/dist/scene/schema/mesh.js +82 -0
- package/dist/scene/schema/particles.d.ts +2178 -0
- package/dist/scene/schema/particles.d.ts.map +1 -0
- package/dist/scene/schema/particles.js +321 -0
- package/dist/scene/schema/physics.d.ts +56 -0
- package/dist/scene/schema/physics.d.ts.map +1 -0
- package/dist/scene/schema/physics.js +37 -0
- package/dist/scene/schema/scene-file.d.ts +304 -0
- package/dist/scene/schema/scene-file.d.ts.map +1 -0
- package/dist/scene/schema/scene-file.js +262 -0
- package/dist/scene/schema/shadow.d.ts +28 -0
- package/dist/scene/schema/shadow.d.ts.map +1 -0
- package/dist/scene/schema/shadow.js +20 -0
- package/dist/scene/schema/spline.d.ts +25 -0
- package/dist/scene/schema/spline.d.ts.map +1 -0
- package/dist/scene/schema/spline.js +15 -0
- package/dist/scene/schema/tuples.d.ts +12 -0
- package/dist/scene/schema/tuples.d.ts.map +1 -0
- package/dist/scene/schema/tuples.js +14 -0
- package/dist/scene/schema/ui.d.ts +880 -0
- package/dist/scene/schema/ui.d.ts.map +1 -0
- package/dist/scene/schema/ui.js +506 -0
- package/dist/scene/user-data.d.ts +171 -0
- package/dist/scene/user-data.d.ts.map +1 -0
- package/dist/scene/user-data.js +137 -0
- package/dist/setup/setup-audio.d.ts +20 -0
- package/dist/setup/setup-audio.d.ts.map +1 -0
- package/dist/setup/setup-audio.js +41 -0
- package/dist/setup/setup-particles.d.ts +17 -0
- package/dist/setup/setup-particles.d.ts.map +1 -0
- package/dist/setup/setup-particles.js +16 -0
- package/dist/setup/setup-physics.d.ts +25 -0
- package/dist/setup/setup-physics.d.ts.map +1 -0
- package/dist/setup/setup-physics.js +51 -0
- package/dist/setup/setup-renderer.d.ts +69 -0
- package/dist/setup/setup-renderer.d.ts.map +1 -0
- package/dist/setup/setup-renderer.js +363 -0
- package/dist/tools/define-tool.d.ts +105 -0
- package/dist/tools/define-tool.d.ts.map +1 -0
- package/dist/tools/define-tool.js +82 -0
- package/dist/world2d/authoring-2d.d.ts +76 -0
- package/dist/world2d/authoring-2d.d.ts.map +1 -0
- package/dist/world2d/authoring-2d.js +176 -0
- package/dist/world2d/capture-to-scene2d.d.ts +5 -0
- package/dist/world2d/capture-to-scene2d.d.ts.map +1 -0
- package/dist/world2d/capture-to-scene2d.js +49 -0
- package/dist/world2d/collision-2d.d.ts +52 -0
- package/dist/world2d/collision-2d.d.ts.map +1 -0
- package/dist/world2d/collision-2d.js +70 -0
- package/dist/world2d/components-2d.d.ts +47 -0
- package/dist/world2d/components-2d.d.ts.map +1 -0
- package/dist/world2d/components-2d.js +77 -0
- package/dist/world2d/index.d.ts +34 -0
- package/dist/world2d/index.d.ts.map +1 -0
- package/dist/world2d/index.js +32 -0
- package/dist/world2d/ingest-iframe-2d.d.ts +82 -0
- package/dist/world2d/ingest-iframe-2d.d.ts.map +1 -0
- package/dist/world2d/ingest-iframe-2d.js +166 -0
- package/dist/world2d/ingest2d.d.ts +97 -0
- package/dist/world2d/ingest2d.d.ts.map +1 -0
- package/dist/world2d/ingest2d.js +40 -0
- package/dist/world2d/physics2d-registry.d.ts +24 -0
- package/dist/world2d/physics2d-registry.d.ts.map +1 -0
- package/dist/world2d/physics2d-registry.js +38 -0
- package/dist/world2d/pixi-game-adapter.d.ts +107 -0
- package/dist/world2d/pixi-game-adapter.d.ts.map +1 -0
- package/dist/world2d/pixi-game-adapter.js +211 -0
- package/dist/world2d/pixi-surface.d.ts +39 -0
- package/dist/world2d/pixi-surface.d.ts.map +1 -0
- package/dist/world2d/pixi-surface.js +47 -0
- package/dist/world2d/scene-capture-2d.d.ts +43 -0
- package/dist/world2d/scene-capture-2d.d.ts.map +1 -0
- package/dist/world2d/scene-capture-2d.js +92 -0
- package/dist/world2d/scene2d-loader.d.ts +27 -0
- package/dist/world2d/scene2d-loader.d.ts.map +1 -0
- package/dist/world2d/scene2d-loader.js +274 -0
- package/dist/world2d/schema/entity2d.d.ts +102 -0
- package/dist/world2d/schema/entity2d.d.ts.map +1 -0
- package/dist/world2d/schema/entity2d.js +119 -0
- package/dist/world2d/schema/physics2d.d.ts +46 -0
- package/dist/world2d/schema/physics2d.d.ts.map +1 -0
- package/dist/world2d/schema/physics2d.js +45 -0
- package/dist/world2d/schema/sprite.d.ts +42 -0
- package/dist/world2d/schema/sprite.d.ts.map +1 -0
- package/dist/world2d/schema/sprite.js +63 -0
- package/dist/world2d/schema/tilemap.d.ts +15 -0
- package/dist/world2d/schema/tilemap.d.ts.map +1 -0
- package/dist/world2d/schema/tilemap.js +19 -0
- package/dist/world2d/schema/tuples2d.d.ts +20 -0
- package/dist/world2d/schema/tuples2d.d.ts.map +1 -0
- package/dist/world2d/schema/tuples2d.js +19 -0
- package/dist/world2d/system-adapters-2d.d.ts +16 -0
- package/dist/world2d/system-adapters-2d.d.ts.map +1 -0
- package/dist/world2d/system-adapters-2d.js +37 -0
- package/dist/world2d/transform-writer-2d.d.ts +16 -0
- package/dist/world2d/transform-writer-2d.d.ts.map +1 -0
- package/dist/world2d/transform-writer-2d.js +22 -0
- package/dist/world2d/types.d.ts +53 -0
- package/dist/world2d/types.d.ts.map +1 -0
- package/dist/world2d/types.js +1 -0
- package/package.json +18 -4
- package/src/adapter/authoring.ts +10 -0
- package/src/adapter/first-party-systems.ts +23 -34
- package/src/adapter/index.ts +1 -3
- package/src/adapter/system-adapter.ts +15 -22
- package/src/adapter/vgai-scene-game-adapter.ts +5 -14
- package/src/animation/anim-graph-types.ts +12 -43
- package/src/animation/animation-clock.ts +479 -0
- package/src/animation/camera-ownership.ts +467 -0
- package/src/animation/cinematic-cues.ts +451 -0
- package/src/animation/clip-map.ts +41 -0
- package/src/animation/gsap-registration.ts +184 -0
- package/src/animation/theatre-clock-binding.ts +111 -0
- package/src/animation/theatre-director.ts +347 -0
- package/src/animation/theatre-object-binding.ts +661 -0
- package/src/animation/xstate-animation-binding.ts +398 -0
- package/src/animation/xstate-animation-meta.ts +282 -0
- package/src/audio/index.ts +39 -7
- package/src/audio/tone-clock-binding.ts +98 -0
- package/src/audio/tone-context.ts +129 -0
- package/src/audio/tone-offline-render.ts +167 -0
- package/src/audio/wav-encode.ts +119 -0
- package/src/core/game-loop.ts +17 -0
- package/src/core/types.ts +13 -0
- package/src/data/data-asset.ts +167 -0
- package/src/data/data-check-core.ts +242 -0
- package/src/data/data-ref.ts +145 -0
- package/src/data/vite-plugin-data.ts +290 -0
- package/src/index.ts +48 -0
- package/src/input/input-manager.ts +1206 -32
- package/src/input/input-types.ts +155 -3
- package/src/input/prompt-labels.ts +122 -0
- package/src/input/rebind-controller.ts +105 -0
- package/src/input/schema.ts +206 -52
- package/src/react/use-data.ts +114 -0
- package/src/react/use-selection.tsx +135 -0
- package/src/runtime/create-runtime.ts +30 -9
- package/src/runtime/render-audio-control.ts +168 -0
- package/src/runtime/render-control.ts +522 -0
- package/src/runtime/render-seed.ts +79 -0
- package/src/runtime/types.ts +0 -5
- package/src/scene/asset-loaders.ts +10 -36
- package/src/scene/asset-paths.ts +0 -2
- package/src/scene/asset-ref-check.ts +248 -0
- package/src/scene/parse.ts +133 -0
- package/src/scene/scene-loader.ts +81 -96
- package/src/scene/schema/animation.ts +30 -79
- package/src/scene/schema/entity.ts +20 -0
- package/src/scene/schema/index.ts +2 -12
- package/src/scene/user-data.ts +8 -9
- package/src/setup/setup-renderer.ts +9 -2
- package/src/tools/define-tool.ts +152 -0
- package/src/animation/anim-graph.ts +0 -406
- package/src/animation/anim-system.ts +0 -28
- package/src/animation/property-track.ts +0 -178
- package/src/animation/schema.ts +0 -204
- package/src/audio/ambient.ts +0 -300
- package/src/audio/impacts.ts +0 -212
- package/src/audio/movement.ts +0 -140
- package/src/audio/musical.ts +0 -200
- package/src/audio/ui-sounds.ts +0 -171
- package/src/audio/vehicle.ts +0 -235
- package/src/audio/weapons.ts +0 -152
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic `Math.random` seeding for render-control mode (I2 AC,
|
|
3
|
+
* `docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md` §15 I2: "`Math.random`
|
|
4
|
+
* is deterministically seeded/stubbed page-wide before any game module
|
|
5
|
+
* executes").
|
|
6
|
+
*
|
|
7
|
+
* Deliberately a ZERO-IMPORT module (no `three`, no other engine file) so
|
|
8
|
+
* its own evaluation is instantaneous — a render-mode entry page loads this
|
|
9
|
+
* as its FIRST `<script type="module">` tag, before the tag that pulls in
|
|
10
|
+
* the actual game/runtime modules. Per the HTML module-script ordering
|
|
11
|
+
* rules, sibling `<script type="module">` tags without `async` execute in
|
|
12
|
+
* document order, and each one's own dependency graph (here, empty) is
|
|
13
|
+
* fully evaluated before the browser moves to the next tag — so calling
|
|
14
|
+
* {@link maybeInstallRenderModeRandom} from this module's importer, in a
|
|
15
|
+
* script tag placed before the game's own entry tag, guarantees every
|
|
16
|
+
* subsequent module's top-level code (and everything it does at runtime)
|
|
17
|
+
* observes the seeded generator, never the platform's real
|
|
18
|
+
* cryptographically-random `Math.random`.
|
|
19
|
+
*
|
|
20
|
+
* This module does not decide WHETHER to seed on its own (importing it has
|
|
21
|
+
* no side effect) — the caller decides, by calling
|
|
22
|
+
* {@link maybeInstallRenderModeRandom} (query-param gated) or
|
|
23
|
+
* {@link installDeterministicRandom} (unconditional) from a tiny bootstrap
|
|
24
|
+
* entry. See `packages/engine/e2e/fixture/render-seed-entry.ts` for the
|
|
25
|
+
* worked bootstrap this module is designed to be loaded from.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* mulberry32 — a small, fast, deterministic 32-bit PRNG. Not cryptographic;
|
|
29
|
+
* this is explicitly a determinism tool (reproducible capture), not a
|
|
30
|
+
* security primitive. Returns a function with the same call signature as
|
|
31
|
+
* `Math.random` (no arguments, `[0, 1)` float).
|
|
32
|
+
*/
|
|
33
|
+
export function createMulberry32(seed) {
|
|
34
|
+
let state = seed >>> 0;
|
|
35
|
+
return function mulberry32() {
|
|
36
|
+
state = (state + 0x6d2b79f5) | 0;
|
|
37
|
+
let t = state;
|
|
38
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
39
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
40
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Replace the global `Math.random` with a seeded, deterministic generator.
|
|
45
|
+
* Idempotent to call more than once (each call re-seeds from scratch — the
|
|
46
|
+
* last call wins), which matters for HMR-style re-execution the same way
|
|
47
|
+
* `main.ts`'s `registerWorldKind` guard does elsewhere in this runtime.
|
|
48
|
+
*/
|
|
49
|
+
export function installDeterministicRandom(seed) {
|
|
50
|
+
Math.random = createMulberry32(seed);
|
|
51
|
+
}
|
|
52
|
+
/** Query-param name that opts a page into render-control mode (I2 AC 4: the
|
|
53
|
+
* mode must be unavailable/protected in normal production gameplay unless
|
|
54
|
+
* explicitly enabled). Shared with `render-control.ts`'s own production
|
|
55
|
+
* guard so both checks agree on the same flag. */
|
|
56
|
+
export const RENDER_MODE_QUERY_PARAM = 'vgai-render';
|
|
57
|
+
/** Optional query param to pin a specific seed (default below when absent). */
|
|
58
|
+
export const RENDER_SEED_QUERY_PARAM = 'vgai-seed';
|
|
59
|
+
const DEFAULT_RENDER_SEED = 0x9e3779b9; // golden-ratio constant — an arbitrary but fixed default
|
|
60
|
+
/**
|
|
61
|
+
* Seed `Math.random` iff the page's URL opts into render mode
|
|
62
|
+
* (`?vgai-render=1`), reading an optional `?vgai-seed=<int>` override.
|
|
63
|
+
* Returns whether it seeded, purely for the caller's own diagnostics/log —
|
|
64
|
+
* the bootstrap entry doesn't need to branch on it.
|
|
65
|
+
*/
|
|
66
|
+
export function maybeInstallRenderModeRandom(location = window.location) {
|
|
67
|
+
const params = new URLSearchParams(location.search);
|
|
68
|
+
if (params.get(RENDER_MODE_QUERY_PARAM) !== '1')
|
|
69
|
+
return false;
|
|
70
|
+
const seedParam = params.get(RENDER_SEED_QUERY_PARAM);
|
|
71
|
+
const seed = seedParam !== null && seedParam !== '' ? Number(seedParam) : DEFAULT_RENDER_SEED;
|
|
72
|
+
installDeterministicRandom(Number.isFinite(seed) ? seed : DEFAULT_RENDER_SEED);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene-UI render bridge (B1, widened design/24-scene-ui.md D3) — the injection
|
|
3
|
+
* seam that keeps the engine React-free.
|
|
4
|
+
*
|
|
5
|
+
* The engine knows the scene carries a `ui` tree (data), but it does NOT know how to
|
|
6
|
+
* render React. An editor-side module registers a renderer here (a thin wrapper over
|
|
7
|
+
* the React `mountSceneUI`); the first-party scene adapter calls it at game-time to
|
|
8
|
+
* mount the scene's UI into `host.ui` and disposes it on teardown. Fully decoupled:
|
|
9
|
+
* the engine treats `sceneUI` and the handle as opaque. The optional third `services`
|
|
10
|
+
* argument carries game-sourced data/components/events/projector (D2-D7) — still
|
|
11
|
+
* opaque to the engine, still zero React import here.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Structural match for `@vgai/scene-ui`'s `UIDataSource` — engine stays React-free
|
|
15
|
+
* (this interface is duck-typed against the real one, not imported from it).
|
|
16
|
+
*/
|
|
17
|
+
export interface SceneUIDataSourceLike {
|
|
18
|
+
get(path: string): unknown;
|
|
19
|
+
set(path: string, value: unknown): void;
|
|
20
|
+
subscribe(listener: () => void): () => void;
|
|
21
|
+
version(): number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Game-time services fed into a scene's UI mount (D2's "dynamic" layer). Every
|
|
25
|
+
* field is optional: a renderer falls back to its own registration-time registry
|
|
26
|
+
* (D2 merge rule) or built-in default when a field is absent. `components`/
|
|
27
|
+
* `transforms`/`strings` stay `unknown`-valued here — they're React things the
|
|
28
|
+
* scene-ui renderer casts to its real `UIComponentRegistry`/`TransformRegistry`/
|
|
29
|
+
* `StringTables`.
|
|
30
|
+
*/
|
|
31
|
+
export interface SceneUIGameServices {
|
|
32
|
+
/** Reactive game state the UI binds against (D4's `gameStateDataSource`, or a
|
|
33
|
+
* game's own bus). Absent -> the renderer falls back to an empty static store. */
|
|
34
|
+
data?: SceneUIDataSourceLike;
|
|
35
|
+
/** `kind:"component"` leaf implementations, keyed by the name authored in the scene. */
|
|
36
|
+
components?: Record<string, unknown>;
|
|
37
|
+
/** Named binding transforms (`$bind.transform`). */
|
|
38
|
+
transforms?: Record<string, unknown>;
|
|
39
|
+
/** Localized string tables, keyed by locale then textKey. */
|
|
40
|
+
strings?: Record<string, Record<string, string>>;
|
|
41
|
+
locale?: string;
|
|
42
|
+
/** Routes a `kind:"button"` (etc.) `events.onClick` handler id to the game.
|
|
43
|
+
* Absent -> a loud console.warn per event (D6 — no magic engine event bus). */
|
|
44
|
+
onEvent?: (handlerId: string, payload?: unknown) => void;
|
|
45
|
+
/** Projects an entity id to a screen-space point for world-tracked canvases
|
|
46
|
+
* (D5). Returns null when the entity is unknown or behind the camera. */
|
|
47
|
+
worldProjector?: (entityId: string) => {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
} | null;
|
|
51
|
+
}
|
|
52
|
+
export interface SceneUIHandle {
|
|
53
|
+
dispose(): void;
|
|
54
|
+
/** Re-render with new services without a remount (a late `setSceneUIServices`
|
|
55
|
+
* call after the initial mount, D7). Optional — a renderer that can't update
|
|
56
|
+
* in place may omit it; callers dispose+remount instead. */
|
|
57
|
+
update?(services: SceneUIGameServices): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renderer signature — `sceneUI` is the scene's `ui` array (opaque to the engine).
|
|
61
|
+
* `services` is optional so existing 2-arg renderer functions keep working
|
|
62
|
+
* unchanged (back-compat, D3/D5 §5).
|
|
63
|
+
*/
|
|
64
|
+
export type SceneUIRenderer = (container: HTMLElement, sceneUI: unknown, services?: SceneUIGameServices) => SceneUIHandle;
|
|
65
|
+
/** Register the React renderer (called once by the editor/runtime host). */
|
|
66
|
+
export declare function setSceneUIRenderer(renderer: SceneUIRenderer | null): void;
|
|
67
|
+
/** Render a scene's UI into `container` if a renderer is registered, else no-op. */
|
|
68
|
+
export declare function renderSceneUI(container: HTMLElement, sceneUI: unknown, services?: SceneUIGameServices): SceneUIHandle | null;
|
|
69
|
+
//# sourceMappingURL=scene-ui-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-ui-bridge.d.ts","sourceRoot":"","sources":["../../src/runtime/scene-ui-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,OAAO,IAAI,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC;uFACmF;IACnF,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;oFACgF;IAChF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD;8EAC0E;IAC1E,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACxE;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,IAAI,IAAI,CAAC;IAChB;;iEAE6D;IAC7D,MAAM,CAAC,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,mBAAmB,KAC3B,aAAa,CAAC;AAInB,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAEzE;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,aAAa,GAAG,IAAI,CAGtB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene-UI render bridge (B1, widened design/24-scene-ui.md D3) — the injection
|
|
3
|
+
* seam that keeps the engine React-free.
|
|
4
|
+
*
|
|
5
|
+
* The engine knows the scene carries a `ui` tree (data), but it does NOT know how to
|
|
6
|
+
* render React. An editor-side module registers a renderer here (a thin wrapper over
|
|
7
|
+
* the React `mountSceneUI`); the first-party scene adapter calls it at game-time to
|
|
8
|
+
* mount the scene's UI into `host.ui` and disposes it on teardown. Fully decoupled:
|
|
9
|
+
* the engine treats `sceneUI` and the handle as opaque. The optional third `services`
|
|
10
|
+
* argument carries game-sourced data/components/events/projector (D2-D7) — still
|
|
11
|
+
* opaque to the engine, still zero React import here.
|
|
12
|
+
*/
|
|
13
|
+
let _renderer = null;
|
|
14
|
+
/** Register the React renderer (called once by the editor/runtime host). */
|
|
15
|
+
export function setSceneUIRenderer(renderer) {
|
|
16
|
+
_renderer = renderer;
|
|
17
|
+
}
|
|
18
|
+
/** Render a scene's UI into `container` if a renderer is registered, else no-op. */
|
|
19
|
+
export function renderSceneUI(container, sceneUI, services) {
|
|
20
|
+
if (!_renderer || sceneUI == null)
|
|
21
|
+
return null;
|
|
22
|
+
return _renderer(container, sceneUI, services);
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentRegistry } from '../scene/component-registry';
|
|
2
|
+
import type { Game } from './game';
|
|
3
|
+
import type { SceneUIDataSourceLike } from './scene-ui-bridge';
|
|
4
|
+
/**
|
|
5
|
+
* Build the default `SceneUIDataSourceLike` over a game's live components.
|
|
6
|
+
*
|
|
7
|
+
* `subscribe`/`version` are driven by `game.state` (bumps once per completed
|
|
8
|
+
* frame, after every world's phases — see `state-bridge.ts`) PLUS a local
|
|
9
|
+
* bump on `set()`, so a two-way control's own write echoes immediately
|
|
10
|
+
* instead of waiting for the next frame.
|
|
11
|
+
*/
|
|
12
|
+
export declare function gameStateDataSource(game: Game, registry: ComponentRegistry): SceneUIDataSourceLike;
|
|
13
|
+
//# sourceMappingURL=scene-ui-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-ui-data.d.ts","sourceRoot":"","sources":["../../src/runtime/scene-ui-data.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAiB/D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,iBAAiB,GAC1B,qBAAqB,CAuEvB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
function splitRoot(path) {
|
|
2
|
+
const dot = path.indexOf('.');
|
|
3
|
+
return dot === -1 ? [path, ''] : [path.slice(0, dot), path.slice(dot + 1)];
|
|
4
|
+
}
|
|
5
|
+
function readRest(obj, rest) {
|
|
6
|
+
if (!rest)
|
|
7
|
+
return obj;
|
|
8
|
+
let cur = obj;
|
|
9
|
+
for (const key of rest.split('.')) {
|
|
10
|
+
if (cur == null || typeof cur !== 'object')
|
|
11
|
+
return undefined;
|
|
12
|
+
cur = cur[key];
|
|
13
|
+
}
|
|
14
|
+
return cur;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the default `SceneUIDataSourceLike` over a game's live components.
|
|
18
|
+
*
|
|
19
|
+
* `subscribe`/`version` are driven by `game.state` (bumps once per completed
|
|
20
|
+
* frame, after every world's phases — see `state-bridge.ts`) PLUS a local
|
|
21
|
+
* bump on `set()`, so a two-way control's own write echoes immediately
|
|
22
|
+
* instead of waiting for the next frame.
|
|
23
|
+
*/
|
|
24
|
+
export function gameStateDataSource(game, registry) {
|
|
25
|
+
let version = 0;
|
|
26
|
+
const listeners = new Set();
|
|
27
|
+
// Warn-once-per-root-segment (D4/§9 review checklist): a scene author
|
|
28
|
+
// typo'ing a component name in a binding should be loud exactly once, not
|
|
29
|
+
// on every `get()` (a bound node re-reads its path every render).
|
|
30
|
+
const warnedRoots = new Set();
|
|
31
|
+
const notify = () => {
|
|
32
|
+
for (const listener of listeners)
|
|
33
|
+
listener();
|
|
34
|
+
};
|
|
35
|
+
/** Resolves a root segment to its live component instance, or undefined. */
|
|
36
|
+
const resolveInstance = (root) => {
|
|
37
|
+
const Klass = registry[root];
|
|
38
|
+
if (!Klass) {
|
|
39
|
+
if (!warnedRoots.has(root)) {
|
|
40
|
+
warnedRoots.add(root);
|
|
41
|
+
console.warn(`scene-ui: data binding root "${root}" is not a registered component name — ` +
|
|
42
|
+
'check the binding source against src/scripts/registry.ts.');
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
// Registered but zero live instances (e.g. not spawned yet this scene) is
|
|
47
|
+
// an ordinary, expected transient state — stays undefined, no warning.
|
|
48
|
+
return game.queryByComponent(Klass)[0];
|
|
49
|
+
};
|
|
50
|
+
// ONE subscription to the frame-versioned state bridge for this data
|
|
51
|
+
// source's whole lifetime, fanning out to however many external
|
|
52
|
+
// subscribers this scene-UI mount has.
|
|
53
|
+
game.state.subscribe(() => {
|
|
54
|
+
version++;
|
|
55
|
+
notify();
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
get(path) {
|
|
59
|
+
const [root, rest] = splitRoot(path);
|
|
60
|
+
const inst = resolveInstance(root);
|
|
61
|
+
return inst === undefined ? undefined : readRest(inst, rest);
|
|
62
|
+
},
|
|
63
|
+
set(path, value) {
|
|
64
|
+
const [root, rest] = splitRoot(path);
|
|
65
|
+
const inst = resolveInstance(root);
|
|
66
|
+
if (inst === undefined || !rest)
|
|
67
|
+
return;
|
|
68
|
+
const keys = rest.split('.');
|
|
69
|
+
let cur = inst;
|
|
70
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
71
|
+
const key = keys[i];
|
|
72
|
+
const next = cur[key];
|
|
73
|
+
if (next == null || typeof next !== 'object')
|
|
74
|
+
return; // don't invent nested fields on a live instance
|
|
75
|
+
cur = next;
|
|
76
|
+
}
|
|
77
|
+
cur[keys[keys.length - 1]] = value;
|
|
78
|
+
// Two-way writes echo immediately, not on the next frame (D4).
|
|
79
|
+
version++;
|
|
80
|
+
notify();
|
|
81
|
+
},
|
|
82
|
+
subscribe(listener) {
|
|
83
|
+
listeners.add(listener);
|
|
84
|
+
return () => {
|
|
85
|
+
listeners.delete(listener);
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
version() {
|
|
89
|
+
return version;
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-versioned game state bridge (T7.4 slice 1 — `docs/REACT-STATE-BRIDGE.md`
|
|
3
|
+
* §2, the D7 remainder). Components mutate state on `this` freely during
|
|
4
|
+
* ticks — there is no proxy, no dirty tracking, no event per mutation (Track
|
|
5
|
+
* A: no mirror, no sync layer). So the unit of change a subscriber can
|
|
6
|
+
* observe is the FRAME: `GameInternal.runFrame` bumps `frameVersion` and
|
|
7
|
+
* notifies subscribers at most once, at its tail, AFTER every phase of every
|
|
8
|
+
* world and every world's `endFrame` hook has run (see the wiring in
|
|
9
|
+
* `runtime/game.ts`) — mirroring the D7 "from `gameLogic` onward, every
|
|
10
|
+
* world's post-step state is readable" guarantee, extended to "after the
|
|
11
|
+
* frame, ALL state is readable".
|
|
12
|
+
*
|
|
13
|
+
* This file is plain, react-free TypeScript any consumer could use — no
|
|
14
|
+
* react import here, or anywhere under `runtime/` (the react-facing
|
|
15
|
+
* `useGameState` hook, which DOES import react, is deliberately colocated
|
|
16
|
+
* with the `mountUI` seam instead — see `packages/editor/template/src/
|
|
17
|
+
* ui/game-state.tsx`).
|
|
18
|
+
*/
|
|
19
|
+
/** Frame-versioned, react-free subscription surface — `docs/REACT-STATE-BRIDGE.md` §2. */
|
|
20
|
+
export interface GameStateBridge {
|
|
21
|
+
/** Monotonic; bumped once per completed `runFrame`. Starts at 0 before the
|
|
22
|
+
* first frame has ever completed. */
|
|
23
|
+
readonly frameVersion: number;
|
|
24
|
+
/** Notified at most once per frame, after ALL phases of ALL worlds (and
|
|
25
|
+
* their `endFrame` hooks) have run. Returns an unsubscribe function. */
|
|
26
|
+
subscribe(onFrame: () => void): () => void;
|
|
27
|
+
}
|
|
28
|
+
/** Host-internal extension of {@link GameStateBridge}: adds `bump`, the
|
|
29
|
+
* method `GameInternal.runFrame` calls at its tail. NOT part of the
|
|
30
|
+
* game-facing `Game.state` surface (typed as the narrower
|
|
31
|
+
* `GameStateBridge` there) — games/components/hooks never call `bump`
|
|
32
|
+
* directly; only the frame executor does. */
|
|
33
|
+
export interface GameStateBridgeInternal extends GameStateBridge {
|
|
34
|
+
/** Bump `frameVersion` by one and notify every current subscriber, in
|
|
35
|
+
* subscription order. Subscriber errors are isolated (per-subscriber
|
|
36
|
+
* try/catch, loud `console.error`, never swallowed silently) — mirrors
|
|
37
|
+
* the error-isolation idiom in `ecs/component-manager.ts`'s per-component
|
|
38
|
+
* `update()` calls: one offending subscriber must not stop its siblings
|
|
39
|
+
* from being notified, and must not break the frame loop. */
|
|
40
|
+
bump(): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Construct a fresh bridge. One per `Game` (created alongside the other
|
|
44
|
+
* game-scoped state in `createGame`, `runtime/game.ts`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function createStateBridge(): GameStateBridgeInternal;
|
|
47
|
+
//# sourceMappingURL=state-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-bridge.d.ts","sourceRoot":"","sources":["../../src/runtime/state-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B;0CACsC;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;6EACyE;IACzE,SAAS,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC5C;AAED;;;;8CAI8C;AAC9C,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D;;;;;kEAK8D;IAC9D,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,uBAAuB,CA8B3D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-versioned game state bridge (T7.4 slice 1 — `docs/REACT-STATE-BRIDGE.md`
|
|
3
|
+
* §2, the D7 remainder). Components mutate state on `this` freely during
|
|
4
|
+
* ticks — there is no proxy, no dirty tracking, no event per mutation (Track
|
|
5
|
+
* A: no mirror, no sync layer). So the unit of change a subscriber can
|
|
6
|
+
* observe is the FRAME: `GameInternal.runFrame` bumps `frameVersion` and
|
|
7
|
+
* notifies subscribers at most once, at its tail, AFTER every phase of every
|
|
8
|
+
* world and every world's `endFrame` hook has run (see the wiring in
|
|
9
|
+
* `runtime/game.ts`) — mirroring the D7 "from `gameLogic` onward, every
|
|
10
|
+
* world's post-step state is readable" guarantee, extended to "after the
|
|
11
|
+
* frame, ALL state is readable".
|
|
12
|
+
*
|
|
13
|
+
* This file is plain, react-free TypeScript any consumer could use — no
|
|
14
|
+
* react import here, or anywhere under `runtime/` (the react-facing
|
|
15
|
+
* `useGameState` hook, which DOES import react, is deliberately colocated
|
|
16
|
+
* with the `mountUI` seam instead — see `packages/editor/template/src/
|
|
17
|
+
* ui/game-state.tsx`).
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Construct a fresh bridge. One per `Game` (created alongside the other
|
|
21
|
+
* game-scoped state in `createGame`, `runtime/game.ts`).
|
|
22
|
+
*/
|
|
23
|
+
export function createStateBridge() {
|
|
24
|
+
let frameVersion = 0;
|
|
25
|
+
const subscribers = new Set();
|
|
26
|
+
return {
|
|
27
|
+
get frameVersion() {
|
|
28
|
+
return frameVersion;
|
|
29
|
+
},
|
|
30
|
+
subscribe(onFrame) {
|
|
31
|
+
subscribers.add(onFrame);
|
|
32
|
+
return () => {
|
|
33
|
+
subscribers.delete(onFrame);
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
bump() {
|
|
37
|
+
frameVersion++;
|
|
38
|
+
// Snapshot before iterating (same idiom as ComponentManager's
|
|
39
|
+
// per-phase `list = byPhase.get(phase)!.slice()`): a subscriber that
|
|
40
|
+
// subscribes/unsubscribes from WITHIN a notification must not affect
|
|
41
|
+
// which of ITS SIBLINGS get notified this same bump.
|
|
42
|
+
const notified = Array.from(subscribers);
|
|
43
|
+
for (const onFrame of notified) {
|
|
44
|
+
try {
|
|
45
|
+
onFrame();
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
console.error('[state-bridge] subscriber threw:', err);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type RAPIER from '@dimforge/rapier3d-compat';
|
|
2
|
+
import type { EffectComposer } from 'postprocessing';
|
|
3
|
+
import type * as THREE from 'three';
|
|
4
|
+
import type { SystemAdapters } from '../adapter/system-adapter';
|
|
5
|
+
import type { AssetCache } from '../assets';
|
|
6
|
+
import type { createSystemRunner } from '../core/system-runner';
|
|
7
|
+
import type { createDebugDraw } from '../dev/debug-draw';
|
|
8
|
+
import type { ComponentManager } from '../ecs/component-manager';
|
|
9
|
+
import type { InputManager } from '../input/input-manager';
|
|
10
|
+
import type { CollisionSystem } from '../physics/collision-system';
|
|
11
|
+
import type { PhysicsRegistry } from '../physics/physics-registry';
|
|
12
|
+
import type { SceneFile } from '../scene/scene-types';
|
|
13
|
+
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
14
|
+
import type { ParticlesContext } from '../setup/setup-particles';
|
|
15
|
+
import type { Game, WorldInstance } from './game';
|
|
16
|
+
import type { SceneUIGameServices } from './scene-ui-bridge';
|
|
17
|
+
/**
|
|
18
|
+
* All engine subsystems, passed to every game `setup(ctx)` and to each
|
|
19
|
+
* GameComponent lifecycle method (`init`/`update`/`dispose`/trigger callbacks).
|
|
20
|
+
*
|
|
21
|
+
* The surface is intentionally split in two:
|
|
22
|
+
*
|
|
23
|
+
* - **Raw libraries** — the actual Three.js / Rapier / postprocessing objects.
|
|
24
|
+
* Call their documented APIs directly; do NOT build wrappers around them.
|
|
25
|
+
* - **Engine handles** — thin VGAI-owned managers that bridge those libraries
|
|
26
|
+
* into the phase-ordered game loop. Reach for these when you need behavior the
|
|
27
|
+
* raw library doesn't provide (physics↔Object3D mapping, system phases, etc.).
|
|
28
|
+
*/
|
|
29
|
+
export interface GameContext {
|
|
30
|
+
/** Three.js scene graph root. Add/remove any `Object3D` (meshes, lights,
|
|
31
|
+
* groups) here. This is THE scene — there is no separate engine scene. */
|
|
32
|
+
scene: THREE.Scene;
|
|
33
|
+
/** The single render camera. Move/aim it directly, or (preferred) drive it
|
|
34
|
+
* from a camera GameComponent — see the camera-precedence note below. */
|
|
35
|
+
camera: THREE.PerspectiveCamera;
|
|
36
|
+
/** The Rapier physics `World`. Step/query it, create bodies & colliders via
|
|
37
|
+
* `ctx.rapier`. One shared world for the whole scene. */
|
|
38
|
+
rapierWorld: RAPIER.World;
|
|
39
|
+
/** The Rapier module namespace itself (`RigidBodyDesc`, `ColliderDesc`,
|
|
40
|
+
* `Vector3`, enums, …). Use to construct physics descriptors. */
|
|
41
|
+
rapier: typeof RAPIER;
|
|
42
|
+
/** The `postprocessing` EffectComposer driving the final render. Use to
|
|
43
|
+
* add/remove passes (bloom, vignette, …) or reach the underlying
|
|
44
|
+
* `WebGLRenderer` via `composer.getRenderer()`. */
|
|
45
|
+
composer: EffectComposer;
|
|
46
|
+
/** Keyboard/mouse/gamepad input. Polled once per frame in the `input` phase;
|
|
47
|
+
* read action/axis state inside your `update`. */
|
|
48
|
+
input: InputManager;
|
|
49
|
+
/** Rapier collision-event dispatcher. Register handlers with
|
|
50
|
+
* `collisions.onCollision(...)`; it is drained each `postPhysics`. Prefer a
|
|
51
|
+
* GameComponent's `onTriggerEnter/Exit` for per-entity sensor logic. */
|
|
52
|
+
collisions: CollisionSystem;
|
|
53
|
+
/** `Object3D ↔ Rapier body/collider` registry (+ collider→Object3D reverse
|
|
54
|
+
* index). Use to find an entity's body/collider, or the entity behind a
|
|
55
|
+
* raw collision. Inside a component, `this.rigidBody`/`this.collider` are
|
|
56
|
+
* pre-resolved from here. */
|
|
57
|
+
physics: PhysicsRegistry;
|
|
58
|
+
/** Procedural audio: master gain, listener, and one-shot/impact helpers.
|
|
59
|
+
* Use for SFX and music; the listener tracks the camera. */
|
|
60
|
+
audio: GameAudio;
|
|
61
|
+
/** three.quarks particle system: the batched renderer + spawn helpers. Use
|
|
62
|
+
* to emit runtime particle effects; declarative scene particles register
|
|
63
|
+
* here automatically. */
|
|
64
|
+
particles: ParticlesContext;
|
|
65
|
+
/** Immediate-mode debug drawing (`line`/`box`/`sphere`/`arrow`). Drawn
|
|
66
|
+
* objects persist until you call `debugDraw.clear()` yourself (the
|
|
67
|
+
* adapter also clears on scene dispose/hot-reload) — nothing clears it
|
|
68
|
+
* automatically per frame. Dev-only visualization — not for shipped
|
|
69
|
+
* visuals. */
|
|
70
|
+
debugDraw: ReturnType<typeof createDebugDraw>;
|
|
71
|
+
/** Shared GLTF/texture cache. Use `assets.loadGLTF(...)` etc. to load+cache
|
|
72
|
+
* models at runtime so repeated loads reuse geometry/material. */
|
|
73
|
+
assets: AssetCache;
|
|
74
|
+
/** The phase-ordered system runner. `systems.add(phase, fn)` registers a
|
|
75
|
+
* per-frame callback. Reserve this for non-gameplay infra (audio mixers,
|
|
76
|
+
* network send); per-entity GAMEPLAY belongs in a GameComponent. */
|
|
77
|
+
systems: ReturnType<typeof createSystemRunner>;
|
|
78
|
+
/** Manager for all live GameComponent instances (attach/detach/HMR). The
|
|
79
|
+
* scene loader drives this; gameplay code rarely touches it directly. */
|
|
80
|
+
components: ComponentManager;
|
|
81
|
+
/** DOM element overlaying the canvas for game UI (React via `mountUI`, or
|
|
82
|
+
* vanilla). `pointer-events:none` by default — set `auto` on interactive
|
|
83
|
+
* elements. Cleared on scene switch / hot-reload. */
|
|
84
|
+
uiContainer: HTMLDivElement;
|
|
85
|
+
/** Register a game-owned `SystemAdapters` capability (networking,
|
|
86
|
+
* navigation, …) on the mounted game's adapter surface, so the editor's
|
|
87
|
+
* introspection panels (via `getActiveSystems()`) can see it. The engine
|
|
88
|
+
* wires the first-party physics/input/assets/animation entries itself;
|
|
89
|
+
* capabilities the GAME owns (a Colyseus connection, a NavMeshManager)
|
|
90
|
+
* are registered here by the game's setup. Optional capability — absent
|
|
91
|
+
* in contexts that expose no adapter surface (some test harnesses);
|
|
92
|
+
* call as `ctx.registerSystemAdapter?.(…)`.
|
|
93
|
+
*
|
|
94
|
+
* Ordering contract: **game registrations always win** — the engine seeds
|
|
95
|
+
* its first-party entries (physics/input/assets/animation) BEFORE setup()
|
|
96
|
+
* runs, so a game that registers any of those same kinds during its own
|
|
97
|
+
* setup overrides the engine's entry, not the other way around. This also
|
|
98
|
+
* holds across a warm restart (`hotReload`): every kind the outgoing game
|
|
99
|
+
* registered is stripped back to the engine's entry (or absent, for
|
|
100
|
+
* game-only kinds like networking/navigation) before the incoming game's
|
|
101
|
+
* setup runs, so a disposed game's adapter is never left stale on the
|
|
102
|
+
* mounted surface. */
|
|
103
|
+
registerSystemAdapter?<K extends keyof SystemAdapters>(kind: K, adapter: SystemAdapters[K]): void;
|
|
104
|
+
/**
|
|
105
|
+
* Register (or replace) this game's scene-UI game-time services — the data
|
|
106
|
+
* source, custom onEvent handler, and/or worldProjector overrides a scene's
|
|
107
|
+
* authored UI mounts against (design/24-scene-ui.md D2/D7). Optional, same
|
|
108
|
+
* precedent as `registerSystemAdapter`: absent in contexts with no scene-UI
|
|
109
|
+
* surface at all (bare test harnesses).
|
|
110
|
+
*
|
|
111
|
+
* Timing is safe by construction: the scene loader awaits
|
|
112
|
+
* `componentManager.initAll()` before `loadScene`/`loadSceneFromData`
|
|
113
|
+
* return, and the adapter mounts scene UI only after that — so calling this
|
|
114
|
+
* from a `GameComponent.init()` always beats the mount (its services are
|
|
115
|
+
* folded into the FIRST render, not a late update). A call AFTER the mount
|
|
116
|
+
* (e.g. from a click handler) updates the live mount in place instead
|
|
117
|
+
* (`SceneUIHandle.update`, or a dispose+remount if the renderer has none).
|
|
118
|
+
*
|
|
119
|
+
* Per-key merge (D2): a key set here always wins over both the project's
|
|
120
|
+
* registration-time registry and the engine's own D4/D5/D6 defaults. Hot
|
|
121
|
+
* reload strips every game-registered key back to none before the incoming
|
|
122
|
+
* game's `init()` runs — same contract as `registerSystemAdapter`'s re-seed.
|
|
123
|
+
*/
|
|
124
|
+
setSceneUIServices?(services: SceneUIGameServices): void;
|
|
125
|
+
/** The Game root — the loop, the world registry, and game-scoped handles.
|
|
126
|
+
* Absent only in bare test harnesses that construct a partial context (the
|
|
127
|
+
* host always sets it in `createGameRuntime`). Optional so every existing
|
|
128
|
+
* harness that builds a hand-rolled `ctx` object keeps compiling
|
|
129
|
+
* unmodified — the same precedent as `registerSystemAdapter`. */
|
|
130
|
+
game?: Game | undefined;
|
|
131
|
+
/** Alias for `game.worlds` — the live, declaration-ordered world registry.
|
|
132
|
+
* Same optionality/absence rule as `game` above. */
|
|
133
|
+
worlds?: ReadonlyArray<WorldInstance> | undefined;
|
|
134
|
+
}
|
|
135
|
+
/** Return value from a game setup function. */
|
|
136
|
+
export interface GameCleanup {
|
|
137
|
+
dispose: () => void;
|
|
138
|
+
}
|
|
139
|
+
/** Context passed to setup() when launched from the editor's play mode. */
|
|
140
|
+
export interface EditorPreview {
|
|
141
|
+
/** Path of the .vscn.json file the user has open (null if unsaved). */
|
|
142
|
+
scenePath: string | null;
|
|
143
|
+
/** The editor's in-memory scene document, including unsaved edits. */
|
|
144
|
+
sceneData: SceneFile;
|
|
145
|
+
/** Editor viewport camera transform — use this as the initial game camera viewpoint. */
|
|
146
|
+
viewportCamera?: {
|
|
147
|
+
position: [number, number, number];
|
|
148
|
+
quaternion: [number, number, number, number];
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Which bundled example the static/browser build's project picker wants to
|
|
152
|
+
* run (docs/EXAMPLES-AS-PROJECTS-DESIGN.md §4 — Adjudication H). Only
|
|
153
|
+
* meaningful to `packages/editor/src/browser-play-entry.ts`'s dispatch over
|
|
154
|
+
* the generated `SETUP_BY_EXAMPLE_ID` table; every other `GameSetupFn`
|
|
155
|
+
* consumer ignores it. Undefined ⇒ the generic scene-loader fallback
|
|
156
|
+
* (today's only reachable behavior — no caller sets this yet, since the
|
|
157
|
+
* picker itself is a later wave).
|
|
158
|
+
*/
|
|
159
|
+
exampleId?: string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Asset prefix for the static/browser build's GENERIC scene-loader fallback,
|
|
162
|
+
* set INSTEAD of `exampleId` when the editor has a non-default scene of a
|
|
163
|
+
* bundled example open (hosted `?project=<id>&scene=<project-relative>` —
|
|
164
|
+
* Track H): the open scene plays via `sceneData`, but its relative asset
|
|
165
|
+
* refs still live under the example's staged `/examples/<id>/` public root.
|
|
166
|
+
* Ignored whenever `exampleId` is set; undefined ⇒ root prefix `/`.
|
|
167
|
+
*/
|
|
168
|
+
assetPrefix?: string | undefined;
|
|
169
|
+
}
|
|
170
|
+
/** A game setup function: receives engine context, returns cleanup.
|
|
171
|
+
*
|
|
172
|
+
* This is the MOUNT body of the FIRST-PARTY implementer. The host no longer
|
|
173
|
+
* depends on it — the host depends on `GameAdapter` (`@engine/adapter`), and
|
|
174
|
+
* `GameSetupFn` is wrapped into a `VgaiSceneGameAdapter` via `fromSetup`. See
|
|
175
|
+
* docs/ADAPTER-ARCHITECTURE.md. (The former `GameAdapter` `{ setup, components }`
|
|
176
|
+
* interface lived here; it is superseded by the real adapter interfaces in
|
|
177
|
+
* `@engine/adapter`.) */
|
|
178
|
+
export type GameSetupFn = (ctx: GameContext, editor?: EditorPreview) => Promise<GameCleanup>;
|
|
179
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,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,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,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,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,WAAW;IAG1B;+EAC2E;IAC3E,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB;8EAC0E;IAC1E,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChC;8DAC0D;IAC1D,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC;IAC1B;sEACkE;IAClE,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB;;wDAEoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IAIzB;uDACmD;IACnD,KAAK,EAAE,YAAY,CAAC;IACpB;;6EAEyE;IACzE,UAAU,EAAE,eAAe,CAAC;IAC5B;;;kCAG8B;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB;iEAC6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB;;8BAE0B;IAC1B,SAAS,EAAE,gBAAgB,CAAC;IAC5B;;;;mBAIe;IACf,SAAS,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC9C;uEACmE;IACnE,MAAM,EAAE,UAAU,CAAC;IACnB;;yEAEqE;IACrE,OAAO,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC/C;8EAC0E;IAC1E,UAAU,EAAE,gBAAgB,CAAC;IAC7B;;0DAEsD;IACtD,WAAW,EAAE,cAAc,CAAC;IAC5B;;;;;;;;;;;;;;;;;2BAiBuB;IACvB,qBAAqB,CAAC,CAAC,CAAC,SAAS,MAAM,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAElG;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAAkB,CAAC,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAIzD;;;;sEAIkE;IAClE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB;yDACqD;IACrD,MAAM,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;CACnD;AAED,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,sEAAsE;IACtE,SAAS,EAAE,SAAS,CAAC;IACrB,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;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;yBAOyB;AACzB,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|