@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,3 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export * from "./public.js";
@@ -0,0 +1,9 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Entity } from "@adobe/data/ecs";
4
+
5
+ /** True while a body carries `voxelShapeName` but the mesh ref is not yet resolved. */
6
+ export const isVoxelShapePhysicsPending = (store: unknown, id: Entity): boolean => {
7
+ const row = (store as { read(id: Entity): Record<string, unknown> | null }).read(id);
8
+ return row?.voxelShapeName != null && row?.voxelShape == null;
9
+ };
@@ -0,0 +1,17 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ /**
4
+ * Fixed-timestep physics clock state — decouples simulation rate from render rate.
5
+ */
6
+ export interface PhysicsClock {
7
+ /** Fixed simulation step length, seconds (default 1/60). */
8
+ readonly fixedDt: number;
9
+ /** Unsimulated time carried to the next frame, seconds (< fixedDt). */
10
+ readonly accumulator: number;
11
+ /** accumulator / fixedDt ∈ [0,1): render interpolation fraction prev→current. */
12
+ readonly alpha: number;
13
+ /** Whole steps the solver should run this frame (0..maxSubSteps). */
14
+ readonly steps: number;
15
+ /** Cap on steps/frame — prevents the "spiral of death" after a long stall. */
16
+ readonly maxSubSteps: number;
17
+ }
@@ -2,28 +2,7 @@
2
2
 
3
3
  import { Database } from "@adobe/data/ecs";
4
4
  import { core } from "../core/core-plugin.js";
5
-
6
- /**
7
- * Fixed-timestep physics clock — decouples the simulation rate from the render
8
- * rate (Fiedler "fix your timestep"). Each render frame the accumulator absorbs
9
- * the variable `frameTime.dt`; the solver then runs a whole number of fixed
10
- * `fixedDt` steps (0, 1, or several), and `alpha` is the leftover fraction used
11
- * to interpolate the rendered pose between the last two simulated states.
12
- *
13
- * Default 60 Hz; set another rate at init with `setFixedTimestep(hz)`.
14
- */
15
- export interface PhysicsClock {
16
- /** Fixed simulation step length, seconds (default 1/60). */
17
- readonly fixedDt: number;
18
- /** Unsimulated time carried to the next frame, seconds (< fixedDt). */
19
- readonly accumulator: number;
20
- /** accumulator / fixedDt ∈ [0,1): render interpolation fraction prev→current. */
21
- readonly alpha: number;
22
- /** Whole steps the solver should run this frame (0..maxSubSteps). */
23
- readonly steps: number;
24
- /** Cap on steps/frame — prevents the "spiral of death" after a long stall. */
25
- readonly maxSubSteps: number;
26
- }
5
+ import type { PhysicsClock } from "./physics-clock/physics-clock.js";
27
6
 
28
7
  const DEFAULT: PhysicsClock = { fixedDt: 1 / 60, accumulator: 0, alpha: 0, steps: 0, maxSubSteps: 8 };
29
8
 
@@ -50,8 +29,6 @@ export const physicsClock = Database.Plugin.create({
50
29
  create: db => () => {
51
30
  const c = db.store.resources.physicsClock;
52
31
  const h = c.fixedDt;
53
- // clamp the absorbed time to the step budget so a long stall (tab
54
- // backgrounded, GC) can't queue hundreds of steps (spiral of death)
55
32
  const acc = c.accumulator + Math.min(db.store.resources.frameTime.dt, h * c.maxSubSteps);
56
33
  const steps = Math.min(Math.floor(acc / h), c.maxSubSteps);
57
34
  db.store.resources.physicsClock = { ...c, accumulator: acc - steps * h, alpha: (acc - steps * h) / h, steps };
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { describe, it, expect } from "vitest";
4
4
  import { Database } from "@adobe/data/ecs";
5
- import { physicsClock, type PhysicsClock } from "./physics-clock-plugin.js";
5
+ import { physicsClock } from "./physics-clock-plugin.js";
6
+ import type { PhysicsClock } from "./physics-clock/physics-clock.js";
6
7
 
7
8
  /** The accumulator turns a variable render dt into a whole number of fixed steps
8
9
  * plus a leftover interpolation `alpha`, capped against the spiral of death. */
@@ -7,6 +7,8 @@ import { BodyType } from "./body/body-type/body-type.js";
7
7
  import { ColliderShape } from "./body/collider-shape/collider-shape.js";
8
8
  import type { ColliderMesh } from "./body/collider-mesh.js";
9
9
  import { Material } from "../material/material.js";
10
+ import { RIGID_BODY_COMPONENTS } from "./rigid-body-components.js";
11
+ import { STATIC_COLLIDER_COMPONENTS } from "./static-collider-components.js";
10
12
 
11
13
  /**
12
14
  * The shared, solver-agnostic rigid-body data model — the seam every physics
@@ -48,8 +50,8 @@ export const physicsData = Database.Plugin.create({
48
50
  rotation: Quat.schema, // unified with Node.rotation so a body renders directly
49
51
  linearVelocity: Vec3.schema,
50
52
  angularVelocity: Vec3.schema,
51
- _prevPosition: Vec3.schema, // derived: pose before the last fixed step (render interpolation)
52
- _prevRotation: Quat.schema,
53
+ _prevPosition: { ...Vec3.schema, nonPersistent: true }, // derived: pose before the last fixed step (render interpolation)
54
+ _prevRotation: { ...Quat.schema, nonPersistent: true },
53
55
  // Bodies sharing the same non-zero collisionGroup do not collide with each
54
56
  // other (they still collide with group 0 / the world) — e.g. a ragdoll's
55
57
  // bones. 0 = default (collide with everything). Honored by both solvers
@@ -63,11 +65,11 @@ export const physicsData = Database.Plugin.create({
63
65
  colliderMesh: { default: null as ColliderMesh | null }, // colliderShape "mesh": static triangle soup
64
66
  },
65
67
  archetypes: {
66
- RigidBody: ["bodyType", "colliderShape", "halfExtents", "material", "position", "rotation", "linearVelocity", "angularVelocity"],
67
- StaticCollider: ["colliderShape", "halfExtents", "material", "position", "rotation"],
68
+ RigidBody: [...RIGID_BODY_COMPONENTS],
69
+ StaticCollider: [...STATIC_COLLIDER_COMPONENTS],
68
70
  // A convex-hull body (dynamic / kinematic): authored as a point cloud.
69
- ConvexBody: ["bodyType", "colliderShape", "halfExtents", "material", "position", "rotation", "linearVelocity", "angularVelocity", "convexPoints"],
71
+ ConvexBody: [...RIGID_BODY_COMPONENTS, "convexPoints"],
70
72
  // A static triangle-mesh collider (terrain / level geometry).
71
- MeshCollider: ["colliderShape", "halfExtents", "material", "position", "rotation", "colliderMesh"],
73
+ MeshCollider: [...STATIC_COLLIDER_COMPONENTS, "colliderMesh"],
72
74
  },
73
75
  });
@@ -0,0 +1,23 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export * from "./physics-data-plugin.js";
4
+ export * from "./rigid-body-components.js";
5
+ export * from "./static-collider-components.js";
6
+ export * from "./collider-primitive-render-archetypes.js";
7
+ export * from "./collider-primitive-render-archetype.js";
8
+ export * from "./physics-clock/physics-clock.js";
9
+ export * from "./physics-clock-plugin.js";
10
+ export * from "./joint/joint-plugin.js";
11
+ export * from "./joint/joint.js";
12
+ export * from "./joint/joint-type/joint-type.js";
13
+ export * from "./body/rigid-body.js";
14
+ export * from "./body/static-collider.js";
15
+ export * from "./body/body-type/body-type.js";
16
+ export * from "./body/collider-shape/collider-shape.js";
17
+ export * from "./solvers/rapier-solver-plugin.js";
18
+ export * from "./solvers/jolt-solver-plugin.js";
19
+ export * from "./solvers/solver-benchmark.js";
20
+ export * from "./solvers/solver-benchmark-options.js";
21
+ export * from "./solvers/solver-benchmark-result.js";
22
+ export * from "./ragdoll/fit-bone-capsules.js";
23
+ export * from "./ragdoll/bone-capsule.js";
@@ -0,0 +1,11 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { Quat, Vec3 } from "@adobe/data/math";
4
+
5
+ export interface BoneCapsule {
6
+ jointIndex: number;
7
+ offsetPosition: Vec3;
8
+ offsetRotation: Quat;
9
+ radius: number;
10
+ halfHeight: number;
11
+ }
@@ -0,0 +1,14 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ import type { SkinVertices } from "./skin-vertices.js";
4
+
5
+ export interface FitBoneCapsulesInput {
6
+ jointCount: number;
7
+ /** glTF inverse-bind matrices, column-major, `jointCount × 16`. */
8
+ inverseBindMatrices: Float32Array;
9
+ skin: SkinVertices;
10
+ /** A vertex joins a bone only if its dominant weight ≥ this (default 0.5). */
11
+ minWeight?: number;
12
+ /** Bones with fewer assigned vertices than this get no capsule (default 6). */
13
+ minVertices?: number;
14
+ }
@@ -1,7 +1,8 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
3
  import { describe, it, expect } from "vitest";
4
- import { fitBoneCapsules, type SkinVertices } from "./fit-bone-capsules.js";
4
+ import { fitBoneCapsules } from "./fit-bone-capsules.js";
5
+ import type { SkinVertices } from "./skin-vertices.js";
5
6
 
6
7
  const IDENTITY_IBM = (n: number) => {
7
8
  const m = new Float32Array(n * 16);
@@ -1,6 +1,8 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
3
  import type { Vec3, Quat } from "@adobe/data/math";
4
+ import type { BoneCapsule } from "./bone-capsule.js";
5
+ import type { FitBoneCapsulesInput } from "./fit-bone-capsules-input.js";
4
6
 
5
7
  /**
6
8
  * Fits one capsule collider to each significant bone of a skinned mesh — the
@@ -16,33 +18,6 @@ import type { Vec3, Quat } from "@adobe/data/math";
16
18
  * `jointWorldMatrix · offset`, tracking the animated skeleton.
17
19
  */
18
20
 
19
- /** Skinned vertices in mesh (bind) space: `positions` (xyz triples), `joints`
20
- * (4 joint indices/vertex), `weights` (4 weights/vertex). */
21
- export interface SkinVertices {
22
- positions: Float32Array;
23
- joints: Uint32Array;
24
- weights: Float32Array;
25
- }
26
-
27
- export interface FitBoneCapsulesInput {
28
- jointCount: number;
29
- /** glTF inverse-bind matrices, column-major, `jointCount × 16`. */
30
- inverseBindMatrices: Float32Array;
31
- skin: SkinVertices;
32
- /** A vertex joins a bone only if its dominant weight ≥ this (default 0.5). */
33
- minWeight?: number;
34
- /** Bones with fewer assigned vertices than this get no capsule (default 6). */
35
- minVertices?: number;
36
- }
37
-
38
- export interface BoneCapsule {
39
- jointIndex: number;
40
- offsetPosition: Vec3; // capsule centre, bone-bind-local
41
- offsetRotation: Quat; // orients the Y-aligned capsule onto the fitted axis, bone-bind-local
42
- radius: number;
43
- halfHeight: number; // half-length of the cylindrical section
44
- }
45
-
46
21
  /** Transform a point by a column-major 4×4 matrix (slice `o..o+16`), into `out`. */
47
22
  function transformPoint(m: Float32Array, o: number, x: number, y: number, z: number, out: [number, number, number]): void {
48
23
  out[0] = m[o] * x + m[o + 4] * y + m[o + 8] * z + m[o + 12];
@@ -0,0 +1,8 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ /** Skinned vertices in mesh (bind) space. */
4
+ export interface SkinVertices {
5
+ positions: Float32Array;
6
+ joints: Uint32Array;
7
+ weights: Float32Array;
8
+ }
@@ -0,0 +1,13 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ /** Column set shared by `RigidBody`, `ConvexBody`, and `VoxelRigidBody`. */
4
+ export const RIGID_BODY_COMPONENTS = [
5
+ "bodyType",
6
+ "colliderShape",
7
+ "halfExtents",
8
+ "material",
9
+ "position",
10
+ "rotation",
11
+ "linearVelocity",
12
+ "angularVelocity",
13
+ ] as const;
@@ -7,6 +7,10 @@ scene runs unchanged on any solver** (`Database.Plugin.combine(scene, solver)`).
7
7
 
8
8
  Two production-grade solvers ship, both compiled to WASM and wired identically:
9
9
 
10
+ ```ts
11
+ import { joltSolver, rapierSolver } from "@adobe/data-gpu/physics";
12
+ ```
13
+
10
14
  | solver | engine | license |
11
15
  | --- | --- | --- |
12
16
  | `joltSolver` | Jolt Physics (Jorrit Rouwe) | MIT |
@@ -2,6 +2,7 @@
2
2
 
3
3
  import initJolt from "jolt-physics";
4
4
  import { Database, type Entity } from "@adobe/data/ecs";
5
+ import { isVoxelShapePhysicsPending } from "../is-voxel-shape-physics-pending.js";
5
6
  import { True } from "@adobe/data/schema";
6
7
  import { physicsClock } from "../physics-clock-plugin.js";
7
8
  import { physicsData } from "../physics-data-plugin.js";
@@ -9,6 +10,7 @@ import { jointData } from "../joint/joint-plugin.js";
9
10
  import { BodyType } from "../body/body-type/body-type.js";
10
11
  import { ColliderShape } from "../body/collider-shape/collider-shape.js";
11
12
  import type { ColliderMesh } from "../body/collider-mesh.js";
13
+ import { massFromVolume } from "../body/collider-shape/mass-from-volume.js";
12
14
 
13
15
  /**
14
16
  * A third rigid-body solver behind the same `physicsData` seam — Jolt Physics
@@ -60,7 +62,7 @@ type JVec3 = InstanceType<JoltModule["Vec3"]>;
60
62
  type JShape = InstanceType<JoltModule["Shape"]>;
61
63
  type JPhysicsSystem = InstanceType<JoltModule["PhysicsSystem"]>;
62
64
 
63
- interface MatProps { restitution: number; friction: number }
65
+ interface MatProps { density: number; restitution: number; friction: number }
64
66
 
65
67
  /** The live Jolt world, published once WASM init completes, so Jolt-native
66
68
  * extensions (e.g. `joltRagdoll`) can add their own bodies/constraints into the
@@ -76,8 +78,8 @@ export interface JoltContext {
76
78
  export const joltSolver = Database.Plugin.create({
77
79
  extends: Database.Plugin.combine(physicsData, jointData, physicsClock),
78
80
  components: {
79
- _joltBody: True.schema, // tag: this body has been mirrored into the Jolt world
80
- _joltJoint: True.schema, // tag: this joint has been mirrored into the Jolt world
81
+ _joltBody: { ...True.schema, nonPersistent: true }, // tag: this body has been mirrored into the Jolt world
82
+ _joltJoint: { ...True.schema, nonPersistent: true }, // tag: this joint has been mirrored into the Jolt world
81
83
  },
82
84
  resources: {
83
85
  _joltContext: { default: null as JoltContext | null, nonPersistent: true },
@@ -95,8 +97,8 @@ export const joltSolver = Database.Plugin.create({
95
97
  const bodies = new Map<Entity, JBody>(); // entity → Jolt body
96
98
 
97
99
  const matPropsOf = (id: Entity): MatProps => {
98
- const m = db.store.read(id) as { restitution?: number; friction?: number } | null;
99
- return { restitution: m?.restitution ?? 0.2, friction: m?.friction ?? 0.5 };
100
+ const m = db.store.read(id) as { density?: number; restitution?: number; friction?: number } | null;
101
+ return { density: m?.density ?? 1, restitution: m?.restitution ?? 0.2, friction: m?.friction ?? 0.5 };
100
102
  };
101
103
 
102
104
  // hull/mesh colliders may be auto-generated from a model that's still
@@ -197,6 +199,16 @@ export const joltSolver = Database.Plugin.create({
197
199
  const settings = new jolt.BodyCreationSettings(shp, pos, rot, motionType, layer);
198
200
  settings.mRestitution = m.restitution;
199
201
  settings.mFriction = m.friction;
202
+ if (motion === "dynamic") {
203
+ const volume = shp.GetVolume();
204
+ if (volume > 0) {
205
+ const mp = shp.GetMassProperties();
206
+ mp.ScaleToMass(massFromVolume(volume, m.density));
207
+ settings.mOverrideMassProperties = jolt.EOverrideMassProperties_MassAndInertiaProvided;
208
+ settings.mMassPropertiesOverride = mp;
209
+ jolt.destroy(mp);
210
+ }
211
+ }
200
212
  const body = bi.CreateBody(settings);
201
213
  bi.AddBody(body.GetID(), motion === "static" ? jolt.EActivation_DontActivate : jolt.EActivation_Activate);
202
214
  if (motion === "dynamic" && (vx || vy || vz || wx || wy || wz)) {
@@ -233,6 +245,7 @@ export const joltSolver = Database.Plugin.create({
233
245
  for (let r = arch.rowCount - 1; r >= 0; r--) {
234
246
  const id = ids.get(r), bodyType = bt.get(r), shape = cs.get(r), h = he.get(r), p = pos.get(r), o = ori.get(r), v = lv.get(r), w = av.get(r);
235
247
  if (!colliderReady(id, shape)) continue; // auto-collider not generated yet
248
+ if (isVoxelShapePhysicsPending(db.store, id)) continue;
236
249
  ensureBody(jolt, bi, id, bodyType, shape, h[0], h[1], h[2], mat.get(r), p[0], p[1], p[2], o, v[0], v[1], v[2], w[0], w[1], w[2]);
237
250
  // Tag as mirrored. Dynamics also migrate onto the derived prev-pose
238
251
  // snapshot (the interpolator reads it); kinematic bodies are authored
@@ -247,6 +260,7 @@ export const joltSolver = Database.Plugin.create({
247
260
  for (let r = arch.rowCount - 1; r >= 0; r--) {
248
261
  const id = ids.get(r), shape = cs.get(r), h = he.get(r), p = pos.get(r);
249
262
  if (!colliderReady(id, shape)) continue; // auto-collider not generated yet
263
+ if (isVoxelShapePhysicsPending(db.store, id)) continue;
250
264
  ensureBody(jolt, bi, id, "static", shape, h[0], h[1], h[2], mat.get(r), p[0], p[1], p[2], ori.get(r), 0, 0, 0, 0, 0, 0);
251
265
  db.store.update(id, { _joltBody: true });
252
266
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  import RAPIER from "@dimforge/rapier3d-compat";
4
4
  import { Database, type Entity } from "@adobe/data/ecs";
5
+ import { isVoxelShapePhysicsPending } from "../is-voxel-shape-physics-pending.js";
5
6
  import { True } from "@adobe/data/schema";
6
7
  import { physicsClock } from "../physics-clock-plugin.js";
7
8
  import { physicsData } from "../physics-data-plugin.js";
@@ -47,8 +48,8 @@ interface MatProps { density: number; restitution: number; friction: number }
47
48
  export const rapierSolver = Database.Plugin.create({
48
49
  extends: Database.Plugin.combine(physicsData, jointData, physicsClock),
49
50
  components: {
50
- _rapierBody: True.schema, // tag: this body has been mirrored into the Rapier world
51
- _rapierJoint: True.schema, // tag: this joint has been mirrored into the Rapier world
51
+ _rapierBody: { ...True.schema, nonPersistent: true }, // tag: this body has been mirrored into the Rapier world
52
+ _rapierJoint: { ...True.schema, nonPersistent: true }, // tag: this joint has been mirrored into the Rapier world
52
53
  },
53
54
  systems: {
54
55
  rapierStep: {
@@ -125,6 +126,7 @@ export const rapierSolver = Database.Plugin.create({
125
126
  for (let r = arch.rowCount - 1; r >= 0; r--) {
126
127
  const id = ids.get(r), bodyType = bt.get(r), shape = cs.get(r), h = he.get(r), p = pos.get(r), o = ori.get(r), v = lv.get(r), w = av.get(r);
127
128
  if (!colliderReady(id, shape)) continue; // auto-collider not generated yet
129
+ if (isVoxelShapePhysicsPending(db.store, id)) continue;
128
130
  ensureBody(id, bodyType, shape, h[0], h[1], h[2], mat.get(r), p[0], p[1], p[2], o, v[0], v[1], v[2], w[0], w[1], w[2]);
129
131
  // Tag as mirrored. Dynamics also migrate onto the derived prev-pose
130
132
  // snapshot (the interpolator reads it); kinematic bodies are authored
@@ -139,6 +141,7 @@ export const rapierSolver = Database.Plugin.create({
139
141
  for (let r = arch.rowCount - 1; r >= 0; r--) {
140
142
  const id = ids.get(r), shape = cs.get(r), h = he.get(r), p = pos.get(r);
141
143
  if (!colliderReady(id, shape)) continue; // auto-collider not generated yet
144
+ if (isVoxelShapePhysicsPending(db.store, id)) continue;
142
145
  ensureBody(id, "static", shape, h[0], h[1], h[2], mat.get(r), p[0], p[1], p[2], ori.get(r), 0, 0, 0, 0, 0, 0);
143
146
  db.store.update(id, { _rapierBody: true });
144
147
  }
@@ -0,0 +1,16 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export interface SolverBenchmarkOptions {
4
+ /** Dynamic bodies dropped into the scene (≈ workload size). Default 256. */
5
+ bodies?: number;
6
+ /** Timed frames. Default 300. */
7
+ frames?: number;
8
+ /** Warm-up frames before timing. Default 90. */
9
+ warmupFrames?: number;
10
+ /** Fixed timestep per frame (seconds). Default 1/60. */
11
+ dt?: number;
12
+ /** Fraction of `bodies` that are spheres (rest are boxes). Default 0.5. */
13
+ sphereFraction?: number;
14
+ /** Extra static collider boxes as resting scenery. Default 0. */
15
+ staticBodies?: number;
16
+ }
@@ -0,0 +1,17 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ export interface SolverBenchmarkResult {
4
+ bodies: number;
5
+ frames: number;
6
+ /** Total wall-clock time of the timed frames (ms). */
7
+ totalMs: number;
8
+ /** Mean cost of one frame (ms). */
9
+ msPerFrame: number;
10
+ /** Simulation frames per real second. */
11
+ simFps: number;
12
+ /** Slowest single frame (ms). */
13
+ maxFrameMs: number;
14
+ avgY: number;
15
+ maxSpeed: number;
16
+ belowFloor: number;
17
+ }
@@ -1,6 +1,8 @@
1
1
  // © 2026 Adobe. MIT License. See /LICENSE for details.
2
2
 
3
3
  import { Database } from "@adobe/data/ecs";
4
+ import type { SolverBenchmarkOptions } from "./solver-benchmark-options.js";
5
+ import type { SolverBenchmarkResult } from "./solver-benchmark-result.js";
4
6
 
5
7
  /**
6
8
  * Headless benchmark harness for a physics **solver plugin** (anything built on
@@ -14,41 +16,6 @@ import { Database } from "@adobe/data/ecs";
14
16
  * yields to the event loop so that init + scene settling complete before timing.
15
17
  */
16
18
 
17
- export interface SolverBenchmarkOptions {
18
- /** Dynamic bodies dropped into the scene (≈ workload size). Default 256. */
19
- bodies?: number;
20
- /** Timed frames. Default 300. */
21
- frames?: number;
22
- /** Warm-up frames before timing (lets async init finish + the pile settle). Default 90. */
23
- warmupFrames?: number;
24
- /** Fixed timestep per frame (seconds). Default 1/60. */
25
- dt?: number;
26
- /** Fraction of `bodies` that are spheres (rest are boxes). Default 0.5. */
27
- sphereFraction?: number;
28
- /** Extra *static* collider boxes laid out as resting scenery. They barely
29
- * cost the engine (nothing moves) but they ARE mirrored once and then scanned
30
- * by a naive per-frame sync — so this isolates the gather/sync overhead, which
31
- * is the realistic "many static, few dynamic" target workload. Default 0. */
32
- staticBodies?: number;
33
- }
34
-
35
- export interface SolverBenchmarkResult {
36
- bodies: number;
37
- frames: number;
38
- /** Total wall-clock time of the timed frames (ms). */
39
- totalMs: number;
40
- /** Mean cost of one frame (ms) — the headline number. */
41
- msPerFrame: number;
42
- /** Simulation frames per real second (1000 / msPerFrame). */
43
- simFps: number;
44
- /** Slowest single frame (ms) — surfaces hitches. */
45
- maxFrameMs: number;
46
- // --- coarse end-state, for cross-solver parity / sanity (not perf) ---
47
- avgY: number; // mean height of dynamic bodies (piled ≈ low, exploded ≈ wild)
48
- maxSpeed: number; // fastest dynamic body (a stable pile is near 0)
49
- belowFloor: number; // dynamic bodies that sank below the floor top (should be 0)
50
- }
51
-
52
19
  interface LooseStore {
53
20
  archetypes: Record<string, { insert(v: unknown): number }>;
54
21
  queryArchetypes(include: readonly string[], opts?: { exclude?: readonly string[] }): Iterable<{
@@ -0,0 +1,10 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+
3
+ /** Column set shared by `StaticCollider`, `MeshCollider`, and `VoxelStaticCollider`. */
4
+ export const STATIC_COLLIDER_COMPONENTS = [
5
+ "colliderShape",
6
+ "halfExtents",
7
+ "material",
8
+ "position",
9
+ "rotation",
10
+ ] as const;