@luma.gl/engine 10.0.0-alpha.4 → 10.0.0-alpha.5

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 (605) hide show
  1. package/README.md +9 -0
  2. package/dist/animation/animation-clip.cjs +36 -0
  3. package/dist/animation/animation-interpolation.cjs +115 -0
  4. package/dist/animation/animation-mixer.cjs +302 -0
  5. package/dist/animation/animation-track.cjs +55 -0
  6. package/dist/animation/animator.cjs +75 -0
  7. package/dist/animation/deform-positions.cjs +69 -0
  8. package/dist/animation/deform-positions.d.ts +13 -0
  9. package/dist/animation/deform-positions.d.ts.map +1 -0
  10. package/dist/animation/deform-positions.js +49 -0
  11. package/dist/animation/deform-positions.js.map +1 -0
  12. package/dist/animation/key-frames.cjs +81 -0
  13. package/dist/animation/morph-targets.cjs +162 -0
  14. package/dist/animation/node-animation-binding.cjs +67 -0
  15. package/dist/animation/node-animation-binding.d.ts +9 -0
  16. package/dist/animation/node-animation-binding.d.ts.map +1 -0
  17. package/dist/animation/node-animation-binding.js +45 -0
  18. package/dist/animation/node-animation-binding.js.map +1 -0
  19. package/dist/animation/property-animation-binding.cjs +159 -0
  20. package/dist/animation/property-animation-binding.d.ts +29 -0
  21. package/dist/animation/property-animation-binding.d.ts.map +1 -0
  22. package/dist/animation/property-animation-binding.js +138 -0
  23. package/dist/animation/property-animation-binding.js.map +1 -0
  24. package/dist/animation/scenegraph-animator.cjs +122 -0
  25. package/dist/animation/scenegraph-animator.d.ts +37 -0
  26. package/dist/animation/scenegraph-animator.d.ts.map +1 -0
  27. package/dist/animation/scenegraph-animator.js +99 -0
  28. package/dist/animation/scenegraph-animator.js.map +1 -0
  29. package/dist/animation/skin.cjs +49 -0
  30. package/dist/animation/texture-transform.cjs +41 -0
  31. package/dist/animation/texture-transform.d.ts +8 -0
  32. package/dist/animation/texture-transform.d.ts.map +1 -0
  33. package/dist/animation/texture-transform.js +17 -0
  34. package/dist/animation/texture-transform.js.map +1 -0
  35. package/dist/animation/timeline.cjs +129 -0
  36. package/dist/animation-loop/animation-loop-template.cjs +33 -0
  37. package/dist/animation-loop/animation-loop.cjs +498 -0
  38. package/dist/animation-loop/animation-loop.d.ts +2 -1
  39. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  40. package/dist/animation-loop/animation-loop.js +9 -3
  41. package/dist/animation-loop/animation-loop.js.map +1 -1
  42. package/dist/animation-loop/animation-props.cjs +15 -0
  43. package/dist/animation-loop/make-animation-loop.cjs +104 -0
  44. package/dist/animation-loop/request-animation-frame.cjs +43 -0
  45. package/dist/application-utils/load-file.cjs +77 -0
  46. package/dist/application-utils/random.cjs +38 -0
  47. package/dist/audio/audio-controller.cjs +429 -0
  48. package/dist/audio/audio-controller.d.ts +146 -0
  49. package/dist/audio/audio-controller.d.ts.map +1 -0
  50. package/dist/audio/audio-controller.js +445 -0
  51. package/dist/audio/audio-controller.js.map +1 -0
  52. package/dist/audio/audio-environment.cjs +157 -0
  53. package/dist/audio/audio-environment.d.ts +49 -0
  54. package/dist/audio/audio-environment.d.ts.map +1 -0
  55. package/dist/audio/audio-environment.js +148 -0
  56. package/dist/audio/audio-environment.js.map +1 -0
  57. package/dist/audio/audio-graph.cjs +182 -0
  58. package/dist/audio/audio-graph.d.ts +58 -0
  59. package/dist/audio/audio-graph.d.ts.map +1 -0
  60. package/dist/audio/audio-graph.js +181 -0
  61. package/dist/audio/audio-graph.js.map +1 -0
  62. package/dist/compute/buffer-transform.cjs +146 -0
  63. package/dist/compute/buffer-transform.d.ts +15 -5
  64. package/dist/compute/buffer-transform.d.ts.map +1 -1
  65. package/dist/compute/buffer-transform.js +56 -12
  66. package/dist/compute/buffer-transform.js.map +1 -1
  67. package/dist/compute/computation.cjs +331 -0
  68. package/dist/compute/computation.d.ts +2 -4
  69. package/dist/compute/computation.d.ts.map +1 -1
  70. package/dist/compute/computation.js +3 -14
  71. package/dist/compute/computation.js.map +1 -1
  72. package/dist/compute/swap.cjs +132 -0
  73. package/dist/compute/texture-transform.cjs +142 -0
  74. package/dist/compute/texture-transform.d.ts +11 -7
  75. package/dist/compute/texture-transform.d.ts.map +1 -1
  76. package/dist/compute/texture-transform.js +16 -6
  77. package/dist/compute/texture-transform.js.map +1 -1
  78. package/dist/controls/orbit-controls.cjs +283 -0
  79. package/dist/controls/orbit-controls.d.ts +2 -0
  80. package/dist/controls/orbit-controls.d.ts.map +1 -1
  81. package/dist/controls/orbit-controls.js +2 -1
  82. package/dist/controls/orbit-controls.js.map +1 -1
  83. package/dist/debug/copy-texture-to-image.cjs +84 -0
  84. package/dist/debug/debug-framebuffer.cjs +113 -0
  85. package/dist/debug/debug-shader-layout.cjs +45 -0
  86. package/dist/debug/pixel-data-utils.cjs +54 -0
  87. package/dist/dist.dev.js +11756 -5632
  88. package/dist/dist.min.js +39 -35
  89. package/dist/dynamic-buffer/dynamic-buffer.cjs +39 -0
  90. package/dist/dynamic-buffer/dynamic-buffer.d.ts +1 -170
  91. package/dist/dynamic-buffer/dynamic-buffer.d.ts.map +1 -1
  92. package/dist/dynamic-buffer/dynamic-buffer.js +2 -312
  93. package/dist/dynamic-buffer/dynamic-buffer.js.map +1 -1
  94. package/dist/dynamic-texture/dynamic-texture.cjs +27 -0
  95. package/dist/dynamic-texture/dynamic-texture.d.ts +1 -114
  96. package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
  97. package/dist/dynamic-texture/dynamic-texture.js +2 -584
  98. package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
  99. package/dist/dynamic-texture/texture-binding-source.cjs +31 -0
  100. package/dist/dynamic-texture/texture-binding-source.d.ts +1 -54
  101. package/dist/dynamic-texture/texture-binding-source.d.ts.map +1 -1
  102. package/dist/dynamic-texture/texture-binding-source.js +2 -51
  103. package/dist/dynamic-texture/texture-binding-source.js.map +1 -1
  104. package/dist/dynamic-texture/texture-data.cjs +53 -0
  105. package/dist/dynamic-texture/texture-data.d.ts +1 -145
  106. package/dist/dynamic-texture/texture-data.d.ts.map +1 -1
  107. package/dist/dynamic-texture/texture-data.js +2 -209
  108. package/dist/dynamic-texture/texture-data.js.map +1 -1
  109. package/dist/dynamic-texture/video-texture.cjs +269 -0
  110. package/dist/dynamic-texture/video-texture.d.ts +1 -1
  111. package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
  112. package/dist/experimental/controls/comparison-splitter.cjs +231 -0
  113. package/dist/experimental/controls/comparison-splitter.d.ts +54 -0
  114. package/dist/experimental/controls/comparison-splitter.d.ts.map +1 -0
  115. package/dist/experimental/controls/comparison-splitter.js +215 -0
  116. package/dist/experimental/controls/comparison-splitter.js.map +1 -0
  117. package/dist/experimental/controls/flat-controller.cjs +301 -0
  118. package/dist/experimental/controls/flat-controller.d.ts +80 -0
  119. package/dist/experimental/controls/flat-controller.d.ts.map +1 -0
  120. package/dist/experimental/controls/flat-controller.js +295 -0
  121. package/dist/experimental/controls/flat-controller.js.map +1 -0
  122. package/dist/experimental/controls/index.cjs +35 -0
  123. package/dist/experimental/controls/index.cjs.map +6 -0
  124. package/dist/experimental/controls/index.d.ts +7 -0
  125. package/dist/experimental/controls/index.d.ts.map +1 -0
  126. package/dist/experimental/controls/index.js +7 -0
  127. package/dist/experimental/controls/index.js.map +1 -0
  128. package/dist/experimental/controls/orbit-controls.cjs +27 -0
  129. package/dist/experimental/controls/orbit-controls.d.ts +3 -0
  130. package/dist/experimental/controls/orbit-controls.d.ts.map +1 -0
  131. package/dist/experimental/controls/orbit-controls.js +5 -0
  132. package/dist/experimental/controls/orbit-controls.js.map +1 -0
  133. package/dist/experimental/materials/emissive-material.cjs +126 -0
  134. package/dist/experimental/materials/emissive-material.d.ts +38 -0
  135. package/dist/experimental/materials/emissive-material.d.ts.map +1 -0
  136. package/dist/experimental/materials/emissive-material.js +100 -0
  137. package/dist/experimental/materials/emissive-material.js.map +1 -0
  138. package/dist/experimental/materials/glass-material.cjs +570 -0
  139. package/dist/experimental/materials/glass-material.d.ts +107 -0
  140. package/dist/experimental/materials/glass-material.d.ts.map +1 -0
  141. package/dist/experimental/materials/glass-material.js +544 -0
  142. package/dist/experimental/materials/glass-material.js.map +1 -0
  143. package/dist/experimental/materials/glass-transmission.cjs +954 -0
  144. package/dist/experimental/materials/glass-transmission.d.ts +193 -0
  145. package/dist/experimental/materials/glass-transmission.d.ts.map +1 -0
  146. package/dist/experimental/materials/glass-transmission.js +928 -0
  147. package/dist/experimental/materials/glass-transmission.js.map +1 -0
  148. package/dist/experimental/materials/index.cjs +61 -0
  149. package/dist/experimental/materials/index.cjs.map +6 -0
  150. package/dist/experimental/materials/index.d.ts +14 -0
  151. package/dist/experimental/materials/index.d.ts.map +1 -0
  152. package/dist/experimental/materials/index.js +11 -0
  153. package/dist/experimental/materials/index.js.map +1 -0
  154. package/dist/experimental/materials/optical-caustics.cjs +201 -0
  155. package/dist/experimental/materials/optical-caustics.d.ts +69 -0
  156. package/dist/experimental/materials/optical-caustics.d.ts.map +1 -0
  157. package/dist/experimental/materials/optical-caustics.js +180 -0
  158. package/dist/experimental/materials/optical-caustics.js.map +1 -0
  159. package/dist/experimental/materials/optical-lighting.cjs +169 -0
  160. package/dist/experimental/materials/optical-lighting.d.ts +7 -0
  161. package/dist/experimental/materials/optical-lighting.d.ts.map +1 -0
  162. package/dist/experimental/materials/optical-lighting.js +144 -0
  163. package/dist/experimental/materials/optical-lighting.js.map +1 -0
  164. package/dist/experimental/materials/optical-point-lights.cjs +258 -0
  165. package/dist/experimental/materials/optical-point-lights.d.ts +68 -0
  166. package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -0
  167. package/dist/experimental/materials/optical-point-lights.js +237 -0
  168. package/dist/experimental/materials/optical-point-lights.js.map +1 -0
  169. package/dist/experimental/materials/reflective-material.cjs +216 -0
  170. package/dist/experimental/materials/reflective-material.d.ts +46 -0
  171. package/dist/experimental/materials/reflective-material.d.ts.map +1 -0
  172. package/dist/experimental/materials/reflective-material.js +190 -0
  173. package/dist/experimental/materials/reflective-material.js.map +1 -0
  174. package/dist/experimental/textures/html-texture.cjs +221 -0
  175. package/dist/experimental/textures/html-texture.d.ts +85 -0
  176. package/dist/experimental/textures/html-texture.d.ts.map +1 -0
  177. package/dist/experimental/textures/html-texture.js +206 -0
  178. package/dist/experimental/textures/html-texture.js.map +1 -0
  179. package/dist/experimental/textures/index.cjs +33 -0
  180. package/dist/experimental/textures/index.cjs.map +6 -0
  181. package/dist/experimental/textures/index.d.ts +5 -0
  182. package/dist/experimental/textures/index.d.ts.map +1 -0
  183. package/dist/experimental/textures/index.js +7 -0
  184. package/dist/experimental/textures/index.js.map +1 -0
  185. package/dist/experimental/textures/packed-pixels.cjs +248 -0
  186. package/dist/experimental/textures/packed-pixels.d.ts +17 -0
  187. package/dist/experimental/textures/packed-pixels.d.ts.map +1 -0
  188. package/dist/experimental/textures/packed-pixels.js +237 -0
  189. package/dist/experimental/textures/packed-pixels.js.map +1 -0
  190. package/dist/experimental/textures/rgba-decoder.cjs +60 -0
  191. package/dist/experimental/textures/rgba-decoder.d.ts +29 -0
  192. package/dist/experimental/textures/rgba-decoder.d.ts.map +1 -0
  193. package/dist/experimental/textures/rgba-decoder.js +43 -0
  194. package/dist/experimental/textures/rgba-decoder.js.map +1 -0
  195. package/dist/experimental/webxr/index.cjs +38 -0
  196. package/dist/experimental/webxr/index.cjs.map +6 -0
  197. package/dist/experimental/webxr/index.d.ts +9 -0
  198. package/dist/experimental/webxr/index.d.ts.map +1 -0
  199. package/dist/experimental/webxr/index.js +8 -0
  200. package/dist/experimental/webxr/index.js.map +1 -0
  201. package/dist/experimental/webxr/webxr-animation-frame-provider.cjs +38 -0
  202. package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts +9 -0
  203. package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts.map +1 -0
  204. package/dist/experimental/webxr/webxr-animation-frame-provider.js +17 -0
  205. package/dist/experimental/webxr/webxr-animation-frame-provider.js.map +1 -0
  206. package/dist/experimental/webxr/webxr-camera-texture.cjs +157 -0
  207. package/dist/experimental/webxr/webxr-camera-texture.d.ts +48 -0
  208. package/dist/experimental/webxr/webxr-camera-texture.d.ts.map +1 -0
  209. package/dist/experimental/webxr/webxr-camera-texture.js +144 -0
  210. package/dist/experimental/webxr/webxr-camera-texture.js.map +1 -0
  211. package/dist/experimental/webxr/webxr-input.cjs +93 -0
  212. package/dist/experimental/webxr/webxr-input.d.ts +24 -0
  213. package/dist/experimental/webxr/webxr-input.d.ts.map +1 -0
  214. package/dist/experimental/webxr/webxr-input.js +70 -0
  215. package/dist/experimental/webxr/webxr-input.js.map +1 -0
  216. package/dist/experimental/webxr/webxr-manager.cjs +356 -0
  217. package/dist/experimental/webxr/webxr-manager.d.ts +91 -0
  218. package/dist/experimental/webxr/webxr-manager.d.ts.map +1 -0
  219. package/dist/experimental/webxr/webxr-manager.js +354 -0
  220. package/dist/experimental/webxr/webxr-manager.js.map +1 -0
  221. package/dist/experimental/webxr/webxr-types.cjs +15 -0
  222. package/dist/experimental/webxr/webxr-types.d.ts +152 -0
  223. package/dist/experimental/webxr/webxr-types.d.ts.map +1 -0
  224. package/dist/experimental/webxr/webxr-types.js +5 -0
  225. package/dist/experimental/webxr/webxr-types.js.map +1 -0
  226. package/dist/geometry/edge-geometry.cjs +171 -0
  227. package/dist/geometry/geometry-primitives.cjs +189 -0
  228. package/dist/geometry/geometry-primitives.d.ts +6 -0
  229. package/dist/geometry/geometry-primitives.d.ts.map +1 -1
  230. package/dist/geometry/geometry-primitives.js +8 -0
  231. package/dist/geometry/geometry-primitives.js.map +1 -1
  232. package/dist/geometry/geometry-table.cjs +15 -0
  233. package/dist/geometry/geometry-utils.cjs +147 -0
  234. package/dist/geometry/geometry.cjs +90 -0
  235. package/dist/geometry/gpu-geometry.cjs +130 -0
  236. package/dist/geometry/gpu-vector-geometry-adapter.cjs +88 -0
  237. package/dist/geometry/gpu-vector-geometry-adapter.d.ts +5 -0
  238. package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -0
  239. package/dist/geometry/gpu-vector-geometry-adapter.js +73 -0
  240. package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -0
  241. package/dist/geometry/gpu-vector-geometry.cjs +40 -0
  242. package/dist/geometry/gpu-vector-geometry.d.ts +21 -0
  243. package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -0
  244. package/dist/geometry/gpu-vector-geometry.js +19 -0
  245. package/dist/geometry/gpu-vector-geometry.js.map +1 -0
  246. package/dist/geometry/mesh-simplification.cjs +385 -0
  247. package/dist/geometry/ring-geometry.cjs +104 -0
  248. package/dist/geometry/ring-geometry.d.ts +17 -0
  249. package/dist/geometry/ring-geometry.d.ts.map +1 -0
  250. package/dist/geometry/ring-geometry.js +94 -0
  251. package/dist/geometry/ring-geometry.js.map +1 -0
  252. package/dist/geometry/stroke-geometry.cjs +171 -0
  253. package/dist/graph/models/index.cjs +66 -0
  254. package/dist/graph/models/index.cjs.map +6 -0
  255. package/dist/graph/models/index.d.ts +7 -0
  256. package/dist/graph/models/index.d.ts.map +1 -0
  257. package/dist/graph/models/index.js +10 -0
  258. package/dist/graph/models/index.js.map +1 -0
  259. package/dist/graph/models/path/path-attribute-model.cjs +421 -0
  260. package/dist/graph/models/path/path-attribute-model.d.ts +142 -0
  261. package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -0
  262. package/dist/graph/models/path/path-attribute-model.js +409 -0
  263. package/dist/graph/models/path/path-attribute-model.js.map +1 -0
  264. package/dist/graph/models/path/path-storage-model.cjs +711 -0
  265. package/dist/graph/models/path/path-storage-model.d.ts +174 -0
  266. package/dist/graph/models/path/path-storage-model.d.ts.map +1 -0
  267. package/dist/graph/models/path/path-storage-model.js +720 -0
  268. package/dist/graph/models/path/path-storage-model.js.map +1 -0
  269. package/dist/graph/models/path/path-trips-storage-model.cjs +271 -0
  270. package/dist/graph/models/path/path-trips-storage-model.d.ts +58 -0
  271. package/dist/graph/models/path/path-trips-storage-model.d.ts.map +1 -0
  272. package/dist/graph/models/path/path-trips-storage-model.js +248 -0
  273. package/dist/graph/models/path/path-trips-storage-model.js.map +1 -0
  274. package/dist/graph/models/polygon/polygon-attribute-model.cjs +117 -0
  275. package/dist/graph/models/polygon/polygon-attribute-model.d.ts +53 -0
  276. package/dist/graph/models/polygon/polygon-attribute-model.d.ts.map +1 -0
  277. package/dist/graph/models/polygon/polygon-attribute-model.js +101 -0
  278. package/dist/graph/models/polygon/polygon-attribute-model.js.map +1 -0
  279. package/dist/graph/models/polygon/polygon-shaders.cjs +283 -0
  280. package/dist/graph/models/polygon/polygon-shaders.d.ts +77 -0
  281. package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -0
  282. package/dist/graph/models/polygon/polygon-shaders.js +242 -0
  283. package/dist/graph/models/polygon/polygon-shaders.js.map +1 -0
  284. package/dist/graph/models/polygon/polygon-storage-model.cjs +111 -0
  285. package/dist/graph/models/polygon/polygon-storage-model.d.ts +53 -0
  286. package/dist/graph/models/polygon/polygon-storage-model.d.ts.map +1 -0
  287. package/dist/graph/models/polygon/polygon-storage-model.js +92 -0
  288. package/dist/graph/models/polygon/polygon-storage-model.js.map +1 -0
  289. package/dist/graph/physics/index.cjs +50 -0
  290. package/dist/graph/physics/index.cjs.map +6 -0
  291. package/dist/graph/physics/index.d.ts +12 -0
  292. package/dist/graph/physics/index.d.ts.map +1 -0
  293. package/dist/graph/physics/index.js +12 -0
  294. package/dist/graph/physics/index.js.map +1 -0
  295. package/dist/graph/physics/physics-scenegraph.cjs +92 -0
  296. package/dist/graph/physics/physics-scenegraph.d.ts +35 -0
  297. package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -0
  298. package/dist/graph/physics/physics-scenegraph.js +80 -0
  299. package/dist/graph/physics/physics-scenegraph.js.map +1 -0
  300. package/dist/graph/physics/scenegraph-behaviors.cjs +164 -0
  301. package/dist/graph/physics/scenegraph-behaviors.d.ts +37 -0
  302. package/dist/graph/physics/scenegraph-behaviors.d.ts.map +1 -0
  303. package/dist/graph/physics/scenegraph-behaviors.js +145 -0
  304. package/dist/graph/physics/scenegraph-behaviors.js.map +1 -0
  305. package/dist/graph/physics/scenegraph-instance.cjs +246 -0
  306. package/dist/graph/physics/scenegraph-instance.d.ts +59 -0
  307. package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -0
  308. package/dist/graph/physics/scenegraph-instance.js +241 -0
  309. package/dist/graph/physics/scenegraph-instance.js.map +1 -0
  310. package/dist/graph/physics/scenegraph-joints.cjs +51 -0
  311. package/dist/graph/physics/scenegraph-joints.d.ts +5 -0
  312. package/dist/graph/physics/scenegraph-joints.d.ts.map +1 -0
  313. package/dist/graph/physics/scenegraph-joints.js +31 -0
  314. package/dist/graph/physics/scenegraph-joints.js.map +1 -0
  315. package/dist/graph/physics/scenegraph-motion.cjs +177 -0
  316. package/dist/graph/physics/scenegraph-motion.d.ts +37 -0
  317. package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -0
  318. package/dist/graph/physics/scenegraph-motion.js +168 -0
  319. package/dist/graph/physics/scenegraph-motion.js.map +1 -0
  320. package/dist/graph/physics/scenegraph-properties.cjs +170 -0
  321. package/dist/graph/physics/scenegraph-properties.d.ts +37 -0
  322. package/dist/graph/physics/scenegraph-properties.d.ts.map +1 -0
  323. package/dist/graph/physics/scenegraph-properties.js +186 -0
  324. package/dist/graph/physics/scenegraph-properties.js.map +1 -0
  325. package/dist/graph/physics/scenegraph-publication.cjs +112 -0
  326. package/dist/graph/physics/scenegraph-publication.d.ts +23 -0
  327. package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -0
  328. package/dist/graph/physics/scenegraph-publication.js +99 -0
  329. package/dist/graph/physics/scenegraph-publication.js.map +1 -0
  330. package/dist/graph/physics/scenegraph-session.cjs +256 -0
  331. package/dist/graph/physics/scenegraph-session.d.ts +68 -0
  332. package/dist/graph/physics/scenegraph-session.d.ts.map +1 -0
  333. package/dist/graph/physics/scenegraph-session.js +249 -0
  334. package/dist/graph/physics/scenegraph-session.js.map +1 -0
  335. package/dist/graph/tables/gpu-table-geometry.cjs +84 -0
  336. package/dist/graph/tables/gpu-table-geometry.d.ts +32 -0
  337. package/dist/graph/tables/gpu-table-geometry.d.ts.map +1 -0
  338. package/dist/graph/tables/gpu-table-geometry.js +67 -0
  339. package/dist/graph/tables/gpu-table-geometry.js.map +1 -0
  340. package/dist/graph/tables/gpu-table-model.cjs +459 -0
  341. package/dist/graph/tables/gpu-table-model.d.ts +67 -0
  342. package/dist/graph/tables/gpu-table-model.d.ts.map +1 -0
  343. package/dist/graph/tables/gpu-table-model.js +457 -0
  344. package/dist/graph/tables/gpu-table-model.js.map +1 -0
  345. package/dist/graph/tables/gpu-table-transform.cjs +341 -0
  346. package/dist/graph/tables/gpu-table-transform.d.ts +61 -0
  347. package/dist/graph/tables/gpu-table-transform.d.ts.map +1 -0
  348. package/dist/graph/tables/gpu-table-transform.js +333 -0
  349. package/dist/graph/tables/gpu-table-transform.js.map +1 -0
  350. package/dist/graph/tables/index.cjs +33 -0
  351. package/dist/graph/tables/index.cjs.map +6 -0
  352. package/dist/graph/tables/index.d.ts +4 -0
  353. package/dist/graph/tables/index.d.ts.map +1 -0
  354. package/dist/graph/tables/index.js +7 -0
  355. package/dist/graph/tables/index.js.map +1 -0
  356. package/dist/index.cjs +303 -9569
  357. package/dist/index.cjs.map +3 -3
  358. package/dist/index.d.ts +32 -5
  359. package/dist/index.d.ts.map +1 -1
  360. package/dist/index.js +26 -3
  361. package/dist/index.js.map +1 -1
  362. package/dist/interactivity/interactivity.cjs +570 -0
  363. package/dist/interactivity/interactivity.d.ts +107 -0
  364. package/dist/interactivity/interactivity.d.ts.map +1 -0
  365. package/dist/interactivity/interactivity.js +575 -0
  366. package/dist/interactivity/interactivity.js.map +1 -0
  367. package/dist/interactivity/physics.cjs +15 -0
  368. package/dist/interactivity/physics.d.ts +12 -0
  369. package/dist/interactivity/physics.d.ts.map +1 -0
  370. package/dist/interactivity/physics.js +5 -0
  371. package/dist/interactivity/physics.js.map +1 -0
  372. package/dist/material/material-factory.cjs +99 -0
  373. package/dist/material/material-factory.d.ts +1 -1
  374. package/dist/material/material-factory.d.ts.map +1 -1
  375. package/dist/material/material.cjs +239 -0
  376. package/dist/material/material.d.ts +2 -2
  377. package/dist/material/material.d.ts.map +1 -1
  378. package/dist/material/material.js +2 -2
  379. package/dist/material/material.js.map +1 -1
  380. package/dist/model/gpu-vector-bindings.cjs +226 -0
  381. package/dist/model/gpu-vector-bindings.d.ts +36 -0
  382. package/dist/model/gpu-vector-bindings.d.ts.map +1 -0
  383. package/dist/model/gpu-vector-bindings.js +217 -0
  384. package/dist/model/gpu-vector-bindings.js.map +1 -0
  385. package/dist/model/gpu-vector-draw-batches.cjs +82 -0
  386. package/dist/model/gpu-vector-draw-batches.d.ts +5 -0
  387. package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -0
  388. package/dist/model/gpu-vector-draw-batches.js +73 -0
  389. package/dist/model/gpu-vector-draw-batches.js.map +1 -0
  390. package/dist/model/gpu-vector-model-batches.cjs +94 -0
  391. package/dist/model/gpu-vector-model-batches.d.ts +41 -0
  392. package/dist/model/gpu-vector-model-batches.d.ts.map +1 -0
  393. package/dist/model/gpu-vector-model-batches.js +77 -0
  394. package/dist/model/gpu-vector-model-batches.js.map +1 -0
  395. package/dist/model/gpu-vector-model.cjs +1264 -0
  396. package/dist/model/gpu-vector-model.d.ts +352 -0
  397. package/dist/model/gpu-vector-model.d.ts.map +1 -0
  398. package/dist/model/gpu-vector-model.js +1375 -0
  399. package/dist/model/gpu-vector-model.js.map +1 -0
  400. package/dist/model/model.cjs +134 -0
  401. package/dist/model/model.d.ts +21 -305
  402. package/dist/model/model.d.ts.map +1 -1
  403. package/dist/model/model.js +68 -1092
  404. package/dist/model/model.js.map +1 -1
  405. package/dist/model/split-uniforms-and-bindings.cjs +44 -0
  406. package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
  407. package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
  408. package/dist/model/split-uniforms-and-bindings.js +5 -2
  409. package/dist/model/split-uniforms-and-bindings.js.map +1 -1
  410. package/dist/models/billboard-texture-model.cjs +167 -0
  411. package/dist/models/billboard-texture-model.d.ts +1 -1
  412. package/dist/models/billboard-texture-model.d.ts.map +1 -1
  413. package/dist/models/billboard-texture-model.js +1 -1
  414. package/dist/models/billboard-texture-model.js.map +1 -1
  415. package/dist/models/billboard-texture-module.cjs +61 -0
  416. package/dist/models/clip-space.cjs +103 -0
  417. package/dist/models/directional-light-model.cjs +45 -0
  418. package/dist/models/light-model-utils.cjs +426 -0
  419. package/dist/models/point-light-model.cjs +44 -0
  420. package/dist/models/spot-light-model.cjs +45 -0
  421. package/dist/modules/picking/color-picking.cjs +209 -0
  422. package/dist/modules/picking/color-picking.d.ts +1 -1
  423. package/dist/modules/picking/index-color-picking.cjs +230 -0
  424. package/dist/modules/picking/index-color-picking.d.ts +1 -1
  425. package/dist/modules/picking/index-picking.cjs +201 -0
  426. package/dist/modules/picking/index-picking.d.ts +1 -1
  427. package/dist/modules/picking/legacy-color-picking.cjs +28 -0
  428. package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
  429. package/dist/modules/picking/legacy-picking-manager.cjs +92 -0
  430. package/dist/modules/picking/picking-manager.cjs +360 -0
  431. package/dist/modules/picking/picking-uniforms.cjs +140 -0
  432. package/dist/modules/picking/picking-uniforms.d.ts +1 -1
  433. package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
  434. package/dist/modules/picking/picking.cjs +43 -0
  435. package/dist/modules/picking/picking.d.ts +1 -1
  436. package/dist/passes/get-fragment-shader.cjs +119 -0
  437. package/dist/passes/shader-pass-renderer.cjs +722 -0
  438. package/dist/passes/shader-pass-renderer.d.ts +2 -2
  439. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  440. package/dist/passes/shader-pass-renderer.js +1 -1
  441. package/dist/passes/shader-pass-renderer.js.map +1 -1
  442. package/dist/passes/texture-transform-module.cjs +78 -0
  443. package/dist/scenegraph/controllers/area-light-controller.cjs +143 -0
  444. package/dist/scenegraph/controllers/area-light-controller.d.ts +31 -0
  445. package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -0
  446. package/dist/scenegraph/controllers/area-light-controller.js +130 -0
  447. package/dist/scenegraph/controllers/area-light-controller.js.map +1 -0
  448. package/dist/scenegraph/controllers/billboard-controller.cjs +156 -0
  449. package/dist/scenegraph/controllers/billboard-controller.d.ts +45 -0
  450. package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -0
  451. package/dist/scenegraph/controllers/billboard-controller.js +156 -0
  452. package/dist/scenegraph/controllers/billboard-controller.js.map +1 -0
  453. package/dist/scenegraph/controllers/joint-controller.cjs +71 -0
  454. package/dist/scenegraph/controllers/joint-controller.d.ts +30 -0
  455. package/dist/scenegraph/controllers/joint-controller.d.ts.map +1 -0
  456. package/dist/scenegraph/controllers/joint-controller.js +53 -0
  457. package/dist/scenegraph/controllers/joint-controller.js.map +1 -0
  458. package/dist/scenegraph/controllers/material-variants.cjs +61 -0
  459. package/dist/scenegraph/controllers/material-variants.d.ts +42 -0
  460. package/dist/scenegraph/controllers/material-variants.d.ts.map +1 -0
  461. package/dist/scenegraph/controllers/material-variants.js +40 -0
  462. package/dist/scenegraph/controllers/material-variants.js.map +1 -0
  463. package/dist/scenegraph/controllers/morph-controller.cjs +61 -0
  464. package/dist/scenegraph/controllers/morph-controller.d.ts +19 -0
  465. package/dist/scenegraph/controllers/morph-controller.d.ts.map +1 -0
  466. package/dist/scenegraph/controllers/morph-controller.js +41 -0
  467. package/dist/scenegraph/controllers/morph-controller.js.map +1 -0
  468. package/dist/scenegraph/controllers/skin-controller.cjs +111 -0
  469. package/dist/scenegraph/controllers/skin-controller.d.ts +36 -0
  470. package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -0
  471. package/dist/scenegraph/controllers/skin-controller.js +90 -0
  472. package/dist/scenegraph/controllers/skin-controller.js.map +1 -0
  473. package/dist/scenegraph/group-node.cjs +129 -0
  474. package/dist/scenegraph/model-node.cjs +68 -0
  475. package/dist/scenegraph/physics-transforms.cjs +95 -0
  476. package/dist/scenegraph/physics-transforms.d.ts +13 -0
  477. package/dist/scenegraph/physics-transforms.d.ts.map +1 -0
  478. package/dist/scenegraph/physics-transforms.js +72 -0
  479. package/dist/scenegraph/physics-transforms.js.map +1 -0
  480. package/dist/scenegraph/published-transforms.cjs +37 -0
  481. package/dist/scenegraph/published-transforms.d.ts +17 -0
  482. package/dist/scenegraph/published-transforms.d.ts.map +1 -0
  483. package/dist/scenegraph/published-transforms.js +16 -0
  484. package/dist/scenegraph/published-transforms.js.map +1 -0
  485. package/dist/scenegraph/scenegraph-bounds.cjs +51 -0
  486. package/dist/scenegraph/scenegraph-node.cjs +182 -0
  487. package/dist/shader-inputs.cjs +231 -0
  488. package/dist/shader-inputs.d.ts +1 -1
  489. package/dist/shader-inputs.d.ts.map +1 -1
  490. package/dist/utils/buffer-layout-helper.cjs +52 -0
  491. package/dist/utils/buffer-layout-order.cjs +37 -0
  492. package/dist/utils/deep-equal.cjs +65 -0
  493. package/dist/utils/get-platform-info.cjs +21 -0
  494. package/dist/utils/get-platform-info.d.ts +2 -0
  495. package/dist/utils/get-platform-info.d.ts.map +1 -0
  496. package/dist/utils/get-platform-info.js +5 -0
  497. package/dist/utils/get-platform-info.js.map +1 -0
  498. package/dist/utils/gpu-vector-batch-structure.cjs +45 -0
  499. package/dist/utils/gpu-vector-batch-structure.d.ts +12 -0
  500. package/dist/utils/gpu-vector-batch-structure.d.ts.map +1 -0
  501. package/dist/utils/gpu-vector-batch-structure.js +27 -0
  502. package/dist/utils/gpu-vector-batch-structure.js.map +1 -0
  503. package/dist/utils/shader-module-utils.cjs +148 -0
  504. package/dist/utils/uid.cjs +32 -0
  505. package/package.json +45 -7
  506. package/src/animation/deform-positions.ts +62 -0
  507. package/src/animation/node-animation-binding.ts +54 -0
  508. package/src/animation/property-animation-binding.ts +212 -0
  509. package/src/animation/scenegraph-animator.ts +117 -0
  510. package/src/animation/texture-transform.ts +59 -0
  511. package/src/animation-loop/animation-loop.ts +10 -3
  512. package/src/audio/audio-controller.ts +583 -0
  513. package/src/audio/audio-environment.ts +202 -0
  514. package/src/audio/audio-graph.ts +253 -0
  515. package/src/compute/buffer-transform.ts +71 -16
  516. package/src/compute/computation.ts +4 -19
  517. package/src/compute/texture-transform.ts +25 -12
  518. package/src/controls/orbit-controls.ts +4 -1
  519. package/src/dynamic-buffer/dynamic-buffer.ts +15 -449
  520. package/src/dynamic-texture/dynamic-texture.ts +5 -760
  521. package/src/dynamic-texture/texture-binding-source.ts +8 -90
  522. package/src/dynamic-texture/texture-data.ts +31 -340
  523. package/src/dynamic-texture/video-texture.ts +1 -1
  524. package/src/experimental/controls/comparison-splitter.ts +269 -0
  525. package/src/experimental/controls/flat-controller.ts +403 -0
  526. package/src/experimental/controls/index.ts +16 -0
  527. package/src/experimental/controls/orbit-controls.ts +6 -0
  528. package/src/experimental/materials/emissive-material.ts +120 -0
  529. package/src/experimental/materials/glass-material.ts +607 -0
  530. package/src/experimental/materials/glass-transmission.ts +1023 -0
  531. package/src/experimental/materials/index.ts +49 -0
  532. package/src/experimental/materials/optical-caustics.ts +234 -0
  533. package/src/experimental/materials/optical-lighting.ts +148 -0
  534. package/src/experimental/materials/optical-point-lights.ts +288 -0
  535. package/src/experimental/materials/reflective-material.ts +214 -0
  536. package/src/experimental/textures/html-texture.ts +285 -0
  537. package/src/experimental/textures/index.ts +8 -0
  538. package/src/experimental/textures/packed-pixels.ts +351 -0
  539. package/src/experimental/textures/rgba-decoder.ts +79 -0
  540. package/src/experimental/webxr/index.ts +21 -0
  541. package/src/experimental/webxr/webxr-animation-frame-provider.ts +22 -0
  542. package/src/experimental/webxr/webxr-camera-texture.ts +195 -0
  543. package/src/experimental/webxr/webxr-input.ts +117 -0
  544. package/src/experimental/webxr/webxr-manager.ts +524 -0
  545. package/src/experimental/webxr/webxr-types.ts +192 -0
  546. package/src/geometry/geometry-primitives.ts +11 -0
  547. package/src/geometry/gpu-vector-geometry-adapter.ts +78 -0
  548. package/src/geometry/gpu-vector-geometry.ts +33 -0
  549. package/src/geometry/ring-geometry.ts +117 -0
  550. package/src/graph/models/index.ts +45 -0
  551. package/src/graph/models/path/path-attribute-model.ts +563 -0
  552. package/src/graph/models/path/path-storage-model.ts +996 -0
  553. package/src/graph/models/path/path-trips-storage-model.ts +286 -0
  554. package/src/graph/models/polygon/polygon-attribute-model.ts +165 -0
  555. package/src/graph/models/polygon/polygon-shaders.ts +279 -0
  556. package/src/graph/models/polygon/polygon-storage-model.ts +146 -0
  557. package/src/graph/physics/index.ts +24 -0
  558. package/src/graph/physics/physics-scenegraph.ts +112 -0
  559. package/src/graph/physics/scenegraph-behaviors.ts +169 -0
  560. package/src/graph/physics/scenegraph-instance.ts +296 -0
  561. package/src/graph/physics/scenegraph-joints.ts +37 -0
  562. package/src/graph/physics/scenegraph-motion.ts +175 -0
  563. package/src/graph/physics/scenegraph-properties.ts +241 -0
  564. package/src/graph/physics/scenegraph-publication.ts +116 -0
  565. package/src/graph/physics/scenegraph-session.ts +317 -0
  566. package/src/graph/tables/gpu-table-geometry.ts +88 -0
  567. package/src/graph/tables/gpu-table-model.ts +661 -0
  568. package/src/graph/tables/gpu-table-transform.ts +497 -0
  569. package/src/graph/tables/index.ts +18 -0
  570. package/src/index.ts +130 -13
  571. package/src/interactivity/interactivity.ts +670 -0
  572. package/src/interactivity/physics.ts +19 -0
  573. package/src/material/material-factory.ts +1 -1
  574. package/src/material/material.ts +2 -2
  575. package/src/model/gpu-vector-bindings.ts +276 -0
  576. package/src/model/gpu-vector-draw-batches.ts +116 -0
  577. package/src/model/gpu-vector-model-batches.ts +142 -0
  578. package/src/model/gpu-vector-model.ts +1819 -0
  579. package/src/model/model.ts +91 -1444
  580. package/src/model/split-uniforms-and-bindings.ts +6 -3
  581. package/src/models/billboard-texture-model.ts +1 -1
  582. package/src/modules/picking/legacy-picking-manager.ts +1 -1
  583. package/src/modules/picking/picking-uniforms.ts +1 -1
  584. package/src/passes/shader-pass-renderer.ts +2 -2
  585. package/src/scenegraph/controllers/area-light-controller.ts +152 -0
  586. package/src/scenegraph/controllers/billboard-controller.ts +204 -0
  587. package/src/scenegraph/controllers/joint-controller.ts +81 -0
  588. package/src/scenegraph/controllers/material-variants.ts +70 -0
  589. package/src/scenegraph/controllers/morph-controller.ts +61 -0
  590. package/src/scenegraph/controllers/skin-controller.ts +125 -0
  591. package/src/scenegraph/physics-transforms.ts +82 -0
  592. package/src/scenegraph/published-transforms.ts +18 -0
  593. package/src/shader-inputs.ts +1 -1
  594. package/src/utils/get-platform-info.ts +5 -0
  595. package/src/utils/gpu-vector-batch-structure.ts +36 -0
  596. package/dist/compute/kernel.d.ts +0 -54
  597. package/dist/compute/kernel.d.ts.map +0 -1
  598. package/dist/compute/kernel.js +0 -103
  599. package/dist/compute/kernel.js.map +0 -1
  600. package/dist/compute/render-kernel.d.ts +0 -65
  601. package/dist/compute/render-kernel.d.ts.map +0 -1
  602. package/dist/compute/render-kernel.js +0 -129
  603. package/dist/compute/render-kernel.js.map +0 -1
  604. package/src/compute/kernel.ts +0 -146
  605. package/src/compute/render-kernel.ts +0 -192
@@ -0,0 +1,171 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var edge_geometry_exports = {};
19
+ __export(edge_geometry_exports, {
20
+ makeEdgeGeometry: () => makeEdgeGeometry,
21
+ makeEdgeGeometryFromGeometries: () => makeEdgeGeometryFromGeometries
22
+ });
23
+ module.exports = __toCommonJS(edge_geometry_exports);
24
+ var import_core = require("@luma.gl/core");
25
+ var import_geometry = require("./geometry.cjs");
26
+ function makeEdgeGeometry(geometry, options = {}) {
27
+ var _a;
28
+ const { angleThreshold = 30, weldTolerance = 0, positionAttribute = "POSITION" } = options;
29
+ const positions = getTrianglePositions(geometry, positionAttribute);
30
+ (0, import_core.assert)(Number.isFinite(weldTolerance) && weldTolerance >= 0);
31
+ (0, import_core.assert)(Number.isFinite(angleThreshold) && angleThreshold >= 0 && angleThreshold <= 180);
32
+ const sourceIndices = (_a = geometry.indices) == null ? void 0 : _a.value;
33
+ const sourceCount = positions.value.length / 3;
34
+ const representatives = /* @__PURE__ */ new Map();
35
+ const buckets = /* @__PURE__ */ new Map();
36
+ const faces = /* @__PURE__ */ new Set();
37
+ const edges = /* @__PURE__ */ new Map();
38
+ const cosineThreshold = Math.cos(angleThreshold * Math.PI / 180);
39
+ const toleranceSquared = weldTolerance * weldTolerance;
40
+ function readPosition(index) {
41
+ return [
42
+ positions.value[index * 3],
43
+ positions.value[index * 3 + 1],
44
+ positions.value[index * 3 + 2]
45
+ ];
46
+ }
47
+ function weldPosition(index) {
48
+ const cached = representatives.get(index);
49
+ if (cached !== void 0)
50
+ return cached;
51
+ (0, import_core.assert)(Number.isInteger(index) && index >= 0 && index < sourceCount);
52
+ const position = readPosition(index);
53
+ (0, import_core.assert)(position.every(Number.isFinite));
54
+ const cell = weldTolerance > 0 ? position.map((value) => Math.floor(value / weldTolerance)) : position;
55
+ const radius = weldTolerance > 0 ? 1 : 0;
56
+ for (let east = -radius; east <= radius; east++) {
57
+ for (let north = -radius; north <= radius; north++) {
58
+ for (let up = -radius; up <= radius; up++) {
59
+ const candidates = buckets.get(`${cell[0] + east},${cell[1] + north},${cell[2] + up}`);
60
+ for (const candidate of candidates || []) {
61
+ const other = readPosition(candidate);
62
+ const distanceSquared = (position[0] - other[0]) ** 2 + (position[1] - other[1]) ** 2 + (position[2] - other[2]) ** 2;
63
+ if (distanceSquared <= toleranceSquared) {
64
+ representatives.set(index, candidate);
65
+ return candidate;
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ const key = cell.join(",");
72
+ const bucket = buckets.get(key) || [];
73
+ bucket.push(index);
74
+ buckets.set(key, bucket);
75
+ representatives.set(index, index);
76
+ return index;
77
+ }
78
+ function addEdge(first, second, normal) {
79
+ const start = Math.min(first, second);
80
+ const end = Math.max(first, second);
81
+ const key = `${start},${end}`;
82
+ const edge = edges.get(key);
83
+ if (edge) {
84
+ edge.faceCount++;
85
+ const cosine = normal[0] * edge.normal[0] + normal[1] * edge.normal[1] + normal[2] * edge.normal[2];
86
+ edge.crease ||= cosine < 1 - 1e-7 && cosine <= cosineThreshold + 1e-7;
87
+ } else {
88
+ edges.set(key, { start, end, normal, faceCount: 1, crease: false });
89
+ }
90
+ }
91
+ for (let offset = 0; offset < geometry.vertexCount; offset += 3) {
92
+ const first = weldPosition((sourceIndices == null ? void 0 : sourceIndices[offset]) ?? offset);
93
+ const second = weldPosition((sourceIndices == null ? void 0 : sourceIndices[offset + 1]) ?? offset + 1);
94
+ const third = weldPosition((sourceIndices == null ? void 0 : sourceIndices[offset + 2]) ?? offset + 2);
95
+ if (first === second || second === third || third === first)
96
+ continue;
97
+ const faceKey = [first, second, third].sort((left, right) => left - right).join(",");
98
+ if (faces.has(faceKey))
99
+ continue;
100
+ faces.add(faceKey);
101
+ const start = readPosition(first);
102
+ const end = readPosition(second);
103
+ const corner = readPosition(third);
104
+ const firstDirection = end.map((value, axis) => value - start[axis]);
105
+ const secondDirection = corner.map((value, axis) => value - start[axis]);
106
+ const normal = [
107
+ firstDirection[1] * secondDirection[2] - firstDirection[2] * secondDirection[1],
108
+ firstDirection[2] * secondDirection[0] - firstDirection[0] * secondDirection[2],
109
+ firstDirection[0] * secondDirection[1] - firstDirection[1] * secondDirection[0]
110
+ ];
111
+ const magnitude = Math.hypot(...normal);
112
+ if (magnitude === 0)
113
+ continue;
114
+ normal[0] /= magnitude;
115
+ normal[1] /= magnitude;
116
+ normal[2] /= magnitude;
117
+ addEdge(first, second, normal);
118
+ addEdge(second, third, normal);
119
+ addEdge(third, first, normal);
120
+ }
121
+ const selected = [...edges.values()].filter((edge) => options.includeCoplanarEdges || edge.faceCount !== 2 || edge.crease).sort((left, right) => left.start - right.start || left.end - right.end);
122
+ return new import_geometry.Geometry({
123
+ id: `${geometry.id}-edges`,
124
+ topology: "line-list",
125
+ attributes: { [positionAttribute]: positions },
126
+ indices: new Uint32Array(selected.flatMap((edge) => [edge.start, edge.end]))
127
+ });
128
+ }
129
+ function makeEdgeGeometryFromGeometries(geometries, options = {}) {
130
+ var _a;
131
+ (0, import_core.assert)(geometries.length > 0);
132
+ const positionAttribute = options.positionAttribute ?? "POSITION";
133
+ const attributes = geometries.map((geometry) => getTrianglePositions(geometry, positionAttribute));
134
+ const firstAttribute = attributes[0];
135
+ (0, import_core.assert)(attributes.every((attribute) => attribute.value.constructor === firstAttribute.value.constructor && Boolean(attribute["normalized"]) === Boolean(firstAttribute["normalized"])));
136
+ const PositionArray = firstAttribute.value.constructor;
137
+ const positions = new PositionArray(attributes.reduce((count, attribute) => count + attribute.value.length, 0));
138
+ const indices = new Uint32Array(geometries.reduce((count, geometry) => count + geometry.vertexCount, 0));
139
+ let positionOffset = 0;
140
+ let indexOffset = 0;
141
+ for (const [geometryIndex, geometry] of geometries.entries()) {
142
+ const attribute = attributes[geometryIndex];
143
+ positions.set(attribute.value, positionOffset);
144
+ for (let offset = 0; offset < geometry.vertexCount; offset++) {
145
+ const index = ((_a = geometry.indices) == null ? void 0 : _a.value[offset]) ?? offset;
146
+ (0, import_core.assert)(Number.isInteger(index) && index >= 0 && index < attribute.value.length / 3);
147
+ indices[indexOffset++] = index + positionOffset / 3;
148
+ }
149
+ positionOffset += attribute.value.length;
150
+ }
151
+ return makeEdgeGeometry(new import_geometry.Geometry({
152
+ id: `${geometries[0].id}-batch`,
153
+ topology: "triangle-list",
154
+ attributes: { [positionAttribute]: { ...firstAttribute, value: positions } },
155
+ indices
156
+ }), options);
157
+ }
158
+ function getTrianglePositions(geometry, positionAttribute) {
159
+ var _a;
160
+ const positions = geometry.attributes[positionAttribute];
161
+ (0, import_core.assert)(geometry.topology === "triangle-list" && (positions == null ? void 0 : positions.size) === 3);
162
+ (0, import_core.assert)(positions.value.length % 3 === 0 && geometry.vertexCount % 3 === 0);
163
+ (0, import_core.assert)(!positions["byteStride"] || positions["byteStride"] === positions.value.BYTES_PER_ELEMENT * 3);
164
+ (0, import_core.assert)(geometry.vertexCount >= 0 && geometry.vertexCount <= (((_a = geometry.indices) == null ? void 0 : _a.value.length) ?? positions.value.length / 3));
165
+ return positions;
166
+ }
167
+ // Annotate the CommonJS export names for ESM import in node:
168
+ 0 && (module.exports = {
169
+ makeEdgeGeometry,
170
+ makeEdgeGeometryFromGeometries
171
+ });
@@ -0,0 +1,189 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var geometry_primitives_exports = {};
19
+ __export(geometry_primitives_exports, {
20
+ ConeGeometry: () => ConeGeometry,
21
+ CubeGeometry: () => CubeGeometry,
22
+ CylinderGeometry: () => CylinderGeometry,
23
+ IcoSphereGeometry: () => IcoSphereGeometry,
24
+ PlaneGeometry: () => PlaneGeometry,
25
+ SphereGeometry: () => SphereGeometry,
26
+ TorusGeometry: () => TorusGeometry,
27
+ TruncatedConeGeometry: () => TruncatedConeGeometry
28
+ });
29
+ module.exports = __toCommonJS(geometry_primitives_exports);
30
+ var import_geometry = require("@math.gl/geometry");
31
+ var import_geometry2 = require("@math.gl/geometry");
32
+ var import_geometry3 = require("./geometry.cjs");
33
+ class TorusGeometry extends import_geometry3.Geometry {
34
+ constructor(props = {}) {
35
+ const source = new import_geometry2.TorusGeometry(props);
36
+ super({ ...source, attributes: source.attributes });
37
+ }
38
+ }
39
+ class CubeGeometry extends import_geometry3.Geometry {
40
+ constructor(props = {}) {
41
+ const source = new import_geometry.CubeGeometry({ size: 2 });
42
+ const faceIndices = new Uint32Array(24);
43
+ const faceOrder = [4, 5, 2, 3, 0, 1];
44
+ for (let vertexIndex = 0; vertexIndex < faceIndices.length; vertexIndex++) {
45
+ faceIndices[vertexIndex] = faceOrder[Math.floor(vertexIndex / 4)];
46
+ }
47
+ source.attributes["faceIndex"] = { size: 1, value: faceIndices };
48
+ if (props.indices === false) {
49
+ source.attributes["COLOR_0"] = {
50
+ size: 3,
51
+ value: new Float32Array(Array.from(source.attributes["POSITION"].value, (value) => (value + 1) / 2))
52
+ };
53
+ }
54
+ const data = props.indices === false ? (0, import_geometry.unpackIndexedGeometry)(source) : source;
55
+ super({
56
+ id: props.id,
57
+ topology: source.topology,
58
+ indices: props.indices === false ? void 0 : source.indices,
59
+ attributes: mergeAttributes(data.attributes, props.attributes)
60
+ });
61
+ }
62
+ }
63
+ class SphereGeometry extends import_geometry3.Geometry {
64
+ constructor(props = {}) {
65
+ var _a;
66
+ const source = new import_geometry.SphereGeometry({
67
+ ...props,
68
+ attributes: void 0,
69
+ radius: props.radius ?? 1
70
+ });
71
+ for (const name of ["POSITION", "NORMAL"]) {
72
+ const values = source.attributes[name].value;
73
+ for (let index = 0; index < values.length; index += 3) {
74
+ const horizontal = values[index];
75
+ values[index] = values[index + 2];
76
+ values[index + 2] = horizontal;
77
+ }
78
+ }
79
+ const indices = (_a = source.indices) == null ? void 0 : _a.value;
80
+ if (indices) {
81
+ for (let index = 0; index < indices.length; index += 3) {
82
+ const second = indices[index + 1];
83
+ indices[index + 1] = indices[index + 2];
84
+ indices[index + 2] = second;
85
+ }
86
+ }
87
+ super({ ...source, attributes: { ...source.attributes, ...props.attributes } });
88
+ }
89
+ }
90
+ class IcoSphereGeometry extends import_geometry3.Geometry {
91
+ constructor(props = {}) {
92
+ const source = new import_geometry.IcoSphereGeometry({ ...props, radius: props.radius ?? 1 });
93
+ super({ ...source, attributes: source.attributes });
94
+ }
95
+ }
96
+ class TruncatedConeGeometry extends import_geometry3.Geometry {
97
+ constructor(props = {}) {
98
+ const source = new import_geometry.TruncatedConeGeometry({ ...props, bottomRadius: props.bottomRadius ?? 1 });
99
+ super({ ...source, attributes: source.attributes });
100
+ }
101
+ }
102
+ class CylinderGeometry extends TruncatedConeGeometry {
103
+ constructor(props = {}) {
104
+ const radius = props.radius ?? 1;
105
+ super({ ...props, topRadius: radius, bottomRadius: radius });
106
+ }
107
+ }
108
+ class ConeGeometry extends TruncatedConeGeometry {
109
+ constructor(props = {}) {
110
+ const cap = props.cap ?? true;
111
+ super({ ...props, topRadius: 0, bottomRadius: props.radius ?? 1, topCap: cap, bottomCap: cap });
112
+ }
113
+ }
114
+ class PlaneGeometry extends import_geometry3.Geometry {
115
+ constructor(props = {}) {
116
+ const { type = "x,y", offset = 0, flipCull = false } = props;
117
+ const planeAxes = {
118
+ "x,y": { sizeX: props.xlen, sizeZ: props.ylen, nx: props.nx, nz: props.ny },
119
+ "x,z": { sizeX: props.xlen, sizeZ: props.zlen, nx: props.nx, nz: props.nz },
120
+ "y,z": { sizeX: props.ylen, sizeZ: props.zlen, nx: props.ny, nz: props.nz }
121
+ }[type];
122
+ if (!planeAxes)
123
+ throw new Error("Invalid plane axes");
124
+ const source = new import_geometry.PlaneGeometry({
125
+ sizeX: planeAxes.sizeX || 1,
126
+ sizeZ: planeAxes.sizeZ || 1,
127
+ nx: planeAxes.nx || 1,
128
+ nz: planeAxes.nz || 1
129
+ });
130
+ orientPlane(source, type, offset, flipCull);
131
+ const data = props.unpack ? (0, import_geometry.unpackIndexedGeometry)(source) : source;
132
+ super({
133
+ id: props.id,
134
+ topology: source.topology,
135
+ indices: props.unpack ? void 0 : source.indices,
136
+ attributes: mergeAttributes(data.attributes, props.attributes)
137
+ });
138
+ }
139
+ }
140
+ function orientPlane(geometry, type, offset, flipCull) {
141
+ const positions = geometry.attributes["POSITION"].value;
142
+ const normals = geometry.attributes["NORMAL"].value;
143
+ const texCoords = geometry.attributes["TEXCOORD_0"].value;
144
+ for (let vertexIndex = 0; vertexIndex < positions.length / 3; vertexIndex++) {
145
+ const positionIndex = vertexIndex * 3;
146
+ const horizontal = Number(positions[positionIndex]) * (flipCull ? -1 : 1);
147
+ const vertical = -Number(positions[positionIndex + 2]);
148
+ const normal = flipCull ? 1 : -1;
149
+ if (type === "x,y") {
150
+ positions.set([horizontal, vertical, offset], positionIndex);
151
+ normals.set([0, 0, normal], positionIndex);
152
+ } else if (type === "x,z") {
153
+ positions.set([horizontal, offset, vertical], positionIndex);
154
+ normals.set([0, normal, 0], positionIndex);
155
+ } else {
156
+ positions.set([offset, horizontal, vertical], positionIndex);
157
+ normals.set([normal, 0, 0], positionIndex);
158
+ }
159
+ if (flipCull)
160
+ texCoords[vertexIndex * 2] = 1 - Number(texCoords[vertexIndex * 2]);
161
+ }
162
+ if (type !== "x,z" && geometry.indices) {
163
+ const indices = geometry.indices.value;
164
+ for (let index = 0; index < indices.length; index += 3) {
165
+ const second = indices[index + 1];
166
+ indices[index + 1] = indices[index + 2];
167
+ indices[index + 2] = second;
168
+ }
169
+ }
170
+ }
171
+ function mergeAttributes(source, overrides = {}) {
172
+ const attributes = {};
173
+ for (const [name, attribute] of Object.entries(source)) {
174
+ if (attribute)
175
+ attributes[name] = attribute;
176
+ }
177
+ return { ...attributes, ...overrides };
178
+ }
179
+ // Annotate the CommonJS export names for ESM import in node:
180
+ 0 && (module.exports = {
181
+ ConeGeometry,
182
+ CubeGeometry,
183
+ CylinderGeometry,
184
+ IcoSphereGeometry,
185
+ PlaneGeometry,
186
+ SphereGeometry,
187
+ TorusGeometry,
188
+ TruncatedConeGeometry
189
+ });
@@ -1,5 +1,11 @@
1
1
  import { type GeometryAttributeInput, type SphereGeometryProps, type IcoSphereGeometryProps, type TruncatedConeGeometryProps } from '@math.gl/geometry';
2
+ import { type TorusGeometryProps } from '@math.gl/geometry';
2
3
  import { Geometry } from "./geometry.js";
4
+ export type { TorusGeometryProps };
5
+ /** Shared math.gl tessellation, including open partial sweeps around the Y axis. */
6
+ export declare class TorusGeometry extends Geometry {
7
+ constructor(props?: TorusGeometryProps);
8
+ }
3
9
  export type { SphereGeometryProps, IcoSphereGeometryProps, TruncatedConeGeometryProps };
4
10
  export type CubeGeometryProps = {
5
11
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-primitives.d.ts","sourceRoot":"","sources":["../../src/geometry/geometry-primitives.ts"],"names":[],"mappings":"AAIA,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,QAAQ,EAAC,sBAAmB;AAEpC,YAAY,EAAC,mBAAmB,EAAE,sBAAsB,EAAE,0BAA0B,EAAC,CAAC;AAEtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CACrD,CAAC;AAEF,iFAAiF;AACjF,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,KAAK,GAAE,iBAAsB;C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CAAC;AAEF,qBAAa,gBAAiB,SAAQ,qBAAqB;gBAC7C,KAAK,GAAE,qBAA0B;CAI9C;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,0BAA0B,EAC1B,WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,WAAW,CACtD,GAAG;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAC,CAAC;AAErC,qBAAa,YAAa,SAAQ,qBAAqB;gBACzC,KAAK,GAAE,iBAAsB;CAI1C;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iEAAiE;AACjE,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,KAAK,GAAE,kBAAuB;CAwB3C"}
@@ -2,7 +2,15 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  import { CubeGeometry as MathCubeGeometry, SphereGeometry as MathSphereGeometry, IcoSphereGeometry as MathIcoSphereGeometry, PlaneGeometry as MathPlaneGeometry, TruncatedConeGeometry as MathTruncatedConeGeometry, unpackIndexedGeometry } from '@math.gl/geometry';
5
+ import { TorusGeometry as MathTorusGeometry } from '@math.gl/geometry';
5
6
  import { Geometry } from "./geometry.js";
7
+ /** Shared math.gl tessellation, including open partial sweeps around the Y axis. */
8
+ export class TorusGeometry extends Geometry {
9
+ constructor(props = {}) {
10
+ const source = new MathTorusGeometry(props);
11
+ super({ ...source, attributes: source.attributes });
12
+ }
13
+ }
6
14
  /** Compatibility defaults and face metadata over the math.gl box tessellator. */
7
15
  export class CubeGeometry extends Geometry {
8
16
  constructor(props = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-primitives.js","sourceRoot":"","sources":["../../src/geometry/geometry-primitives.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,YAAY,IAAI,gBAAgB,EAChC,cAAc,IAAI,kBAAkB,EACpC,iBAAiB,IAAI,qBAAqB,EAC1C,aAAa,IAAI,iBAAiB,EAClC,qBAAqB,IAAI,yBAAyB,EAClD,qBAAqB,EAMtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,QAAQ,EAAC,sBAAmB;AAUpC,iFAAiF;AACjF,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,YAAY,QAA2B,EAAE;QACvC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QACxC,gEAAgE;QAChE,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrC,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC;YAC1E,WAAW,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,W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AAC;IAC9D,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,IAAI,SAAS;YAAE,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,CAAC;IACD,OAAO,EAAC,GAAG,UAAU,EAAE,GAAG,SAAS,EAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,15 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var geometry_table_exports = {};
15
+ module.exports = __toCommonJS(geometry_table_exports);
@@ -0,0 +1,147 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var geometry_utils_exports = {};
19
+ __export(geometry_utils_exports, {
20
+ makeInterleavedGeometry: () => makeInterleavedGeometry,
21
+ unpackIndexedGeometry: () => import_geometry.unpackIndexedGeometry
22
+ });
23
+ module.exports = __toCommonJS(geometry_utils_exports);
24
+ var import_core = require("@luma.gl/core");
25
+ var import_geometry = require("@math.gl/geometry");
26
+ var import_geometry2 = require("./geometry.cjs");
27
+ function makeInterleavedGeometry(geometry, options = {}) {
28
+ const bufferName = options.bufferName || "geometry";
29
+ if (isInterleavedGeometry(geometry, bufferName)) {
30
+ return geometry;
31
+ }
32
+ const minAttributeAlignment = options.minAttributeAlignment || 4;
33
+ const sourceAttributes = getInterleavedSourceAttributes(geometry, options.attributes);
34
+ const interleavedAttributes = [];
35
+ let byteOffset = 0;
36
+ let attributeVertexCount = Infinity;
37
+ for (const [sourceName, attribute] of sourceAttributes) {
38
+ if (!attribute) {
39
+ continue;
40
+ }
41
+ if (attribute["constant"]) {
42
+ throw new Error(`Attribute ${sourceName} is constant`);
43
+ }
44
+ const { value, size, normalized } = attribute;
45
+ if (!ArrayBuffer.isView(value)) {
46
+ throw new Error(`Attribute ${sourceName} is missing typed array data`);
47
+ }
48
+ if (size === void 0) {
49
+ throw new Error(`Attribute ${sourceName} is missing a size`);
50
+ }
51
+ const format = import_core.vertexFormatDecoder.getVertexFormatFromAttribute(value, size, normalized);
52
+ const vertexFormatInfo = import_core.vertexFormatDecoder.getVertexFormatInfo(format);
53
+ byteOffset = alignTo(byteOffset, minAttributeAlignment);
54
+ interleavedAttributes.push({
55
+ sourceName,
56
+ attributeName: (0, import_geometry2.getGeometryShaderAttributeName)(sourceName),
57
+ value,
58
+ size,
59
+ format,
60
+ byteOffset,
61
+ byteLength: vertexFormatInfo.byteLength
62
+ });
63
+ byteOffset += vertexFormatInfo.byteLength;
64
+ const sourceVertexCount = value.length / size;
65
+ if (!Number.isInteger(sourceVertexCount)) {
66
+ throw new Error(`Attribute ${sourceName} length is not divisible by size`);
67
+ }
68
+ attributeVertexCount = Math.min(attributeVertexCount, sourceVertexCount);
69
+ }
70
+ if (interleavedAttributes.length === 0 || !Number.isFinite(attributeVertexCount)) {
71
+ throw new Error(`Geometry ${geometry.id} has no interleavable attributes`);
72
+ }
73
+ const byteStride = alignTo(byteOffset, minAttributeAlignment);
74
+ const arrayBuffer = new ArrayBuffer(attributeVertexCount * byteStride);
75
+ for (const attribute of interleavedAttributes) {
76
+ writeInterleavedAttribute(arrayBuffer, attributeVertexCount, byteStride, attribute);
77
+ }
78
+ return new import_geometry2.Geometry({
79
+ id: geometry.id,
80
+ topology: geometry.topology || "triangle-list",
81
+ vertexCount: geometry.vertexCount,
82
+ indices: geometry.indices,
83
+ attributes: {
84
+ [bufferName]: {
85
+ value: new Uint8Array(arrayBuffer),
86
+ size: byteStride,
87
+ byteStride
88
+ }
89
+ },
90
+ bufferLayout: [
91
+ {
92
+ name: bufferName,
93
+ stepMode: "vertex",
94
+ byteStride,
95
+ attributes: interleavedAttributes.map((attribute) => ({
96
+ attribute: attribute.attributeName,
97
+ format: attribute.format,
98
+ byteOffset: attribute.byteOffset
99
+ }))
100
+ }
101
+ ]
102
+ });
103
+ }
104
+ function isInterleavedGeometry(geometry, bufferName) {
105
+ var _a, _b;
106
+ if (((_a = geometry.bufferLayout) == null ? void 0 : _a.length) !== 1) {
107
+ return false;
108
+ }
109
+ const bufferLayout = geometry.bufferLayout[0];
110
+ return bufferLayout.name === bufferName && Boolean((_b = bufferLayout.attributes) == null ? void 0 : _b.length) && Boolean(geometry.attributes[bufferName]);
111
+ }
112
+ function getInterleavedSourceAttributes(geometry, attributeNames) {
113
+ const attributes = /* @__PURE__ */ new Map();
114
+ const sourceNames = attributeNames || Object.keys(geometry.attributes);
115
+ for (const name of sourceNames) {
116
+ const attribute = geometry.attributes[name];
117
+ if (attribute)
118
+ attributes.set((0, import_geometry2.getGeometryShaderAttributeName)(name), [name, attribute]);
119
+ }
120
+ return Array.from(attributes.values());
121
+ }
122
+ function writeInterleavedAttribute(arrayBuffer, vertexCount, byteStride, attribute) {
123
+ const ArrayType = attribute.value.constructor;
124
+ const bytesPerElement = ArrayType.BYTES_PER_ELEMENT;
125
+ if (attribute.byteOffset % bytesPerElement !== 0 || byteStride % bytesPerElement !== 0) {
126
+ throw new Error(`Attribute ${attribute.sourceName} is not aligned to its component type`);
127
+ }
128
+ const target = new ArrayType(arrayBuffer);
129
+ const source = attribute.value;
130
+ const elementOffset = attribute.byteOffset / bytesPerElement;
131
+ const elementStride = byteStride / bytesPerElement;
132
+ for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
133
+ const sourceIndex = vertexIndex * attribute.size;
134
+ const targetIndex = vertexIndex * elementStride + elementOffset;
135
+ for (let componentIndex = 0; componentIndex < attribute.size; componentIndex++) {
136
+ target[targetIndex + componentIndex] = source[sourceIndex + componentIndex];
137
+ }
138
+ }
139
+ }
140
+ function alignTo(byteOffset, alignment) {
141
+ return Math.ceil(byteOffset / alignment) * alignment;
142
+ }
143
+ // Annotate the CommonJS export names for ESM import in node:
144
+ 0 && (module.exports = {
145
+ makeInterleavedGeometry,
146
+ unpackIndexedGeometry
147
+ });