@vgai/engine 0.5.5 → 0.5.7
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,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared light + camera factory (T1.13 — DEFAULTS truth).
|
|
3
|
+
*
|
|
4
|
+
* `createLight`/`createCamera` used to be duplicated verbatim between the
|
|
5
|
+
* runtime loader (`scene-loader.ts`) and the editor preview
|
|
6
|
+
* (`entity-factory.ts`) — both hardcoded the same fallback literals (color
|
|
7
|
+
* '#ffffff', fov 60, near 0.1, far 1000, etc.) that happened to agree with
|
|
8
|
+
* `DEFAULTS.light`/`DEFAULTS.camera` by luck rather than by reading them. Any
|
|
9
|
+
* edit to one copy (or to `DEFAULTS`) could silently diverge from the other.
|
|
10
|
+
*
|
|
11
|
+
* This module is now the ONE place that builds a `THREE.Light`/`THREE.Camera`
|
|
12
|
+
* from a `LightDescriptor`/`CameraDescriptor` descriptor, reading its fallbacks from
|
|
13
|
+
* `DEFAULTS` (the single source of truth for scene default values — see
|
|
14
|
+
* `defaults.ts`). Both the loader and the editor import it, so they
|
|
15
|
+
* can no longer disagree.
|
|
16
|
+
*/
|
|
17
|
+
import * as THREE from 'three';
|
|
18
|
+
// Area lights. `RectAreaLight` requires its LTC lookup-texture uniforms
|
|
19
|
+
// initialized once before the first instance is constructed; three.js ships
|
|
20
|
+
// that setup as an addon, not part of core. Imported via the
|
|
21
|
+
// `three/addons/*` alias (package.json `exports`: `"./addons/*":
|
|
22
|
+
// "./examples/jsm/*"` — the identical file as
|
|
23
|
+
// `three/examples/jsm/lights/RectAreaLightUniformsLib.js`) because a literal
|
|
24
|
+
// `/examples/` specifier trips `engine-host-no-game-imports.test.ts`'s
|
|
25
|
+
// game/editor-example guard (a same-substring false positive against this
|
|
26
|
+
// repo's OWN `packages/editor/template/src/examples/` convention, unrelated
|
|
27
|
+
// to three.js's addon folder naming).
|
|
28
|
+
import { RectAreaLightUniformsLib } from 'three/addons/lights/RectAreaLightUniformsLib.js';
|
|
29
|
+
import { DEFAULTS } from '../defaults';
|
|
30
|
+
let rectAreaLightUniformsInitialized = false;
|
|
31
|
+
/** Build a Three.js light from a `LightDescriptor` descriptor. */
|
|
32
|
+
export function createLight(def) {
|
|
33
|
+
const d = DEFAULTS.light;
|
|
34
|
+
const color = def.color ?? d.color;
|
|
35
|
+
const intensity = def.intensity ?? d.intensity;
|
|
36
|
+
switch (def.type) {
|
|
37
|
+
case 'directional':
|
|
38
|
+
return new THREE.DirectionalLight(color, intensity);
|
|
39
|
+
case 'point':
|
|
40
|
+
return new THREE.PointLight(color, intensity, def.distance ?? d.distance, def.decay ?? d.decay);
|
|
41
|
+
case 'spot': {
|
|
42
|
+
const light = new THREE.SpotLight(color, intensity, def.distance ?? d.distance, def.angle ?? d.angle, def.penumbra ?? d.penumbra);
|
|
43
|
+
light.decay = def.decay ?? d.decay;
|
|
44
|
+
return light;
|
|
45
|
+
}
|
|
46
|
+
case 'hemisphere':
|
|
47
|
+
return new THREE.HemisphereLight(color, def.groundColor ?? d.groundColor, intensity);
|
|
48
|
+
case 'area': {
|
|
49
|
+
// No shadow map is ever wired for this light (RectAreaLight does not
|
|
50
|
+
// support shadows in three.js — see the honesty note on the schema
|
|
51
|
+
// field's .describe(); degrade loudly, not silently).
|
|
52
|
+
if (!rectAreaLightUniformsInitialized) {
|
|
53
|
+
RectAreaLightUniformsLib.init();
|
|
54
|
+
rectAreaLightUniformsInitialized = true;
|
|
55
|
+
}
|
|
56
|
+
return new THREE.RectAreaLight(color, intensity, def.width ?? d.width, def.height ?? d.height);
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
return new THREE.DirectionalLight(color, intensity);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Build a Three.js camera from a `CameraDescriptor` descriptor. */
|
|
63
|
+
export function createCamera(def) {
|
|
64
|
+
const d = DEFAULTS.camera;
|
|
65
|
+
const aspect = (def.width ?? d.width) / (def.height ?? d.height);
|
|
66
|
+
if (def.type === 'orthographic') {
|
|
67
|
+
const size = def.orthoSize ?? d.orthoSize;
|
|
68
|
+
return new THREE.OrthographicCamera(-size * aspect, size * aspect, size, -size, def.near ?? d.near, def.far ?? d.far);
|
|
69
|
+
}
|
|
70
|
+
return new THREE.PerspectiveCamera(def.fov ?? d.fov, aspect, def.near ?? d.near, def.far ?? d.far);
|
|
71
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Per-frame LOD tick. `THREE.LOD` only swaps its active level when
|
|
4
|
+
* `.update(camera)` runs, so every `THREE.LOD` in the scene graph needs this
|
|
5
|
+
* called once a frame. Wired into the runtime's `preRender` system in
|
|
6
|
+
* `adapter/setup-three-root-adapter.ts`.
|
|
7
|
+
*
|
|
8
|
+
* Format-neutral: it matches THREE's own `isLOD` marker and knows nothing about
|
|
9
|
+
* how the LOD was built. Formerly `@engine/scene/scene-loader`'s
|
|
10
|
+
* `updateSceneLODs`, relocated here when WO-8 deleted the `.vscn` scene loader.
|
|
11
|
+
*/
|
|
12
|
+
export declare function updateSceneLODs(scene: THREE.Object3D, camera: THREE.Camera): void;
|
|
13
|
+
//# sourceMappingURL=lod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lod.d.ts","sourceRoot":"","sources":["../../src/render/lod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAIjF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-frame LOD tick. `THREE.LOD` only swaps its active level when
|
|
3
|
+
* `.update(camera)` runs, so every `THREE.LOD` in the scene graph needs this
|
|
4
|
+
* called once a frame. Wired into the runtime's `preRender` system in
|
|
5
|
+
* `adapter/setup-three-root-adapter.ts`.
|
|
6
|
+
*
|
|
7
|
+
* Format-neutral: it matches THREE's own `isLOD` marker and knows nothing about
|
|
8
|
+
* how the LOD was built. Formerly `@engine/scene/scene-loader`'s
|
|
9
|
+
* `updateSceneLODs`, relocated here when WO-8 deleted the `.vscn` scene loader.
|
|
10
|
+
*/
|
|
11
|
+
export function updateSceneLODs(scene, camera) {
|
|
12
|
+
scene.traverse((o) => {
|
|
13
|
+
if (o.isLOD)
|
|
14
|
+
o.update(camera);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { MaterialDescriptor } from '../asset-formats/material';
|
|
3
|
+
import type { MeshDescriptor } from '../asset-formats/mesh';
|
|
4
|
+
/**
|
|
5
|
+
* Single source of truth for turning a `MeshDescriptor` / `MaterialDescriptor` descriptor
|
|
6
|
+
* into Three.js geometry/material. Both the runtime scene-loader and the editor's
|
|
7
|
+
* entity-factory import these, so the editor preview renders exactly what the game
|
|
8
|
+
* renders (the WYSIWYG guarantee). Previously these were
|
|
9
|
+
* copy-pasted in two places and had to be hand-synced — any new material feature
|
|
10
|
+
* added to one and not the other silently broke that guarantee.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare function createGeometry(mesh: MeshDescriptor): THREE.BufferGeometry;
|
|
14
|
+
export declare function createMaterial(mat?: MaterialDescriptor): THREE.Material;
|
|
15
|
+
//# sourceMappingURL=material-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-factory.d.ts","sourceRoot":"","sources":["../../src/render/material-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;GAQG;AAEH,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAwBzE;AAGD,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CA6JvE"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { loadTexture } from '../asset-loaders';
|
|
3
|
+
import { DEFAULTS } from '../defaults';
|
|
4
|
+
/**
|
|
5
|
+
* Single source of truth for turning a `MeshDescriptor` / `MaterialDescriptor` descriptor
|
|
6
|
+
* into Three.js geometry/material. Both the runtime scene-loader and the editor's
|
|
7
|
+
* entity-factory import these, so the editor preview renders exactly what the game
|
|
8
|
+
* renders (the WYSIWYG guarantee). Previously these were
|
|
9
|
+
* copy-pasted in two places and had to be hand-synced — any new material feature
|
|
10
|
+
* added to one and not the other silently broke that guarantee.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: straightforward type-based switch with fallback args
|
|
14
|
+
export function createGeometry(mesh) {
|
|
15
|
+
const args = mesh.args ?? [];
|
|
16
|
+
switch (mesh.type) {
|
|
17
|
+
case 'box':
|
|
18
|
+
return new THREE.BoxGeometry(args[0] ?? 1, args[1] ?? 1, args[2] ?? 1);
|
|
19
|
+
case 'sphere':
|
|
20
|
+
return new THREE.SphereGeometry(args[0] ?? 0.5, args[1] ?? 32, args[2] ?? 16);
|
|
21
|
+
case 'plane':
|
|
22
|
+
// args[2]/args[3] (width/height segments) matter for vertex-displacing
|
|
23
|
+
// materials (e.g. the Water shader) — they used to be silently dropped,
|
|
24
|
+
// which collapsed the water demo to a 2-triangle quad.
|
|
25
|
+
return new THREE.PlaneGeometry(args[0] ?? 1, args[1] ?? 1, args[2] ?? 1, args[3] ?? 1);
|
|
26
|
+
case 'cylinder':
|
|
27
|
+
return new THREE.CylinderGeometry(args[0] ?? 0.5, args[1] ?? 0.5, args[2] ?? 1, args[3] ?? 32);
|
|
28
|
+
case 'capsule':
|
|
29
|
+
return new THREE.CapsuleGeometry(args[0] ?? 0.5, args[1] ?? 1, args[2] ?? 4, args[3] ?? 16);
|
|
30
|
+
default:
|
|
31
|
+
return new THREE.BoxGeometry(1, 1, 1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: flat type-based switch building Three materials
|
|
35
|
+
export function createMaterial(mat) {
|
|
36
|
+
if (!mat)
|
|
37
|
+
return new THREE.MeshStandardMaterial({ color: DEFAULTS.material.color });
|
|
38
|
+
// Only include texture props when actually defined (Three.js warns on undefined values)
|
|
39
|
+
const textures = {};
|
|
40
|
+
if (mat.map)
|
|
41
|
+
textures.map = loadTexture(mat.map);
|
|
42
|
+
if (mat.normalMap)
|
|
43
|
+
textures.normalMap = loadTexture(mat.normalMap);
|
|
44
|
+
if (mat.emissiveMap)
|
|
45
|
+
textures.emissiveMap = loadTexture(mat.emissiveMap);
|
|
46
|
+
if (mat.aoMap)
|
|
47
|
+
textures.aoMap = loadTexture(mat.aoMap);
|
|
48
|
+
if (mat.lightMap)
|
|
49
|
+
textures.lightMap = loadTexture(mat.lightMap);
|
|
50
|
+
if (mat.roughnessMap)
|
|
51
|
+
textures.roughnessMap = loadTexture(mat.roughnessMap);
|
|
52
|
+
if (mat.metalnessMap)
|
|
53
|
+
textures.metalnessMap = loadTexture(mat.metalnessMap);
|
|
54
|
+
// R1c — every fallback below reads DEFAULTS.material.* instead of
|
|
55
|
+
// duplicating its value as a bare literal, so DEFAULTS stays the single
|
|
56
|
+
// source of truth for what an omitted field renders as (see
|
|
57
|
+
// defaults-out-of-scope-consistency.test.ts / material-factory.test.ts's
|
|
58
|
+
// "omitted-field" locks, which fail if either copy drifts from the other).
|
|
59
|
+
const dMat = DEFAULTS.material;
|
|
60
|
+
const sideValue = mat.side ?? dMat.side;
|
|
61
|
+
const side = sideValue === 'back'
|
|
62
|
+
? THREE.BackSide
|
|
63
|
+
: sideValue === 'double'
|
|
64
|
+
? THREE.DoubleSide
|
|
65
|
+
: THREE.FrontSide;
|
|
66
|
+
const opacity = mat.opacity ?? dMat.opacity;
|
|
67
|
+
const transparent = mat.transparent ?? dMat.transparent;
|
|
68
|
+
switch (mat.type) {
|
|
69
|
+
case 'basic':
|
|
70
|
+
return new THREE.MeshBasicMaterial({
|
|
71
|
+
color: mat.color ?? dMat.color,
|
|
72
|
+
...textures,
|
|
73
|
+
lightMapIntensity: mat.lightMapIntensity ?? 1,
|
|
74
|
+
opacity,
|
|
75
|
+
transparent,
|
|
76
|
+
side,
|
|
77
|
+
});
|
|
78
|
+
case 'toon':
|
|
79
|
+
return new THREE.MeshToonMaterial({
|
|
80
|
+
color: mat.color ?? dMat.color,
|
|
81
|
+
...textures,
|
|
82
|
+
lightMapIntensity: mat.lightMapIntensity ?? 1,
|
|
83
|
+
emissive: mat.emissive ?? dMat.emissive,
|
|
84
|
+
emissiveIntensity: mat.emissiveIntensity ?? dMat.emissiveIntensity,
|
|
85
|
+
opacity,
|
|
86
|
+
transparent,
|
|
87
|
+
side,
|
|
88
|
+
});
|
|
89
|
+
case 'physical':
|
|
90
|
+
return new THREE.MeshPhysicalMaterial({
|
|
91
|
+
color: mat.color ?? dMat.color,
|
|
92
|
+
metalness: mat.metalness ?? dMat.metalness,
|
|
93
|
+
roughness: mat.roughness ?? dMat.roughness,
|
|
94
|
+
...textures,
|
|
95
|
+
lightMapIntensity: mat.lightMapIntensity ?? 1,
|
|
96
|
+
emissive: mat.emissive ?? dMat.emissive,
|
|
97
|
+
emissiveIntensity: mat.emissiveIntensity ?? dMat.emissiveIntensity,
|
|
98
|
+
opacity,
|
|
99
|
+
transparent,
|
|
100
|
+
side,
|
|
101
|
+
flatShading: mat.flatShading ?? dMat.flatShading,
|
|
102
|
+
// Clearcoat
|
|
103
|
+
...(mat.clearcoat
|
|
104
|
+
? {
|
|
105
|
+
clearcoat: mat.clearcoat.clearcoat,
|
|
106
|
+
clearcoatRoughness: mat.clearcoat.clearcoatRoughness ?? dMat.clearcoat.clearcoatRoughness,
|
|
107
|
+
...(mat.clearcoat.clearcoatMap
|
|
108
|
+
? { clearcoatMap: loadTexture(mat.clearcoat.clearcoatMap) }
|
|
109
|
+
: {}),
|
|
110
|
+
...(mat.clearcoat.clearcoatRoughnessMap
|
|
111
|
+
? { clearcoatRoughnessMap: loadTexture(mat.clearcoat.clearcoatRoughnessMap) }
|
|
112
|
+
: {}),
|
|
113
|
+
}
|
|
114
|
+
: {}),
|
|
115
|
+
// Transmission — `thickness` used to hardcode a literal `0` here,
|
|
116
|
+
// silently diverging from DEFAULTS.material.transmission.thickness
|
|
117
|
+
// (0.5, per the editor's Transmission inspector default). Fixed:
|
|
118
|
+
// read DEFAULTS directly, like every other fallback in this file.
|
|
119
|
+
...(mat.transmission
|
|
120
|
+
? {
|
|
121
|
+
transmission: mat.transmission.transmission,
|
|
122
|
+
ior: mat.transmission.ior ?? dMat.transmission.ior,
|
|
123
|
+
thickness: mat.transmission.thickness ?? dMat.transmission.thickness,
|
|
124
|
+
...(mat.transmission.attenuationColor
|
|
125
|
+
? { attenuationColor: new THREE.Color(mat.transmission.attenuationColor) }
|
|
126
|
+
: {}),
|
|
127
|
+
attenuationDistance: mat.transmission.attenuationDistance ?? Infinity,
|
|
128
|
+
...(mat.transmission.transmissionMap
|
|
129
|
+
? { transmissionMap: loadTexture(mat.transmission.transmissionMap) }
|
|
130
|
+
: {}),
|
|
131
|
+
}
|
|
132
|
+
: {}),
|
|
133
|
+
// Sheen
|
|
134
|
+
...(mat.sheen
|
|
135
|
+
? {
|
|
136
|
+
sheen: mat.sheen.sheen,
|
|
137
|
+
sheenColor: new THREE.Color(mat.sheen.sheenColor ?? dMat.sheen.sheenColor),
|
|
138
|
+
sheenRoughness: mat.sheen.sheenRoughness ?? dMat.sheen.sheenRoughness,
|
|
139
|
+
...(mat.sheen.sheenColorMap
|
|
140
|
+
? { sheenColorMap: loadTexture(mat.sheen.sheenColorMap) }
|
|
141
|
+
: {}),
|
|
142
|
+
...(mat.sheen.sheenRoughnessMap
|
|
143
|
+
? { sheenRoughnessMap: loadTexture(mat.sheen.sheenRoughnessMap) }
|
|
144
|
+
: {}),
|
|
145
|
+
}
|
|
146
|
+
: {}),
|
|
147
|
+
// Iridescence
|
|
148
|
+
...(mat.iridescence
|
|
149
|
+
? {
|
|
150
|
+
iridescence: mat.iridescence.iridescence,
|
|
151
|
+
iridescenceIOR: mat.iridescence.iridescenceIOR ?? dMat.iridescence.iridescenceIOR,
|
|
152
|
+
iridescenceThicknessRange: mat.iridescence.iridescenceThicknessRange ??
|
|
153
|
+
dMat.iridescence.iridescenceThicknessRange,
|
|
154
|
+
...(mat.iridescence.iridescenceMap
|
|
155
|
+
? { iridescenceMap: loadTexture(mat.iridescence.iridescenceMap) }
|
|
156
|
+
: {}),
|
|
157
|
+
...(mat.iridescence.iridescenceThicknessMap
|
|
158
|
+
? {
|
|
159
|
+
iridescenceThicknessMap: loadTexture(mat.iridescence.iridescenceThicknessMap),
|
|
160
|
+
}
|
|
161
|
+
: {}),
|
|
162
|
+
}
|
|
163
|
+
: {}),
|
|
164
|
+
// Displacement
|
|
165
|
+
...(mat.displacementMap ? { displacementMap: loadTexture(mat.displacementMap) } : {}),
|
|
166
|
+
...(mat.displacementScale !== undefined
|
|
167
|
+
? { displacementScale: mat.displacementScale }
|
|
168
|
+
: {}),
|
|
169
|
+
...(mat.displacementBias !== undefined ? { displacementBias: mat.displacementBias } : {}),
|
|
170
|
+
});
|
|
171
|
+
default:
|
|
172
|
+
return new THREE.MeshStandardMaterial({
|
|
173
|
+
color: mat.color ?? dMat.color,
|
|
174
|
+
metalness: mat.metalness ?? dMat.metalness,
|
|
175
|
+
roughness: mat.roughness ?? dMat.roughness,
|
|
176
|
+
...textures,
|
|
177
|
+
lightMapIntensity: mat.lightMapIntensity ?? 1,
|
|
178
|
+
emissive: mat.emissive ?? dMat.emissive,
|
|
179
|
+
emissiveIntensity: mat.emissiveIntensity ?? dMat.emissiveIntensity,
|
|
180
|
+
opacity,
|
|
181
|
+
transparent,
|
|
182
|
+
side,
|
|
183
|
+
flatShading: mat.flatShading ?? dMat.flatShading,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Apply the authored mesh-shadow contract to every renderable in a model.
|
|
4
|
+
*
|
|
5
|
+
* Primitive scene entities contain one Mesh, while glTF entities usually
|
|
6
|
+
* contain a Group with many Mesh/SkinnedMesh descendants. Keeping this walk
|
|
7
|
+
* shared prevents editor preview and runtime Play from disagreeing by source
|
|
8
|
+
* format.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setMeshShadowEnabled(root: THREE.Object3D, enabled: boolean | undefined): void;
|
|
11
|
+
//# sourceMappingURL=mesh-shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-shadow.d.ts","sourceRoot":"","sources":["../../src/render/mesh-shadow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAO7F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Apply the authored mesh-shadow contract to every renderable in a model.
|
|
4
|
+
*
|
|
5
|
+
* Primitive scene entities contain one Mesh, while glTF entities usually
|
|
6
|
+
* contain a Group with many Mesh/SkinnedMesh descendants. Keeping this walk
|
|
7
|
+
* shared prevents editor preview and runtime Play from disagreeing by source
|
|
8
|
+
* format.
|
|
9
|
+
*/
|
|
10
|
+
export function setMeshShadowEnabled(root, enabled) {
|
|
11
|
+
if (enabled === undefined)
|
|
12
|
+
return;
|
|
13
|
+
root.traverse((object) => {
|
|
14
|
+
if (!(object instanceof THREE.Mesh))
|
|
15
|
+
return;
|
|
16
|
+
object.castShadow = enabled;
|
|
17
|
+
object.receiveShadow = enabled;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts ParticlesDescriptor JSON → three.quarks ParticleSystem.
|
|
3
|
+
*
|
|
4
|
+
* Shared between the editor entity-factory and the runtime scene-loader.
|
|
5
|
+
* The schema mirrors quarks' native JSON format, so most fields pass through
|
|
6
|
+
* directly to quarks' fromJSON or constructor methods.
|
|
7
|
+
*/
|
|
8
|
+
import { type EmitterShape } from 'quarks.core';
|
|
9
|
+
import * as THREE from 'three';
|
|
10
|
+
import { type BatchedRenderer, ParticleSystem } from 'three.quarks';
|
|
11
|
+
import type { ParticlesDescriptor } from '../asset-formats/particles';
|
|
12
|
+
export interface ParticleSystemResult {
|
|
13
|
+
/** The emitter Object3D (add to scene for transform) */
|
|
14
|
+
emitter: THREE.Object3D;
|
|
15
|
+
/** The ParticleSystem instance (register with BatchedRenderer) */
|
|
16
|
+
system: ParticleSystem;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The non-JSON companion to a {@link ParticlesDescriptor} — the runtime objects
|
|
20
|
+
* a JSON document cannot carry, and an authoring toggle. Every field is
|
|
21
|
+
* optional and the whole argument is optional, so existing single-argument
|
|
22
|
+
* callers (the editor entity-factory, the runtime scene-loader) are unchanged.
|
|
23
|
+
*
|
|
24
|
+
* This is how a caller with fidelity a plain descriptor cannot express reaches
|
|
25
|
+
* the SAME factory instead of hand-building its own `new ParticleSystem(...)`:
|
|
26
|
+
* a foreign-engine carry (e.g. Godot CPUParticles) supplies its own
|
|
27
|
+
* `EmitterShape` and an instancing geometry here, and expresses everything
|
|
28
|
+
* else — lifecycle, start values, emission, behaviors, material — as descriptor
|
|
29
|
+
* JSON.
|
|
30
|
+
*/
|
|
31
|
+
export interface ParticleSystemObjects {
|
|
32
|
+
/**
|
|
33
|
+
* A pre-built emitter shape for a spawn distribution the JSON `shape` field
|
|
34
|
+
* cannot express (a `three.quarks` `EmitterShape` plugin instance). When
|
|
35
|
+
* present it REPLACES `data.shape`.
|
|
36
|
+
*/
|
|
37
|
+
shape?: EmitterShape;
|
|
38
|
+
/**
|
|
39
|
+
* The geometry instanced per particle in `RenderMode.Mesh`. A
|
|
40
|
+
* `BufferGeometry` is not JSON-serializable, so `renderMode: 'mesh'` requires
|
|
41
|
+
* the caller to resolve and pass it here.
|
|
42
|
+
*/
|
|
43
|
+
instancingGeometry?: THREE.BufferGeometry;
|
|
44
|
+
/**
|
|
45
|
+
* When the material has no texture `map`, the factory substitutes a soft
|
|
46
|
+
* radial default sprite so a freshly-authored billboard shows something.
|
|
47
|
+
* Pass `false` to keep the material's own (map-less) appearance — a faithful
|
|
48
|
+
* carry of a foreign engine whose particle draws a plain colored quad, and
|
|
49
|
+
* the way that carry avoids the default-sprite canvas entirely. Defaults to
|
|
50
|
+
* `true`.
|
|
51
|
+
*/
|
|
52
|
+
defaultSprite?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a three.quarks ParticleSystem from ParticlesDescriptor JSON data.
|
|
56
|
+
*
|
|
57
|
+
* `objects` carries the pieces a JSON descriptor cannot: a plugin emitter
|
|
58
|
+
* shape, a mesh-mode instancing geometry, and the default-sprite toggle. It is
|
|
59
|
+
* optional and additive — a call with only `data` behaves exactly as before.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createParticleSystemFromData(data: ParticlesDescriptor, objects?: ParticleSystemObjects): ParticleSystemResult;
|
|
62
|
+
/**
|
|
63
|
+
* Patch a RUNNING ParticleSystem in place from ParticlesDescriptor JSON — the
|
|
64
|
+
* editor's live-tune path (W1b). Unlike `createParticleSystemFromData`, this
|
|
65
|
+
* does NOT recreate the system: the particle pool, per-particle ages, and the
|
|
66
|
+
* emission clock all survive, so a curve-key drag reshapes the live emitter
|
|
67
|
+
* with no restart stutter.
|
|
68
|
+
*
|
|
69
|
+
* Covers the live-tunable subset: lifecycle scalars (duration/looping/
|
|
70
|
+
* prewarm), emitter shape, start-value generators, emission rates + bursts,
|
|
71
|
+
* and the behavior stack (behavior instances are rebuilt from JSON — quarks
|
|
72
|
+
* behaviors read their generators per-update, so existing particles pick the
|
|
73
|
+
* new curves up on the next frame).
|
|
74
|
+
*
|
|
75
|
+
* NOT covered (these change the render batch and must go through the normal
|
|
76
|
+
* teardown/rebuild path): material, renderMode, tiling/soft-particle render
|
|
77
|
+
* settings, worldSpace.
|
|
78
|
+
*/
|
|
79
|
+
export declare function applyParticlesDataLive(system: ParticleSystem, data: ParticlesDescriptor): void;
|
|
80
|
+
/**
|
|
81
|
+
* Scrub a ParticleSystem to an absolute time by deterministic re-simulation:
|
|
82
|
+
* restart, then advance in fixed steps to `time`, then pause. Used by the
|
|
83
|
+
* editor's emitter-transport time scrub. `update` is TS-private on
|
|
84
|
+
* ParticleSystem but is exactly what BatchedRenderer.update calls per system.
|
|
85
|
+
*/
|
|
86
|
+
export declare function scrubParticleSystemTo(system: ParticleSystem, time: number, step?: number): void;
|
|
87
|
+
/**
|
|
88
|
+
* Register a particle system with a BatchedRenderer.
|
|
89
|
+
*/
|
|
90
|
+
export declare function registerParticleSystem(batchedRenderer: BatchedRenderer, system: ParticleSystem): void;
|
|
91
|
+
/**
|
|
92
|
+
* Unregister a particle system from a BatchedRenderer.
|
|
93
|
+
*/
|
|
94
|
+
export declare function unregisterParticleSystem(batchedRenderer: BatchedRenderer, system: ParticleSystem): void;
|
|
95
|
+
/**
|
|
96
|
+
* Default particle data for creating a new particle emitter via AddSectionMenu.
|
|
97
|
+
*/
|
|
98
|
+
export declare function defaultParticlesData(): ParticlesDescriptor;
|
|
99
|
+
//# sourceMappingURL=particles-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"particles-factory.d.ts","sourceRoot":"","sources":["../../src/render/particles-factory.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EAQL,KAAK,YAAY,EAmBlB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,eAAe,EAAE,cAAc,EAAc,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAIV,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AAyNpC,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,kEAAkE;IAClE,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC;IAC1C;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AAEH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,oBAAoB,CA6DtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAsB9F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,IAAI,CAU/F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,cAAc,GACrB,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,cAAc,GACrB,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,mBAAmB,CA6B1D"}
|