@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,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Vec2Schema } from './tuples2d';
|
|
3
|
+
/**
|
|
4
|
+
* `sprite` authored section — engine-owned 2D sprite data, NOT a `PIXI.Sprite`.
|
|
5
|
+
*
|
|
6
|
+
* Per ARCHITECTURE.md §Render Surfaces: authored data says `sprite`, and a runtime
|
|
7
|
+
* adapter instantiates it onto the appropriate backend (here, a `PIXI.Sprite` on
|
|
8
|
+
* the world2d surface). A 1x1 white texture is used when `texture` is omitted, so a
|
|
9
|
+
* tinted rectangle sprite needs no asset.
|
|
10
|
+
*/
|
|
11
|
+
export const SpriteSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
texture: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Texture asset URL (loaded via PIXI.Assets). Omit for a tintable 1x1 white texture'),
|
|
17
|
+
frame: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Spritesheet frame/sub-texture name when `texture` is a spritesheet atlas'),
|
|
21
|
+
anchor: Vec2Schema.optional().describe('Normalized anchor [x, y] (0..1). Default [0.5, 0.5]'),
|
|
22
|
+
tint: z
|
|
23
|
+
.string()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Tint color as hex string (e.g. '#ff8800'). Default white"),
|
|
26
|
+
alpha: z.number().min(0).max(1).optional().describe('Opacity 0..1. Default 1'),
|
|
27
|
+
width: z
|
|
28
|
+
.number()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('Explicit display width in pixels (overrides texture size)'),
|
|
31
|
+
height: z
|
|
32
|
+
.number()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Explicit display height in pixels (overrides texture size)'),
|
|
35
|
+
blendMode: z
|
|
36
|
+
.enum(['normal', 'add', 'multiply', 'screen'])
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('PixiJS blend mode. Default normal'),
|
|
39
|
+
interactive: z
|
|
40
|
+
.boolean()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Enable federated pointer events (eventMode=static) so this sprite can be picked'),
|
|
43
|
+
filter: z
|
|
44
|
+
.enum(['none', 'blur', 'desaturate'])
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Apply a PixiJS filter (BlurFilter / ColorMatrix desaturate). Default none'),
|
|
47
|
+
animationFrames: z
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('If set, build an AnimatedSprite cycling N generated tinted frames'),
|
|
52
|
+
fps: z.number().optional().describe('AnimatedSprite playback speed in frames/sec. Default 8'),
|
|
53
|
+
})
|
|
54
|
+
.describe('2D sprite appearance (world2d). Instantiated as a PIXI.Sprite or AnimatedSprite');
|
|
55
|
+
/** `text` authored section — a world-space PIXI.Text label (world-space UI). */
|
|
56
|
+
export const Text2DSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
text: z.string().describe('The string to display'),
|
|
59
|
+
fontSize: z.number().optional().describe('Font size in pixels. Default 24'),
|
|
60
|
+
fill: z.string().optional().describe("Text color as hex string. Default '#ffffff'"),
|
|
61
|
+
anchor: Vec2Schema.optional().describe('Normalized anchor [x, y] (0..1). Default [0.5, 0.5]'),
|
|
62
|
+
})
|
|
63
|
+
.describe('2D world-space text label (world2d). Instantiated as a PIXI.Text');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* `tilemap` authored section — engine-owned 2D tilemap data (NOT a CompositeTilemap),
|
|
4
|
+
* instantiated to a `@pixi/tilemap` CompositeTilemap by the 2D spawn path. Asset-light:
|
|
5
|
+
* a `palette` of hex colors generates one tile texture each, and `tiles` is a row-major
|
|
6
|
+
* grid of palette indices. A real tileset texture/Tiled `.tmj` import is the natural
|
|
7
|
+
* extension (per the spec's optional Tiled note).
|
|
8
|
+
*/
|
|
9
|
+
export declare const TilemapSchema: z.ZodObject<{
|
|
10
|
+
tileSize: z.ZodNumber;
|
|
11
|
+
palette: z.ZodArray<z.ZodString>;
|
|
12
|
+
tiles: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type SceneTilemap = z.infer<typeof TilemapSchema>;
|
|
15
|
+
//# sourceMappingURL=tilemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tilemap.d.ts","sourceRoot":"","sources":["../../../src/world2d/schema/tilemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;iBAU2D,CAAC;AAEtF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* `tilemap` authored section — engine-owned 2D tilemap data (NOT a CompositeTilemap),
|
|
4
|
+
* instantiated to a `@pixi/tilemap` CompositeTilemap by the 2D spawn path. Asset-light:
|
|
5
|
+
* a `palette` of hex colors generates one tile texture each, and `tiles` is a row-major
|
|
6
|
+
* grid of palette indices. A real tileset texture/Tiled `.tmj` import is the natural
|
|
7
|
+
* extension (per the spec's optional Tiled note).
|
|
8
|
+
*/
|
|
9
|
+
export const TilemapSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
tileSize: z.number().describe('Tile width/height in pixels'),
|
|
12
|
+
palette: z
|
|
13
|
+
.array(z.string())
|
|
14
|
+
.describe('Hex colors; one generated tile texture per entry (index → color)'),
|
|
15
|
+
tiles: z
|
|
16
|
+
.array(z.array(z.number().int()))
|
|
17
|
+
.describe('Row-major grid of palette indices (each row is an array of tile indices)'),
|
|
18
|
+
})
|
|
19
|
+
.describe('2D tilemap (world2d). Instantiated as a @pixi/tilemap CompositeTilemap');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** 2D vector as [x, y]. The world2d analog of the 3D Vec3. */
|
|
3
|
+
export declare const Vec2Schema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
4
|
+
export type Vec2 = z.infer<typeof Vec2Schema>;
|
|
5
|
+
/**
|
|
6
|
+
* 2D local transform — the world2d analog of the 3D TransformSchema.
|
|
7
|
+
*
|
|
8
|
+
* Orientation is a single scalar `rotation` (radians, about the screen Z axis),
|
|
9
|
+
* NOT a quaternion: PixiJS display objects rotate in the plane. The runtime/editor
|
|
10
|
+
* neutral `Transform` tuple (position[3]/quaternion[4]/scale[3]) maps onto this as
|
|
11
|
+
* z = 0 and rotation about Z (see PIXI-WORLD2D-MAXIMAL-SPEC model-transform2d-section).
|
|
12
|
+
*/
|
|
13
|
+
export declare const Transform2DSchema: z.ZodObject<{
|
|
14
|
+
position: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
15
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
scale: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
17
|
+
pivot: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type SceneTransform2D = z.infer<typeof Transform2DSchema>;
|
|
20
|
+
//# sourceMappingURL=tuples2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuples2d.d.ts","sourceRoot":"","sources":["../../../src/world2d/schema/tuples2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8DAA8D;AAC9D,eAAO,MAAM,UAAU,8CAAoE,CAAC;AAE5F,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;iBAOwC,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** 2D vector as [x, y]. The world2d analog of the 3D Vec3. */
|
|
3
|
+
export const Vec2Schema = z.tuple([z.number(), z.number()]).describe('2D vector as [x, y]');
|
|
4
|
+
/**
|
|
5
|
+
* 2D local transform — the world2d analog of the 3D TransformSchema.
|
|
6
|
+
*
|
|
7
|
+
* Orientation is a single scalar `rotation` (radians, about the screen Z axis),
|
|
8
|
+
* NOT a quaternion: PixiJS display objects rotate in the plane. The runtime/editor
|
|
9
|
+
* neutral `Transform` tuple (position[3]/quaternion[4]/scale[3]) maps onto this as
|
|
10
|
+
* z = 0 and rotation about Z (see PIXI-WORLD2D-MAXIMAL-SPEC model-transform2d-section).
|
|
11
|
+
*/
|
|
12
|
+
export const Transform2DSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
position: Vec2Schema.optional().describe('Local position [x, y] in world2d pixels'),
|
|
15
|
+
rotation: z.number().optional().describe('Rotation in radians about the Z axis. Default 0'),
|
|
16
|
+
scale: Vec2Schema.optional().describe('Scale per axis [x, y]. Default [1, 1]'),
|
|
17
|
+
pivot: Vec2Schema.optional().describe('Local pivot point [x, y] (center of rotation/scale)'),
|
|
18
|
+
})
|
|
19
|
+
.describe('2D local transform relative to parent (world2d surface)');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Container } from 'pixi.js';
|
|
2
|
+
import type { Physics2DRegistry } from './physics2d-registry';
|
|
3
|
+
/**
|
|
4
|
+
* PhysicsAdapter2D — the world2d analog of the 3D PhysicsAdapter (rapier-physics-adapter).
|
|
5
|
+
* Lets the editor coordinate editing of a Rapier-2D-driven entity WITHOUT owning the
|
|
6
|
+
* simulation: report transform ownership, then freeze → commit → unfreeze so a drag
|
|
7
|
+
* sticks instead of being stomped by the next physics step.
|
|
8
|
+
*/
|
|
9
|
+
export interface PhysicsAdapter2D {
|
|
10
|
+
ownerOf(display: Container): 'physics' | 'none';
|
|
11
|
+
freeze(display: Container): void;
|
|
12
|
+
commit(display: Container, position: [number, number], rotation: number): void;
|
|
13
|
+
unfreeze(display: Container): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createPhysicsAdapter2D(physics: Physics2DRegistry): PhysicsAdapter2D;
|
|
16
|
+
//# sourceMappingURL=system-adapters-2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-adapters-2d.d.ts","sourceRoot":"","sources":["../../src/world2d/system-adapters-2d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,MAAM,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/E,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAgCnF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function createPhysicsAdapter2D(physics) {
|
|
2
|
+
// Remember each frozen body's prior type so unfreeze restores it.
|
|
3
|
+
const frozen = new WeakMap();
|
|
4
|
+
return {
|
|
5
|
+
ownerOf(display) {
|
|
6
|
+
const refs = physics.get(display);
|
|
7
|
+
if (!refs)
|
|
8
|
+
return 'none';
|
|
9
|
+
return refs.body.isDynamic() || refs.body.isKinematic() ? 'physics' : 'none';
|
|
10
|
+
},
|
|
11
|
+
freeze(display) {
|
|
12
|
+
const refs = physics.get(display);
|
|
13
|
+
if (!refs)
|
|
14
|
+
return;
|
|
15
|
+
frozen.set(display, refs.body.bodyType());
|
|
16
|
+
// Kinematic-position bodies hold a pose without being driven by forces.
|
|
17
|
+
refs.body.setBodyType(2 /* KinematicPositionBased */, true);
|
|
18
|
+
},
|
|
19
|
+
commit(display, position, rotation) {
|
|
20
|
+
const refs = physics.get(display);
|
|
21
|
+
if (!refs)
|
|
22
|
+
return;
|
|
23
|
+
refs.body.setTranslation({ x: position[0], y: position[1] }, true);
|
|
24
|
+
refs.body.setRotation(rotation, true);
|
|
25
|
+
},
|
|
26
|
+
unfreeze(display) {
|
|
27
|
+
const refs = physics.get(display);
|
|
28
|
+
if (!refs)
|
|
29
|
+
return;
|
|
30
|
+
const prior = frozen.get(display);
|
|
31
|
+
if (prior !== undefined) {
|
|
32
|
+
refs.body.setBodyType(prior, true);
|
|
33
|
+
frozen.delete(display);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Physics2DRegistry } from './physics2d-registry';
|
|
2
|
+
/**
|
|
3
|
+
* Build the single postPhysics transform writer for world2d — the ~5-line 2D
|
|
4
|
+
* analog of `createTransformWriter`.
|
|
5
|
+
*
|
|
6
|
+
* Rapier 2D reports `translation()` as `{x, y}` and `rotation()` as a SCALAR angle
|
|
7
|
+
* (radians), so the writeback is simply `display.position.set(x, y)` +
|
|
8
|
+
* `display.rotation = angle`. Scale is left untouched (Rapier carries no scale).
|
|
9
|
+
*
|
|
10
|
+
* Bodies are simulated in world2d pixel space directly (the surface uses a
|
|
11
|
+
* y-down, pixel-unit world), so no unit conversion is needed; parented entities
|
|
12
|
+
* are kept flat under the world container by the loader, mirroring the 3D writer's
|
|
13
|
+
* scene-root fast path.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createTransformWriter2D(physics: Physics2DRegistry): () => void;
|
|
16
|
+
//# sourceMappingURL=transform-writer-2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-writer-2d.d.ts","sourceRoot":"","sources":["../../src/world2d/transform-writer-2d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,SAC3B,IAAI,CAO1C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the single postPhysics transform writer for world2d — the ~5-line 2D
|
|
3
|
+
* analog of `createTransformWriter`.
|
|
4
|
+
*
|
|
5
|
+
* Rapier 2D reports `translation()` as `{x, y}` and `rotation()` as a SCALAR angle
|
|
6
|
+
* (radians), so the writeback is simply `display.position.set(x, y)` +
|
|
7
|
+
* `display.rotation = angle`. Scale is left untouched (Rapier carries no scale).
|
|
8
|
+
*
|
|
9
|
+
* Bodies are simulated in world2d pixel space directly (the surface uses a
|
|
10
|
+
* y-down, pixel-unit world), so no unit conversion is needed; parented entities
|
|
11
|
+
* are kept flat under the world container by the loader, mirroring the 3D writer's
|
|
12
|
+
* scene-root fast path.
|
|
13
|
+
*/
|
|
14
|
+
export function createTransformWriter2D(physics) {
|
|
15
|
+
return function writeTransforms2D() {
|
|
16
|
+
for (const [display, { body }] of physics.entries()) {
|
|
17
|
+
const t = body.translation();
|
|
18
|
+
display.position.set(t.x, t.y);
|
|
19
|
+
display.rotation = body.rotation();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type RAPIER from '@dimforge/rapier2d-compat';
|
|
2
|
+
import type { Application, Container } from 'pixi.js';
|
|
3
|
+
import type { z } from 'zod';
|
|
4
|
+
import type { createSystemRunner } from '../core/system-runner';
|
|
5
|
+
import type { SystemPhaseName } from '../core/types';
|
|
6
|
+
import type { ComponentManager } from '../ecs/component-manager';
|
|
7
|
+
import type { GameComponent } from '../ecs/game-component';
|
|
8
|
+
import type { Collision2DSystem } from './collision-2d';
|
|
9
|
+
import type { Physics2DRegistry } from './physics2d-registry';
|
|
10
|
+
/**
|
|
11
|
+
* All world2d subsystems, passed to every world2d `setup(ctx)` and to each
|
|
12
|
+
* `GameComponent<'pixijs'>` lifecycle method — the 2D analog of `GameContext`.
|
|
13
|
+
*
|
|
14
|
+
* Raw libraries (call directly, no wrappers): `app` / `stage` (PixiJS),
|
|
15
|
+
* `rapier2dWorld` / `rapier2d` (Rapier 2D). Engine handles bridge them into the
|
|
16
|
+
* SAME phase-ordered loop the 3D path uses (`systems` is the very same
|
|
17
|
+
* `createSystemRunner`, and `PHASE_ORDER` is shared).
|
|
18
|
+
*/
|
|
19
|
+
export interface World2DContext {
|
|
20
|
+
/** The PixiJS application. Its renderer draws `stage`; auto-ticker is disabled. */
|
|
21
|
+
app: Application;
|
|
22
|
+
/** The world2d scene-graph root (the camera/world container under app.stage). */
|
|
23
|
+
stage: Container;
|
|
24
|
+
/** The Rapier 2D physics `World`. One shared world per world2d scene. */
|
|
25
|
+
rapier2dWorld: RAPIER.World;
|
|
26
|
+
/** The Rapier 2D module namespace (RigidBodyDesc, ColliderDesc, Vector2, …). */
|
|
27
|
+
rapier2d: typeof RAPIER;
|
|
28
|
+
/** `Container ↔ Rapier2D body/collider` registry (+ collider→entity reverse index). */
|
|
29
|
+
physics2d: Physics2DRegistry;
|
|
30
|
+
/** Rapier 2D collision/trigger event dispatcher; drained each postPhysics. */
|
|
31
|
+
collisions2d: Collision2DSystem;
|
|
32
|
+
/** Manager for all live GameComponent instances in this pixi world — the
|
|
33
|
+
* unified `ComponentManager` (`ecs/component-manager.ts`, constructed with
|
|
34
|
+
* `{ kind: 'pixijs' }`). The world2d-silo-only manager this replaced
|
|
35
|
+
* (T7.3) is deleted; every 2D component attaches here, exactly like a
|
|
36
|
+
* threejs component attaches onto its world's manager. */
|
|
37
|
+
components: ComponentManager;
|
|
38
|
+
/** The phase-ordered system runner (shared with the 3D path). */
|
|
39
|
+
systems: ReturnType<typeof createSystemRunner>;
|
|
40
|
+
/** DOM overlay for screen-space React/HUD UI (pointer-events:none by default). */
|
|
41
|
+
uiContainer: HTMLDivElement;
|
|
42
|
+
}
|
|
43
|
+
/** Constructor type for `GameComponent<'pixijs'>` subclasses used in a world2d
|
|
44
|
+
* registry (carries static phase/schema) — the 2D-registry analog of
|
|
45
|
+
* `GameComponentClass` (`ecs/game-component.ts`), narrowed to the pixijs kind
|
|
46
|
+
* so `new Cls()` returns a properly-typed `GameComponent<'pixijs'>` without a cast. */
|
|
47
|
+
export type Pixi2DComponentClass = (new () => GameComponent<'pixijs'>) & {
|
|
48
|
+
phase?: SystemPhaseName;
|
|
49
|
+
schema?: z.ZodObject<z.ZodRawShape>;
|
|
50
|
+
};
|
|
51
|
+
/** Component registry for world2d — a plain name→class map (the 2D analog). */
|
|
52
|
+
export type Component2DRegistry = Record<string, Pixi2DComponentClass>;
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/world2d/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,GAAG,EAAE,WAAW,CAAC;IACjB,iFAAiF;IACjF,KAAK,EAAE,SAAS,CAAC;IACjB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC;IAC5B,gFAAgF;IAChF,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,uFAAuF;IACvF,SAAS,EAAE,iBAAiB,CAAC;IAC7B,8EAA8E;IAC9E,YAAY,EAAE,iBAAiB,CAAC;IAChC;;;;+DAI2D;IAC3D,UAAU,EAAE,gBAAgB,CAAC;IAC7B,iEAAiE;IACjE,OAAO,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC/C,kFAAkF;IAClF,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED;;;wFAGwF;AACxF,MAAM,MAAM,oBAAoB,GAAG,CAAC,UAAU,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG;IACvE,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;CACrC,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@vgai/engine",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"description": "The vgai game engine — core loop, GameComponent model, physics, scene loader, adapter seam.",
|
|
8
8
|
"homepage": "https://github.com/volter-ai/vgai-engine#readme",
|
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
"./package.json": "./package.json",
|
|
20
20
|
"./*": "./src/*"
|
|
21
21
|
},
|
|
22
|
-
"files": [
|
|
22
|
+
"files": [
|
|
23
|
+
"src",
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.0.0"
|
|
28
|
+
},
|
|
23
29
|
"scripts": {
|
|
24
30
|
"build": "tsc -p tsconfig.build.json"
|
|
25
31
|
},
|
|
@@ -34,8 +40,12 @@
|
|
|
34
40
|
"postprocessing": "^6.38.0",
|
|
35
41
|
"realism-effects": "^1.1.2",
|
|
36
42
|
"recast-navigation": "^0.43.0",
|
|
43
|
+
"@theatre/core": "0.7.2",
|
|
44
|
+
"gsap": "^3.12.0",
|
|
37
45
|
"three": "^0.170.0",
|
|
38
46
|
"three.quarks": "^0.16.0",
|
|
47
|
+
"tone": "^15.1.22",
|
|
48
|
+
"xstate": "^5.32.4",
|
|
39
49
|
"zod": "^4.3.6"
|
|
40
50
|
},
|
|
41
51
|
"peerDependencies": {
|
|
@@ -43,8 +53,12 @@
|
|
|
43
53
|
"react-dom": ">=18"
|
|
44
54
|
},
|
|
45
55
|
"peerDependenciesMeta": {
|
|
46
|
-
"react": {
|
|
47
|
-
|
|
56
|
+
"react": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"react-dom": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
48
62
|
},
|
|
49
63
|
"devDependencies": {
|
|
50
64
|
"@types/react": "^19.2.14",
|
package/src/adapter/authoring.ts
CHANGED
|
@@ -277,6 +277,16 @@ export interface ComponentsProvider {
|
|
|
277
277
|
list(nodeId: string): { type: string }[];
|
|
278
278
|
add(nodeId: string, type: string): void;
|
|
279
279
|
remove(nodeId: string, type: string): void;
|
|
280
|
+
/**
|
|
281
|
+
* OPTIONAL read accessor (W3.1, docs/DATA-TOOLS-DESIGN.md §3.3): the raw
|
|
282
|
+
* authored config record for one attached component (`list()` names the
|
|
283
|
+
* types; this reads one type's per-entity data), or `null` when the entity
|
|
284
|
+
* or component doesn't exist. Returns a shallow copy — callers must write
|
|
285
|
+
* through `InspectorProvider.set('components.<Type>.<field>', v)`, never by
|
|
286
|
+
* mutating this. Absent ⇒ config is not readable through this provider
|
|
287
|
+
* (tools degrade to `config: null`).
|
|
288
|
+
*/
|
|
289
|
+
config?(nodeId: string, type: string): Record<string, unknown> | null;
|
|
280
290
|
}
|
|
281
291
|
|
|
282
292
|
/** Asset drop (hierarchy + viewport). */
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* First-party implementations of the remaining `SystemAdapters` — input, assets,
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
+
* engine subsystem (the original vision named these as first-class System
|
|
5
5
|
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
6
|
-
* interfaces; these wrap `InputManager`, the asset loader, `
|
|
7
|
-
*
|
|
6
|
+
* interfaces; these wrap `InputManager`, the asset loader, and `NavMeshManager`
|
|
7
|
+
* so an external game could supply its own equivalents. (The former
|
|
8
|
+
* `AnimationAdapter`/`createAnimationAdapter` over the `AnimGraph` map was
|
|
9
|
+
* removed by E5 — AnimGraph no longer exists; see
|
|
10
|
+
* docs/AI-NATIVE-AUTHORING-IMPLEMENTATION-SPEC.md §3.3/§11 E5.)
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
import type * as THREE from 'three';
|
|
11
14
|
import type { NavMeshManager } from '../ai/navigation';
|
|
12
|
-
import type { AnimGraph } from '../animation/anim-graph';
|
|
13
15
|
import type { InputManager } from '../input/input-manager';
|
|
14
16
|
import { resolveUrl } from '../loader';
|
|
15
17
|
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
16
18
|
import type {
|
|
17
|
-
|
|
19
|
+
ActionValueSnapshot,
|
|
18
20
|
AssetAdapter,
|
|
19
21
|
AudioAdapter,
|
|
20
22
|
InputAdapter,
|
|
@@ -22,13 +24,25 @@ import type {
|
|
|
22
24
|
NavPoint,
|
|
23
25
|
} from './system-adapter';
|
|
24
26
|
|
|
25
|
-
/** First-party `InputAdapter` over the engine `InputManager`.
|
|
27
|
+
/** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
|
|
28
|
+
* `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
|
|
29
|
+
* (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
|
|
30
|
+
* surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
|
|
31
|
+
* `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
|
|
26
32
|
export function createInputManagerAdapter(input: InputManager): InputAdapter {
|
|
27
33
|
return {
|
|
28
34
|
poll: () => input.poll(),
|
|
29
35
|
actions: () => {
|
|
30
|
-
const out: Record<string,
|
|
31
|
-
for (const name of input.actionNames())
|
|
36
|
+
const out: Record<string, ActionValueSnapshot> = {};
|
|
37
|
+
for (const name of input.actionNames()) {
|
|
38
|
+
const type = input.getActionValueType(name);
|
|
39
|
+
// `readAction`'s return type is inferred from a literal `expectedType`; with `type`
|
|
40
|
+
// widened to `ActionValueType` here it collapses to `boolean | number | Vector2`, so
|
|
41
|
+
// digital's `boolean` is normalized to the adapter's 1/0 the same way the old digital-
|
|
42
|
+
// only adapter did — every other value type already reads as `number | Vector2`.
|
|
43
|
+
const raw = input.readAction(name, type);
|
|
44
|
+
out[name] = { type, value: typeof raw === 'boolean' ? (raw ? 1 : 0) : raw };
|
|
45
|
+
}
|
|
32
46
|
return out;
|
|
33
47
|
},
|
|
34
48
|
};
|
|
@@ -41,31 +55,6 @@ export function createVgaiAssetAdapter(): AssetAdapter {
|
|
|
41
55
|
return { resolve: (url) => resolveUrl(url) };
|
|
42
56
|
}
|
|
43
57
|
|
|
44
|
-
/** First-party `AnimationAdapter` over the runtime's `AnimGraph` map. */
|
|
45
|
-
export function createAnimationAdapter(
|
|
46
|
-
animGraphs: Map<THREE.Object3D, AnimGraph>,
|
|
47
|
-
): AnimationAdapter {
|
|
48
|
-
const paramsOf = (g: AnimGraph): Record<string, number | boolean> => {
|
|
49
|
-
const out: Record<string, number | boolean> = {};
|
|
50
|
-
for (const name of g.parameterNames()) {
|
|
51
|
-
const v = g.getParameter(name);
|
|
52
|
-
if (v !== undefined) out[name] = v;
|
|
53
|
-
}
|
|
54
|
-
return out;
|
|
55
|
-
};
|
|
56
|
-
return {
|
|
57
|
-
graphs: () =>
|
|
58
|
-
[...animGraphs.entries()].map(([object, g]) => ({
|
|
59
|
-
object,
|
|
60
|
-
state: g.getCurrentState(),
|
|
61
|
-
parameters: paramsOf(g),
|
|
62
|
-
})),
|
|
63
|
-
state: (o) => animGraphs.get(o)?.getCurrentState() ?? null,
|
|
64
|
-
getParameter: (o, name) => animGraphs.get(o)?.getParameter(name),
|
|
65
|
-
setParameter: (o, name, value) => animGraphs.get(o)?.setParameter(name, value),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
58
|
/**
|
|
70
59
|
* First-party `AudioAdapter` over the engine's master-gain bus
|
|
71
60
|
* (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
|
package/src/adapter/index.ts
CHANGED
|
@@ -41,7 +41,6 @@ export {
|
|
|
41
41
|
createColyseusNetworkingAdapter,
|
|
42
42
|
} from './colyseus-networking-adapter';
|
|
43
43
|
export {
|
|
44
|
-
createAnimationAdapter,
|
|
45
44
|
createInputManagerAdapter,
|
|
46
45
|
createNavigationAdapter,
|
|
47
46
|
createVgaiAssetAdapter,
|
|
@@ -60,8 +59,7 @@ export type {
|
|
|
60
59
|
export type { HostContext, HostSurface, LoopHandle, SystemRegistry } from './host-context';
|
|
61
60
|
export { createRapierPhysicsAdapter } from './rapier-physics-adapter';
|
|
62
61
|
export type {
|
|
63
|
-
|
|
64
|
-
AnimationGraphInfo,
|
|
62
|
+
ActionValueSnapshot,
|
|
65
63
|
AssetAdapter,
|
|
66
64
|
ConnectionState,
|
|
67
65
|
InputAdapter,
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type * as THREE from 'three';
|
|
15
|
+
import type { ActionValueType, Vector2 } from '../input/input-types';
|
|
15
16
|
import type { Transform, TransformOwner } from './transform';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -75,10 +76,22 @@ export interface NetworkingAdapter {
|
|
|
75
76
|
subscribe(cb: () => void): Unsubscribe;
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
/** One action's current value, tagged with its declared shape (F1 `ActionValueType`) so a
|
|
80
|
+
* consumer (editor input inspector, conformance suite) can render/assert on the real typed
|
|
81
|
+
* value instead of a lossy digital coercion. `value` is a `number` for `'digital'`
|
|
82
|
+
* (1 = pressed, 0 = not) and `'scalar'`, or a `Vector2` for `'vector2'`/`'pointerDelta'`/
|
|
83
|
+
* `'pointerPosition'` — narrow on `type` to know which. */
|
|
84
|
+
export interface ActionValueSnapshot {
|
|
85
|
+
type: ActionValueType;
|
|
86
|
+
value: number | Vector2;
|
|
87
|
+
}
|
|
88
|
+
|
|
78
89
|
export interface InputAdapter {
|
|
79
90
|
poll(): void;
|
|
80
|
-
/**
|
|
81
|
-
|
|
91
|
+
/** Every named action's current value, faithfully typed per its declared `ActionValueType`
|
|
92
|
+
* (F1, spec §12) — digital reads as 1/0, scalar as its float, vector2/pointerDelta/
|
|
93
|
+
* pointerPosition as `{x,y}`. Never coerces a non-digital action down to 0/1. */
|
|
94
|
+
actions(): Readonly<Record<string, ActionValueSnapshot>>;
|
|
82
95
|
}
|
|
83
96
|
|
|
84
97
|
/** URL remap so an ingested game's relative asset paths resolve under the host. */
|
|
@@ -86,25 +99,6 @@ export interface AssetAdapter {
|
|
|
86
99
|
resolve(url: string): string;
|
|
87
100
|
}
|
|
88
101
|
|
|
89
|
-
/** A snapshot of one object's animation graph (state + parameter values). */
|
|
90
|
-
export interface AnimationGraphInfo {
|
|
91
|
-
object: THREE.Object3D;
|
|
92
|
-
state: string;
|
|
93
|
-
parameters: Record<string, number | boolean>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Inspect + drive a game's animation graphs (state machines / blend params). The
|
|
98
|
-
* editor uses this to list animated objects, read their current state, and scrub
|
|
99
|
-
* parameters — without owning the animation system.
|
|
100
|
-
*/
|
|
101
|
-
export interface AnimationAdapter {
|
|
102
|
-
graphs(): AnimationGraphInfo[];
|
|
103
|
-
state(o: THREE.Object3D): string | null;
|
|
104
|
-
getParameter(o: THREE.Object3D, name: string): number | boolean | undefined;
|
|
105
|
-
setParameter(o: THREE.Object3D, name: string, value: number | boolean): void;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
102
|
export interface NavPoint {
|
|
109
103
|
x: number;
|
|
110
104
|
y: number;
|
|
@@ -148,7 +142,6 @@ export interface SystemAdapters {
|
|
|
148
142
|
networking?: NetworkingAdapter;
|
|
149
143
|
input?: InputAdapter;
|
|
150
144
|
assets?: AssetAdapter;
|
|
151
|
-
animation?: AnimationAdapter;
|
|
152
145
|
navigation?: NavigationAdapter;
|
|
153
146
|
audio?: AudioAdapter;
|
|
154
147
|
}
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
import RAPIER from '@dimforge/rapier3d-compat';
|
|
16
16
|
import type { EffectComposer } from 'postprocessing';
|
|
17
17
|
import * as THREE from 'three';
|
|
18
|
-
import type { AnimGraph } from '../animation/anim-graph';
|
|
19
|
-
import { animationSystem } from '../animation/anim-system';
|
|
20
18
|
import { createSystemRunner } from '../core/system-runner';
|
|
21
19
|
import { createDebugDraw } from '../dev/debug-draw';
|
|
22
20
|
import { createComponentManager } from '../ecs/component-manager';
|
|
@@ -57,7 +55,6 @@ import {
|
|
|
57
55
|
createSceneView,
|
|
58
56
|
} from '../setup/setup-renderer';
|
|
59
57
|
import {
|
|
60
|
-
createAnimationAdapter,
|
|
61
58
|
createAudioSystemAdapter,
|
|
62
59
|
createInputManagerAdapter,
|
|
63
60
|
createNavigationAdapter,
|
|
@@ -240,10 +237,9 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
240
237
|
// --- UI container (host-provided) ---
|
|
241
238
|
const uiContainer = host.ui as HTMLDivElement;
|
|
242
239
|
|
|
243
|
-
// --- Debug draw / assets
|
|
240
|
+
// --- Debug draw / assets ---
|
|
244
241
|
const debugDraw = createDebugDraw(scene);
|
|
245
242
|
const assets = host.assets;
|
|
246
|
-
const animGraphs = new Map<THREE.Object3D, AnimGraph>();
|
|
247
243
|
|
|
248
244
|
// --- System runner (engine-level systems) ---
|
|
249
245
|
const systems = createSystemRunner();
|
|
@@ -253,7 +249,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
253
249
|
collisions.drain();
|
|
254
250
|
writeTransforms();
|
|
255
251
|
});
|
|
256
|
-
systems.add('animation', (dt) => animationSystem(animGraphs, dt));
|
|
257
252
|
systems.add('preRender', (dt) => {
|
|
258
253
|
particles.batchedRenderer.update(dt);
|
|
259
254
|
tickCustomMaterials(scene, dt);
|
|
@@ -309,7 +304,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
309
304
|
audio,
|
|
310
305
|
particles,
|
|
311
306
|
debugDraw,
|
|
312
|
-
animGraphs,
|
|
313
307
|
assets,
|
|
314
308
|
systems,
|
|
315
309
|
components: null!,
|
|
@@ -372,7 +366,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
372
366
|
systemAdapters.physics = createRapierPhysicsAdapter(physicsRegistry, physics.debugMesh);
|
|
373
367
|
systemAdapters.input = createInputManagerAdapter(input);
|
|
374
368
|
systemAdapters.assets = createVgaiAssetAdapter();
|
|
375
|
-
systemAdapters.animation = createAnimationAdapter(animGraphs);
|
|
376
369
|
// D10/T7.6: the audio seam `Game.play.pause()` silences on pause. Works
|
|
377
370
|
// against the headless stand-in too (`headlessAudio()`'s plain
|
|
378
371
|
// `masterGain.gain` object) — this world's `pause()` mutes it harmlessly.
|
|
@@ -510,7 +503,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
510
503
|
rapier: ctx.rapier,
|
|
511
504
|
physics: ctx.physics,
|
|
512
505
|
audioListener: ctx.audio.listener,
|
|
513
|
-
animGraphs: ctx.animGraphs,
|
|
514
506
|
...(componentRegistry ? { componentRegistry } : {}),
|
|
515
507
|
componentManager: ctx.components,
|
|
516
508
|
particleRenderer: ctx.particles.batchedRenderer,
|
|
@@ -532,7 +524,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
532
524
|
rapier: ctx.rapier,
|
|
533
525
|
physics: ctx.physics,
|
|
534
526
|
audioListener: ctx.audio.listener,
|
|
535
|
-
animGraphs: ctx.animGraphs,
|
|
536
527
|
...(componentRegistry ? { componentRegistry } : {}),
|
|
537
528
|
componentManager: ctx.components,
|
|
538
529
|
particleRenderer: ctx.particles.batchedRenderer,
|
|
@@ -663,7 +654,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
663
654
|
});
|
|
664
655
|
safeStep('clearAssetCaches', () => clearAssetCaches());
|
|
665
656
|
safeStep('debugDraw.clear', () => debugDraw.clear());
|
|
666
|
-
safeStep('animGraphs.clear', () => animGraphs.clear());
|
|
667
657
|
safeStep('sceneUIHandle.dispose', () => {
|
|
668
658
|
sceneUIHandle?.dispose();
|
|
669
659
|
sceneUIHandle = null;
|
|
@@ -764,7 +754,6 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
764
754
|
scene.environment = null;
|
|
765
755
|
});
|
|
766
756
|
safeStep('debugDraw.clear', () => debugDraw.clear());
|
|
767
|
-
safeStep('animGraphs.clear', () => animGraphs.clear());
|
|
768
757
|
safeStep('sceneUIHandle.dispose', () => {
|
|
769
758
|
sceneUIHandle?.dispose();
|
|
770
759
|
sceneUIHandle = null;
|
|
@@ -813,8 +802,10 @@ export class VgaiSceneGameAdapter implements GameAdapter {
|
|
|
813
802
|
postFrame();
|
|
814
803
|
},
|
|
815
804
|
resize: (w: number, h: number) => {
|
|
816
|
-
|
|
817
|
-
|
|
805
|
+
const safeWidth = Math.max(1, w);
|
|
806
|
+
const safeHeight = Math.max(1, h);
|
|
807
|
+
composer.setSize(safeWidth, safeHeight);
|
|
808
|
+
camera.aspect = safeWidth / safeHeight;
|
|
818
809
|
camera.updateProjectionMatrix();
|
|
819
810
|
},
|
|
820
811
|
dispose: disposeGame,
|