@adobe/data-gpu 0.9.75 → 0.9.77

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 (383) hide show
  1. package/CLAUDE.md +9 -0
  2. package/README.md +36 -0
  3. package/dist/core/core-plugin.d.ts +1 -1
  4. package/dist/core/public.d.ts +2 -0
  5. package/dist/core/public.js +4 -0
  6. package/dist/core/public.js.map +1 -0
  7. package/dist/graphics/animation/animation-data-plugin.d.ts +8 -0
  8. package/dist/graphics/animation/animation-plugin.d.ts +10 -2
  9. package/dist/graphics/camera/camera-plugin.d.ts +3 -3
  10. package/dist/graphics/camera/orbit/attach-orbit-drag.d.ts +1 -21
  11. package/dist/graphics/camera/orbit/attach-orbit-drag.js +0 -10
  12. package/dist/graphics/camera/orbit/attach-orbit-drag.js.map +1 -1
  13. package/dist/graphics/camera/orbit/orbit-data-plugin.d.ts +6 -6
  14. package/dist/graphics/camera/orbit/orbit-data-plugin.js +1 -1
  15. package/dist/graphics/camera/orbit/orbit-data-plugin.js.map +1 -1
  16. package/dist/graphics/camera/orbit/orbit-drag-service.d.ts +11 -0
  17. package/dist/graphics/camera/orbit/orbit-drag-service.js +3 -0
  18. package/dist/graphics/camera/orbit/orbit-drag-service.js.map +1 -0
  19. package/dist/graphics/camera/orbit/orbit-plugin.d.ts +6 -6
  20. package/dist/graphics/camera/orbit/orbit-system-plugin.d.ts +8 -8
  21. package/dist/graphics/camera/orbit/orbit-system-plugin.js +6 -9
  22. package/dist/graphics/camera/orbit/orbit-system-plugin.js.map +1 -1
  23. package/dist/graphics/camera/orbit/orbit.d.ts +5 -5
  24. package/dist/graphics/camera/orbit/public.d.ts +2 -2
  25. package/dist/graphics/camera/orbit/public.js +2 -1
  26. package/dist/graphics/camera/orbit/public.js.map +1 -1
  27. package/dist/graphics/graphics-plugin.d.ts +1 -1
  28. package/dist/graphics/index.d.ts +1 -0
  29. package/dist/graphics/index.js +3 -0
  30. package/dist/graphics/index.js.map +1 -0
  31. package/dist/graphics/picking/picking-plugin.d.ts +9871 -1912
  32. package/dist/graphics/picking/picking-plugin.js +3 -3
  33. package/dist/graphics/picking/picking-plugin.js.map +1 -1
  34. package/dist/graphics/public.d.ts +38 -0
  35. package/dist/graphics/public.js +40 -0
  36. package/dist/graphics/public.js.map +1 -0
  37. package/dist/graphics/rendering/bone-collider-plugin.d.ts +2967 -486
  38. package/dist/graphics/rendering/bone-collider-plugin.js +13 -12
  39. package/dist/graphics/rendering/bone-collider-plugin.js.map +1 -1
  40. package/dist/graphics/rendering/display-transform-plugin.d.ts +2 -0
  41. package/dist/graphics/rendering/display-transform-plugin.js +2 -2
  42. package/dist/graphics/rendering/display-transform-plugin.js.map +1 -1
  43. package/dist/graphics/rendering/ibl-render/ibl-render-plugin.d.ts +2857 -403
  44. package/dist/graphics/rendering/ibl-render/ibl-render-plugin.js +9 -9
  45. package/dist/graphics/rendering/ibl-render/ibl-render-plugin.js.map +1 -1
  46. package/dist/graphics/rendering/interpolation-plugin.d.ts +1040 -156
  47. package/dist/graphics/rendering/jolt-ragdoll-plugin.d.ts +3017 -538
  48. package/dist/graphics/rendering/jolt-ragdoll-plugin.js +6 -6
  49. package/dist/graphics/rendering/jolt-ragdoll-plugin.js.map +1 -1
  50. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.d.ts +1123 -0
  51. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.js +79 -0
  52. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.js.map +1 -0
  53. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.d.ts +1 -0
  54. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.js +18 -0
  55. package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.js.map +1 -0
  56. package/dist/graphics/rendering/material-palette-gpu/material-palette.d.ts +25 -0
  57. package/dist/graphics/rendering/material-palette-gpu/material-palette.js +27 -0
  58. package/dist/graphics/rendering/material-palette-gpu/material-palette.js.map +1 -0
  59. package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.d.ts +3 -0
  60. package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.js +22 -0
  61. package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.js.map +1 -0
  62. package/dist/graphics/rendering/model-collider-plugin.d.ts +2903 -663
  63. package/dist/graphics/rendering/model-collider-plugin.js +11 -34
  64. package/dist/graphics/rendering/model-collider-plugin.js.map +1 -1
  65. package/dist/graphics/rendering/pbr-core-plugin.d.ts +16 -8
  66. package/dist/graphics/rendering/pbr-core-plugin.js +16 -19
  67. package/dist/graphics/rendering/pbr-core-plugin.js.map +1 -1
  68. package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.d.ts +3514 -0
  69. package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.js +189 -0
  70. package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.js.map +1 -0
  71. package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.d.ts +7 -0
  72. package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.js +124 -0
  73. package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.js.map +1 -0
  74. package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.d.ts +769 -571
  75. package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.js +98 -79
  76. package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.js.map +1 -1
  77. package/dist/graphics/rendering/pbr-render/primitive-render-shared.d.ts +43 -0
  78. package/dist/graphics/rendering/pbr-render/primitive-render-shared.js +59 -0
  79. package/dist/graphics/rendering/pbr-render/primitive-render-shared.js.map +1 -0
  80. package/dist/graphics/rendering/skinning/skinning-plugin.d.ts +2930 -270
  81. package/dist/graphics/rendering/skinning/skinning-plugin.js +19 -40
  82. package/dist/graphics/rendering/skinning/skinning-plugin.js.map +1 -1
  83. package/dist/graphics/scene/model/geometry/public.d.ts +1 -0
  84. package/dist/graphics/scene/model/mesh/mesh.d.ts +13 -0
  85. package/dist/graphics/scene/model/mesh/mesh.js +3 -0
  86. package/dist/graphics/scene/model/mesh/mesh.js.map +1 -0
  87. package/dist/graphics/scene/model/mesh/public.d.ts +1 -0
  88. package/dist/graphics/scene/model/mesh/public.js +3 -0
  89. package/dist/graphics/scene/model/mesh/public.js.map +1 -0
  90. package/dist/graphics/scene/model/mesh-plugin.d.ts +5177 -0
  91. package/dist/graphics/scene/model/mesh-plugin.js +87 -0
  92. package/dist/graphics/scene/model/mesh-plugin.js.map +1 -0
  93. package/dist/graphics/scene/model/model-loader-plugin.d.ts +2728 -295
  94. package/dist/graphics/scene/model/model-loader-plugin.js +24 -42
  95. package/dist/graphics/scene/model/model-loader-plugin.js.map +1 -1
  96. package/dist/graphics/scene/model/model-plugin.d.ts +1 -352
  97. package/dist/graphics/scene/model/model-plugin.js +1 -37
  98. package/dist/graphics/scene/model/model-plugin.js.map +1 -1
  99. package/dist/graphics/scene/model/model.d.ts +2 -6
  100. package/dist/graphics/scene/model/model.js.map +1 -1
  101. package/dist/graphics/scene/model/public.d.ts +1 -1
  102. package/dist/graphics/scene/model/public.js +2 -1
  103. package/dist/graphics/scene/model/public.js.map +1 -1
  104. package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.d.ts +4 -0
  105. package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.js +25 -0
  106. package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.js.map +1 -0
  107. package/dist/graphics/scene/model/shape/shape-geometry-plugin.d.ts +233 -386
  108. package/dist/graphics/scene/model/shape/shape-geometry-plugin.js +87 -18
  109. package/dist/graphics/scene/model/shape/shape-geometry-plugin.js.map +1 -1
  110. package/dist/graphics/scene/model/shape/shape-spec.d.ts +17 -0
  111. package/dist/graphics/scene/model/shape/shape-spec.js +3 -0
  112. package/dist/graphics/scene/model/shape/shape-spec.js.map +1 -0
  113. package/dist/graphics/scene/model/world-bounds-plugin.d.ts +2670 -245
  114. package/dist/graphics/scene/model/world-bounds-plugin.js +6 -25
  115. package/dist/graphics/scene/model/world-bounds-plugin.js.map +1 -1
  116. package/dist/graphics/scene/node/node-data-plugin.d.ts +15 -4
  117. package/dist/graphics/scene/node/node-data-plugin.js +12 -5
  118. package/dist/graphics/scene/node/node-data-plugin.js.map +1 -1
  119. package/dist/graphics/scene/node/node-data-plugin.test.d.ts +1 -0
  120. package/dist/graphics/scene/node/node-data-plugin.test.js +40 -0
  121. package/dist/graphics/scene/node/node-data-plugin.test.js.map +1 -0
  122. package/dist/graphics/scene/node/node-plugin.d.ts +8 -1
  123. package/dist/graphics/scene/node/transform-plugin.d.ts +8 -1
  124. package/dist/graphics/scene/scene-plugin.d.ts +2353 -100
  125. package/dist/graphics/scene/scene-plugin.js +3 -3
  126. package/dist/graphics/scene/scene-plugin.js.map +1 -1
  127. package/dist/graphics/scene/scene-uniforms/scene-uniforms-plugin.d.ts +3 -3
  128. package/dist/index.d.ts +1 -53
  129. package/dist/index.js +1 -54
  130. package/dist/index.js.map +1 -1
  131. package/dist/material/assemble-material-row.d.ts +4 -0
  132. package/dist/material/assemble-material-row.js +22 -0
  133. package/dist/material/assemble-material-row.js.map +1 -0
  134. package/dist/material/definitions.d.ts +833 -0
  135. package/dist/material/definitions.js +423 -0
  136. package/dist/material/definitions.js.map +1 -0
  137. package/dist/material/emission-mode.d.ts +8 -0
  138. package/dist/material/emission-mode.js +9 -0
  139. package/dist/material/emission-mode.js.map +1 -0
  140. package/dist/material/index.d.ts +1 -0
  141. package/dist/material/index.js +3 -0
  142. package/dist/material/index.js.map +1 -0
  143. package/dist/material/json/from-json-string.d.ts +2 -0
  144. package/dist/material/json/from-json-string.js +12 -0
  145. package/dist/material/json/from-json-string.js.map +1 -0
  146. package/dist/material/json/from-json.d.ts +10 -0
  147. package/dist/material/json/from-json.js +16 -0
  148. package/dist/material/json/from-json.js.map +1 -0
  149. package/dist/material/json/from-json.test.d.ts +1 -0
  150. package/dist/material/json/from-json.test.js +46 -0
  151. package/dist/material/json/from-json.test.js.map +1 -0
  152. package/dist/material/json/is-properties-json.d.ts +2 -0
  153. package/dist/material/json/is-properties-json.js +65 -0
  154. package/dist/material/json/is-properties-json.js.map +1 -0
  155. package/dist/material/json/library-json.d.ts +3 -0
  156. package/dist/material/json/library-json.js +2 -0
  157. package/dist/material/json/library-json.js.map +1 -0
  158. package/dist/material/json/load-json.d.ts +7 -0
  159. package/dist/material/json/load-json.js +10 -0
  160. package/dist/material/json/load-json.js.map +1 -0
  161. package/dist/material/json/properties-json.d.ts +25 -0
  162. package/dist/material/json/properties-json.js +2 -0
  163. package/dist/material/json/properties-json.js.map +1 -0
  164. package/dist/material/json/public.d.ts +9 -0
  165. package/dist/material/json/public.js +6 -0
  166. package/dist/material/json/public.js.map +1 -0
  167. package/dist/material/json/to-definition.d.ts +5 -0
  168. package/dist/material/json/to-definition.js +65 -0
  169. package/dist/material/json/to-definition.js.map +1 -0
  170. package/dist/material/material-by-name-lookup.d.ts +11 -0
  171. package/dist/material/material-by-name-lookup.js +3 -0
  172. package/dist/material/material-by-name-lookup.js.map +1 -0
  173. package/dist/material/material-defaults.d.ts +23 -0
  174. package/dist/material/material-defaults.js +25 -0
  175. package/dist/material/material-defaults.js.map +1 -0
  176. package/dist/material/material-definition.d.ts +3 -0
  177. package/dist/material/material-definition.js +2 -0
  178. package/dist/material/material-definition.js.map +1 -0
  179. package/dist/material/material-name.d.ts +2 -0
  180. package/dist/material/material-name.js +2 -0
  181. package/dist/material/material-name.js.map +1 -0
  182. package/dist/material/material-plugin.d.ts +891 -22
  183. package/dist/material/material-plugin.js +46 -21
  184. package/dist/material/material-plugin.js.map +1 -1
  185. package/dist/material/material-plugin.test.d.ts +1 -0
  186. package/dist/material/material-plugin.test.js +87 -0
  187. package/dist/material/material-plugin.test.js.map +1 -0
  188. package/dist/material/material.d.ts +27 -29
  189. package/dist/material/material.js +0 -1
  190. package/dist/material/material.js.map +1 -1
  191. package/dist/material/public.d.ts +12 -2
  192. package/dist/material/public.js +12 -2
  193. package/dist/material/public.js.map +1 -1
  194. package/dist/material/require-material.d.ts +4 -0
  195. package/dist/material/require-material.js +10 -0
  196. package/dist/material/require-material.js.map +1 -0
  197. package/dist/material/standard-material-names.d.ts +2 -0
  198. package/dist/material/standard-material-names.js +4 -0
  199. package/dist/material/standard-material-names.js.map +1 -0
  200. package/dist/material/standard-materials.d.ts +1 -1
  201. package/dist/material/standard-materials.js +17 -24
  202. package/dist/material/standard-materials.js.map +1 -1
  203. package/dist/material/stress-strain-curve/create.d.ts +8 -0
  204. package/dist/material/stress-strain-curve/create.js +2 -0
  205. package/dist/material/stress-strain-curve/create.js.map +1 -0
  206. package/dist/material/stress-strain-curve/public.d.ts +2 -0
  207. package/dist/material/stress-strain-curve/public.js +3 -0
  208. package/dist/material/stress-strain-curve/public.js.map +1 -0
  209. package/dist/material/stress-strain-curve/schema.d.ts +52 -0
  210. package/dist/material/stress-strain-curve/schema.js +19 -0
  211. package/dist/material/stress-strain-curve/schema.js.map +1 -0
  212. package/dist/material/stress-strain-curve/schema.test.d.ts +1 -0
  213. package/dist/material/stress-strain-curve/schema.test.js +18 -0
  214. package/dist/material/stress-strain-curve/schema.test.js.map +1 -0
  215. package/dist/material/stress-strain-curve/stress-strain-curve.d.ts +4 -0
  216. package/dist/material/stress-strain-curve/stress-strain-curve.js +2 -0
  217. package/dist/material/stress-strain-curve/stress-strain-curve.js.map +1 -0
  218. package/dist/physics/body/collider-shape/mass-from-volume.d.ts +2 -0
  219. package/dist/physics/body/collider-shape/mass-from-volume.js +4 -0
  220. package/dist/physics/body/collider-shape/mass-from-volume.js.map +1 -0
  221. package/dist/physics/body/collider-shape/mass-from-volume.test.d.ts +1 -0
  222. package/dist/physics/body/collider-shape/mass-from-volume.test.js +8 -0
  223. package/dist/physics/body/collider-shape/mass-from-volume.test.js.map +1 -0
  224. package/dist/physics/collider-primitive-render-archetype.d.ts +2 -0
  225. package/dist/physics/collider-primitive-render-archetype.js +3 -0
  226. package/dist/physics/collider-primitive-render-archetype.js.map +1 -0
  227. package/dist/physics/collider-primitive-render-archetypes.d.ts +2 -0
  228. package/dist/physics/collider-primitive-render-archetypes.js +9 -0
  229. package/dist/physics/collider-primitive-render-archetypes.js.map +1 -0
  230. package/dist/physics/index.d.ts +1 -0
  231. package/dist/physics/index.js +3 -0
  232. package/dist/physics/index.js.map +1 -0
  233. package/dist/physics/is-voxel-shape-physics-pending.d.ts +3 -0
  234. package/dist/physics/is-voxel-shape-physics-pending.js +7 -0
  235. package/dist/physics/is-voxel-shape-physics-pending.js.map +1 -0
  236. package/dist/physics/physics-clock/physics-clock.d.ts +15 -0
  237. package/dist/physics/physics-clock/physics-clock.js +3 -0
  238. package/dist/physics/physics-clock/physics-clock.js.map +1 -0
  239. package/dist/physics/physics-clock-plugin.d.ts +2 -22
  240. package/dist/physics/physics-clock-plugin.js +0 -2
  241. package/dist/physics/physics-clock-plugin.js.map +1 -1
  242. package/dist/physics/physics-clock.test.js.map +1 -1
  243. package/dist/physics/physics-data-plugin.d.ts +889 -13
  244. package/dist/physics/physics-data-plugin.js +8 -6
  245. package/dist/physics/physics-data-plugin.js.map +1 -1
  246. package/dist/physics/public.d.ts +21 -0
  247. package/dist/physics/public.js +23 -0
  248. package/dist/physics/public.js.map +1 -0
  249. package/dist/physics/ragdoll/bone-capsule.d.ts +8 -0
  250. package/dist/physics/ragdoll/bone-capsule.js +3 -0
  251. package/dist/physics/ragdoll/bone-capsule.js.map +1 -0
  252. package/dist/physics/ragdoll/fit-bone-capsules-input.d.ts +11 -0
  253. package/dist/physics/ragdoll/fit-bone-capsules-input.js +3 -0
  254. package/dist/physics/ragdoll/fit-bone-capsules-input.js.map +1 -0
  255. package/dist/physics/ragdoll/fit-bone-capsules.d.ts +2 -38
  256. package/dist/physics/ragdoll/fit-bone-capsules.js +13 -0
  257. package/dist/physics/ragdoll/fit-bone-capsules.js.map +1 -1
  258. package/dist/physics/ragdoll/fit-bone-capsules.test.js.map +1 -1
  259. package/dist/physics/ragdoll/skin-vertices.d.ts +6 -0
  260. package/dist/physics/ragdoll/skin-vertices.js +3 -0
  261. package/dist/physics/ragdoll/skin-vertices.js.map +1 -0
  262. package/dist/physics/rigid-body-components.d.ts +2 -0
  263. package/dist/physics/rigid-body-components.js +13 -0
  264. package/dist/physics/rigid-body-components.js.map +1 -0
  265. package/dist/physics/solvers/jolt-solver-plugin.d.ts +918 -41
  266. package/dist/physics/solvers/jolt-solver-plugin.js +19 -3
  267. package/dist/physics/solvers/jolt-solver-plugin.js.map +1 -1
  268. package/dist/physics/solvers/rapier-solver-plugin.d.ts +918 -41
  269. package/dist/physics/solvers/rapier-solver-plugin.js +7 -2
  270. package/dist/physics/solvers/rapier-solver-plugin.js.map +1 -1
  271. package/dist/physics/solvers/solver-benchmark-options.d.ts +14 -0
  272. package/dist/physics/solvers/solver-benchmark-options.js +3 -0
  273. package/dist/physics/solvers/solver-benchmark-options.js.map +1 -0
  274. package/dist/physics/solvers/solver-benchmark-result.d.ts +15 -0
  275. package/dist/physics/solvers/solver-benchmark-result.js +3 -0
  276. package/dist/physics/solvers/solver-benchmark-result.js.map +1 -0
  277. package/dist/physics/solvers/solver-benchmark.d.ts +2 -43
  278. package/dist/physics/solvers/solver-benchmark.js.map +1 -1
  279. package/dist/physics/static-collider-components.d.ts +2 -0
  280. package/dist/physics/static-collider-components.js +10 -0
  281. package/dist/physics/static-collider-components.js.map +1 -0
  282. package/package.json +14 -2
  283. package/src/core/public.ts +4 -0
  284. package/src/graphics/camera/orbit/attach-orbit-drag.ts +7 -27
  285. package/src/graphics/camera/orbit/orbit-data-plugin.ts +1 -1
  286. package/src/graphics/camera/orbit/orbit-drag-service.ts +13 -0
  287. package/src/graphics/camera/orbit/orbit-system-plugin.ts +6 -9
  288. package/src/graphics/camera/orbit/orbit.ts +5 -5
  289. package/src/graphics/camera/orbit/public.ts +2 -2
  290. package/src/graphics/index.ts +3 -0
  291. package/src/graphics/picking/picking-plugin.ts +4 -4
  292. package/src/graphics/public.ts +40 -0
  293. package/src/graphics/rendering/bone-collider-plugin.ts +16 -12
  294. package/src/graphics/rendering/display-transform-plugin.ts +2 -2
  295. package/src/graphics/rendering/ibl-render/ibl-render-plugin.ts +9 -9
  296. package/src/graphics/rendering/interpolation.test.ts +1 -1
  297. package/src/graphics/rendering/jolt-ragdoll-plugin.ts +11 -7
  298. package/src/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.ts +86 -0
  299. package/src/graphics/rendering/material-palette-gpu/material-palette-gpu.test.ts +20 -0
  300. package/src/graphics/rendering/material-palette-gpu/material-palette.ts +41 -0
  301. package/src/graphics/rendering/material-palette-gpu/palette-bind-group.ts +24 -0
  302. package/src/graphics/rendering/model-collider-plugin.ts +19 -35
  303. package/src/graphics/rendering/pbr-core-plugin.ts +16 -19
  304. package/src/graphics/rendering/pbr-render/{pbr-render-plugin.ts → pbr-factor-render-plugin.ts} +60 -111
  305. package/src/graphics/rendering/pbr-render/{pbr-array-shader.wgsl.ts → pbr-factor-shader.wgsl.ts} +19 -40
  306. package/src/graphics/rendering/pbr-render/physics-bridge-plugin.ts +95 -69
  307. package/src/graphics/rendering/pbr-render/primitive-render-shared.ts +76 -0
  308. package/src/graphics/rendering/skinning/skinning-plugin.ts +23 -41
  309. package/src/graphics/scene/model/geometry/public.ts +1 -1
  310. package/src/graphics/scene/model/mesh/mesh.ts +18 -0
  311. package/src/graphics/scene/model/mesh/public.ts +3 -0
  312. package/src/graphics/scene/model/mesh-plugin.ts +102 -0
  313. package/src/graphics/scene/model/model-loader-plugin.ts +25 -43
  314. package/src/graphics/scene/model/model-plugin.ts +1 -44
  315. package/src/graphics/scene/model/model.ts +2 -6
  316. package/src/graphics/scene/model/public.ts +3 -1
  317. package/src/graphics/scene/model/shape/bounds-from-shape-mesh.ts +20 -0
  318. package/src/graphics/scene/model/shape/shape-geometry-plugin.ts +97 -18
  319. package/src/graphics/scene/model/shape/shape-spec.ts +9 -0
  320. package/src/graphics/scene/model/world-bounds-plugin.ts +6 -25
  321. package/src/graphics/scene/node/node-data-plugin.test.ts +47 -0
  322. package/src/graphics/scene/node/node-data-plugin.ts +12 -5
  323. package/src/graphics/scene/scene-plugin.ts +3 -3
  324. package/src/index.ts +1 -70
  325. package/src/material/assemble-material-row.ts +26 -0
  326. package/src/material/definitions.ts +427 -0
  327. package/src/material/emission-mode.ts +11 -0
  328. package/src/material/index.ts +3 -0
  329. package/src/material/json/from-json-string.ts +11 -0
  330. package/src/material/json/from-json.test.ts +50 -0
  331. package/src/material/json/from-json.ts +23 -0
  332. package/src/material/json/is-properties-json.ts +77 -0
  333. package/src/material/json/library-json.ts +4 -0
  334. package/src/material/json/load-json.ts +15 -0
  335. package/src/material/json/properties-json.ts +25 -0
  336. package/src/material/json/public.ts +9 -0
  337. package/src/material/json/to-definition.ts +70 -0
  338. package/src/material/material-by-name-lookup.ts +10 -0
  339. package/src/material/material-defaults.ts +26 -0
  340. package/src/material/material-definition.ts +4 -0
  341. package/src/material/material-name.ts +3 -0
  342. package/src/material/material-plugin.test.ts +97 -0
  343. package/src/material/material-plugin.ts +67 -39
  344. package/src/material/material.ts +35 -34
  345. package/src/material/public.ts +12 -2
  346. package/src/material/require-material.ts +15 -0
  347. package/src/material/standard-material-names.ts +4 -0
  348. package/src/material/standard-materials.ts +21 -27
  349. package/src/material/stress-strain-curve/create.ts +9 -0
  350. package/src/material/stress-strain-curve/public.ts +2 -0
  351. package/src/material/stress-strain-curve/schema.test.ts +20 -0
  352. package/src/material/stress-strain-curve/schema.ts +20 -0
  353. package/src/material/stress-strain-curve/stress-strain-curve.ts +11 -0
  354. package/src/physics/README.md +9 -1
  355. package/src/physics/body/collider-shape/mass-from-volume.test.ts +8 -0
  356. package/src/physics/body/collider-shape/mass-from-volume.ts +4 -0
  357. package/src/physics/collider-primitive-render-archetype.ts +5 -0
  358. package/src/physics/collider-primitive-render-archetypes.ts +9 -0
  359. package/src/physics/index.ts +3 -0
  360. package/src/physics/is-voxel-shape-physics-pending.ts +9 -0
  361. package/src/physics/physics-clock/physics-clock.ts +17 -0
  362. package/src/physics/physics-clock-plugin.ts +1 -24
  363. package/src/physics/physics-clock.test.ts +2 -1
  364. package/src/physics/physics-data-plugin.ts +8 -6
  365. package/src/physics/public.ts +23 -0
  366. package/src/physics/ragdoll/bone-capsule.ts +11 -0
  367. package/src/physics/ragdoll/fit-bone-capsules-input.ts +14 -0
  368. package/src/physics/ragdoll/fit-bone-capsules.test.ts +2 -1
  369. package/src/physics/ragdoll/fit-bone-capsules.ts +2 -27
  370. package/src/physics/ragdoll/skin-vertices.ts +8 -0
  371. package/src/physics/rigid-body-components.ts +13 -0
  372. package/src/physics/solvers/README.md +4 -0
  373. package/src/physics/solvers/jolt-solver-plugin.ts +19 -5
  374. package/src/physics/solvers/rapier-solver-plugin.ts +5 -2
  375. package/src/physics/solvers/solver-benchmark-options.ts +16 -0
  376. package/src/physics/solvers/solver-benchmark-result.ts +17 -0
  377. package/src/physics/solvers/solver-benchmark.ts +2 -35
  378. package/src/physics/static-collider-components.ts +10 -0
  379. package/tsconfig.tsbuildinfo +1 -1
  380. package/src/graphics/rendering/material-gpu/material-arrays.ts +0 -113
  381. package/src/graphics/rendering/material-gpu/material-bind-group.ts +0 -61
  382. package/src/graphics/rendering/material-gpu/material-gpu-plugin.ts +0 -95
  383. package/src/graphics/scene/model/geometry/geometry.ts +0 -12
@@ -0,0 +1,76 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Entity } from "@adobe/data/ecs";
4
+
5
+ /** Must match `pbrIblRender` IBL bake mip count. */
6
+ export const PREFILTERED_MIP_COUNT = 7;
7
+
8
+ /** Drawable: visible entity with mesh ref, transform, and material. */
9
+ export const DRAWABLE = ["mesh", "visible", "position", "rotation", "scale", "material"] as const;
10
+ export const DRAWABLE_INTERP = [...DRAWABLE, "_renderPosition", "_renderRotation"] as const;
11
+ export const DRAWABLE_DIRECT = { exclude: ["_renderPosition"] } as const;
12
+ export const PRIMITIVE = ["_vertexBuffer", "_indexBuffer", "_indexCount", "_indexFormat", "_mesh", "_nodeLocalMatrix"] as const;
13
+
14
+ /** Minimal column shape the gather reads — satisfied by either query's columns. */
15
+ export interface ColumnReader<T> { get(i: number): T }
16
+
17
+ export function createIblBindGroupLayout(device: GPUDevice): GPUBindGroupLayout {
18
+ return device.createBindGroupLayout({
19
+ entries: [
20
+ { binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "float", viewDimension: "cube" } },
21
+ { binding: 1, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "float", viewDimension: "cube" } },
22
+ { binding: 2, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: "float", viewDimension: "2d" } },
23
+ { binding: 3, visibility: GPUShaderStage.FRAGMENT, sampler: { type: "filtering" } },
24
+ ],
25
+ });
26
+ }
27
+
28
+ /** Compose column-major TRS into `out[o..o+15]`. */
29
+ export function composeTrs(
30
+ out: Float32Array, o: number,
31
+ p: ArrayLike<number>, pi: number, q: ArrayLike<number>, qi: number, s: ArrayLike<number>, si: number,
32
+ ): void {
33
+ const qx = q[qi], qy = q[qi + 1], qz = q[qi + 2], qw = q[qi + 3];
34
+ const sx = s[si], sy = s[si + 1], sz = s[si + 2];
35
+ const xx = qx * qx, yy = qy * qy, zz = qz * qz;
36
+ const xy = qx * qy, xz = qx * qz, yz = qy * qz;
37
+ const wx = qw * qx, wy = qw * qy, wz = qw * qz;
38
+ out[o] = (1 - 2 * (yy + zz)) * sx; out[o + 1] = (2 * (xy + wz)) * sx; out[o + 2] = (2 * (xz - wy)) * sx; out[o + 3] = 0;
39
+ out[o + 4] = (2 * (xy - wz)) * sy; out[o + 5] = (1 - 2 * (xx + zz)) * sy; out[o + 6] = (2 * (yz + wx)) * sy; out[o + 7] = 0;
40
+ out[o + 8] = (2 * (xz + wy)) * sz; out[o + 9] = (2 * (yz - wx)) * sz; out[o + 10] = (1 - 2 * (xx + yy)) * sz; out[o + 11] = 0;
41
+ out[o + 12] = p[pi]; out[o + 13] = p[pi + 1]; out[o + 14] = p[pi + 2]; out[o + 15] = 1;
42
+ }
43
+
44
+ export interface MeshBatch {
45
+ off: number[];
46
+ materialIndex: number[];
47
+ }
48
+
49
+ /** @deprecated Use `MeshBatch`. */
50
+ export type GeometryBatch = MeshBatch;
51
+
52
+ export interface InstancedDrawCache {
53
+ buffer: GPUBuffer;
54
+ indexBuffer: GPUBuffer;
55
+ bindGroup: GPUBindGroup;
56
+ capacity: number;
57
+ }
58
+
59
+ /** Refresh material entity → GPU index map when the tagged material set grows. */
60
+ export function refreshMaterialIndexMap(
61
+ db: { store: { queryArchetypes: (cols: string[]) => Iterable<{ rowCount: number; columns: { id: ColumnReader<Entity>; [k: string]: ColumnReader<number> } }> } },
62
+ indexColumn: string,
63
+ matCount: { value: number },
64
+ matIndex: Map<Entity, number>,
65
+ ): void {
66
+ let mc = 0;
67
+ for (const arch of db.store.queryArchetypes([indexColumn])) mc += arch.rowCount;
68
+ if (mc === matCount.value) return;
69
+ matIndex.clear();
70
+ for (const arch of db.store.queryArchetypes([indexColumn])) {
71
+ const id = arch.columns.id;
72
+ const col = arch.columns[indexColumn];
73
+ for (let i = 0; i < arch.rowCount; i++) matIndex.set(id.get(i), col.get(i));
74
+ }
75
+ matCount.value = mc;
76
+ }
@@ -9,36 +9,21 @@ import { animation } from "../../animation/animation-plugin.js";
9
9
  import type { JointTemplate } from "../../scene/model/gltf/parse-skin.js";
10
10
 
11
11
  /**
12
- * pbrSkinning
13
- * query: Model+geometry, _Skeleton
14
- * read:
15
- * geometry
16
- * _skinJointTemplate (from Geometry)
17
- * _skinInverseBindMatrices (from Geometry)
18
- * _animationClipRefs (from Geometry)
19
- * _worldMatrix (from Model + joint Nodes)
20
- * write:
21
- * _Skeleton // new ephemeral entity, one per skinned Model
22
- * Node // joint entities (TRS hierarchy)
23
- * Animation // optional, when geometry has clips
24
- * _skeletonInstanceBuffer
25
- * _skeletonJointMatrixBuffer
26
- * _skeletonJointMatrixBindGroup
12
+ * pbrSkinning — builds a `_Skeleton` for each `Model` whose `mesh` is a
13
+ * `SkinnedMesh` (non-empty `skinJointTemplate`).
27
14
  */
28
15
  export const pbrSkinning = Database.Plugin.create({
29
16
  extends: Database.Plugin.combine(modelLoader, pbrCore, transform, animation),
30
17
  components: {
31
- _skeletonJoints: { default: [] as number[] },
32
- _skeletonGeometry: Entity.schema,
33
- /** 64 bytes — the Model's world matrix, refreshed each frame. */
34
- _skeletonInstanceBuffer: { default: null as GPUBuffer | null },
35
- /** N × 64 bytes — joint skinning matrices, refreshed each frame. */
36
- _skeletonJointMatrixBuffer: { default: null as GPUBuffer | null },
18
+ _skeletonJoints: { default: [] as number[], nonPersistent: true },
19
+ _skeletonMesh: { ...Entity.schema, nonPersistent: true },
20
+ _skeletonInstanceBuffer: { default: null as GPUBuffer | null, nonPersistent: true },
21
+ _skeletonJointMatrixBuffer: { default: null as GPUBuffer | null, nonPersistent: true },
37
22
  },
38
23
  archetypes: {
39
24
  _Skeleton: [
40
25
  "_skeletonJoints",
41
- "_skeletonGeometry",
26
+ "_skeletonMesh",
42
27
  "_skeletonModelRef",
43
28
  "_skeletonInstanceBuffer",
44
29
  "_skeletonJointMatrixBuffer",
@@ -48,7 +33,7 @@ export const pbrSkinning = Database.Plugin.create({
48
33
  transactions: {
49
34
  initSkeleton(t, args: {
50
35
  modelRef: number;
51
- geometryRef: number;
36
+ meshRef: number;
52
37
  jointTemplate: readonly JointTemplate[];
53
38
  instanceBuffer: GPUBuffer;
54
39
  jointMatrixBuffer: GPUBuffer;
@@ -56,9 +41,6 @@ export const pbrSkinning = Database.Plugin.create({
56
41
  clipRef: number | null;
57
42
  }) {
58
43
  const jointIds: number[] = new Array(args.jointTemplate.length);
59
- // jointTemplate is in glTF skin.joints[] order. Parents can come
60
- // after children in glTF, so resolve parent entity ids in two passes:
61
- // first insert with parent=0, then update each joint's parent.
62
44
  for (let i = 0; i < args.jointTemplate.length; i++) {
63
45
  const j = args.jointTemplate[i];
64
46
  jointIds[i] = t.archetypes.Node.insert({
@@ -76,7 +58,7 @@ export const pbrSkinning = Database.Plugin.create({
76
58
  }
77
59
  t.archetypes._Skeleton.insert({
78
60
  _skeletonJoints: jointIds,
79
- _skeletonGeometry: args.geometryRef,
61
+ _skeletonMesh: args.meshRef,
80
62
  _skeletonModelRef: args.modelRef,
81
63
  _skeletonInstanceBuffer: args.instanceBuffer,
82
64
  _skeletonJointMatrixBuffer: args.jointMatrixBuffer,
@@ -110,15 +92,18 @@ export const pbrSkinning = Database.Plugin.create({
110
92
  ],
111
93
  });
112
94
  }
113
- for (const arch of db.store.queryArchetypes(["geometry"])) {
95
+ for (const arch of db.store.queryArchetypes(["mesh"])) {
114
96
  const ids = arch.columns.id;
115
- const geoRefs = arch.columns.geometry;
97
+ const meshRefs = arch.columns.mesh;
116
98
  for (let i = 0; i < arch.rowCount; i++) {
117
99
  const modelId = ids.get(i);
118
100
  if (initialized.has(modelId)) continue;
119
- const geoId = geoRefs.get(i);
120
- const geo = db.store.read(geoId);
121
- const template = geo?._skinJointTemplate;
101
+ const meshId = meshRefs.get(i);
102
+ const asset = db.store.read(meshId) as {
103
+ skinJointTemplate?: JointTemplate[];
104
+ animationClipRefs?: number[];
105
+ } | null;
106
+ const template = asset?.skinJointTemplate;
122
107
  if (!template || template.length === 0) continue;
123
108
  initialized.add(modelId);
124
109
 
@@ -139,12 +124,12 @@ export const pbrSkinning = Database.Plugin.create({
139
124
  });
140
125
  db.transactions.initSkeleton({
141
126
  modelRef: modelId,
142
- geometryRef: geoId,
127
+ meshRef: meshId,
143
128
  jointTemplate: template,
144
129
  instanceBuffer,
145
130
  jointMatrixBuffer: matrixBuffer,
146
131
  jointMatrixBindGroup: matrixBindGroup,
147
- clipRef: geo?._animationClipRefs?.[0] ?? null,
132
+ clipRef: asset?.animationClipRefs?.[0] ?? null,
148
133
  });
149
134
  }
150
135
  }
@@ -160,29 +145,28 @@ export const pbrSkinning = Database.Plugin.create({
160
145
  if (!device) return;
161
146
  for (const arch of db.store.queryArchetypes([
162
147
  "_skeletonJoints",
163
- "_skeletonGeometry",
148
+ "_skeletonMesh",
164
149
  "_skeletonModelRef",
165
150
  "_skeletonInstanceBuffer",
166
151
  "_skeletonJointMatrixBuffer",
167
152
  ])) {
168
153
  const jointsCol = arch.columns._skeletonJoints;
169
- const geoCol = arch.columns._skeletonGeometry;
154
+ const meshCol = arch.columns._skeletonMesh;
170
155
  const modelCol = arch.columns._skeletonModelRef;
171
156
  const instBufCol = arch.columns._skeletonInstanceBuffer;
172
157
  const bufCol = arch.columns._skeletonJointMatrixBuffer;
173
158
  for (let i = 0; i < arch.rowCount; i++) {
174
159
  const joints = jointsCol.get(i);
175
- const geoId = geoCol.get(i);
160
+ const meshId = meshCol.get(i);
176
161
  const modelId = modelCol.get(i);
177
162
  const instanceBuffer = instBufCol.get(i);
178
163
  const buffer = bufCol.get(i);
179
164
  if (!buffer || !instanceBuffer) continue;
180
- const ibm = db.store.get(geoId, "_skinInverseBindMatrices");
165
+ const ibm = db.store.get(meshId, "skinInverseBindMatrices") as Float32Array | null;
181
166
  if (!ibm) continue;
182
167
  const modelWorld = db.store.get(modelId, "_worldMatrix");
183
168
  if (!modelWorld) continue;
184
169
 
185
- // The vertex shader's `instances[0]` slot.
186
170
  device.queue.writeBuffer(instanceBuffer, 0, new Float32Array(modelWorld));
187
171
 
188
172
  const invModelWorld = Mat4x4.inverse(modelWorld);
@@ -191,8 +175,6 @@ export const pbrSkinning = Database.Plugin.create({
191
175
  }
192
176
  for (let j = 0; j < joints.length; j++) {
193
177
  const jw = db.store.get(joints[j], "_worldMatrix") ?? Mat4x4.identity;
194
- // inverse(modelWorld) × jointWorld × IBM — leaves vertices in
195
- // model-local space; vertex shader applies modelWorld separately.
196
178
  const ibmJoint: Mat4x4 = [
197
179
  ibm[j * 16 + 0], ibm[j * 16 + 1], ibm[j * 16 + 2], ibm[j * 16 + 3],
198
180
  ibm[j * 16 + 4], ibm[j * 16 + 5], ibm[j * 16 + 6], ibm[j * 16 + 7],
@@ -1,4 +1,4 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
- // Reserved for future Geometry helpers (e.g. bounds queries).
3
+ /** @deprecated Use `mesh/mesh.ts`. */
4
4
  export {};
@@ -0,0 +1,18 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Aabb } from "@adobe/data/math";
4
+ import type { JointTemplate } from "../gltf/parse-skin.js";
5
+
6
+ /** Baked static mesh asset — local-space bounds only. */
7
+ export interface StaticMesh {
8
+ localBounds: Aabb;
9
+ }
10
+
11
+ /** Baked skinned mesh asset — static capabilities plus skeleton/animation data. */
12
+ export interface SkinnedMesh extends StaticMesh {
13
+ skinJointTemplate: JointTemplate[];
14
+ skinInverseBindMatrices: Float32Array | null;
15
+ animationClipRefs: number[];
16
+ }
17
+
18
+ export * as Mesh from "./public.js";
@@ -0,0 +1,3 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export { mesh as plugin } from "../mesh-plugin.js";
@@ -0,0 +1,102 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import { Database, Entity } from "@adobe/data/ecs";
4
+ import { Aabb, Quat, type Vec3 } from "@adobe/data/math";
5
+ import { Node } from "../node/node.js";
6
+ import { plugin as Material } from "../../../material/material-plugin.js";
7
+ import type { ShapeSpec } from "./shape/shape-spec.js";
8
+ import type { JointTemplate } from "./gltf/parse-skin.js";
9
+
10
+ /**
11
+ * Mesh asset model — separates mesh **intent** (pending import), **asset**
12
+ * (static or skinned capabilities), and **instance** (placed drawables).
13
+ *
14
+ * - `GltfMeshPending` / `ShapeMeshPending` — work queue; the entity id is the
15
+ * stable mesh handle instances can reference before GPU data exists.
16
+ * - `StaticMesh` / `SkinnedMesh` — baked assets with capability components.
17
+ * - `Model` — hierarchical instance (glTF / scene graph).
18
+ * - `MeshInstance` — render-only instance with a material (factor path).
19
+ */
20
+ export const mesh = Database.Plugin.create({
21
+ extends: Database.Plugin.combine(Node.plugin, Material),
22
+ components: {
23
+ /** Instance → baked mesh asset entity. */
24
+ mesh: Entity.schema,
25
+ /** Pending glTF import — cleared when the row migrates to Static/SkinnedMesh. */
26
+ gltfUrl: { type: "string" },
27
+ /** Pending procedural import — cleared when baked to StaticMesh. */
28
+ shapeSpec: { default: null as ShapeSpec | null },
29
+ /** Optional grid dimensions on baked mesh assets (used by extensions for scale). */
30
+ voxelVolumeSize: { default: null as Vec3 | null },
31
+ /** Asset-space axis-aligned bounds (all baked meshes). */
32
+ localBounds: { default: null as Aabb | null },
33
+ /** Skinned-mesh capabilities (SkinnedMesh archetype). */
34
+ skinJointTemplate: { default: [] as JointTemplate[] },
35
+ skinInverseBindMatrices: { default: null as Float32Array | null },
36
+ animationClipRefs: { default: [] as number[] },
37
+ /** CPU-retained collision source for auto-collider generation. */
38
+ cpuCollisionPositions: { default: null as Float32Array | null },
39
+ cpuCollisionIndices: { default: null as Uint32Array | null },
40
+ /** CPU-retained skin bind data for ragdoll capsule fitting. */
41
+ cpuSkin: { default: null as { positions: Float32Array; joints: Uint32Array; weights: Float32Array } | null },
42
+ },
43
+ resources: {
44
+ _gltfMeshByUrl: { default: null as Map<string, Entity> | null, nonPersistent: true },
45
+ },
46
+ archetypes: {
47
+ GltfMeshPending: ["gltfUrl"],
48
+ ShapeMeshPending: ["shapeSpec"],
49
+ StaticMesh: ["localBounds"],
50
+ SkinnedMesh: ["localBounds", "skinJointTemplate", "skinInverseBindMatrices", "animationClipRefs"],
51
+ MeshInstance: ["mesh", "position", "rotation", "scale", "visible", "material"],
52
+ Model: ["mesh", "position", "rotation", "scale", "visible", "parent"],
53
+ },
54
+ transactions: {
55
+ insertGltfMesh(t, args: { url: string }): Entity {
56
+ const map = t.resources._gltfMeshByUrl ??= new Map();
57
+ const existing = map.get(args.url);
58
+ if (existing != null) return existing;
59
+ const id = t.archetypes.GltfMeshPending.insert({ gltfUrl: args.url });
60
+ map.set(args.url, id);
61
+ return id;
62
+ },
63
+ insertShapeMesh(t, args: { shapeSpec: ShapeSpec }): Entity {
64
+ return t.archetypes.ShapeMeshPending.insert({ shapeSpec: args.shapeSpec });
65
+ },
66
+ insertMeshInstance(t, args: {
67
+ mesh: Entity;
68
+ material: Entity;
69
+ position?: Vec3;
70
+ rotation?: Quat;
71
+ scale?: Vec3;
72
+ }): Entity {
73
+ return t.archetypes.MeshInstance.insert({
74
+ mesh: args.mesh,
75
+ material: args.material,
76
+ position: args.position ?? [0, 0, 0],
77
+ rotation: args.rotation ?? Quat.identity,
78
+ scale: args.scale ?? [1, 1, 1],
79
+ visible: true,
80
+ });
81
+ },
82
+ insertModel(t, args: {
83
+ mesh: Entity;
84
+ position?: Vec3;
85
+ rotation?: Quat;
86
+ scale?: Vec3;
87
+ parent?: Entity;
88
+ }): Entity {
89
+ return t.archetypes.Model.insert({
90
+ mesh: args.mesh,
91
+ position: args.position ?? [0, 0, 0],
92
+ rotation: args.rotation ?? Quat.identity,
93
+ scale: args.scale ?? [1, 1, 1],
94
+ visible: true,
95
+ parent: args.parent ?? 0,
96
+ });
97
+ },
98
+ },
99
+ });
100
+
101
+ /** @deprecated Use `mesh` — kept for scene combiner import path. */
102
+ export const model = mesh;
@@ -5,13 +5,13 @@ import type { Aabb } from "@adobe/data/math";
5
5
  import { pbrCore } from "../../rendering/pbr-core-plugin.js";
6
6
  import { animation } from "../../animation/animation-plugin.js";
7
7
  import { core } from "../../../core/core-plugin.js";
8
- import { Model } from "./model.js";
8
+ import { mesh } from "./mesh-plugin.js";
9
9
  import { loadGltfPrimitives, type GpuPrimitiveData } from "./gltf/load-gltf-model.js";
10
10
  import type { LoadedAnimation } from "./gltf/parse-animations.js";
11
11
  import type { JointTemplate } from "./gltf/parse-skin.js";
12
12
 
13
13
  export interface LoadedArgs {
14
- geometry: number;
14
+ mesh: number;
15
15
  bounds: Aabb;
16
16
  primitives: GpuPrimitiveData[];
17
17
  skinJointTemplate: JointTemplate[];
@@ -22,44 +22,23 @@ export interface LoadedArgs {
22
22
  }
23
23
 
24
24
  /**
25
- * modelLoader
26
- * query: Geometry-_bounds
27
- * read:
28
- * modelUrl
29
- * write:
30
- * _bounds: Aabb
31
- * _skinJointTemplate: JointTemplate[]
32
- * _skinInverseBindMatrices: Float32Array | null
33
- * _animationClipRefs: EntityId[]
34
- * _VisibleMaterial
35
- * _PbrPrimitive
36
- * AnimationClip // when the glTF carries animations
25
+ * modelLoader — queries `GltfMeshPending`, fetches each `gltfUrl`, inserts
26
+ * `_PbrPrimitive` rows, and migrates the mesh entity to `StaticMesh` or
27
+ * `SkinnedMesh` with capability components.
37
28
  */
38
29
  export const modelLoader = Database.Plugin.create({
39
- extends: Database.Plugin.combine(pbrCore, Model.plugin, core, animation),
40
- components: {
41
- _bounds: { default: null as Aabb | null },
42
- _skinJointTemplate: { default: [] as JointTemplate[] },
43
- _skinInverseBindMatrices: { default: null as Float32Array | null },
44
- _animationClipRefs: { default: [] as number[] },
45
- // CPU-retained model-space collision geometry (auto-collider source).
46
- _cpuPositions: { default: null as Float32Array | null },
47
- _cpuIndices: { default: null as Uint32Array | null },
48
- // CPU-retained skin (mesh-bind positions + 4 joints + 4 weights per vertex),
49
- // for fitting per-bone ragdoll capsules.
50
- _cpuSkin: { default: null as { positions: Float32Array; joints: Uint32Array; weights: Float32Array } | null },
51
- },
30
+ extends: Database.Plugin.combine(pbrCore, mesh, core, animation),
52
31
  transactions: {
53
32
  insertLoadedPrimitives(t, args: LoadedArgs) {
54
33
  for (const p of args.primitives) {
55
34
  const materialId = t.archetypes._VisibleMaterial.insert({
56
- ephemeral: true,
35
+ nonPersistent: true,
57
36
  _materialBindGroup: p.pbrMaterialBindGroup,
58
- _geometry: args.geometry,
37
+ _mesh: args.mesh,
59
38
  });
60
39
  t.archetypes._PbrPrimitive.insert({
61
- ephemeral: true,
62
- _geometry: args.geometry,
40
+ nonPersistent: true,
41
+ _mesh: args.mesh,
63
42
  _material: materialId,
64
43
  _vertexBuffer: p.pbrVertexBuffer,
65
44
  _skinVertexBuffer: p.pbrSkinVertexBuffer,
@@ -78,14 +57,17 @@ export const modelLoader = Database.Plugin.create({
78
57
  });
79
58
  clipRefs.push(clipId);
80
59
  }
81
- t.update(args.geometry, {
82
- _bounds: args.bounds,
83
- _skinJointTemplate: args.skinJointTemplate,
84
- _skinInverseBindMatrices: args.skinInverseBindMatrices,
85
- _animationClipRefs: clipRefs,
86
- _cpuPositions: args.collision?.positions ?? null,
87
- _cpuIndices: args.collision?.indices ?? null,
88
- _cpuSkin: args.skinVertices,
60
+ const skinned = args.skinJointTemplate.length > 0;
61
+ t.update(args.mesh, {
62
+ localBounds: args.bounds,
63
+ cpuCollisionPositions: args.collision?.positions ?? null,
64
+ cpuCollisionIndices: args.collision?.indices ?? null,
65
+ cpuSkin: args.skinVertices,
66
+ ...(skinned ? {
67
+ skinJointTemplate: args.skinJointTemplate,
68
+ skinInverseBindMatrices: args.skinInverseBindMatrices,
69
+ animationClipRefs: clipRefs,
70
+ } : {}),
89
71
  });
90
72
  },
91
73
  },
@@ -96,19 +78,19 @@ export const modelLoader = Database.Plugin.create({
96
78
  return () => {
97
79
  const { device } = db.store.resources;
98
80
  if (!device) return;
99
- for (const arch of db.store.queryArchetypes(["modelUrl"])) {
81
+ for (const arch of db.store.queryArchetypes(["gltfUrl"])) {
100
82
  const ids = arch.columns.id;
101
- const urls = arch.columns.modelUrl;
83
+ const urls = arch.columns.gltfUrl;
102
84
  for (let i = 0; i < arch.rowCount; i++) {
103
85
  const id = ids.get(i);
104
86
  if (inFlight.has(id)) continue;
105
87
  const url = urls.get(i);
106
- if (!url) continue; // procedural geometries (shapes) carry no URL
88
+ if (!url) continue;
107
89
  inFlight.add(id);
108
90
  loadGltfPrimitives(device, url)
109
91
  .then(loaded => {
110
92
  db.transactions.insertLoadedPrimitives({
111
- geometry: id,
93
+ mesh: id,
112
94
  bounds: loaded.bounds,
113
95
  primitives: loaded.primitives,
114
96
  skinJointTemplate: loaded.skin?.jointTemplate ?? [],
@@ -1,46 +1,3 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
- import { Database, Entity } from "@adobe/data/ecs";
4
- import { Quat, type Vec3 } from "@adobe/data/math";
5
- import { Node } from "../node/node.js";
6
-
7
- /**
8
- * Authored renderable scene. A `Geometry` is an asset identified by URL; a
9
- * `Model` is a placed instance of a Geometry — a Node plus a reference to
10
- * the Geometry it draws.
11
- *
12
- * Loading is performed by `modelLoader`, which reads the `modelUrl` and
13
- * produces the GPU primitives the renderers consume.
14
- */
15
- export const model = Database.Plugin.create({
16
- extends: Node.plugin,
17
- components: {
18
- modelUrl: { type: "string" },
19
- geometry: Entity.schema,
20
- },
21
- archetypes: {
22
- Geometry: ["modelUrl"],
23
- Model: ["geometry", "position", "rotation", "scale", "visible", "parent"],
24
- },
25
- transactions: {
26
- insertGeometry(t, args: { modelUrl: string }): number {
27
- return t.archetypes.Geometry.insert({ modelUrl: args.modelUrl });
28
- },
29
- insertModel(t, args: {
30
- geometry: number;
31
- position?: Vec3;
32
- rotation?: Quat;
33
- scale?: Vec3;
34
- parent?: number;
35
- }): number {
36
- return t.archetypes.Model.insert({
37
- geometry: args.geometry,
38
- position: args.position ?? [0, 0, 0],
39
- rotation: args.rotation ?? Quat.identity,
40
- scale: args.scale ?? [1, 1, 1],
41
- visible: true,
42
- parent: args.parent ?? 0,
43
- });
44
- },
45
- },
46
- });
3
+ export { mesh as model } from "./mesh-plugin.js";
@@ -3,13 +3,9 @@
3
3
  import type { Entity } from "@adobe/data/ecs";
4
4
  import type { Node } from "../node/node.js";
5
5
 
6
- /**
7
- * One row of the `Model` archetype — a placed instance of a Geometry. A
8
- * Node (transform + visibility + parent) plus a reference to the Geometry
9
- * the renderer should draw.
10
- */
6
+ /** One row of the `Model` archetype — a placed instance of a mesh asset. */
11
7
  export interface Model extends Node {
12
- geometry: Entity;
8
+ mesh: Entity;
13
9
  }
14
10
 
15
11
  export * as Model from "./public.js";
@@ -1 +1,3 @@
1
- export { model as plugin } from "./model-plugin.js";
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export { mesh as plugin } from "./mesh-plugin.js";
@@ -0,0 +1,20 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Aabb } from "@adobe/data/math";
4
+ import type { ShapeMesh } from "./shape-mesh.js";
5
+
6
+ const FLOATS_PER_VERTEX = 12;
7
+
8
+ /** Axis-aligned bounds of packed StandardVertex positions in a shape mesh. */
9
+ export const boundsFromShapeMesh = (mesh: ShapeMesh): Aabb => {
10
+ const v = mesh.vertices;
11
+ let minX = Infinity, minY = Infinity, minZ = Infinity;
12
+ let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
13
+ for (let i = 0; i < v.length; i += FLOATS_PER_VERTEX) {
14
+ const x = v[i], y = v[i + 1], z = v[i + 2];
15
+ if (x < minX) minX = x; if (x > maxX) maxX = x;
16
+ if (y < minY) minY = y; if (y > maxY) maxY = y;
17
+ if (z < minZ) minZ = z; if (z > maxZ) maxZ = z;
18
+ }
19
+ return { min: [minX, minY, minZ], max: [maxX, maxY, maxZ] };
20
+ };