@vgai/engine 0.5.0 → 0.5.2
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/package.json +1 -1
- package/schemas/engine-capabilities.json +4 -4
- package/schemas/vgai-game.schema.json +2 -2
- package/src/adapter/authoring.ts +42 -0
- package/src/adapter/index.ts +3 -0
- package/src/adapter/ingest/overlay-apply.ts +50 -6
- package/src/adapter/ingest/scene-capture.ts +51 -2
- package/src/adapter/vgai-scene-game-adapter.ts +24 -0
- package/src/manifest/schema.ts +7 -3
- package/src/runtime/create-runtime.ts +97 -0
- package/src/runtime/game.ts +11 -1
- package/src/scene/asset-ref-check.ts +1 -1
- package/src/scene/scene-loader.ts +2 -2
- package/src/scene/user-data.ts +18 -0
- package/src/world3d-react/behavior.tsx +19 -11
- package/src/world3d-react/r3f-adapter.tsx +8 -0
- package/dist/adapter/adapter-surface.d.ts +0 -30
- package/dist/adapter/adapter-surface.d.ts.map +0 -1
- package/dist/adapter/adapter-surface.js +0 -18
- package/dist/adapter/authoring.d.ts +0 -461
- package/dist/adapter/authoring.d.ts.map +0 -1
- package/dist/adapter/authoring.js +0 -22
- package/dist/adapter/colyseus-networking-adapter.d.ts +0 -43
- package/dist/adapter/colyseus-networking-adapter.d.ts.map +0 -1
- package/dist/adapter/colyseus-networking-adapter.js +0 -38
- package/dist/adapter/first-party-systems.d.ts +0 -38
- package/dist/adapter/first-party-systems.d.ts.map +0 -1
- package/dist/adapter/first-party-systems.js +0 -77
- package/dist/adapter/game-adapter.d.ts +0 -133
- package/dist/adapter/game-adapter.d.ts.map +0 -1
- package/dist/adapter/game-adapter.js +0 -10
- package/dist/adapter/host-context.d.ts +0 -71
- package/dist/adapter/host-context.d.ts.map +0 -1
- package/dist/adapter/host-context.js +0 -16
- package/dist/adapter/index.d.ts +0 -22
- package/dist/adapter/index.d.ts.map +0 -1
- package/dist/adapter/index.js +0 -15
- package/dist/adapter/ingest/game-contract.d.ts +0 -53
- package/dist/adapter/ingest/game-contract.d.ts.map +0 -1
- package/dist/adapter/ingest/game-contract.js +0 -30
- package/dist/adapter/ingest/overlay-applier.d.ts +0 -118
- package/dist/adapter/ingest/overlay-applier.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-applier.js +0 -132
- package/dist/adapter/ingest/overlay-apply.d.ts +0 -60
- package/dist/adapter/ingest/overlay-apply.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-apply.js +0 -101
- package/dist/adapter/ingest/overlay-file.d.ts +0 -79
- package/dist/adapter/ingest/overlay-file.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-file.js +0 -66
- package/dist/adapter/ingest/overlay-report.d.ts +0 -113
- package/dist/adapter/ingest/overlay-report.d.ts.map +0 -1
- package/dist/adapter/ingest/overlay-report.js +0 -103
- package/dist/adapter/ingest/scene-capture.d.ts +0 -97
- package/dist/adapter/ingest/scene-capture.d.ts.map +0 -1
- package/dist/adapter/ingest/scene-capture.js +0 -248
- package/dist/adapter/ingest/upstream-pin.d.ts +0 -47
- package/dist/adapter/ingest/upstream-pin.d.ts.map +0 -1
- package/dist/adapter/ingest/upstream-pin.js +0 -50
- package/dist/adapter/loop-gate-report.d.ts +0 -34
- package/dist/adapter/loop-gate-report.d.ts.map +0 -1
- package/dist/adapter/loop-gate-report.js +0 -37
- package/dist/adapter/rapier-physics-adapter.d.ts +0 -12
- package/dist/adapter/rapier-physics-adapter.d.ts.map +0 -1
- package/dist/adapter/rapier-physics-adapter.js +0 -46
- package/dist/adapter/system-adapter.d.ts +0 -206
- package/dist/adapter/system-adapter.d.ts.map +0 -1
- package/dist/adapter/system-adapter.js +0 -13
- package/dist/adapter/transform.d.ts +0 -18
- package/dist/adapter/transform.d.ts.map +0 -1
- package/dist/adapter/transform.js +0 -1
- package/dist/adapter/vgai-scene-game-adapter.d.ts +0 -108
- package/dist/adapter/vgai-scene-game-adapter.d.ts.map +0 -1
- package/dist/adapter/vgai-scene-game-adapter.js +0 -762
- package/dist/ai/navigation.d.ts +0 -64
- package/dist/ai/navigation.d.ts.map +0 -1
- package/dist/ai/navigation.js +0 -133
- package/dist/animation/anim-graph-types.d.ts +0 -25
- package/dist/animation/anim-graph-types.d.ts.map +0 -1
- package/dist/animation/anim-graph-types.js +0 -1
- package/dist/animation/animation-clock.d.ts +0 -213
- package/dist/animation/animation-clock.d.ts.map +0 -1
- package/dist/animation/animation-clock.js +0 -301
- package/dist/animation/blend-node.d.ts +0 -22
- package/dist/animation/blend-node.d.ts.map +0 -1
- package/dist/animation/blend-node.js +0 -97
- package/dist/animation/camera-ownership.d.ts +0 -250
- package/dist/animation/camera-ownership.d.ts.map +0 -1
- package/dist/animation/camera-ownership.js +0 -169
- package/dist/animation/cinematic-cues.d.ts +0 -200
- package/dist/animation/cinematic-cues.d.ts.map +0 -1
- package/dist/animation/cinematic-cues.js +0 -213
- package/dist/animation/clip-map.d.ts +0 -12
- package/dist/animation/clip-map.d.ts.map +0 -1
- package/dist/animation/clip-map.js +0 -37
- package/dist/animation/gsap-registration.d.ts +0 -119
- package/dist/animation/gsap-registration.d.ts.map +0 -1
- package/dist/animation/gsap-registration.js +0 -92
- package/dist/animation/theatre-clock-binding.d.ts +0 -89
- package/dist/animation/theatre-clock-binding.d.ts.map +0 -1
- package/dist/animation/theatre-clock-binding.js +0 -29
- package/dist/animation/theatre-director.d.ts +0 -242
- package/dist/animation/theatre-director.d.ts.map +0 -1
- package/dist/animation/theatre-director.js +0 -235
- package/dist/animation/theatre-object-binding.d.ts +0 -305
- package/dist/animation/theatre-object-binding.d.ts.map +0 -1
- package/dist/animation/theatre-object-binding.js +0 -351
- package/dist/animation/xstate-animation-binding.d.ts +0 -56
- package/dist/animation/xstate-animation-binding.d.ts.map +0 -1
- package/dist/animation/xstate-animation-binding.js +0 -331
- package/dist/animation/xstate-animation-meta.d.ts +0 -266
- package/dist/animation/xstate-animation-meta.d.ts.map +0 -1
- package/dist/animation/xstate-animation-meta.js +0 -252
- package/dist/assets.d.ts +0 -26
- package/dist/assets.d.ts.map +0 -1
- package/dist/assets.js +0 -55
- package/dist/audio/index.d.ts +0 -4
- package/dist/audio/index.d.ts.map +0 -1
- package/dist/audio/index.js +0 -24
- package/dist/audio/tone-clock-binding.d.ts +0 -75
- package/dist/audio/tone-clock-binding.d.ts.map +0 -1
- package/dist/audio/tone-clock-binding.js +0 -29
- package/dist/audio/tone-context.d.ts +0 -114
- package/dist/audio/tone-context.d.ts.map +0 -1
- package/dist/audio/tone-context.js +0 -39
- package/dist/audio/tone-offline-render.d.ts +0 -90
- package/dist/audio/tone-offline-render.d.ts.map +0 -1
- package/dist/audio/tone-offline-render.js +0 -56
- package/dist/audio/wav-encode.d.ts +0 -38
- package/dist/audio/wav-encode.d.ts.map +0 -1
- package/dist/audio/wav-encode.js +0 -97
- package/dist/character/cloth-sim.d.ts +0 -179
- package/dist/character/cloth-sim.d.ts.map +0 -1
- package/dist/character/cloth-sim.js +0 -334
- package/dist/character/spring-chain.d.ts +0 -135
- package/dist/character/spring-chain.d.ts.map +0 -1
- package/dist/character/spring-chain.js +0 -165
- package/dist/core/game-loop.d.ts +0 -42
- package/dist/core/game-loop.d.ts.map +0 -1
- package/dist/core/game-loop.js +0 -167
- package/dist/core/seeded-random.d.ts +0 -69
- package/dist/core/seeded-random.d.ts.map +0 -1
- package/dist/core/seeded-random.js +0 -121
- package/dist/core/system-runner.d.ts +0 -120
- package/dist/core/system-runner.d.ts.map +0 -1
- package/dist/core/system-runner.js +0 -297
- package/dist/core/types.d.ts +0 -92
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -25
- package/dist/data/data-asset.d.ts +0 -101
- package/dist/data/data-asset.d.ts.map +0 -1
- package/dist/data/data-asset.js +0 -122
- package/dist/data/data-check-core.d.ts +0 -110
- package/dist/data/data-check-core.d.ts.map +0 -1
- package/dist/data/data-check-core.js +0 -178
- package/dist/data/data-ref.d.ts +0 -79
- package/dist/data/data-ref.d.ts.map +0 -1
- package/dist/data/data-ref.js +0 -130
- package/dist/data/vite-plugin-data.d.ts +0 -79
- package/dist/data/vite-plugin-data.d.ts.map +0 -1
- package/dist/data/vite-plugin-data.js +0 -217
- package/dist/dev/console-bridge.d.ts +0 -22
- package/dist/dev/console-bridge.d.ts.map +0 -1
- package/dist/dev/console-bridge.js +0 -71
- package/dist/dev/debug-draw.d.ts +0 -24
- package/dist/dev/debug-draw.d.ts.map +0 -1
- package/dist/dev/debug-draw.js +0 -73
- package/dist/dev/logger.d.ts +0 -30
- package/dist/dev/logger.d.ts.map +0 -1
- package/dist/dev/logger.js +0 -90
- package/dist/dev/performance-profiler.d.ts +0 -60
- package/dist/dev/performance-profiler.d.ts.map +0 -1
- package/dist/dev/performance-profiler.js +0 -181
- package/dist/dev/webgl-gpu-timer.d.ts +0 -8
- package/dist/dev/webgl-gpu-timer.d.ts.map +0 -1
- package/dist/dev/webgl-gpu-timer.js +0 -52
- package/dist/ecs/component-manager.d.ts +0 -205
- package/dist/ecs/component-manager.d.ts.map +0 -1
- package/dist/ecs/component-manager.js +0 -706
- package/dist/ecs/game-component.d.ts +0 -146
- package/dist/ecs/game-component.d.ts.map +0 -1
- package/dist/ecs/game-component.js +0 -141
- package/dist/ecs/hmr-swap-report.d.ts +0 -53
- package/dist/ecs/hmr-swap-report.d.ts.map +0 -1
- package/dist/ecs/hmr-swap-report.js +0 -55
- package/dist/humanoid/bake.operation.d.ts +0 -119
- package/dist/humanoid/bake.operation.d.ts.map +0 -1
- package/dist/humanoid/bake.operation.js +0 -228
- package/dist/humanoid/body.d.ts +0 -101
- package/dist/humanoid/body.d.ts.map +0 -1
- package/dist/humanoid/body.js +0 -530
- package/dist/humanoid/clips.d.ts +0 -62
- package/dist/humanoid/clips.d.ts.map +0 -1
- package/dist/humanoid/clips.js +0 -121
- package/dist/humanoid/compose.d.ts +0 -75
- package/dist/humanoid/compose.d.ts.map +0 -1
- package/dist/humanoid/compose.js +0 -176
- package/dist/humanoid/generate.d.ts +0 -92
- package/dist/humanoid/generate.d.ts.map +0 -1
- package/dist/humanoid/generate.js +0 -124
- package/dist/humanoid/index.d.ts +0 -24
- package/dist/humanoid/index.d.ts.map +0 -1
- package/dist/humanoid/index.js +0 -18
- package/dist/humanoid/schema.d.ts +0 -35
- package/dist/humanoid/schema.d.ts.map +0 -1
- package/dist/humanoid/schema.js +0 -87
- package/dist/humanoid/skeleton.d.ts +0 -103
- package/dist/humanoid/skeleton.d.ts.map +0 -1
- package/dist/humanoid/skeleton.js +0 -289
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -30
- package/dist/input/input-manager.d.ts +0 -945
- package/dist/input/input-manager.d.ts.map +0 -1
- package/dist/input/input-manager.js +0 -2207
- package/dist/input/input-types.d.ts +0 -174
- package/dist/input/input-types.d.ts.map +0 -1
- package/dist/input/input-types.js +0 -1
- package/dist/input/prompt-labels.d.ts +0 -21
- package/dist/input/prompt-labels.d.ts.map +0 -1
- package/dist/input/prompt-labels.js +0 -121
- package/dist/input/rebind-controller.d.ts +0 -59
- package/dist/input/rebind-controller.d.ts.map +0 -1
- package/dist/input/rebind-controller.js +0 -85
- package/dist/input/schema.d.ts +0 -16
- package/dist/input/schema.d.ts.map +0 -1
- package/dist/input/schema.js +0 -228
- package/dist/loader.d.ts +0 -43
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -59
- package/dist/manifest/index.d.ts +0 -5
- package/dist/manifest/index.d.ts.map +0 -1
- package/dist/manifest/index.js +0 -8
- package/dist/manifest/load-file.d.ts +0 -4
- package/dist/manifest/load-file.d.ts.map +0 -1
- package/dist/manifest/load-file.js +0 -14
- package/dist/manifest/load.d.ts +0 -144
- package/dist/manifest/load.d.ts.map +0 -1
- package/dist/manifest/load.js +0 -273
- package/dist/manifest/schema.d.ts +0 -230
- package/dist/manifest/schema.d.ts.map +0 -1
- package/dist/manifest/schema.js +0 -394
- package/dist/physics/collision-system.d.ts +0 -41
- package/dist/physics/collision-system.d.ts.map +0 -1
- package/dist/physics/collision-system.js +0 -64
- package/dist/physics/physics-registry.d.ts +0 -45
- package/dist/physics/physics-registry.d.ts.map +0 -1
- package/dist/physics/physics-registry.js +0 -65
- package/dist/physics/transform-writer.d.ts +0 -16
- package/dist/physics/transform-writer.d.ts.map +0 -1
- package/dist/physics/transform-writer.js +0 -38
- package/dist/physics/trigger-dispatch.d.ts +0 -24
- package/dist/physics/trigger-dispatch.d.ts.map +0 -1
- package/dist/physics/trigger-dispatch.js +0 -80
- package/dist/react/game-state.d.ts +0 -156
- package/dist/react/game-state.d.ts.map +0 -1
- package/dist/react/game-state.js +0 -222
- package/dist/react/root-adapter.d.ts +0 -11
- package/dist/react/root-adapter.d.ts.map +0 -1
- package/dist/react/root-adapter.js +0 -41
- package/dist/react/unmanaged-root-detector.d.ts +0 -12
- package/dist/react/unmanaged-root-detector.d.ts.map +0 -1
- package/dist/react/unmanaged-root-detector.js +0 -45
- package/dist/react/use-data.d.ts +0 -60
- package/dist/react/use-data.d.ts.map +0 -1
- package/dist/react/use-data.js +0 -101
- package/dist/react/use-selection.d.ts +0 -75
- package/dist/react/use-selection.d.ts.map +0 -1
- package/dist/react/use-selection.js +0 -90
- package/dist/render/auto-batcher.d.ts +0 -34
- package/dist/render/auto-batcher.d.ts.map +0 -1
- package/dist/render/auto-batcher.js +0 -140
- package/dist/render/render-batch-system.d.ts +0 -33
- package/dist/render/render-batch-system.d.ts.map +0 -1
- package/dist/render/render-batch-system.js +0 -230
- package/dist/render/render-features.d.ts +0 -47
- package/dist/render/render-features.d.ts.map +0 -1
- package/dist/render/render-features.js +0 -105
- package/dist/render/render-settings.d.ts +0 -36
- package/dist/render/render-settings.d.ts.map +0 -1
- package/dist/render/render-settings.js +0 -51
- package/dist/runtime/create-runtime.d.ts +0 -249
- package/dist/runtime/create-runtime.d.ts.map +0 -1
- package/dist/runtime/create-runtime.js +0 -641
- package/dist/runtime/debug-bridge.d.ts +0 -257
- package/dist/runtime/debug-bridge.d.ts.map +0 -1
- package/dist/runtime/debug-bridge.js +0 -224
- package/dist/runtime/debug-registry.d.ts +0 -288
- package/dist/runtime/debug-registry.d.ts.map +0 -1
- package/dist/runtime/debug-registry.js +0 -513
- package/dist/runtime/frame-selector-cache.d.ts +0 -41
- package/dist/runtime/frame-selector-cache.d.ts.map +0 -1
- package/dist/runtime/frame-selector-cache.js +0 -65
- package/dist/runtime/game.d.ts +0 -496
- package/dist/runtime/game.d.ts.map +0 -1
- package/dist/runtime/game.js +0 -741
- package/dist/runtime/gameplay-rng-trap.d.ts +0 -48
- package/dist/runtime/gameplay-rng-trap.d.ts.map +0 -1
- package/dist/runtime/gameplay-rng-trap.js +0 -96
- package/dist/runtime/input-router.d.ts +0 -78
- package/dist/runtime/input-router.d.ts.map +0 -1
- package/dist/runtime/input-router.js +0 -171
- package/dist/runtime/mount-game.d.ts +0 -129
- package/dist/runtime/mount-game.d.ts.map +0 -1
- package/dist/runtime/mount-game.js +0 -152
- package/dist/runtime/mount-manifest.d.ts +0 -173
- package/dist/runtime/mount-manifest.d.ts.map +0 -1
- package/dist/runtime/mount-manifest.js +0 -297
- package/dist/runtime/render-audio-control.d.ts +0 -110
- package/dist/runtime/render-audio-control.d.ts.map +0 -1
- package/dist/runtime/render-audio-control.js +0 -111
- package/dist/runtime/render-control.d.ts +0 -291
- package/dist/runtime/render-control.d.ts.map +0 -1
- package/dist/runtime/render-control.js +0 -264
- package/dist/runtime/render-seed.d.ts +0 -57
- package/dist/runtime/render-seed.d.ts.map +0 -1
- package/dist/runtime/render-seed.js +0 -74
- package/dist/runtime/state-bridge.d.ts +0 -61
- package/dist/runtime/state-bridge.d.ts.map +0 -1
- package/dist/runtime/state-bridge.js +0 -63
- package/dist/runtime/types.d.ts +0 -253
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/types.js +0 -1
- package/dist/scene/asset-loaders.d.ts +0 -79
- package/dist/scene/asset-loaders.d.ts.map +0 -1
- package/dist/scene/asset-loaders.js +0 -141
- package/dist/scene/asset-paths.d.ts +0 -11
- package/dist/scene/asset-paths.d.ts.map +0 -1
- package/dist/scene/asset-paths.js +0 -108
- package/dist/scene/asset-ref-check.d.ts +0 -88
- package/dist/scene/asset-ref-check.d.ts.map +0 -1
- package/dist/scene/asset-ref-check.js +0 -214
- package/dist/scene/asset-registry.d.ts +0 -38
- package/dist/scene/asset-registry.d.ts.map +0 -1
- package/dist/scene/asset-registry.js +0 -66
- package/dist/scene/collider-dimensions.d.ts +0 -63
- package/dist/scene/collider-dimensions.d.ts.map +0 -1
- package/dist/scene/collider-dimensions.js +0 -98
- package/dist/scene/component-registry.d.ts +0 -22
- package/dist/scene/component-registry.d.ts.map +0 -1
- package/dist/scene/component-registry.js +0 -37
- package/dist/scene/defaults.d.ts +0 -252
- package/dist/scene/defaults.d.ts.map +0 -1
- package/dist/scene/defaults.js +0 -151
- package/dist/scene/geometries/index.d.ts +0 -8
- package/dist/scene/geometries/index.d.ts.map +0 -1
- package/dist/scene/geometries/index.js +0 -7
- package/dist/scene/geometries/terrain.d.ts +0 -2
- package/dist/scene/geometries/terrain.d.ts.map +0 -1
- package/dist/scene/geometries/terrain.js +0 -37
- package/dist/scene/geometry-registry.d.ts +0 -24
- package/dist/scene/geometry-registry.d.ts.map +0 -1
- package/dist/scene/geometry-registry.js +0 -20
- package/dist/scene/instance-registry.d.ts +0 -36
- package/dist/scene/instance-registry.d.ts.map +0 -1
- package/dist/scene/instance-registry.js +0 -55
- package/dist/scene/instancers/grid.d.ts +0 -2
- package/dist/scene/instancers/grid.d.ts.map +0 -1
- package/dist/scene/instancers/grid.js +0 -36
- package/dist/scene/instancers/index.d.ts +0 -8
- package/dist/scene/instancers/index.d.ts.map +0 -1
- package/dist/scene/instancers/index.js +0 -7
- package/dist/scene/light-camera-factory.d.ts +0 -23
- package/dist/scene/light-camera-factory.d.ts.map +0 -1
- package/dist/scene/light-camera-factory.js +0 -68
- package/dist/scene/material-factory.d.ts +0 -17
- package/dist/scene/material-factory.d.ts.map +0 -1
- package/dist/scene/material-factory.js +0 -197
- package/dist/scene/material-registry.d.ts +0 -40
- package/dist/scene/material-registry.d.ts.map +0 -1
- package/dist/scene/material-registry.js +0 -44
- package/dist/scene/materials/index.d.ts +0 -8
- package/dist/scene/materials/index.d.ts.map +0 -1
- package/dist/scene/materials/index.js +0 -7
- package/dist/scene/materials/water.d.ts +0 -2
- package/dist/scene/materials/water.d.ts.map +0 -1
- package/dist/scene/materials/water.js +0 -54
- package/dist/scene/parse.d.ts +0 -23
- package/dist/scene/parse.d.ts.map +0 -1
- package/dist/scene/parse.js +0 -179
- package/dist/scene/particles-factory.d.ts +0 -33
- package/dist/scene/particles-factory.d.ts.map +0 -1
- package/dist/scene/particles-factory.js +0 -282
- package/dist/scene/scene-apply.d.ts +0 -109
- package/dist/scene/scene-apply.d.ts.map +0 -1
- package/dist/scene/scene-apply.js +0 -370
- package/dist/scene/scene-diff-schema.d.ts +0 -285
- package/dist/scene/scene-diff-schema.d.ts.map +0 -1
- package/dist/scene/scene-diff-schema.js +0 -92
- package/dist/scene/scene-diff-types.d.ts +0 -40
- package/dist/scene/scene-diff-types.d.ts.map +0 -1
- package/dist/scene/scene-diff-types.js +0 -14
- package/dist/scene/scene-loader.d.ts +0 -167
- package/dist/scene/scene-loader.d.ts.map +0 -1
- package/dist/scene/scene-loader.js +0 -1211
- package/dist/scene/scene-query.d.ts +0 -11
- package/dist/scene/scene-query.d.ts.map +0 -1
- package/dist/scene/scene-query.js +0 -63
- package/dist/scene/scene-types.d.ts +0 -10
- package/dist/scene/scene-types.d.ts.map +0 -1
- package/dist/scene/scene-types.js +0 -8
- package/dist/scene/scene-version.d.ts +0 -26
- package/dist/scene/scene-version.d.ts.map +0 -1
- package/dist/scene/scene-version.js +0 -34
- package/dist/scene/schema/animation.d.ts +0 -8
- package/dist/scene/schema/animation.d.ts.map +0 -1
- package/dist/scene/schema/animation.js +0 -42
- package/dist/scene/schema/audio.d.ts +0 -13
- package/dist/scene/schema/audio.d.ts.map +0 -1
- package/dist/scene/schema/audio.js +0 -22
- package/dist/scene/schema/camera.d.ts +0 -28
- package/dist/scene/schema/camera.d.ts.map +0 -1
- package/dist/scene/schema/camera.js +0 -17
- package/dist/scene/schema/collider.d.ts +0 -40
- package/dist/scene/schema/collider.d.ts.map +0 -1
- package/dist/scene/schema/collider.js +0 -55
- package/dist/scene/schema/entity-ref.d.ts +0 -31
- package/dist/scene/schema/entity-ref.d.ts.map +0 -1
- package/dist/scene/schema/entity-ref.js +0 -61
- package/dist/scene/schema/entity.d.ts +0 -1036
- package/dist/scene/schema/entity.d.ts.map +0 -1
- package/dist/scene/schema/entity.js +0 -153
- package/dist/scene/schema/environment.d.ts +0 -425
- package/dist/scene/schema/environment.d.ts.map +0 -1
- package/dist/scene/schema/environment.js +0 -357
- package/dist/scene/schema/index.d.ts +0 -37
- package/dist/scene/schema/index.d.ts.map +0 -1
- package/dist/scene/schema/index.js +0 -19
- package/dist/scene/schema/instances.d.ts +0 -14
- package/dist/scene/schema/instances.d.ts.map +0 -1
- package/dist/scene/schema/instances.js +0 -28
- package/dist/scene/schema/joint.d.ts +0 -23
- package/dist/scene/schema/joint.d.ts.map +0 -1
- package/dist/scene/schema/joint.js +0 -23
- package/dist/scene/schema/light.d.ts +0 -38
- package/dist/scene/schema/light.d.ts.map +0 -1
- package/dist/scene/schema/light.js +0 -26
- package/dist/scene/schema/material.d.ts +0 -199
- package/dist/scene/schema/material.d.ts.map +0 -1
- package/dist/scene/schema/material.js +0 -103
- package/dist/scene/schema/mesh.d.ts +0 -48
- package/dist/scene/schema/mesh.d.ts.map +0 -1
- package/dist/scene/schema/mesh.js +0 -82
- package/dist/scene/schema/particles.d.ts +0 -2178
- package/dist/scene/schema/particles.d.ts.map +0 -1
- package/dist/scene/schema/particles.js +0 -321
- package/dist/scene/schema/physics.d.ts +0 -56
- package/dist/scene/schema/physics.d.ts.map +0 -1
- package/dist/scene/schema/physics.js +0 -37
- package/dist/scene/schema/scene-file.d.ts +0 -303
- package/dist/scene/schema/scene-file.d.ts.map +0 -1
- package/dist/scene/schema/scene-file.js +0 -256
- package/dist/scene/schema/shadow.d.ts +0 -28
- package/dist/scene/schema/shadow.d.ts.map +0 -1
- package/dist/scene/schema/shadow.js +0 -20
- package/dist/scene/schema/spline.d.ts +0 -25
- package/dist/scene/schema/spline.d.ts.map +0 -1
- package/dist/scene/schema/spline.js +0 -15
- package/dist/scene/schema/tuples.d.ts +0 -12
- package/dist/scene/schema/tuples.d.ts.map +0 -1
- package/dist/scene/schema/tuples.js +0 -14
- package/dist/scene/user-data.d.ts +0 -185
- package/dist/scene/user-data.d.ts.map +0 -1
- package/dist/scene/user-data.js +0 -144
- package/dist/setup/setup-audio.d.ts +0 -20
- package/dist/setup/setup-audio.d.ts.map +0 -1
- package/dist/setup/setup-audio.js +0 -41
- package/dist/setup/setup-particles.d.ts +0 -17
- package/dist/setup/setup-particles.d.ts.map +0 -1
- package/dist/setup/setup-particles.js +0 -16
- package/dist/setup/setup-physics.d.ts +0 -25
- package/dist/setup/setup-physics.d.ts.map +0 -1
- package/dist/setup/setup-physics.js +0 -51
- package/dist/setup/setup-renderer.d.ts +0 -69
- package/dist/setup/setup-renderer.d.ts.map +0 -1
- package/dist/setup/setup-renderer.js +0 -363
- package/dist/tools/define-tool.d.ts +0 -130
- package/dist/tools/define-tool.d.ts.map +0 -1
- package/dist/tools/define-tool.js +0 -96
- package/dist/world2d/authoring-2d.d.ts +0 -80
- package/dist/world2d/authoring-2d.d.ts.map +0 -1
- package/dist/world2d/authoring-2d.js +0 -195
- package/dist/world2d/capture-to-scene2d.d.ts +0 -5
- package/dist/world2d/capture-to-scene2d.d.ts.map +0 -1
- package/dist/world2d/capture-to-scene2d.js +0 -49
- package/dist/world2d/collision-2d.d.ts +0 -52
- package/dist/world2d/collision-2d.d.ts.map +0 -1
- package/dist/world2d/collision-2d.js +0 -70
- package/dist/world2d/components-2d.d.ts +0 -47
- package/dist/world2d/components-2d.d.ts.map +0 -1
- package/dist/world2d/components-2d.js +0 -77
- package/dist/world2d/index.d.ts +0 -34
- package/dist/world2d/index.d.ts.map +0 -1
- package/dist/world2d/index.js +0 -32
- package/dist/world2d/ingest-iframe-2d.d.ts +0 -82
- package/dist/world2d/ingest-iframe-2d.d.ts.map +0 -1
- package/dist/world2d/ingest-iframe-2d.js +0 -166
- package/dist/world2d/ingest2d.d.ts +0 -97
- package/dist/world2d/ingest2d.d.ts.map +0 -1
- package/dist/world2d/ingest2d.js +0 -40
- package/dist/world2d/physics2d-registry.d.ts +0 -24
- package/dist/world2d/physics2d-registry.d.ts.map +0 -1
- package/dist/world2d/physics2d-registry.js +0 -38
- package/dist/world2d/pixi-game-adapter.d.ts +0 -107
- package/dist/world2d/pixi-game-adapter.d.ts.map +0 -1
- package/dist/world2d/pixi-game-adapter.js +0 -210
- package/dist/world2d/pixi-surface.d.ts +0 -39
- package/dist/world2d/pixi-surface.d.ts.map +0 -1
- package/dist/world2d/pixi-surface.js +0 -47
- package/dist/world2d/scene-capture-2d.d.ts +0 -43
- package/dist/world2d/scene-capture-2d.d.ts.map +0 -1
- package/dist/world2d/scene-capture-2d.js +0 -92
- package/dist/world2d/scene2d-loader.d.ts +0 -27
- package/dist/world2d/scene2d-loader.d.ts.map +0 -1
- package/dist/world2d/scene2d-loader.js +0 -275
- package/dist/world2d/schema/entity2d.d.ts +0 -102
- package/dist/world2d/schema/entity2d.d.ts.map +0 -1
- package/dist/world2d/schema/entity2d.js +0 -119
- package/dist/world2d/schema/physics2d.d.ts +0 -46
- package/dist/world2d/schema/physics2d.d.ts.map +0 -1
- package/dist/world2d/schema/physics2d.js +0 -45
- package/dist/world2d/schema/sprite.d.ts +0 -42
- package/dist/world2d/schema/sprite.d.ts.map +0 -1
- package/dist/world2d/schema/sprite.js +0 -63
- package/dist/world2d/schema/tilemap.d.ts +0 -15
- package/dist/world2d/schema/tilemap.d.ts.map +0 -1
- package/dist/world2d/schema/tilemap.js +0 -19
- package/dist/world2d/schema/tuples2d.d.ts +0 -20
- package/dist/world2d/schema/tuples2d.d.ts.map +0 -1
- package/dist/world2d/schema/tuples2d.js +0 -19
- package/dist/world2d/system-adapters-2d.d.ts +0 -16
- package/dist/world2d/system-adapters-2d.d.ts.map +0 -1
- package/dist/world2d/system-adapters-2d.js +0 -37
- package/dist/world2d/transform-writer-2d.d.ts +0 -16
- package/dist/world2d/transform-writer-2d.d.ts.map +0 -1
- package/dist/world2d/transform-writer-2d.js +0 -22
- package/dist/world2d/types.d.ts +0 -59
- package/dist/world2d/types.d.ts.map +0 -1
- package/dist/world2d/types.js +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* world2d iframe ingest tiers — the PixiJS analogs of the 3D ingest-iframe adapters.
|
|
3
|
-
*
|
|
4
|
-
* - OPAQUE EMBED (tier 0-1): a prebuilt/self-contained bundle runs in a sandboxed
|
|
5
|
-
* iframe; hosted + sized + disposed, NOT introspectable.
|
|
6
|
-
* - IFRAME-REACHABLE (tier 2-3): a bundle runs in its own iframe realm, but its
|
|
7
|
-
* `import 'pixi.js'` is wired (via an importmap) to a blob module re-exporting the
|
|
8
|
-
* HOST's pixi instance, so every Application/Sprite it creates is a HOST-realm
|
|
9
|
-
* object → the host `Application.prototype.render` trap fires and capture works.
|
|
10
|
-
*/
|
|
11
|
-
import { type CapturedRuntime2D, type SceneCapture2DHandle } from './scene-capture-2d';
|
|
12
|
-
export interface EmbedMount2D {
|
|
13
|
-
iframe: HTMLIFrameElement;
|
|
14
|
-
dispose: () => void;
|
|
15
|
-
}
|
|
16
|
-
/** OPAQUE EMBED: sandboxed iframe, no scene introspection (tier 0-1). */
|
|
17
|
-
export declare function mountIngestGame2DEmbed(html: string, container: HTMLElement): EmbedMount2D;
|
|
18
|
-
export interface IframeReachableMultiOpts {
|
|
19
|
-
captureTimeoutMs?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Bare-specifier → host module-namespace map. MUST include the pixi.js instance the trap is
|
|
22
|
-
* installed on (passed separately as `pixiNamespace`); list the game's OTHER shared bare deps
|
|
23
|
-
* here (@pixi/sound, @pixi/ui, gsap, pixi-filters) so they resolve to host instances and their
|
|
24
|
-
* extension side-effects register on the host pixi (the trapped instance).
|
|
25
|
-
*/
|
|
26
|
-
extraDeps?: Record<string, Record<string, unknown>>;
|
|
27
|
-
/**
|
|
28
|
-
* D-Z3 (docs/WAVE3-ADAPTER-PLUMBING-DESIGN.md) — bare-specifier -> VERBATIM
|
|
29
|
-
* URL importmap entries (the project-node_modules fallback for a specifier
|
|
30
|
-
* that isn't in the host-namespace registry but IS installed in the open
|
|
31
|
-
* project's own `node_modules`). Written into the importmap DIRECTLY
|
|
32
|
-
* alongside the `extraDeps` blob-namespace entries — no host-side import,
|
|
33
|
-
* no blob wrapping, no decision logic here: this function just merges
|
|
34
|
-
* whatever `Record<specifier, url>` the caller (editor-side
|
|
35
|
-
* `host-namespace-registry.ts`) already decided. The URL's own transitive
|
|
36
|
-
* `import 'pixi.js'` resolves through this SAME importmap back to the host
|
|
37
|
-
* pixi trap (§0.3), keeping module identity converged without a second pixi
|
|
38
|
-
* instance.
|
|
39
|
-
*/
|
|
40
|
-
extraDepUrls?: Record<string, string>;
|
|
41
|
-
/** <base href> for the iframe so the game's relative asset URLs (Assets basePath) resolve. */
|
|
42
|
-
baseHref?: string;
|
|
43
|
-
/**
|
|
44
|
-
* HOST-SIDE asset URL remap (the Pixi analog of the three.js DefaultLoadingManager.setURLModifier
|
|
45
|
-
* asset adapter). A document.write iframe keeps the PARENT's window.location, so PixiJS's Assets
|
|
46
|
-
* resolver (which builds absolute URLs from window.location, not document.baseURI) would resolve
|
|
47
|
-
* the game's relative `basePath:'assets'` against the parent page. Wrapping the host pixi's
|
|
48
|
-
* Assets.init to force this ABSOLUTE basePath fixes resolution without touching the game source —
|
|
49
|
-
* pure host library configuration, restored on dispose.
|
|
50
|
-
*/
|
|
51
|
-
assetBaseUrl?: string;
|
|
52
|
-
/** Load the game bundle from this absolute URL (a built multi-file game). */
|
|
53
|
-
bundleUrl?: string;
|
|
54
|
-
/** …or run this inline module source (a single-file game). One of bundleUrl/inlineSrc required. */
|
|
55
|
-
inlineSrc?: string;
|
|
56
|
-
/** DOM the game expects to find before it boots (e.g. a `<div id="game-root">` it appends to). */
|
|
57
|
-
bodyHtml?: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* IFRAME-REACHABLE for REAL MULTI-FILE GAMES (cov2d-bundled-dedupe): run a built game bundle
|
|
61
|
-
* (its OWN unaltered source, externalized against pixi at build time) in its own iframe realm
|
|
62
|
-
* whose importmap maps EVERY shared bare dep — pixi.js + @pixi/sound/@pixi/ui/gsap/… — to the
|
|
63
|
-
* HOST instances, and (optionally) a <base href> so its AssetPack/manifest URLs resolve. The
|
|
64
|
-
* host `Application.prototype.render` trap then captures the live stage IN-REALM. The game's
|
|
65
|
-
* source is never touched; all of this is host-side wiring.
|
|
66
|
-
*/
|
|
67
|
-
export declare function mountIngestGame2DIframeReachableMulti(pixiNamespace: unknown, container: HTMLElement, opts: IframeReachableMultiOpts): Promise<IframeReachableMount2D>;
|
|
68
|
-
export interface IframeReachableMount2D {
|
|
69
|
-
iframe: HTMLIFrameElement;
|
|
70
|
-
capture: SceneCapture2DHandle;
|
|
71
|
-
captured: CapturedRuntime2D | null;
|
|
72
|
-
dispose: () => void;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* IFRAME-REACHABLE (tier 2-3): run `gameModuleSrc` in an iframe whose importmap maps
|
|
76
|
-
* `pixi.js` to a host-pixi re-export blob, and trap the host `Application.prototype`
|
|
77
|
-
* so the bundle's render is captured in-realm.
|
|
78
|
-
*/
|
|
79
|
-
export declare function mountIngestGame2DIframeReachable(pixiNamespace: unknown, gameModuleSrc: string, container: HTMLElement, opts?: {
|
|
80
|
-
captureTimeoutMs?: number;
|
|
81
|
-
}): Promise<IframeReachableMount2D>;
|
|
82
|
-
//# sourceMappingURL=ingest-iframe-2d.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-iframe-2d.d.ts","sourceRoot":"","sources":["../../src/world2d/ingest-iframe-2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,CASzF;AAsCD,MAAM,WAAW,wBAAwB;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAsB,qCAAqC,CACzD,aAAa,EAAE,OAAO,EACtB,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CA2EjC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,aAAa,EAAE,OAAO,EACtB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,WAAW,EACtB,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,OAAO,CAAC,sBAAsB,CAAC,CAqCjC"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* world2d iframe ingest tiers — the PixiJS analogs of the 3D ingest-iframe adapters.
|
|
3
|
-
*
|
|
4
|
-
* - OPAQUE EMBED (tier 0-1): a prebuilt/self-contained bundle runs in a sandboxed
|
|
5
|
-
* iframe; hosted + sized + disposed, NOT introspectable.
|
|
6
|
-
* - IFRAME-REACHABLE (tier 2-3): a bundle runs in its own iframe realm, but its
|
|
7
|
-
* `import 'pixi.js'` is wired (via an importmap) to a blob module re-exporting the
|
|
8
|
-
* HOST's pixi instance, so every Application/Sprite it creates is a HOST-realm
|
|
9
|
-
* object → the host `Application.prototype.render` trap fires and capture works.
|
|
10
|
-
*/
|
|
11
|
-
import { installSceneCapture2D, } from './scene-capture-2d';
|
|
12
|
-
/** OPAQUE EMBED: sandboxed iframe, no scene introspection (tier 0-1). */
|
|
13
|
-
export function mountIngestGame2DEmbed(html, container) {
|
|
14
|
-
const iframe = document.createElement('iframe');
|
|
15
|
-
iframe.setAttribute('sandbox', 'allow-scripts');
|
|
16
|
-
iframe.style.border = '0';
|
|
17
|
-
iframe.style.width = '100%';
|
|
18
|
-
iframe.style.height = '100%';
|
|
19
|
-
iframe.srcdoc = html;
|
|
20
|
-
container.appendChild(iframe);
|
|
21
|
-
return { iframe, dispose: () => iframe.remove() };
|
|
22
|
-
}
|
|
23
|
-
const HOST_PIXI_KEY = '__vgaiHostPixi';
|
|
24
|
-
/** Build a blob module that re-exports the host's pixi namespace (for the importmap). */
|
|
25
|
-
function makeHostPixiReexportUrl(pixiNamespace) {
|
|
26
|
-
window[HOST_PIXI_KEY] = pixiNamespace;
|
|
27
|
-
const ident = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
28
|
-
const keys = Object.keys(pixiNamespace).filter((k) => k !== 'default' && ident.test(k));
|
|
29
|
-
const body = `const T = window.parent[${JSON.stringify(HOST_PIXI_KEY)}];\n` +
|
|
30
|
-
`export default T;\n` +
|
|
31
|
-
keys.map((k) => `export const ${k} = T[${JSON.stringify(k)}];`).join('\n');
|
|
32
|
-
return URL.createObjectURL(new Blob([body], { type: 'text/javascript' }));
|
|
33
|
-
}
|
|
34
|
-
let _reexportKeySeq = 0;
|
|
35
|
-
/**
|
|
36
|
-
* Generalized host-namespace re-export (the multi-dep analog of {@link makeHostPixiReexportUrl}).
|
|
37
|
-
* Stashes `ns` (an ES module namespace object, e.g. `import * as ns from 'gsap'`) on a unique
|
|
38
|
-
* window key and builds a blob module re-exporting it, so the iframe's importmap can map a bare
|
|
39
|
-
* specifier (pixi.js, @pixi/sound, @pixi/ui, gsap, …) to the HOST's single instance. Default-export
|
|
40
|
-
* handling: `export default T.default ?? T` so `import gsap from 'gsap'` gets gsap, while a
|
|
41
|
-
* default-less namespace (pixi.js) re-exports the namespace itself for `import * as`.
|
|
42
|
-
*/
|
|
43
|
-
function makeHostNamespaceReexportUrl(ns) {
|
|
44
|
-
const key = `__vgaiHostNs_${_reexportKeySeq++}`;
|
|
45
|
-
window[key] = ns;
|
|
46
|
-
const ident = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
47
|
-
const keys = Object.keys(ns).filter((k) => k !== 'default' && ident.test(k));
|
|
48
|
-
const body = `const T = window.parent[${JSON.stringify(key)}];\n` +
|
|
49
|
-
`export default (T && T.default !== undefined ? T.default : T);\n` +
|
|
50
|
-
keys.map((k) => `export const ${k} = T[${JSON.stringify(k)}];`).join('\n');
|
|
51
|
-
return URL.createObjectURL(new Blob([body], { type: 'text/javascript' }));
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* IFRAME-REACHABLE for REAL MULTI-FILE GAMES (cov2d-bundled-dedupe): run a built game bundle
|
|
55
|
-
* (its OWN unaltered source, externalized against pixi at build time) in its own iframe realm
|
|
56
|
-
* whose importmap maps EVERY shared bare dep — pixi.js + @pixi/sound/@pixi/ui/gsap/… — to the
|
|
57
|
-
* HOST instances, and (optionally) a <base href> so its AssetPack/manifest URLs resolve. The
|
|
58
|
-
* host `Application.prototype.render` trap then captures the live stage IN-REALM. The game's
|
|
59
|
-
* source is never touched; all of this is host-side wiring.
|
|
60
|
-
*/
|
|
61
|
-
export async function mountIngestGame2DIframeReachableMulti(pixiNamespace, container, opts) {
|
|
62
|
-
const capture = installSceneCapture2D(pixiNamespace);
|
|
63
|
-
const created = [];
|
|
64
|
-
const mkUrl = (ns) => {
|
|
65
|
-
const u = makeHostNamespaceReexportUrl(ns);
|
|
66
|
-
created.push(u);
|
|
67
|
-
return u;
|
|
68
|
-
};
|
|
69
|
-
const imports = {
|
|
70
|
-
'pixi.js': mkUrl(pixiNamespace),
|
|
71
|
-
};
|
|
72
|
-
for (const [spec, ns] of Object.entries(opts.extraDeps ?? {}))
|
|
73
|
-
imports[spec] = mkUrl(ns);
|
|
74
|
-
// D-Z3 fallback: verbatim URL entries, no blob wrapping, merged in beside
|
|
75
|
-
// the host-namespace ones — decision-free (see `extraDepUrls`'s doc comment).
|
|
76
|
-
for (const [spec, url] of Object.entries(opts.extraDepUrls ?? {}))
|
|
77
|
-
imports[spec] = url;
|
|
78
|
-
// Host-side asset URL remap (asset adapter): force the game's Assets.init basePath to an
|
|
79
|
-
// absolute URL so its assets resolve to the served bundle dir, not the parent page path.
|
|
80
|
-
let restoreInit;
|
|
81
|
-
if (opts.assetBaseUrl) {
|
|
82
|
-
const assetsApi = pixiNamespace.Assets;
|
|
83
|
-
if (assetsApi?.init) {
|
|
84
|
-
const orig = assetsApi.init.bind(assetsApi);
|
|
85
|
-
assetsApi.init = (o = {}) => orig({ ...o, basePath: opts.assetBaseUrl });
|
|
86
|
-
restoreInit = () => {
|
|
87
|
-
assetsApi.init = orig;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const iframe = document.createElement('iframe');
|
|
92
|
-
iframe.style.border = '0';
|
|
93
|
-
iframe.style.width = '100%';
|
|
94
|
-
iframe.style.height = '100%';
|
|
95
|
-
container.appendChild(iframe);
|
|
96
|
-
// Split the closing script token so this module's own bundling never sees a literal
|
|
97
|
-
// </script> (defensive; matches the single-dep mount's convention).
|
|
98
|
-
const close = `</${'scr'}ipt>`;
|
|
99
|
-
const baseTag = opts.baseHref ? `<base href="${opts.baseHref}">` : '';
|
|
100
|
-
const scriptTag = opts.bundleUrl
|
|
101
|
-
? `<script type="module" src="${opts.bundleUrl}">${close}`
|
|
102
|
-
: `<script type="module">${opts.inlineSrc ?? ''}${close}`;
|
|
103
|
-
const importmapTag = `<script type="importmap">${JSON.stringify({ imports })}${close}`;
|
|
104
|
-
const bodyHtml = opts.bodyHtml ?? '';
|
|
105
|
-
const doc = iframe.contentDocument;
|
|
106
|
-
doc.open();
|
|
107
|
-
doc.write(`<!doctype html><html><head><meta charset="utf-8">${baseTag}${importmapTag}</head><body>${bodyHtml}${scriptTag}</body></html>`);
|
|
108
|
-
doc.close();
|
|
109
|
-
let captured = null;
|
|
110
|
-
try {
|
|
111
|
-
captured = await capture.waitForCapture(opts.captureTimeoutMs ?? 12_000);
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
captured = null;
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
iframe,
|
|
118
|
-
capture,
|
|
119
|
-
captured,
|
|
120
|
-
dispose: () => {
|
|
121
|
-
capture.uninstall();
|
|
122
|
-
restoreInit?.();
|
|
123
|
-
for (const u of created)
|
|
124
|
-
URL.revokeObjectURL(u);
|
|
125
|
-
iframe.remove();
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* IFRAME-REACHABLE (tier 2-3): run `gameModuleSrc` in an iframe whose importmap maps
|
|
131
|
-
* `pixi.js` to a host-pixi re-export blob, and trap the host `Application.prototype`
|
|
132
|
-
* so the bundle's render is captured in-realm.
|
|
133
|
-
*/
|
|
134
|
-
export async function mountIngestGame2DIframeReachable(pixiNamespace, gameModuleSrc, container, opts = {}) {
|
|
135
|
-
const capture = installSceneCapture2D(pixiNamespace);
|
|
136
|
-
const reexportUrl = makeHostPixiReexportUrl(pixiNamespace);
|
|
137
|
-
const iframe = document.createElement('iframe');
|
|
138
|
-
iframe.style.border = '0';
|
|
139
|
-
iframe.style.width = '100%';
|
|
140
|
-
iframe.style.height = '100%';
|
|
141
|
-
container.appendChild(iframe);
|
|
142
|
-
const doc = iframe.contentDocument;
|
|
143
|
-
doc.open();
|
|
144
|
-
doc.write(`<!doctype html><html><head><meta charset="utf-8">` +
|
|
145
|
-
`<script type="importmap">${JSON.stringify({ imports: { 'pixi.js': reexportUrl } })}</scr` +
|
|
146
|
-
`ipt></head><body><script type="module">${gameModuleSrc}</scr` +
|
|
147
|
-
`ipt></body></html>`);
|
|
148
|
-
doc.close();
|
|
149
|
-
let captured = null;
|
|
150
|
-
try {
|
|
151
|
-
captured = await capture.waitForCapture(opts.captureTimeoutMs ?? 8000);
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
captured = null;
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
iframe,
|
|
158
|
-
capture,
|
|
159
|
-
captured,
|
|
160
|
-
dispose: () => {
|
|
161
|
-
capture.uninstall();
|
|
162
|
-
URL.revokeObjectURL(reexportUrl);
|
|
163
|
-
iframe.remove();
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { type SceneCapture2DHandle } from './scene-capture-2d';
|
|
2
|
-
/**
|
|
3
|
-
* D-Z3 (docs/WAVE3-ADAPTER-PLUMBING-DESIGN.md) — a manifest's `extraDeps`
|
|
4
|
-
* resolve to TWO kinds of importmap entry: `namespaces` are today's
|
|
5
|
-
* registry-known bare specifiers (host-namespace-registry.ts), re-exported
|
|
6
|
-
* via a blob module (`ingest-iframe-2d.ts`'s `makeHostNamespaceReexportUrl`);
|
|
7
|
-
* `urls` are the D-Z3 fallback — a specifier that isn't registered but IS
|
|
8
|
-
* present in the open project's own `node_modules`, mapped DIRECTLY to its
|
|
9
|
-
* `/project-game-static/node_modules/<spec>/<esm entry>` URL (no host-side
|
|
10
|
-
* import, no blob — the dep executes in the iframe realm and its own
|
|
11
|
-
* transitive `import 'pixi.js'` resolves through the same importmap back to
|
|
12
|
-
* the host pixi trap). All probing/decision logic (which kind a specifier
|
|
13
|
-
* resolves to, exports-map parsing, anti-shim throws) lives editor-side
|
|
14
|
-
* (`host-namespace-registry.ts`) — this engine module only carries the
|
|
15
|
-
* ALREADY-DECIDED shape; `ingest-iframe-2d.ts` stays decision-free and just
|
|
16
|
-
* merges both maps into the iframe importmap.
|
|
17
|
-
*/
|
|
18
|
-
export interface ExtraDepsResolution2D {
|
|
19
|
-
namespaces: Record<string, Record<string, unknown>>;
|
|
20
|
-
urls: Record<string, string>;
|
|
21
|
-
}
|
|
22
|
-
/** A registered unmodified PixiJS game (the world2d analog of `IngestGame`). */
|
|
23
|
-
export interface IngestGame2D {
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
description: string;
|
|
27
|
-
/** Shared-pixi path: import + run the unmodified game module. */
|
|
28
|
-
load?: () => Promise<unknown>;
|
|
29
|
-
/** Tier ceiling: how reachable the game's pixi instance is. */
|
|
30
|
-
tier?: 'shared' | 'iframe-reachable' | 'opaque-embed';
|
|
31
|
-
captureTimeoutMs?: number;
|
|
32
|
-
/**
|
|
33
|
-
* IFRAME-REACHABLE-MULTI fields (Track P, docs/PIXI-INGEST-LANDING-DESIGN.md
|
|
34
|
-
* §2): an externalized built bundle mounted via
|
|
35
|
-
* `mountIngestGame2DIframeReachableMulti` (`./ingest-iframe-2d.ts`) instead
|
|
36
|
-
* of `load()` — populated only when `tier` is `'iframe-reachable'` AND
|
|
37
|
-
* `load` is absent. Mirror `IframeReachableMultiOpts`'s fields, EXCEPT
|
|
38
|
-
* `extraDeps`/`pixiNamespace` are THUNKS here, not resolved values — the
|
|
39
|
-
* same "lazy, only invoked at mount time" shape `load` already uses, so
|
|
40
|
-
* building this descriptor (`resolveIngest2DDescriptor` / `discovery2d.ts`,
|
|
41
|
-
* editor-side) never has to be async just to wire up which specifiers/
|
|
42
|
-
* version-skew URL a game needs; only actually MOUNTING it (the ingest-mode
|
|
43
|
-
* mount bridge) pays for the dynamic import of `@pixi/sound`/`gsap`/spine/
|
|
44
|
-
* a standalone pixi build.
|
|
45
|
-
*/
|
|
46
|
-
bundleUrl?: string;
|
|
47
|
-
/** <base href> for the iframe (see `IframeReachableMultiOpts.baseHref`). */
|
|
48
|
-
baseHref?: string;
|
|
49
|
-
/** Host-side Assets.init basePath remap (see `IframeReachableMultiOpts.assetBaseUrl`). */
|
|
50
|
-
assetBaseUrl?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Lazily resolve this game's bare-specifier -> extraDeps resolution via the
|
|
53
|
-
* editor's host-namespace registry. Absent (or omitted) means no extra deps
|
|
54
|
-
* beyond pixi.js.
|
|
55
|
-
*/
|
|
56
|
-
extraDeps?: () => Promise<ExtraDepsResolution2D>;
|
|
57
|
-
/**
|
|
58
|
-
* Lazily resolve the trapped-pixi namespace for version-skewed games (a
|
|
59
|
-
* dynamic `import()` of the manifest's `pixiModuleUrl`) — absent means
|
|
60
|
-
* "mount against the host's own `pixi.js`" (no skew).
|
|
61
|
-
*/
|
|
62
|
-
pixiNamespace?: () => Promise<unknown>;
|
|
63
|
-
/** DOM the game expects before boot (see `IframeReachableMultiOpts.bodyHtml`). */
|
|
64
|
-
bodyHtml?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Lazily read an OPAQUE prebuilt bundle's self-contained HTML (D-W2,
|
|
67
|
-
* docs/WAVE4-FTUE-HARDENING-DESIGN.md) — the pixi twin of `IngestGame.embedHtml`.
|
|
68
|
-
* Always a lazy thunk here (no in-tree world2d opaque-embed fixture exists
|
|
69
|
-
* yet to need a plain-string form, unlike the three side):
|
|
70
|
-
* `resolveIngest2DDescriptor` (adapter-resolver.ts) builds one that reads
|
|
71
|
-
* the declared `entryHtml` file's bytes through the `/project-game-static/`
|
|
72
|
-
* route, only when the game is actually mounted. The host runs the
|
|
73
|
-
* resolved HTML in a sandboxed iframe at the embed-only floor (Tier 0-1),
|
|
74
|
-
* `mountIngestGame2DEmbed` (`./ingest-iframe-2d.ts`).
|
|
75
|
-
*/
|
|
76
|
-
embedHtml?: () => Promise<string>;
|
|
77
|
-
}
|
|
78
|
-
export interface IngestMount2D {
|
|
79
|
-
/** The captured live stage Container (null if capture failed/degraded). */
|
|
80
|
-
stage: unknown | null;
|
|
81
|
-
capture: SceneCapture2DHandle;
|
|
82
|
-
embedOnly: boolean;
|
|
83
|
-
setPaused(paused: boolean): void;
|
|
84
|
-
dispose(): void;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Mount an UNMODIFIED PixiJS game via the shared-instance capture path — the 2D
|
|
88
|
-
* analog of `mountIngestGame`. Installs the render trap on the host's pixi
|
|
89
|
-
* instance, runs the game's `load()`, waits for the game to render its first
|
|
90
|
-
* frame (capturing its live stage), and exposes loop gating + cleanup. If capture
|
|
91
|
-
* times out (pixi unreachable / bundled / mismatched), degrades to embed-only —
|
|
92
|
-
* never a silent failure.
|
|
93
|
-
*/
|
|
94
|
-
export declare function mountIngestGame2D(pixiNamespace: unknown, game: IngestGame2D, opts?: {
|
|
95
|
-
captureTimeoutMs?: number;
|
|
96
|
-
}): Promise<IngestMount2D>;
|
|
97
|
-
//# sourceMappingURL=ingest2d.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingest2d.d.ts","sourceRoot":"","sources":["../../src/world2d/ingest2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAEtF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,QAAQ,GAAG,kBAAkB,GAAG,cAAc,CAAC;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACjD;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,YAAY,EAClB,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,OAAO,CAAC,aAAa,CAAC,CA6BxB"}
|
package/dist/world2d/ingest2d.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { installSceneCapture2D } from './scene-capture-2d';
|
|
2
|
-
/**
|
|
3
|
-
* Mount an UNMODIFIED PixiJS game via the shared-instance capture path — the 2D
|
|
4
|
-
* analog of `mountIngestGame`. Installs the render trap on the host's pixi
|
|
5
|
-
* instance, runs the game's `load()`, waits for the game to render its first
|
|
6
|
-
* frame (capturing its live stage), and exposes loop gating + cleanup. If capture
|
|
7
|
-
* times out (pixi unreachable / bundled / mismatched), degrades to embed-only —
|
|
8
|
-
* never a silent failure.
|
|
9
|
-
*/
|
|
10
|
-
export async function mountIngestGame2D(pixiNamespace, game, opts = {}) {
|
|
11
|
-
const capture = installSceneCapture2D(pixiNamespace);
|
|
12
|
-
try {
|
|
13
|
-
await game.load?.();
|
|
14
|
-
}
|
|
15
|
-
catch (err) {
|
|
16
|
-
capture.uninstall();
|
|
17
|
-
throw new Error(`world2d ingest: game "${game.id}" failed to load: ${err}`);
|
|
18
|
-
}
|
|
19
|
-
const timeout = opts.captureTimeoutMs ?? game.captureTimeoutMs ?? 8000;
|
|
20
|
-
try {
|
|
21
|
-
const rt = await capture.waitForCapture(timeout);
|
|
22
|
-
return {
|
|
23
|
-
stage: rt.stage,
|
|
24
|
-
capture,
|
|
25
|
-
embedOnly: false,
|
|
26
|
-
setPaused: (p) => capture.setPaused(p),
|
|
27
|
-
dispose: () => capture.uninstall(),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
// Capture failed → pixi unreachable/mismatched → degrade to embed-only.
|
|
32
|
-
return {
|
|
33
|
-
stage: null,
|
|
34
|
-
capture,
|
|
35
|
-
embedOnly: true,
|
|
36
|
-
setPaused: () => { },
|
|
37
|
-
dispose: () => capture.uninstall(),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type RAPIER from '@dimforge/rapier2d-compat';
|
|
2
|
-
import type { Container } from 'pixi.js';
|
|
3
|
-
/** The Rapier 2D handles owned by a single display-object entity. */
|
|
4
|
-
export interface Physics2DRefs {
|
|
5
|
-
body: RAPIER.RigidBody;
|
|
6
|
-
collider: RAPIER.Collider;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Maps PixiJS display objects to their Rapier 2D bodies/colliders and back —
|
|
10
|
-
* the world2d analog of `PhysicsRegistry`. Two indexes:
|
|
11
|
-
* - `Container → {body, collider}` for the postPhysics transform writer.
|
|
12
|
-
* - `colliderHandle → Container` reverse index for collision/trigger dispatch.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createPhysics2DRegistry(): {
|
|
15
|
-
add(display: Container, body: RAPIER.RigidBody, collider: RAPIER.Collider): void;
|
|
16
|
-
get(display: Container): Physics2DRefs | undefined;
|
|
17
|
-
getByColliderHandle(handle: number): Container | undefined;
|
|
18
|
-
remove(display: Container): void;
|
|
19
|
-
entries(): IterableIterator<[Container, Physics2DRefs]>;
|
|
20
|
-
readonly size: number;
|
|
21
|
-
clear(): void;
|
|
22
|
-
};
|
|
23
|
-
export type Physics2DRegistry = ReturnType<typeof createPhysics2DRegistry>;
|
|
24
|
-
//# sourceMappingURL=physics2d-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"physics2d-registry.d.ts","sourceRoot":"","sources":["../../src/world2d/physics2d-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB;iBAKtB,SAAS,QAAQ,MAAM,CAAC,SAAS,YAAY,MAAM,CAAC,QAAQ,GAAG,IAAI;iBAInE,SAAS,GAAG,aAAa,GAAG,SAAS;gCAGtB,MAAM,GAAG,SAAS,GAAG,SAAS;oBAG1C,SAAS,GAAG,IAAI;eAKrB,gBAAgB,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;mBAG3C,MAAM;aAGT,IAAI;EAKhB;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps PixiJS display objects to their Rapier 2D bodies/colliders and back —
|
|
3
|
-
* the world2d analog of `PhysicsRegistry`. Two indexes:
|
|
4
|
-
* - `Container → {body, collider}` for the postPhysics transform writer.
|
|
5
|
-
* - `colliderHandle → Container` reverse index for collision/trigger dispatch.
|
|
6
|
-
*/
|
|
7
|
-
export function createPhysics2DRegistry() {
|
|
8
|
-
const byObject = new Map();
|
|
9
|
-
const byColliderHandle = new Map();
|
|
10
|
-
return {
|
|
11
|
-
add(display, body, collider) {
|
|
12
|
-
byObject.set(display, { body, collider });
|
|
13
|
-
byColliderHandle.set(collider.handle, display);
|
|
14
|
-
},
|
|
15
|
-
get(display) {
|
|
16
|
-
return byObject.get(display);
|
|
17
|
-
},
|
|
18
|
-
getByColliderHandle(handle) {
|
|
19
|
-
return byColliderHandle.get(handle);
|
|
20
|
-
},
|
|
21
|
-
remove(display) {
|
|
22
|
-
const refs = byObject.get(display);
|
|
23
|
-
if (refs)
|
|
24
|
-
byColliderHandle.delete(refs.collider.handle);
|
|
25
|
-
byObject.delete(display);
|
|
26
|
-
},
|
|
27
|
-
entries() {
|
|
28
|
-
return byObject.entries();
|
|
29
|
-
},
|
|
30
|
-
get size() {
|
|
31
|
-
return byObject.size;
|
|
32
|
-
},
|
|
33
|
-
clear() {
|
|
34
|
-
byObject.clear();
|
|
35
|
-
byColliderHandle.clear();
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { Container } from 'pixi.js';
|
|
2
|
-
import type { MountedPixiWorld } from '../adapter/game-adapter';
|
|
3
|
-
import { type GameInternal, type WorldFrameHooks } from '../runtime/game';
|
|
4
|
-
import type { Scene2DFile } from './schema/entity2d';
|
|
5
|
-
import type { Component2DRegistry, World2DContext } from './types';
|
|
6
|
-
/** Minimal host surface for world2d (the stacked-own-root model from the spec). */
|
|
7
|
-
export interface World2DHost {
|
|
8
|
-
canvas: HTMLCanvasElement;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
/** Shared Game root when mounted by the universal multi-world host. */
|
|
12
|
-
game?: GameInternal;
|
|
13
|
-
/** DPR override (T6.1 slice 1, COMPOSITION-DESIGN.md D5 §3 — "one DPR
|
|
14
|
-
* everywhere"): the roots-path host computes ONE dpr for every stacked
|
|
15
|
-
* surface and passes it here; omitted -> `createPixiSurface`'s own
|
|
16
|
-
* default (`window.devicePixelRatio`, uncapped) — today's behavior. */
|
|
17
|
-
dpr?: number;
|
|
18
|
-
/** This world is stacked ABOVE another world (D5 §1): clear with alpha 0
|
|
19
|
-
* instead of an opaque background so the layer below shows through. */
|
|
20
|
-
transparent?: boolean;
|
|
21
|
-
/** Capture tier cost (D5 §4) — see `PixiSurfaceOptions.preserveDrawingBuffer`. */
|
|
22
|
-
preserveDrawingBuffer?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/** A world2d setup function — build the scene from the context, return cleanup. */
|
|
25
|
-
export type World2DSetupFn = (ctx: World2DContext) => Promise<{
|
|
26
|
-
dispose: () => void;
|
|
27
|
-
}> | {
|
|
28
|
-
dispose: () => void;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* MountedGame for world2d — the pixi peer of the 3D `MountedThreeWorld`,
|
|
32
|
-
* satisfying `MountedPixiWorld` (`adapter/game-adapter.ts`, T7.5) via `kind`/
|
|
33
|
-
* `stage` so a `WorldInstance` built from this mount needs no cast through
|
|
34
|
-
* the generic `MountedWorld` union. `scene`/`camera` (both the SAME `Container`
|
|
35
|
-
* as `stage`) are kept as extra fields for pre-T7.5 call sites/tests that
|
|
36
|
-
* already read them — `stage` is the canonical name going forward.
|
|
37
|
-
*/
|
|
38
|
-
export interface MountedGame2D extends MountedPixiWorld {
|
|
39
|
-
/** First-party brand (T7.3 slice 2 — closes the gap `adapter/vgai-scene-
|
|
40
|
-
* game-adapter.ts`'s `VgaiMountedGame.firstParty` doc flagged as a "T7.3
|
|
41
|
-
* lookahead"): `runtime/game.ts`'s `isFirstPartyMounted` brand-checks
|
|
42
|
-
* this literal, NOT a structural `'ctx' in mounted` probe (this mount's
|
|
43
|
-
* `ctx` is a `World2DContext`, unrelated to `GameContext`). Without this,
|
|
44
|
-
* a pixijs `WorldInstance` is silently skipped by every first-party-only
|
|
45
|
-
* Game feature — `Game.queryByComponent` in particular, the T7.3 AC
|
|
46
|
-
* (`test/game-three-plus-pixi.test.ts`). */
|
|
47
|
-
readonly firstParty: true;
|
|
48
|
-
/** Pre-T7.5 field names, kept for compatibility — both alias `stage`
|
|
49
|
-
* (pixi has no separate camera concept; `MountedGame2D.mount` always sets
|
|
50
|
-
* `scene === camera === stage`). */
|
|
51
|
-
readonly scene: Container;
|
|
52
|
-
readonly camera: Container;
|
|
53
|
-
readonly ctx: World2DContext;
|
|
54
|
-
update?(dt: number): void;
|
|
55
|
-
resize?(width: number, height: number): void;
|
|
56
|
-
dispose(): void;
|
|
57
|
-
/** Phase-partitioned frame entry point (T7.3 slice 1) — the pixi analog of
|
|
58
|
-
* `VgaiMountedGame.frame` (`adapter/vgai-scene-game-adapter.ts`). Delegates
|
|
59
|
-
* to this mount's own `SystemRunner`, so a `WorldInstance` built from this
|
|
60
|
-
* mount ticks it through `Game.runFrame` instead of a standalone loop. */
|
|
61
|
-
readonly frame?: WorldFrameHooks;
|
|
62
|
-
}
|
|
63
|
-
export interface PixiSceneConfig {
|
|
64
|
-
/** A world2d scene file to load (declarative path). */
|
|
65
|
-
sceneData?: Scene2DFile;
|
|
66
|
-
/** A setup function (imperative path) — mutually exclusive with sceneData. */
|
|
67
|
-
setup?: World2DSetupFn;
|
|
68
|
-
/** Component registry the scene's `components` reference. */
|
|
69
|
-
registry?: Component2DRegistry;
|
|
70
|
-
id?: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* The first-party implementer that mounts an authored world2d scene — the 2D
|
|
74
|
-
* analog of `VgaiSceneGameAdapter`. It builds the Pixi surface + Rapier 2D world,
|
|
75
|
-
* registers the engine systems into the shared phase runner, loads the scene (or
|
|
76
|
-
* runs a setup), and returns a `MountedGame2D`.
|
|
77
|
-
*/
|
|
78
|
-
export declare class PixiSceneGameAdapter {
|
|
79
|
-
private readonly config;
|
|
80
|
-
readonly id: string;
|
|
81
|
-
constructor(config?: PixiSceneConfig);
|
|
82
|
-
mount(host: World2DHost): Promise<MountedGame2D>;
|
|
83
|
-
}
|
|
84
|
-
/** Handle returned by {@link createWorld2DRuntime}. */
|
|
85
|
-
export interface World2DSession {
|
|
86
|
-
stop(): void;
|
|
87
|
-
pause(): void;
|
|
88
|
-
resume(): void;
|
|
89
|
-
/** Advance exactly one fixed substep — the pixi analog of
|
|
90
|
-
* `GameSession.step()` (`runtime/create-runtime.ts`), delegating to the
|
|
91
|
-
* same `Game.play.step()` (D10, T7.6). */
|
|
92
|
-
step(): void;
|
|
93
|
-
resize(width: number, height: number): void;
|
|
94
|
-
readonly mounted: MountedGame2D;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Host entry for world2d — the sibling of `createGameRuntime`, kept separate so the
|
|
98
|
-
* proven THREE host/interfaces are untouched (the stacked-own-root option the spec's
|
|
99
|
-
* surface-host-backend-neutral allows). Owns the canvas and constructs a real `Game`
|
|
100
|
-
* (T7.3 slice 1) with exactly one `'pixijs'`-kind `WorldInstance`, driven each fixed
|
|
101
|
-
* substep through `Game.runFrame` — the world2d analog of `createGameRuntime`'s
|
|
102
|
-
* `registerThreeWorld` (`runtime/create-runtime.ts`). Before T7.3 this ran its
|
|
103
|
-
* own standalone `createGameLoop` calling `mounted.update` directly; that loop is
|
|
104
|
-
* retired here in favor of one shared frame executor per game root.
|
|
105
|
-
*/
|
|
106
|
-
export declare function createWorld2DRuntime(config: PixiSceneConfig & World2DHost): Promise<World2DSession>;
|
|
107
|
-
//# sourceMappingURL=pixi-game-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-game-adapter.d.ts","sourceRoot":"","sources":["../../src/world2d/pixi-game-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAKhE,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;4EAGwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;4EACwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kFAAkF;IAClF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD;;;;;;;iDAO6C;IAC7C,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B;;yCAEqC;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,OAAO,IAAI,IAAI,CAAC;IAChB;;;+EAG2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,qBAAa,oBAAoB;IAEnB,OAAO,CAAC,QAAQ,CAAC,MAAM;IADnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBACS,MAAM,GAAE,eAAoB;IAInD,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAoHvD;AAED,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf;;+CAE2C;IAC3C,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,eAAe,GAAG,WAAW,GACpC,OAAO,CAAC,cAAc,CAAC,CAiFzB"}
|