@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,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authorable body-type parameters for the procedural humanoid generator
|
|
3
|
-
* (`generateHumanoid`). Same posture as the other engine Zod schemas: every
|
|
4
|
-
* field carries `.describe()`, and the object is `.strict()` so a typo'd
|
|
5
|
-
* param fails loudly at parse instead of silently generating the default
|
|
6
|
-
* body.
|
|
7
|
-
*
|
|
8
|
-
* These params are a CODE-API schema (validated by `generateHumanoid` the
|
|
9
|
-
* way `GameComponent.schema` params are), not a fetched-file format — they
|
|
10
|
-
* are deliberately NOT wired into `scripts/generate-schema.ts`, whose six
|
|
11
|
-
* outputs are all on-disk file formats. If a scene-authorable humanoid
|
|
12
|
-
* entity lands later, that wiring (plus a consumption-map entry) happens
|
|
13
|
-
* then.
|
|
14
|
-
*
|
|
15
|
-
* All multipliers are relative to the reference rig (the vendored Mixamo
|
|
16
|
-
* soldier's proportions, ~1.83 m). 1 = reference. The generator keeps feet
|
|
17
|
-
* grounded and skin weights correct across the whole documented range.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
export declare const HumanoidParamsSchema: z.ZodObject<{
|
|
21
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
legLength: z.ZodDefault<z.ZodNumber>;
|
|
23
|
-
armLength: z.ZodDefault<z.ZodNumber>;
|
|
24
|
-
torsoLength: z.ZodDefault<z.ZodNumber>;
|
|
25
|
-
shoulderWidth: z.ZodDefault<z.ZodNumber>;
|
|
26
|
-
hipWidth: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
headSize: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
limbThickness: z.ZodDefault<z.ZodNumber>;
|
|
29
|
-
torsoGirth: z.ZodDefault<z.ZodNumber>;
|
|
30
|
-
}, z.core.$strict>;
|
|
31
|
-
/** Authorable input shape — every field optional. */
|
|
32
|
-
export type HumanoidParams = z.input<typeof HumanoidParamsSchema>;
|
|
33
|
-
/** Post-parse shape — defaults applied (only `height` stays optional). */
|
|
34
|
-
export type ResolvedHumanoidParams = z.output<typeof HumanoidParamsSchema>;
|
|
35
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/humanoid/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;;;kBAiFtB,CAAC;AAEZ,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,0EAA0E;AAC1E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/humanoid/schema.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authorable body-type parameters for the procedural humanoid generator
|
|
3
|
-
* (`generateHumanoid`). Same posture as the other engine Zod schemas: every
|
|
4
|
-
* field carries `.describe()`, and the object is `.strict()` so a typo'd
|
|
5
|
-
* param fails loudly at parse instead of silently generating the default
|
|
6
|
-
* body.
|
|
7
|
-
*
|
|
8
|
-
* These params are a CODE-API schema (validated by `generateHumanoid` the
|
|
9
|
-
* way `GameComponent.schema` params are), not a fetched-file format — they
|
|
10
|
-
* are deliberately NOT wired into `scripts/generate-schema.ts`, whose six
|
|
11
|
-
* outputs are all on-disk file formats. If a scene-authorable humanoid
|
|
12
|
-
* entity lands later, that wiring (plus a consumption-map entry) happens
|
|
13
|
-
* then.
|
|
14
|
-
*
|
|
15
|
-
* All multipliers are relative to the reference rig (the vendored Mixamo
|
|
16
|
-
* soldier's proportions, ~1.83 m). 1 = reference. The generator keeps feet
|
|
17
|
-
* grounded and skin weights correct across the whole documented range.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
export const HumanoidParamsSchema = z
|
|
21
|
-
.object({
|
|
22
|
-
height: z
|
|
23
|
-
.number()
|
|
24
|
-
.min(0.3)
|
|
25
|
-
.max(4)
|
|
26
|
-
.optional()
|
|
27
|
-
.describe('Target standing height in metres, measured to the crown of the head. Omit to keep ' +
|
|
28
|
-
'the natural height implied by the proportion multipliers (the reference rig is ' +
|
|
29
|
-
'~1.83 m). All body dimensions scale uniformly to hit this, so proportions are ' +
|
|
30
|
-
'controlled by the multipliers and overall size by this one number.'),
|
|
31
|
-
legLength: z
|
|
32
|
-
.number()
|
|
33
|
-
.min(0.5)
|
|
34
|
-
.max(2)
|
|
35
|
-
.default(1)
|
|
36
|
-
.describe('Thigh + shin length multiplier (1 = reference). The pelvis rest height follows ' +
|
|
37
|
-
'automatically so the feet stay grounded — long legs raise the hips, short legs ' +
|
|
38
|
-
'lower them.'),
|
|
39
|
-
armLength: z
|
|
40
|
-
.number()
|
|
41
|
-
.min(0.5)
|
|
42
|
-
.max(2)
|
|
43
|
-
.default(1)
|
|
44
|
-
.describe('Upper-arm + forearm length multiplier (1 = reference).'),
|
|
45
|
-
torsoLength: z
|
|
46
|
-
.number()
|
|
47
|
-
.min(0.5)
|
|
48
|
-
.max(2)
|
|
49
|
-
.default(1)
|
|
50
|
-
.describe('Spine + neck length multiplier (1 = reference) — a longer or shorter trunk.'),
|
|
51
|
-
shoulderWidth: z
|
|
52
|
-
.number()
|
|
53
|
-
.min(0.5)
|
|
54
|
-
.max(2)
|
|
55
|
-
.default(1)
|
|
56
|
-
.describe('Shoulder breadth multiplier (1 = reference): scales the lateral shoulder-root offsets ' +
|
|
57
|
-
'and the clavicles.'),
|
|
58
|
-
hipWidth: z
|
|
59
|
-
.number()
|
|
60
|
-
.min(0.5)
|
|
61
|
-
.max(2)
|
|
62
|
-
.default(1)
|
|
63
|
-
.describe('Hip/pelvis breadth multiplier (1 = reference): scales the lateral upper-leg root ' +
|
|
64
|
-
'offsets and the pelvis block width.'),
|
|
65
|
-
headSize: z
|
|
66
|
-
.number()
|
|
67
|
-
.min(0.5)
|
|
68
|
-
.max(2)
|
|
69
|
-
.default(1)
|
|
70
|
-
.describe('Head + neck size multiplier (1 = reference). Larger heads read younger/stylized — ' +
|
|
71
|
-
'child-proportioned characters pair headSize ≈ 1.3–1.6 with a small height.'),
|
|
72
|
-
limbThickness: z
|
|
73
|
-
.number()
|
|
74
|
-
.min(0.4)
|
|
75
|
-
.max(2.5)
|
|
76
|
-
.default(1)
|
|
77
|
-
.describe('Arm and leg capsule radius multiplier (1 = reference) — slim (≈0.7) to heavyset ' +
|
|
78
|
-
'(≈1.5). Feet keep their reference radius so ground contact never sinks.'),
|
|
79
|
-
torsoGirth: z
|
|
80
|
-
.number()
|
|
81
|
-
.min(0.4)
|
|
82
|
-
.max(2.5)
|
|
83
|
-
.default(1)
|
|
84
|
-
.describe('Torso/pelvis bulk multiplier (1 = reference): scales the torso capsule radii and the ' +
|
|
85
|
-
'pelvis block depth — the main "build" control (slim vs heavy trunk).'),
|
|
86
|
-
})
|
|
87
|
-
.strict();
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The engine's STANDARD humanoid skeleton — Mixamo naming + the Mixamo rest
|
|
3
|
-
* pose — built at runtime ENTIRELY from `THREE.Bone` (no imported mesh, no
|
|
4
|
-
* loader). Promoted from the accepted Phase-1 feasibility PoC
|
|
5
|
-
* (`packages/engine/e2e/humanoid-skin-proof/`), which proved that a skeleton
|
|
6
|
-
* with these names and this rest pose plays standard Mixamo-named clips.
|
|
7
|
-
*
|
|
8
|
-
* Naming standard: **Mixamo** (`mixamorigHips`, `mixamorigSpine`, …) — the
|
|
9
|
-
* de-facto interchange standard for free humanoid clip libraries, and the
|
|
10
|
-
* naming of the repo's vendored clip source
|
|
11
|
-
* (`examples/rts/public/models/Soldier.glb`). Names are the
|
|
12
|
-
* post-`PropertyBinding.sanitizeNodeName` form (`mixamorig:Hips` →
|
|
13
|
-
* `mixamorigHips`), i.e. the names GLTFLoader gives clip tracks;
|
|
14
|
-
* `humanoid/clips.ts` maps the other spellings (`mixamorig:` / `mixamorig_` /
|
|
15
|
-
* bare) onto these.
|
|
16
|
-
*
|
|
17
|
-
* Rest pose: the reference rig's own T-pose. The table below is pure DATA —
|
|
18
|
-
* per-bone local translation (cm, the rig's native Mixamo unit) + local rest
|
|
19
|
-
* quaternion — extracted ONCE from Soldier.glb's node hierarchy (see the
|
|
20
|
-
* provenance note above the table). At runtime nothing is loaded:
|
|
21
|
-
* `buildHumanoidSkeleton` composes plain `THREE.Bone`s from this table.
|
|
22
|
-
*
|
|
23
|
-
* Body-type parameterization: `scaleSkeletonDef` rescales the table's
|
|
24
|
-
* translations (never the rest rotations) from authored `HumanoidParams` —
|
|
25
|
-
* per-segment length multipliers, lateral width multipliers, and a final
|
|
26
|
-
* uniform height normalization — then re-grounds the hips so the feet keep
|
|
27
|
-
* the reference rig's ground clearance. See that function's comment for the
|
|
28
|
-
* exact clip-compatibility contract this preserves.
|
|
29
|
-
*/
|
|
30
|
-
import * as THREE from 'three';
|
|
31
|
-
import type { ResolvedHumanoidParams } from './schema';
|
|
32
|
-
/** One bone: sanitized Mixamo name, parent row index (-1 = root), local
|
|
33
|
-
* rest translation [x,y,z] in the rig's native cm units, local rest
|
|
34
|
-
* quaternion [x,y,z,w]. */
|
|
35
|
-
export type BoneDef = readonly [
|
|
36
|
-
name: string,
|
|
37
|
-
parentIndex: number,
|
|
38
|
-
translation: readonly [number, number, number],
|
|
39
|
-
rotation: readonly [number, number, number, number]
|
|
40
|
-
];
|
|
41
|
-
export declare const MIXAMO_SKELETON_DEF: readonly BoneDef[];
|
|
42
|
-
/** The hierarchy root bone's canonical name. */
|
|
43
|
-
export declare const HUMANOID_HIPS_BONE = "mixamorigHips";
|
|
44
|
-
/** The source rig's armature transform ("Character" node in Soldier.glb):
|
|
45
|
-
* Mixamo exports Z-up centimetres; this maps the rig into the scene's
|
|
46
|
-
* Y-up metres. Applied to the Group the root bone is parented under. */
|
|
47
|
-
export declare const ARMATURE_ROTATION_X: number;
|
|
48
|
-
export declare const ARMATURE_SCALE = 0.01;
|
|
49
|
-
export interface BuiltSkeleton {
|
|
50
|
-
/** `mixamorigHips` — the hierarchy root. */
|
|
51
|
-
root: THREE.Bone;
|
|
52
|
-
/** All bones in `MIXAMO_SKELETON_DEF` row order (this order defines skinIndex values). */
|
|
53
|
-
bones: THREE.Bone[];
|
|
54
|
-
byName: Map<string, THREE.Bone>;
|
|
55
|
-
}
|
|
56
|
-
/** Build the standard humanoid bone hierarchy from the pure-data table —
|
|
57
|
-
* plain `THREE.Bone`s wired parent→child with the source rest pose. */
|
|
58
|
-
export declare function buildHumanoidSkeleton(defs?: readonly BoneDef[]): BuiltSkeleton;
|
|
59
|
-
/** Wrap a built bone hierarchy in the standard armature group (the Z-up-cm →
|
|
60
|
-
* Y-up-m transform every def-table translation is authored against). */
|
|
61
|
-
export declare function createArmatureGroup(rig: BuiltSkeleton): THREE.Group;
|
|
62
|
-
export interface ScaledSkeletonDef {
|
|
63
|
-
/** The rescaled bone table — feed to `buildHumanoidSkeleton`. */
|
|
64
|
-
defs: readonly BoneDef[];
|
|
65
|
-
/** The uniform factor applied to EVERY dimension at the end (1 when
|
|
66
|
-
* `params.height` is omitted). Body geometry radii must scale by this
|
|
67
|
-
* so proportions survive the height normalization. */
|
|
68
|
-
heightFactor: number;
|
|
69
|
-
/** Realized standing height, metres, measured to the head-top joint plus
|
|
70
|
-
* `crownPadding` (the body's head-capsule radius). */
|
|
71
|
-
height: number;
|
|
72
|
-
/** |scaled hips rest translation| / |reference hips rest translation| —
|
|
73
|
-
* the factor `clips.ts` multiplies hips `.position` tracks by, so root
|
|
74
|
-
* motion authored for the reference rig lands at this rig's hip height. */
|
|
75
|
-
hipsPositionScale: number;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Rescale the reference skeleton table for a body type.
|
|
79
|
-
*
|
|
80
|
-
* Order of operations (all in the table's native Z-up cm space):
|
|
81
|
-
* 1. Per-group segment-length / lateral-width multipliers (never the hips
|
|
82
|
-
* row, never any rest rotation).
|
|
83
|
-
* 2. Re-ground: shift the hips rest translation so the lowest foot joint
|
|
84
|
-
* keeps the REFERENCE rig's ground clearance (longer legs raise the
|
|
85
|
-
* pelvis, shorter legs lower it — feet never float or sink).
|
|
86
|
-
* 3. Height normalization: if `params.height` is set, uniformly scale every
|
|
87
|
-
* translation so head-top + `crownPadding` lands exactly on it.
|
|
88
|
-
*
|
|
89
|
-
* With all-default params every step is an exact no-op (multiplies by 1.0,
|
|
90
|
-
* adds 0.0), so the default rig is bit-identical to the reference table —
|
|
91
|
-
* that is what keeps the Phase-1 PoC fixture's committed render valid.
|
|
92
|
-
*
|
|
93
|
-
* CLIP COMPATIBILITY (the reviewer-flagged trap): animation clips carry
|
|
94
|
-
* per-bone `.position` tracks baked for the SOURCE rig's segment lengths.
|
|
95
|
-
* Played raw on a rescaled skeleton they would snap limbs back to source
|
|
96
|
-
* proportions. The contract here is split with `clips.ts`: this function
|
|
97
|
-
* only rescales REST translations and reports `hipsPositionScale`;
|
|
98
|
-
* `retargetClipToHumanoid` drops every non-hips translation track (bones
|
|
99
|
-
* keep these rest translations) and remaps the hips track by that factor —
|
|
100
|
-
* the standard humanoid-retarget policy.
|
|
101
|
-
*/
|
|
102
|
-
export declare function scaleSkeletonDef(params: ResolvedHumanoidParams, crownPadding: number): ScaledSkeletonDef;
|
|
103
|
-
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/humanoid/skeleton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD;;4BAE4B;AAC5B,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;CACpD,CAAC;AAiBF,eAAO,MAAM,mBAAmB,EAAE,SAAS,OAAO,EAkEjD,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD;;yEAEyE;AACzE,eAAO,MAAM,mBAAmB,QAAe,CAAC;AAChD,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;IACjB,0FAA0F;IAC1F,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACjC;AAED;wEACwE;AACxE,wBAAgB,qBAAqB,CACnC,IAAI,GAAE,SAAS,OAAO,EAAwB,GAC7C,aAAa,CAcf;AAED;yEACyE;AACzE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,KAAK,CAAC,KAAK,CAOnE;AAuED,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB;;2DAEuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB;2DACuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf;;gFAE4E;IAC5E,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,EAC9B,YAAY,EAAE,MAAM,GACnB,iBAAiB,CAyDnB"}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The engine's STANDARD humanoid skeleton — Mixamo naming + the Mixamo rest
|
|
3
|
-
* pose — built at runtime ENTIRELY from `THREE.Bone` (no imported mesh, no
|
|
4
|
-
* loader). Promoted from the accepted Phase-1 feasibility PoC
|
|
5
|
-
* (`packages/engine/e2e/humanoid-skin-proof/`), which proved that a skeleton
|
|
6
|
-
* with these names and this rest pose plays standard Mixamo-named clips.
|
|
7
|
-
*
|
|
8
|
-
* Naming standard: **Mixamo** (`mixamorigHips`, `mixamorigSpine`, …) — the
|
|
9
|
-
* de-facto interchange standard for free humanoid clip libraries, and the
|
|
10
|
-
* naming of the repo's vendored clip source
|
|
11
|
-
* (`examples/rts/public/models/Soldier.glb`). Names are the
|
|
12
|
-
* post-`PropertyBinding.sanitizeNodeName` form (`mixamorig:Hips` →
|
|
13
|
-
* `mixamorigHips`), i.e. the names GLTFLoader gives clip tracks;
|
|
14
|
-
* `humanoid/clips.ts` maps the other spellings (`mixamorig:` / `mixamorig_` /
|
|
15
|
-
* bare) onto these.
|
|
16
|
-
*
|
|
17
|
-
* Rest pose: the reference rig's own T-pose. The table below is pure DATA —
|
|
18
|
-
* per-bone local translation (cm, the rig's native Mixamo unit) + local rest
|
|
19
|
-
* quaternion — extracted ONCE from Soldier.glb's node hierarchy (see the
|
|
20
|
-
* provenance note above the table). At runtime nothing is loaded:
|
|
21
|
-
* `buildHumanoidSkeleton` composes plain `THREE.Bone`s from this table.
|
|
22
|
-
*
|
|
23
|
-
* Body-type parameterization: `scaleSkeletonDef` rescales the table's
|
|
24
|
-
* translations (never the rest rotations) from authored `HumanoidParams` —
|
|
25
|
-
* per-segment length multipliers, lateral width multipliers, and a final
|
|
26
|
-
* uniform height normalization — then re-grounds the hips so the feet keep
|
|
27
|
-
* the reference rig's ground clearance. See that function's comment for the
|
|
28
|
-
* exact clip-compatibility contract this preserves.
|
|
29
|
-
*/
|
|
30
|
-
import * as THREE from 'three';
|
|
31
|
-
/**
|
|
32
|
-
* Provenance: generated from `examples/rts/public/models/Soldier.glb`
|
|
33
|
-
* (the three.js example Mixamo soldier vendored by the RTS example) by
|
|
34
|
-
* parsing the GLB JSON chunk and walking `skins[0].joints[0]`'s node
|
|
35
|
-
* subtree — 65 bones, covering all 52 nodes the GLB's Idle/Run/TPose/Walk
|
|
36
|
-
* clips animate. Extraction (node):
|
|
37
|
-
*
|
|
38
|
-
* const json = JSON.parse(glb.slice(20, 20 + glb.readUInt32LE(12)));
|
|
39
|
-
* walk(hipsNode, n => [name(n).replace(/[\[\]\.:\/]/g, ''), parentRow,
|
|
40
|
-
* n.translation ?? [0,0,0], n.rotation ?? [0,0,0,1]]);
|
|
41
|
-
*/
|
|
42
|
-
// The rig's ±90° rest rotations serialize as ~0.7071 in the GLB; Math.SQRT1_2
|
|
43
|
-
// is the exact intent.
|
|
44
|
-
const R2 = Math.SQRT1_2;
|
|
45
|
-
export const MIXAMO_SKELETON_DEF = [
|
|
46
|
-
['mixamorigHips', -1, [-0.1602, 1.147488, 106.130768], [0, R2, R2, 0]],
|
|
47
|
-
['mixamorigSpine', 0, [-0.038121, 9.490517, -1.392063], [0, 0, 0, 1]],
|
|
48
|
-
['mixamorigSpine1', 1, [-0.044231, 11.072289, -1.624071], [0, 0, 0, 1]],
|
|
49
|
-
['mixamorigSpine2', 2, [-0.050549, 12.654045, -1.856082], [0, 0, 0, 1]],
|
|
50
|
-
['mixamorigNeck', 3, [-0.056868, 14.235764, -2.088092], [0, 0, 0, 1]],
|
|
51
|
-
['mixamorigHead', 4, [0, 3.280212, 0.313332], [0, 0, 0, 1]],
|
|
52
|
-
['mixamorigHeadTop_End', 5, [0, 25.653503, 2.450463], [0, 0, 0, 1]],
|
|
53
|
-
['mixamorigLeftShoulder', 3, [6.728773, 11.756622, -2.05846], [R2, R2, 0, 0]],
|
|
54
|
-
['mixamorigLeftArm', 7, [-3.178758, 14.094679, -0.059263], [0, 0, 0, 1]],
|
|
55
|
-
['mixamorigLeftForeArm', 8, [0.000015, 23.160294, 0], [0, 0, 0, 1]],
|
|
56
|
-
['mixamorigLeftHand', 9, [0.000036, 24.07176, 0.000015], [0, 0, 0, 1]],
|
|
57
|
-
['mixamorigLeftHandThumb1', 10, [-1.925056, 4.173385, -1.510903], [0, 0, 0, 1]],
|
|
58
|
-
['mixamorigLeftHandThumb2', 11, [-1.730873, 2.998001, -1.730855], [0, 0, 0, 1]],
|
|
59
|
-
['mixamorigLeftHandThumb3', 12, [-2.106666, 3.648872, -2.106638], [0, 0, 0, 1]],
|
|
60
|
-
['mixamorigLeftHandThumb4', 13, [-1.712988, 2.967014, -1.712967], [0, 0, 0, 1]],
|
|
61
|
-
['mixamorigLeftHandIndex1', 10, [-0.395972, 14.669356, -2.855875], [0, 0, 0, 1]],
|
|
62
|
-
['mixamorigLeftHandIndex2', 15, [-0.000021, 3.24861, -0.000036], [0, 0, 0, 1]],
|
|
63
|
-
['mixamorigLeftHandIndex3', 16, [0.000013, 2.659588, -0.000042], [0, 0, 0, 1]],
|
|
64
|
-
['mixamorigLeftHandIndex4', 17, [0.000012, 3.633183, -0.00002], [0, 0, 0, 1]],
|
|
65
|
-
['mixamorigLeftHandMiddle1', 10, [0.000009, 14.409812, -0.000004], [0, 0, 0, 1]],
|
|
66
|
-
['mixamorigLeftHandMiddle2', 19, [-0.000006, 3.25907, -0.000035], [0, 0, 0, 1]],
|
|
67
|
-
['mixamorigLeftHandMiddle3', 20, [-0.000003, 2.639858, -0.000025], [0, 0, 0, 1]],
|
|
68
|
-
['mixamorigLeftHandMiddle4', 21, [-0.000006, 3.673858, -0.000035], [0, 0, 0, 1]],
|
|
69
|
-
['mixamorigLeftHandRing1', 10, [0.318856, 13.191451, 3.305259], [0, 0, 0, 1]],
|
|
70
|
-
['mixamorigLeftHandRing2', 23, [-0.000007, 2.717635, -0.000018], [0, 0, 0, 1]],
|
|
71
|
-
['mixamorigLeftHandRing3', 24, [0.000012, 2.134457, 0.000041], [0, 0, 0, 1]],
|
|
72
|
-
['mixamorigLeftHandRing4', 25, [0, 2.786875, -0.000016], [0, 0, 0, 1]],
|
|
73
|
-
['mixamorigLeftHandPinky1', 10, [-0.521934, 11.636352, 5.613723], [0, 0, 0, 1]],
|
|
74
|
-
['mixamorigLeftHandPinky2', 27, [-0.000007, 1.559371, 0], [0.000002, -0.000002, 0, 1]],
|
|
75
|
-
['mixamorigLeftHandPinky3', 28, [0.000001, 1.540605, -0.000013], [-0.000002, 0.000002, 0, 1]],
|
|
76
|
-
['mixamorigLeftHandPinky4', 29, [-0.000003, 1.668713, 0], [-0.000002, 0.000002, 0.000005, 1]],
|
|
77
|
-
['mixamorigRightShoulder', 3, [-6.823778, 11.756622, -2.117723], [0, 0, R2, R2]],
|
|
78
|
-
['mixamorigRightArm', 31, [-3.183563, 14.057526, -0.05926], [0, 0, 0, 1]],
|
|
79
|
-
['mixamorigRightForeArm', 32, [0, 23.1602, 0], [0, 0, 0, 1]],
|
|
80
|
-
['mixamorigRightHand', 33, [-0.000015, 24.14341, -0.000017], [0, 0, 0, 1]],
|
|
81
|
-
['mixamorigRightHandThumb1', 34, [-2.027328, 4.192596, 1.472372], [0, 0, 0, 1]],
|
|
82
|
-
['mixamorigRightHandThumb2', 35, [-1.747421, 3.026642, 1.747453], [0, 0, 0, 1]],
|
|
83
|
-
['mixamorigRightHandThumb3', 36, [-2.123373, 3.677785, 2.1234], [0, 0, 0, 1]],
|
|
84
|
-
['mixamorigRightHandThumb4', 37, [-1.693868, 2.933862, 1.693906], [0, 0, 0, 1]],
|
|
85
|
-
['mixamorigRightHandIndex1', 34, [-0.40802, 14.636856, 3.083014], [0, 0, 0, 1]],
|
|
86
|
-
['mixamorigRightHandIndex2', 39, [0, 3.21624, 0.000026], [0, 0, 0, 1]],
|
|
87
|
-
['mixamorigRightHandIndex3', 40, [0.000015, 2.638268, 0.000045], [0, 0, 0, 1]],
|
|
88
|
-
['mixamorigRightHandIndex4', 41, [0, 3.65332, 0.000027], [0, 0, 0, 1]],
|
|
89
|
-
['mixamorigRightHandMiddle1', 34, [0.000031, 14.530449, -0.000024], [0, 0, 0, 1]],
|
|
90
|
-
['mixamorigRightHandMiddle2', 43, [0, 3.12674, 0], [0, 0, 0, 1]],
|
|
91
|
-
['mixamorigRightHandMiddle3', 44, [0.000008, 2.672478, 0.000014], [0, 0, 0, 1]],
|
|
92
|
-
['mixamorigRightHandMiddle4', 45, [-0.042618, 3.130852, 0.057592], [0, 0, 0, 1]],
|
|
93
|
-
['mixamorigRightHandRing1', 34, [0.19577, 12.771111, -2.96601], [0, 0, 0, 1]],
|
|
94
|
-
['mixamorigRightHandRing2', 47, [0.000015, 2.512802, -0.000039], [0, 0, 0, 1]],
|
|
95
|
-
['mixamorigRightHandRing3', 48, [-0.000015, 2.197067, 0.000041], [0, 0, 0, 1]],
|
|
96
|
-
['mixamorigRightHandRing4', 49, [0, 3.068436, 0], [0, 0, 0, 1]],
|
|
97
|
-
['mixamorigRightHandPinky1', 34, [-0.461517, 11.750786, -5.650592], [0, 0, 0, 1]],
|
|
98
|
-
['mixamorigRightHandPinky2', 51, [-0.000015, 1.67952, 0.000027], [0, 0, 0, 1]],
|
|
99
|
-
['mixamorigRightHandPinky3', 52, [0, 1.364082, 0.000023], [0, 0, 0, 1]],
|
|
100
|
-
['mixamorigRightHandPinky4', 53, [0, 1.668221, 0.000039], [0, 0, 0, 1]],
|
|
101
|
-
['mixamorigLeftUpLeg', 0, [9.618273, -5.272293, -1.010886], [1, 0, 0, 0]],
|
|
102
|
-
['mixamorigLeftLeg', 55, [0.116409, 43.344528, -1.323286], [0, 0, 0, 1]],
|
|
103
|
-
['mixamorigLeftFoot', 56, [-0.102314, 44.292152, 4.219776], [-R2, 0, 0, R2]],
|
|
104
|
-
['mixamorigLeftToeBase', 57, [2.599463, 15.813891, 11.814322], [0, 0, 0, 1]],
|
|
105
|
-
['mixamorigLeftToe_End', 58, [1.22305, 7.973637, -0.044495], [0, 0, 0, 1]],
|
|
106
|
-
['mixamorigRightUpLeg', 0, [-9.940967, -5.27272, -1.211655], [1, 0, 0, 0]],
|
|
107
|
-
['mixamorigRightLeg', 60, [-0.103974, 43.304852, -2.031704], [0, 0, 0, 1]],
|
|
108
|
-
['mixamorigRightFoot', 61, [0.117103, 44.331413, 4.727186], [-R2, 0, 0, R2]],
|
|
109
|
-
['mixamorigRightToeBase', 62, [-2.599469, 15.99981, 11.814546], [0, 0, 0, 1]],
|
|
110
|
-
['mixamorigRightToe_End', 63, [-1.223054, 7.92706, -0.044394], [0, 0, 0, 1]],
|
|
111
|
-
];
|
|
112
|
-
/** The hierarchy root bone's canonical name. */
|
|
113
|
-
export const HUMANOID_HIPS_BONE = 'mixamorigHips';
|
|
114
|
-
/** The source rig's armature transform ("Character" node in Soldier.glb):
|
|
115
|
-
* Mixamo exports Z-up centimetres; this maps the rig into the scene's
|
|
116
|
-
* Y-up metres. Applied to the Group the root bone is parented under. */
|
|
117
|
-
export const ARMATURE_ROTATION_X = -Math.PI / 2;
|
|
118
|
-
export const ARMATURE_SCALE = 0.01;
|
|
119
|
-
/** Build the standard humanoid bone hierarchy from the pure-data table —
|
|
120
|
-
* plain `THREE.Bone`s wired parent→child with the source rest pose. */
|
|
121
|
-
export function buildHumanoidSkeleton(defs = MIXAMO_SKELETON_DEF) {
|
|
122
|
-
const bones = [];
|
|
123
|
-
const byName = new Map();
|
|
124
|
-
for (const [name, parentIndex, t, r] of defs) {
|
|
125
|
-
const bone = new THREE.Bone();
|
|
126
|
-
bone.name = name;
|
|
127
|
-
bone.position.set(t[0], t[1], t[2]);
|
|
128
|
-
bone.quaternion.set(r[0], r[1], r[2], r[3]);
|
|
129
|
-
bones.push(bone);
|
|
130
|
-
byName.set(name, bone);
|
|
131
|
-
// Non-null: the table is topologically ordered (parents precede children).
|
|
132
|
-
if (parentIndex >= 0)
|
|
133
|
-
bones[parentIndex].add(bone);
|
|
134
|
-
}
|
|
135
|
-
return { root: bones[0], bones, byName };
|
|
136
|
-
}
|
|
137
|
-
/** Wrap a built bone hierarchy in the standard armature group (the Z-up-cm →
|
|
138
|
-
* Y-up-m transform every def-table translation is authored against). */
|
|
139
|
-
export function createArmatureGroup(rig) {
|
|
140
|
-
const armature = new THREE.Group();
|
|
141
|
-
armature.name = 'Armature';
|
|
142
|
-
armature.rotation.x = ARMATURE_ROTATION_X;
|
|
143
|
-
armature.scale.setScalar(ARMATURE_SCALE);
|
|
144
|
-
armature.add(rig.root);
|
|
145
|
-
return armature;
|
|
146
|
-
}
|
|
147
|
-
// --- Body-type scaling -----------------------------------------------------
|
|
148
|
-
/** Segment-length groups: each named bone's LOCAL TRANSLATION (= the length of
|
|
149
|
-
* the segment ending at that bone) scales by the group's multiplier. Rest
|
|
150
|
-
* rotations are never touched — clips own rotations at play time. */
|
|
151
|
-
const TORSO_LENGTH_BONES = new Set([
|
|
152
|
-
'mixamorigSpine',
|
|
153
|
-
'mixamorigSpine1',
|
|
154
|
-
'mixamorigSpine2',
|
|
155
|
-
'mixamorigNeck',
|
|
156
|
-
'mixamorigHead',
|
|
157
|
-
]);
|
|
158
|
-
const HEAD_LENGTH_BONES = new Set(['mixamorigHeadTop_End']);
|
|
159
|
-
const ARM_LENGTH_BONES = new Set([
|
|
160
|
-
'mixamorigLeftForeArm',
|
|
161
|
-
'mixamorigLeftHand',
|
|
162
|
-
'mixamorigRightForeArm',
|
|
163
|
-
'mixamorigRightHand',
|
|
164
|
-
]);
|
|
165
|
-
const LEG_LENGTH_BONES = new Set([
|
|
166
|
-
'mixamorigLeftLeg',
|
|
167
|
-
'mixamorigLeftFoot',
|
|
168
|
-
'mixamorigRightLeg',
|
|
169
|
-
'mixamorigRightFoot',
|
|
170
|
-
]);
|
|
171
|
-
/** Clavicles (Shoulder→Arm): mostly lateral in the T-pose — whole-vector
|
|
172
|
-
* scaled by shoulderWidth. */
|
|
173
|
-
const CLAVICLE_BONES = new Set(['mixamorigLeftArm', 'mixamorigRightArm']);
|
|
174
|
-
/** Shoulder roots off Spine2: X is lateral in the spine frame. */
|
|
175
|
-
const SHOULDER_X_BONES = new Set(['mixamorigLeftShoulder', 'mixamorigRightShoulder']);
|
|
176
|
-
/** Upper-leg roots off Hips: X is lateral in the hips frame. */
|
|
177
|
-
const HIP_X_BONES = new Set(['mixamorigLeftUpLeg', 'mixamorigRightUpLeg']);
|
|
178
|
-
/** Joints whose lowest world-Y point defines the rig's ground clearance. */
|
|
179
|
-
const GROUND_JOINTS = [
|
|
180
|
-
'mixamorigLeftFoot',
|
|
181
|
-
'mixamorigRightFoot',
|
|
182
|
-
'mixamorigLeftToeBase',
|
|
183
|
-
'mixamorigRightToeBase',
|
|
184
|
-
'mixamorigLeftToe_End',
|
|
185
|
-
'mixamorigRightToe_End',
|
|
186
|
-
];
|
|
187
|
-
/** Build the defs under a throwaway armature and read rest-pose world heights. */
|
|
188
|
-
function measureSkeleton(defs) {
|
|
189
|
-
const rig = buildHumanoidSkeleton(defs);
|
|
190
|
-
const armature = createArmatureGroup(rig);
|
|
191
|
-
armature.updateMatrixWorld(true);
|
|
192
|
-
const p = new THREE.Vector3();
|
|
193
|
-
let minFootY = Number.POSITIVE_INFINITY;
|
|
194
|
-
for (const name of GROUND_JOINTS) {
|
|
195
|
-
const bone = rig.byName.get(name);
|
|
196
|
-
if (!bone)
|
|
197
|
-
throw new Error(`humanoid: skeleton def is missing ground joint '${name}'`);
|
|
198
|
-
p.setFromMatrixPosition(bone.matrixWorld);
|
|
199
|
-
if (p.y < minFootY)
|
|
200
|
-
minFootY = p.y;
|
|
201
|
-
}
|
|
202
|
-
const headTop = rig.byName.get('mixamorigHeadTop_End');
|
|
203
|
-
if (!headTop)
|
|
204
|
-
throw new Error("humanoid: skeleton def is missing 'mixamorigHeadTop_End'");
|
|
205
|
-
p.setFromMatrixPosition(headTop.matrixWorld);
|
|
206
|
-
return { minFootY, headTopY: p.y };
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Rescale the reference skeleton table for a body type.
|
|
210
|
-
*
|
|
211
|
-
* Order of operations (all in the table's native Z-up cm space):
|
|
212
|
-
* 1. Per-group segment-length / lateral-width multipliers (never the hips
|
|
213
|
-
* row, never any rest rotation).
|
|
214
|
-
* 2. Re-ground: shift the hips rest translation so the lowest foot joint
|
|
215
|
-
* keeps the REFERENCE rig's ground clearance (longer legs raise the
|
|
216
|
-
* pelvis, shorter legs lower it — feet never float or sink).
|
|
217
|
-
* 3. Height normalization: if `params.height` is set, uniformly scale every
|
|
218
|
-
* translation so head-top + `crownPadding` lands exactly on it.
|
|
219
|
-
*
|
|
220
|
-
* With all-default params every step is an exact no-op (multiplies by 1.0,
|
|
221
|
-
* adds 0.0), so the default rig is bit-identical to the reference table —
|
|
222
|
-
* that is what keeps the Phase-1 PoC fixture's committed render valid.
|
|
223
|
-
*
|
|
224
|
-
* CLIP COMPATIBILITY (the reviewer-flagged trap): animation clips carry
|
|
225
|
-
* per-bone `.position` tracks baked for the SOURCE rig's segment lengths.
|
|
226
|
-
* Played raw on a rescaled skeleton they would snap limbs back to source
|
|
227
|
-
* proportions. The contract here is split with `clips.ts`: this function
|
|
228
|
-
* only rescales REST translations and reports `hipsPositionScale`;
|
|
229
|
-
* `retargetClipToHumanoid` drops every non-hips translation track (bones
|
|
230
|
-
* keep these rest translations) and remaps the hips track by that factor —
|
|
231
|
-
* the standard humanoid-retarget policy.
|
|
232
|
-
*/
|
|
233
|
-
export function scaleSkeletonDef(params, crownPadding) {
|
|
234
|
-
const base = MIXAMO_SKELETON_DEF;
|
|
235
|
-
const groupFactor = (name) => {
|
|
236
|
-
if (TORSO_LENGTH_BONES.has(name))
|
|
237
|
-
return params.torsoLength;
|
|
238
|
-
if (HEAD_LENGTH_BONES.has(name))
|
|
239
|
-
return params.headSize;
|
|
240
|
-
if (ARM_LENGTH_BONES.has(name))
|
|
241
|
-
return params.armLength;
|
|
242
|
-
if (LEG_LENGTH_BONES.has(name))
|
|
243
|
-
return params.legLength;
|
|
244
|
-
if (CLAVICLE_BONES.has(name))
|
|
245
|
-
return params.shoulderWidth;
|
|
246
|
-
return 1;
|
|
247
|
-
};
|
|
248
|
-
const scaled = base.map(([name, parent, t, r]) => {
|
|
249
|
-
const k = groupFactor(name);
|
|
250
|
-
let [x, y, z] = [t[0] * k, t[1] * k, t[2] * k];
|
|
251
|
-
if (SHOULDER_X_BONES.has(name))
|
|
252
|
-
x = t[0] * params.shoulderWidth;
|
|
253
|
-
if (HIP_X_BONES.has(name))
|
|
254
|
-
x = t[0] * params.hipWidth;
|
|
255
|
-
return [name, parent, [x, y, z], r];
|
|
256
|
-
});
|
|
257
|
-
// 2. Re-ground the hips against the reference clearance.
|
|
258
|
-
const reference = measureSkeleton(base);
|
|
259
|
-
const current = measureSkeleton(scaled);
|
|
260
|
-
const groundDeltaM = reference.minFootY - current.minFootY;
|
|
261
|
-
const hips = scaled[0];
|
|
262
|
-
const hipsT = [
|
|
263
|
-
hips[2][0],
|
|
264
|
-
hips[2][1],
|
|
265
|
-
hips[2][2] + groundDeltaM / ARMATURE_SCALE,
|
|
266
|
-
];
|
|
267
|
-
scaled[0] = [hips[0], hips[1], hipsT, hips[3]];
|
|
268
|
-
// 3. Height normalization.
|
|
269
|
-
const naturalHeight = current.headTopY + groundDeltaM + crownPadding;
|
|
270
|
-
const heightFactor = params.height !== undefined ? params.height / naturalHeight : 1;
|
|
271
|
-
const finalDefs = heightFactor === 1
|
|
272
|
-
? scaled
|
|
273
|
-
: scaled.map(([name, parent, t, r]) => [
|
|
274
|
-
name,
|
|
275
|
-
parent,
|
|
276
|
-
[t[0] * heightFactor, t[1] * heightFactor, t[2] * heightFactor],
|
|
277
|
-
r,
|
|
278
|
-
]);
|
|
279
|
-
const baseHips = base[0][2];
|
|
280
|
-
const finalHips = finalDefs[0][2];
|
|
281
|
-
const hipsPositionScale = Math.hypot(finalHips[0], finalHips[1], finalHips[2]) /
|
|
282
|
-
Math.hypot(baseHips[0], baseHips[1], baseHips[2]);
|
|
283
|
-
return {
|
|
284
|
-
defs: finalDefs,
|
|
285
|
-
heightFactor,
|
|
286
|
-
height: naturalHeight * heightFactor,
|
|
287
|
-
hipsPositionScale,
|
|
288
|
-
};
|
|
289
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@vgai/engine`'s package `"."` entry — what `import '@vgai/engine'`
|
|
3
|
-
* resolves to.
|
|
4
|
-
*
|
|
5
|
-
* This is a SMALL, CURATED barrel, not a re-export-everything convenience
|
|
6
|
-
* import. The engine's own doctrine (CLAUDE.md: "the engine code in
|
|
7
|
-
* `packages/engine/src/` is meant to be read and edited directly — it is
|
|
8
|
-
* not a black-box library") means subpath imports
|
|
9
|
-
* (`@vgai/engine/<path>`, matching this package's `"./*"` exports entry)
|
|
10
|
-
* remain the primary way to reach engine internals — reach for a subpath
|
|
11
|
-
* first. This barrel exists only so the package's bare-name entry point is
|
|
12
|
-
* HONEST (resolves to something real and useful) instead of dangling; it
|
|
13
|
-
* covers just the handful of symbols a game/consumer needs to author a
|
|
14
|
-
* first-party `setup()` and mount it, plus the scene/manifest file
|
|
15
|
-
* entry points. Keep it small when extending it — prefer a new subpath
|
|
16
|
-
* export over growing this file into a firehose.
|
|
17
|
-
*
|
|
18
|
-
* Groups (import order below is alphabetical-by-specifier, per the repo's
|
|
19
|
-
* biome `organizeImports` rule, not by group — see this list instead):
|
|
20
|
-
* - game setup contract: `GameContext`/`GameCleanup`/`GameSetupFn`, `fromSetup`
|
|
21
|
-
* - component model: `GameComponent`, `AdapterSurface`
|
|
22
|
-
* - manifest-driven mount: `mountManifestWorlds` + its option/result types
|
|
23
|
-
* - scene file entry point: `parseSceneFile`/`parsePrefabFile`
|
|
24
|
-
* - game manifest (vgai.game.json) entry point: `loadGameManifest`
|
|
25
|
-
*/
|
|
26
|
-
export type { AdapterSurface } from './adapter/adapter-surface';
|
|
27
|
-
export { fromSetup } from './adapter/vgai-scene-game-adapter';
|
|
28
|
-
export { GameComponent } from './ecs/game-component';
|
|
29
|
-
export type { AdapterRoot, GameManifest, ResolvedAdapter, ResolvedAdapterRoot, ResolvedGameManifest, RootAdapter, } from './manifest';
|
|
30
|
-
export { CAPABILITY_CEILINGS, DEFAULT_SERVER_MODULE, loadGameManifest } from './manifest';
|
|
31
|
-
export type { GameSession } from './runtime/create-runtime';
|
|
32
|
-
export type { MountEntry, MountedManifestSession, MountManifestOptions, } from './runtime/mount-manifest';
|
|
33
|
-
export { mountManifestWorlds } from './runtime/mount-manifest';
|
|
34
|
-
export type { GameCleanup, GameContext, GameSetupFn } from './runtime/types';
|
|
35
|
-
export { parsePrefabFile, parseSceneFile, SceneParseError } from './scene/parse';
|
|
36
|
-
export type { PrefabFile, SceneFile } from './scene/schema';
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC1F,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EACV,UAAU,EACV,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACjF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@vgai/engine`'s package `"."` entry — what `import '@vgai/engine'`
|
|
3
|
-
* resolves to.
|
|
4
|
-
*
|
|
5
|
-
* This is a SMALL, CURATED barrel, not a re-export-everything convenience
|
|
6
|
-
* import. The engine's own doctrine (CLAUDE.md: "the engine code in
|
|
7
|
-
* `packages/engine/src/` is meant to be read and edited directly — it is
|
|
8
|
-
* not a black-box library") means subpath imports
|
|
9
|
-
* (`@vgai/engine/<path>`, matching this package's `"./*"` exports entry)
|
|
10
|
-
* remain the primary way to reach engine internals — reach for a subpath
|
|
11
|
-
* first. This barrel exists only so the package's bare-name entry point is
|
|
12
|
-
* HONEST (resolves to something real and useful) instead of dangling; it
|
|
13
|
-
* covers just the handful of symbols a game/consumer needs to author a
|
|
14
|
-
* first-party `setup()` and mount it, plus the scene/manifest file
|
|
15
|
-
* entry points. Keep it small when extending it — prefer a new subpath
|
|
16
|
-
* export over growing this file into a firehose.
|
|
17
|
-
*
|
|
18
|
-
* Groups (import order below is alphabetical-by-specifier, per the repo's
|
|
19
|
-
* biome `organizeImports` rule, not by group — see this list instead):
|
|
20
|
-
* - game setup contract: `GameContext`/`GameCleanup`/`GameSetupFn`, `fromSetup`
|
|
21
|
-
* - component model: `GameComponent`, `AdapterSurface`
|
|
22
|
-
* - manifest-driven mount: `mountManifestWorlds` + its option/result types
|
|
23
|
-
* - scene file entry point: `parseSceneFile`/`parsePrefabFile`
|
|
24
|
-
* - game manifest (vgai.game.json) entry point: `loadGameManifest`
|
|
25
|
-
*/
|
|
26
|
-
export { fromSetup } from './adapter/vgai-scene-game-adapter';
|
|
27
|
-
export { GameComponent } from './ecs/game-component';
|
|
28
|
-
export { CAPABILITY_CEILINGS, DEFAULT_SERVER_MODULE, loadGameManifest } from './manifest';
|
|
29
|
-
export { mountManifestWorlds } from './runtime/mount-manifest';
|
|
30
|
-
export { parsePrefabFile, parseSceneFile, SceneParseError } from './scene/parse';
|