@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
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@ The vgai game engine: the game loop and phase scheduler, the
|
|
|
4
4
|
`GameComponent` model (the world node *is* the entity — no ECS, no mirror
|
|
5
5
|
tree), Rapier physics integration, the `.vscn.json` scene loader with its
|
|
6
6
|
Zod schemas (the single source of truth for the scene format), animation
|
|
7
|
-
(
|
|
7
|
+
(native `THREE.AnimationMixer` actions bound to XState state machines via
|
|
8
|
+
`bindXStateAnimation` — see `src/animation/xstate-animation-binding.ts`),
|
|
9
|
+
audio, input, the adapter seam
|
|
8
10
|
(`src/adapter/` — how the editor hosts non-native and unmodified games),
|
|
9
11
|
and the world2d PixiJS stack.
|
|
10
12
|
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthoringAdapter — the editor's authoring contract. The editor talks to THIS,
|
|
3
|
+
* keyed by opaque string node ids, instead of to a concrete document format.
|
|
4
|
+
*
|
|
5
|
+
* `.vscn` / `SceneEntity` is the private model of ONE implementer
|
|
6
|
+
* (`VgaiSceneAuthoringAdapter`); an ingested game's adapter implements the same
|
|
7
|
+
* providers directly over its live `Object3D` tree. The editor sees only the
|
|
8
|
+
* interface and the advertised `capabilities` — it never branches on which
|
|
9
|
+
* implementer it is talking to.
|
|
10
|
+
*
|
|
11
|
+
* The interface lives in the engine (not the editor) so `MountedGame.authoring`
|
|
12
|
+
* can reference it without the engine depending on the editor; implementers live
|
|
13
|
+
* in `packages/editor/src/authoring/`.
|
|
14
|
+
*
|
|
15
|
+
* **Reserved inspector paths convention:** the property paths `name`, `visible`,
|
|
16
|
+
* and `locked` are reserved — an adapter that supports them exposes them through
|
|
17
|
+
* the ordinary `InspectorProvider.get`/`set` (no separate provider). The shell
|
|
18
|
+
* renders the hierarchy panel's rename field, eye (visibility) toggle, and lock
|
|
19
|
+
* toggle against these three paths, generically, for any adapter that reports
|
|
20
|
+
* them via `InspectorProvider.properties`.
|
|
21
|
+
*/
|
|
22
|
+
import type * as THREE from 'three';
|
|
23
|
+
import type { SceneEntity } from '../scene/scene-types';
|
|
24
|
+
import type { Transform, TransformOwner } from './transform';
|
|
25
|
+
/** Booleans the editor UI gates affordances on (hide what an adapter can't do). */
|
|
26
|
+
export interface AuthoringCapabilities {
|
|
27
|
+
transform: boolean;
|
|
28
|
+
material: boolean;
|
|
29
|
+
inspectorFields: boolean;
|
|
30
|
+
create: boolean;
|
|
31
|
+
delete: boolean;
|
|
32
|
+
reparent: boolean;
|
|
33
|
+
persist: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* UI layout authoring (anchors/offsets/pivot/flex) — distinct from 3D
|
|
36
|
+
* `transform`. Optional so existing 3D adapters need not declare it. A UI
|
|
37
|
+
* adapter sets this true and implements {@link LayoutProvider}; the 3D gizmo /
|
|
38
|
+
* TransformProvider are NOT the UI manipulation path (spec K7).
|
|
39
|
+
*/
|
|
40
|
+
layout?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** A node in the authoring hierarchy — format-neutral (not a `SceneEntity`). */
|
|
43
|
+
export interface EditorNode {
|
|
44
|
+
/** STABLE id — survives reload (see ingest structural-path ids). */
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
kind: 'mesh' | 'light' | 'camera' | 'group' | 'object' | (string & {});
|
|
48
|
+
parentId: string | null;
|
|
49
|
+
childIds: string[];
|
|
50
|
+
flags: {
|
|
51
|
+
runtimeOnly?: boolean;
|
|
52
|
+
locked?: boolean;
|
|
53
|
+
transformOwner?: TransformOwner;
|
|
54
|
+
/** D8 — member of a RootGroup, not the active one; children may be unloaded. */
|
|
55
|
+
inactiveRoot?: boolean;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface PropertyDescriptor {
|
|
59
|
+
path: string;
|
|
60
|
+
label: string;
|
|
61
|
+
type: 'string' | 'number' | 'boolean' | 'vec3' | 'color' | 'enum' | 'asset' | 'json';
|
|
62
|
+
readonly?: boolean;
|
|
63
|
+
options?: unknown[];
|
|
64
|
+
/**
|
|
65
|
+
* Optional domain-shaped grouping (T3.4 slice 2, docs/ADAPTER-AUTHORING-
|
|
66
|
+
* DESIGN.md §1.E): properties sharing the same `group` label render
|
|
67
|
+
* together under a titled sub-section in the generic inspector, instead of
|
|
68
|
+
* the flat property grid. Backward-compatible — omitted (or two
|
|
69
|
+
* descriptors with different/no `group`) renders exactly as before this
|
|
70
|
+
* field existed. This is the ONLY authoring-richness addition v1 makes;
|
|
71
|
+
* there is no schema and no new PropertyDescriptor `type` — a custom
|
|
72
|
+
* adapter reports its own domain concepts (health/score/an enum, …) through
|
|
73
|
+
* the SAME provider, merely labeled into a named group.
|
|
74
|
+
*/
|
|
75
|
+
group?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface HierarchyProvider {
|
|
78
|
+
roots(): EditorNode[];
|
|
79
|
+
node(id: string): EditorNode | null;
|
|
80
|
+
/** The live object for raycast/gizmo binding (null for non-object nodes). */
|
|
81
|
+
object3D(id: string): THREE.Object3D | null;
|
|
82
|
+
idForObject3D(o: THREE.Object3D): string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface SelectionProvider {
|
|
85
|
+
get(): string[];
|
|
86
|
+
set(ids: string[]): void;
|
|
87
|
+
}
|
|
88
|
+
export interface TransformProvider {
|
|
89
|
+
get(id: string): Transform;
|
|
90
|
+
owner(id: string): TransformOwner;
|
|
91
|
+
/** Pause whatever controller fights the gizmo (physics/script) for editing. */
|
|
92
|
+
beginEdit(id: string): void;
|
|
93
|
+
apply(id: string, t: Transform): void;
|
|
94
|
+
endEdit(id: string): void;
|
|
95
|
+
}
|
|
96
|
+
export interface InspectorProvider {
|
|
97
|
+
/** Schema-driven — NOT fixed to `SceneEntity`. */
|
|
98
|
+
properties(id: string): PropertyDescriptor[];
|
|
99
|
+
get(id: string, path: string): unknown;
|
|
100
|
+
set(id: string, path: string, value: unknown): void;
|
|
101
|
+
/**
|
|
102
|
+
* Optional — REMOVE a property's authored override entirely (not "set to a
|
|
103
|
+
* value"), letting whatever governs it in its absence take over. The one
|
|
104
|
+
* concrete need today: a longhand CSS override (`style.borderTopLeftRadius`)
|
|
105
|
+
* that a uniform edit of its shorthand (`style.borderRadius`) must clear so
|
|
106
|
+
* the shorthand actually wins, instead of leaving a stale longhand that
|
|
107
|
+
* silently overrides it on reload (spec 27 §5 C2, U2). Adapters with no
|
|
108
|
+
* removable-override concept simply omit it — callers optional-chain.
|
|
109
|
+
*/
|
|
110
|
+
remove?(id: string, path: string): void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* UI layout authoring (K7) — anchors/offsets/pivot/flex props on a UI node. This
|
|
114
|
+
* is the manipulation path for the DOM-overlay UI editor (handles, anchor presets,
|
|
115
|
+
* flex inspector) and is deliberately SEPARATE from {@link TransformProvider}
|
|
116
|
+
* (which is 3D position/quaternion/scale and cannot express flex/anchor layout).
|
|
117
|
+
* The layout shape is format-neutral (a plain object the UI adapter understands).
|
|
118
|
+
*/
|
|
119
|
+
export interface LayoutProvider {
|
|
120
|
+
/** The node's current layout object (anchors/offsets/pivot/flex), or null. */
|
|
121
|
+
get(id: string): Record<string, unknown> | null;
|
|
122
|
+
/** Pause whatever drives layout (animation) before a gesture, if needed. */
|
|
123
|
+
beginEdit(id: string): void;
|
|
124
|
+
/** Apply a (partial) layout patch — merged onto the node's layout. */
|
|
125
|
+
apply(id: string, layoutPatch: Record<string, unknown>): void;
|
|
126
|
+
/** Commit the gesture (one undo step). */
|
|
127
|
+
endEdit(id: string): void;
|
|
128
|
+
}
|
|
129
|
+
export interface StructureProvider {
|
|
130
|
+
create(kind: string, parentId?: string): string;
|
|
131
|
+
/**
|
|
132
|
+
* Remove `id`. May optionally return an awaitable (`Promise<void>`) when the
|
|
133
|
+
* underlying write is asynchronous (e.g. a react-world source-file edit) —
|
|
134
|
+
* `deleteSelection` (`editor-hotkeys.ts`) awaits it per id so a same-file
|
|
135
|
+
* multi-delete's writes land strictly one at a time (see that function's own
|
|
136
|
+
* doc comment for why serialization + deletion order together are what make
|
|
137
|
+
* a per-id loop sound for an adapter whose OID index isn't reindexed between
|
|
138
|
+
* writes). An adapter with a synchronous/in-memory remove (e.g.
|
|
139
|
+
* `UIAuthoringAdapter`) returns `void` — `await`ing it is a harmless no-op.
|
|
140
|
+
*/
|
|
141
|
+
remove(id: string): void | Promise<void>;
|
|
142
|
+
duplicate(id: string): string;
|
|
143
|
+
reparent(id: string, newParentId: string | null): void;
|
|
144
|
+
/** Reorder `id` to sit immediately before `beforeSiblingId` among its siblings
|
|
145
|
+
* (`null` = move to the end). Absent ⇒ the shell has no sibling-reorder UI
|
|
146
|
+
* for this adapter. */
|
|
147
|
+
reorder?(id: string, beforeSiblingId: string | null): void;
|
|
148
|
+
/**
|
|
149
|
+
* The kinds `create` accepts for a given parent (`null` parentId = a new
|
|
150
|
+
* root), each with a display label — drives the shell's creation palette.
|
|
151
|
+
* Absent ⇒ the palette shows nothing for this adapter, even though `create`
|
|
152
|
+
* itself may still work when called directly (e.g. programmatically, or by
|
|
153
|
+
* an adapter-specific affordance outside the generic palette).
|
|
154
|
+
*/
|
|
155
|
+
creatableKinds?(parentId: string | null): {
|
|
156
|
+
kind: string;
|
|
157
|
+
label: string;
|
|
158
|
+
}[];
|
|
159
|
+
/** D3 (spec 27 §6) — wrap `id` in a new container element (default tag
|
|
160
|
+
* adapter-chosen, e.g. a `div`), re-parenting `id` as that container's sole
|
|
161
|
+
* child. Absent ⇒ the shell's context menu shows no Wrap item for this
|
|
162
|
+
* adapter. */
|
|
163
|
+
wrap?(id: string, wrapperTag?: string): void;
|
|
164
|
+
/** D3 (spec 27 §6) — replace `id` with its own children (the inverse of
|
|
165
|
+
* `wrap`). Absent ⇒ the shell's context menu shows no Unwrap item for this
|
|
166
|
+
* adapter. */
|
|
167
|
+
unwrap?(id: string): void;
|
|
168
|
+
/**
|
|
169
|
+
* D4.R2 (spec27 §6 D4 reopen) — remove every id in `ids` as ONE undoable
|
|
170
|
+
* op (a single Ctrl+Z restores the whole batch), instead of the caller
|
|
171
|
+
* looping `remove(id)` per id (which — one `remove` call = one undo push
|
|
172
|
+
* per adapter, by design — produces N separate undo entries: Ctrl+Z then
|
|
173
|
+
* restores them one at a time, asymmetric with the first-party adapter's
|
|
174
|
+
* own single batched multi-delete undo). Absent ⇒ the shell falls back to
|
|
175
|
+
* the per-id `remove` loop (today's N-entry behavior, unchanged) — an
|
|
176
|
+
* honest degrade, not a silent behavior change, for any adapter that
|
|
177
|
+
* hasn't implemented batching. May optionally return an awaitable
|
|
178
|
+
* (`Promise<void>`), same widening `remove` documents above and for the
|
|
179
|
+
* same reason (delete-order-residual fix): `deleteSelection`
|
|
180
|
+
* (`editor-hotkeys.ts`) awaits it so the caller can rely on the whole
|
|
181
|
+
* batch's write having landed before it returns. A synchronous/in-memory
|
|
182
|
+
* implementation (e.g. `UIAuthoringAdapter`'s) returns `void` — awaiting it
|
|
183
|
+
* is a harmless no-op.
|
|
184
|
+
*/
|
|
185
|
+
removeMany?(ids: readonly string[]): void | Promise<void>;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* PersistenceProvider — whether and where an adapter's edits persist (design:
|
|
189
|
+
* `docs/PERSISTENCE-PROVIDER-DESIGN.md` §2). The ACTIVE adapter's provider is the
|
|
190
|
+
* ONE place this is decided — the host (editor) never hard-codes a destination or
|
|
191
|
+
* guards on session flags; it asks the provider.
|
|
192
|
+
*/
|
|
193
|
+
export interface PersistenceProvider {
|
|
194
|
+
isDirty(): boolean;
|
|
195
|
+
/** Save to the adapter's OWN source of truth (.vscn / overlay file / …). */
|
|
196
|
+
save(): Promise<void>;
|
|
197
|
+
serialize(): unknown;
|
|
198
|
+
/** Migration aid (first-party direction): pull a subtree into `.vscn` entities. */
|
|
199
|
+
captureToVscn?(ids: string[]): SceneEntity[];
|
|
200
|
+
/**
|
|
201
|
+
* Human/agent-readable destination this provider persists to — e.g.
|
|
202
|
+
* `"scenes/main.vscn.json"`, `".vgai/overlays/fps.json"`, or `"ephemeral
|
|
203
|
+
* (discarded on stop)"`. Drives the save-status UI and makes routing
|
|
204
|
+
* inspectable (design §2). Implementers whose destination can change during
|
|
205
|
+
* the session (e.g. the first-party provider tracks the loaded `.vscn` path)
|
|
206
|
+
* should expose this as a live getter rather than a value captured once.
|
|
207
|
+
*/
|
|
208
|
+
readonly destination: string;
|
|
209
|
+
/**
|
|
210
|
+
* The reload contract (design §5): apply an external change to this
|
|
211
|
+
* provider's persisted artifact into the RUNNING session (e.g. a file-watcher
|
|
212
|
+
* update to the `.vscn` or the overlay). Absent ⇒ the host must remount to
|
|
213
|
+
* pick up external changes (the honest floor). Implemented (T3.2 slice 3) by
|
|
214
|
+
* the first-party provider (`applyExternalUpdate`) and the ingest overlay
|
|
215
|
+
* provider (`applyOverlay`); absent (correctly) on the ephemeral provider.
|
|
216
|
+
*
|
|
217
|
+
* `rawContent`, when the host has it (the file-watcher SSE payload carries the
|
|
218
|
+
* artifact's exact bytes), is an OPTIONAL second parameter enabling own-echo
|
|
219
|
+
* detection — an event that is exactly what this provider itself last wrote is
|
|
220
|
+
* its own save reflected back, and should be skipped even outside the normal
|
|
221
|
+
* debounce window (see `EditorStore.applyExternalUpdate`'s doc comment). This
|
|
222
|
+
* stays optional/provider-specific — only the first-party provider currently
|
|
223
|
+
* uses it — so other implementers can ignore the parameter entirely.
|
|
224
|
+
*/
|
|
225
|
+
applyExternal?(content: unknown, rawContent?: string): void;
|
|
226
|
+
}
|
|
227
|
+
/** D8 — mutually-exclusive root groups (radio roots): e.g. a "Scenes" group whose
|
|
228
|
+
* members are the game's scene roots, only one of which is loaded/active at a
|
|
229
|
+
* time (unlike ordinary sibling roots, which all coexist). */
|
|
230
|
+
export interface RootGroup {
|
|
231
|
+
id: string;
|
|
232
|
+
label: string;
|
|
233
|
+
memberRootIds: string[];
|
|
234
|
+
activeRootId: string | null;
|
|
235
|
+
}
|
|
236
|
+
export interface RootGroupsProvider {
|
|
237
|
+
groups(): RootGroup[];
|
|
238
|
+
activate(groupId: string, rootId: string): Promise<void> | void;
|
|
239
|
+
}
|
|
240
|
+
/** D8 — data-file → root mapping ("opening a file" = activating its root). */
|
|
241
|
+
export interface FileMapProvider {
|
|
242
|
+
/** project-relative path → node id this adapter maps it to, else null. */
|
|
243
|
+
rootForFile(path: string): string | null;
|
|
244
|
+
}
|
|
245
|
+
/** D12 — per-layer viewport picking. Coordinates are client (browser) px. */
|
|
246
|
+
export interface PickProvider {
|
|
247
|
+
pick(clientX: number, clientY: number): string | null;
|
|
248
|
+
}
|
|
249
|
+
/** D4 — storybook stories. */
|
|
250
|
+
export interface StoryRef {
|
|
251
|
+
id: string;
|
|
252
|
+
label: string;
|
|
253
|
+
}
|
|
254
|
+
export interface StoriesProvider {
|
|
255
|
+
storiesFor(nodeId: string): StoryRef[];
|
|
256
|
+
active(nodeId: string): string | null;
|
|
257
|
+
apply(nodeId: string, storyId: string | null): void;
|
|
258
|
+
/** Render ONLY this node against the story (storybook canvas); null exits. */
|
|
259
|
+
isolate?(nodeId: string | null, storyId?: string): void;
|
|
260
|
+
}
|
|
261
|
+
/** D6 (S-C) — GameComponent management; config editing stays on InspectorProvider. */
|
|
262
|
+
export interface ComponentsProvider {
|
|
263
|
+
available(nodeId: string): string[];
|
|
264
|
+
list(nodeId: string): {
|
|
265
|
+
type: string;
|
|
266
|
+
}[];
|
|
267
|
+
add(nodeId: string, type: string): void;
|
|
268
|
+
remove(nodeId: string, type: string): void;
|
|
269
|
+
/**
|
|
270
|
+
* OPTIONAL read accessor (W3.1, docs/DATA-TOOLS-DESIGN.md §3.3): the raw
|
|
271
|
+
* authored config record for one attached component (`list()` names the
|
|
272
|
+
* types; this reads one type's per-entity data), or `null` when the entity
|
|
273
|
+
* or component doesn't exist. Returns a shallow copy — callers must write
|
|
274
|
+
* through `InspectorProvider.set('components.<Type>.<field>', v)`, never by
|
|
275
|
+
* mutating this. Absent ⇒ config is not readable through this provider
|
|
276
|
+
* (tools degrade to `config: null`).
|
|
277
|
+
*/
|
|
278
|
+
config?(nodeId: string, type: string): Record<string, unknown> | null;
|
|
279
|
+
}
|
|
280
|
+
/** Asset drop (hierarchy + viewport). */
|
|
281
|
+
export interface AssetDropProvider {
|
|
282
|
+
accepts(nodeId: string, assetPath: string): boolean;
|
|
283
|
+
drop(nodeId: string, assetPath: string): void;
|
|
284
|
+
}
|
|
285
|
+
/** Plain-object rect shape shared by {@link RectProvider} — the same fields a real
|
|
286
|
+
* `DOMRect` carries (a subset, so a real `DOMRect` satisfies this structurally too).
|
|
287
|
+
* See {@link RectProvider} for the coordinate space (host-relative, not viewport). */
|
|
288
|
+
export interface DOMRectLike {
|
|
289
|
+
x: number;
|
|
290
|
+
y: number;
|
|
291
|
+
width: number;
|
|
292
|
+
height: number;
|
|
293
|
+
}
|
|
294
|
+
/** Per-node screen geometry — the KEYSTONE omission today (nothing produces rects the
|
|
295
|
+
* ported inspect.ts math consumes). Coordinates are **host-relative** px: relative to
|
|
296
|
+
* the adapter's own mounted world surface (its `position:absolute; inset:0` layer), the
|
|
297
|
+
* same surface the A3 selection overlay is hosted over, so the overlay can draw against
|
|
298
|
+
* these rects directly. (NOT viewport-client — the JSDoc formerly said so in error.) */
|
|
299
|
+
export interface RectProvider {
|
|
300
|
+
/** selectable node id → its current bounding rect, or null if unmounted/offscreen */
|
|
301
|
+
rect(id: string): {
|
|
302
|
+
x: number;
|
|
303
|
+
y: number;
|
|
304
|
+
width: number;
|
|
305
|
+
height: number;
|
|
306
|
+
} | null;
|
|
307
|
+
/** rects of layout-relevant neighbours, for snap/measure/box-model overlays */
|
|
308
|
+
contextRects?(id: string): {
|
|
309
|
+
parent?: DOMRectLike;
|
|
310
|
+
siblings?: DOMRectLike[];
|
|
311
|
+
paddingBox?: DOMRectLike;
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* D3 (spec 27 §6) — every currently-empty container this adapter's tree
|
|
315
|
+
* contains right now: no visible children, no text, a collapsed dimension
|
|
316
|
+
* (the `ui-source/inspect.ts:findEmptyContainers` math) — each with a
|
|
317
|
+
* grown-to-tappable placeholder rect and a display name, driving the
|
|
318
|
+
* overlay's dashed empty-container hint. Host-relative, same coordinate
|
|
319
|
+
* space as {@link rect}. Absent ⇒ this adapter has no "empty container"
|
|
320
|
+
* concept (e.g. an adapter with no structural containers at all) — no
|
|
321
|
+
* hints are drawn for it.
|
|
322
|
+
*/
|
|
323
|
+
emptyContainers?(): {
|
|
324
|
+
id: string;
|
|
325
|
+
rect: DOMRectLike;
|
|
326
|
+
displayName: string;
|
|
327
|
+
}[];
|
|
328
|
+
}
|
|
329
|
+
/** Spatial gesture → source/data write, for non-Object3D (DOM) nodes. Distinct from the
|
|
330
|
+
* 3D TransformProvider. begin/apply/end bracket a single undo step; apply is live-preview. */
|
|
331
|
+
export interface BoxEditProvider {
|
|
332
|
+
begin(id: string): void;
|
|
333
|
+
/** patch: any of x,y,width,height,marginTop… paddingLeft… — px deltas or absolutes */
|
|
334
|
+
apply(id: string, patch: Record<string, number>): void;
|
|
335
|
+
end(id: string): void;
|
|
336
|
+
}
|
|
337
|
+
/** Text-content editing — currently OFF-contract (the react adapter has an `editText(id)`
|
|
338
|
+
* method, react-world-authoring-adapter.ts:728, not reachable via the contract). Bring it
|
|
339
|
+
* on so the overlay's double-click-to-edit-text (D3) is contract-driven. */
|
|
340
|
+
export interface TextProvider {
|
|
341
|
+
/** the element's editable pure-text, or null if the body is dynamic/has child elements */
|
|
342
|
+
get(id: string): string | null;
|
|
343
|
+
set(id: string, text: string): void;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* D3 (spec 27 §6) — background-color sampling at a viewport point, for the
|
|
347
|
+
* eyedropper's FALLBACK path (browsers with no native `EyeDropper` API). The
|
|
348
|
+
* native API, where available, samples real rendered pixels itself and needs
|
|
349
|
+
* none of this. Distinct from {@link PickProvider} (which returns a node id,
|
|
350
|
+
* not a color) and from `InspectorProvider.get('style.backgroundColor')`
|
|
351
|
+
* (which NORMALIZES to `#rrggbb` and so loses the "transparent" signal a
|
|
352
|
+
* color CHAIN walk needs — see `ui-source/inspect.ts:effectiveColorFromChain`'s
|
|
353
|
+
* doc comment: it walks raw, un-normalized CSS values looking for the first
|
|
354
|
+
* non-transparent one).
|
|
355
|
+
*/
|
|
356
|
+
export interface ColorSampleProvider {
|
|
357
|
+
/** Raw (un-normalized) CSS `background-color` values, hit-element FIRST,
|
|
358
|
+
* walking up its ancestor chain — the exact shape
|
|
359
|
+
* `effectiveColorFromChain` consumes. `null` when nothing is hit at the
|
|
360
|
+
* point. Client (viewport) px, matching {@link PickProvider}. */
|
|
361
|
+
backgroundChainAt(clientX: number, clientY: number): string[] | null;
|
|
362
|
+
}
|
|
363
|
+
export interface AuthoringAdapter {
|
|
364
|
+
readonly capabilities: AuthoringCapabilities;
|
|
365
|
+
readonly hierarchy: HierarchyProvider;
|
|
366
|
+
readonly selection?: SelectionProvider;
|
|
367
|
+
readonly transforms?: TransformProvider;
|
|
368
|
+
readonly inspector?: InspectorProvider;
|
|
369
|
+
/** UI layout authoring path (K7) — present on UI adapters, absent on 3D adapters. */
|
|
370
|
+
readonly layout?: LayoutProvider;
|
|
371
|
+
readonly structure?: StructureProvider;
|
|
372
|
+
readonly persistence?: PersistenceProvider;
|
|
373
|
+
/** D8 — mutually-exclusive root groups (radio roots). Absent ⇒ no grouped roots. */
|
|
374
|
+
readonly rootGroups?: RootGroupsProvider;
|
|
375
|
+
/** D8 — data-file → root mapping. Absent ⇒ this adapter maps no files to roots. */
|
|
376
|
+
readonly files?: FileMapProvider;
|
|
377
|
+
/** D12 — per-layer viewport picking. Absent ⇒ this adapter is not pickable. */
|
|
378
|
+
readonly pickable?: PickProvider;
|
|
379
|
+
/** T0 (spec 27 §2) — per-node screen geometry for a DOM visual editor's overlay/
|
|
380
|
+
* snap/measure math. Absent ⇒ this adapter produces no rects (no overlay). */
|
|
381
|
+
readonly rects?: RectProvider;
|
|
382
|
+
/** T0 (spec 27 §2) — spatial drag-resize/move → source/data write for non-Object3D
|
|
383
|
+
* (DOM) nodes. Absent ⇒ no box-edit gesture for this adapter. */
|
|
384
|
+
readonly boxEdit?: BoxEditProvider;
|
|
385
|
+
/** T0 (spec 27 §2) — double-click-to-edit-text on the contract (wires the react
|
|
386
|
+
* adapter's existing off-contract `editText`). Absent ⇒ no in-place text edit. */
|
|
387
|
+
readonly text?: TextProvider;
|
|
388
|
+
/** D3 (spec 27 §6) — eyedropper fallback color sampling. Absent ⇒ the
|
|
389
|
+
* canvas eyedropper swatch has no non-native path for this adapter. */
|
|
390
|
+
readonly colorSample?: ColorSampleProvider;
|
|
391
|
+
/** D4 — storybook stories. Absent ⇒ no stories for any node in this adapter. */
|
|
392
|
+
readonly stories?: StoriesProvider;
|
|
393
|
+
/** D6 (S-C) — GameComponent management. Absent ⇒ no component authoring. */
|
|
394
|
+
readonly components?: ComponentsProvider;
|
|
395
|
+
/** Asset drop (hierarchy + viewport). Absent ⇒ this adapter accepts no drops. */
|
|
396
|
+
readonly assetDrop?: AssetDropProvider;
|
|
397
|
+
/** Undo/redo for this adapter's edits (first-party delegates to the store; an
|
|
398
|
+
* ingest adapter keeps its own overlay-backed stack). Absent ⇒ host falls back. */
|
|
399
|
+
undo?(): void;
|
|
400
|
+
redo?(): void;
|
|
401
|
+
/** Change notification → UI refresh. */
|
|
402
|
+
subscribe?(listener: () => void): () => void;
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=authoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../../src/adapter/authoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,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C,IAAI,IAAI,CAAC;IACd,wCAAwC;IACxC,SAAS,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthoringAdapter — the editor's authoring contract. The editor talks to THIS,
|
|
3
|
+
* keyed by opaque string node ids, instead of to a concrete document format.
|
|
4
|
+
*
|
|
5
|
+
* `.vscn` / `SceneEntity` is the private model of ONE implementer
|
|
6
|
+
* (`VgaiSceneAuthoringAdapter`); an ingested game's adapter implements the same
|
|
7
|
+
* providers directly over its live `Object3D` tree. The editor sees only the
|
|
8
|
+
* interface and the advertised `capabilities` — it never branches on which
|
|
9
|
+
* implementer it is talking to.
|
|
10
|
+
*
|
|
11
|
+
* The interface lives in the engine (not the editor) so `MountedGame.authoring`
|
|
12
|
+
* can reference it without the engine depending on the editor; implementers live
|
|
13
|
+
* in `packages/editor/src/authoring/`.
|
|
14
|
+
*
|
|
15
|
+
* **Reserved inspector paths convention:** the property paths `name`, `visible`,
|
|
16
|
+
* and `locked` are reserved — an adapter that supports them exposes them through
|
|
17
|
+
* the ordinary `InspectorProvider.get`/`set` (no separate provider). The shell
|
|
18
|
+
* renders the hierarchy panel's rename field, eye (visibility) toggle, and lock
|
|
19
|
+
* toggle against these three paths, generically, for any adapter that reports
|
|
20
|
+
* them via `InspectorProvider.properties`.
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
|
|
3
|
+
* INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
|
|
4
|
+
* "is this object replicated, who owns it, may I edit it" — and, for the network
|
|
5
|
+
* inspector panel, "am I connected, to which room, how much replication activity
|
|
6
|
+
* is happening" — without owning Colyseus.
|
|
7
|
+
*
|
|
8
|
+
* It is parameterized by accessors over the room state (rather than a fixed schema)
|
|
9
|
+
* so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
|
|
10
|
+
* report the local session and peers, and report connection/room/stats for the
|
|
11
|
+
* inspector. The editor uses `authority`/`editable` to keep remote/server-
|
|
12
|
+
* authoritative objects inspect-only (editing a replicated transform locally is
|
|
13
|
+
* meaningless — the server overwrites it next snapshot).
|
|
14
|
+
*/
|
|
15
|
+
import type * as THREE from 'three';
|
|
16
|
+
import type { ConnectionState, NetPeer, NetworkingAdapter, ReplicationStats, RoomInfo, Unsubscribe } from './system-adapter';
|
|
17
|
+
export interface ColyseusNetworkingConfig {
|
|
18
|
+
/** The local peer's session id (objects it owns are editable). */
|
|
19
|
+
localSessionId(): string | null;
|
|
20
|
+
/** Peers currently in the room. */
|
|
21
|
+
peers(): NetPeer[];
|
|
22
|
+
/** Network id for an object, or null if it is not replicated (→ local authored). */
|
|
23
|
+
networkId(o: THREE.Object3D): string | null;
|
|
24
|
+
/** Owning peer/session id for a replicated object (null = server-owned). */
|
|
25
|
+
ownerId(o: THREE.Object3D): string | null;
|
|
26
|
+
/** True if the server is authoritative over this object (→ inspect-only). */
|
|
27
|
+
serverAuthoritative?(o: THREE.Object3D): boolean;
|
|
28
|
+
/** Current connection lifecycle state, for the network inspector panel.
|
|
29
|
+
* Optional — defaults to `'disconnected'` for implementers that only need
|
|
30
|
+
* object authority/editability (the pre-inspector config shape). */
|
|
31
|
+
connectionState?(): ConnectionState;
|
|
32
|
+
/** The active room's identity, or `null` when not connected to a room.
|
|
33
|
+
* Optional — defaults to `null`. */
|
|
34
|
+
roomInfo?(): RoomInfo | null;
|
|
35
|
+
/** Replication activity snapshot (entity count + msg rates), for the inspector.
|
|
36
|
+
* Optional — defaults to all-zero stats. */
|
|
37
|
+
replicationStats?(): ReplicationStats;
|
|
38
|
+
/** Subscribe to changes in connection state / room / replication stats.
|
|
39
|
+
* Optional — defaults to a no-op subscription. */
|
|
40
|
+
subscribe?(cb: () => void): Unsubscribe;
|
|
41
|
+
}
|
|
42
|
+
export declare function createColyseusNetworkingAdapter(cfg: ColyseusNetworkingConfig): NetworkingAdapter;
|
|
43
|
+
//# sourceMappingURL=colyseus-networking-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colyseus-networking-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/colyseus-networking-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,cAAc,IAAI,MAAM,GAAG,IAAI,CAAC;IAChC,mCAAmC;IACnC,KAAK,IAAI,OAAO,EAAE,CAAC;IACnB,oFAAoF;IACpF,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,6EAA6E;IAC7E,mBAAmB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjD;;yEAEqE;IACrE,eAAe,CAAC,IAAI,eAAe,CAAC;IACpC;yCACqC;IACrC,QAAQ,CAAC,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC7B;iDAC6C;IAC7C,gBAAgB,CAAC,IAAI,gBAAgB,CAAC;IACtC;uDACmD;IACnD,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;CACzC;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,wBAAwB,GAAG,iBAAiB,CAoBhG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColyseusNetworkingAdapter — the first-party `NetworkingAdapter`. This is an
|
|
3
|
+
* INTROSPECTION / coordination boundary, NOT a transport: it lets the editor ask
|
|
4
|
+
* "is this object replicated, who owns it, may I edit it" — and, for the network
|
|
5
|
+
* inspector panel, "am I connected, to which room, how much replication activity
|
|
6
|
+
* is happening" — without owning Colyseus.
|
|
7
|
+
*
|
|
8
|
+
* It is parameterized by accessors over the room state (rather than a fixed schema)
|
|
9
|
+
* so any Colyseus room can supply one: map an `Object3D` to its network id + owner,
|
|
10
|
+
* report the local session and peers, and report connection/room/stats for the
|
|
11
|
+
* inspector. The editor uses `authority`/`editable` to keep remote/server-
|
|
12
|
+
* authoritative objects inspect-only (editing a replicated transform locally is
|
|
13
|
+
* meaningless — the server overwrites it next snapshot).
|
|
14
|
+
*/
|
|
15
|
+
export function createColyseusNetworkingAdapter(cfg) {
|
|
16
|
+
return {
|
|
17
|
+
peers: () => cfg.peers(),
|
|
18
|
+
networkId: (o) => cfg.networkId(o),
|
|
19
|
+
authority: (o) => {
|
|
20
|
+
if (cfg.networkId(o) == null)
|
|
21
|
+
return 'local'; // not replicated → local authored
|
|
22
|
+
if (cfg.serverAuthoritative?.(o))
|
|
23
|
+
return 'server';
|
|
24
|
+
return cfg.ownerId(o) === cfg.localSessionId() ? 'local' : 'remote';
|
|
25
|
+
},
|
|
26
|
+
editable: (o) => {
|
|
27
|
+
if (cfg.networkId(o) == null)
|
|
28
|
+
return true; // local authored object
|
|
29
|
+
if (cfg.serverAuthoritative?.(o))
|
|
30
|
+
return false; // server owns it → inspect-only
|
|
31
|
+
return cfg.ownerId(o) === cfg.localSessionId(); // only your own peer's objects
|
|
32
|
+
},
|
|
33
|
+
getConnectionState: () => cfg.connectionState?.() ?? 'disconnected',
|
|
34
|
+
getRoomInfo: () => cfg.roomInfo?.() ?? null,
|
|
35
|
+
getReplicationStats: () => cfg.replicationStats?.() ?? { entities: 0, msgsInPerSec: 0, msgsOutPerSec: 0 },
|
|
36
|
+
subscribe: (cb) => cfg.subscribe?.(cb) ?? (() => { }),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party implementations of the remaining `SystemAdapters` — input, assets,
|
|
3
|
+
* navigation — each a thin coordination/introspection boundary over the real
|
|
4
|
+
* engine subsystem (the original vision named these as first-class System
|
|
5
|
+
* adapters; physics + networking shipped earlier). The editor speaks only the
|
|
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.)
|
|
11
|
+
*/
|
|
12
|
+
import type { NavMeshManager } from '../ai/navigation';
|
|
13
|
+
import type { InputManager } from '../input/input-manager';
|
|
14
|
+
import type { AudioContext as GameAudio } from '../setup/setup-audio';
|
|
15
|
+
import type { AssetAdapter, AudioAdapter, InputAdapter, NavigationAdapter } from './system-adapter';
|
|
16
|
+
/** First-party `InputAdapter` over the engine `InputManager`. Reads each action through
|
|
17
|
+
* `InputManager.readAction`, dispatched on that action's OWN declared `valueType`
|
|
18
|
+
* (`getActionValueType`) — never a hardcoded getter — so a scalar/Vector2/pointer action
|
|
19
|
+
* surfaces its real typed value instead of being coerced through `isPressed` (F1-followup;
|
|
20
|
+
* `readAction` on the wrong type would throw, so dispatch must follow the declared type). */
|
|
21
|
+
export declare function createInputManagerAdapter(input: InputManager): InputAdapter;
|
|
22
|
+
/** First-party `AssetAdapter` — resolves URLs through the engine loader (which
|
|
23
|
+
* applies the project base + downloaded-asset remap). External/ingest games can
|
|
24
|
+
* supply their own to redirect relative paths. */
|
|
25
|
+
export declare function createVgaiAssetAdapter(): AssetAdapter;
|
|
26
|
+
/**
|
|
27
|
+
* First-party `AudioAdapter` over the engine's master-gain bus
|
|
28
|
+
* (`setup-audio.ts`'s `AudioContext.masterGain`) — the seam `Game.play.pause()`
|
|
29
|
+
* (D10, T7.6) calls to silence a first-party world's audio. Restoring after a
|
|
30
|
+
* mute puts the gain back at whatever value it held right before muting (not
|
|
31
|
+
* a hardcoded `1`) — this composes correctly with an independent manual mute
|
|
32
|
+
* (the editor's `MuteButton`, `PlayBar.tsx`): pausing while already
|
|
33
|
+
* user-muted resumes muted, exactly as a user would expect.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createAudioSystemAdapter(audio: GameAudio): AudioAdapter;
|
|
36
|
+
/** First-party `NavigationAdapter` over the engine `NavMeshManager`. */
|
|
37
|
+
export declare function createNavigationAdapter(nav: NavMeshManager): NavigationAdapter;
|
|
38
|
+
//# sourceMappingURL=first-party-systems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-party-systems.d.ts","sourceRoot":"","sources":["../../src/adapter/first-party-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAEV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAE1B;;;;8FAI8F;AAC9F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAiB3E;AAED;;mDAEmD;AACnD,wBAAgB,sBAAsB,IAAI,YAAY,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAgBvE;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,CAM9E"}
|