@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.
Files changed (538) hide show
  1. package/package.json +1 -1
  2. package/schemas/engine-capabilities.json +4 -4
  3. package/schemas/vgai-game.schema.json +2 -2
  4. package/src/adapter/authoring.ts +42 -0
  5. package/src/adapter/index.ts +3 -0
  6. package/src/adapter/ingest/overlay-apply.ts +50 -6
  7. package/src/adapter/ingest/scene-capture.ts +51 -2
  8. package/src/adapter/vgai-scene-game-adapter.ts +24 -0
  9. package/src/manifest/schema.ts +7 -3
  10. package/src/runtime/create-runtime.ts +97 -0
  11. package/src/runtime/game.ts +11 -1
  12. package/src/scene/asset-ref-check.ts +1 -1
  13. package/src/scene/scene-loader.ts +2 -2
  14. package/src/scene/user-data.ts +18 -0
  15. package/src/world3d-react/behavior.tsx +19 -11
  16. package/src/world3d-react/r3f-adapter.tsx +8 -0
  17. package/dist/adapter/adapter-surface.d.ts +0 -30
  18. package/dist/adapter/adapter-surface.d.ts.map +0 -1
  19. package/dist/adapter/adapter-surface.js +0 -18
  20. package/dist/adapter/authoring.d.ts +0 -461
  21. package/dist/adapter/authoring.d.ts.map +0 -1
  22. package/dist/adapter/authoring.js +0 -22
  23. package/dist/adapter/colyseus-networking-adapter.d.ts +0 -43
  24. package/dist/adapter/colyseus-networking-adapter.d.ts.map +0 -1
  25. package/dist/adapter/colyseus-networking-adapter.js +0 -38
  26. package/dist/adapter/first-party-systems.d.ts +0 -38
  27. package/dist/adapter/first-party-systems.d.ts.map +0 -1
  28. package/dist/adapter/first-party-systems.js +0 -77
  29. package/dist/adapter/game-adapter.d.ts +0 -133
  30. package/dist/adapter/game-adapter.d.ts.map +0 -1
  31. package/dist/adapter/game-adapter.js +0 -10
  32. package/dist/adapter/host-context.d.ts +0 -71
  33. package/dist/adapter/host-context.d.ts.map +0 -1
  34. package/dist/adapter/host-context.js +0 -16
  35. package/dist/adapter/index.d.ts +0 -22
  36. package/dist/adapter/index.d.ts.map +0 -1
  37. package/dist/adapter/index.js +0 -15
  38. package/dist/adapter/ingest/game-contract.d.ts +0 -53
  39. package/dist/adapter/ingest/game-contract.d.ts.map +0 -1
  40. package/dist/adapter/ingest/game-contract.js +0 -30
  41. package/dist/adapter/ingest/overlay-applier.d.ts +0 -118
  42. package/dist/adapter/ingest/overlay-applier.d.ts.map +0 -1
  43. package/dist/adapter/ingest/overlay-applier.js +0 -132
  44. package/dist/adapter/ingest/overlay-apply.d.ts +0 -60
  45. package/dist/adapter/ingest/overlay-apply.d.ts.map +0 -1
  46. package/dist/adapter/ingest/overlay-apply.js +0 -101
  47. package/dist/adapter/ingest/overlay-file.d.ts +0 -79
  48. package/dist/adapter/ingest/overlay-file.d.ts.map +0 -1
  49. package/dist/adapter/ingest/overlay-file.js +0 -66
  50. package/dist/adapter/ingest/overlay-report.d.ts +0 -113
  51. package/dist/adapter/ingest/overlay-report.d.ts.map +0 -1
  52. package/dist/adapter/ingest/overlay-report.js +0 -103
  53. package/dist/adapter/ingest/scene-capture.d.ts +0 -97
  54. package/dist/adapter/ingest/scene-capture.d.ts.map +0 -1
  55. package/dist/adapter/ingest/scene-capture.js +0 -248
  56. package/dist/adapter/ingest/upstream-pin.d.ts +0 -47
  57. package/dist/adapter/ingest/upstream-pin.d.ts.map +0 -1
  58. package/dist/adapter/ingest/upstream-pin.js +0 -50
  59. package/dist/adapter/loop-gate-report.d.ts +0 -34
  60. package/dist/adapter/loop-gate-report.d.ts.map +0 -1
  61. package/dist/adapter/loop-gate-report.js +0 -37
  62. package/dist/adapter/rapier-physics-adapter.d.ts +0 -12
  63. package/dist/adapter/rapier-physics-adapter.d.ts.map +0 -1
  64. package/dist/adapter/rapier-physics-adapter.js +0 -46
  65. package/dist/adapter/system-adapter.d.ts +0 -206
  66. package/dist/adapter/system-adapter.d.ts.map +0 -1
  67. package/dist/adapter/system-adapter.js +0 -13
  68. package/dist/adapter/transform.d.ts +0 -18
  69. package/dist/adapter/transform.d.ts.map +0 -1
  70. package/dist/adapter/transform.js +0 -1
  71. package/dist/adapter/vgai-scene-game-adapter.d.ts +0 -108
  72. package/dist/adapter/vgai-scene-game-adapter.d.ts.map +0 -1
  73. package/dist/adapter/vgai-scene-game-adapter.js +0 -762
  74. package/dist/ai/navigation.d.ts +0 -64
  75. package/dist/ai/navigation.d.ts.map +0 -1
  76. package/dist/ai/navigation.js +0 -133
  77. package/dist/animation/anim-graph-types.d.ts +0 -25
  78. package/dist/animation/anim-graph-types.d.ts.map +0 -1
  79. package/dist/animation/anim-graph-types.js +0 -1
  80. package/dist/animation/animation-clock.d.ts +0 -213
  81. package/dist/animation/animation-clock.d.ts.map +0 -1
  82. package/dist/animation/animation-clock.js +0 -301
  83. package/dist/animation/blend-node.d.ts +0 -22
  84. package/dist/animation/blend-node.d.ts.map +0 -1
  85. package/dist/animation/blend-node.js +0 -97
  86. package/dist/animation/camera-ownership.d.ts +0 -250
  87. package/dist/animation/camera-ownership.d.ts.map +0 -1
  88. package/dist/animation/camera-ownership.js +0 -169
  89. package/dist/animation/cinematic-cues.d.ts +0 -200
  90. package/dist/animation/cinematic-cues.d.ts.map +0 -1
  91. package/dist/animation/cinematic-cues.js +0 -213
  92. package/dist/animation/clip-map.d.ts +0 -12
  93. package/dist/animation/clip-map.d.ts.map +0 -1
  94. package/dist/animation/clip-map.js +0 -37
  95. package/dist/animation/gsap-registration.d.ts +0 -119
  96. package/dist/animation/gsap-registration.d.ts.map +0 -1
  97. package/dist/animation/gsap-registration.js +0 -92
  98. package/dist/animation/theatre-clock-binding.d.ts +0 -89
  99. package/dist/animation/theatre-clock-binding.d.ts.map +0 -1
  100. package/dist/animation/theatre-clock-binding.js +0 -29
  101. package/dist/animation/theatre-director.d.ts +0 -242
  102. package/dist/animation/theatre-director.d.ts.map +0 -1
  103. package/dist/animation/theatre-director.js +0 -235
  104. package/dist/animation/theatre-object-binding.d.ts +0 -305
  105. package/dist/animation/theatre-object-binding.d.ts.map +0 -1
  106. package/dist/animation/theatre-object-binding.js +0 -351
  107. package/dist/animation/xstate-animation-binding.d.ts +0 -56
  108. package/dist/animation/xstate-animation-binding.d.ts.map +0 -1
  109. package/dist/animation/xstate-animation-binding.js +0 -331
  110. package/dist/animation/xstate-animation-meta.d.ts +0 -266
  111. package/dist/animation/xstate-animation-meta.d.ts.map +0 -1
  112. package/dist/animation/xstate-animation-meta.js +0 -252
  113. package/dist/assets.d.ts +0 -26
  114. package/dist/assets.d.ts.map +0 -1
  115. package/dist/assets.js +0 -55
  116. package/dist/audio/index.d.ts +0 -4
  117. package/dist/audio/index.d.ts.map +0 -1
  118. package/dist/audio/index.js +0 -24
  119. package/dist/audio/tone-clock-binding.d.ts +0 -75
  120. package/dist/audio/tone-clock-binding.d.ts.map +0 -1
  121. package/dist/audio/tone-clock-binding.js +0 -29
  122. package/dist/audio/tone-context.d.ts +0 -114
  123. package/dist/audio/tone-context.d.ts.map +0 -1
  124. package/dist/audio/tone-context.js +0 -39
  125. package/dist/audio/tone-offline-render.d.ts +0 -90
  126. package/dist/audio/tone-offline-render.d.ts.map +0 -1
  127. package/dist/audio/tone-offline-render.js +0 -56
  128. package/dist/audio/wav-encode.d.ts +0 -38
  129. package/dist/audio/wav-encode.d.ts.map +0 -1
  130. package/dist/audio/wav-encode.js +0 -97
  131. package/dist/character/cloth-sim.d.ts +0 -179
  132. package/dist/character/cloth-sim.d.ts.map +0 -1
  133. package/dist/character/cloth-sim.js +0 -334
  134. package/dist/character/spring-chain.d.ts +0 -135
  135. package/dist/character/spring-chain.d.ts.map +0 -1
  136. package/dist/character/spring-chain.js +0 -165
  137. package/dist/core/game-loop.d.ts +0 -42
  138. package/dist/core/game-loop.d.ts.map +0 -1
  139. package/dist/core/game-loop.js +0 -167
  140. package/dist/core/seeded-random.d.ts +0 -69
  141. package/dist/core/seeded-random.d.ts.map +0 -1
  142. package/dist/core/seeded-random.js +0 -121
  143. package/dist/core/system-runner.d.ts +0 -120
  144. package/dist/core/system-runner.d.ts.map +0 -1
  145. package/dist/core/system-runner.js +0 -297
  146. package/dist/core/types.d.ts +0 -92
  147. package/dist/core/types.d.ts.map +0 -1
  148. package/dist/core/types.js +0 -25
  149. package/dist/data/data-asset.d.ts +0 -101
  150. package/dist/data/data-asset.d.ts.map +0 -1
  151. package/dist/data/data-asset.js +0 -122
  152. package/dist/data/data-check-core.d.ts +0 -110
  153. package/dist/data/data-check-core.d.ts.map +0 -1
  154. package/dist/data/data-check-core.js +0 -178
  155. package/dist/data/data-ref.d.ts +0 -79
  156. package/dist/data/data-ref.d.ts.map +0 -1
  157. package/dist/data/data-ref.js +0 -130
  158. package/dist/data/vite-plugin-data.d.ts +0 -79
  159. package/dist/data/vite-plugin-data.d.ts.map +0 -1
  160. package/dist/data/vite-plugin-data.js +0 -217
  161. package/dist/dev/console-bridge.d.ts +0 -22
  162. package/dist/dev/console-bridge.d.ts.map +0 -1
  163. package/dist/dev/console-bridge.js +0 -71
  164. package/dist/dev/debug-draw.d.ts +0 -24
  165. package/dist/dev/debug-draw.d.ts.map +0 -1
  166. package/dist/dev/debug-draw.js +0 -73
  167. package/dist/dev/logger.d.ts +0 -30
  168. package/dist/dev/logger.d.ts.map +0 -1
  169. package/dist/dev/logger.js +0 -90
  170. package/dist/dev/performance-profiler.d.ts +0 -60
  171. package/dist/dev/performance-profiler.d.ts.map +0 -1
  172. package/dist/dev/performance-profiler.js +0 -181
  173. package/dist/dev/webgl-gpu-timer.d.ts +0 -8
  174. package/dist/dev/webgl-gpu-timer.d.ts.map +0 -1
  175. package/dist/dev/webgl-gpu-timer.js +0 -52
  176. package/dist/ecs/component-manager.d.ts +0 -205
  177. package/dist/ecs/component-manager.d.ts.map +0 -1
  178. package/dist/ecs/component-manager.js +0 -706
  179. package/dist/ecs/game-component.d.ts +0 -146
  180. package/dist/ecs/game-component.d.ts.map +0 -1
  181. package/dist/ecs/game-component.js +0 -141
  182. package/dist/ecs/hmr-swap-report.d.ts +0 -53
  183. package/dist/ecs/hmr-swap-report.d.ts.map +0 -1
  184. package/dist/ecs/hmr-swap-report.js +0 -55
  185. package/dist/humanoid/bake.operation.d.ts +0 -119
  186. package/dist/humanoid/bake.operation.d.ts.map +0 -1
  187. package/dist/humanoid/bake.operation.js +0 -228
  188. package/dist/humanoid/body.d.ts +0 -101
  189. package/dist/humanoid/body.d.ts.map +0 -1
  190. package/dist/humanoid/body.js +0 -530
  191. package/dist/humanoid/clips.d.ts +0 -62
  192. package/dist/humanoid/clips.d.ts.map +0 -1
  193. package/dist/humanoid/clips.js +0 -121
  194. package/dist/humanoid/compose.d.ts +0 -75
  195. package/dist/humanoid/compose.d.ts.map +0 -1
  196. package/dist/humanoid/compose.js +0 -176
  197. package/dist/humanoid/generate.d.ts +0 -92
  198. package/dist/humanoid/generate.d.ts.map +0 -1
  199. package/dist/humanoid/generate.js +0 -124
  200. package/dist/humanoid/index.d.ts +0 -24
  201. package/dist/humanoid/index.d.ts.map +0 -1
  202. package/dist/humanoid/index.js +0 -18
  203. package/dist/humanoid/schema.d.ts +0 -35
  204. package/dist/humanoid/schema.d.ts.map +0 -1
  205. package/dist/humanoid/schema.js +0 -87
  206. package/dist/humanoid/skeleton.d.ts +0 -103
  207. package/dist/humanoid/skeleton.d.ts.map +0 -1
  208. package/dist/humanoid/skeleton.js +0 -289
  209. package/dist/index.d.ts +0 -37
  210. package/dist/index.d.ts.map +0 -1
  211. package/dist/index.js +0 -30
  212. package/dist/input/input-manager.d.ts +0 -945
  213. package/dist/input/input-manager.d.ts.map +0 -1
  214. package/dist/input/input-manager.js +0 -2207
  215. package/dist/input/input-types.d.ts +0 -174
  216. package/dist/input/input-types.d.ts.map +0 -1
  217. package/dist/input/input-types.js +0 -1
  218. package/dist/input/prompt-labels.d.ts +0 -21
  219. package/dist/input/prompt-labels.d.ts.map +0 -1
  220. package/dist/input/prompt-labels.js +0 -121
  221. package/dist/input/rebind-controller.d.ts +0 -59
  222. package/dist/input/rebind-controller.d.ts.map +0 -1
  223. package/dist/input/rebind-controller.js +0 -85
  224. package/dist/input/schema.d.ts +0 -16
  225. package/dist/input/schema.d.ts.map +0 -1
  226. package/dist/input/schema.js +0 -228
  227. package/dist/loader.d.ts +0 -43
  228. package/dist/loader.d.ts.map +0 -1
  229. package/dist/loader.js +0 -59
  230. package/dist/manifest/index.d.ts +0 -5
  231. package/dist/manifest/index.d.ts.map +0 -1
  232. package/dist/manifest/index.js +0 -8
  233. package/dist/manifest/load-file.d.ts +0 -4
  234. package/dist/manifest/load-file.d.ts.map +0 -1
  235. package/dist/manifest/load-file.js +0 -14
  236. package/dist/manifest/load.d.ts +0 -144
  237. package/dist/manifest/load.d.ts.map +0 -1
  238. package/dist/manifest/load.js +0 -273
  239. package/dist/manifest/schema.d.ts +0 -230
  240. package/dist/manifest/schema.d.ts.map +0 -1
  241. package/dist/manifest/schema.js +0 -394
  242. package/dist/physics/collision-system.d.ts +0 -41
  243. package/dist/physics/collision-system.d.ts.map +0 -1
  244. package/dist/physics/collision-system.js +0 -64
  245. package/dist/physics/physics-registry.d.ts +0 -45
  246. package/dist/physics/physics-registry.d.ts.map +0 -1
  247. package/dist/physics/physics-registry.js +0 -65
  248. package/dist/physics/transform-writer.d.ts +0 -16
  249. package/dist/physics/transform-writer.d.ts.map +0 -1
  250. package/dist/physics/transform-writer.js +0 -38
  251. package/dist/physics/trigger-dispatch.d.ts +0 -24
  252. package/dist/physics/trigger-dispatch.d.ts.map +0 -1
  253. package/dist/physics/trigger-dispatch.js +0 -80
  254. package/dist/react/game-state.d.ts +0 -156
  255. package/dist/react/game-state.d.ts.map +0 -1
  256. package/dist/react/game-state.js +0 -222
  257. package/dist/react/root-adapter.d.ts +0 -11
  258. package/dist/react/root-adapter.d.ts.map +0 -1
  259. package/dist/react/root-adapter.js +0 -41
  260. package/dist/react/unmanaged-root-detector.d.ts +0 -12
  261. package/dist/react/unmanaged-root-detector.d.ts.map +0 -1
  262. package/dist/react/unmanaged-root-detector.js +0 -45
  263. package/dist/react/use-data.d.ts +0 -60
  264. package/dist/react/use-data.d.ts.map +0 -1
  265. package/dist/react/use-data.js +0 -101
  266. package/dist/react/use-selection.d.ts +0 -75
  267. package/dist/react/use-selection.d.ts.map +0 -1
  268. package/dist/react/use-selection.js +0 -90
  269. package/dist/render/auto-batcher.d.ts +0 -34
  270. package/dist/render/auto-batcher.d.ts.map +0 -1
  271. package/dist/render/auto-batcher.js +0 -140
  272. package/dist/render/render-batch-system.d.ts +0 -33
  273. package/dist/render/render-batch-system.d.ts.map +0 -1
  274. package/dist/render/render-batch-system.js +0 -230
  275. package/dist/render/render-features.d.ts +0 -47
  276. package/dist/render/render-features.d.ts.map +0 -1
  277. package/dist/render/render-features.js +0 -105
  278. package/dist/render/render-settings.d.ts +0 -36
  279. package/dist/render/render-settings.d.ts.map +0 -1
  280. package/dist/render/render-settings.js +0 -51
  281. package/dist/runtime/create-runtime.d.ts +0 -249
  282. package/dist/runtime/create-runtime.d.ts.map +0 -1
  283. package/dist/runtime/create-runtime.js +0 -641
  284. package/dist/runtime/debug-bridge.d.ts +0 -257
  285. package/dist/runtime/debug-bridge.d.ts.map +0 -1
  286. package/dist/runtime/debug-bridge.js +0 -224
  287. package/dist/runtime/debug-registry.d.ts +0 -288
  288. package/dist/runtime/debug-registry.d.ts.map +0 -1
  289. package/dist/runtime/debug-registry.js +0 -513
  290. package/dist/runtime/frame-selector-cache.d.ts +0 -41
  291. package/dist/runtime/frame-selector-cache.d.ts.map +0 -1
  292. package/dist/runtime/frame-selector-cache.js +0 -65
  293. package/dist/runtime/game.d.ts +0 -496
  294. package/dist/runtime/game.d.ts.map +0 -1
  295. package/dist/runtime/game.js +0 -741
  296. package/dist/runtime/gameplay-rng-trap.d.ts +0 -48
  297. package/dist/runtime/gameplay-rng-trap.d.ts.map +0 -1
  298. package/dist/runtime/gameplay-rng-trap.js +0 -96
  299. package/dist/runtime/input-router.d.ts +0 -78
  300. package/dist/runtime/input-router.d.ts.map +0 -1
  301. package/dist/runtime/input-router.js +0 -171
  302. package/dist/runtime/mount-game.d.ts +0 -129
  303. package/dist/runtime/mount-game.d.ts.map +0 -1
  304. package/dist/runtime/mount-game.js +0 -152
  305. package/dist/runtime/mount-manifest.d.ts +0 -173
  306. package/dist/runtime/mount-manifest.d.ts.map +0 -1
  307. package/dist/runtime/mount-manifest.js +0 -297
  308. package/dist/runtime/render-audio-control.d.ts +0 -110
  309. package/dist/runtime/render-audio-control.d.ts.map +0 -1
  310. package/dist/runtime/render-audio-control.js +0 -111
  311. package/dist/runtime/render-control.d.ts +0 -291
  312. package/dist/runtime/render-control.d.ts.map +0 -1
  313. package/dist/runtime/render-control.js +0 -264
  314. package/dist/runtime/render-seed.d.ts +0 -57
  315. package/dist/runtime/render-seed.d.ts.map +0 -1
  316. package/dist/runtime/render-seed.js +0 -74
  317. package/dist/runtime/state-bridge.d.ts +0 -61
  318. package/dist/runtime/state-bridge.d.ts.map +0 -1
  319. package/dist/runtime/state-bridge.js +0 -63
  320. package/dist/runtime/types.d.ts +0 -253
  321. package/dist/runtime/types.d.ts.map +0 -1
  322. package/dist/runtime/types.js +0 -1
  323. package/dist/scene/asset-loaders.d.ts +0 -79
  324. package/dist/scene/asset-loaders.d.ts.map +0 -1
  325. package/dist/scene/asset-loaders.js +0 -141
  326. package/dist/scene/asset-paths.d.ts +0 -11
  327. package/dist/scene/asset-paths.d.ts.map +0 -1
  328. package/dist/scene/asset-paths.js +0 -108
  329. package/dist/scene/asset-ref-check.d.ts +0 -88
  330. package/dist/scene/asset-ref-check.d.ts.map +0 -1
  331. package/dist/scene/asset-ref-check.js +0 -214
  332. package/dist/scene/asset-registry.d.ts +0 -38
  333. package/dist/scene/asset-registry.d.ts.map +0 -1
  334. package/dist/scene/asset-registry.js +0 -66
  335. package/dist/scene/collider-dimensions.d.ts +0 -63
  336. package/dist/scene/collider-dimensions.d.ts.map +0 -1
  337. package/dist/scene/collider-dimensions.js +0 -98
  338. package/dist/scene/component-registry.d.ts +0 -22
  339. package/dist/scene/component-registry.d.ts.map +0 -1
  340. package/dist/scene/component-registry.js +0 -37
  341. package/dist/scene/defaults.d.ts +0 -252
  342. package/dist/scene/defaults.d.ts.map +0 -1
  343. package/dist/scene/defaults.js +0 -151
  344. package/dist/scene/geometries/index.d.ts +0 -8
  345. package/dist/scene/geometries/index.d.ts.map +0 -1
  346. package/dist/scene/geometries/index.js +0 -7
  347. package/dist/scene/geometries/terrain.d.ts +0 -2
  348. package/dist/scene/geometries/terrain.d.ts.map +0 -1
  349. package/dist/scene/geometries/terrain.js +0 -37
  350. package/dist/scene/geometry-registry.d.ts +0 -24
  351. package/dist/scene/geometry-registry.d.ts.map +0 -1
  352. package/dist/scene/geometry-registry.js +0 -20
  353. package/dist/scene/instance-registry.d.ts +0 -36
  354. package/dist/scene/instance-registry.d.ts.map +0 -1
  355. package/dist/scene/instance-registry.js +0 -55
  356. package/dist/scene/instancers/grid.d.ts +0 -2
  357. package/dist/scene/instancers/grid.d.ts.map +0 -1
  358. package/dist/scene/instancers/grid.js +0 -36
  359. package/dist/scene/instancers/index.d.ts +0 -8
  360. package/dist/scene/instancers/index.d.ts.map +0 -1
  361. package/dist/scene/instancers/index.js +0 -7
  362. package/dist/scene/light-camera-factory.d.ts +0 -23
  363. package/dist/scene/light-camera-factory.d.ts.map +0 -1
  364. package/dist/scene/light-camera-factory.js +0 -68
  365. package/dist/scene/material-factory.d.ts +0 -17
  366. package/dist/scene/material-factory.d.ts.map +0 -1
  367. package/dist/scene/material-factory.js +0 -197
  368. package/dist/scene/material-registry.d.ts +0 -40
  369. package/dist/scene/material-registry.d.ts.map +0 -1
  370. package/dist/scene/material-registry.js +0 -44
  371. package/dist/scene/materials/index.d.ts +0 -8
  372. package/dist/scene/materials/index.d.ts.map +0 -1
  373. package/dist/scene/materials/index.js +0 -7
  374. package/dist/scene/materials/water.d.ts +0 -2
  375. package/dist/scene/materials/water.d.ts.map +0 -1
  376. package/dist/scene/materials/water.js +0 -54
  377. package/dist/scene/parse.d.ts +0 -23
  378. package/dist/scene/parse.d.ts.map +0 -1
  379. package/dist/scene/parse.js +0 -179
  380. package/dist/scene/particles-factory.d.ts +0 -33
  381. package/dist/scene/particles-factory.d.ts.map +0 -1
  382. package/dist/scene/particles-factory.js +0 -282
  383. package/dist/scene/scene-apply.d.ts +0 -109
  384. package/dist/scene/scene-apply.d.ts.map +0 -1
  385. package/dist/scene/scene-apply.js +0 -370
  386. package/dist/scene/scene-diff-schema.d.ts +0 -285
  387. package/dist/scene/scene-diff-schema.d.ts.map +0 -1
  388. package/dist/scene/scene-diff-schema.js +0 -92
  389. package/dist/scene/scene-diff-types.d.ts +0 -40
  390. package/dist/scene/scene-diff-types.d.ts.map +0 -1
  391. package/dist/scene/scene-diff-types.js +0 -14
  392. package/dist/scene/scene-loader.d.ts +0 -167
  393. package/dist/scene/scene-loader.d.ts.map +0 -1
  394. package/dist/scene/scene-loader.js +0 -1211
  395. package/dist/scene/scene-query.d.ts +0 -11
  396. package/dist/scene/scene-query.d.ts.map +0 -1
  397. package/dist/scene/scene-query.js +0 -63
  398. package/dist/scene/scene-types.d.ts +0 -10
  399. package/dist/scene/scene-types.d.ts.map +0 -1
  400. package/dist/scene/scene-types.js +0 -8
  401. package/dist/scene/scene-version.d.ts +0 -26
  402. package/dist/scene/scene-version.d.ts.map +0 -1
  403. package/dist/scene/scene-version.js +0 -34
  404. package/dist/scene/schema/animation.d.ts +0 -8
  405. package/dist/scene/schema/animation.d.ts.map +0 -1
  406. package/dist/scene/schema/animation.js +0 -42
  407. package/dist/scene/schema/audio.d.ts +0 -13
  408. package/dist/scene/schema/audio.d.ts.map +0 -1
  409. package/dist/scene/schema/audio.js +0 -22
  410. package/dist/scene/schema/camera.d.ts +0 -28
  411. package/dist/scene/schema/camera.d.ts.map +0 -1
  412. package/dist/scene/schema/camera.js +0 -17
  413. package/dist/scene/schema/collider.d.ts +0 -40
  414. package/dist/scene/schema/collider.d.ts.map +0 -1
  415. package/dist/scene/schema/collider.js +0 -55
  416. package/dist/scene/schema/entity-ref.d.ts +0 -31
  417. package/dist/scene/schema/entity-ref.d.ts.map +0 -1
  418. package/dist/scene/schema/entity-ref.js +0 -61
  419. package/dist/scene/schema/entity.d.ts +0 -1036
  420. package/dist/scene/schema/entity.d.ts.map +0 -1
  421. package/dist/scene/schema/entity.js +0 -153
  422. package/dist/scene/schema/environment.d.ts +0 -425
  423. package/dist/scene/schema/environment.d.ts.map +0 -1
  424. package/dist/scene/schema/environment.js +0 -357
  425. package/dist/scene/schema/index.d.ts +0 -37
  426. package/dist/scene/schema/index.d.ts.map +0 -1
  427. package/dist/scene/schema/index.js +0 -19
  428. package/dist/scene/schema/instances.d.ts +0 -14
  429. package/dist/scene/schema/instances.d.ts.map +0 -1
  430. package/dist/scene/schema/instances.js +0 -28
  431. package/dist/scene/schema/joint.d.ts +0 -23
  432. package/dist/scene/schema/joint.d.ts.map +0 -1
  433. package/dist/scene/schema/joint.js +0 -23
  434. package/dist/scene/schema/light.d.ts +0 -38
  435. package/dist/scene/schema/light.d.ts.map +0 -1
  436. package/dist/scene/schema/light.js +0 -26
  437. package/dist/scene/schema/material.d.ts +0 -199
  438. package/dist/scene/schema/material.d.ts.map +0 -1
  439. package/dist/scene/schema/material.js +0 -103
  440. package/dist/scene/schema/mesh.d.ts +0 -48
  441. package/dist/scene/schema/mesh.d.ts.map +0 -1
  442. package/dist/scene/schema/mesh.js +0 -82
  443. package/dist/scene/schema/particles.d.ts +0 -2178
  444. package/dist/scene/schema/particles.d.ts.map +0 -1
  445. package/dist/scene/schema/particles.js +0 -321
  446. package/dist/scene/schema/physics.d.ts +0 -56
  447. package/dist/scene/schema/physics.d.ts.map +0 -1
  448. package/dist/scene/schema/physics.js +0 -37
  449. package/dist/scene/schema/scene-file.d.ts +0 -303
  450. package/dist/scene/schema/scene-file.d.ts.map +0 -1
  451. package/dist/scene/schema/scene-file.js +0 -256
  452. package/dist/scene/schema/shadow.d.ts +0 -28
  453. package/dist/scene/schema/shadow.d.ts.map +0 -1
  454. package/dist/scene/schema/shadow.js +0 -20
  455. package/dist/scene/schema/spline.d.ts +0 -25
  456. package/dist/scene/schema/spline.d.ts.map +0 -1
  457. package/dist/scene/schema/spline.js +0 -15
  458. package/dist/scene/schema/tuples.d.ts +0 -12
  459. package/dist/scene/schema/tuples.d.ts.map +0 -1
  460. package/dist/scene/schema/tuples.js +0 -14
  461. package/dist/scene/user-data.d.ts +0 -185
  462. package/dist/scene/user-data.d.ts.map +0 -1
  463. package/dist/scene/user-data.js +0 -144
  464. package/dist/setup/setup-audio.d.ts +0 -20
  465. package/dist/setup/setup-audio.d.ts.map +0 -1
  466. package/dist/setup/setup-audio.js +0 -41
  467. package/dist/setup/setup-particles.d.ts +0 -17
  468. package/dist/setup/setup-particles.d.ts.map +0 -1
  469. package/dist/setup/setup-particles.js +0 -16
  470. package/dist/setup/setup-physics.d.ts +0 -25
  471. package/dist/setup/setup-physics.d.ts.map +0 -1
  472. package/dist/setup/setup-physics.js +0 -51
  473. package/dist/setup/setup-renderer.d.ts +0 -69
  474. package/dist/setup/setup-renderer.d.ts.map +0 -1
  475. package/dist/setup/setup-renderer.js +0 -363
  476. package/dist/tools/define-tool.d.ts +0 -130
  477. package/dist/tools/define-tool.d.ts.map +0 -1
  478. package/dist/tools/define-tool.js +0 -96
  479. package/dist/world2d/authoring-2d.d.ts +0 -80
  480. package/dist/world2d/authoring-2d.d.ts.map +0 -1
  481. package/dist/world2d/authoring-2d.js +0 -195
  482. package/dist/world2d/capture-to-scene2d.d.ts +0 -5
  483. package/dist/world2d/capture-to-scene2d.d.ts.map +0 -1
  484. package/dist/world2d/capture-to-scene2d.js +0 -49
  485. package/dist/world2d/collision-2d.d.ts +0 -52
  486. package/dist/world2d/collision-2d.d.ts.map +0 -1
  487. package/dist/world2d/collision-2d.js +0 -70
  488. package/dist/world2d/components-2d.d.ts +0 -47
  489. package/dist/world2d/components-2d.d.ts.map +0 -1
  490. package/dist/world2d/components-2d.js +0 -77
  491. package/dist/world2d/index.d.ts +0 -34
  492. package/dist/world2d/index.d.ts.map +0 -1
  493. package/dist/world2d/index.js +0 -32
  494. package/dist/world2d/ingest-iframe-2d.d.ts +0 -82
  495. package/dist/world2d/ingest-iframe-2d.d.ts.map +0 -1
  496. package/dist/world2d/ingest-iframe-2d.js +0 -166
  497. package/dist/world2d/ingest2d.d.ts +0 -97
  498. package/dist/world2d/ingest2d.d.ts.map +0 -1
  499. package/dist/world2d/ingest2d.js +0 -40
  500. package/dist/world2d/physics2d-registry.d.ts +0 -24
  501. package/dist/world2d/physics2d-registry.d.ts.map +0 -1
  502. package/dist/world2d/physics2d-registry.js +0 -38
  503. package/dist/world2d/pixi-game-adapter.d.ts +0 -107
  504. package/dist/world2d/pixi-game-adapter.d.ts.map +0 -1
  505. package/dist/world2d/pixi-game-adapter.js +0 -210
  506. package/dist/world2d/pixi-surface.d.ts +0 -39
  507. package/dist/world2d/pixi-surface.d.ts.map +0 -1
  508. package/dist/world2d/pixi-surface.js +0 -47
  509. package/dist/world2d/scene-capture-2d.d.ts +0 -43
  510. package/dist/world2d/scene-capture-2d.d.ts.map +0 -1
  511. package/dist/world2d/scene-capture-2d.js +0 -92
  512. package/dist/world2d/scene2d-loader.d.ts +0 -27
  513. package/dist/world2d/scene2d-loader.d.ts.map +0 -1
  514. package/dist/world2d/scene2d-loader.js +0 -275
  515. package/dist/world2d/schema/entity2d.d.ts +0 -102
  516. package/dist/world2d/schema/entity2d.d.ts.map +0 -1
  517. package/dist/world2d/schema/entity2d.js +0 -119
  518. package/dist/world2d/schema/physics2d.d.ts +0 -46
  519. package/dist/world2d/schema/physics2d.d.ts.map +0 -1
  520. package/dist/world2d/schema/physics2d.js +0 -45
  521. package/dist/world2d/schema/sprite.d.ts +0 -42
  522. package/dist/world2d/schema/sprite.d.ts.map +0 -1
  523. package/dist/world2d/schema/sprite.js +0 -63
  524. package/dist/world2d/schema/tilemap.d.ts +0 -15
  525. package/dist/world2d/schema/tilemap.d.ts.map +0 -1
  526. package/dist/world2d/schema/tilemap.js +0 -19
  527. package/dist/world2d/schema/tuples2d.d.ts +0 -20
  528. package/dist/world2d/schema/tuples2d.d.ts.map +0 -1
  529. package/dist/world2d/schema/tuples2d.js +0 -19
  530. package/dist/world2d/system-adapters-2d.d.ts +0 -16
  531. package/dist/world2d/system-adapters-2d.d.ts.map +0 -1
  532. package/dist/world2d/system-adapters-2d.js +0 -37
  533. package/dist/world2d/transform-writer-2d.d.ts +0 -16
  534. package/dist/world2d/transform-writer-2d.d.ts.map +0 -1
  535. package/dist/world2d/transform-writer-2d.js +0 -22
  536. package/dist/world2d/types.d.ts +0 -59
  537. package/dist/world2d/types.d.ts.map +0 -1
  538. package/dist/world2d/types.js +0 -1
@@ -1,121 +0,0 @@
1
- /**
2
- * Standard-clip playback for generated humanoids: map Mixamo-named
3
- * `AnimationClip`s (from any GLB/FBX-derived source) onto the engine's
4
- * standard skeleton, across naming variants, with the translation-track
5
- * policy body-type rescaling requires.
6
- *
7
- * TRANSLATION-TRACK POLICY (the reviewer-flagged trap, documented choice):
8
- * humanoid clips carry per-bone `.position` tracks baked for the SOURCE
9
- * rig's segment lengths — played raw on a rescaled skeleton they snap limb
10
- * proportions back to the source's. `retargetClipToHumanoid` therefore
11
- * - DROPS every non-hips `.position` track (bones keep the generated
12
- * rig's rest translations — segment lengths come from the body params),
13
- * - KEEPS the hips `.position` track but multiplies it by the rig's
14
- * `hipsPositionScale` (root motion / bob authored for the reference
15
- * hip height lands at the generated hip height),
16
- * - DROPS `.scale` tracks (rest scale is always 1), and
17
- * - KEEPS every `.quaternion` track verbatim — rotations are
18
- * proportion-independent, which is the whole point of a shared rest
19
- * pose. This is the standard humanoid-retarget policy (the alternative,
20
- * per-bone translation rescale, buys nothing for rigid capsule bodies
21
- * and reintroduces per-bone coupling).
22
- *
23
- * NAME VARIANTS: track node names resolve across the three spellings in the
24
- * wild — sanitized `mixamorigHips` (what GLTFLoader yields), raw
25
- * `mixamorig:Hips` / `mixamorig_Hips` (FBX-side exports), and bare `Hips`
26
- * (renamed rigs). A track whose node cannot be resolved to a standard bone
27
- * — or whose property is not a bone TRS channel — is collected, and
28
- * `retargetClipToHumanoid` throws ONE hard error listing every unresolved
29
- * track (degrade loudly, never a silently-frozen limb).
30
- */
31
- import * as THREE from 'three';
32
- import { buildClipMap } from '../animation/clip-map';
33
- import { HUMANOID_HIPS_BONE } from './skeleton';
34
- /** Resolve a clip-track node name to a canonical bone name, or null. */
35
- export function resolveHumanoidBoneName(nodeName, bonesByName) {
36
- if (bonesByName.has(nodeName))
37
- return nodeName;
38
- // `mixamorig:Hips` → `mixamorigHips` (what GLTFLoader itself does).
39
- const sanitized = THREE.PropertyBinding.sanitizeNodeName(nodeName);
40
- if (bonesByName.has(sanitized))
41
- return sanitized;
42
- // `mixamorig_Hips` → `Hips`; bare `Hips` passes through unchanged.
43
- const bare = sanitized.replace(/^mixamorig_?/i, '');
44
- const canonical = `mixamorig${bare}`;
45
- if (bonesByName.has(canonical))
46
- return canonical;
47
- return null;
48
- }
49
- /** Retarget one track: a rebuilt track to keep, 'drop' (by policy), or
50
- * 'unresolved' (not a standard bone TRS channel). */
51
- function retargetTrack(track, target) {
52
- const dot = track.name.lastIndexOf('.');
53
- if (dot <= 0)
54
- return 'unresolved';
55
- const bone = resolveHumanoidBoneName(track.name.slice(0, dot), target.bonesByName);
56
- if (!bone)
57
- return 'unresolved';
58
- const property = track.name.slice(dot + 1);
59
- if (property === 'quaternion') {
60
- const kept = track.clone();
61
- kept.name = `${bone}.quaternion`;
62
- return kept;
63
- }
64
- if (property === 'position') {
65
- if (bone !== HUMANOID_HIPS_BONE)
66
- return 'drop'; // policy: rest owns segment lengths
67
- const kept = track.clone();
68
- kept.name = `${bone}.position`;
69
- const s = target.hipsPositionScale;
70
- if (s !== 1)
71
- kept.values = kept.values.map((v) => v * s);
72
- return kept;
73
- }
74
- if (property === 'scale')
75
- return 'drop'; // policy: rest scale is always 1
76
- // Not a bone TRS channel (morphs etc.) — nothing on a generated humanoid
77
- // can consume it; loud beats silent.
78
- return 'unresolved';
79
- }
80
- /**
81
- * Rebuild `clip` for a generated humanoid: node names canonicalized, the
82
- * translation policy above applied. The input clip is never mutated. Throws
83
- * (listing every offender) if any track fails to resolve to a standard bone
84
- * TRS channel.
85
- */
86
- export function retargetClipToHumanoid(clip, target) {
87
- const tracks = [];
88
- const unresolved = [];
89
- for (const track of clip.tracks) {
90
- const result = retargetTrack(track, target);
91
- if (result === 'unresolved')
92
- unresolved.push(track.name);
93
- else if (result !== 'drop')
94
- tracks.push(result);
95
- }
96
- if (unresolved.length > 0) {
97
- throw new Error(`humanoid: clip '${clip.name}' has ${unresolved.length} track(s) that do not resolve ` +
98
- `to standard humanoid bones: ${unresolved.join(', ')}`);
99
- }
100
- return new THREE.AnimationClip(clip.name, clip.duration, tracks, clip.blendMode);
101
- }
102
- /**
103
- * Build a name → clip library from a loaded GLB's `animations` array —
104
- * `buildClipMap` semantics (exact names, case-insensitive lookup,
105
- * armature-prefix stripping, `walking`→`walk`-style aliases), plus a
106
- * loud getter.
107
- */
108
- export function createHumanoidClipLibrary(animations, aliases = {}) {
109
- const map = buildClipMap(animations, aliases);
110
- return {
111
- clips: map,
112
- get(name) {
113
- const clip = map.get(name) ?? map.get(name.toLowerCase());
114
- if (!clip) {
115
- const have = [...new Set(animations.map((c) => c.name))].join(', ');
116
- throw new Error(`humanoid: no clip named '${name}' in library (have: ${have})`);
117
- }
118
- return clip;
119
- },
120
- };
121
- }
@@ -1,75 +0,0 @@
1
- /**
2
- * Character-composition primitives — how a generated humanoid BECOMES a
3
- * distinct character (a viking, a policeman, …).
4
- *
5
- * PHILOSOPHY (owner directive): this file is deliberately NOT a customization
6
- * system. No recipe DSL, no slot/preset registry, no outfit library. It ships
7
- * the BARE MINIMUM an agent needs to compose ANY character with ordinary,
8
- * idiomatic three.js code written at generation time:
9
- *
10
- * 1. `skinToHumanoid(geometry, rig)` — skin arbitrary generated geometry
11
- * (a tunic lathe, a sleeve cylinder, …) to the rig's shared skeleton so
12
- * it deforms with the body,
13
- * 2. `attachToBone(rig, boneName, object)` — parent a rigid prop (helmet,
14
- * axe, badge) to a named bone with a model-space authoring contract,
15
- * 3. `restJointPosition(rig, boneName)` — the one placement query: agents
16
- * must size/place geometry against the PARAMETRIC body (joints move
17
- * with body-type params), and reading `bone.matrixWorld` is wrong once
18
- * a clip is playing — rest pose comes from the bind data instead.
19
- *
20
- * Everything else (shapes, colors, layering, which prop goes where) is the
21
- * agent's ordinary code. Worked agent-artifact examples:
22
- * `packages/engine/e2e/humanoid-character-proof/{viking,policeman}.ts`.
23
- *
24
- * AUTHORING SPACE: both primitives speak the rig's MODEL SPACE — Y-up metres,
25
- * rest pose, origin at the rig root (the same space `generateHumanoid` builds
26
- * the body in, and the space `rig.mesh.geometry` positions live in). The
27
- * armature's internal Z-up-centimetre frame (ARMATURE_SCALE) never leaks:
28
- * `skinToHumanoid` binds with the body's own bind matrix, and `attachToBone`
29
- * converts through the skeleton's inverse bind matrices.
30
- *
31
- * OWNERSHIP: both primitives parent their object under the rig (`rig.root`
32
- * for skinned meshes, the bone for props), and `rig.dispose()` frees every
33
- * geometry/material found under the root — dressing a rig hands the
34
- * resources' lifetime to it. Detach first to keep something alive.
35
- */
36
- import * as THREE from 'three';
37
- import type { HumanoidRig } from './generate';
38
- /** Rest-pose (bind-pose) position of a named joint in the rig's model space —
39
- * stable regardless of the current animation pose, because it is read from
40
- * the skeleton's inverse bind matrices rather than live bone transforms. */
41
- export declare function restJointPosition(rig: HumanoidRig, boneName: string, target?: THREE.Vector3): THREE.Vector3;
42
- /**
43
- * Skin arbitrary generated geometry to a humanoid rig's skeleton.
44
- *
45
- * `geometry` is authored in the rig's model space (Y-up metres, rest pose —
46
- * build a sleeve around the rest arm, a tunic around the rest torso). The
47
- * function computes 4-wide zero-padded `skinIndex`/`skinWeight` attributes on
48
- * the geometry (in place), wraps it in a `THREE.SkinnedMesh` bound to the
49
- * SAME `THREE.Skeleton` as the body, parents it under `rig.root`, and returns
50
- * it. From then on it deforms with the body and is freed by `rig.dispose()`.
51
- *
52
- * Weighting is the body's own analytic scheme, per vertex: pick the body
53
- * segment whose SURFACE is nearest (distance to the joint-to-joint axis minus
54
- * the part's radius — so a loose tunic still binds to the torso it covers),
55
- * project the vertex onto that segment's axis, and apply the same smoothstep
56
- * 2-bone joint blend the body uses (50/50 exactly at each joint). Geometry
57
- * spanning a joint therefore blends across it exactly like the body does —
58
- * give clothing a slightly larger radius than the body part underneath and
59
- * the two move together with no relative sliding.
60
- */
61
- export declare function skinToHumanoid(geometry: THREE.BufferGeometry, rig: HumanoidRig, material?: THREE.Material): THREE.SkinnedMesh;
62
- /**
63
- * Attach a rigid prop (helmet, axe, badge, …) to a named bone.
64
- *
65
- * Authoring contract: position/rotate/scale `object` in the rig's MODEL SPACE
66
- * (Y-up metres, rest pose — e.g. a helmet at `restJointPosition(rig,
67
- * 'mixamorigHead')` plus a bit of Y). The function converts that placement
68
- * into the bone's local frame — including the armature's internal
69
- * Z-up-centimetre transform, which is why the local values you'd read back
70
- * afterwards look like centimetres with a ~100× scale — parents the object to
71
- * the bone, and returns it. The prop then rides the bone through every pose,
72
- * and `rig.dispose()` frees its geometry/materials.
73
- */
74
- export declare function attachToBone<T extends THREE.Object3D>(rig: HumanoidRig, boneName: string, object: T): T;
75
- //# sourceMappingURL=compose.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/humanoid/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C;;6EAE6E;AAC7E,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,gBAAsB,GAC3B,KAAK,CAAC,OAAO,CAGf;AA0CD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,GAAG,EAAE,WAAW,EAChB,QAAQ,GAAE,KAAK,CAAC,QAA6D,GAC5E,KAAK,CAAC,WAAW,CAyDnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,QAAQ,EACnD,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,GACR,CAAC,CAYH"}
@@ -1,176 +0,0 @@
1
- /**
2
- * Character-composition primitives — how a generated humanoid BECOMES a
3
- * distinct character (a viking, a policeman, …).
4
- *
5
- * PHILOSOPHY (owner directive): this file is deliberately NOT a customization
6
- * system. No recipe DSL, no slot/preset registry, no outfit library. It ships
7
- * the BARE MINIMUM an agent needs to compose ANY character with ordinary,
8
- * idiomatic three.js code written at generation time:
9
- *
10
- * 1. `skinToHumanoid(geometry, rig)` — skin arbitrary generated geometry
11
- * (a tunic lathe, a sleeve cylinder, …) to the rig's shared skeleton so
12
- * it deforms with the body,
13
- * 2. `attachToBone(rig, boneName, object)` — parent a rigid prop (helmet,
14
- * axe, badge) to a named bone with a model-space authoring contract,
15
- * 3. `restJointPosition(rig, boneName)` — the one placement query: agents
16
- * must size/place geometry against the PARAMETRIC body (joints move
17
- * with body-type params), and reading `bone.matrixWorld` is wrong once
18
- * a clip is playing — rest pose comes from the bind data instead.
19
- *
20
- * Everything else (shapes, colors, layering, which prop goes where) is the
21
- * agent's ordinary code. Worked agent-artifact examples:
22
- * `packages/engine/e2e/humanoid-character-proof/{viking,policeman}.ts`.
23
- *
24
- * AUTHORING SPACE: both primitives speak the rig's MODEL SPACE — Y-up metres,
25
- * rest pose, origin at the rig root (the same space `generateHumanoid` builds
26
- * the body in, and the space `rig.mesh.geometry` positions live in). The
27
- * armature's internal Z-up-centimetre frame (ARMATURE_SCALE) never leaks:
28
- * `skinToHumanoid` binds with the body's own bind matrix, and `attachToBone`
29
- * converts through the skeleton's inverse bind matrices.
30
- *
31
- * OWNERSHIP: both primitives parent their object under the rig (`rig.root`
32
- * for skinned meshes, the bone for props), and `rig.dispose()` frees every
33
- * geometry/material found under the root — dressing a rig hands the
34
- * resources' lifetime to it. Detach first to keep something alive.
35
- */
36
- import * as THREE from 'three';
37
- import { computeBindingSegments, HEAD_CAPSULE_RADIUS, smoothstep, } from './body';
38
- import { scaleSkeletonDef } from './skeleton';
39
- /** Rest-pose (bind-pose) position of a named joint in the rig's model space —
40
- * stable regardless of the current animation pose, because it is read from
41
- * the skeleton's inverse bind matrices rather than live bone transforms. */
42
- export function restJointPosition(rig, boneName, target = new THREE.Vector3()) {
43
- const inverse = rig.skeleton.boneInverses[requireBoneIndex(rig, boneName)];
44
- return target.setFromMatrixPosition(restMatrix.copy(inverse).invert());
45
- }
46
- const restMatrix = new THREE.Matrix4();
47
- function requireBoneIndex(rig, boneName) {
48
- const bone = rig.bonesByName.get(boneName);
49
- const index = bone ? rig.bones.indexOf(bone) : -1;
50
- if (index < 0) {
51
- throw new Error(`humanoid: unknown bone '${boneName}' (standard names are the sanitized ` +
52
- `Mixamo set, e.g. 'mixamorigHead', 'mixamorigRightHand')`);
53
- }
54
- return index;
55
- }
56
- /** Per-rig cache of the resolved binding segments (a rig is typically dressed
57
- * with several meshes; the segment map is identical for all of them). */
58
- const segmentCache = new WeakMap();
59
- function bindingSegments(rig) {
60
- let segments = segmentCache.get(rig);
61
- if (segments)
62
- return segments;
63
- // The uniform height factor is a pure function of the rig's (resolved)
64
- // params — recompute it exactly as `generateHumanoid` did rather than
65
- // widening the public HumanoidRig surface with a field only this needs.
66
- const { heightFactor } = scaleSkeletonDef(rig.params, HEAD_CAPSULE_RADIUS * rig.params.headSize);
67
- segments = computeBindingSegments((name) => restJointPosition(rig, name), (name) => requireBoneIndex(rig, name), {
68
- heightFactor,
69
- limbThickness: rig.params.limbThickness,
70
- torsoGirth: rig.params.torsoGirth,
71
- headSize: rig.params.headSize,
72
- hipWidth: rig.params.hipWidth,
73
- });
74
- segmentCache.set(rig, segments);
75
- return segments;
76
- }
77
- /**
78
- * Skin arbitrary generated geometry to a humanoid rig's skeleton.
79
- *
80
- * `geometry` is authored in the rig's model space (Y-up metres, rest pose —
81
- * build a sleeve around the rest arm, a tunic around the rest torso). The
82
- * function computes 4-wide zero-padded `skinIndex`/`skinWeight` attributes on
83
- * the geometry (in place), wraps it in a `THREE.SkinnedMesh` bound to the
84
- * SAME `THREE.Skeleton` as the body, parents it under `rig.root`, and returns
85
- * it. From then on it deforms with the body and is freed by `rig.dispose()`.
86
- *
87
- * Weighting is the body's own analytic scheme, per vertex: pick the body
88
- * segment whose SURFACE is nearest (distance to the joint-to-joint axis minus
89
- * the part's radius — so a loose tunic still binds to the torso it covers),
90
- * project the vertex onto that segment's axis, and apply the same smoothstep
91
- * 2-bone joint blend the body uses (50/50 exactly at each joint). Geometry
92
- * spanning a joint therefore blends across it exactly like the body does —
93
- * give clothing a slightly larger radius than the body part underneath and
94
- * the two move together with no relative sliding.
95
- */
96
- export function skinToHumanoid(geometry, rig, material = new THREE.MeshStandardMaterial({ roughness: 0.8 })) {
97
- const position = geometry.getAttribute('position');
98
- if (!position)
99
- throw new Error('humanoid: skinToHumanoid needs a position attribute');
100
- const segments = bindingSegments(rig);
101
- const n = position.count;
102
- const skinIndex = new Uint16Array(n * 4);
103
- const skinWeight = new Float32Array(n * 4);
104
- const v = new THREE.Vector3();
105
- const w = new THREE.Vector3();
106
- for (let i = 0; i < n; i++) {
107
- v.fromBufferAttribute(position, i);
108
- // Nearest segment by distance to the part SURFACE (t clamped to the
109
- // joint span for the distance test only).
110
- let best = segments[0];
111
- let bestT = 0;
112
- let bestD = Number.POSITIVE_INFINITY;
113
- for (const seg of segments) {
114
- w.copy(v).sub(seg.p0);
115
- const t = w.dot(seg.axis) / seg.len;
116
- const tc = Math.min(1, Math.max(0, t));
117
- const d = w.addScaledVector(seg.axis, -tc * seg.len).length() - seg.radius;
118
- if (d < bestD) {
119
- bestD = d;
120
- best = seg;
121
- bestT = t;
122
- }
123
- }
124
- // The body's own 2-bone joint blend (skinSegment in body.ts), verbatim.
125
- let other = best.bone;
126
- let w2 = 0;
127
- if (best.proximal >= 0 && bestT < best.blend) {
128
- other = best.proximal;
129
- w2 = 0.5 * (1 - smoothstep(bestT / best.blend));
130
- }
131
- else if (best.distal >= 0 && bestT > 1 - best.blend) {
132
- other = best.distal;
133
- w2 = 0.5 * smoothstep((bestT - (1 - best.blend)) / best.blend);
134
- }
135
- skinIndex.set([best.bone, other, 0, 0], i * 4);
136
- skinWeight.set([1 - w2, w2, 0, 0], i * 4);
137
- }
138
- geometry.setAttribute('skinIndex', new THREE.BufferAttribute(skinIndex, 4));
139
- geometry.setAttribute('skinWeight', new THREE.BufferAttribute(skinWeight, 4));
140
- const mesh = new THREE.SkinnedMesh(geometry, material);
141
- mesh.name = 'HumanoidSkinnedAttachment';
142
- mesh.castShadow = true;
143
- // Same as the body: an animated skinned mesh leaves its rest-pose bounds.
144
- mesh.frustumCulled = false;
145
- rig.root.add(mesh);
146
- // Bind in the body's bind space (model space at generate time) — NOT the
147
- // mesh's current matrixWorld, which already includes wherever the caller
148
- // has moved `rig.root` by now.
149
- mesh.bind(rig.skeleton, rig.mesh.bindMatrix.clone());
150
- return mesh;
151
- }
152
- /**
153
- * Attach a rigid prop (helmet, axe, badge, …) to a named bone.
154
- *
155
- * Authoring contract: position/rotate/scale `object` in the rig's MODEL SPACE
156
- * (Y-up metres, rest pose — e.g. a helmet at `restJointPosition(rig,
157
- * 'mixamorigHead')` plus a bit of Y). The function converts that placement
158
- * into the bone's local frame — including the armature's internal
159
- * Z-up-centimetre transform, which is why the local values you'd read back
160
- * afterwards look like centimetres with a ~100× scale — parents the object to
161
- * the bone, and returns it. The prop then rides the bone through every pose,
162
- * and `rig.dispose()` frees its geometry/materials.
163
- */
164
- export function attachToBone(rig, boneName, object) {
165
- const index = requireBoneIndex(rig, boneName);
166
- const bone = rig.bones[index];
167
- object.updateMatrix();
168
- // local = inverse(boneRestWorld) × authoredModelMatrix; boneInverses IS
169
- // inverse(boneRestWorld) in model space (root at identity at bind time).
170
- // The bone's rest world scale is uniform (ARMATURE_SCALE), so the
171
- // decompose below is exact.
172
- const local = rig.skeleton.boneInverses[index].clone().multiply(object.matrix);
173
- local.decompose(object.position, object.quaternion, object.scale);
174
- bone.add(object);
175
- return object;
176
- }
@@ -1,92 +0,0 @@
1
- /**
2
- * `generateHumanoid` — the engine's procedural humanoid character generator.
3
- *
4
- * vgai generates buildings and terrain procedurally; this is the same idea
5
- * for CHARACTERS: no downloaded model, no Quaternius/Mixamo mesh dependency —
6
- * a ready-to-animate skinned humanoid built entirely from code:
7
- *
8
- * - the STANDARD skeleton (Mixamo-named, reference rest pose) rescaled by
9
- * authored body-type params (`skeleton.ts`),
10
- * - a fully procedural capsule/box body with analytic per-segment skin
11
- * weights that stay correct across proportions (`body.ts`),
12
- * - standard-clip playback with prefix-variant resolution and the
13
- * translation-track retarget policy (`clips.ts`).
14
- *
15
- * The one external thing a game still supplies is ANIMATION CLIPS (from any
16
- * Mixamo-named GLB — e.g. the repo's vendored Soldier.glb Idle/Walk/Run).
17
- *
18
- * Usage (a game's `setup()` or any three.js world):
19
- *
20
- * import { generateHumanoid, createHumanoidClipLibrary } from '@vgai/engine/humanoid';
21
- *
22
- * const rig = generateHumanoid({ height: 1.6, limbThickness: 1.3, torsoGirth: 1.4 });
23
- * scene.add(rig.root);
24
- * const clips = createHumanoidClipLibrary(gltf.animations);
25
- * rig.playClip(clips.get('Walk'));
26
- * // per frame: rig.update(dt) // e.g. from a SystemPhase.ANIMATION system
27
- * // teardown: rig.dispose()
28
- *
29
- * Scene-file authoring status: this is a code API (like `GameComponent`
30
- * schemas), NOT yet a `.vscn` generator — the scene `generator` seam
31
- * (`scene/geometry-registry.ts`) produces bare `BufferGeometry`, while a
32
- * humanoid is a SkinnedMesh + bone hierarchy + mixer. Wiring a scene-entity
33
- * spelling is future work (see docs/PROCEDURAL-HUMANOID.md).
34
- */
35
- import * as THREE from 'three';
36
- import { type HumanoidBodyPart } from './body';
37
- import { type HumanoidParams, type ResolvedHumanoidParams } from './schema';
38
- export interface GenerateHumanoidOptions {
39
- /** Override the body material (default: a vertex-colored MeshStandardMaterial
40
- * that visualizes the body-part/blend-zone map). A caller-supplied material
41
- * is NOT disposed by `rig.dispose()`. */
42
- material?: THREE.Material;
43
- }
44
- export interface PlayClipOptions {
45
- /** Crossfade seconds from the previous action (0 = hard cut). Default 0.25. */
46
- fade?: number;
47
- }
48
- /** A generated, ready-to-use humanoid character rig. */
49
- export interface HumanoidRig {
50
- /** Add this to the scene; position/rotate/scale it like any Object3D. */
51
- root: THREE.Group;
52
- /** The single merged skinned body mesh (child of `root`). */
53
- mesh: THREE.SkinnedMesh;
54
- skeleton: THREE.Skeleton;
55
- /** All bones in canonical row order (skinIndex order). */
56
- bones: THREE.Bone[];
57
- /** Bone lookup by canonical Mixamo name (`mixamorigHips`, …). */
58
- bonesByName: ReadonlyMap<string, THREE.Bone>;
59
- /** The resolved (defaulted) params this rig was generated from. */
60
- params: ResolvedHumanoidParams;
61
- /** Realized standing height in metres (crown of head, rest pose). */
62
- height: number;
63
- /** Hips-height ratio vs the reference rig — the hips `.position` track
64
- * remap factor (see `clips.ts`). */
65
- hipsPositionScale: number;
66
- vertexCount: number;
67
- /** Per-part vertex ranges + allowed bone influences (test/debug surface). */
68
- parts: readonly HumanoidBodyPart[];
69
- /** The rig's own mixer, rooted at `root`. Drive it via `update(dt)`. */
70
- mixer: THREE.AnimationMixer;
71
- /**
72
- * Play a standard humanoid clip: retargets it (prefix variants, the
73
- * translation-track policy — cached per source clip), crossfades from the
74
- * currently-playing action, returns the started `AnimationAction` for
75
- * further control (timeScale, loop mode, …). Throws, listing every
76
- * offender, if the clip has tracks that don't resolve to standard bones.
77
- */
78
- playClip(clip: THREE.AnimationClip, options?: PlayClipOptions): THREE.AnimationAction;
79
- /** Advance the rig's animation. Call once per frame with seconds. */
80
- update(dt: number): void;
81
- /** Stop animation, release GPU resources (the body AND every geometry/
82
- * material parented under the rig — skinned clothing, bone props),
83
- * detach from parent. */
84
- dispose(): void;
85
- }
86
- /**
87
- * Generate a skinned humanoid character from body-type params (validated by
88
- * `HumanoidParamsSchema`; `generateHumanoid()` with no args yields the
89
- * reference body). Pure and synchronous — no assets are loaded.
90
- */
91
- export declare function generateHumanoid(params?: HumanoidParams, options?: GenerateHumanoidOptions): HumanoidRig;
92
- //# sourceMappingURL=generate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/humanoid/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA0C,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAEvF,OAAO,EAAE,KAAK,cAAc,EAAwB,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlG,MAAM,WAAW,uBAAuB;IACtC;;8CAE0C;IAC1C,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wDAAwD;AACxD,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;IAClB,6DAA6D;IAC7D,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzB,0DAA0D;IAC1D,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,iEAAiE;IACjE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,mEAAmE;IACnE,MAAM,EAAE,sBAAsB,CAAC;IAC/B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf;yCACqC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACnC,wEAAwE;IACxE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IACtF,qEAAqE;IACrE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;8BAE0B;IAC1B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,cAAmB,EAC3B,OAAO,GAAE,uBAA4B,GACpC,WAAW,CAwFb"}
@@ -1,124 +0,0 @@
1
- /**
2
- * `generateHumanoid` — the engine's procedural humanoid character generator.
3
- *
4
- * vgai generates buildings and terrain procedurally; this is the same idea
5
- * for CHARACTERS: no downloaded model, no Quaternius/Mixamo mesh dependency —
6
- * a ready-to-animate skinned humanoid built entirely from code:
7
- *
8
- * - the STANDARD skeleton (Mixamo-named, reference rest pose) rescaled by
9
- * authored body-type params (`skeleton.ts`),
10
- * - a fully procedural capsule/box body with analytic per-segment skin
11
- * weights that stay correct across proportions (`body.ts`),
12
- * - standard-clip playback with prefix-variant resolution and the
13
- * translation-track retarget policy (`clips.ts`).
14
- *
15
- * The one external thing a game still supplies is ANIMATION CLIPS (from any
16
- * Mixamo-named GLB — e.g. the repo's vendored Soldier.glb Idle/Walk/Run).
17
- *
18
- * Usage (a game's `setup()` or any three.js world):
19
- *
20
- * import { generateHumanoid, createHumanoidClipLibrary } from '@vgai/engine/humanoid';
21
- *
22
- * const rig = generateHumanoid({ height: 1.6, limbThickness: 1.3, torsoGirth: 1.4 });
23
- * scene.add(rig.root);
24
- * const clips = createHumanoidClipLibrary(gltf.animations);
25
- * rig.playClip(clips.get('Walk'));
26
- * // per frame: rig.update(dt) // e.g. from a SystemPhase.ANIMATION system
27
- * // teardown: rig.dispose()
28
- *
29
- * Scene-file authoring status: this is a code API (like `GameComponent`
30
- * schemas), NOT yet a `.vscn` generator — the scene `generator` seam
31
- * (`scene/geometry-registry.ts`) produces bare `BufferGeometry`, while a
32
- * humanoid is a SkinnedMesh + bone hierarchy + mixer. Wiring a scene-entity
33
- * spelling is future work (see docs/PROCEDURAL-HUMANOID.md).
34
- */
35
- import * as THREE from 'three';
36
- import { buildHumanoidBody, HEAD_CAPSULE_RADIUS } from './body';
37
- import { retargetClipToHumanoid } from './clips';
38
- import { HumanoidParamsSchema } from './schema';
39
- import { buildHumanoidSkeleton, createArmatureGroup, scaleSkeletonDef } from './skeleton';
40
- /**
41
- * Generate a skinned humanoid character from body-type params (validated by
42
- * `HumanoidParamsSchema`; `generateHumanoid()` with no args yields the
43
- * reference body). Pure and synchronous — no assets are loaded.
44
- */
45
- export function generateHumanoid(params = {}, options = {}) {
46
- const resolved = HumanoidParamsSchema.parse(params);
47
- const scaledDef = scaleSkeletonDef(resolved, HEAD_CAPSULE_RADIUS * resolved.headSize);
48
- const skeletonRig = buildHumanoidSkeleton(scaledDef.defs);
49
- const root = new THREE.Group();
50
- root.name = 'ProceduralHumanoid';
51
- const armature = createArmatureGroup(skeletonRig);
52
- root.add(armature);
53
- // Rest-pose world matrices (root at identity) → bind pose + body geometry.
54
- root.updateMatrixWorld(true);
55
- const body = buildHumanoidBody(skeletonRig, {
56
- heightFactor: scaledDef.heightFactor,
57
- limbThickness: resolved.limbThickness,
58
- torsoGirth: resolved.torsoGirth,
59
- headSize: resolved.headSize,
60
- hipWidth: resolved.hipWidth,
61
- }, options.material);
62
- root.add(body.mesh);
63
- const mixer = new THREE.AnimationMixer(root);
64
- const retargetCache = new Map();
65
- let currentAction = null;
66
- const rig = {
67
- root,
68
- mesh: body.mesh,
69
- skeleton: body.skeleton,
70
- bones: skeletonRig.bones,
71
- bonesByName: skeletonRig.byName,
72
- params: resolved,
73
- height: scaledDef.height,
74
- hipsPositionScale: scaledDef.hipsPositionScale,
75
- vertexCount: body.vertexCount,
76
- parts: body.parts,
77
- mixer,
78
- playClip(clip, playOptions = {}) {
79
- const fade = playOptions.fade ?? 0.25;
80
- let prepared = retargetCache.get(clip.uuid);
81
- if (!prepared) {
82
- prepared = retargetClipToHumanoid(clip, rig);
83
- retargetCache.set(clip.uuid, prepared);
84
- }
85
- const action = mixer.clipAction(prepared);
86
- const previous = currentAction;
87
- if (previous && previous !== action && fade > 0) {
88
- previous.fadeOut(fade);
89
- action.reset().fadeIn(fade).play();
90
- }
91
- else {
92
- previous?.stop();
93
- action.reset().play();
94
- }
95
- currentAction = action;
96
- return action;
97
- },
98
- update(dt) {
99
- mixer.update(dt);
100
- },
101
- dispose() {
102
- mixer.stopAllAction();
103
- mixer.uncacheRoot(root);
104
- body.skeleton.dispose();
105
- // Free EVERYTHING parented under the rig — the body plus whatever the
106
- // composition primitives (`skinToHumanoid` clothing, `attachToBone`
107
- // props — see compose.ts's ownership contract) added since. The one
108
- // exception stays: a caller-supplied body material is never disposed.
109
- root.traverse((obj) => {
110
- const withResources = obj;
111
- withResources.geometry?.dispose();
112
- const material = withResources.material;
113
- if (!material)
114
- return;
115
- for (const mat of Array.isArray(material) ? material : [material]) {
116
- if (mat !== options.material)
117
- mat.dispose();
118
- }
119
- });
120
- root.removeFromParent();
121
- },
122
- };
123
- return rig;
124
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * `@vgai/engine/humanoid` — procedural humanoid character generation.
3
- *
4
- * Generate skinned, animation-ready humanoid characters entirely from code
5
- * (the way the engine generates terrain/props): a standard Mixamo-named
6
- * skeleton rescaled by body-type params, a procedural capsule body with
7
- * analytic skin weights, and standard-clip playback with the humanoid
8
- * retarget policy. Start at `generateHumanoid`; turn the result into a
9
- * distinct CHARACTER with the composition primitives (`skinToHumanoid`,
10
- * `attachToBone`, `restJointPosition` — see compose.ts's philosophy note).
11
- * Full guide: docs/PROCEDURAL-HUMANOID.md.
12
- */
13
- export type { HumanoidBody, HumanoidBodyDims, HumanoidBodyPart } from './body';
14
- export { buildHumanoidBody, HEAD_CAPSULE_RADIUS } from './body';
15
- export type { HumanoidClipLibrary, HumanoidClipTarget } from './clips';
16
- export { createHumanoidClipLibrary, resolveHumanoidBoneName, retargetClipToHumanoid, } from './clips';
17
- export { attachToBone, restJointPosition, skinToHumanoid } from './compose';
18
- export type { GenerateHumanoidOptions, HumanoidRig, PlayClipOptions } from './generate';
19
- export { generateHumanoid } from './generate';
20
- export type { HumanoidParams, ResolvedHumanoidParams } from './schema';
21
- export { HumanoidParamsSchema } from './schema';
22
- export type { BoneDef, BuiltSkeleton, ScaledSkeletonDef } from './skeleton';
23
- export { ARMATURE_ROTATION_X, ARMATURE_SCALE, buildHumanoidSkeleton, createArmatureGroup, HUMANOID_HIPS_BONE, MIXAMO_SKELETON_DEF, scaleSkeletonDef, } from './skeleton';
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/humanoid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5E,YAAY,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * `@vgai/engine/humanoid` — procedural humanoid character generation.
3
- *
4
- * Generate skinned, animation-ready humanoid characters entirely from code
5
- * (the way the engine generates terrain/props): a standard Mixamo-named
6
- * skeleton rescaled by body-type params, a procedural capsule body with
7
- * analytic skin weights, and standard-clip playback with the humanoid
8
- * retarget policy. Start at `generateHumanoid`; turn the result into a
9
- * distinct CHARACTER with the composition primitives (`skinToHumanoid`,
10
- * `attachToBone`, `restJointPosition` — see compose.ts's philosophy note).
11
- * Full guide: docs/PROCEDURAL-HUMANOID.md.
12
- */
13
- export { buildHumanoidBody, HEAD_CAPSULE_RADIUS } from './body';
14
- export { createHumanoidClipLibrary, resolveHumanoidBoneName, retargetClipToHumanoid, } from './clips';
15
- export { attachToBone, restJointPosition, skinToHumanoid } from './compose';
16
- export { generateHumanoid } from './generate';
17
- export { HumanoidParamsSchema } from './schema';
18
- export { ARMATURE_ROTATION_X, ARMATURE_SCALE, buildHumanoidSkeleton, createArmatureGroup, HUMANOID_HIPS_BONE, MIXAMO_SKELETON_DEF, scaleSkeletonDef, } from './skeleton';