@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,11 @@
|
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
/** All objects in the graph carrying the given tag (depth-first, document order). */
|
|
3
|
+
export declare function queryByTag(root: THREE.Object3D, tag: string): THREE.Object3D[];
|
|
4
|
+
/** All objects in the graph with the given name (depth-first, document order). */
|
|
5
|
+
export declare function queryByName(root: THREE.Object3D, name: string): THREE.Object3D[];
|
|
6
|
+
/**
|
|
7
|
+
* All objects in the graph that have the named component attached
|
|
8
|
+
* (depth-first, document order).
|
|
9
|
+
*/
|
|
10
|
+
export declare function queryByComponent(root: THREE.Object3D, componentName: string): THREE.Object3D[];
|
|
11
|
+
//# sourceMappingURL=scene-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-query.d.ts","sourceRoot":"","sources":["../../src/scene/scene-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAkCpC,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAM9E;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAMhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAM9F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getUserData } from './user-data';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime queries over a loaded THREE scene graph (P1.6d).
|
|
4
|
+
*
|
|
5
|
+
* The scene's `tags` schema field is documented as "for runtime queries" but,
|
|
6
|
+
* until now, no query existed. These helpers walk a THREE.Object3D graph and
|
|
7
|
+
* read entity metadata off `userData`, so gameplay code can find objects by tag,
|
|
8
|
+
* name, or attached component without bookkeeping its own indexes.
|
|
9
|
+
*
|
|
10
|
+
* Canonical metadata locations (in priority order):
|
|
11
|
+
* - tags: `userData['tags']` (string[]) — falls back to `userData['entity'].tags`
|
|
12
|
+
* - name: `Object3D.name`
|
|
13
|
+
* - components: `userData['components']` (record or string[]) — falls back to
|
|
14
|
+
* `userData['entity'].components` (record keyed by component name)
|
|
15
|
+
*/
|
|
16
|
+
function getTags(obj) {
|
|
17
|
+
const direct = getUserData(obj, 'tags');
|
|
18
|
+
if (Array.isArray(direct))
|
|
19
|
+
return direct;
|
|
20
|
+
const fromDef = getUserData(obj, 'entity')?.tags;
|
|
21
|
+
return Array.isArray(fromDef) ? fromDef : [];
|
|
22
|
+
}
|
|
23
|
+
function getComponentNames(obj) {
|
|
24
|
+
const direct = getUserData(obj, 'components');
|
|
25
|
+
if (Array.isArray(direct))
|
|
26
|
+
return direct;
|
|
27
|
+
if (direct && typeof direct === 'object')
|
|
28
|
+
return Object.keys(direct);
|
|
29
|
+
const fromDef = getUserData(obj, 'entity')?.components;
|
|
30
|
+
if (fromDef && typeof fromDef === 'object')
|
|
31
|
+
return Object.keys(fromDef);
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
/** All objects in the graph carrying the given tag (depth-first, document order). */
|
|
35
|
+
export function queryByTag(root, tag) {
|
|
36
|
+
const matches = [];
|
|
37
|
+
root.traverse((obj) => {
|
|
38
|
+
if (getTags(obj).includes(tag))
|
|
39
|
+
matches.push(obj);
|
|
40
|
+
});
|
|
41
|
+
return matches;
|
|
42
|
+
}
|
|
43
|
+
/** All objects in the graph with the given name (depth-first, document order). */
|
|
44
|
+
export function queryByName(root, name) {
|
|
45
|
+
const matches = [];
|
|
46
|
+
root.traverse((obj) => {
|
|
47
|
+
if (obj.name === name)
|
|
48
|
+
matches.push(obj);
|
|
49
|
+
});
|
|
50
|
+
return matches;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* All objects in the graph that have the named component attached
|
|
54
|
+
* (depth-first, document order).
|
|
55
|
+
*/
|
|
56
|
+
export function queryByComponent(root, componentName) {
|
|
57
|
+
const matches = [];
|
|
58
|
+
root.traverse((obj) => {
|
|
59
|
+
if (getComponentNames(obj).includes(componentName))
|
|
60
|
+
matches.push(obj);
|
|
61
|
+
});
|
|
62
|
+
return matches;
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene file types — derived from Zod schemas (single source of truth).
|
|
3
|
+
*
|
|
4
|
+
* Raw types for the .vscn.json file format. Both the editor and the runtime
|
|
5
|
+
* loader work with these directly, applying DEFAULTS (./defaults.ts) for omitted
|
|
6
|
+
* fields — DEFAULTS is the single source of truth for default values.
|
|
7
|
+
*/
|
|
8
|
+
export type { InstancesFile, MaterialFile, PrefabFile, SceneAnimation, SceneAudio, SceneCamera, SceneCollider, SceneEntity, SceneEnvironment, SceneFile, SceneJoint, SceneLight, SceneMaterial, SceneMesh, SceneNavigation, SceneParticles, ScenePhysics, ScenePhysicsSettings, ScenePostProcessing, SceneSpline, SceneToneMapping, UIRoot, } from './schema';
|
|
9
|
+
export { mergePrefabInstance } from './schema';
|
|
10
|
+
//# sourceMappingURL=scene-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-types.d.ts","sourceRoot":"","sources":["../../src/scene/scene-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,MAAM,GACP,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene file types — derived from Zod schemas (single source of truth).
|
|
3
|
+
*
|
|
4
|
+
* Raw types for the .vscn.json file format. Both the editor and the runtime
|
|
5
|
+
* loader work with these directly, applying DEFAULTS (./defaults.ts) for omitted
|
|
6
|
+
* fields — DEFAULTS is the single source of truth for default values.
|
|
7
|
+
*/
|
|
8
|
+
export { mergePrefabInstance } from './schema';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scene/prefab file format `version` range this engine checkout can
|
|
3
|
+
* load (T2.3/D3 §1.E, docs/ENGINE-UPGRADE-DESIGN.md). `[min, max]` — today
|
|
4
|
+
* `[1, 1]`: every shipped `.vscn.json`/`.prefab.json` is version 1, and no
|
|
5
|
+
* migration machinery exists yet (a future format bump widens `max`, and a
|
|
6
|
+
* future engine that drops support for `1` would raise `min`).
|
|
7
|
+
*
|
|
8
|
+
* Deliberately NOT in `./schema/` (that directory's byte contents are
|
|
9
|
+
* pinned by `packages/engine/schemas/engine-capabilities.json`'s
|
|
10
|
+
* `schemaDirHash`, refreshed only by `scripts/capabilities-hash.ts` — this
|
|
11
|
+
* slice does not run that script). This is also why the check below is a
|
|
12
|
+
* POST-Zod-parse function here in `scene/`, not a Zod refinement inside
|
|
13
|
+
* `SceneFileSchema`/`PrefabFileSchema`: the generated `vscn.schema.json`/
|
|
14
|
+
* `prefab.schema.json` stay byte-identical (the `version` field itself is
|
|
15
|
+
* still just `z.number()`).
|
|
16
|
+
*/
|
|
17
|
+
export declare const SUPPORTED_SCENE_VERSION_RANGE: readonly [number, number];
|
|
18
|
+
/**
|
|
19
|
+
* Throw if `version` falls outside `SUPPORTED_SCENE_VERSION_RANGE`; silently
|
|
20
|
+
* accept in-range versions. `fileKind` only changes the error message's noun
|
|
21
|
+
* (`.vscn.json` and `.prefab.json` share this single version axis — verified
|
|
22
|
+
* both schemas declare their own `version: z.number()` field, not a shared
|
|
23
|
+
* ref, but the same counter/semantics per docs/ENGINE-UPGRADE-DESIGN.md).
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkSceneVersionInRange(version: number, fileKind?: 'scene' | 'prefab'): void;
|
|
26
|
+
//# sourceMappingURL=scene-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-version.d.ts","sourceRoot":"","sources":["../../src/scene/scene-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAE/E;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,OAAO,GAAG,QAAkB,GACrC,IAAI,CAWN"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scene/prefab file format `version` range this engine checkout can
|
|
3
|
+
* load (T2.3/D3 §1.E, docs/ENGINE-UPGRADE-DESIGN.md). `[min, max]` — today
|
|
4
|
+
* `[1, 1]`: every shipped `.vscn.json`/`.prefab.json` is version 1, and no
|
|
5
|
+
* migration machinery exists yet (a future format bump widens `max`, and a
|
|
6
|
+
* future engine that drops support for `1` would raise `min`).
|
|
7
|
+
*
|
|
8
|
+
* Deliberately NOT in `./schema/` (that directory's byte contents are
|
|
9
|
+
* pinned by `packages/engine/schemas/engine-capabilities.json`'s
|
|
10
|
+
* `schemaDirHash`, refreshed only by `scripts/capabilities-hash.ts` — this
|
|
11
|
+
* slice does not run that script). This is also why the check below is a
|
|
12
|
+
* POST-Zod-parse function here in `scene/`, not a Zod refinement inside
|
|
13
|
+
* `SceneFileSchema`/`PrefabFileSchema`: the generated `vscn.schema.json`/
|
|
14
|
+
* `prefab.schema.json` stay byte-identical (the `version` field itself is
|
|
15
|
+
* still just `z.number()`).
|
|
16
|
+
*/
|
|
17
|
+
export const SUPPORTED_SCENE_VERSION_RANGE = [1, 1];
|
|
18
|
+
/**
|
|
19
|
+
* Throw if `version` falls outside `SUPPORTED_SCENE_VERSION_RANGE`; silently
|
|
20
|
+
* accept in-range versions. `fileKind` only changes the error message's noun
|
|
21
|
+
* (`.vscn.json` and `.prefab.json` share this single version axis — verified
|
|
22
|
+
* both schemas declare their own `version: z.number()` field, not a shared
|
|
23
|
+
* ref, but the same counter/semantics per docs/ENGINE-UPGRADE-DESIGN.md).
|
|
24
|
+
*/
|
|
25
|
+
export function checkSceneVersionInRange(version, fileKind = 'scene') {
|
|
26
|
+
const [min, max] = SUPPORTED_SCENE_VERSION_RANGE;
|
|
27
|
+
if (version >= min && version <= max)
|
|
28
|
+
return;
|
|
29
|
+
const cause = version > max
|
|
30
|
+
? `the engine checkout is older than this ${fileKind}`
|
|
31
|
+
: `this ${fileKind} predates the oldest supported format version`;
|
|
32
|
+
throw new Error(`${fileKind} version ${version} is outside the supported range [${min}, ${max}] — ` +
|
|
33
|
+
`${cause}; see docs/ENGINE-UPGRADE-DESIGN.md`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneAnimationSchema: z.ZodObject<{
|
|
3
|
+
autoplay: z.ZodOptional<z.ZodString>;
|
|
4
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
clipAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type SceneAnimation = z.infer<typeof SceneAnimationSchema>;
|
|
8
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB,eAAO,MAAM,oBAAoB;;;;iBASc,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// D8 — declarative property tracks (formerly F5,
|
|
4
|
+
// docs/VSCN-STRUCTURAL-GAPS-DESIGN.md) were REMOVED: Theatre
|
|
5
|
+
// (`@theatre/core`) is the sole authored continuous-animation source (spec
|
|
6
|
+
// §3.2, §10 D2-D4/D8). `PropertyTrackSchema`/`PropertyTrackRunner` and the
|
|
7
|
+
// `tracks` field are deleted, not deprecated-in-place — see
|
|
8
|
+
// packages/engine/src/scene/parse.ts (`assertNoRemovedPropertyTracks`) for
|
|
9
|
+
// the loud migration-error guard that rejects any `.vscn`/`.prefab.json`
|
|
10
|
+
// still authoring `animation.tracks`, since Zod would otherwise silently
|
|
11
|
+
// strip an unrecognized field rather than failing loudly (Global AC §6).
|
|
12
|
+
//
|
|
13
|
+
// E5 — the AnimGraph state-machine runtime, `.animgraph.json` format, and
|
|
14
|
+
// every consumer were removed (spec §3.3, §11 E5; XState + native Three
|
|
15
|
+
// `AnimationMixer` replace it — see `xstate-animation-binding.ts`). The
|
|
16
|
+
// `animGraph` field is deleted outright, not deprecated-in-place, for the
|
|
17
|
+
// same reason as `tracks` above: Zod's default object mode would otherwise
|
|
18
|
+
// silently STRIP an authored `animation.animGraph` rather than reporting it,
|
|
19
|
+
// violating Global AC §6 ("Removed formats fail with a concise migration/
|
|
20
|
+
// removal error rather than being partially read"). The raw-JSON guard
|
|
21
|
+
// (`assertNoRemovedAnimGraph` in packages/engine/src/scene/parse.ts) rejects
|
|
22
|
+
// any `.vscn`/`.prefab.json` still authoring it before Zod ever parses the
|
|
23
|
+
// data — see packages/engine/test/anim-graph-removed.test.ts.
|
|
24
|
+
//
|
|
25
|
+
// `parameters` is deleted alongside `animGraph`, though it isn't itself named
|
|
26
|
+
// in the spec/removal-inventory: its ONLY documented purpose was seeding an
|
|
27
|
+
// `AnimGraph`'s initial parameter values (its only readers were
|
|
28
|
+
// `scene-loader.ts`'s former animGraph branch, the editor's entity-factory.ts,
|
|
29
|
+
// and AnimationSection.tsx's parameter-row UI — all deleted with the runtime).
|
|
30
|
+
// Leaving it declared with zero remaining readers would violate this repo's
|
|
31
|
+
// "no schema field without a runtime reader" policy (CLAUDE.md).
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
export const SceneAnimationSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
autoplay: z.string().optional().describe('Clip name to play automatically on load'),
|
|
36
|
+
loop: z.boolean().optional().describe('Whether the autoplay clip should loop'),
|
|
37
|
+
clipAliases: z
|
|
38
|
+
.record(z.string(), z.string())
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Map raw GLTF clip names to clean names'),
|
|
41
|
+
})
|
|
42
|
+
.describe('Animation playback configuration');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneAudioSchema: z.ZodObject<{
|
|
3
|
+
src: z.ZodOptional<z.ZodString>;
|
|
4
|
+
spatial: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
refDistance: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
rolloffFactor: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
maxDistance: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type SceneAudio = z.infer<typeof SceneAudioSchema>;
|
|
13
|
+
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/audio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;;iBAoBY,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SceneAudioSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
src: z.string().optional().describe('Path to audio file (WAV, MP3, OGG)'),
|
|
5
|
+
spatial: z.boolean().optional().describe('Enable 3D spatial audio (positional sound)'),
|
|
6
|
+
volume: z.number().optional().describe('Playback volume 0–1'),
|
|
7
|
+
refDistance: z
|
|
8
|
+
.number()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Distance at which volume starts to attenuate (spatial only)'),
|
|
11
|
+
rolloffFactor: z
|
|
12
|
+
.number()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('How quickly volume attenuates with distance (spatial only)'),
|
|
15
|
+
maxDistance: z
|
|
16
|
+
.number()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Maximum distance at which sound is audible (spatial only)'),
|
|
19
|
+
loop: z.boolean().optional().describe('Whether the audio should loop'),
|
|
20
|
+
autoplay: z.boolean().optional().describe('Start playing automatically when the scene loads'),
|
|
21
|
+
})
|
|
22
|
+
.describe('Audio source configuration');
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneCameraSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodEnum<{
|
|
4
|
+
perspective: "perspective";
|
|
5
|
+
orthographic: "orthographic";
|
|
6
|
+
}>;
|
|
7
|
+
fov: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
near: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
far: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
orthoSize: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
/** Partial schema for prefab instance overrides (type not required). */
|
|
15
|
+
export declare const SceneCameraOverrideSchema: z.ZodObject<{
|
|
16
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
perspective: "perspective";
|
|
18
|
+
orthographic: "orthographic";
|
|
19
|
+
}>>;
|
|
20
|
+
fov: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
near: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
22
|
+
far: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
orthoSize: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
24
|
+
width: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
25
|
+
height: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type SceneCamera = z.infer<typeof SceneCameraSchema>;
|
|
28
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAaK,CAAC;AAEpC,wEAAwE;AACxE,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAA8B,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SceneCameraSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
type: z.enum(['perspective', 'orthographic']).describe('Camera projection type'),
|
|
5
|
+
fov: z.number().optional().describe('Vertical field of view in degrees (perspective only)'),
|
|
6
|
+
near: z.number().optional().describe('Near clipping plane distance'),
|
|
7
|
+
far: z.number().optional().describe('Far clipping plane distance'),
|
|
8
|
+
orthoSize: z
|
|
9
|
+
.number()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Half-height of the orthographic frustum (orthographic only)'),
|
|
12
|
+
width: z.number().optional().describe('Render width in pixels. Defaults to viewport width'),
|
|
13
|
+
height: z.number().optional().describe('Render height in pixels. Defaults to viewport height'),
|
|
14
|
+
})
|
|
15
|
+
.describe('Camera configuration');
|
|
16
|
+
/** Partial schema for prefab instance overrides (type not required). */
|
|
17
|
+
export const SceneCameraOverrideSchema = SceneCameraSchema.partial();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneColliderSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodEnum<{
|
|
4
|
+
cuboid: "cuboid";
|
|
5
|
+
ball: "ball";
|
|
6
|
+
capsule: "capsule";
|
|
7
|
+
trimesh: "trimesh";
|
|
8
|
+
}>;
|
|
9
|
+
halfExtents: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
10
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
halfHeight: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
friction: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
restitution: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
density: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
16
|
+
isSensor: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
collisionGroups: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
collisionFilter: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
/** Partial schema for prefab instance overrides (type not required). */
|
|
21
|
+
export declare const SceneColliderOverrideSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
cuboid: "cuboid";
|
|
24
|
+
ball: "ball";
|
|
25
|
+
capsule: "capsule";
|
|
26
|
+
trimesh: "trimesh";
|
|
27
|
+
}>>;
|
|
28
|
+
halfExtents: z.ZodOptional<z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>>;
|
|
29
|
+
radius: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
+
halfHeight: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
31
|
+
friction: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
restitution: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
33
|
+
density: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
offset: z.ZodOptional<z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>>;
|
|
35
|
+
isSensor: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
36
|
+
collisionGroups: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
collisionFilter: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type SceneCollider = z.infer<typeof SceneColliderSchema>;
|
|
40
|
+
//# sourceMappingURL=collider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collider.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/collider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBA4DoB,CAAC;AAErD,wEAAwE;AACxE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;iBAAgC,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Vec3Schema } from './tuples';
|
|
3
|
+
export const SceneColliderSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
type: z
|
|
6
|
+
.enum(['cuboid', 'ball', 'capsule', 'trimesh'])
|
|
7
|
+
.describe("Collider shape type. T1.2: every shape scales with the entity's composed world scale " +
|
|
8
|
+
"(self × ancestors) — for trimesh this means the entity's own mesh geometry vertices " +
|
|
9
|
+
'are pre-scaled per-axis before building the Rapier trimesh, so it matches whatever ' +
|
|
10
|
+
"size ends up on screen; it does not require the collider's own dimension fields."),
|
|
11
|
+
halfExtents: Vec3Schema.optional().describe("Half-size [x, y, z] for cuboid colliders, in the ENTITY'S OWN LOCAL units. T1.2: " +
|
|
12
|
+
"scales with the entity — the actual Rapier collider is this value times the entity's " +
|
|
13
|
+
'composed world scale (self × every transformed ancestor), per axis, baked in once at ' +
|
|
14
|
+
"load time (Rapier has no live notion of an Object3D's scale)."),
|
|
15
|
+
radius: z
|
|
16
|
+
.number()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Radius for ball and capsule colliders, in the ENTITY'S OWN LOCAL units. T1.2: scales " +
|
|
19
|
+
"with the entity's composed world scale, which MUST be uniform on the collider's round " +
|
|
20
|
+
'axes (ball: all of x/y/z; capsule: x and z) — a non-uniform scale there throws a loud ' +
|
|
21
|
+
'load error (Rapier balls/capsules cannot represent an ellipse).'),
|
|
22
|
+
halfHeight: z
|
|
23
|
+
.number()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Half-height for capsule colliders, in the entity's own local units, along the capsule's " +
|
|
26
|
+
"axis (Y). T1.2: scales by the entity's composed world scale on that axis."),
|
|
27
|
+
friction: z.number().optional().describe('Surface friction coefficient'),
|
|
28
|
+
restitution: z
|
|
29
|
+
.number()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Bounciness coefficient (0 = no bounce, 1 = perfect bounce)'),
|
|
32
|
+
density: z
|
|
33
|
+
.number()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Mass density. Used to compute mass from collider volume'),
|
|
36
|
+
offset: Vec3Schema.optional().describe("Translation offset relative to body origin, in the ENTITY'S OWN LOCAL units. T1.2/R1c: " +
|
|
37
|
+
"scales with the entity's composed world scale (self × every transformed ancestor), " +
|
|
38
|
+
'per axis, the same way halfExtents/radius/halfHeight do — an unscaled offset would ' +
|
|
39
|
+
"silently drift away from the entity's visual anchor point under any non-1 scale."),
|
|
40
|
+
isSensor: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('When true, detects overlaps without physical blocking (trigger volume)'),
|
|
44
|
+
collisionGroups: z
|
|
45
|
+
.number()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Bitmask: collision layers this collider belongs to (max 16 bits)'),
|
|
48
|
+
collisionFilter: z
|
|
49
|
+
.number()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Bitmask: collision layers this collider interacts with (max 16 bits)'),
|
|
52
|
+
})
|
|
53
|
+
.describe('Physics collider shape and properties');
|
|
54
|
+
/** Partial schema for prefab instance overrides (type not required). */
|
|
55
|
+
export const SceneColliderOverrideSchema = SceneColliderSchema.partial();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* F6 (`docs/VSCN-STRUCTURAL-GAPS-DESIGN.md`) — a first-class, reusable
|
|
4
|
+
* reference from one entity to another, for a `GameComponent`'s own static
|
|
5
|
+
* Zod schema (e.g. `target: EntityRefSchema` — "this button opens THAT
|
|
6
|
+
* door"). A branded string: on disk (and through generic component-data
|
|
7
|
+
* validation) it is a plain string id, but a component field typed
|
|
8
|
+
* `EntityRef` is compile-time distinct from an arbitrary `string` field, so a
|
|
9
|
+
* bare label can't be assigned where a ref is expected.
|
|
10
|
+
*
|
|
11
|
+
* Resolution is a runtime concern, not a schema one: `scene-loader.ts`'s
|
|
12
|
+
* `resolveEntityRefs` (the post-spawn pass, modeled on `joint.target`'s
|
|
13
|
+
* existing resolution) rewrites the field from the authored string id to the
|
|
14
|
+
* live `THREE.Object3D` — through the SAME `idMap` `createSceneJoints`
|
|
15
|
+
* already uses, no new registry (G3) — before the referencing component's
|
|
16
|
+
* `init()` runs.
|
|
17
|
+
*/
|
|
18
|
+
export declare const EntityRefSchema: z.core.$ZodBranded<z.ZodString, "EntityRef", "out">;
|
|
19
|
+
export type EntityRef = z.infer<typeof EntityRefSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Is `schema` an {@link EntityRefSchema} field — including when wrapped by
|
|
22
|
+
* `.optional()`, `.default(...)`, or `.nullable()` (the common ways a
|
|
23
|
+
* component author would declare an optional ref)? Unwraps those via zod 4's
|
|
24
|
+
* internal `_def.innerType` (there is no public reflection API for this —
|
|
25
|
+
* `packages/editor/src/components/inspectors/zod-fields.ts` uses the same
|
|
26
|
+
* mechanism to introspect component schemas for the inspector) down to the
|
|
27
|
+
* core schema, then checks it against the registered `EntityRefSchema`
|
|
28
|
+
* instance by reference.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isEntityRefSchema(schema: z.core.$ZodType): boolean;
|
|
31
|
+
//# sourceMappingURL=entity-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-ref.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/entity-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,qDAOzB,CAAC;AAEJ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AA8BxD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAUlE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* F6 (`docs/VSCN-STRUCTURAL-GAPS-DESIGN.md`) — a first-class, reusable
|
|
4
|
+
* reference from one entity to another, for a `GameComponent`'s own static
|
|
5
|
+
* Zod schema (e.g. `target: EntityRefSchema` — "this button opens THAT
|
|
6
|
+
* door"). A branded string: on disk (and through generic component-data
|
|
7
|
+
* validation) it is a plain string id, but a component field typed
|
|
8
|
+
* `EntityRef` is compile-time distinct from an arbitrary `string` field, so a
|
|
9
|
+
* bare label can't be assigned where a ref is expected.
|
|
10
|
+
*
|
|
11
|
+
* Resolution is a runtime concern, not a schema one: `scene-loader.ts`'s
|
|
12
|
+
* `resolveEntityRefs` (the post-spawn pass, modeled on `joint.target`'s
|
|
13
|
+
* existing resolution) rewrites the field from the authored string id to the
|
|
14
|
+
* live `THREE.Object3D` — through the SAME `idMap` `createSceneJoints`
|
|
15
|
+
* already uses, no new registry (G3) — before the referencing component's
|
|
16
|
+
* `init()` runs.
|
|
17
|
+
*/
|
|
18
|
+
export const EntityRefSchema = z
|
|
19
|
+
.string()
|
|
20
|
+
.brand()
|
|
21
|
+
.describe('A reference to another entity by its authored id. On disk it is a plain string id; the ' +
|
|
22
|
+
'scene loader resolves it to the live THREE.Object3D (WorldNode-as-truth) before the ' +
|
|
23
|
+
"referencing component's init() runs. A ref to a missing id is a loud load error.");
|
|
24
|
+
/**
|
|
25
|
+
* Identity registry of the `EntityRefSchema` object (there is exactly one —
|
|
26
|
+
* this module's export), used by {@link isEntityRefSchema}.
|
|
27
|
+
*
|
|
28
|
+
* Why identity rather than a Zod "type name" check: zod 4's `.brand()` is a
|
|
29
|
+
* type-only cast (see zod's own source — `inst.brand = () => inst`), not a
|
|
30
|
+
* distinct wrapper class runtime code could switch on. A branded schema is,
|
|
31
|
+
* at runtime, just the underlying `ZodString` (here, after `.describe()`
|
|
32
|
+
* clones it once more — see zod's `check()`/`clone()`). So "is this an
|
|
33
|
+
* EntityRef field" can only be answered by reference identity against the
|
|
34
|
+
* one schema object every ref field is declared with — which is exactly
|
|
35
|
+
* what we want anyway: a look-alike `z.string()` field must NOT count.
|
|
36
|
+
*/
|
|
37
|
+
const ENTITY_REF_SCHEMAS = new WeakSet();
|
|
38
|
+
ENTITY_REF_SCHEMAS.add(EntityRefSchema);
|
|
39
|
+
/**
|
|
40
|
+
* Is `schema` an {@link EntityRefSchema} field — including when wrapped by
|
|
41
|
+
* `.optional()`, `.default(...)`, or `.nullable()` (the common ways a
|
|
42
|
+
* component author would declare an optional ref)? Unwraps those via zod 4's
|
|
43
|
+
* internal `_def.innerType` (there is no public reflection API for this —
|
|
44
|
+
* `packages/editor/src/components/inspectors/zod-fields.ts` uses the same
|
|
45
|
+
* mechanism to introspect component schemas for the inspector) down to the
|
|
46
|
+
* core schema, then checks it against the registered `EntityRefSchema`
|
|
47
|
+
* instance by reference.
|
|
48
|
+
*/
|
|
49
|
+
export function isEntityRefSchema(schema) {
|
|
50
|
+
let cur = schema;
|
|
51
|
+
while (cur) {
|
|
52
|
+
if (ENTITY_REF_SCHEMAS.has(cur))
|
|
53
|
+
return true;
|
|
54
|
+
const inner = cur._def
|
|
55
|
+
?.innerType;
|
|
56
|
+
if (!inner)
|
|
57
|
+
return false;
|
|
58
|
+
cur = inner;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|