@adobe/data-gpu 0.9.75 → 0.9.76

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
@@ -1,33 +1,45 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
3
  import { Database, type Entity } from "@adobe/data/ecs";
4
+ import type { Aabb } from "@adobe/data/math";
4
5
  import { Mat4x4 } from "@adobe/data/math";
5
6
  import { pbrCore } from "../../../rendering/pbr-core-plugin.js";
6
7
  import { core } from "../../../../core/core-plugin.js";
7
- import { model } from "../model-plugin.js";
8
+ import { mesh } from "../mesh-plugin.js";
8
9
  import { unitSphere, unitCube } from "./shape-mesh.js";
9
10
  import { uploadShapeMesh } from "./upload-shape-mesh.js";
11
+ import { boundsFromShapeMesh } from "./bounds-from-shape-mesh.js";
12
+ import { capsuleMesh, flatShadedMesh } from "./shape-mesh.js";
13
+ import { convexHullMesh } from "./convex-hull.js";
14
+ import type { ShapeSpec } from "./shape-spec.js";
10
15
 
11
16
  /**
12
- * shapeGeometry — registers procedural unit-sphere and unit-cube geometries as
13
- * `Geometry` + `_PbrPrimitive` entities (StandardVertex layout), exactly like
14
- * the model loader does for glTF, so primitives and loaded models share one
15
- * render path. The two geometry entity ids are published in `_shapeGeometry`
16
- * for the physics render bridge to reference (sphere / cuboid bodies). Built
17
- * once when the device is ready.
17
+ * shapeGeometry — bakes built-in procedural meshes into `StaticMesh` + `_PbrPrimitive`
18
+ * (StandardVertex layout). Registers shared unit sphere/cube at init; provides
19
+ * `insertStaticMeshPrimitive` for direct bakes (capsule/hull caches, extensions, etc.).
18
20
  */
19
21
  export const shapeGeometry = Database.Plugin.create({
20
- extends: Database.Plugin.combine(pbrCore, model, core),
22
+ imports: Database.Plugin.combine(pbrCore, mesh),
23
+ extends: core,
21
24
  resources: {
22
- _shapeGeometry: { default: null as { sphere: Entity; cube: Entity } | null, nonPersistent: true },
25
+ _shapeMeshes: { default: null as { sphere: Entity; cube: Entity } | null, nonPersistent: true },
23
26
  },
24
27
  transactions: {
25
- insertShapePrimitive(t, args: { vertexBuffer: GPUBuffer; indexBuffer: GPUBuffer; indexCount: number }): Entity {
26
- const geometry = t.archetypes.Geometry.insert({ modelUrl: "" });
28
+ insertStaticMeshPrimitive(t, args: {
29
+ mesh?: Entity;
30
+ vertexBuffer: GPUBuffer;
31
+ indexBuffer: GPUBuffer;
32
+ indexCount: number;
33
+ localBounds: Aabb;
34
+ }): Entity {
35
+ const meshId = args.mesh ?? t.archetypes.StaticMesh.insert({ localBounds: args.localBounds });
36
+ if (args.mesh !== undefined) {
37
+ t.update(args.mesh, { localBounds: args.localBounds });
38
+ }
27
39
  t.archetypes._PbrPrimitive.insert({
28
- ephemeral: true,
29
- _geometry: geometry,
30
- _material: 0, // primitives carry material per-instance, not here
40
+ nonPersistent: true,
41
+ _mesh: meshId,
42
+ _material: 0,
31
43
  _vertexBuffer: args.vertexBuffer,
32
44
  _skinVertexBuffer: null,
33
45
  _indexBuffer: args.indexBuffer,
@@ -35,7 +47,7 @@ export const shapeGeometry = Database.Plugin.create({
35
47
  _indexFormat: "uint16",
36
48
  _nodeLocalMatrix: Mat4x4.identity,
37
49
  });
38
- return geometry;
50
+ return meshId;
39
51
  },
40
52
  },
41
53
  systems: {
@@ -50,12 +62,79 @@ export const shapeGeometry = Database.Plugin.create({
50
62
 
51
63
  const s = uploadShapeMesh(device, unitSphere());
52
64
  const c = uploadShapeMesh(device, unitCube());
53
- const sphere = db.transactions.insertShapePrimitive({ vertexBuffer: s.vb, indexBuffer: s.ib, indexCount: s.count });
54
- const cube = db.transactions.insertShapePrimitive({ vertexBuffer: c.vb, indexBuffer: c.ib, indexCount: c.count });
55
- db.store.resources._shapeGeometry = { sphere, cube };
65
+ const sphere = db.transactions.insertStaticMeshPrimitive({
66
+ vertexBuffer: s.vb, indexBuffer: s.ib, indexCount: s.count,
67
+ localBounds: boundsFromShapeMesh(unitSphere()),
68
+ });
69
+ const cube = db.transactions.insertStaticMeshPrimitive({
70
+ vertexBuffer: c.vb, indexBuffer: c.ib, indexCount: c.count,
71
+ localBounds: boundsFromShapeMesh(unitCube()),
72
+ });
73
+ db.store.resources._shapeMeshes = { sphere, cube };
56
74
  done = true;
57
75
  };
58
76
  },
59
77
  },
78
+ shapeMeshBake: {
79
+ schedule: { during: ["preUpdate"], after: ["shapeGeometryInit"] },
80
+ create: db => {
81
+ const bake = (spec: ShapeSpec): {
82
+ vb: GPUBuffer;
83
+ ib: GPUBuffer;
84
+ count: number;
85
+ localBounds: Aabb;
86
+ } | null => {
87
+ const { device } = db.store.resources;
88
+ if (!device) return null;
89
+ if (spec.kind === "unitSphere") {
90
+ const data = unitSphere();
91
+ const gpu = uploadShapeMesh(device, data);
92
+ return { ...gpu, localBounds: boundsFromShapeMesh(data) };
93
+ }
94
+ if (spec.kind === "unitBox") {
95
+ const data = unitCube();
96
+ const gpu = uploadShapeMesh(device, data);
97
+ return { ...gpu, localBounds: boundsFromShapeMesh(data) };
98
+ }
99
+ if (spec.kind === "capsule") {
100
+ const data = capsuleMesh(spec.radius, spec.halfHeight);
101
+ const gpu = uploadShapeMesh(device, data);
102
+ return { ...gpu, localBounds: boundsFromShapeMesh(data) };
103
+ }
104
+ if (spec.kind === "convexHull") {
105
+ const data = convexHullMesh(spec.points);
106
+ const gpu = uploadShapeMesh(device, data);
107
+ return { ...gpu, localBounds: boundsFromShapeMesh(data) };
108
+ }
109
+ if (spec.kind === "triMesh") {
110
+ const data = flatShadedMesh(spec.positions, spec.indices);
111
+ const gpu = uploadShapeMesh(device, data);
112
+ return { ...gpu, localBounds: boundsFromShapeMesh(data) };
113
+ }
114
+ return null;
115
+ };
116
+ return () => {
117
+ for (const arch of db.store.queryArchetypes(["shapeSpec"])) {
118
+ const ids = arch.columns.id;
119
+ const specs = arch.columns.shapeSpec;
120
+ for (let i = arch.rowCount - 1; i >= 0; i--) {
121
+ const spec = specs.get(i);
122
+ if (!spec) continue;
123
+ const meshId = ids.get(i);
124
+ const baked = bake(spec);
125
+ if (!baked) continue;
126
+ db.transactions.insertStaticMeshPrimitive({
127
+ mesh: meshId,
128
+ vertexBuffer: baked.vb,
129
+ indexBuffer: baked.ib,
130
+ indexCount: baked.count,
131
+ localBounds: baked.localBounds,
132
+ });
133
+ db.store.update(meshId, { shapeSpec: null });
134
+ }
135
+ }
136
+ };
137
+ },
138
+ },
60
139
  },
61
140
  });
@@ -0,0 +1,9 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ /** Authored procedural mesh intent — consumed by the shape baker, not the renderer. */
4
+ export type ShapeSpec =
5
+ | { kind: "unitSphere" }
6
+ | { kind: "unitBox" }
7
+ | { kind: "capsule"; radius: number; halfHeight: number }
8
+ | { kind: "convexHull"; points: Float32Array }
9
+ | { kind: "triMesh"; positions: Float32Array; indices: Uint32Array };
@@ -6,25 +6,8 @@ import { transform } from "../node/transform-plugin.js";
6
6
  import { modelLoader } from "./model-loader-plugin.js";
7
7
 
8
8
  /**
9
- * worldBoundsCreate
10
- * query: Model-_worldBounds
11
- * write: _worldBounds (archetype migration; unit placeholder)
12
- *
13
- * Adds the `_worldBounds` column to any Model that doesn't have it yet, so
14
- * `worldBoundsSystem` can write directly without further migration.
15
- *
16
- * worldBoundsSystem
17
- * query: Model+_worldMatrix+_worldBounds
18
- * read: geometry → _bounds, _worldMatrix
19
- * write: _worldBounds
20
- *
21
- * Transforms the asset-space AABB on each Model's `geometry` by the Model's
22
- * `_worldMatrix` (all 8 corners, reduce to min/max) and writes the result.
23
- * Geometries still loading have no `_bounds` yet — those Models are skipped
24
- * until the asset finishes; their `_worldBounds` stays at its placeholder.
25
- *
26
- * Cost: one matrix-vec multiply × 8 corners × N visible Models, per frame.
27
- * At N=1000 that's ~8K vec3 ops; well under 0.1ms on modern CPUs.
9
+ * worldBounds — derives `_worldBounds` on `Model` rows from each instance's
10
+ * mesh `localBounds` and `_worldMatrix`.
28
11
  */
29
12
  export const worldBounds = Database.Plugin.create({
30
13
  extends: Database.Plugin.combine(modelLoader, transform),
@@ -33,11 +16,10 @@ export const worldBounds = Database.Plugin.create({
33
16
  schedule: { after: ["transformCreateWorldMatrix"] },
34
17
  create: db => () => {
35
18
  for (const arch of db.store.queryArchetypes(
36
- ["geometry", "_worldMatrix"],
19
+ ["mesh", "_worldMatrix"],
37
20
  { exclude: ["_worldBounds"] },
38
21
  )) {
39
22
  const ids = arch.columns.id;
40
- // Iterate tail→head: every row migrates out of this archetype.
41
23
  for (let i = arch.rowCount - 1; i >= 0; i--) {
42
24
  db.store.update(ids.get(i), { _worldBounds: Aabb.unit });
43
25
  }
@@ -48,13 +30,13 @@ export const worldBounds = Database.Plugin.create({
48
30
  schedule: { after: ["transformSystem", "worldBoundsCreate"] },
49
31
  create: db => () => {
50
32
  for (const arch of db.store.queryArchetypes([
51
- "geometry", "_worldMatrix", "_worldBounds",
33
+ "mesh", "_worldMatrix", "_worldBounds",
52
34
  ])) {
53
- const geos = arch.columns.geometry;
35
+ const meshRefs = arch.columns.mesh;
54
36
  const worldMats = arch.columns._worldMatrix;
55
37
  const worldBoundsCol = arch.columns._worldBounds;
56
38
  for (let i = 0; i < arch.rowCount; i++) {
57
- const localBounds = db.store.get(geos.get(i), "_bounds");
39
+ const localBounds = db.store.get(meshRefs.get(i), "localBounds") as Aabb | null;
58
40
  if (!localBounds) continue;
59
41
  worldBoundsCol.set(i, transformAabb(localBounds, worldMats.get(i)));
60
42
  }
@@ -68,7 +50,6 @@ const transformAabb = (local: Aabb, m: Mat4x4): Aabb => {
68
50
  const { min, max } = local;
69
51
  let minX = Infinity, minY = Infinity, minZ = Infinity;
70
52
  let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
71
- // The 8 box corners.
72
53
  for (let cx = 0; cx < 2; cx++) {
73
54
  for (let cy = 0; cy < 2; cy++) {
74
55
  for (let cz = 0; cz < 2; cz++) {
@@ -0,0 +1,47 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { Database, Entity, type Store } from "@adobe/data/ecs";
3
+ import { nodeData } from "./node-data-plugin.js";
4
+
5
+ const createTestDb = () => Database.create(nodeData);
6
+
7
+ const storeOf = (db: ReturnType<typeof createTestDb>) =>
8
+ (db as unknown as { store: Store<any, any, any> }).store;
9
+
10
+ const identityNode = () => ({
11
+ position: [0, 0, 0] as const,
12
+ rotation: [0, 0, 0, 1] as const,
13
+ scale: [1, 1, 1] as const,
14
+ visible: true,
15
+ parent: 0 as Entity,
16
+ });
17
+
18
+ describe("nodeChildrenOf index", () => {
19
+ it("finds direct children of a parent node", () => {
20
+ const db = createTestDb();
21
+ const store = storeOf(db);
22
+ store.archetypes.Node.insert(identityNode()); // entity 0 — keeps parent id non-zero
23
+ const parent = store.archetypes.Node.insert(identityNode());
24
+ const childA = store.archetypes.Node.insert({ ...identityNode(), parent });
25
+ const childB = store.archetypes.Node.insert({ ...identityNode(), parent });
26
+ store.archetypes.Node.insert(identityNode()); // other root (parent === 0)
27
+
28
+ const children = db.indexes.nodeChildrenOf.find({ parent });
29
+ expect(children).toHaveLength(2);
30
+ expect(children).toContain(childA);
31
+ expect(children).toContain(childB);
32
+ expect(children).not.toContain(parent);
33
+ });
34
+
35
+ it("updates buckets when parent changes", () => {
36
+ const db = createTestDb();
37
+ const store = storeOf(db);
38
+ const parentA = store.archetypes.Node.insert(identityNode());
39
+ const parentB = store.archetypes.Node.insert(identityNode());
40
+ const child = store.archetypes.Node.insert({ ...identityNode(), parent: parentA });
41
+
42
+ expect(db.indexes.nodeChildrenOf.find({ parent: parentA })).toContain(child);
43
+ store.update(child, { parent: parentB });
44
+ expect(db.indexes.nodeChildrenOf.find({ parent: parentA })).not.toContain(child);
45
+ expect(db.indexes.nodeChildrenOf.find({ parent: parentB })).toContain(child);
46
+ });
47
+ });
@@ -8,9 +8,13 @@ import { True } from "@adobe/data/schema";
8
8
  * The transform-hierarchy core model. Every entity with a position in the
9
9
  * world is a `Node` — see `node.ts` for the field bundle.
10
10
  *
11
- * `_worldMatrix` and `_worldBounds` are declared as components but NOT listed
12
- * on the authored Node archetype — systems write them via `db.store.update`,
13
- * migrating each entity once into a wider archetype.
11
+ * `_worldMatrix` and `_worldBounds` are derived components (`nonPersistent: true`)
12
+ * but NOT listed on the authored Node archetype — systems write them via
13
+ * `db.store.update`, migrating each entity once into a wider archetype.
14
+ *
15
+ * `indexes.nodeChildrenOf` lists direct children by parent entity id. Scoped
16
+ * to the Node archetype (and supersets such as Model) — not every column that
17
+ * happens to carry `parent`.
14
18
  */
15
19
  export const nodeData = Database.Plugin.create({
16
20
  components: {
@@ -19,10 +23,13 @@ export const nodeData = Database.Plugin.create({
19
23
  rotation: Quat.schema,
20
24
  scale: Vec3.schema,
21
25
  parent: Entity.schema,
22
- _worldMatrix: Mat4x4.schema,
23
- _worldBounds: Aabb.schema,
26
+ _worldMatrix: { ...Mat4x4.schema, nonPersistent: true },
27
+ _worldBounds: { ...Aabb.schema, nonPersistent: true },
24
28
  },
25
29
  archetypes: {
26
30
  Node: ["position", "rotation", "scale", "parent", "visible"],
27
31
  },
32
+ indexes: {
33
+ nodeChildrenOf: { key: "parent", archetype: "Node" },
34
+ },
28
35
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Database } from "@adobe/data/ecs";
4
4
  import { plugin as nodePlugin } from "./node/node-plugin.js";
5
- import { model } from "./model/model-plugin.js";
5
+ import { mesh } from "./model/mesh-plugin.js";
6
6
  import { SceneUniforms } from "./scene-uniforms/scene-uniforms.js";
7
7
 
8
8
  /**
@@ -11,10 +11,10 @@ import { SceneUniforms } from "./scene-uniforms/scene-uniforms.js";
11
11
  *
12
12
  * Combines:
13
13
  * - `Node.plugin` (node data + transform system)
14
- * - `model` (Geometry + Model archetypes)
14
+ * - `mesh` (Mesh asset + Model/MeshInstance archetypes)
15
15
  * - `SceneUniforms.plugin` (camera resource + light resource + GPU uniform packing)
16
16
  *
17
17
  * Add a camera controller (e.g. `Orbit.plugin`), animation, and a renderer
18
18
  * (`pbrIblRender`) to get a working interactive scene.
19
19
  */
20
- export const scene = Database.Plugin.combine(nodePlugin, model, SceneUniforms.plugin);
20
+ export const scene = Database.Plugin.combine(nodePlugin, mesh, SceneUniforms.plugin);
package/src/index.ts CHANGED
@@ -1,72 +1,3 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
- // --- Scene model (declarative authored data, no camera, no systems) ----------
4
- export { scene } from "./graphics/scene/scene-plugin.js";
5
-
6
- // --- Authoring abstractions --------------------------------------------------
7
- export { animation } from "./graphics/animation/animation-plugin.js";
8
- export { AnimationTrack } from "./graphics/animation/animation-track/animation-track.js";
9
- export { InterpolationMode } from "./graphics/animation/interpolation-mode/interpolation-mode.js";
10
-
11
- // --- Infrastructure ----------------------------------------------------------
12
- export { core } from "./core/core-plugin.js";
13
- export { FrameTime } from "./core/frame-time/frame-time.js";
14
- export { graphics } from "./graphics/graphics-plugin.js";
15
-
16
- // --- Physics: shared rigid-body data model + pluggable solver seam -----------
17
- export { physicsData } from "./physics/physics-data-plugin.js";
18
- export { physicsClock } from "./physics/physics-clock-plugin.js";
19
- export type { PhysicsClock } from "./physics/physics-clock-plugin.js";
20
- export { jointData } from "./physics/joint/joint-plugin.js";
21
- export type { Joint } from "./physics/joint/joint.js";
22
- export { JointType } from "./physics/joint/joint-type/joint-type.js";
23
- export type { RigidBody } from "./physics/body/rigid-body.js";
24
- export type { StaticCollider } from "./physics/body/static-collider.js";
25
- export { BodyType } from "./physics/body/body-type/body-type.js";
26
- export { ColliderShape } from "./physics/body/collider-shape/collider-shape.js";
27
- export { rapierSolver } from "./physics/solvers/rapier-solver-plugin.js";
28
- export { joltSolver } from "./physics/solvers/jolt-solver-plugin.js";
29
- export { runSolverBenchmark } from "./physics/solvers/solver-benchmark.js";
30
- export type { SolverBenchmarkOptions, SolverBenchmarkResult } from "./physics/solvers/solver-benchmark.js";
31
-
32
- // --- Material registry (authored entities: physical + visible PBR props) ------
33
- export { Material } from "./material/material.js";
34
-
35
- // --- System plugins (consumed via aggregators) -------------------------------
36
- export { transform } from "./graphics/scene/node/transform-plugin.js";
37
- export { pbrCore } from "./graphics/rendering/pbr-core-plugin.js";
38
- export { modelLoader } from "./graphics/scene/model/model-loader-plugin.js";
39
- export { pbrSkinning } from "./graphics/rendering/skinning/skinning-plugin.js";
40
- export { picking } from "./graphics/picking/picking-plugin.js";
41
- export type { PickHit } from "./graphics/picking/pick-hit.js";
42
-
43
- // --- Rendering ---------------------------------------------------------------
44
- export { rendering } from "./graphics/rendering/rendering-plugin.js";
45
- export { pbrIblRender } from "./graphics/rendering/ibl-render/ibl-render-plugin.js";
46
- export { materialGpu } from "./graphics/rendering/material-gpu/material-gpu-plugin.js";
47
- export { pbrRender } from "./graphics/rendering/pbr-render/pbr-render-plugin.js";
48
- export { physicsRenderBridge } from "./graphics/rendering/pbr-render/physics-bridge-plugin.js";
49
- export { displayTransform } from "./graphics/rendering/display-transform-plugin.js";
50
- export { interpolation } from "./graphics/rendering/interpolation-plugin.js";
51
- export { modelCollider } from "./graphics/rendering/model-collider-plugin.js";
52
- export { boneColliders } from "./graphics/rendering/bone-collider-plugin.js";
53
- export { ragdollTrigger } from "./graphics/rendering/ragdoll-trigger-plugin.js";
54
- export { joltRagdoll } from "./graphics/rendering/jolt-ragdoll-plugin.js";
55
- export { fitBoneCapsules } from "./physics/ragdoll/fit-bone-capsules.js";
56
- export type { BoneCapsule } from "./physics/ragdoll/fit-bone-capsules.js";
57
- export { shapeGeometry } from "./graphics/scene/model/shape/shape-geometry-plugin.js";
58
-
59
- // --- Types (type + namespace, access .plugin for the ECS plugin) -------------
60
- export { Camera } from "./graphics/camera/camera.js";
61
- export { Light } from "./graphics/scene/light/light.js";
62
- export { Orbit } from "./graphics/camera/orbit/orbit.js";
63
- export { Node } from "./graphics/scene/node/node.js";
64
- export { Model } from "./graphics/scene/model/model.js";
65
- export { Geometry } from "./graphics/scene/model/geometry/geometry.js";
66
- export { SceneUniforms } from "./graphics/scene/scene-uniforms/scene-uniforms.js";
67
- export { StandardVertex } from "./graphics/rendering/standard-vertex/standard-vertex.js";
68
- export { VisibleMaterial } from "./graphics/rendering/visible-material/visible-material.js";
69
-
70
- // --- Utilities ---------------------------------------------------------------
71
- export { attachOrbitDrag } from "./graphics/camera/orbit/attach-orbit-drag.js";
72
- export type { OrbitDragService } from "./graphics/camera/orbit/attach-orbit-drag.js";
3
+ export * from "./core/public.js";
@@ -0,0 +1,26 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Material } from "./material.js";
4
+ import type { MaterialDefinition } from "./material-definition.js";
5
+ import { solidDefaults } from "./material-defaults.js";
6
+
7
+ /** Fields that `solidDefaults` does not supply — must appear on every definition or full row. */
8
+ const REQUIRED_KEYS = [
9
+ "density",
10
+ "restitution",
11
+ "heatCapacity",
12
+ "baseColorFactor",
13
+ "emissiveFactor",
14
+ "metallicFactor",
15
+ "roughnessFactor",
16
+ ] as const satisfies readonly (keyof Material)[];
17
+
18
+ /** Merge defaults + definition into a full `Material` row; throw if required fields are missing. */
19
+ export const assembleMaterialRow = (name: string, definition: MaterialDefinition): Material => {
20
+ const row = { name, ...solidDefaults, ...definition };
21
+ const missing = REQUIRED_KEYS.filter(key => row[key] === undefined);
22
+ if (missing.length > 0) {
23
+ throw new Error(`Material "${name}" is missing required fields: ${missing.join(", ")}`);
24
+ }
25
+ return row as Material;
26
+ };