@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,304 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type SceneEntity } from './entity';
|
|
3
|
+
export declare const SceneFileSchema: z.ZodObject<{
|
|
4
|
+
version: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
background: z.ZodOptional<z.ZodString>;
|
|
8
|
+
ambient: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
color: z.ZodString;
|
|
10
|
+
intensity: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
fog: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
type: z.ZodEnum<{
|
|
14
|
+
linear: "linear";
|
|
15
|
+
exponential: "exponential";
|
|
16
|
+
}>;
|
|
17
|
+
color: z.ZodString;
|
|
18
|
+
near: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
far: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
density: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
skybox: z.ZodOptional<z.ZodString>;
|
|
23
|
+
envMapIntensity: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
toneMapping: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
none: "none";
|
|
27
|
+
linear: "linear";
|
|
28
|
+
reinhard: "reinhard";
|
|
29
|
+
cineon: "cineon";
|
|
30
|
+
aces: "aces";
|
|
31
|
+
agx: "agx";
|
|
32
|
+
}>>;
|
|
33
|
+
exposure: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
postProcessing: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
bloom: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
luminanceThreshold: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
luminanceSmoothing: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
vignette: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
darkness: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
brightnessContrast: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
brightness: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
contrast: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
hueSaturation: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
hue: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
saturation: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
sepia: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
colorDepth: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
bits: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
chromaticAberration: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
offsetX: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
offsetY: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
radialModulation: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
modulationOffset: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
lensDistortion: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
distortionX: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
distortionY: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
focalLengthX: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
focalLengthY: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
skew: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
depthOfField: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
worldFocusDistance: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
worldFocusRange: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
bokehScale: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
focalLength: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
tiltShift: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
focusArea: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
feather: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
noise: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
premultiply: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
scanline: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
density: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
dotScreen: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
grid: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
pixelation: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
granularity: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
glitch: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
delayX: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
delayY: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
durationX: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
durationY: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
strengthX: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
strengthY: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
columns: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
ratio: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
shockWave: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
maxRadius: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
waveSize: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
amplitude: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
positionX: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
positionY: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
positionZ: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
smaa: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
preset: z.ZodOptional<z.ZodEnum<{
|
|
140
|
+
low: "low";
|
|
141
|
+
medium: "medium";
|
|
142
|
+
high: "high";
|
|
143
|
+
ultra: "ultra";
|
|
144
|
+
}>>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
ssao: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
bias: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
samples: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
rings: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
fade: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
color: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
n8ao: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
aoSamples: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
aoRadius: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
denoiseSamples: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
denoiseRadius: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
distanceFalloff: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
screenSpaceRadius: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
color: z.ZodOptional<z.ZodString>;
|
|
166
|
+
halfRes: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
}, z.core.$strip>>;
|
|
168
|
+
godRays: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
sourceEntity: z.ZodOptional<z.ZodString>;
|
|
171
|
+
density: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
decay: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
exposure: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
samples: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
outline: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
180
|
+
edgeStrength: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
pulseSpeed: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
visibleEdgeColor: z.ZodOptional<z.ZodString>;
|
|
183
|
+
hiddenEdgeColor: z.ZodOptional<z.ZodString>;
|
|
184
|
+
xRay: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
ssr: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
exponent: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
maxRoughness: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
ssgi: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
196
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
maxRoughness: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
motionBlur: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
203
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
jitter: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
samples: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
}, z.core.$strip>>;
|
|
208
|
+
navigation: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
cellSize: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
cellHeight: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
walkableSlopeAngle: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
walkableHeight: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
walkableClimb: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
walkableRadius: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
maxEdgeLen: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
maxSimplificationError: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
minRegionArea: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
mergeRegionArea: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
physics: z.ZodOptional<z.ZodObject<{
|
|
221
|
+
collisionLayers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
rendering: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
entities: z.ZodArray<z.ZodType<SceneEntity, unknown, z.core.$ZodTypeInternals<SceneEntity, unknown>>>;
|
|
226
|
+
ui: z.ZodOptional<z.ZodArray<z.ZodType<import("./ui").UIRoot, unknown, z.core.$ZodTypeInternals<import("./ui").UIRoot, unknown>>>>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
export type SceneFile = z.infer<typeof SceneFileSchema>;
|
|
229
|
+
export declare const PrefabFileSchema: z.ZodObject<{
|
|
230
|
+
version: z.ZodNumber;
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
root: z.ZodType<SceneEntity, unknown, z.core.$ZodTypeInternals<SceneEntity, unknown>>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type PrefabFile = z.infer<typeof PrefabFileSchema>;
|
|
235
|
+
/**
|
|
236
|
+
* Merge a prefab root definition with an instance's overrides.
|
|
237
|
+
*
|
|
238
|
+
* Per-field merge rules (exactly as implemented below):
|
|
239
|
+
*
|
|
240
|
+
* - transform: instance wins entirely if set, else the prefab root's transform
|
|
241
|
+
* (placement is per-instance; transforms are not blended field-by-field).
|
|
242
|
+
* - name: instance always wins.
|
|
243
|
+
* - id: instance wins if set (each instance has its own id); else prefab's.
|
|
244
|
+
* - prefab: stripped from the result so spawnEntity recursion terminates.
|
|
245
|
+
*
|
|
246
|
+
* - Sections — `mesh`, `light`, `camera`, `animation`, `audio`, `particles`,
|
|
247
|
+
* `spline`, `render`: SHALLOW merge per section. If the instance sets the
|
|
248
|
+
* section, its top-level fields override the prefab root's same-named
|
|
249
|
+
* fields ({ ...prefabSection, ...instanceSection }); fields the instance
|
|
250
|
+
* omits fall through to the prefab. Nested objects are replaced, not
|
|
251
|
+
* deep-merged. If only the prefab has the section it is kept as-is.
|
|
252
|
+
* (CB4: `spline` is included here; CB5: see metadata below; T1.10: `render`
|
|
253
|
+
* is now included — an instance's per-entity render overrides are honored
|
|
254
|
+
* and merged the same way as `mesh`/`material`.)
|
|
255
|
+
*
|
|
256
|
+
* NOTE (T1.10 audit): `mesh.instancerParams`/`mesh.generatorParams` and
|
|
257
|
+
* `animation.parameters`/`animation.clipAliases` are keyed dict maps nested
|
|
258
|
+
* one level down, and `particles` nests discriminated-union shapes/behaviors
|
|
259
|
+
* arrays. These have the same "shallow replace" defect as `material`/
|
|
260
|
+
* `physics` did, but no single well-defined field-merge semantics (dict keys
|
|
261
|
+
* authors may legitimately want fully replaced; discriminated unions can't
|
|
262
|
+
* be safely field-merged across different variants). Left as wholesale
|
|
263
|
+
* per-section replace; flagged here rather than silently "fixed" with a
|
|
264
|
+
* guess. Revisit if this causes real authoring pain.
|
|
265
|
+
*
|
|
266
|
+
* - `material`: shallow merge at the top level, PLUS deep-merge of the four
|
|
267
|
+
* nested physical-material feature groups (`clearcoat`, `transmission`,
|
|
268
|
+
* `sheen`, `iridescence`) so an instance overriding e.g. `clearcoat.clearcoat`
|
|
269
|
+
* preserves the prefab's `clearcoat.clearcoatRoughness` (T1.10 — previously
|
|
270
|
+
* these nested groups were wholesale-replaced like any other shallow field).
|
|
271
|
+
*
|
|
272
|
+
* - `physics`: shallow merge at the top level (`bodyType`, `mass`), PLUS
|
|
273
|
+
* deep-merge of the nested `collider` object so a partial instance collider
|
|
274
|
+
* override (e.g. just `isSensor`) preserves the prefab's `type` and other
|
|
275
|
+
* collider fields instead of dropping them (T1.10 AC).
|
|
276
|
+
*
|
|
277
|
+
* - `shadow`: shallow merge at the top level, PLUS deep-merge of the nested
|
|
278
|
+
* `camera` (shadow-camera frustum bounds) object, for the same reason as
|
|
279
|
+
* `physics.collider` (T1.10 audit — same defect, same fix).
|
|
280
|
+
*
|
|
281
|
+
* - components: DEEP merge, keyed by component name. The union of component
|
|
282
|
+
* names is taken; for each, instance fields override prefab fields
|
|
283
|
+
* ({ ...prefabComp, ...instanceComp }).
|
|
284
|
+
*
|
|
285
|
+
* - joints: REPLACE — if the instance sets joints, its array wins wholesale
|
|
286
|
+
* (arrays are not field-mergeable); else the prefab's joints are kept.
|
|
287
|
+
* - children: APPEND — prefab children first, then instance-only children.
|
|
288
|
+
*
|
|
289
|
+
* - Instance-level metadata `visible`, `materialRef`, `tags`, `locked`,
|
|
290
|
+
* `navigation`, `pivot`: instance wins if explicitly set, otherwise the
|
|
291
|
+
* prefab root's value is inherited. (CB5: spline + these metadata fields are
|
|
292
|
+
* now instance-wins; previously dropped.)
|
|
293
|
+
*
|
|
294
|
+
* - Re-validation (T1.10): the merged entity is re-parsed through
|
|
295
|
+
* `SceneEntitySchema` before being returned. This is what makes the
|
|
296
|
+
* material/materialRef mutual-exclusion refine fire on the MERGED result —
|
|
297
|
+
* previously a prefab's inline `material` plus an instance's `materialRef`
|
|
298
|
+
* (or vice versa) silently combined into an entity carrying both, bypassing
|
|
299
|
+
* the refine entirely (it only ever saw the pre-merge, individually-valid
|
|
300
|
+
* halves). A merge that produces an invalid entity now throws, naming the
|
|
301
|
+
* offending prefab path + instance name.
|
|
302
|
+
*/
|
|
303
|
+
export declare function mergePrefabInstance(prefabRoot: SceneEntity, instance: SceneEntity): SceneEntity;
|
|
304
|
+
//# sourceMappingURL=scene-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-file.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/scene-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,UAAU,CAAC;AAI/D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaU,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;iBAMY,CAAC;AAE1C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AA8D1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,GAAG,WAAW,CA+B/F"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SceneEntitySchema } from './entity';
|
|
3
|
+
import { SceneEnvironmentSchema } from './environment';
|
|
4
|
+
import { UIRootSchema } from './ui';
|
|
5
|
+
export const SceneFileSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
version: z.number().describe('Scene file format version'),
|
|
8
|
+
name: z.string().describe('Scene display name'),
|
|
9
|
+
environment: SceneEnvironmentSchema.optional().describe('Scene-level environment settings'),
|
|
10
|
+
entities: z.array(SceneEntitySchema).describe('Top-level entities in the scene'),
|
|
11
|
+
// UI roots (HUD/menus) attached to the scene graph as data. Optional and
|
|
12
|
+
// additive — pre-UI scenes (no `ui` field) load unchanged (A4 versioning).
|
|
13
|
+
ui: z
|
|
14
|
+
.array(UIRootSchema)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('React UI roots (canvases) attached to the scene graph (A1)'),
|
|
17
|
+
})
|
|
18
|
+
.describe('Scene file (.vscn.json)');
|
|
19
|
+
export const PrefabFileSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
version: z.number().describe('Prefab file format version'),
|
|
22
|
+
name: z.string().describe('Prefab display name'),
|
|
23
|
+
root: SceneEntitySchema.describe('Root entity of the prefab'),
|
|
24
|
+
})
|
|
25
|
+
.describe('Prefab file (.prefab.json)');
|
|
26
|
+
/**
|
|
27
|
+
* Shallow-merge a section, but deep-merge specific named nested sub-objects
|
|
28
|
+
* within it (e.g. `physics.collider`, `material.clearcoat`). A partial
|
|
29
|
+
* instance override of a nested sub-object would otherwise wholesale-replace
|
|
30
|
+
* it and drop the prefab's other fields in that sub-object (e.g. an instance
|
|
31
|
+
* overriding one collider field would silently lose the prefab's `type`).
|
|
32
|
+
*/
|
|
33
|
+
function mergeSectionDeepNested(prefabSection, instanceSection, nestedKeys) {
|
|
34
|
+
if (instanceSection === undefined)
|
|
35
|
+
return prefabSection;
|
|
36
|
+
if (prefabSection === undefined)
|
|
37
|
+
return instanceSection;
|
|
38
|
+
const merged = { ...prefabSection, ...instanceSection };
|
|
39
|
+
for (const key of nestedKeys) {
|
|
40
|
+
const p = prefabSection[key];
|
|
41
|
+
const i = instanceSection[key];
|
|
42
|
+
if (i !== undefined &&
|
|
43
|
+
p !== undefined &&
|
|
44
|
+
typeof i === 'object' &&
|
|
45
|
+
typeof p === 'object' &&
|
|
46
|
+
!Array.isArray(i) &&
|
|
47
|
+
!Array.isArray(p)) {
|
|
48
|
+
merged[key] = { ...p, ...i };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return merged;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Sections whose nested sub-object needs deep merging (T1.10) — see the
|
|
55
|
+
* `mergePrefabInstance` docstring for the reasoning behind each.
|
|
56
|
+
*/
|
|
57
|
+
const DEEP_NESTED_SECTIONS = [
|
|
58
|
+
{ key: 'physics', nestedKeys: ['collider'] },
|
|
59
|
+
{ key: 'material', nestedKeys: ['clearcoat', 'transmission', 'sheen', 'iridescence'] },
|
|
60
|
+
{ key: 'shadow', nestedKeys: ['camera'] },
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Re-validate a merged entity through `SceneEntitySchema` (T1.10). This is
|
|
64
|
+
* the gate that catches a prefab's inline `material` combined with an
|
|
65
|
+
* instance's `materialRef` (or vice versa) — each half is individually valid,
|
|
66
|
+
* so only the MERGED entity can trip the material/materialRef
|
|
67
|
+
* mutual-exclusion refine. Throws naming the offending prefab path + instance
|
|
68
|
+
* so a bad scene file points straight at the offender.
|
|
69
|
+
*/
|
|
70
|
+
function validateMergedEntity(merged, instance) {
|
|
71
|
+
const validated = SceneEntitySchema.safeParse(merged);
|
|
72
|
+
if (validated.success)
|
|
73
|
+
return validated.data;
|
|
74
|
+
const issues = validated.error.issues.map((issue) => issue.message).join('; ');
|
|
75
|
+
const prefabPath = instance.prefab ?? '<unknown prefab>';
|
|
76
|
+
throw new Error(`Prefab merge produced an invalid entity — prefab "${prefabPath}", instance "${instance.name}": ${issues}`);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Merge a prefab root definition with an instance's overrides.
|
|
80
|
+
*
|
|
81
|
+
* Per-field merge rules (exactly as implemented below):
|
|
82
|
+
*
|
|
83
|
+
* - transform: instance wins entirely if set, else the prefab root's transform
|
|
84
|
+
* (placement is per-instance; transforms are not blended field-by-field).
|
|
85
|
+
* - name: instance always wins.
|
|
86
|
+
* - id: instance wins if set (each instance has its own id); else prefab's.
|
|
87
|
+
* - prefab: stripped from the result so spawnEntity recursion terminates.
|
|
88
|
+
*
|
|
89
|
+
* - Sections — `mesh`, `light`, `camera`, `animation`, `audio`, `particles`,
|
|
90
|
+
* `spline`, `render`: SHALLOW merge per section. If the instance sets the
|
|
91
|
+
* section, its top-level fields override the prefab root's same-named
|
|
92
|
+
* fields ({ ...prefabSection, ...instanceSection }); fields the instance
|
|
93
|
+
* omits fall through to the prefab. Nested objects are replaced, not
|
|
94
|
+
* deep-merged. If only the prefab has the section it is kept as-is.
|
|
95
|
+
* (CB4: `spline` is included here; CB5: see metadata below; T1.10: `render`
|
|
96
|
+
* is now included — an instance's per-entity render overrides are honored
|
|
97
|
+
* and merged the same way as `mesh`/`material`.)
|
|
98
|
+
*
|
|
99
|
+
* NOTE (T1.10 audit): `mesh.instancerParams`/`mesh.generatorParams` and
|
|
100
|
+
* `animation.parameters`/`animation.clipAliases` are keyed dict maps nested
|
|
101
|
+
* one level down, and `particles` nests discriminated-union shapes/behaviors
|
|
102
|
+
* arrays. These have the same "shallow replace" defect as `material`/
|
|
103
|
+
* `physics` did, but no single well-defined field-merge semantics (dict keys
|
|
104
|
+
* authors may legitimately want fully replaced; discriminated unions can't
|
|
105
|
+
* be safely field-merged across different variants). Left as wholesale
|
|
106
|
+
* per-section replace; flagged here rather than silently "fixed" with a
|
|
107
|
+
* guess. Revisit if this causes real authoring pain.
|
|
108
|
+
*
|
|
109
|
+
* - `material`: shallow merge at the top level, PLUS deep-merge of the four
|
|
110
|
+
* nested physical-material feature groups (`clearcoat`, `transmission`,
|
|
111
|
+
* `sheen`, `iridescence`) so an instance overriding e.g. `clearcoat.clearcoat`
|
|
112
|
+
* preserves the prefab's `clearcoat.clearcoatRoughness` (T1.10 — previously
|
|
113
|
+
* these nested groups were wholesale-replaced like any other shallow field).
|
|
114
|
+
*
|
|
115
|
+
* - `physics`: shallow merge at the top level (`bodyType`, `mass`), PLUS
|
|
116
|
+
* deep-merge of the nested `collider` object so a partial instance collider
|
|
117
|
+
* override (e.g. just `isSensor`) preserves the prefab's `type` and other
|
|
118
|
+
* collider fields instead of dropping them (T1.10 AC).
|
|
119
|
+
*
|
|
120
|
+
* - `shadow`: shallow merge at the top level, PLUS deep-merge of the nested
|
|
121
|
+
* `camera` (shadow-camera frustum bounds) object, for the same reason as
|
|
122
|
+
* `physics.collider` (T1.10 audit — same defect, same fix).
|
|
123
|
+
*
|
|
124
|
+
* - components: DEEP merge, keyed by component name. The union of component
|
|
125
|
+
* names is taken; for each, instance fields override prefab fields
|
|
126
|
+
* ({ ...prefabComp, ...instanceComp }).
|
|
127
|
+
*
|
|
128
|
+
* - joints: REPLACE — if the instance sets joints, its array wins wholesale
|
|
129
|
+
* (arrays are not field-mergeable); else the prefab's joints are kept.
|
|
130
|
+
* - children: APPEND — prefab children first, then instance-only children.
|
|
131
|
+
*
|
|
132
|
+
* - Instance-level metadata `visible`, `materialRef`, `tags`, `locked`,
|
|
133
|
+
* `navigation`, `pivot`: instance wins if explicitly set, otherwise the
|
|
134
|
+
* prefab root's value is inherited. (CB5: spline + these metadata fields are
|
|
135
|
+
* now instance-wins; previously dropped.)
|
|
136
|
+
*
|
|
137
|
+
* - Re-validation (T1.10): the merged entity is re-parsed through
|
|
138
|
+
* `SceneEntitySchema` before being returned. This is what makes the
|
|
139
|
+
* material/materialRef mutual-exclusion refine fire on the MERGED result —
|
|
140
|
+
* previously a prefab's inline `material` plus an instance's `materialRef`
|
|
141
|
+
* (or vice versa) silently combined into an entity carrying both, bypassing
|
|
142
|
+
* the refine entirely (it only ever saw the pre-merge, individually-valid
|
|
143
|
+
* halves). A merge that produces an invalid entity now throws, naming the
|
|
144
|
+
* offending prefab path + instance name.
|
|
145
|
+
*/
|
|
146
|
+
export function mergePrefabInstance(prefabRoot, instance) {
|
|
147
|
+
const merged = {
|
|
148
|
+
...prefabRoot,
|
|
149
|
+
name: instance.name,
|
|
150
|
+
};
|
|
151
|
+
// Handle optional fields explicitly to satisfy exactOptionalPropertyTypes
|
|
152
|
+
const resolvedTransform = instance.transform ?? prefabRoot.transform;
|
|
153
|
+
if (resolvedTransform)
|
|
154
|
+
merged.transform = resolvedTransform;
|
|
155
|
+
if (instance.id)
|
|
156
|
+
merged.id = instance.id;
|
|
157
|
+
// Strip prefab field so spawnEntity won't recurse infinitely
|
|
158
|
+
delete merged.prefab;
|
|
159
|
+
applyInstanceMetadata(merged, prefabRoot, instance);
|
|
160
|
+
applyDeepNestedSections(merged, prefabRoot, instance);
|
|
161
|
+
applyShallowSections(merged, prefabRoot, instance);
|
|
162
|
+
const components = mergeComponents(prefabRoot, instance);
|
|
163
|
+
if (components !== undefined)
|
|
164
|
+
merged.components = components;
|
|
165
|
+
// Joints: instance wins (array, not shallow-mergeable)
|
|
166
|
+
if (instance.joints !== undefined) {
|
|
167
|
+
merged.joints = instance.joints;
|
|
168
|
+
}
|
|
169
|
+
const children = mergeChildren(prefabRoot, instance);
|
|
170
|
+
if (children !== undefined)
|
|
171
|
+
merged.children = children;
|
|
172
|
+
// Re-validate the merged result (T1.10) — see `validateMergedEntity` above.
|
|
173
|
+
return validateMergedEntity(merged, instance);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Visibility + instance-level metadata (`materialRef`, `tags`, `locked`,
|
|
177
|
+
* `navigation`, `pivot`): instance wins if explicitly set, otherwise the
|
|
178
|
+
* prefab root's value (already present on `merged` via the initial spread in
|
|
179
|
+
* `mergePrefabInstance`) is kept.
|
|
180
|
+
*/
|
|
181
|
+
function applyInstanceMetadata(merged, prefabRoot, instance) {
|
|
182
|
+
if (instance.visible !== undefined)
|
|
183
|
+
merged.visible = instance.visible;
|
|
184
|
+
if (instance.materialRef !== undefined)
|
|
185
|
+
merged.materialRef = instance.materialRef;
|
|
186
|
+
if (instance.tags !== undefined)
|
|
187
|
+
merged.tags = instance.tags;
|
|
188
|
+
if (instance.locked !== undefined)
|
|
189
|
+
merged.locked = instance.locked;
|
|
190
|
+
if (instance.navigation !== undefined)
|
|
191
|
+
merged.navigation = instance.navigation;
|
|
192
|
+
if (instance.pivot !== undefined) {
|
|
193
|
+
merged.pivot = instance.pivot;
|
|
194
|
+
}
|
|
195
|
+
else if (prefabRoot.pivot !== undefined) {
|
|
196
|
+
merged.pivot = prefabRoot.pivot;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Sections whose nested sub-object needs deep (not shallow) merging — see the
|
|
201
|
+
* `mergePrefabInstance` docstring for the reasoning behind each.
|
|
202
|
+
*/
|
|
203
|
+
function applyDeepNestedSections(merged, prefabRoot, instance) {
|
|
204
|
+
for (const { key, nestedKeys } of DEEP_NESTED_SECTIONS) {
|
|
205
|
+
const result = mergeSectionDeepNested(
|
|
206
|
+
// biome-ignore lint/suspicious/noExplicitAny: TS can't correlate indexed access across a union of keys
|
|
207
|
+
prefabRoot[key],
|
|
208
|
+
// biome-ignore lint/suspicious/noExplicitAny: TS can't correlate indexed access across a union of keys
|
|
209
|
+
instance[key], nestedKeys);
|
|
210
|
+
// biome-ignore lint/suspicious/noExplicitAny: TS can't correlate indexed access across a union of keys
|
|
211
|
+
if (result !== undefined)
|
|
212
|
+
merged[key] = result;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/** Sections shallow-merged whole (material/physics/shadow handled separately above). */
|
|
216
|
+
const SHALLOW_SECTIONS = [
|
|
217
|
+
'mesh',
|
|
218
|
+
'light',
|
|
219
|
+
'camera',
|
|
220
|
+
'animation',
|
|
221
|
+
'audio',
|
|
222
|
+
'particles',
|
|
223
|
+
'spline',
|
|
224
|
+
'render',
|
|
225
|
+
];
|
|
226
|
+
/**
|
|
227
|
+
* Shallow merge per remaining section — instance fields override within the
|
|
228
|
+
* section ({ ...prefabSection, ...instanceSection }); if only the prefab has
|
|
229
|
+
* the section it is kept as-is.
|
|
230
|
+
*/
|
|
231
|
+
function applyShallowSections(merged, prefabRoot, instance) {
|
|
232
|
+
for (const key of SHALLOW_SECTIONS) {
|
|
233
|
+
if (instance[key] === undefined)
|
|
234
|
+
continue;
|
|
235
|
+
// biome-ignore lint/suspicious/noExplicitAny: TS can't correlate indexed access across a union of keys
|
|
236
|
+
merged[key] =
|
|
237
|
+
prefabRoot[key] !== undefined
|
|
238
|
+
? // biome-ignore lint/suspicious/noExplicitAny: TS can't correlate indexed access across a union of keys
|
|
239
|
+
{ ...prefabRoot[key], ...instance[key] }
|
|
240
|
+
: instance[key];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/** Deep merge `components`, keyed by component name (instance fields win per-component). */
|
|
244
|
+
function mergeComponents(prefabRoot, instance) {
|
|
245
|
+
if (!instance.components && !prefabRoot.components)
|
|
246
|
+
return undefined;
|
|
247
|
+
const base = prefabRoot.components ?? {};
|
|
248
|
+
const over = instance.components ?? {};
|
|
249
|
+
const result = {};
|
|
250
|
+
for (const comp of new Set([...Object.keys(base), ...Object.keys(over)])) {
|
|
251
|
+
result[comp] = { ...base[comp], ...over[comp] };
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
/** Children: prefab children first, then instance-only children appended. */
|
|
256
|
+
function mergeChildren(prefabRoot, instance) {
|
|
257
|
+
const prefabChildren = prefabRoot.children ?? [];
|
|
258
|
+
const instanceChildren = instance.children ?? [];
|
|
259
|
+
if (prefabChildren.length === 0 && instanceChildren.length === 0)
|
|
260
|
+
return undefined;
|
|
261
|
+
return [...prefabChildren, ...instanceChildren];
|
|
262
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneShadowSchema: z.ZodObject<{
|
|
3
|
+
enabled: z.ZodBoolean;
|
|
4
|
+
mapSize: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
camera: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
bias: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
/** Partial schema for prefab instance overrides (enabled not required). */
|
|
15
|
+
export declare const SceneShadowOverrideSchema: z.ZodObject<{
|
|
16
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
mapSize: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
18
|
+
camera: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
19
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>>>;
|
|
24
|
+
radius: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
25
|
+
bias: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type SceneShadow = z.infer<typeof SceneShadowSchema>;
|
|
28
|
+
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/shadow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAgBa,CAAC;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAA8B,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const SceneShadowSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
enabled: z.boolean().describe('Whether this light casts shadows'),
|
|
5
|
+
mapSize: z.number().optional().describe('Shadow map resolution in pixels (e.g. 1024, 2048)'),
|
|
6
|
+
camera: z
|
|
7
|
+
.object({
|
|
8
|
+
left: z.number().optional().describe('Left bound of shadow camera frustum'),
|
|
9
|
+
right: z.number().optional().describe('Right bound of shadow camera frustum'),
|
|
10
|
+
top: z.number().optional().describe('Top bound of shadow camera frustum'),
|
|
11
|
+
bottom: z.number().optional().describe('Bottom bound of shadow camera frustum'),
|
|
12
|
+
})
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Shadow camera frustum bounds (directional lights)'),
|
|
15
|
+
radius: z.number().optional().describe('Shadow map blur radius for soft shadows'),
|
|
16
|
+
bias: z.number().optional().describe('Shadow bias to reduce shadow acne artifacts'),
|
|
17
|
+
})
|
|
18
|
+
.describe('Shadow casting configuration');
|
|
19
|
+
/** Partial schema for prefab instance overrides (enabled not required). */
|
|
20
|
+
export const SceneShadowOverrideSchema = SceneShadowSchema.partial();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SceneSplineSchema: z.ZodObject<{
|
|
3
|
+
curveType: z.ZodEnum<{
|
|
4
|
+
centripetal: "centripetal";
|
|
5
|
+
chordal: "chordal";
|
|
6
|
+
catmullrom: "catmullrom";
|
|
7
|
+
}>;
|
|
8
|
+
points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
9
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
tension: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
resolution: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SceneSpline = z.infer<typeof SceneSplineSchema>;
|
|
14
|
+
export declare const SceneSplineOverrideSchema: z.ZodObject<{
|
|
15
|
+
curveType: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
centripetal: "centripetal";
|
|
17
|
+
chordal: "chordal";
|
|
18
|
+
catmullrom: "catmullrom";
|
|
19
|
+
}>>;
|
|
20
|
+
points: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>>;
|
|
21
|
+
closed: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
22
|
+
tension: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
resolution: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
//# sourceMappingURL=spline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spline.d.ts","sourceRoot":"","sources":["../../../src/scene/schema/spline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;iBAa5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,yBAAyB;;;;;;;;;;iBAA8B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Vec3Schema } from './tuples';
|
|
3
|
+
export const SceneSplineSchema = z.object({
|
|
4
|
+
curveType: z
|
|
5
|
+
.enum(['centripetal', 'chordal', 'catmullrom'])
|
|
6
|
+
.describe('CatmullRomCurve3 parameterization type. Matches Three.js curveType parameter'),
|
|
7
|
+
points: z.array(Vec3Schema).min(2).describe('Control point positions in local space'),
|
|
8
|
+
closed: z.boolean().optional().describe('Whether the spline forms a closed loop'),
|
|
9
|
+
tension: z
|
|
10
|
+
.number()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('Curve tension (default 0.5). Only used when curveType is catmullrom; ignored for centripetal and chordal'),
|
|
13
|
+
resolution: z.number().optional().describe('Number of line segments for rendering the curve'),
|
|
14
|
+
});
|
|
15
|
+
export const SceneSplineOverrideSchema = SceneSplineSchema.partial();
|