@luma.gl/engine 10.0.0-beta.1 → 10.0.0-beta.3

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 (492) hide show
  1. package/dist/animation/deform-positions.d.ts +1 -1
  2. package/dist/animation/deform-positions.d.ts.map +1 -1
  3. package/dist/animation/skin.cjs +4 -4
  4. package/dist/animation/skin.d.ts +1 -1
  5. package/dist/animation/skin.d.ts.map +1 -1
  6. package/dist/animation/skin.js +1 -1
  7. package/dist/animation/skin.js.map +1 -1
  8. package/dist/animation/texture-transform.cjs +7 -7
  9. package/dist/animation/texture-transform.js +1 -1
  10. package/dist/animation/texture-transform.js.map +1 -1
  11. package/dist/arrow/arrow-mesh-types.d.ts +1 -1
  12. package/dist/arrow/arrow-mesh-types.d.ts.map +1 -1
  13. package/dist/arrow/index.cjs.map +2 -2
  14. package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +2 -2
  15. package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts +1 -1
  16. package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +1 -1
  17. package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.cjs +1 -0
  18. package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.d.ts.map +1 -1
  19. package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js +1 -0
  20. package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js.map +1 -1
  21. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +2 -2
  22. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +1 -1
  23. package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
  24. package/dist/audio/audio-controller.cjs +6 -6
  25. package/dist/audio/audio-controller.d.ts +1 -1
  26. package/dist/audio/audio-controller.d.ts.map +1 -1
  27. package/dist/audio/audio-controller.js +1 -1
  28. package/dist/audio/audio-controller.js.map +1 -1
  29. package/dist/audio/audio-environment.cjs +6 -6
  30. package/dist/audio/audio-environment.d.ts +1 -1
  31. package/dist/audio/audio-environment.d.ts.map +1 -1
  32. package/dist/audio/audio-environment.js +1 -1
  33. package/dist/audio/audio-environment.js.map +1 -1
  34. package/dist/compute/computation.d.ts +1 -1
  35. package/dist/compute/computation.d.ts.map +1 -1
  36. package/dist/debug/pixel-data-utils.d.ts +1 -1
  37. package/dist/debug/pixel-data-utils.d.ts.map +1 -1
  38. package/dist/dist.dev.js +293 -229
  39. package/dist/dist.min.js +73 -59
  40. package/dist/effects/index.cjs.map +1 -1
  41. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +1 -1
  42. package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
  43. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +1 -1
  44. package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
  45. package/dist/effects/passes/screen-space/gtao.cjs +4 -4
  46. package/dist/effects/passes/screen-space/gtao.d.ts +1 -1
  47. package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
  48. package/dist/effects/passes/screen-space/gtao.js +1 -1
  49. package/dist/effects/passes/screen-space/gtao.js.map +1 -1
  50. package/dist/effects/passes/screen-space/height-fog.d.ts +1 -1
  51. package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
  52. package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +1 -1
  53. package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
  54. package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +1 -1
  55. package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
  56. package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts +1 -1
  57. package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -1
  58. package/dist/experimental/controls/index.cjs +0 -3
  59. package/dist/experimental/controls/index.cjs.map +2 -2
  60. package/dist/experimental/controls/index.d.ts +0 -2
  61. package/dist/experimental/controls/index.d.ts.map +1 -1
  62. package/dist/experimental/controls/index.js +0 -1
  63. package/dist/experimental/controls/index.js.map +1 -1
  64. package/dist/experimental/webxr/webxr-input.d.ts +1 -1
  65. package/dist/experimental/webxr/webxr-input.d.ts.map +1 -1
  66. package/dist/experimental-controls.cjs +21 -0
  67. package/dist/experimental-controls.d.ts +2 -0
  68. package/dist/experimental-controls.d.ts.map +1 -0
  69. package/dist/experimental-controls.js +5 -0
  70. package/dist/experimental-controls.js.map +1 -0
  71. package/dist/experimental-materials.cjs +21 -0
  72. package/dist/experimental-materials.d.ts +2 -0
  73. package/dist/experimental-materials.d.ts.map +1 -0
  74. package/dist/experimental-materials.js +5 -0
  75. package/dist/experimental-materials.js.map +1 -0
  76. package/dist/experimental-textures.cjs +21 -0
  77. package/dist/experimental-textures.d.ts +2 -0
  78. package/dist/experimental-textures.d.ts.map +1 -0
  79. package/dist/experimental-textures.js +5 -0
  80. package/dist/experimental-textures.js.map +1 -0
  81. package/dist/{experimental/controls/orbit-controls.cjs → experimental-webxr.cjs} +5 -11
  82. package/dist/experimental-webxr.d.ts +2 -0
  83. package/dist/experimental-webxr.d.ts.map +1 -0
  84. package/dist/experimental-webxr.js +5 -0
  85. package/dist/experimental-webxr.js.map +1 -0
  86. package/dist/geometry/edge-geometry.d.ts +1 -1
  87. package/dist/geometry/edge-geometry.d.ts.map +1 -1
  88. package/dist/geometry/geometry-primitives.cjs +18 -17
  89. package/dist/geometry/geometry-primitives.d.ts +2 -2
  90. package/dist/geometry/geometry-primitives.d.ts.map +1 -1
  91. package/dist/geometry/geometry-primitives.js +3 -2
  92. package/dist/geometry/geometry-primitives.js.map +1 -1
  93. package/dist/geometry/geometry-table.d.ts +1 -1
  94. package/dist/geometry/geometry-table.d.ts.map +1 -1
  95. package/dist/geometry/geometry-utils.cjs +6 -6
  96. package/dist/geometry/geometry-utils.d.ts +2 -2
  97. package/dist/geometry/geometry-utils.d.ts.map +1 -1
  98. package/dist/geometry/geometry-utils.js +1 -1
  99. package/dist/geometry/geometry-utils.js.map +1 -1
  100. package/dist/geometry/geometry.cjs +2 -2
  101. package/dist/geometry/geometry.d.ts +4 -3
  102. package/dist/geometry/geometry.d.ts.map +1 -1
  103. package/dist/geometry/geometry.js +1 -1
  104. package/dist/geometry/geometry.js.map +1 -1
  105. package/dist/geometry/gpu-geometry.d.ts +1 -1
  106. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  107. package/dist/geometry/gpu-vector-geometry-adapter.d.ts +1 -1
  108. package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -1
  109. package/dist/geometry/ring-geometry.cjs +6 -6
  110. package/dist/geometry/ring-geometry.d.ts +1 -1
  111. package/dist/geometry/ring-geometry.d.ts.map +1 -1
  112. package/dist/geometry/ring-geometry.js +2 -2
  113. package/dist/geometry/ring-geometry.js.map +1 -1
  114. package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.cjs +80 -0
  115. package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.d.ts +28 -0
  116. package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.d.ts.map +1 -0
  117. package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.js +74 -0
  118. package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.js.map +1 -0
  119. package/dist/gltf/gltf/create-gltf-model.d.ts +1 -1
  120. package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
  121. package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +13 -4
  122. package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
  123. package/dist/gltf/gltf/create-scenegraph-from-gltf.js +11 -0
  124. package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
  125. package/dist/gltf/gltf/gltf-animated-crowd.d.ts +2 -1
  126. package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
  127. package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
  128. package/dist/gltf/gltf/gltf-instancing.cjs +2 -2
  129. package/dist/gltf/gltf/gltf-instancing.d.ts +1 -1
  130. package/dist/gltf/gltf/gltf-instancing.d.ts.map +1 -1
  131. package/dist/gltf/gltf/gltf-instancing.js +1 -1
  132. package/dist/gltf/gltf/gltf-instancing.js.map +1 -1
  133. package/dist/gltf/gltf/gltf-lightmap.cjs +2 -2
  134. package/dist/gltf/gltf/gltf-lightmap.d.ts +1 -1
  135. package/dist/gltf/gltf/gltf-lightmap.d.ts.map +1 -1
  136. package/dist/gltf/gltf/gltf-lightmap.js +1 -1
  137. package/dist/gltf/gltf/gltf-lightmap.js.map +1 -1
  138. package/dist/gltf/gltf/gltf-skin.cjs +1 -1
  139. package/dist/gltf/gltf/gltf-skin.js +2 -2
  140. package/dist/gltf/gltf/gltf-skin.js.map +1 -1
  141. package/dist/gltf/index.cjs +3 -0
  142. package/dist/gltf/index.cjs.map +3 -3
  143. package/dist/gltf/index.d.ts +1 -0
  144. package/dist/gltf/index.d.ts.map +1 -1
  145. package/dist/gltf/index.js +1 -0
  146. package/dist/gltf/index.js.map +1 -1
  147. package/dist/gltf/parsers/parse-gltf-lights.cjs +5 -5
  148. package/dist/gltf/parsers/parse-gltf-lights.js +1 -1
  149. package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
  150. package/dist/gltf/parsers/parse-gltf-physics-pointer.cjs +1 -1
  151. package/dist/gltf/parsers/parse-gltf-physics-pointer.js +1 -1
  152. package/dist/gltf/parsers/parse-gltf-physics-pointer.js.map +1 -1
  153. package/dist/gltf/parsers/parse-gltf.cjs +2 -1
  154. package/dist/gltf/parsers/parse-gltf.d.ts +2 -0
  155. package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
  156. package/dist/gltf/parsers/parse-gltf.js +3 -1
  157. package/dist/gltf/parsers/parse-gltf.js.map +1 -1
  158. package/dist/gltf/parsers/parse-pbr-material.cjs +27 -27
  159. package/dist/gltf/parsers/parse-pbr-material.js +1 -1
  160. package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
  161. package/dist/gltf/physics/export-state.cjs +118 -17
  162. package/dist/gltf/physics/export-state.d.ts +9 -2
  163. package/dist/gltf/physics/export-state.d.ts.map +1 -1
  164. package/dist/gltf/physics/export-state.js +172 -19
  165. package/dist/gltf/physics/export-state.js.map +1 -1
  166. package/dist/gltf/physics/index.cjs.map +2 -2
  167. package/dist/gltf/physics/index.d.ts +1 -1
  168. package/dist/gltf/physics/index.d.ts.map +1 -1
  169. package/dist/gltf/physics/index.js.map +1 -1
  170. package/dist/gltf/physics/mesh-snapshot.cjs +3 -3
  171. package/dist/gltf/physics/mesh-snapshot.js +1 -1
  172. package/dist/gltf/physics/mesh-snapshot.js.map +1 -1
  173. package/dist/gltf/physics/node-collision-geometry.cjs +3 -3
  174. package/dist/gltf/physics/node-collision-geometry.js +1 -1
  175. package/dist/gltf/physics/node-collision-geometry.js.map +1 -1
  176. package/dist/gltf/physics/parse-gltf-physics.cjs +20 -17
  177. package/dist/gltf/physics/parse-gltf-physics.d.ts.map +1 -1
  178. package/dist/gltf/physics/parse-gltf-physics.js +7 -3
  179. package/dist/gltf/physics/parse-gltf-physics.js.map +1 -1
  180. package/dist/gltf/physics/parse-physics-joints.cjs +3 -3
  181. package/dist/gltf/physics/parse-physics-joints.d.ts +1 -1
  182. package/dist/gltf/physics/parse-physics-joints.d.ts.map +1 -1
  183. package/dist/gltf/physics/parse-physics-joints.js +1 -1
  184. package/dist/gltf/physics/parse-physics-joints.js.map +1 -1
  185. package/dist/gltf/physics/physics-types.d.ts +4 -0
  186. package/dist/gltf/physics/physics-types.d.ts.map +1 -1
  187. package/dist/gltf/physics/property-bindings.cjs +9 -6
  188. package/dist/gltf/physics/property-bindings.d.ts.map +1 -1
  189. package/dist/gltf/physics/property-bindings.js +12 -3
  190. package/dist/gltf/physics/property-bindings.js.map +1 -1
  191. package/dist/gltf/types/gltf-postprocessed-schema.d.ts +4 -0
  192. package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
  193. package/dist/gltf/types/gltf-types.d.ts +2 -0
  194. package/dist/gltf/types/gltf-types.d.ts.map +1 -1
  195. package/dist/graph/models/index.cjs.map +2 -2
  196. package/dist/graph/models/path/path-storage-model.cjs +8 -8
  197. package/dist/graph/models/path/path-storage-model.d.ts +1 -1
  198. package/dist/graph/models/path/path-storage-model.js +2 -2
  199. package/dist/graph/models/polygon/polygon-attribute-model.cjs +4 -4
  200. package/dist/graph/models/polygon/polygon-attribute-model.d.ts +1 -1
  201. package/dist/graph/models/polygon/polygon-attribute-model.js +1 -1
  202. package/dist/graph/models/polygon/polygon-shaders.d.ts +1 -1
  203. package/dist/graph/models/polygon/polygon-storage-model.cjs +4 -4
  204. package/dist/graph/models/polygon/polygon-storage-model.d.ts +1 -1
  205. package/dist/graph/models/polygon/polygon-storage-model.js +1 -1
  206. package/dist/graph/physics/index.cjs +3 -0
  207. package/dist/graph/physics/index.cjs.map +3 -3
  208. package/dist/graph/physics/index.d.ts +2 -1
  209. package/dist/graph/physics/index.d.ts.map +1 -1
  210. package/dist/graph/physics/index.js +1 -0
  211. package/dist/graph/physics/index.js.map +1 -1
  212. package/dist/graph/physics/physics-controller-geometry.cjs +8 -8
  213. package/dist/graph/physics/physics-controller-geometry.js +2 -2
  214. package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
  215. package/dist/graph/physics/physics-controller.cjs +95 -31
  216. package/dist/graph/physics/physics-controller.d.ts +36 -9
  217. package/dist/graph/physics/physics-controller.d.ts.map +1 -1
  218. package/dist/graph/physics/physics-controller.js +96 -31
  219. package/dist/graph/physics/physics-controller.js.map +1 -1
  220. package/dist/graph/physics/physics-scenegraph.cjs +4 -4
  221. package/dist/graph/physics/physics-scenegraph.d.ts +1 -1
  222. package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -1
  223. package/dist/graph/physics/physics-scenegraph.js +1 -1
  224. package/dist/graph/physics/physics-scenegraph.js.map +1 -1
  225. package/dist/graph/physics/scenegraph-instance.cjs +14 -7
  226. package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
  227. package/dist/graph/physics/scenegraph-instance.js +15 -7
  228. package/dist/graph/physics/scenegraph-instance.js.map +1 -1
  229. package/dist/graph/physics/scenegraph-motion.cjs +7 -7
  230. package/dist/graph/physics/scenegraph-motion.d.ts +1 -1
  231. package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -1
  232. package/dist/graph/physics/scenegraph-motion.js +1 -1
  233. package/dist/graph/physics/scenegraph-motion.js.map +1 -1
  234. package/dist/graph/physics/scenegraph-properties.cjs +3 -3
  235. package/dist/graph/physics/scenegraph-properties.js +1 -1
  236. package/dist/graph/physics/scenegraph-properties.js.map +1 -1
  237. package/dist/graph/physics/scenegraph-publication.cjs +5 -5
  238. package/dist/graph/physics/scenegraph-publication.d.ts +1 -1
  239. package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -1
  240. package/dist/graph/physics/scenegraph-publication.js +1 -1
  241. package/dist/graph/physics/scenegraph-publication.js.map +1 -1
  242. package/dist/graph/physics/scenegraph-ragdoll.cjs +132 -0
  243. package/dist/graph/physics/scenegraph-ragdoll.d.ts +32 -0
  244. package/dist/graph/physics/scenegraph-ragdoll.d.ts.map +1 -0
  245. package/dist/graph/physics/scenegraph-ragdoll.js +117 -0
  246. package/dist/graph/physics/scenegraph-ragdoll.js.map +1 -0
  247. package/dist/graph/tables/index.cjs.map +2 -2
  248. package/dist/index.cjs +3 -0
  249. package/dist/index.cjs.map +3 -3
  250. package/dist/index.d.ts +1 -0
  251. package/dist/index.d.ts.map +1 -1
  252. package/dist/index.js +1 -0
  253. package/dist/index.js.map +1 -1
  254. package/dist/lighting/ambient-occlusion-pass.cjs +3 -3
  255. package/dist/lighting/ambient-occlusion-pass.d.ts +2 -1
  256. package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
  257. package/dist/lighting/ambient-occlusion-pass.js +1 -1
  258. package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
  259. package/dist/lighting/clustered-light-grid.d.ts +1 -1
  260. package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
  261. package/dist/lighting/contact-shadow-pass.cjs +2 -2
  262. package/dist/lighting/contact-shadow-pass.d.ts +2 -1
  263. package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
  264. package/dist/lighting/contact-shadow-pass.js +1 -1
  265. package/dist/lighting/contact-shadow-pass.js.map +1 -1
  266. package/dist/lighting/index.cjs.map +2 -2
  267. package/dist/lighting/lightmap-atlas.cjs +6 -6
  268. package/dist/lighting/lightmap-atlas.d.ts +1 -1
  269. package/dist/lighting/lightmap-atlas.d.ts.map +1 -1
  270. package/dist/lighting/lightmap-atlas.js +1 -1
  271. package/dist/lighting/lightmap-atlas.js.map +1 -1
  272. package/dist/lighting/reflection-probe.cjs +4 -4
  273. package/dist/lighting/reflection-probe.d.ts +2 -1
  274. package/dist/lighting/reflection-probe.d.ts.map +1 -1
  275. package/dist/lighting/reflection-probe.js +1 -1
  276. package/dist/lighting/reflection-probe.js.map +1 -1
  277. package/dist/lighting/shadow-map-renderer.cjs +13 -13
  278. package/dist/lighting/shadow-map-renderer.d.ts +2 -2
  279. package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
  280. package/dist/lighting/shadow-map-renderer.js +1 -1
  281. package/dist/lighting/shadow-map-renderer.js.map +1 -1
  282. package/dist/model/gpu-vector-model.d.ts +1 -1
  283. package/dist/model/gpu-vector-model.d.ts.map +1 -1
  284. package/dist/model/model.d.ts +1 -1
  285. package/dist/model/model.d.ts.map +1 -1
  286. package/dist/models/light-model-utils.cjs +2 -2
  287. package/dist/models/light-model-utils.d.ts +1 -1
  288. package/dist/models/light-model-utils.d.ts.map +1 -1
  289. package/dist/models/light-model-utils.js +1 -1
  290. package/dist/models/light-model-utils.js.map +1 -1
  291. package/dist/modules/picking/color-picking.d.ts +1 -1
  292. package/dist/modules/picking/index-color-picking.d.ts +1 -1
  293. package/dist/modules/picking/index-picking.d.ts +1 -1
  294. package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
  295. package/dist/modules/picking/picking-uniforms.d.ts +1 -1
  296. package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
  297. package/dist/modules/picking/picking.d.ts +1 -1
  298. package/dist/scenegraph/controllers/area-light-controller.cjs +11 -11
  299. package/dist/scenegraph/controllers/area-light-controller.js +1 -1
  300. package/dist/scenegraph/controllers/area-light-controller.js.map +1 -1
  301. package/dist/scenegraph/controllers/billboard-controller.cjs +28 -28
  302. package/dist/scenegraph/controllers/billboard-controller.d.ts +2 -1
  303. package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -1
  304. package/dist/scenegraph/controllers/billboard-controller.js +1 -1
  305. package/dist/scenegraph/controllers/billboard-controller.js.map +1 -1
  306. package/dist/scenegraph/controllers/joint-controller.cjs +5 -5
  307. package/dist/scenegraph/controllers/joint-controller.js +1 -1
  308. package/dist/scenegraph/controllers/joint-controller.js.map +1 -1
  309. package/dist/scenegraph/controllers/punctual-light-controller.cjs +2 -2
  310. package/dist/scenegraph/controllers/punctual-light-controller.d.ts +1 -1
  311. package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -1
  312. package/dist/scenegraph/controllers/punctual-light-controller.js +1 -1
  313. package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -1
  314. package/dist/scenegraph/controllers/skin-controller.cjs +22 -3
  315. package/dist/scenegraph/controllers/skin-controller.d.ts +4 -0
  316. package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -1
  317. package/dist/scenegraph/controllers/skin-controller.js +22 -2
  318. package/dist/scenegraph/controllers/skin-controller.js.map +1 -1
  319. package/dist/scenegraph/group-node.cjs +14 -14
  320. package/dist/scenegraph/group-node.d.ts +2 -2
  321. package/dist/scenegraph/group-node.d.ts.map +1 -1
  322. package/dist/scenegraph/group-node.js +1 -1
  323. package/dist/scenegraph/group-node.js.map +1 -1
  324. package/dist/scenegraph/model-node.d.ts +1 -1
  325. package/dist/scenegraph/model-node.d.ts.map +1 -1
  326. package/dist/scenegraph/physics-transforms.cjs +2 -2
  327. package/dist/scenegraph/physics-transforms.d.ts +1 -1
  328. package/dist/scenegraph/physics-transforms.d.ts.map +1 -1
  329. package/dist/scenegraph/physics-transforms.js +1 -1
  330. package/dist/scenegraph/physics-transforms.js.map +1 -1
  331. package/dist/scenegraph/scenegraph-bounds.cjs +3 -3
  332. package/dist/scenegraph/scenegraph-bounds.d.ts +1 -1
  333. package/dist/scenegraph/scenegraph-bounds.d.ts.map +1 -1
  334. package/dist/scenegraph/scenegraph-bounds.js +1 -1
  335. package/dist/scenegraph/scenegraph-bounds.js.map +1 -1
  336. package/dist/scenegraph/scenegraph-node.cjs +7 -7
  337. package/dist/scenegraph/scenegraph-node.d.ts +2 -1
  338. package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
  339. package/dist/scenegraph/scenegraph-node.js +1 -1
  340. package/dist/scenegraph/scenegraph-node.js.map +1 -1
  341. package/dist/scenegraph/transform-source.d.ts +1 -1
  342. package/dist/scenegraph/transform-source.d.ts.map +1 -1
  343. package/dist/shader-plugins/depth-interval.cjs +60 -0
  344. package/dist/shader-plugins/depth-interval.d.ts +10 -0
  345. package/dist/shader-plugins/depth-interval.d.ts.map +1 -0
  346. package/dist/shader-plugins/depth-interval.js +42 -0
  347. package/dist/shader-plugins/depth-interval.js.map +1 -0
  348. package/dist/splats/index.cjs.map +2 -2
  349. package/dist/splats/index.d.ts +1 -1
  350. package/dist/splats/index.d.ts.map +1 -1
  351. package/dist/splats/index.js.map +1 -1
  352. package/dist/splats/splat-picking.d.ts +2 -2
  353. package/dist/splats/splat-picking.d.ts.map +1 -1
  354. package/dist/splats/splat-renderer.cjs +51 -2
  355. package/dist/splats/splat-renderer.d.ts +15 -1
  356. package/dist/splats/splat-renderer.d.ts.map +1 -1
  357. package/dist/splats/splat-renderer.js +61 -2
  358. package/dist/splats/splat-renderer.js.map +1 -1
  359. package/dist/splats/splat-shaders.cjs +46 -3
  360. package/dist/splats/splat-shaders.d.ts +5 -3
  361. package/dist/splats/splat-shaders.d.ts.map +1 -1
  362. package/dist/splats/splat-shaders.js +42 -3
  363. package/dist/splats/splat-shaders.js.map +1 -1
  364. package/dist/text/text-3d/extrude.cjs +15 -15
  365. package/dist/text/text-3d/extrude.js +1 -1
  366. package/dist/text/text-3d/extrude.js.map +1 -1
  367. package/dist/text/text-3d/index.cjs.map +2 -2
  368. package/dist/text/text-3d/paths/curves.cjs +5 -5
  369. package/dist/text/text-3d/paths/curves.d.ts +1 -1
  370. package/dist/text/text-3d/paths/curves.d.ts.map +1 -1
  371. package/dist/text/text-3d/paths/curves.js +1 -1
  372. package/dist/text/text-3d/paths/curves.js.map +1 -1
  373. package/dist/text/text-3d/paths/path.cjs +5 -5
  374. package/dist/text/text-3d/paths/path.d.ts +1 -1
  375. package/dist/text/text-3d/paths/path.d.ts.map +1 -1
  376. package/dist/text/text-3d/paths/path.js +1 -1
  377. package/dist/text/text-3d/paths/path.js.map +1 -1
  378. package/dist/text/text-3d/paths/shape-path.d.ts +1 -1
  379. package/dist/text/text-3d/paths/shape-path.d.ts.map +1 -1
  380. package/dist/text/text-3d/paths/shape-utils.cjs +2 -2
  381. package/dist/text/text-3d/paths/shape-utils.d.ts +1 -1
  382. package/dist/text/text-3d/paths/shape-utils.d.ts.map +1 -1
  383. package/dist/text/text-3d/paths/shape-utils.js +1 -1
  384. package/dist/text/text-3d/paths/shape-utils.js.map +1 -1
  385. package/package.json +12 -12
  386. package/src/animation/deform-positions.ts +1 -1
  387. package/src/animation/skin.ts +2 -1
  388. package/src/animation/texture-transform.ts +1 -1
  389. package/src/arrow/arrow-geometry.ts +1 -1
  390. package/src/arrow/arrow-mesh-types.ts +1 -1
  391. package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +1 -1
  392. package/src/arrow/renderers/path/transforms/gpu-path-float64-deltas.ts +1 -0
  393. package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +1 -1
  394. package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +1 -1
  395. package/src/audio/audio-controller.ts +1 -1
  396. package/src/audio/audio-environment.ts +1 -1
  397. package/src/compute/computation.ts +1 -1
  398. package/src/debug/pixel-data-utils.ts +1 -1
  399. package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +1 -1
  400. package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +1 -1
  401. package/src/effects/passes/screen-space/gtao.ts +1 -1
  402. package/src/effects/passes/screen-space/height-fog.ts +1 -1
  403. package/src/effects/passes/screen-space/screen-space-global-illumination.ts +1 -1
  404. package/src/effects/passes/screen-space/screen-space-reflections.ts +1 -1
  405. package/src/effects/passes/screen-space/ssr-camera-temporal.ts +1 -1
  406. package/src/experimental/controls/index.ts +0 -2
  407. package/src/experimental/webxr/webxr-input.ts +1 -1
  408. package/{dist/experimental/controls/orbit-controls.js → src/experimental-controls.ts} +2 -2
  409. package/src/experimental-materials.ts +5 -0
  410. package/src/experimental-textures.ts +5 -0
  411. package/src/experimental-webxr.ts +5 -0
  412. package/src/geometry/edge-geometry.ts +2 -2
  413. package/src/geometry/geometry-primitives.ts +6 -3
  414. package/src/geometry/geometry-table.ts +1 -1
  415. package/src/geometry/geometry-utils.ts +3 -3
  416. package/src/geometry/geometry.ts +7 -7
  417. package/src/geometry/gpu-geometry.ts +1 -1
  418. package/src/geometry/gpu-vector-geometry-adapter.ts +1 -1
  419. package/src/geometry/ring-geometry.ts +2 -2
  420. package/src/gltf/gltf/create-composed-scenegraphs-from-gltf.ts +100 -0
  421. package/src/gltf/gltf/create-gltf-model.ts +1 -1
  422. package/src/gltf/gltf/create-scenegraph-from-gltf.ts +12 -0
  423. package/src/gltf/gltf/gltf-animated-crowd.ts +2 -1
  424. package/src/gltf/gltf/gltf-instancing.ts +1 -1
  425. package/src/gltf/gltf/gltf-lightmap.ts +1 -1
  426. package/src/gltf/gltf/gltf-skin.ts +2 -2
  427. package/src/gltf/index.ts +5 -0
  428. package/src/gltf/parsers/parse-gltf-lights.ts +1 -1
  429. package/src/gltf/parsers/parse-gltf-physics-pointer.ts +1 -1
  430. package/src/gltf/parsers/parse-gltf.ts +6 -4
  431. package/src/gltf/parsers/parse-pbr-material.ts +1 -1
  432. package/src/gltf/physics/README.md +16 -0
  433. package/src/gltf/physics/export-state.ts +216 -19
  434. package/src/gltf/physics/index.ts +1 -1
  435. package/src/gltf/physics/mesh-snapshot.ts +1 -1
  436. package/src/gltf/physics/node-collision-geometry.ts +1 -1
  437. package/src/gltf/physics/parse-gltf-physics.ts +6 -3
  438. package/src/gltf/physics/parse-physics-joints.ts +1 -1
  439. package/src/gltf/physics/physics-types.ts +4 -0
  440. package/src/gltf/physics/property-bindings.ts +11 -3
  441. package/src/gltf/types/gltf-postprocessed-schema.ts +4 -0
  442. package/src/gltf/types/gltf-types.ts +2 -0
  443. package/src/graph/models/path/path-storage-model.ts +3 -3
  444. package/src/graph/models/polygon/polygon-attribute-model.ts +1 -1
  445. package/src/graph/models/polygon/polygon-storage-model.ts +1 -1
  446. package/src/graph/physics/index.ts +2 -0
  447. package/src/graph/physics/physics-controller-geometry.ts +2 -2
  448. package/src/graph/physics/physics-controller.ts +139 -40
  449. package/src/graph/physics/physics-scenegraph.ts +1 -1
  450. package/src/graph/physics/scenegraph-instance.ts +25 -9
  451. package/src/graph/physics/scenegraph-motion.ts +1 -1
  452. package/src/graph/physics/scenegraph-properties.ts +1 -1
  453. package/src/graph/physics/scenegraph-publication.ts +1 -1
  454. package/src/graph/physics/scenegraph-ragdoll.ts +133 -0
  455. package/src/index.ts +2 -0
  456. package/src/lighting/ambient-occlusion-pass.ts +2 -1
  457. package/src/lighting/clustered-light-grid.ts +1 -1
  458. package/src/lighting/contact-shadow-pass.ts +2 -1
  459. package/src/lighting/lightmap-atlas.ts +1 -1
  460. package/src/lighting/reflection-probe.ts +2 -1
  461. package/src/lighting/shadow-map-renderer.ts +2 -2
  462. package/src/model/gpu-vector-model.ts +1 -1
  463. package/src/model/model.ts +1 -1
  464. package/src/models/light-model-utils.ts +2 -1
  465. package/src/modules/picking/legacy-picking-manager.ts +1 -1
  466. package/src/modules/picking/picking-uniforms.ts +1 -1
  467. package/src/scenegraph/controllers/area-light-controller.ts +1 -1
  468. package/src/scenegraph/controllers/billboard-controller.ts +2 -1
  469. package/src/scenegraph/controllers/joint-controller.ts +1 -1
  470. package/src/scenegraph/controllers/punctual-light-controller.ts +1 -1
  471. package/src/scenegraph/controllers/skin-controller.ts +21 -2
  472. package/src/scenegraph/group-node.ts +2 -2
  473. package/src/scenegraph/model-node.ts +1 -1
  474. package/src/scenegraph/physics-transforms.ts +1 -1
  475. package/src/scenegraph/scenegraph-bounds.ts +2 -2
  476. package/src/scenegraph/scenegraph-node.ts +2 -1
  477. package/src/scenegraph/transform-source.ts +1 -1
  478. package/src/shader-plugins/depth-interval.ts +45 -0
  479. package/src/splats/README.md +10 -0
  480. package/src/splats/index.ts +1 -0
  481. package/src/splats/splat-renderer.ts +82 -2
  482. package/src/splats/splat-shaders.ts +48 -3
  483. package/src/text/text-3d/extrude.ts +1 -1
  484. package/src/text/text-3d/font.ts +1 -1
  485. package/src/text/text-3d/paths/curves.ts +1 -1
  486. package/src/text/text-3d/paths/path.ts +1 -1
  487. package/src/text/text-3d/paths/shape-path.ts +1 -1
  488. package/src/text/text-3d/paths/shape-utils.ts +2 -2
  489. package/dist/experimental/controls/orbit-controls.d.ts +0 -3
  490. package/dist/experimental/controls/orbit-controls.d.ts.map +0 -1
  491. package/dist/experimental/controls/orbit-controls.js.map +0 -1
  492. package/src/experimental/controls/orbit-controls.ts +0 -6
@@ -2,33 +2,44 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {Matrix4} from '@math.gl/core';
6
- import {decomposePhysicsTransform} from '@luma.gl/engine';
5
+ import {Matrix4} from '@math.gl/core/matrix';
6
+ import {decomposePhysicsTransform, readPhysicsRotation, type ScenegraphNode} from '@luma.gl/engine';
7
7
  import {ScenegraphPhysicsProperties} from '@luma.gl/engine/physics';
8
8
  import {type GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
9
9
  import type {GLTFPhysicsDescription, GLTFPhysicsDocument} from './physics-types';
10
10
  import {makeGLTFPhysicsProperties} from './property-bindings';
11
11
 
12
+ /** Authored input from the same settled session as the GPU world. */
13
+ export type GLTFPhysicsExportOptions = {
14
+ /** Current local scene transforms for animated analytic collider frames and scales. */
15
+ sceneNodes?: ReadonlyMap<number, ScenegraphNode>;
16
+ };
17
+
12
18
  /** Export a settled revision as native draft glTF JSON, preserving source assets and provenance.
13
19
  * This explicit editing operation reads GPU state. It is not a simulation/render bridge.
14
- * Geometry/topology changes must first be reimported so the description matches the live world.
20
+ * Recook mesh deformation and topology changes first. Current analytic animation can
21
+ * be exported directly when the scene node map represents the same accepted revision.
15
22
  * Animation clips remain authored: replaying a clip can intentionally replace the saved pose.
16
23
  */
17
24
  export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
18
25
  source: T,
19
26
  description: GLTFPhysicsDescription,
20
- world: GPURigidBodyWorld
27
+ world: GPURigidBodyWorld,
28
+ {sceneNodes}: GLTFPhysicsExportOptions = {}
21
29
  ): Promise<T> {
22
30
  if (world.count !== description.bodies.length)
23
31
  throw new Error('Recook before exporting topology');
24
32
  const output = structuredClone(source);
25
33
  const nodes = output.nodes ?? [];
34
+ if (sceneNodes) writeLiveTransforms(output, sceneNodes);
26
35
  const parents = new Map<number, number>();
27
36
  for (const [index, node] of nodes.entries())
28
37
  for (const child of node.children ?? []) {
29
38
  if (parents.has(child)) throw new Error('Ambiguous export hierarchy');
30
39
  parents.set(child, index);
31
40
  }
41
+ /** Capture the local-frame origin before queuing the corresponding GPU state read. */
42
+ const origin = world.origin;
32
43
  const states = await world.readState();
33
44
  const matrices = new Map<number, Matrix4>();
34
45
  const locals = new Map<number, Matrix4>();
@@ -44,7 +55,7 @@ export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
44
55
  ? new Matrix4(node.matrix)
45
56
  : new Matrix4()
46
57
  .translate(node.translation ?? [0, 0, 0])
47
- .multiplyRight(new Matrix4().fromQuaternion(node.rotation ?? [0, 0, 0, 1]))
58
+ .multiplyRight(new Matrix4().fromQuaternion(readPhysicsRotation(node.rotation)))
48
59
  .scale(node.scale ?? [1, 1, 1]);
49
60
  locals.set(index, local);
50
61
  const parent = parents.get(index);
@@ -77,43 +88,46 @@ export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
77
88
  : target.joints.map(joint => ({...target, joints: [joint]}));
78
89
  for (const candidate of candidates) {
79
90
  const binding = new ScenegraphPhysicsProperties(world, new Map([[pointer, candidate]]));
80
- if (JSON.stringify(binding.get(pointer)) !== JSON.stringify(value))
91
+ if (!equalProperty(binding.get(pointer), value))
81
92
  throw new Error('Shared physics resource diverged');
82
93
  }
83
94
  }
84
- if (target.type === 'shape') {
85
- for (const collider of target.colliders) {
86
- if (world.getColliderShapeScale(collider.index).some(component => component !== 1))
87
- throw new Error('Recook animated scale before exporting');
88
- }
89
- }
90
95
  writePointer(output, pointer, value.length === 1 ? value[0] : value);
91
96
  }
92
97
  for (const body of description.bodies) {
93
98
  if (body.nodeIndex < 0) continue;
94
99
  const state = states[body.bodyIndex];
95
- const rotation = new Matrix4().fromQuaternion(state.orientation);
100
+ const rotation = new Matrix4().fromQuaternion(readPhysicsRotation(state.orientation));
96
101
  const center = rotation.transformAsVector(
97
102
  world.getBodyParameters(body.bodyIndex).centerOfMass ?? [0, 0, 0]
98
103
  );
99
104
  const matrix = new Matrix4()
100
105
  .translate(state.position.map((value, axis) => value - center[axis]))
101
106
  .multiplyRight(rotation)
102
- .scale(decomposePhysicsTransform(new Matrix4(body.worldMatrix)).scale);
107
+ .scale(decomposePhysicsTransform(authored(body.nodeIndex)).scale);
103
108
  bodyMatrices.set(body.nodeIndex, matrix);
104
109
  }
105
110
  matrices.clear();
111
+ /** Compose the accepted hierarchy near the simulation origin to preserve small local offsets. */
106
112
  const currentWorld = (index: number): Matrix4 => {
107
113
  const existing = bodyMatrices.get(index) ?? matrices.get(index);
108
114
  if (existing) return existing;
115
+ /** Articulated and static descendants inherit the same origin-relative frame. */
109
116
  const parent = parents.get(index);
117
+ /** The source local matrix is needed later and must stay in its authored frame. */
118
+ const local = locals.get(index)!;
119
+ /** Rebase an authored root by changing its world translation directly. */
110
120
  const matrix =
111
- parent === undefined
112
- ? locals.get(index)!
113
- : new Matrix4(currentWorld(parent)).multiplyRight(locals.get(index)!);
121
+ parent === undefined ? local.clone() : new Matrix4(currentWorld(parent)).multiplyRight(local);
122
+ if (parent === undefined) {
123
+ matrix[12] -= origin[0];
124
+ matrix[13] -= origin[1];
125
+ matrix[14] -= origin[2];
126
+ }
114
127
  matrices.set(index, matrix);
115
128
  return matrix;
116
129
  };
130
+ validateColliderFrames(description, world, currentWorld, parents, locals);
117
131
  const bodyNodes = new Set(description.bodies.map(body => body.nodeIndex));
118
132
  for (const body of description.bodies) {
119
133
  if (body.nodeIndex < 0) continue;
@@ -158,7 +172,11 @@ export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
158
172
  }
159
173
  const node = nodes[body.nodeIndex];
160
174
  delete node.matrix;
161
- node.translation = transform.position;
175
+ // Only scene roots need world-space positions. Child TRS is already relative to its parent.
176
+ node.translation =
177
+ parent === undefined || promote
178
+ ? transform.position.map((value, axis) => value + origin[axis])
179
+ : transform.position;
162
180
  node.rotation = transform.rotation;
163
181
  node.scale = transform.scale;
164
182
  if (mode === 'static') {
@@ -201,7 +219,7 @@ export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
201
219
  output,
202
220
  `${motion}angularVelocity`,
203
221
  new Matrix4()
204
- .fromQuaternion(states[body.bodyIndex].orientation)
222
+ .fromQuaternion(readPhysicsRotation(states[body.bodyIndex].orientation))
205
223
  .invert()
206
224
  .transformAsVector(states[body.bodyIndex].angularVelocity)
207
225
  );
@@ -210,6 +228,185 @@ export async function exportGLTFPhysicsState<T extends GLTFPhysicsDocument>(
210
228
  return output;
211
229
  }
212
230
 
231
+ /** Keep animated nodes in TRS form so their existing channels remain valid glTF. */
232
+ function writeLiveTransforms(
233
+ output: GLTFPhysicsDocument,
234
+ sceneNodes: ReadonlyMap<number, ScenegraphNode>
235
+ ): void {
236
+ /** Only node TRS channels require decomposition of a supplied local transform. */
237
+ const animated = new Set<number>();
238
+ for (const animation of output.animations ?? []) {
239
+ for (const {target} of animation.channels) {
240
+ if (
241
+ target.node !== undefined &&
242
+ ['translation', 'rotation', 'scale'].includes(target.path ?? '')
243
+ )
244
+ animated.add(target.node);
245
+ /** KHR_animation_pointer can target the same authored TRS fields. */
246
+ const extension = target.extensions?.['KHR_animation_pointer'];
247
+ if (
248
+ extension &&
249
+ typeof extension === 'object' &&
250
+ 'pointer' in extension &&
251
+ typeof extension.pointer === 'string'
252
+ ) {
253
+ /** Snapshot node indices remain identical to source indices. */
254
+ const match = /^\/nodes\/(\d+)\/(translation|rotation|scale)(?:\/\d+)?$/.exec(
255
+ extension.pointer
256
+ );
257
+ if (match) animated.add(Number(match[1]));
258
+ }
259
+ }
260
+ }
261
+ for (const [index, current] of sceneNodes) {
262
+ /** Render-only matrices retain their exact affine transform. */
263
+ const node = output.nodes?.[index];
264
+ if (!node) throw new Error('Unknown export scene node');
265
+ if (animated.has(index)) {
266
+ /** Retain valid glTF authoring channels for non-body animated descendants as well. */
267
+ const transform = getLiveNodeComponents(current, node);
268
+ delete node.matrix;
269
+ node.translation = transform.position;
270
+ node.rotation = transform.rotation;
271
+ node.scale = transform.scale;
272
+ } else {
273
+ node.matrix = Array.from(current.matrix);
274
+ delete node.translation;
275
+ delete node.rotation;
276
+ delete node.scale;
277
+ }
278
+ }
279
+ }
280
+
281
+ /** Preserve signed and zero scales when the local matrix comes from known TRS. */
282
+ function getLiveNodeComponents(
283
+ current: ScenegraphNode,
284
+ source: NonNullable<GLTFPhysicsDocument['nodes']>[number]
285
+ ): {position: readonly number[]; rotation: readonly number[]; scale: readonly number[]} {
286
+ /** Live local translation from the scenegraph component API. */
287
+ const position = Array.from(current.position);
288
+ /** Keep each axis sign, including axes collapsed by animation. */
289
+ const scale = Array.from(current.scale);
290
+ /** Convert either quaternion or Euler components with the scenegraph convention. */
291
+ const rotationMatrix = new Matrix4();
292
+ if (current.rotation.length === 4) rotationMatrix.fromQuaternion(current.rotation);
293
+ else rotationMatrix.rotateXYZ(current.rotation);
294
+ /** Verify that the components still describe the matrix used by the scene. */
295
+ const liveMatrix = new Matrix4().translate(position).multiplyRight(rotationMatrix).scale(scale);
296
+ if (liveMatrix.every((value, index) => value === current.matrix[index])) {
297
+ /** glTF rotation channels always use quaternions. */
298
+ const rotation =
299
+ current.rotation.length === 4
300
+ ? Array.from(current.rotation)
301
+ : decomposePhysicsTransform(rotationMatrix).rotation;
302
+ return {position, rotation, scale};
303
+ }
304
+
305
+ // Some imported nodes initialize only the matrix. Retain the source TRS when it still matches.
306
+ if (!source.matrix) {
307
+ /** Authored local translation with the glTF identity default. */
308
+ const authoredPosition = source.translation ?? [0, 0, 0];
309
+ /** Normalize exactly as the physics importer does when initializing the local matrix. */
310
+ const authoredRotation = readPhysicsRotation(source.rotation);
311
+ /** Authored scale with the glTF identity default. */
312
+ const authoredScale = source.scale ?? [1, 1, 1];
313
+ /** Match the import-time matrix before using source components. */
314
+ const authoredMatrix = new Matrix4()
315
+ .translate(authoredPosition)
316
+ .multiplyRight(new Matrix4().fromQuaternion(authoredRotation))
317
+ .scale(authoredScale);
318
+ if (authoredMatrix.every((value, index) => value === current.matrix[index]))
319
+ return {position: authoredPosition, rotation: authoredRotation, scale: authoredScale};
320
+ }
321
+ return decomposePhysicsTransform(new Matrix4(current.matrix));
322
+ }
323
+
324
+ /** Check that the native scene reproduces the live collider geometry and placement. */
325
+ function validateColliderFrames(
326
+ description: GLTFPhysicsDescription,
327
+ world: GPURigidBodyWorld,
328
+ getWorldMatrix: (index: number) => Matrix4,
329
+ parents: ReadonlyMap<number, number>,
330
+ locals: ReadonlyMap<number, Matrix4>
331
+ ): void {
332
+ for (const collider of description.colliders) {
333
+ /** The importer assigns the collider to its nearest rigid body ancestor. */
334
+ const body = description.bodies[collider.bodyIndex];
335
+ /** Begin at the authored collider placement, including any baked mesh center. */
336
+ const matrix = new Matrix4(collider.localMatrix);
337
+ if (body.nodeIndex < 0) {
338
+ matrix.multiplyLeft(getWorldMatrix(collider.nodeIndex));
339
+ } else {
340
+ /** Walk only body-local matrices to retain offsets even in distant parts of the world. */
341
+ let nodeIndex = collider.nodeIndex;
342
+ while (nodeIndex !== body.nodeIndex) {
343
+ matrix.multiplyLeft(locals.get(nodeIndex)!);
344
+ /** Collider ownership must still match the settled scene hierarchy. */
345
+ const parent = parents.get(nodeIndex);
346
+ if (parent === undefined) throw new Error('Recook before exporting collider ownership');
347
+ nodeIndex = parent;
348
+ }
349
+ /** Cooked collider frames include body scale and exclude rigid world motion. */
350
+ const {scale} = decomposePhysicsTransform(getWorldMatrix(body.nodeIndex));
351
+ matrix.multiplyLeft(new Matrix4().scale(scale));
352
+ }
353
+ /** Inspect the dimensions and pose in the same frame as the cooked collider. */
354
+ const authored = decomposePhysicsTransform(matrix);
355
+ /** Authored absolute scale must match the live cooked dimensions without baking scale twice. */
356
+ const liveScale = world.getColliderShapeScale(collider.colliderIndex);
357
+ if (
358
+ !authored.scale.every((value, axis) =>
359
+ closeComponent(Math.abs(value), collider.cookedScale[axis] * liveScale[axis], 1e-15)
360
+ )
361
+ )
362
+ throw new Error(
363
+ 'Export scene scale does not match the live collider. Supply the settled scene nodes or recook.'
364
+ );
365
+ if (collider.shapeIndex === undefined && liveScale.some(component => component !== 1))
366
+ throw new Error('Recook mesh geometry before export');
367
+
368
+ if (body.nodeIndex < 0) continue;
369
+ /** The two quaternion signs represent the same accepted collider orientation. */
370
+ const live = world.getColliderTransform(collider.colliderIndex);
371
+ /** Quaternion alignment tests orientation independently of quaternion sign. */
372
+ const alignment = authored.rotation.reduce(
373
+ (sum, value, axis) => sum + value * live.orientation[axis],
374
+ 0
375
+ );
376
+ if (
377
+ !authored.position.every((value, axis) => closeComponent(value, live.position[axis])) ||
378
+ !closeComponent(Math.abs(alignment), 1)
379
+ )
380
+ throw new Error(
381
+ 'Export scene pose does not match the live collider. Supply the settled scene nodes or recook.'
382
+ );
383
+ }
384
+ }
385
+
386
+ /** Allow roundoff when a shared value has been independently scaled and unscaled. */
387
+ function equalProperty(
388
+ actual: readonly unknown[] | undefined,
389
+ expected: readonly unknown[]
390
+ ): boolean {
391
+ return (
392
+ actual?.length === expected.length &&
393
+ actual.every((value, index) => {
394
+ /** Boolean pointer values must still match exactly. */
395
+ const other = expected[index];
396
+ return typeof value === 'number' && typeof other === 'number'
397
+ ? closeComponent(value, other, 1e-15)
398
+ : value === other;
399
+ })
400
+ );
401
+ }
402
+
403
+ /** Browser GPU poses are float32 while source transforms and export are JavaScript numbers. */
404
+ function closeComponent(first: number, second: number, minimumMagnitude = 1): boolean {
405
+ return (
406
+ Math.abs(first - second) <= Math.max(minimumMagnitude, Math.abs(first), Math.abs(second)) * 2e-6
407
+ );
408
+ }
409
+
213
410
  function writePointer(document: object, pointer: string, value: unknown): void {
214
411
  const keys = pointer.slice(1).split('/');
215
412
  let object: Record<string, unknown> = document as Record<string, unknown>;
@@ -95,6 +95,6 @@ export function makeGLTFPhysicsDefinition(
95
95
  }
96
96
  export {makeGLTFPhysicsScene} from './scene-bindings';
97
97
 
98
- export {exportGLTFPhysicsState} from './export-state';
98
+ export {exportGLTFPhysicsState, type GLTFPhysicsExportOptions} from './export-state';
99
99
 
100
100
  export {snapshotGLTFPhysicsScene} from './snapshot-scene';
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {Matrix4} from '@math.gl/core';
5
+ import {Matrix4} from '@math.gl/core/matrix';
6
6
  import {deformPositions, type ScenegraphNode} from '@luma.gl/engine';
7
7
  import type {
8
8
  GLTF,
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {Matrix4} from '@math.gl/core';
5
+ import {Matrix4} from '@math.gl/core/matrix';
6
6
  import type {GLTFPhysicsDocument, ParseGLTFPhysicsOptions} from './physics-types';
7
7
  import {readPhysicsRotation, readPhysicsVector} from './physics-transforms';
8
8
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {isGLTFPhysicsPropertyPointer} from '../parsers/parse-gltf-physics-pointer';
6
6
  import {parsePhysicsJoints} from './parse-physics-joints';
7
- import {Matrix4, Quaternion} from '@math.gl/core';
7
+ import {Matrix4, Quaternion} from '@math.gl/core/matrix';
8
8
  import {collectNodeCollisionGeometry} from './node-collision-geometry';
9
9
  import {getMeshBoxBounds} from './mesh-box-shape';
10
10
  import {
@@ -248,7 +248,9 @@ export function parseGLTFPhysics(
248
248
  const shapeRoot =
249
249
  source.extensions?.[SHAPES] === undefined ? {} : record(source.extensions[SHAPES]);
250
250
  checkFields(shapeRoot, ['shapes']);
251
- shapes = array(shapeRoot['shapes']);
251
+ if (source.shapes && source.extensions?.[SHAPES])
252
+ throw new Error('Physics shape indices require exactly one shape namespace');
253
+ shapes = source.shapes ? [...source.shapes] : array(shapeRoot['shapes']);
252
254
  } catch (error) {
253
255
  report('invalid-extension', '/extensions', error);
254
256
  }
@@ -796,6 +798,7 @@ export function parseGLTFPhysics(
796
798
  typeof pointer === 'string' &&
797
799
  (pointer.includes(PHYSICS) ||
798
800
  pointer.includes(SHAPES) ||
801
+ pointer.startsWith('/shapes/') ||
799
802
  Boolean(nodeMatch && relevant.has(Number(nodeMatch[1]))));
800
803
  const targetNode = nodeMatch ? Number(nodeMatch[1]) : channel.target.node;
801
804
  const targetPath = nodeMatch ? nodeMatch[2] : channel.target.path;
@@ -878,7 +881,7 @@ export function parseGLTFPhysics(
878
881
  result.animatedColliderIndices.push(collider.colliderIndex);
879
882
  if (affected.length || affectedColliders.length) {
880
883
  for (const body of affected) {
881
- body.body.mode = 'kinematic';
884
+ if (!options.preserveAnimatedBodyModes) body.body.mode = 'kinematic';
882
885
  if (!result.animatedBodyIndices.includes(body.bodyIndex))
883
886
  result.animatedBodyIndices.push(body.bodyIndex);
884
887
  }
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
5
  import {parseGLTFJointDeclarations} from '../parsers/parse-gltf-joints';
6
- import {Matrix4} from '@math.gl/core';
6
+ import {Matrix4} from '@math.gl/core/matrix';
7
7
  import {makeRigidBodyJointsFromScenegraph} from '@luma.gl/engine/physics';
8
8
  import {GroupNode, JointController} from '@luma.gl/engine';
9
9
  import {readPhysicsRotation, readPhysicsVector} from './physics-transforms';
@@ -12,6 +12,8 @@ import type {
12
12
 
13
13
  /** Raw glTF JSON, before loaders.gl replaces node indices with objects. */
14
14
  export type GLTFPhysicsDocument = {
15
+ /** Core analytic shapes in the glTF 2.1 document. */
16
+ shapes?: readonly unknown[];
15
17
  scene?: number;
16
18
  scenes?: readonly {nodes?: readonly number[]}[];
17
19
  nodes?: readonly {
@@ -101,6 +103,8 @@ export type ParseGLTFPhysicsOptions = {
101
103
  propertyBindings?: boolean;
102
104
  /** Bind rigid node translation/rotation channels through ScenegraphPhysicsMotion. */
103
105
  animationOwnership?: 'scenegraph';
106
+ /** Keep authored motion modes so a session can release animation-owned bodies into dynamics. */
107
+ preserveAnimatedBodyModes?: boolean;
104
108
  scene?: number;
105
109
  /** Decode one node's own mesh at its initial pose in that node's local space.
106
110
  * Include initial skinning and morph weights; the adapter combines child transforms.
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {Matrix4} from '@math.gl/core';
5
+ import {Matrix4} from '@math.gl/core/matrix';
6
6
  import {decomposePhysicsTransform} from '@luma.gl/engine';
7
7
  import {ScenegraphPhysicsProperties, type PhysicsPropertyTarget} from '@luma.gl/engine/physics';
8
8
  import {type GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
@@ -61,13 +61,21 @@ export function makeGLTFPhysicsProperties(
61
61
  });
62
62
  }
63
63
  // Source indices and unit conversion belong to the importer; runtime mutation is shared.
64
+ /** Preserve the source namespace in animation pointers and native export. */
65
+ const shapePointer = description.source.shapes
66
+ ? '/shapes'
67
+ : '/extensions/KHR_implicit_shapes/shapes';
68
+ /** Both profiles use the same analytic physics property bindings. */
64
69
  const shapes =
70
+ (description.source.shapes as Record<string, unknown>[] | undefined) ??
65
71
  (
66
72
  description.source.extensions?.['KHR_implicit_shapes'] as
67
73
  | {shapes?: Record<string, unknown>[]}
68
74
  | undefined
69
- )?.shapes ?? [];
75
+ )?.shapes ??
76
+ [];
70
77
  for (const [shapeIndex, source] of shapes.entries()) {
78
+ if (!source || typeof source !== 'object') continue;
71
79
  const type = source['type'];
72
80
  const fields =
73
81
  type === 'sphere'
@@ -109,7 +117,7 @@ export function makeGLTFPhysicsProperties(
109
117
  ]
110
118
  };
111
119
  });
112
- targets.set(`/extensions/KHR_implicit_shapes/shapes/${shapeIndex}/${type}/${field}`, {
120
+ targets.set(`${shapePointer}/${shapeIndex}/${type}/${field}`, {
113
121
  type: 'shape',
114
122
  colliders,
115
123
  property: property as Extract<PhysicsPropertyTarget, {type: 'shape'}>['property']
@@ -636,6 +636,8 @@ export type GLTFNodePostprocessed = {
636
636
  mesh?: GLTFMeshPostprocessed;
637
637
  /** Index of the draft glTF 2.1 external asset instantiated by this node. */
638
638
  externalAsset?: GlTfId;
639
+ /** Draft glTF 2.1 authored spatial bound. */
640
+ boundingVolume?: import('./gltf-shape-schema').GLTFBoundingVolume;
639
641
  /**
640
642
  * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
641
643
  */
@@ -781,6 +783,8 @@ export type GLTFPostprocessed = {
781
783
  scene?: GLTFScenePostprocessed;
782
784
  /** An array of scenes. */
783
785
  scenes: GLTFScenePostprocessed[];
786
+ /** Draft glTF 2.1 analytic shapes shared by authored bounds and physics. */
787
+ shapes?: import('./gltf-shape-schema').GLTFShape[];
784
788
  /** An array of skins. */
785
789
  skins: GLTFSkinPostprocessed[];
786
790
  /** An array of textures. */
@@ -93,6 +93,8 @@ export type GLTFWithBuffers = {
93
93
  images?: (GLTFImageData | null)[];
94
94
  binary?: ArrayBuffer;
95
95
  baseUri?: string;
96
+ /** Decoded glTF 2.1 dependencies, indexed by the source externalAssets array. */
97
+ externalAssets?: Array<GLTFWithBuffers | null>;
96
98
  /** Gaussian primitive descriptors supplied by the loader. */
97
99
  gaussianSplatPrimitives?: GLTFGaussianSplatDescriptor[];
98
100
  };
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
5
  import type {ModelDrawOptions} from '../../../model/gpu-vector-model';
6
- import type {GPUPathStorageInputProps} from '@luma.gl/graph/experimental/models';
6
+ import type {GPUPathStorageInputProps} from '@luma.gl/graph/experimental-models';
7
7
 
8
8
  import {
9
9
  Buffer,
@@ -23,11 +23,11 @@ import {
23
23
  createGpuPathGeneratedState,
24
24
  createGpuPathRangeState,
25
25
  dispatchGpuPathExpansionCompute
26
- } from '@luma.gl/graph/experimental/models';
26
+ } from '@luma.gl/graph/experimental-models';
27
27
  import {
28
28
  resolvePathStorageInputs,
29
29
  type PathStorageBatchInputs
30
- } from '@luma.gl/graph/experimental/models';
30
+ } from '@luma.gl/graph/experimental-models';
31
31
  import type {GPUInputSchema} from '@luma.gl/graph/gpu-tables';
32
32
 
33
33
  const SEGMENT_START_POINT_INDICES_COLUMN = 'segmentStartPointIndices';
@@ -15,7 +15,7 @@ import {
15
15
  POLYGON_GPU_INPUT_SCHEMA,
16
16
  type PolygonBatchProps,
17
17
  type PolygonGPUVectors
18
- } from '@luma.gl/graph/experimental/models';
18
+ } from '@luma.gl/graph/experimental-models';
19
19
  import {
20
20
  POLYGON_ATTRIBUTE_SHADER_LAYOUT,
21
21
  POLYGON_ATTRIBUTE_VS_GLSL,
@@ -14,7 +14,7 @@ import {
14
14
  assertPolygonGPUVectorInputs,
15
15
  POLYGON_GPU_INPUT_SCHEMA,
16
16
  type PolygonBatchProps
17
- } from '@luma.gl/graph/experimental/models';
17
+ } from '@luma.gl/graph/experimental-models';
18
18
  import {
19
19
  getPolygonPickingParameters,
20
20
  mergePolygonShaderModules,
@@ -25,6 +25,7 @@ export type {ScenegraphPhysicsScene, ScenegraphPhysicsSessionCapture} from './sc
25
25
  export {PhysicsController} from './physics-controller';
26
26
  export type {
27
27
  PhysicsNodeReference,
28
+ PhysicsVehicleOptions,
28
29
  PhysicsJointOptions,
29
30
  PhysicsBodyOptions,
30
31
  PhysicsControllerProps,
@@ -32,3 +33,4 @@ export type {
32
33
  PhysicsBodyPose,
33
34
  PhysicsUpdateResult
34
35
  } from './physics-controller';
36
+ export {ScenegraphRagdoll} from './scenegraph-ragdoll';
@@ -3,8 +3,8 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
5
  import {assert} from '@luma.gl/core';
6
- import {Geometry} from '@math.gl/geometry';
7
- import {Matrix4} from '@math.gl/core';
6
+ import {Geometry} from '@math.gl/geometry/primitives';
7
+ import {Matrix4} from '@math.gl/core/matrix';
8
8
  import {
9
9
  CubeGeometry,
10
10
  GroupNode,