@vgai/engine 0.5.5 → 0.5.6
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/dist/adapter/adapter-surface.d.ts +30 -0
- package/dist/adapter/adapter-surface.d.ts.map +1 -0
- package/dist/adapter/adapter-surface.js +18 -0
- package/dist/adapter/authoring.d.ts +597 -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 +77 -0
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
- package/dist/adapter/colyseus-networking-adapter.js +76 -0
- package/dist/adapter/first-party-systems.d.ts +23 -0
- package/dist/adapter/first-party-systems.d.ts.map +1 -0
- package/dist/adapter/first-party-systems.js +196 -0
- package/dist/adapter/host-context.d.ts +194 -0
- package/dist/adapter/host-context.d.ts.map +1 -0
- package/dist/adapter/host-context.js +80 -0
- package/dist/adapter/index.d.ts +33 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +25 -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/scene-capture.d.ts +121 -0
- package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
- package/dist/adapter/ingest/scene-capture.js +270 -0
- package/dist/adapter/ingest/structural-ids.d.ts +64 -0
- package/dist/adapter/ingest/structural-ids.d.ts.map +1 -0
- package/dist/adapter/ingest/structural-ids.js +110 -0
- package/dist/adapter/ingest/upstream-pin.d.ts +44 -0
- package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
- package/dist/adapter/ingest/upstream-pin.js +47 -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 +69 -0
- package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
- package/dist/adapter/rapier-physics-adapter.js +135 -0
- package/dist/adapter/root-adapter.d.ts +195 -0
- package/dist/adapter/root-adapter.d.ts.map +1 -0
- package/dist/adapter/root-adapter.js +25 -0
- package/dist/adapter/setup-three-root-adapter.d.ts +87 -0
- package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -0
- package/dist/adapter/setup-three-root-adapter.js +791 -0
- package/dist/adapter/system-adapter.d.ts +453 -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/ai/navigation.d.ts +78 -0
- package/dist/ai/navigation.d.ts.map +1 -0
- package/dist/ai/navigation.js +152 -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 +249 -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 +31 -0
- package/dist/animation/cubic-spline-interpolant.d.ts +54 -0
- package/dist/animation/cubic-spline-interpolant.d.ts.map +1 -0
- package/dist/animation/cubic-spline-interpolant.js +111 -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 +277 -0
- package/dist/animation/theatre-director.d.ts.map +1 -0
- package/dist/animation/theatre-director.js +248 -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 +119 -0
- package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
- package/dist/animation/xstate-animation-binding.js +349 -0
- package/dist/animation/xstate-animation-meta.d.ts +266 -0
- package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
- package/dist/animation/xstate-animation-meta.js +252 -0
- package/dist/asset-formats/camera.d.ts +15 -0
- package/dist/asset-formats/camera.d.ts.map +1 -0
- package/dist/asset-formats/camera.js +15 -0
- package/dist/asset-formats/collider.d.ts +21 -0
- package/dist/asset-formats/collider.d.ts.map +1 -0
- package/dist/asset-formats/collider.js +53 -0
- package/dist/asset-formats/index.d.ts +46 -0
- package/dist/asset-formats/index.d.ts.map +1 -0
- package/dist/asset-formats/index.js +36 -0
- package/dist/asset-formats/instances.d.ts +17 -0
- package/dist/asset-formats/instances.d.ts.map +1 -0
- package/dist/asset-formats/instances.js +31 -0
- package/dist/asset-formats/light.d.ts +21 -0
- package/dist/asset-formats/light.d.ts.map +1 -0
- package/dist/asset-formats/light.js +35 -0
- package/dist/asset-formats/material.d.ts +129 -0
- package/dist/asset-formats/material.d.ts.map +1 -0
- package/dist/asset-formats/material.js +88 -0
- package/dist/asset-formats/mesh.d.ts +22 -0
- package/dist/asset-formats/mesh.d.ts.map +1 -0
- package/dist/asset-formats/mesh.js +64 -0
- package/dist/asset-formats/parse.d.ts +20 -0
- package/dist/asset-formats/parse.d.ts.map +1 -0
- package/dist/asset-formats/parse.js +34 -0
- package/dist/asset-formats/particles.d.ts +1390 -0
- package/dist/asset-formats/particles.d.ts.map +1 -0
- package/dist/asset-formats/particles.js +319 -0
- package/dist/asset-formats/render-env.d.ts +387 -0
- package/dist/asset-formats/render-env.d.ts.map +1 -0
- package/dist/asset-formats/render-env.js +300 -0
- package/dist/asset-formats/tuples.d.ts +12 -0
- package/dist/asset-formats/tuples.d.ts.map +1 -0
- package/dist/asset-formats/tuples.js +14 -0
- package/dist/asset-loaders.d.ts +97 -0
- package/dist/asset-loaders.d.ts.map +1 -0
- package/dist/asset-loaders.js +209 -0
- package/dist/asset-parse-error.d.ts +24 -0
- package/dist/asset-parse-error.d.ts.map +1 -0
- package/dist/asset-parse-error.js +29 -0
- package/dist/asset-registry.d.ts +38 -0
- package/dist/asset-registry.d.ts.map +1 -0
- package/dist/asset-registry.js +66 -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/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/canvas-react/engine-bridge.d.ts +45 -0
- package/dist/canvas-react/engine-bridge.d.ts.map +1 -0
- package/dist/canvas-react/engine-bridge.js +45 -0
- package/dist/canvas-react/index.d.ts +42 -0
- package/dist/canvas-react/index.d.ts.map +1 -0
- package/dist/canvas-react/index.js +41 -0
- package/dist/canvas-react/pixi-primitive.d.ts +85 -0
- package/dist/canvas-react/pixi-primitive.d.ts.map +1 -0
- package/dist/canvas-react/pixi-primitive.js +181 -0
- package/dist/canvas-react/pixi-react-adapter.d.ts +71 -0
- package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -0
- package/dist/canvas-react/pixi-react-adapter.js +229 -0
- package/dist/canvas-react/pixi-react-root-factory.d.ts +56 -0
- package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -0
- package/dist/canvas-react/pixi-react-root-factory.js +73 -0
- package/dist/canvas-react/world-context.d.ts +88 -0
- package/dist/canvas-react/world-context.d.ts.map +1 -0
- package/dist/canvas-react/world-context.js +212 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +8 -0
- package/dist/core/frame-pacing.d.ts +90 -0
- package/dist/core/frame-pacing.d.ts.map +1 -0
- package/dist/core/frame-pacing.js +89 -0
- package/dist/core/game-loop.d.ts +62 -0
- package/dist/core/game-loop.d.ts.map +1 -0
- package/dist/core/game-loop.js +189 -0
- package/dist/core/seeded-random.d.ts +69 -0
- package/dist/core/seeded-random.d.ts.map +1 -0
- package/dist/core/seeded-random.js +121 -0
- package/dist/core/sim-clock.d.ts +199 -0
- package/dist/core/sim-clock.d.ts.map +1 -0
- package/dist/core/sim-clock.js +291 -0
- package/dist/core/system-runner.d.ts +96 -0
- package/dist/core/system-runner.d.ts.map +1 -0
- package/dist/core/system-runner.js +253 -0
- package/dist/core/types.d.ts +111 -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 +109 -0
- package/dist/data/data-check-core.d.ts.map +1 -0
- package/dist/data/data-check-core.js +177 -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/defaults.d.ts +233 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +137 -0
- package/dist/dev/chrome-trace.d.ts +45 -0
- package/dist/dev/chrome-trace.d.ts.map +1 -0
- package/dist/dev/chrome-trace.js +114 -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/instruments.d.ts +133 -0
- package/dist/dev/instruments.d.ts.map +1 -0
- package/dist/dev/instruments.js +231 -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/dev/performance-profiler.d.ts +111 -0
- package/dist/dev/performance-profiler.d.ts.map +1 -0
- package/dist/dev/performance-profiler.js +215 -0
- package/dist/dev/render-debug-adapter.d.ts +57 -0
- package/dist/dev/render-debug-adapter.d.ts.map +1 -0
- package/dist/dev/render-debug-adapter.js +141 -0
- package/dist/dev/render-memory.d.ts +53 -0
- package/dist/dev/render-memory.d.ts.map +1 -0
- package/dist/dev/render-memory.js +190 -0
- package/dist/dev/webgl-frame-capture.d.ts +134 -0
- package/dist/dev/webgl-frame-capture.d.ts.map +1 -0
- package/dist/dev/webgl-frame-capture.js +270 -0
- package/dist/dev/webgl-gpu-timer.d.ts +8 -0
- package/dist/dev/webgl-gpu-timer.d.ts.map +1 -0
- package/dist/dev/webgl-gpu-timer.js +52 -0
- package/dist/ecs/scene-index.d.ts +179 -0
- package/dist/ecs/scene-index.d.ts.map +1 -0
- package/dist/ecs/scene-index.js +331 -0
- package/dist/ecs/scene-query.d.ts +6 -0
- package/dist/ecs/scene-query.d.ts.map +1 -0
- package/dist/ecs/scene-query.js +40 -0
- package/dist/ecs/user-data.d.ts +193 -0
- package/dist/ecs/user-data.d.ts.map +1 -0
- package/dist/ecs/user-data.js +145 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/input/input-manager.d.ts +944 -0
- package/dist/input/input-manager.d.ts.map +1 -0
- package/dist/input/input-manager.js +2209 -0
- package/dist/input/input-types.d.ts +174 -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 +76 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +114 -0
- package/dist/manifest/editor-port.d.ts +53 -0
- package/dist/manifest/editor-port.d.ts.map +1 -0
- package/dist/manifest/editor-port.js +67 -0
- package/dist/manifest/filename.d.ts +14 -0
- package/dist/manifest/filename.d.ts.map +1 -0
- package/dist/manifest/filename.js +43 -0
- package/dist/manifest/index.d.ts +6 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +9 -0
- package/dist/manifest/load-file.d.ts +7 -0
- package/dist/manifest/load-file.d.ts.map +1 -0
- package/dist/manifest/load-file.js +23 -0
- package/dist/manifest/load.d.ts +161 -0
- package/dist/manifest/load.d.ts.map +1 -0
- package/dist/manifest/load.js +269 -0
- package/dist/manifest/locate.d.ts +24 -0
- package/dist/manifest/locate.d.ts.map +1 -0
- package/dist/manifest/locate.js +48 -0
- package/dist/manifest/schema.d.ts +293 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +633 -0
- package/dist/physics/collider-dimensions.d.ts +63 -0
- package/dist/physics/collider-dimensions.d.ts.map +1 -0
- package/dist/physics/collider-dimensions.js +98 -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/pixi/authoring.d.ts +93 -0
- package/dist/pixi/authoring.d.ts.map +1 -0
- package/dist/pixi/authoring.js +207 -0
- package/dist/pixi/index.d.ts +16 -0
- package/dist/pixi/index.d.ts.map +1 -0
- package/dist/pixi/index.js +15 -0
- package/dist/pixi/ingest-iframe.d.ts +82 -0
- package/dist/pixi/ingest-iframe.d.ts.map +1 -0
- package/dist/pixi/ingest-iframe.js +166 -0
- package/dist/pixi/ingest.d.ts +97 -0
- package/dist/pixi/ingest.d.ts.map +1 -0
- package/dist/pixi/ingest.js +40 -0
- package/dist/pixi/physics-registry.d.ts +24 -0
- package/dist/pixi/physics-registry.d.ts.map +1 -0
- package/dist/pixi/physics-registry.js +38 -0
- package/dist/pixi/scene-capture.d.ts +43 -0
- package/dist/pixi/scene-capture.d.ts.map +1 -0
- package/dist/pixi/scene-capture.js +92 -0
- package/dist/pixi/system-adapters.d.ts +16 -0
- package/dist/pixi/system-adapters.d.ts.map +1 -0
- package/dist/pixi/system-adapters.js +37 -0
- package/dist/react/unmanaged-root-detector.d.ts +18 -0
- package/dist/react/unmanaged-root-detector.d.ts.map +1 -0
- package/dist/react/unmanaged-root-detector.js +70 -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 +101 -0
- package/dist/react/use-selection.d.ts +54 -0
- package/dist/react/use-selection.d.ts.map +1 -0
- package/dist/react/use-selection.js +71 -0
- package/dist/react/world-state.d.ts +154 -0
- package/dist/react/world-state.d.ts.map +1 -0
- package/dist/react/world-state.js +220 -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/instance-mesh.d.ts +5 -0
- package/dist/render/instance-mesh.d.ts.map +1 -0
- package/dist/render/instance-mesh.js +19 -0
- package/dist/render/light-camera-factory.d.ts +24 -0
- package/dist/render/light-camera-factory.d.ts.map +1 -0
- package/dist/render/light-camera-factory.js +71 -0
- package/dist/render/lod.d.ts +13 -0
- package/dist/render/lod.d.ts.map +1 -0
- package/dist/render/lod.js +16 -0
- package/dist/render/material-factory.d.ts +15 -0
- package/dist/render/material-factory.d.ts.map +1 -0
- package/dist/render/material-factory.js +186 -0
- package/dist/render/mesh-shadow.d.ts +11 -0
- package/dist/render/mesh-shadow.d.ts.map +1 -0
- package/dist/render/mesh-shadow.js +19 -0
- package/dist/render/particles-factory.d.ts +99 -0
- package/dist/render/particles-factory.d.ts.map +1 -0
- package/dist/render/particles-factory.js +361 -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 +223 -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 +35 -0
- package/dist/render/render-settings.d.ts.map +1 -0
- package/dist/render/render-settings.js +51 -0
- package/dist/render/spark-renderer-lifecycle.d.ts +18 -0
- package/dist/render/spark-renderer-lifecycle.d.ts.map +1 -0
- package/dist/render/spark-renderer-lifecycle.js +57 -0
- package/dist/render/viewport-shading.d.ts +17 -0
- package/dist/render/viewport-shading.d.ts.map +1 -0
- package/dist/render/viewport-shading.js +87 -0
- package/dist/runtime/create-runtime.d.ts +259 -0
- package/dist/runtime/create-runtime.d.ts.map +1 -0
- package/dist/runtime/create-runtime.js +666 -0
- package/dist/runtime/debug-bridge.d.ts +288 -0
- package/dist/runtime/debug-bridge.d.ts.map +1 -0
- package/dist/runtime/debug-bridge.js +277 -0
- package/dist/runtime/debug-registry.d.ts +287 -0
- package/dist/runtime/debug-registry.d.ts.map +1 -0
- package/dist/runtime/debug-registry.js +528 -0
- package/dist/runtime/dev-layers.d.ts +34 -0
- package/dist/runtime/dev-layers.d.ts.map +1 -0
- package/dist/runtime/dev-layers.js +40 -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 +576 -0
- package/dist/runtime/game.d.ts.map +1 -0
- package/dist/runtime/game.js +1003 -0
- package/dist/runtime/gameplay-rng-trap.d.ts +47 -0
- package/dist/runtime/gameplay-rng-trap.d.ts.map +1 -0
- package/dist/runtime/gameplay-rng-trap.js +95 -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 +126 -0
- package/dist/runtime/mount-game.d.ts.map +1 -0
- package/dist/runtime/mount-game.js +159 -0
- package/dist/runtime/mount-manifest.d.ts +174 -0
- package/dist/runtime/mount-manifest.d.ts.map +1 -0
- package/dist/runtime/mount-manifest.js +304 -0
- package/dist/runtime/presentation.d.ts +85 -0
- package/dist/runtime/presentation.d.ts.map +1 -0
- package/dist/runtime/presentation.js +92 -0
- package/dist/runtime/render-audio-control.d.ts +126 -0
- package/dist/runtime/render-audio-control.d.ts.map +1 -0
- package/dist/runtime/render-audio-control.js +116 -0
- package/dist/runtime/render-control.d.ts +347 -0
- package/dist/runtime/render-control.d.ts.map +1 -0
- package/dist/runtime/render-control.js +317 -0
- package/dist/runtime/render-seed.d.ts +56 -0
- package/dist/runtime/render-seed.d.ts.map +1 -0
- package/dist/runtime/render-seed.js +73 -0
- package/dist/runtime/state-bridge.d.ts +60 -0
- package/dist/runtime/state-bridge.d.ts.map +1 -0
- package/dist/runtime/state-bridge.js +62 -0
- package/dist/runtime/types.d.ts +285 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/unexported-game-trap.d.ts +36 -0
- package/dist/runtime/unexported-game-trap.d.ts.map +1 -0
- package/dist/runtime/unexported-game-trap.js +80 -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 +82 -0
- package/dist/setup/setup-renderer.d.ts.map +1 -0
- package/dist/setup/setup-renderer.js +381 -0
- package/dist/world3d-react/engine-bridge.d.ts +47 -0
- package/dist/world3d-react/engine-bridge.d.ts.map +1 -0
- package/dist/world3d-react/engine-bridge.js +48 -0
- package/dist/world3d-react/index.d.ts +47 -0
- package/dist/world3d-react/index.d.ts.map +1 -0
- package/dist/world3d-react/index.js +46 -0
- package/dist/world3d-react/r3f-adapter.d.ts +51 -0
- package/dist/world3d-react/r3f-adapter.d.ts.map +1 -0
- package/dist/world3d-react/r3f-adapter.js +368 -0
- package/dist/world3d-react/r3f-root-factory.d.ts +62 -0
- package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -0
- package/dist/world3d-react/r3f-root-factory.js +79 -0
- package/dist/world3d-react/rapier-physics-bridge.d.ts +76 -0
- package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -0
- package/dist/world3d-react/rapier-physics-bridge.js +120 -0
- package/dist/world3d-react/renderer-config.d.ts +58 -0
- package/dist/world3d-react/renderer-config.d.ts.map +1 -0
- package/dist/world3d-react/renderer-config.js +96 -0
- package/dist/world3d-react/world-context.d.ts +123 -0
- package/dist/world3d-react/world-context.d.ts.map +1 -0
- package/dist/world3d-react/world-context.js +204 -0
- package/dist-config/config.js +303 -0
- package/dist-config/config.js.map +7 -0
- package/package.json +14 -3
- package/src/adapter/rapier-physics-adapter.ts +77 -34
- package/src/config.ts +8 -0
- package/src/core/frame-pacing.ts +26 -0
- package/src/core/game-loop.ts +4 -3
- package/src/dev/instruments.ts +302 -0
- package/src/setup/setup-renderer.ts +2 -0
- package/src/world3d-react/index.ts +9 -0
- package/src/world3d-react/rapier-physics-bridge.tsx +137 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System adapters — optional subsystem capability providers hung off a mounted
|
|
3
|
+
* game (`MountedThreeRoot.systems`). Each is a thin capability boundary the editor can
|
|
4
|
+
* coordinate with WITHOUT owning the implementation. The first-party
|
|
5
|
+
* implementers wrap Rapier / Colyseus / recast; an external game supplies its
|
|
6
|
+
* own or none, and the editor degrades per `capabilities`.
|
|
7
|
+
*
|
|
8
|
+
* These are introspection/coordination boundaries, NOT re-implementations: e.g.
|
|
9
|
+
* `NetworkingAdapter` is not a transport, and `PhysicsAdapter` does not replace
|
|
10
|
+
* Rapier — it lets the editor ask "who owns this object" and "freeze it while I
|
|
11
|
+
* edit it".
|
|
12
|
+
*/
|
|
13
|
+
import type * as THREE from 'three';
|
|
14
|
+
import type { RenderMemorySnapshot } from '../dev/render-memory';
|
|
15
|
+
import type { FrameCapture } from '../dev/webgl-frame-capture';
|
|
16
|
+
import type { Transform, TransformOwner } from './transform';
|
|
17
|
+
/**
|
|
18
|
+
* Physics coordination so the editor can stably edit an object a simulation
|
|
19
|
+
* would otherwise overwrite every frame: `freeze → apply → unfreeze`.
|
|
20
|
+
*
|
|
21
|
+
* Keyed by NODE ID (the `EditorNode` id), not `THREE.Object3D` (P-4). The
|
|
22
|
+
* Object3D keying made this seam structurally unreachable for any non-three
|
|
23
|
+
* world: a Pixi or React world could never expose a physics inspector, because
|
|
24
|
+
* the seam spoke a vocabulary it has no values in — which is why the Pixi
|
|
25
|
+
* surface grew a parallel `PhysicsAdapter2D` (`pixi/system-adapters.ts`)
|
|
26
|
+
* instead of implementing this. Substrate-specific resolution (id → the native
|
|
27
|
+
* object) is the IMPLEMENTER's job, done once at its own boundary.
|
|
28
|
+
*/
|
|
29
|
+
export interface PhysicsAdapter {
|
|
30
|
+
/** Returns `'physics'` when a body drives this node, else another owner. */
|
|
31
|
+
ownerOf(nodeId: string): TransformOwner;
|
|
32
|
+
/** Pause the body driving `nodeId` (kinematic / sleep / detach) for editing. */
|
|
33
|
+
freeze(nodeId: string): void;
|
|
34
|
+
/** Teleport the body to the edited pose (so the sim continues from there). */
|
|
35
|
+
commit(nodeId: string, t: Transform): void;
|
|
36
|
+
/** Resume simulation of `nodeId`. */
|
|
37
|
+
unfreeze(nodeId: string): void;
|
|
38
|
+
/** Optional debug-draw object (collider wireframes). */
|
|
39
|
+
debugDraw?(): THREE.Object3D | null;
|
|
40
|
+
/**
|
|
41
|
+
* Optional: turn the engine's per-frame physics debug rendering on/off —
|
|
42
|
+
* the first-party implementation drives Rapier's `debugRender()` into the
|
|
43
|
+
* `debugDraw()` object inside the game's own render system, so an editor
|
|
44
|
+
* overlay toggle costs the editor zero per-frame work (W2a §2.3c).
|
|
45
|
+
*/
|
|
46
|
+
setDebugDrawEnabled?(enabled: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Optional: live world-space contact points this frame, as xyz triples.
|
|
49
|
+
* Returns a view over a REUSED backing buffer — valid only until the next
|
|
50
|
+
* call (no per-frame allocation churn; callers copy into their own
|
|
51
|
+
* geometry).
|
|
52
|
+
*/
|
|
53
|
+
contactPoints?(): Float32Array;
|
|
54
|
+
}
|
|
55
|
+
export interface NetPeer {
|
|
56
|
+
id: string;
|
|
57
|
+
label?: string;
|
|
58
|
+
}
|
|
59
|
+
/** The project's declared multiplayer server, readable with the game NOT
|
|
60
|
+
* running. `null` from `getServerConfig` means no server is declared. */
|
|
61
|
+
export interface NetServerConfig {
|
|
62
|
+
endpoint: string;
|
|
63
|
+
roomName: string;
|
|
64
|
+
}
|
|
65
|
+
/** The signed-in player's authored identity, used as the connect default. */
|
|
66
|
+
export interface NetPlayerIdentity {
|
|
67
|
+
name?: string;
|
|
68
|
+
id?: string;
|
|
69
|
+
}
|
|
70
|
+
/** The live connection lifecycle, for the editor's network inspector. */
|
|
71
|
+
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
72
|
+
/** Identity of the room the local peer is currently in, or `null` when not connected. */
|
|
73
|
+
export interface RoomInfo {
|
|
74
|
+
roomId: string;
|
|
75
|
+
sessionId: string;
|
|
76
|
+
roomName: string;
|
|
77
|
+
}
|
|
78
|
+
/** Lightweight replication counters for the editor's network inspector. */
|
|
79
|
+
export interface ReplicationStats {
|
|
80
|
+
/** Number of replicated entities currently known (e.g. players + NPCs). */
|
|
81
|
+
entities: number;
|
|
82
|
+
/** Approximate inbound replication activity (state changes observed per second). */
|
|
83
|
+
msgsInPerSec: number;
|
|
84
|
+
/** Approximate outbound message rate (client → server sends per second). */
|
|
85
|
+
msgsOutPerSec: number;
|
|
86
|
+
}
|
|
87
|
+
export type Unsubscribe = () => void;
|
|
88
|
+
/** One captured network message, for the inspector's message log (W3b).
|
|
89
|
+
* `seq` is an adapter-lifetime MONOTONIC counter — the ring-buffer fence a
|
|
90
|
+
* consumer polls with (`messageEvents(sinceSeq)`), mirroring
|
|
91
|
+
* `DebugAdapter.events`' seq discipline. `time` is a `performance.now()`-
|
|
92
|
+
* domain ms timestamp at capture. */
|
|
93
|
+
export interface NetMessageEvent {
|
|
94
|
+
seq: number;
|
|
95
|
+
time: number;
|
|
96
|
+
direction: 'in' | 'out';
|
|
97
|
+
/** Message type/channel (e.g. `'input'`, `'players.add'`, `'state.phase'`). */
|
|
98
|
+
type: string;
|
|
99
|
+
/** Approximate payload size in bytes, when measurable. OMITTED — never
|
|
100
|
+
* fabricated — when the transport doesn't expose it (e.g. Colyseus schema
|
|
101
|
+
* patches observed via the Callbacks API carry no byte count). */
|
|
102
|
+
size?: number;
|
|
103
|
+
/** `true` when the link conditioner (`setConditioning`) dropped this
|
|
104
|
+
* outbound message instead of sending it — logged so the inspector can
|
|
105
|
+
* show the drop honestly rather than silently losing it. */
|
|
106
|
+
dropped?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Send/receive rates for the inspector's sparklines (W3b). The byte fields
|
|
109
|
+
* are OPTIONAL capabilities-within-the-capability: an implementer omits a
|
|
110
|
+
* direction it cannot measure (never reports a fabricated 0). */
|
|
111
|
+
export interface NetRates {
|
|
112
|
+
msgsInPerSec: number;
|
|
113
|
+
msgsOutPerSec: number;
|
|
114
|
+
bytesInPerSec?: number;
|
|
115
|
+
bytesOutPerSec?: number;
|
|
116
|
+
}
|
|
117
|
+
/** Client-side link-conditioning parameters, applied AT THE ADAPTER SEAM
|
|
118
|
+
* (W3b M3) — the implementer wraps its own transport calls (e.g. delaying/
|
|
119
|
+
* dropping around `room.send`); nobody patches transport internals. */
|
|
120
|
+
export interface NetConditioning {
|
|
121
|
+
/** Fixed added delay per outbound message, ms. */
|
|
122
|
+
latencyMs: number;
|
|
123
|
+
/** Uniform random extra delay in `[0, jitterMs)`, ms. */
|
|
124
|
+
jitterMs: number;
|
|
125
|
+
/** Probability in `[0, 1]` that an outbound message is dropped. */
|
|
126
|
+
packetLoss: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* INTROSPECTION over replication state — NOT a networking transport.
|
|
130
|
+
*
|
|
131
|
+
* The optional members are CAPABILITIES in the `SystemAdapters` sense
|
|
132
|
+
* (absence means "not supported" and the editor's Network inspector marks
|
|
133
|
+
* that section absent — it never fabricates data): `getStateSnapshot` feeds
|
|
134
|
+
* the replicated-state tree, `messageEvents` the message log, `getRates` the
|
|
135
|
+
* rate sparklines, and `getConditioning`/`setConditioning` the latency/loss
|
|
136
|
+
* conditioner. The first-party Colyseus factory
|
|
137
|
+
* (`createColyseusNetworkingAdapter`) only attaches each one when its config
|
|
138
|
+
* supplies the accessor, so partial implementers degrade honestly.
|
|
139
|
+
*/
|
|
140
|
+
export interface NetworkingAdapter {
|
|
141
|
+
peers(): NetPeer[];
|
|
142
|
+
/** Keyed by NODE ID, not `THREE.Object3D` — see {@link PhysicsAdapter} (P-4). */
|
|
143
|
+
networkId(nodeId: string): string | null;
|
|
144
|
+
authority(nodeId: string): 'local' | 'remote' | 'server';
|
|
145
|
+
/** Remote/server-authoritative nodes → inspect-only in the editor. */
|
|
146
|
+
editable(nodeId: string): boolean;
|
|
147
|
+
/** Current connection lifecycle state. */
|
|
148
|
+
getConnectionState(): ConnectionState;
|
|
149
|
+
/** The active room's identity, or `null` when not connected to a room. */
|
|
150
|
+
getRoomInfo(): RoomInfo | null;
|
|
151
|
+
/** Replication activity snapshot, for a live network inspector panel. */
|
|
152
|
+
getReplicationStats(): ReplicationStats;
|
|
153
|
+
/** Subscribe to changes in connection state / room / replication stats. */
|
|
154
|
+
subscribe(cb: () => void): Unsubscribe;
|
|
155
|
+
/** Optional capability: one plain-data (JSON-safe) snapshot of the
|
|
156
|
+
* replicated room state, or `null` when not connected. Colyseus schema is
|
|
157
|
+
* self-describing (`state.toJSON()`), so the first-party implementation
|
|
158
|
+
* is one call — the inspector renders whatever tree comes back. */
|
|
159
|
+
getStateSnapshot?(): unknown;
|
|
160
|
+
/** Optional capability: captured message events with `seq > sinceSeq`
|
|
161
|
+
* (whole ring when omitted). Implementations ring-buffer (drop oldest);
|
|
162
|
+
* the inspector keeps its own consumer-side ring and fences on `seq`. */
|
|
163
|
+
messageEvents?(sinceSeq?: number): NetMessageEvent[];
|
|
164
|
+
/** Optional capability: msg + byte rates for the inspector's sparklines. */
|
|
165
|
+
getRates?(): NetRates;
|
|
166
|
+
/** Optional capability (paired with `setConditioning`): current
|
|
167
|
+
* conditioning parameters. */
|
|
168
|
+
getConditioning?(): NetConditioning;
|
|
169
|
+
/** Optional capability: apply link conditioning at the adapter seam. */
|
|
170
|
+
setConditioning?(c: NetConditioning): void;
|
|
171
|
+
/** Optional edit-time capability: the project's declared server, readable
|
|
172
|
+
* with the game NOT running (`null` = no server declared). Hides on
|
|
173
|
+
* absence, like the other optionals. */
|
|
174
|
+
getServerConfig?(): NetServerConfig | null;
|
|
175
|
+
/** Optional capability: the local player's identity, as the GAME defines it
|
|
176
|
+
* (e.g. read off its own room state). The editor consumes this for display —
|
|
177
|
+
* a seat label — ONLY when a real implementer provides it, falling back to a
|
|
178
|
+
* generic label otherwise. */
|
|
179
|
+
getPlayerIdentity?(): NetPlayerIdentity;
|
|
180
|
+
/** Optional capability, PAIRED with {@link getPlayerIdentity}: set the local
|
|
181
|
+
* player's identity through the game's OWN multiplayer mechanism. The editor
|
|
182
|
+
* renders an editable name field ONLY when a real implementer provides this
|
|
183
|
+
* (consume-by-presence, exactly like {@link setConditioning}); its absence
|
|
184
|
+
* means the game does not support an author-settable name and no field shows.
|
|
185
|
+
*
|
|
186
|
+
* This is NOT the editor imposing a name: whether a name is settable, and how
|
|
187
|
+
* it reaches the server, is entirely the game's decision — a game that names
|
|
188
|
+
* players by join order simply never provides this member. When it does, the
|
|
189
|
+
* implementation drives the game's real path (a join option honoured by the
|
|
190
|
+
* server, a rename message, …), so what the editor sets is the same value the
|
|
191
|
+
* multiplayer build actually uses — never a placeholder the server discards. */
|
|
192
|
+
setPlayerIdentity?(identity: NetPlayerIdentity): void | Promise<void>;
|
|
193
|
+
}
|
|
194
|
+
export interface NavPoint {
|
|
195
|
+
x: number;
|
|
196
|
+
y: number;
|
|
197
|
+
z: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Navmesh bake parameters — the recast `rcConfig` vocabulary the scene schema
|
|
201
|
+
* (`SceneNavigationSchema`) also mirrors. All optional; an implementation
|
|
202
|
+
* applies its own defaults. `walkableHeight`/`walkableClimb`/`walkableRadius`
|
|
203
|
+
* are in VOXEL units (multiples of `cellHeight`/`cellSize`), per recast.
|
|
204
|
+
*/
|
|
205
|
+
export interface NavBakeParams {
|
|
206
|
+
cellSize?: number | undefined;
|
|
207
|
+
cellHeight?: number | undefined;
|
|
208
|
+
walkableSlopeAngle?: number | undefined;
|
|
209
|
+
walkableHeight?: number | undefined;
|
|
210
|
+
walkableClimb?: number | undefined;
|
|
211
|
+
walkableRadius?: number | undefined;
|
|
212
|
+
maxEdgeLen?: number | undefined;
|
|
213
|
+
maxSimplificationError?: number | undefined;
|
|
214
|
+
minRegionArea?: number | undefined;
|
|
215
|
+
mergeRegionArea?: number | undefined;
|
|
216
|
+
}
|
|
217
|
+
/** One crowd agent's live state — plain data (no engine/WASM handles), for the
|
|
218
|
+
* editor's play-mode crowd debug draw. */
|
|
219
|
+
export interface NavCrowdAgentState {
|
|
220
|
+
position: NavPoint;
|
|
221
|
+
velocity: NavPoint;
|
|
222
|
+
radius: number;
|
|
223
|
+
height: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Inspect a game's navigation mesh: whether one is built, query a path, and get a
|
|
227
|
+
* debug overlay. Coordination/introspection only — the editor doesn't own the build.
|
|
228
|
+
*
|
|
229
|
+
* The optional members are CAPABILITIES in the `SystemAdapters` sense (absence
|
|
230
|
+
* means "not supported", the editor degrades): `bake`/`exportData` let the
|
|
231
|
+
* editor's Navigation panel (re)build and persist a navmesh through the seam —
|
|
232
|
+
* the first-party recast implementation (`createNavigationAdapter`) is the
|
|
233
|
+
* blessed implementer — while an external game that owns its build simply
|
|
234
|
+
* omits them. `crowdAgents` feeds the play-mode crowd debug draw.
|
|
235
|
+
*/
|
|
236
|
+
export interface NavigationAdapter {
|
|
237
|
+
hasNavMesh(): boolean;
|
|
238
|
+
findPath(start: NavPoint, end: NavPoint): NavPoint[];
|
|
239
|
+
debugMesh(scene: THREE.Scene): THREE.Object3D | null;
|
|
240
|
+
/** (Re)build the navmesh from source meshes. Synchronous in the blessed
|
|
241
|
+
* recast/WASM implementation; returns `false` on a failed bake. */
|
|
242
|
+
bake?(meshes: THREE.Mesh[], params?: NavBakeParams): boolean;
|
|
243
|
+
/** Serialize the current navmesh to a binary blob (the editor persists it
|
|
244
|
+
* as the scene's `.navmesh` sidecar). Throws when nothing is built. */
|
|
245
|
+
exportData?(): Uint8Array;
|
|
246
|
+
/** Live crowd-agent snapshots for debug draw. Empty when no crowd. */
|
|
247
|
+
crowdAgents?(): NavCrowdAgentState[];
|
|
248
|
+
}
|
|
249
|
+
/** One node in an audio-graph snapshot (W3c, the Audio debugger tab). Edges
|
|
250
|
+
* point DOWNSTREAM: `outputs` holds the ids of nodes this node's output
|
|
251
|
+
* feeds (ultimately reaching the `destination` node). */
|
|
252
|
+
export interface AudioGraphNode {
|
|
253
|
+
id: string;
|
|
254
|
+
/** Node class/constructor name (`'GainNode'`, `'Gain'` for a Tone node,
|
|
255
|
+
* `'AudioDestinationNode'`, …) — whatever the implementation truthfully
|
|
256
|
+
* knows, never a prettified fabrication. */
|
|
257
|
+
type: string;
|
|
258
|
+
/** Human-facing label (`'Master'`, `'Music bus'`) when one exists. */
|
|
259
|
+
label?: string;
|
|
260
|
+
/** ids of downstream nodes this node's output connects to. */
|
|
261
|
+
outputs: string[];
|
|
262
|
+
/** Lifecycle/playback state when truthfully known (`'running'`,
|
|
263
|
+
* `'suspended'`, `'started'`…). OMITTED — never fabricated — otherwise. */
|
|
264
|
+
state?: string;
|
|
265
|
+
}
|
|
266
|
+
/** Musical-transport snapshot for the Audio debugger's transport strip
|
|
267
|
+
* (W3c). The first-party implementation reads Tone's real transport. */
|
|
268
|
+
export interface AudioTransportState {
|
|
269
|
+
state: 'started' | 'stopped' | 'paused';
|
|
270
|
+
/** Playback position along the transport's timeline, seconds. */
|
|
271
|
+
seconds: number;
|
|
272
|
+
bpm: number;
|
|
273
|
+
/** Musical position (`Bars:Beats:Sixteenths`) when a musical grid exists. */
|
|
274
|
+
position?: string;
|
|
275
|
+
}
|
|
276
|
+
/** One bus level sample: `level` is linear RMS over the implementation's most
|
|
277
|
+
* recent analysis window (0 = silence; ~1 = full-scale). */
|
|
278
|
+
export interface AudioMeterFrame {
|
|
279
|
+
id: string;
|
|
280
|
+
label: string;
|
|
281
|
+
level: number;
|
|
282
|
+
}
|
|
283
|
+
/** A live metering session. Metering costs real audio nodes (Tone.Meter /
|
|
284
|
+
* AnalyserNode taps), so it is ACQUIRED for exactly as long as a meter UI is
|
|
285
|
+
* visible and MUST be released via `dispose()` — the first-party handle
|
|
286
|
+
* disconnects its analyser taps there (no leaked nodes after Stop). */
|
|
287
|
+
export interface AudioMeterHandle {
|
|
288
|
+
/** Current level per bus. Cheap enough to poll at UI rate (~10 Hz). */
|
|
289
|
+
read(): AudioMeterFrame[];
|
|
290
|
+
/** Release the metering nodes. Idempotent. */
|
|
291
|
+
dispose(): void;
|
|
292
|
+
}
|
|
293
|
+
/** One entry in the audio event ring (W3c). `seq` is an adapter-lifetime
|
|
294
|
+
* MONOTONIC counter — the same ring-buffer fence discipline as
|
|
295
|
+
* `NetMessageEvent.seq` / `DebugAdapter.events`. `time` is a
|
|
296
|
+
* `performance.now()`-domain ms timestamp at capture. `'error'` is reserved
|
|
297
|
+
* for implementations that can truthfully report one (the first-party
|
|
298
|
+
* adapter has no honest audio-error source today and never emits it). */
|
|
299
|
+
export interface AudioDebugEvent {
|
|
300
|
+
seq: number;
|
|
301
|
+
time: number;
|
|
302
|
+
kind: 'transport-start' | 'transport-stop' | 'transport-pause' | 'context-statechange' | 'mute' | 'unmute' | 'error';
|
|
303
|
+
detail?: string;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Silence/restore a world's own audio (D10, T7.6) — NOT a mixer/bus API. This
|
|
307
|
+
* is the seam `Game.play.pause()` calls so a paused world's audio goes quiet
|
|
308
|
+
* too ("an audio seam in `SystemAdapters` so pause can silence game audio
|
|
309
|
+
* (howler et al.) or explicitly report it cannot"). Absence on a world's
|
|
310
|
+
* `mounted.systems` means exactly that: `Game.play.pause()` reports it loudly
|
|
311
|
+
* once per world rather than silently leaving that world's audio playing under
|
|
312
|
+
* a "paused" game.
|
|
313
|
+
*
|
|
314
|
+
* The OPTIONAL methods below are the W3c read-only INTROSPECTION capabilities
|
|
315
|
+
* feeding the editor's Audio debugger tab (graph / transport / meters /
|
|
316
|
+
* events). They follow the W3a degradation ladder: an implementer omits what
|
|
317
|
+
* it cannot truthfully provide, and the editor marks that section absent —
|
|
318
|
+
* never fabricated. The full MIXER (sends/effects/gain editing) is SQ-4-gated
|
|
319
|
+
* and deliberately NOT part of this seam. The first-party implementation over
|
|
320
|
+
* the engine's own Tone/Web-Audio stack is
|
|
321
|
+
* `packages/engine/src/audio/audio-introspection.ts`; pre-existing
|
|
322
|
+
* mute-only registrants keep compiling untouched (every addition is
|
|
323
|
+
* optional).
|
|
324
|
+
*/
|
|
325
|
+
export interface AudioAdapter {
|
|
326
|
+
/** Resume/unlock this adapter's real audio context from a user gesture.
|
|
327
|
+
* Optional for external adapters that do not own a resumable Web Audio
|
|
328
|
+
* context; first-party edit and play adapters both provide it. */
|
|
329
|
+
resume?(): void;
|
|
330
|
+
/** `true` silences this world's audio; `false` restores it to whatever
|
|
331
|
+
* level it was at before silencing (an implementer's own concern — the
|
|
332
|
+
* first-party adapter restores its master-gain value, not a hardcoded 1). */
|
|
333
|
+
setMuted(muted: boolean): void;
|
|
334
|
+
/** Current muted state, for inspection (editor mute UI, proofs). */
|
|
335
|
+
isMuted(): boolean;
|
|
336
|
+
/** Optional: current audio-graph snapshot (active nodes + downstream
|
|
337
|
+
* edges). The first-party adapter reports the engine bus hierarchy plus
|
|
338
|
+
* every Tone node routed through `connectToneBusToMasterGain` — it cannot
|
|
339
|
+
* see a game's private Tone-internal wiring and does not pretend to. */
|
|
340
|
+
graphSnapshot?(): AudioGraphNode[];
|
|
341
|
+
/** Optional: musical-transport snapshot. Returns `null` — an honest
|
|
342
|
+
* "this world has no musical transport" — when none is active (e.g. the
|
|
343
|
+
* first-party adapter when the game never bridged Tone onto this world's
|
|
344
|
+
* context). Method ABSENT means the capability itself is unsupported. */
|
|
345
|
+
transportState?(): AudioTransportState | null;
|
|
346
|
+
/** Optional: begin a per-bus metering session. Returns `null` when the
|
|
347
|
+
* environment cannot meter (headless world with no real AudioContext) —
|
|
348
|
+
* the UI says so rather than showing frozen zeros. */
|
|
349
|
+
acquireMeters?(): AudioMeterHandle | null;
|
|
350
|
+
/** Optional: the audio event ring (bounded, drops oldest). `sinceSeq`
|
|
351
|
+
* filters to `seq > sinceSeq` — the consumer's fence. */
|
|
352
|
+
audioEvents?(sinceSeq?: number): AudioDebugEvent[];
|
|
353
|
+
}
|
|
354
|
+
/** One tick-stamped debug event (`ctx.debug.emit`, spec §3.3): `tick`/`simT`
|
|
355
|
+
* are the engine's own counters AT EMISSION, so events and state reads
|
|
356
|
+
* correlate frame-exactly across every door (in-page bridge, relay, panels).
|
|
357
|
+
*
|
|
358
|
+
* `seq` (run-4 friction #5 fix) is a registry-lifetime MONOTONIC counter,
|
|
359
|
+
* strictly increasing by one per `emit()` call regardless of `tick` —
|
|
360
|
+
* unlike `tick`, it is never shared by two events, which is what makes it
|
|
361
|
+
* safe to fence on. A debug command handler runs BETWEEN ticks (its
|
|
362
|
+
* emissions carry whatever `tick` is current at that instant, same as every
|
|
363
|
+
* other emission at that instant would), so two DIFFERENT events — or an
|
|
364
|
+
* event and a consumer's fence point — can legitimately share one `tick`;
|
|
365
|
+
* `seq` never collides the same way, so "everything after what I've already
|
|
366
|
+
* observed" is unambiguous. See `events(sinceSeq)` below. */
|
|
367
|
+
export interface TickStampedEvent {
|
|
368
|
+
tick: number;
|
|
369
|
+
simT: number;
|
|
370
|
+
event: string;
|
|
371
|
+
detail?: unknown;
|
|
372
|
+
seq: number;
|
|
373
|
+
}
|
|
374
|
+
/** One registered debug command's listing shape — `locus` is always present
|
|
375
|
+
* (defaults to `'client'` when a command didn't declare one) so every
|
|
376
|
+
* listing surface can print it without a fallback of its own. */
|
|
377
|
+
export interface DebugCommandInfo {
|
|
378
|
+
name: string;
|
|
379
|
+
description?: string | undefined;
|
|
380
|
+
/** JSON-Schema projection of the command's Zod args tuple, when declared. */
|
|
381
|
+
argsJsonSchema?: unknown;
|
|
382
|
+
locus: 'client' | 'server';
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The debug/synthetic-player seam: game-scoped introspection + actuation
|
|
386
|
+
* over whatever a game registers via `ctx.debug`
|
|
387
|
+
* (`registerStateProvider`/`registerCommand`/`emit`). NOT a gameplay API —
|
|
388
|
+
* this is the one seam the debug bridge, the editor's Debug Console/State
|
|
389
|
+
* Watch panels, and `@vgai/live` all read/drive through.
|
|
390
|
+
*/
|
|
391
|
+
export interface DebugAdapter {
|
|
392
|
+
providers(): {
|
|
393
|
+
name: string;
|
|
394
|
+
tier: 'observable' | 'assisted';
|
|
395
|
+
}[];
|
|
396
|
+
/** One provider's current value. Throws `DebugError` code
|
|
397
|
+
* `STATE_PROVIDER_NOT_FOUND` (`data.registered`) for an unknown name. */
|
|
398
|
+
state(name: string): unknown;
|
|
399
|
+
/** One coherent snapshot of every registered provider — a throwing
|
|
400
|
+
* provider contributes `{ __error: String(err) }` for its own key rather
|
|
401
|
+
* than failing the whole snapshot. */
|
|
402
|
+
stateAll(): Record<string, unknown>;
|
|
403
|
+
commands(): DebugCommandInfo[];
|
|
404
|
+
/** Validates `args` against the command's declared Zod tuple (when
|
|
405
|
+
* present), then awaits the registered fn. Throws `DebugError` code
|
|
406
|
+
* `DEBUG_COMMAND_NOT_REGISTERED` for an unknown name,
|
|
407
|
+
* `DEBUG_COMMAND_ARGS_INVALID` for a validation failure, or
|
|
408
|
+
* `DEBUG_COMMAND_FAILED` wrapping anything the command itself threw. */
|
|
409
|
+
invoke(name: string, args: unknown[]): Promise<unknown>;
|
|
410
|
+
/** The tick-stamped event ring (cap 500, drops oldest).
|
|
411
|
+
*
|
|
412
|
+
* - `sinceSeq` given (run-4 friction #5 fix): filters to `seq > sinceSeq`
|
|
413
|
+
* — the unambiguous fence for "everything emitted after what I've
|
|
414
|
+
* already observed" (see `TickStampedEvent.seq`'s doc comment for why
|
|
415
|
+
* `tick` alone can't do this: a debug-command emission and a consumer's
|
|
416
|
+
* fence point can share one tick).
|
|
417
|
+
* - Omitted: the whole ring.
|
|
418
|
+
*
|
|
419
|
+
* There was a second, KNOWN-DEFECTIVE `sinceTick` parameter (`tick >
|
|
420
|
+
* sinceTick`, which silently dropped same-tick events) kept for
|
|
421
|
+
* back-compat after the seq fix. It is REMOVED — a fence is `seq` or
|
|
422
|
+
* nothing. */
|
|
423
|
+
events(sinceSeq?: number): TickStampedEvent[];
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Read-only render-debugging introspection (W4b, F11 frame debugger +
|
|
427
|
+
* profiler) — NOT a renderer. `captureFrame` arms the first-party WebGL2
|
|
428
|
+
* capture (`dev/webgl-frame-capture.ts`) and resolves with the NEXT rendered
|
|
429
|
+
* frame's draw list, attributed by wrapping each renderable's `onBeforeRender`
|
|
430
|
+
* (three calls it immediately before that object's main-pass draw; shadow/
|
|
431
|
+
* composer-pass draws stay unattributed BY CONSTRUCTION — an honest gap, not a
|
|
432
|
+
* guess). It REJECTS — never fabricates — if no frame renders within a bounded
|
|
433
|
+
* timeout (a paused/stopped world). `memorySnapshot` is the W3a-style OPTIONAL
|
|
434
|
+
* capability: present only when the mount can supply `renderer.info` (a
|
|
435
|
+
* headless mount omits it, and the editor marks the section absent).
|
|
436
|
+
*/
|
|
437
|
+
export interface RenderDebugAdapter {
|
|
438
|
+
captureFrame(): Promise<FrameCapture>;
|
|
439
|
+
memorySnapshot?(): RenderMemorySnapshot;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The set of optional subsystem providers a mounted game may expose. Absence of
|
|
443
|
+
* a provider means "capability not supported" — the editor degrades gracefully.
|
|
444
|
+
*/
|
|
445
|
+
export interface SystemAdapters {
|
|
446
|
+
physics?: PhysicsAdapter;
|
|
447
|
+
networking?: NetworkingAdapter;
|
|
448
|
+
navigation?: NavigationAdapter;
|
|
449
|
+
audio?: AudioAdapter;
|
|
450
|
+
debug?: DebugAdapter;
|
|
451
|
+
renderDebug?: RenderDebugAdapter;
|
|
452
|
+
}
|
|
453
|
+
//# sourceMappingURL=system-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/system-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YA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;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System adapters — optional subsystem capability providers hung off a mounted
|
|
3
|
+
* game (`MountedThreeRoot.systems`). Each is a thin capability boundary the editor can
|
|
4
|
+
* coordinate with WITHOUT owning the implementation. The first-party
|
|
5
|
+
* implementers wrap Rapier / Colyseus / recast; an external game supplies its
|
|
6
|
+
* own or none, and the editor degrades per `capabilities`.
|
|
7
|
+
*
|
|
8
|
+
* These are introspection/coordination boundaries, NOT re-implementations: e.g.
|
|
9
|
+
* `NetworkingAdapter` is not a transport, and `PhysicsAdapter` does not replace
|
|
10
|
+
* Rapier — it lets the editor ask "who owns this object" and "freeze it while I
|
|
11
|
+
* edit it".
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The neutral transform value used across adapter interfaces. Position + scale
|
|
3
|
+
* are xyz; rotation is a quaternion (xyzw) — matching `Object3D.quaternion`, so
|
|
4
|
+
* adapters never have to agree on an Euler convention.
|
|
5
|
+
*/
|
|
6
|
+
export interface Transform {
|
|
7
|
+
position: [number, number, number];
|
|
8
|
+
rotation: [number, number, number, number];
|
|
9
|
+
scale: [number, number, number];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Who currently owns an object's transform — i.e. what writes it each frame.
|
|
13
|
+
* The editor uses this to decide whether a gizmo edit is durable (`editor`),
|
|
14
|
+
* needs simulation coordination (`physics`), or is best-effort/inspect-only
|
|
15
|
+
* (`script`/`network`/`external`).
|
|
16
|
+
*/
|
|
17
|
+
export type TransformOwner = 'editor' | 'physics' | 'animation' | 'script' | 'network' | 'external';
|
|
18
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/adapter/transform.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NavMeshManager — wraps recast-navigation for navmesh generation + crowd pathfinding.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* await init(); // WASM init (call once per app)
|
|
6
|
+
* const nav = new NavMeshManager();
|
|
7
|
+
* await nav.buildFromMeshes(meshes);
|
|
8
|
+
* const path = nav.findPath(start, end);
|
|
9
|
+
* const crowd = nav.createCrowd(10);
|
|
10
|
+
* // In game loop: nav.updateCrowd(dt);
|
|
11
|
+
*/
|
|
12
|
+
import { NavMeshHelper } from '@recast-navigation/three';
|
|
13
|
+
import type { CrowdAgent } from 'recast-navigation';
|
|
14
|
+
import { Crowd } from 'recast-navigation';
|
|
15
|
+
import type { Mesh, Scene } from 'three';
|
|
16
|
+
export type { CrowdAgent };
|
|
17
|
+
export interface Vector3Like {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
z: number;
|
|
21
|
+
}
|
|
22
|
+
/** One crowd agent's live state — a plain-data snapshot safe to hand across
|
|
23
|
+
* the adapter seam (no WASM handles), for editor debug draw. */
|
|
24
|
+
export interface CrowdAgentSnapshot {
|
|
25
|
+
position: Vector3Like;
|
|
26
|
+
velocity: Vector3Like;
|
|
27
|
+
radius: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
|
30
|
+
export interface NavMeshBuildParams {
|
|
31
|
+
cellSize?: number | undefined;
|
|
32
|
+
cellHeight?: number | undefined;
|
|
33
|
+
walkableSlopeAngle?: number | undefined;
|
|
34
|
+
walkableHeight?: number | undefined;
|
|
35
|
+
walkableClimb?: number | undefined;
|
|
36
|
+
walkableRadius?: number | undefined;
|
|
37
|
+
maxEdgeLen?: number | undefined;
|
|
38
|
+
maxSimplificationError?: number | undefined;
|
|
39
|
+
minRegionArea?: number | undefined;
|
|
40
|
+
mergeRegionArea?: number | undefined;
|
|
41
|
+
}
|
|
42
|
+
export declare function initNavigation(): Promise<void>;
|
|
43
|
+
export declare class NavMeshManager {
|
|
44
|
+
private navMesh;
|
|
45
|
+
private query;
|
|
46
|
+
private crowd;
|
|
47
|
+
private helper;
|
|
48
|
+
/** Build navmesh from Three.js Mesh objects (grounds, obstacles, etc.). */
|
|
49
|
+
buildFromMeshes(meshes: Mesh[], params?: NavMeshBuildParams): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Destroy all live recast handles (crowd, query, navmesh) and dispose the
|
|
52
|
+
* debug helper. Recast objects live on the WASM heap and are NOT GC'd —
|
|
53
|
+
* they must be explicitly `.destroy()`ed or they leak.
|
|
54
|
+
*/
|
|
55
|
+
private destroyRecast;
|
|
56
|
+
/** True once a navmesh has been built (for the NavigationAdapter to gate on). */
|
|
57
|
+
hasNavMesh(): boolean;
|
|
58
|
+
/** Find a straight path between two world positions. Returns [] if no path. */
|
|
59
|
+
findPath(start: Vector3Like, end: Vector3Like): Vector3Like[];
|
|
60
|
+
/** Create a crowd with up to maxAgents agents. */
|
|
61
|
+
createCrowd(maxAgents: number): Crowd;
|
|
62
|
+
/** Step the crowd simulation. Call once per frame. */
|
|
63
|
+
updateCrowd(dt: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* Plain-data snapshots of every active crowd agent (interpolated position,
|
|
66
|
+
* velocity, radius, height) — the introspection feed for the editor's
|
|
67
|
+
* play-mode crowd debug draw. Empty when no crowd exists.
|
|
68
|
+
*/
|
|
69
|
+
getCrowdAgents(): CrowdAgentSnapshot[];
|
|
70
|
+
/** Get or create the wireframe debug mesh. Add to scene once, call update() after rebuilding. */
|
|
71
|
+
getDebugMesh(scene: Scene): NavMeshHelper | null;
|
|
72
|
+
/** Serialize the current navmesh to a binary blob. */
|
|
73
|
+
exportData(): Uint8Array;
|
|
74
|
+
/** Load a navmesh from a previously exported binary blob. */
|
|
75
|
+
loadFromData(data: Uint8Array): void;
|
|
76
|
+
dispose(scene: Scene): void;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/ai/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAsB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAoD,MAAM,mBAAmB,CAAC;AAC5F,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAGzC,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;iEACiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS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