@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,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RootAdapter — the host ⇄ runtime contract. A ROOT is *anything that mounts*.
|
|
3
|
+
*
|
|
4
|
+
* This is the interface the HOST depends on. It replaces the old
|
|
5
|
+
* `{ setup, components }` shape: the host no longer knows about `GameSetupFn`
|
|
6
|
+
* — that is the internal of ONE implementer
|
|
7
|
+
* (`SetupThreeRootAdapter`). First-party content and an unmodified external game
|
|
8
|
+
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
+
*
|
|
10
|
+
* It was `GameAdapter` until WO-9 #60, and the rename is an ONTOLOGY fix, not
|
|
11
|
+
* taste. Under D20 a *game* is the manifest's whole `roots` array — that is
|
|
12
|
+
* what `runtime/game.ts`'s `Game` is. Every implementer of THIS interface
|
|
13
|
+
* adapts exactly ONE root. So `Game` and `GameAdapter` sat at different levels
|
|
14
|
+
* of the ontology while sharing a name-stem, which reads as though one were
|
|
15
|
+
* the adapter for the other. The surrounding vocabulary had already moved:
|
|
16
|
+
* `MountedRootBase`, `MountedRoot`, `MountedRootFor`, `RootStateObserver`,
|
|
17
|
+
* `SurfaceAdapterFor`, `RootInstance`, `mountManifestRoots` — and, decisively,
|
|
18
|
+
* the resolver that PRODUCES these (`resolveRootAdapter`, `RootAdapterSchema`,
|
|
19
|
+
* `resolveThreeRootAdapter`) already said root. The interface was the last
|
|
20
|
+
* holdout, out of step with its own resolver.
|
|
21
|
+
*
|
|
22
|
+
* The `K = 'three'` default below is KEPT deliberately (see the note on the
|
|
23
|
+
* interface).
|
|
24
|
+
*/
|
|
25
|
+
import type { Container } from 'pixi.js';
|
|
26
|
+
import type * as THREE from 'three';
|
|
27
|
+
import type { AdapterSurface } from './adapter-surface';
|
|
28
|
+
import type { AuthoringAdapter } from './authoring';
|
|
29
|
+
import type { HostContextFor } from './host-context';
|
|
30
|
+
import type { SystemAdapters } from './system-adapter';
|
|
31
|
+
/**
|
|
32
|
+
* The ingested-world observation contract (T7.4 slice 2, "the
|
|
33
|
+
* must-answer"). Cross-world data flow with a
|
|
34
|
+
* foreign game is observation via an adapter-provided interface, not ordinary
|
|
35
|
+
* shared state (that's D7's answer for first-party↔first-party flow).
|
|
36
|
+
* Optional on {@link MountedThreeRoot} —
|
|
37
|
+
* absence means the adapter has nothing genuinely observable to expose (the
|
|
38
|
+
* anti-shim rule: never fabricate state), and the world takes the honest
|
|
39
|
+
* "no state bridge" tier hit (see `Game.registerRoot` in `runtime/game.ts`)
|
|
40
|
+
* rather than silently offering an `undefined`-forever subscription.
|
|
41
|
+
*/
|
|
42
|
+
export interface RootStateObserver {
|
|
43
|
+
/**
|
|
44
|
+
* Notified at most once per frame IF the adapter can hook the game's own
|
|
45
|
+
* update (`loop: 'gated'` roots, §(d)); self-driven roots (`loop:
|
|
46
|
+
* 'self-driven'`, raw-rAF) may notify on their OWN rAF cadence instead —
|
|
47
|
+
* consumers must not assume our frame timing. Returns an unsubscribe
|
|
48
|
+
* function.
|
|
49
|
+
*/
|
|
50
|
+
subscribe(onChange: () => void): () => void;
|
|
51
|
+
/**
|
|
52
|
+
* A cheap, adapter-chosen snapshot of this world's observable state.
|
|
53
|
+
* Returns a STABLE reference while nothing has changed (so a selector run
|
|
54
|
+
* over it can cheaply bail out by reference, same spirit as
|
|
55
|
+
* `GameStateBridge`'s frame-version cache). Shape is adapter-defined —
|
|
56
|
+
* not centrally schematized in v1.
|
|
57
|
+
*/
|
|
58
|
+
snapshot(): unknown;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Everything a mounted world provides EXCEPT its render surface: THREE.Scene/
|
|
62
|
+
* THREE.Camera typing is replaced with kind-tagged world surfaces. Split out
|
|
63
|
+
* of the old flat
|
|
64
|
+
* `MountedThreeRoot` so a non-threejs world can carry its own kind-appropriate
|
|
65
|
+
* surface field (a pixi `stage`, a react `container`) instead of being
|
|
66
|
+
* force-fit through THREE `scene`/`camera` fields it doesn't have.
|
|
67
|
+
*/
|
|
68
|
+
export interface MountedRootBase {
|
|
69
|
+
/**
|
|
70
|
+
* Loop model:
|
|
71
|
+
* - `false` (host-driven): first-party + "clean" externals. The host ticks
|
|
72
|
+
* `update(dt)` in its loop.
|
|
73
|
+
* - `true` (self-driven): an unmodified game that owns its renderer + rAF.
|
|
74
|
+
* The host does NOT tick it. Pause/step control is a DECLARED CAPABILITY,
|
|
75
|
+
* not a promise: implement `setPaused`/`step` only where the game exposes
|
|
76
|
+
* a sanctioned pause/step mechanism. Gating a raw-rAF loop from outside
|
|
77
|
+
* was demonstrated and REJECTED (D5 — it halts the loop rather than
|
|
78
|
+
* pausing it); such games are the "composited, unsynchronized" tier:
|
|
79
|
+
* `setPaused` absent, host degrades loudly (T7.6 owns the tier surface).
|
|
80
|
+
*/
|
|
81
|
+
readonly drivesOwnLoop: boolean;
|
|
82
|
+
update?(dt: number): void;
|
|
83
|
+
fixedUpdate?(dt: number): void;
|
|
84
|
+
setPaused?(paused: boolean): void;
|
|
85
|
+
step?(): void;
|
|
86
|
+
resize?(width: number, height: number): void;
|
|
87
|
+
dispose(): void;
|
|
88
|
+
/** Optional capability providers — absence = "not supported", host degrades. */
|
|
89
|
+
readonly authoring?: AuthoringAdapter;
|
|
90
|
+
readonly systems?: SystemAdapters;
|
|
91
|
+
/** Optional state-observation capability (T7.4 slice 2, §4) — absent means
|
|
92
|
+
* "no state bridge"; `Game.registerRoot` reports this loudly, once, for
|
|
93
|
+
* any non-first-party mount. First-party mounts are exempt — their state
|
|
94
|
+
* is observed through `Game.state`/`useWorldState` instead (§3), not this
|
|
95
|
+
* field. */
|
|
96
|
+
readonly observe?: RootStateObserver;
|
|
97
|
+
}
|
|
98
|
+
/** A live, mounted three world. The host obtains `scene`/`camera` to
|
|
99
|
+
* render+author. Until WO-9 task #9 this type also had a `MountedGame` alias,
|
|
100
|
+
* which every pre-T7.5 threejs call site named; the alias is deleted, because
|
|
101
|
+
* what it aliased is one three ROOT and a game is the manifest's whole set of
|
|
102
|
+
* roots (D20). */
|
|
103
|
+
export interface MountedThreeRoot extends MountedRootBase {
|
|
104
|
+
readonly kind: 'three';
|
|
105
|
+
/** The live scene + camera the editor inspects/renders for authoring. */
|
|
106
|
+
readonly scene: THREE.Scene;
|
|
107
|
+
readonly camera: THREE.Camera;
|
|
108
|
+
}
|
|
109
|
+
/** A live, mounted canvas world (T7.3) — the pixi analog of
|
|
110
|
+
* {@link MountedThreeRoot}. `stage` is the pixi world container the host
|
|
111
|
+
* renders/authors, the surface `RootInstance.pixiStage()` returns. */
|
|
112
|
+
export interface MountedPixiRoot extends MountedRootBase {
|
|
113
|
+
readonly kind: 'canvas';
|
|
114
|
+
readonly stage: Container;
|
|
115
|
+
}
|
|
116
|
+
/** A live, mounted react world (T6.2) — the react analog of
|
|
117
|
+
* {@link MountedThreeRoot}. `container` is the DOM-root layer the host
|
|
118
|
+
* handed the adapter's `mount` (the SAME element `RootInstance.reactRoot()`
|
|
119
|
+
* returns) — a react world's tree renders into it via `createRoot`. */
|
|
120
|
+
export interface MountedReactRoot extends MountedRootBase {
|
|
121
|
+
readonly kind: 'dom';
|
|
122
|
+
readonly container: HTMLElement;
|
|
123
|
+
}
|
|
124
|
+
/** Every kind of live, mounted world (T7.5) — the union `RootInstance.mounted`
|
|
125
|
+
* is typed against now, replacing the THREE-only `MountedThreeRoot`. */
|
|
126
|
+
export type MountedRoot = MountedThreeRoot | MountedPixiRoot | MountedReactRoot;
|
|
127
|
+
/** Map a {@link AdapterSurface} to its mounted-world shape (mirrors `NodeOf`/
|
|
128
|
+
* `BodyOf`/`ColliderOf` in `ecs/behavior.ts`) — lets generic code over
|
|
129
|
+
* `K extends AdapterSurface` name the right surface without a manual union. */
|
|
130
|
+
export type MountedRootFor<K extends AdapterSurface> = K extends 'three' ? MountedThreeRoot : K extends 'canvas' ? MountedPixiRoot : K extends 'dom' ? MountedReactRoot : never;
|
|
131
|
+
/**
|
|
132
|
+
* The interface every game implements to run on the host. Generic over
|
|
133
|
+
* {@link AdapterSurface} (T7.5) so a non-threejs implementer's `mount` returns
|
|
134
|
+
* its OWN kind-tagged surface instead of being cast through the three shape —
|
|
135
|
+
* defaults to `'three'` so every pre-T7.5 implementer/call site
|
|
136
|
+
* (`RootAdapter`, unparameterized) keeps compiling unchanged.
|
|
137
|
+
*
|
|
138
|
+
* `K` parameterizes BOTH halves of `mount` (P-8): until then only the RETURN
|
|
139
|
+
* type was kind-tagged, while the PARAMETER was always the three-shaped
|
|
140
|
+
* `ThreeHostContext` — so a `RootAdapter<'canvas'>` was, by its own type, handed a
|
|
141
|
+
* `THREE.WebGLRenderer` it cannot use, and the production Pixi/React adapters
|
|
142
|
+
* could not be `RootAdapter`s at all (they were separate structural types over
|
|
143
|
+
* `CanvasHostContext`/`DomHostContext`, and `RootAdapter<'canvas'>` existed only in
|
|
144
|
+
* tests). With `HostContextFor<K>` the surface tag picks the context type, and
|
|
145
|
+
* those production adapters are now genuine `RootAdapter<K>` subtypes —
|
|
146
|
+
* `Pixi2DRootAdapter extends RootAdapter<'canvas'>`, `ReactRootAdapter extends
|
|
147
|
+
* RootAdapter<'dom'>` (`runtime/create-runtime.ts`).
|
|
148
|
+
*/
|
|
149
|
+
/**
|
|
150
|
+
* On the `= 'three'` default (WO-9 #60 considered removing it, and did not):
|
|
151
|
+
* this default is type-level only: an author who writes bare `RootAdapter` for
|
|
152
|
+
* a pixi root gets a compile error on `mount`'s return type, because
|
|
153
|
+
* `MountedRootFor<'three'>` demands `scene`/`camera` a `MountedPixiRoot` has
|
|
154
|
+
* not got. Wrong-by-default is caught by tsc, so removing this default would
|
|
155
|
+
* be churn across ~125 bare call sites for no defect it could catch.
|
|
156
|
+
*/
|
|
157
|
+
export interface RootAdapter<K extends AdapterSurface = 'three'> {
|
|
158
|
+
/** Stable id (telemetry/registry/conformance). */
|
|
159
|
+
readonly id: string;
|
|
160
|
+
/** Build/start the game against the host context for ITS surface; return the
|
|
161
|
+
* handle. */
|
|
162
|
+
mount(host: HostContextFor<K>): Promise<MountedRootFor<K>>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* One surface tag paired with an adapter typed FOR that surface (WO-34).
|
|
166
|
+
*
|
|
167
|
+
* Why this exists: a resolver that turns a manifest root into a mountable
|
|
168
|
+
* adapter handles every surface in one function, so its return type has to
|
|
169
|
+
* span all three. Returning the bare union `RootAdapter<'three'> |
|
|
170
|
+
* RootAdapter<'canvas'> | RootAdapter<'dom'>` does NOT work — a union of
|
|
171
|
+
* function types INTERSECTS its parameters, so `.mount(host)` becomes
|
|
172
|
+
* uncallable with any single host value (no one object is simultaneously a
|
|
173
|
+
* `ThreeHostContext`, a `CanvasHostContext` and a `DomHostContext`). The historical
|
|
174
|
+
* workaround was to declare the whole channel `RootAdapter<'three'>` and
|
|
175
|
+
* re-assert the real kind at each call site with `as unknown as` — kind
|
|
176
|
+
* ERASURE: the surface tag the manifest already knew was thrown away and
|
|
177
|
+
* guessed back.
|
|
178
|
+
*
|
|
179
|
+
* Carrying the tag ALONGSIDE the adapter fixes that structurally: this is a
|
|
180
|
+
* discriminated union on `surface`, so `switch (resolved.surface)` narrows
|
|
181
|
+
* `resolved.adapter` to ONE `RootAdapter<K>` inside each branch — a single
|
|
182
|
+
* signature again, hence `.mount(host)` is callable with that surface's own
|
|
183
|
+
* host context, checked by the compiler instead of asserted.
|
|
184
|
+
*/
|
|
185
|
+
export type SurfaceAdapterFor<K extends AdapterSurface> = {
|
|
186
|
+
readonly surface: K;
|
|
187
|
+
readonly adapter: RootAdapter<K>;
|
|
188
|
+
};
|
|
189
|
+
/** Every surface's {@link SurfaceAdapterFor}, as one discriminated union.
|
|
190
|
+
* Written out member-by-member (rather than as a distributive conditional)
|
|
191
|
+
* so `assertNever` sees exactly three variants and a hypothetical 4th
|
|
192
|
+
* `AdapterSurface` member fails to compile HERE, at the vocabulary, rather
|
|
193
|
+
* than silently widening every consumer's exhaustiveness guard. */
|
|
194
|
+
export type SurfaceAdapter = SurfaceAdapterFor<'three'> | SurfaceAdapterFor<'canvas'> | SurfaceAdapterFor<'dom'>;
|
|
195
|
+
//# sourceMappingURL=root-adapter.d.ts.map
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CAAC,CAAC,SAAS,cAAc,IAAI;IACxD,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;;;oEAIoE;AACpE,MAAM,MAAM,cAAc,GACtB,iBAAiB,CAAC,OAAO,CAAC,GAC1B,iBAAiB,CAAC,QAAQ,CAAC,GAC3B,iBAAiB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RootAdapter — the host ⇄ runtime contract. A ROOT is *anything that mounts*.
|
|
3
|
+
*
|
|
4
|
+
* This is the interface the HOST depends on. It replaces the old
|
|
5
|
+
* `{ setup, components }` shape: the host no longer knows about `GameSetupFn`
|
|
6
|
+
* — that is the internal of ONE implementer
|
|
7
|
+
* (`SetupThreeRootAdapter`). First-party content and an unmodified external game
|
|
8
|
+
* are peer implementers of THIS interface; the host has no branch on which.
|
|
9
|
+
*
|
|
10
|
+
* It was `GameAdapter` until WO-9 #60, and the rename is an ONTOLOGY fix, not
|
|
11
|
+
* taste. Under D20 a *game* is the manifest's whole `roots` array — that is
|
|
12
|
+
* what `runtime/game.ts`'s `Game` is. Every implementer of THIS interface
|
|
13
|
+
* adapts exactly ONE root. So `Game` and `GameAdapter` sat at different levels
|
|
14
|
+
* of the ontology while sharing a name-stem, which reads as though one were
|
|
15
|
+
* the adapter for the other. The surrounding vocabulary had already moved:
|
|
16
|
+
* `MountedRootBase`, `MountedRoot`, `MountedRootFor`, `RootStateObserver`,
|
|
17
|
+
* `SurfaceAdapterFor`, `RootInstance`, `mountManifestRoots` — and, decisively,
|
|
18
|
+
* the resolver that PRODUCES these (`resolveRootAdapter`, `RootAdapterSchema`,
|
|
19
|
+
* `resolveThreeRootAdapter`) already said root. The interface was the last
|
|
20
|
+
* holdout, out of step with its own resolver.
|
|
21
|
+
*
|
|
22
|
+
* The `K = 'three'` default below is KEPT deliberately (see the note on the
|
|
23
|
+
* interface).
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SetupThreeRootAdapter — the first-party implementer of {@link RootAdapter}
|
|
3
|
+
* that mounts ONE three root from an imperative `setup(ctx)` function.
|
|
4
|
+
*
|
|
5
|
+
* This is where Rapier lives now: the host no longer knows about it.
|
|
6
|
+
* `mount(host)` builds the full first-party runtime (the body
|
|
7
|
+
* that used to live inline in `create-runtime.ts`) from a neutral
|
|
8
|
+
* {@link ThreeHostContext}, runs the game's `setup`, and returns a
|
|
9
|
+
* {@link MountedThreeRoot}. First-party content is now just one implementer of
|
|
10
|
+
* the same interface an unmodified external game implements (Phase B).
|
|
11
|
+
*
|
|
12
|
+
* It was `VgaiSceneGameAdapter` until WO-9 tasks #6/#9. Both halves of that
|
|
13
|
+
* name had stopped being true: it loads no scene (the `.vscn.json` branches
|
|
14
|
+
* went with the format in WO-8 — `setup` is the only mount path left), and what
|
|
15
|
+
* it mounts is one three ROOT, not a game (a game is the manifest's whole set
|
|
16
|
+
* of roots). The R3F/TSX world root is a SEPARATE adapter; this one is
|
|
17
|
+
* specifically the `fromSetup` path.
|
|
18
|
+
*
|
|
19
|
+
* `GameSetupFn` / `GameContext` are imported ONLY here (and in the example
|
|
20
|
+
* `fromSetup` wrappers) — never by the host. That confinement is the inversion.
|
|
21
|
+
*/
|
|
22
|
+
import type { EffectComposer } from 'postprocessing';
|
|
23
|
+
import { type ViewportShadingMode } from '../render/viewport-shading';
|
|
24
|
+
import { type RootFrameHooks } from '../runtime/game';
|
|
25
|
+
import type { EditorPreview, GameContext, GameSetupFn } from '../runtime/types';
|
|
26
|
+
import type { ThreeHostContext } from './host-context';
|
|
27
|
+
import type { MountedThreeRoot, RootAdapter } from './root-adapter';
|
|
28
|
+
/** How a {@link SetupThreeRootAdapter} builds its game (the former RuntimeConfig). */
|
|
29
|
+
export interface SetupThreeRootConfig {
|
|
30
|
+
/** Game setup function — registers systems and loads scenes. */
|
|
31
|
+
setup?: GameSetupFn | undefined;
|
|
32
|
+
/** Editor context — passed to setup() when launched from the editor. */
|
|
33
|
+
editorPreview?: EditorPreview | undefined;
|
|
34
|
+
/** Input map JSON path. Defaults to 'inputmaps/default.inputmap.json'. */
|
|
35
|
+
inputMapPath?: string | undefined;
|
|
36
|
+
/** URL prefix for relative asset paths. Defaults to '/'. */
|
|
37
|
+
assetPrefix?: string | undefined;
|
|
38
|
+
/** Stable adapter id (for registry/conformance). Defaults to 'setup-three'. */
|
|
39
|
+
id?: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The first-party `MountedThreeRoot`, with concrete extras the editor host uses for
|
|
43
|
+
* first-party features (HMR, physics sync) that are NOT part of the neutral
|
|
44
|
+
* interface. The generic host only touches the `MountedThreeRoot` surface.
|
|
45
|
+
*/
|
|
46
|
+
export interface MountedSetupThreeRoot extends MountedThreeRoot {
|
|
47
|
+
/**
|
|
48
|
+
* First-party brand (checklist item 1 / T7.3 lookahead): a plain `'ctx' in
|
|
49
|
+
* mounted` structural check misfires against any foreign mount that happens
|
|
50
|
+
* to carry an unrelated `ctx` key. This literal-`true`
|
|
51
|
+
* property is what `isFirstPartyMounted` (`runtime/game.ts`) actually
|
|
52
|
+
* checks; `game.ts` reads it via a structural `{ firstParty?: unknown }`
|
|
53
|
+
* probe so it never needs a value import of this module (the existing
|
|
54
|
+
* import is type-only and must stay that way).
|
|
55
|
+
*/
|
|
56
|
+
readonly firstParty: true;
|
|
57
|
+
readonly ctx: GameContext;
|
|
58
|
+
readonly composer: EffectComposer | null;
|
|
59
|
+
/** Render-only developer view; native game materials are restored before the frame returns. */
|
|
60
|
+
setViewportShadingMode(mode: ViewportShadingMode): void;
|
|
61
|
+
/** Warm-restart: dispose the current game, re-run a new setup on the same ctx. */
|
|
62
|
+
hotReload(newSetup: GameSetupFn, editorPreview?: EditorPreview): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Phase-partitioned frame entry point (T7.1 slice 2) — wired onto this
|
|
65
|
+
* world's `RootInstance` by `registerThreeRoot` (`create-runtime.ts`).
|
|
66
|
+
* `Game.runFrame` is the CANONICAL driver going forward: it calls
|
|
67
|
+
* `frame.runPhase` once per (phase, substep) for every world, then
|
|
68
|
+
* `frame.endFrame` once per substep after all roots finish all phases.
|
|
69
|
+
* `update` (below) remains the legacy/direct entry point to the exact same
|
|
70
|
+
* `SystemRunner` — direct callers (editor HMR, adapter conformance tests)
|
|
71
|
+
* keep using it unchanged.
|
|
72
|
+
*/
|
|
73
|
+
readonly frame: RootFrameHooks;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Wrap a first-party `setup` function as a {@link RootAdapter}. This is how every
|
|
77
|
+
* first-party example becomes an implementer of the same interface an external
|
|
78
|
+
* game implements — with no change to the setup's body.
|
|
79
|
+
*/
|
|
80
|
+
export declare function fromSetup(id: string, setup: GameSetupFn): RootAdapter;
|
|
81
|
+
export declare class SetupThreeRootAdapter implements RootAdapter {
|
|
82
|
+
private readonly config;
|
|
83
|
+
readonly id: string;
|
|
84
|
+
constructor(config?: SetupThreeRootConfig);
|
|
85
|
+
mount(host: ThreeHostContext): Promise<MountedSetupThreeRoot>;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=setup-three-root-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-three-root-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/setup-three-root-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAiCrD,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,4BAA4B,CAAC;AAM/F,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAe,WAAW,EAAE,WAAW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