@luma.gl/engine 10.0.0-alpha.3 → 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 (673) 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 +11517 -6015
  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/edge-geometry.d.ts +3 -2
  228. package/dist/geometry/edge-geometry.d.ts.map +1 -1
  229. package/dist/geometry/edge-geometry.js.map +1 -1
  230. package/dist/geometry/geometry-primitives.cjs +189 -0
  231. package/dist/geometry/geometry-primitives.d.ts +60 -0
  232. package/dist/geometry/geometry-primitives.d.ts.map +1 -0
  233. package/dist/geometry/geometry-primitives.js +161 -0
  234. package/dist/geometry/geometry-primitives.js.map +1 -0
  235. package/dist/geometry/geometry-table.cjs +15 -0
  236. package/dist/geometry/geometry-utils.cjs +147 -0
  237. package/dist/geometry/geometry-utils.d.ts +7 -15
  238. package/dist/geometry/geometry-utils.d.ts.map +1 -1
  239. package/dist/geometry/geometry-utils.js +9 -55
  240. package/dist/geometry/geometry-utils.js.map +1 -1
  241. package/dist/geometry/geometry.cjs +90 -0
  242. package/dist/geometry/geometry.d.ts +9 -69
  243. package/dist/geometry/geometry.d.ts.map +1 -1
  244. package/dist/geometry/geometry.js +27 -93
  245. package/dist/geometry/geometry.js.map +1 -1
  246. package/dist/geometry/gpu-geometry.cjs +130 -0
  247. package/dist/geometry/gpu-geometry.d.ts +4 -2
  248. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  249. package/dist/geometry/gpu-geometry.js +3 -3
  250. package/dist/geometry/gpu-geometry.js.map +1 -1
  251. package/dist/geometry/gpu-vector-geometry-adapter.cjs +88 -0
  252. package/dist/geometry/gpu-vector-geometry-adapter.d.ts +5 -0
  253. package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -0
  254. package/dist/geometry/gpu-vector-geometry-adapter.js +73 -0
  255. package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -0
  256. package/dist/geometry/gpu-vector-geometry.cjs +40 -0
  257. package/dist/geometry/gpu-vector-geometry.d.ts +21 -0
  258. package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -0
  259. package/dist/geometry/gpu-vector-geometry.js +19 -0
  260. package/dist/geometry/gpu-vector-geometry.js.map +1 -0
  261. package/dist/geometry/mesh-simplification.cjs +385 -0
  262. package/dist/geometry/ring-geometry.cjs +104 -0
  263. package/dist/geometry/ring-geometry.d.ts +17 -0
  264. package/dist/geometry/ring-geometry.d.ts.map +1 -0
  265. package/dist/geometry/ring-geometry.js +94 -0
  266. package/dist/geometry/ring-geometry.js.map +1 -0
  267. package/dist/geometry/stroke-geometry.cjs +171 -0
  268. package/dist/graph/models/index.cjs +66 -0
  269. package/dist/graph/models/index.cjs.map +6 -0
  270. package/dist/graph/models/index.d.ts +7 -0
  271. package/dist/graph/models/index.d.ts.map +1 -0
  272. package/dist/graph/models/index.js +10 -0
  273. package/dist/graph/models/index.js.map +1 -0
  274. package/dist/graph/models/path/path-attribute-model.cjs +421 -0
  275. package/dist/graph/models/path/path-attribute-model.d.ts +142 -0
  276. package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -0
  277. package/dist/graph/models/path/path-attribute-model.js +409 -0
  278. package/dist/graph/models/path/path-attribute-model.js.map +1 -0
  279. package/dist/graph/models/path/path-storage-model.cjs +711 -0
  280. package/dist/graph/models/path/path-storage-model.d.ts +174 -0
  281. package/dist/graph/models/path/path-storage-model.d.ts.map +1 -0
  282. package/dist/graph/models/path/path-storage-model.js +720 -0
  283. package/dist/graph/models/path/path-storage-model.js.map +1 -0
  284. package/dist/graph/models/path/path-trips-storage-model.cjs +271 -0
  285. package/dist/graph/models/path/path-trips-storage-model.d.ts +58 -0
  286. package/dist/graph/models/path/path-trips-storage-model.d.ts.map +1 -0
  287. package/dist/graph/models/path/path-trips-storage-model.js +248 -0
  288. package/dist/graph/models/path/path-trips-storage-model.js.map +1 -0
  289. package/dist/graph/models/polygon/polygon-attribute-model.cjs +117 -0
  290. package/dist/graph/models/polygon/polygon-attribute-model.d.ts +53 -0
  291. package/dist/graph/models/polygon/polygon-attribute-model.d.ts.map +1 -0
  292. package/dist/graph/models/polygon/polygon-attribute-model.js +101 -0
  293. package/dist/graph/models/polygon/polygon-attribute-model.js.map +1 -0
  294. package/dist/graph/models/polygon/polygon-shaders.cjs +283 -0
  295. package/dist/graph/models/polygon/polygon-shaders.d.ts +77 -0
  296. package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -0
  297. package/dist/graph/models/polygon/polygon-shaders.js +242 -0
  298. package/dist/graph/models/polygon/polygon-shaders.js.map +1 -0
  299. package/dist/graph/models/polygon/polygon-storage-model.cjs +111 -0
  300. package/dist/graph/models/polygon/polygon-storage-model.d.ts +53 -0
  301. package/dist/graph/models/polygon/polygon-storage-model.d.ts.map +1 -0
  302. package/dist/graph/models/polygon/polygon-storage-model.js +92 -0
  303. package/dist/graph/models/polygon/polygon-storage-model.js.map +1 -0
  304. package/dist/graph/physics/index.cjs +50 -0
  305. package/dist/graph/physics/index.cjs.map +6 -0
  306. package/dist/graph/physics/index.d.ts +12 -0
  307. package/dist/graph/physics/index.d.ts.map +1 -0
  308. package/dist/graph/physics/index.js +12 -0
  309. package/dist/graph/physics/index.js.map +1 -0
  310. package/dist/graph/physics/physics-scenegraph.cjs +92 -0
  311. package/dist/graph/physics/physics-scenegraph.d.ts +35 -0
  312. package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -0
  313. package/dist/graph/physics/physics-scenegraph.js +80 -0
  314. package/dist/graph/physics/physics-scenegraph.js.map +1 -0
  315. package/dist/graph/physics/scenegraph-behaviors.cjs +164 -0
  316. package/dist/graph/physics/scenegraph-behaviors.d.ts +37 -0
  317. package/dist/graph/physics/scenegraph-behaviors.d.ts.map +1 -0
  318. package/dist/graph/physics/scenegraph-behaviors.js +145 -0
  319. package/dist/graph/physics/scenegraph-behaviors.js.map +1 -0
  320. package/dist/graph/physics/scenegraph-instance.cjs +246 -0
  321. package/dist/graph/physics/scenegraph-instance.d.ts +59 -0
  322. package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -0
  323. package/dist/graph/physics/scenegraph-instance.js +241 -0
  324. package/dist/graph/physics/scenegraph-instance.js.map +1 -0
  325. package/dist/graph/physics/scenegraph-joints.cjs +51 -0
  326. package/dist/graph/physics/scenegraph-joints.d.ts +5 -0
  327. package/dist/graph/physics/scenegraph-joints.d.ts.map +1 -0
  328. package/dist/graph/physics/scenegraph-joints.js +31 -0
  329. package/dist/graph/physics/scenegraph-joints.js.map +1 -0
  330. package/dist/graph/physics/scenegraph-motion.cjs +177 -0
  331. package/dist/graph/physics/scenegraph-motion.d.ts +37 -0
  332. package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -0
  333. package/dist/graph/physics/scenegraph-motion.js +168 -0
  334. package/dist/graph/physics/scenegraph-motion.js.map +1 -0
  335. package/dist/graph/physics/scenegraph-properties.cjs +170 -0
  336. package/dist/graph/physics/scenegraph-properties.d.ts +37 -0
  337. package/dist/graph/physics/scenegraph-properties.d.ts.map +1 -0
  338. package/dist/graph/physics/scenegraph-properties.js +186 -0
  339. package/dist/graph/physics/scenegraph-properties.js.map +1 -0
  340. package/dist/graph/physics/scenegraph-publication.cjs +112 -0
  341. package/dist/graph/physics/scenegraph-publication.d.ts +23 -0
  342. package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -0
  343. package/dist/graph/physics/scenegraph-publication.js +99 -0
  344. package/dist/graph/physics/scenegraph-publication.js.map +1 -0
  345. package/dist/graph/physics/scenegraph-session.cjs +256 -0
  346. package/dist/graph/physics/scenegraph-session.d.ts +68 -0
  347. package/dist/graph/physics/scenegraph-session.d.ts.map +1 -0
  348. package/dist/graph/physics/scenegraph-session.js +249 -0
  349. package/dist/graph/physics/scenegraph-session.js.map +1 -0
  350. package/dist/graph/tables/gpu-table-geometry.cjs +84 -0
  351. package/dist/graph/tables/gpu-table-geometry.d.ts +32 -0
  352. package/dist/graph/tables/gpu-table-geometry.d.ts.map +1 -0
  353. package/dist/graph/tables/gpu-table-geometry.js +67 -0
  354. package/dist/graph/tables/gpu-table-geometry.js.map +1 -0
  355. package/dist/graph/tables/gpu-table-model.cjs +459 -0
  356. package/dist/graph/tables/gpu-table-model.d.ts +67 -0
  357. package/dist/graph/tables/gpu-table-model.d.ts.map +1 -0
  358. package/dist/graph/tables/gpu-table-model.js +457 -0
  359. package/dist/graph/tables/gpu-table-model.js.map +1 -0
  360. package/dist/graph/tables/gpu-table-transform.cjs +341 -0
  361. package/dist/graph/tables/gpu-table-transform.d.ts +61 -0
  362. package/dist/graph/tables/gpu-table-transform.d.ts.map +1 -0
  363. package/dist/graph/tables/gpu-table-transform.js +333 -0
  364. package/dist/graph/tables/gpu-table-transform.js.map +1 -0
  365. package/dist/graph/tables/index.cjs +33 -0
  366. package/dist/graph/tables/index.cjs.map +6 -0
  367. package/dist/graph/tables/index.d.ts +4 -0
  368. package/dist/graph/tables/index.d.ts.map +1 -0
  369. package/dist/graph/tables/index.js +7 -0
  370. package/dist/graph/tables/index.js.map +1 -0
  371. package/dist/index.cjs +303 -10629
  372. package/dist/index.cjs.map +3 -3
  373. package/dist/index.d.ts +46 -19
  374. package/dist/index.d.ts.map +1 -1
  375. package/dist/index.js +33 -10
  376. package/dist/index.js.map +1 -1
  377. package/dist/interactivity/interactivity.cjs +570 -0
  378. package/dist/interactivity/interactivity.d.ts +107 -0
  379. package/dist/interactivity/interactivity.d.ts.map +1 -0
  380. package/dist/interactivity/interactivity.js +575 -0
  381. package/dist/interactivity/interactivity.js.map +1 -0
  382. package/dist/interactivity/physics.cjs +15 -0
  383. package/dist/interactivity/physics.d.ts +12 -0
  384. package/dist/interactivity/physics.d.ts.map +1 -0
  385. package/dist/interactivity/physics.js +5 -0
  386. package/dist/interactivity/physics.js.map +1 -0
  387. package/dist/material/material-factory.cjs +99 -0
  388. package/dist/material/material-factory.d.ts +1 -1
  389. package/dist/material/material-factory.d.ts.map +1 -1
  390. package/dist/material/material.cjs +239 -0
  391. package/dist/material/material.d.ts +2 -2
  392. package/dist/material/material.d.ts.map +1 -1
  393. package/dist/material/material.js +2 -2
  394. package/dist/material/material.js.map +1 -1
  395. package/dist/model/gpu-vector-bindings.cjs +226 -0
  396. package/dist/model/gpu-vector-bindings.d.ts +36 -0
  397. package/dist/model/gpu-vector-bindings.d.ts.map +1 -0
  398. package/dist/model/gpu-vector-bindings.js +217 -0
  399. package/dist/model/gpu-vector-bindings.js.map +1 -0
  400. package/dist/model/gpu-vector-draw-batches.cjs +82 -0
  401. package/dist/model/gpu-vector-draw-batches.d.ts +5 -0
  402. package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -0
  403. package/dist/model/gpu-vector-draw-batches.js +73 -0
  404. package/dist/model/gpu-vector-draw-batches.js.map +1 -0
  405. package/dist/model/gpu-vector-model-batches.cjs +94 -0
  406. package/dist/model/gpu-vector-model-batches.d.ts +41 -0
  407. package/dist/model/gpu-vector-model-batches.d.ts.map +1 -0
  408. package/dist/model/gpu-vector-model-batches.js +77 -0
  409. package/dist/model/gpu-vector-model-batches.js.map +1 -0
  410. package/dist/model/gpu-vector-model.cjs +1264 -0
  411. package/dist/model/gpu-vector-model.d.ts +352 -0
  412. package/dist/model/gpu-vector-model.d.ts.map +1 -0
  413. package/dist/model/gpu-vector-model.js +1375 -0
  414. package/dist/model/gpu-vector-model.js.map +1 -0
  415. package/dist/model/model.cjs +134 -0
  416. package/dist/model/model.d.ts +22 -306
  417. package/dist/model/model.d.ts.map +1 -1
  418. package/dist/model/model.js +68 -1092
  419. package/dist/model/model.js.map +1 -1
  420. package/dist/model/split-uniforms-and-bindings.cjs +44 -0
  421. package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
  422. package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
  423. package/dist/model/split-uniforms-and-bindings.js +5 -2
  424. package/dist/model/split-uniforms-and-bindings.js.map +1 -1
  425. package/dist/models/billboard-texture-model.cjs +167 -0
  426. package/dist/models/billboard-texture-model.d.ts +1 -1
  427. package/dist/models/billboard-texture-model.d.ts.map +1 -1
  428. package/dist/models/billboard-texture-model.js +1 -1
  429. package/dist/models/billboard-texture-model.js.map +1 -1
  430. package/dist/models/billboard-texture-module.cjs +61 -0
  431. package/dist/models/clip-space.cjs +103 -0
  432. package/dist/models/clip-space.d.ts +4 -1
  433. package/dist/models/clip-space.d.ts.map +1 -1
  434. package/dist/models/clip-space.js +16 -13
  435. package/dist/models/clip-space.js.map +1 -1
  436. package/dist/models/directional-light-model.cjs +45 -0
  437. package/dist/models/directional-light-model.js +1 -1
  438. package/dist/models/directional-light-model.js.map +1 -1
  439. package/dist/models/light-model-utils.cjs +426 -0
  440. package/dist/models/point-light-model.cjs +44 -0
  441. package/dist/models/point-light-model.js +1 -1
  442. package/dist/models/point-light-model.js.map +1 -1
  443. package/dist/models/spot-light-model.cjs +45 -0
  444. package/dist/models/spot-light-model.js +1 -1
  445. package/dist/models/spot-light-model.js.map +1 -1
  446. package/dist/modules/picking/color-picking.cjs +209 -0
  447. package/dist/modules/picking/color-picking.d.ts +1 -1
  448. package/dist/modules/picking/index-color-picking.cjs +230 -0
  449. package/dist/modules/picking/index-color-picking.d.ts +1 -1
  450. package/dist/modules/picking/index-picking.cjs +201 -0
  451. package/dist/modules/picking/index-picking.d.ts +1 -1
  452. package/dist/modules/picking/legacy-color-picking.cjs +28 -0
  453. package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
  454. package/dist/modules/picking/legacy-picking-manager.cjs +92 -0
  455. package/dist/modules/picking/picking-manager.cjs +360 -0
  456. package/dist/modules/picking/picking-uniforms.cjs +140 -0
  457. package/dist/modules/picking/picking-uniforms.d.ts +1 -1
  458. package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
  459. package/dist/modules/picking/picking.cjs +43 -0
  460. package/dist/modules/picking/picking.d.ts +1 -1
  461. package/dist/passes/get-fragment-shader.cjs +119 -0
  462. package/dist/passes/shader-pass-renderer.cjs +722 -0
  463. package/dist/passes/shader-pass-renderer.d.ts +2 -2
  464. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  465. package/dist/passes/shader-pass-renderer.js +1 -1
  466. package/dist/passes/shader-pass-renderer.js.map +1 -1
  467. package/dist/passes/texture-transform-module.cjs +78 -0
  468. package/dist/scenegraph/controllers/area-light-controller.cjs +143 -0
  469. package/dist/scenegraph/controllers/area-light-controller.d.ts +31 -0
  470. package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -0
  471. package/dist/scenegraph/controllers/area-light-controller.js +130 -0
  472. package/dist/scenegraph/controllers/area-light-controller.js.map +1 -0
  473. package/dist/scenegraph/controllers/billboard-controller.cjs +156 -0
  474. package/dist/scenegraph/controllers/billboard-controller.d.ts +45 -0
  475. package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -0
  476. package/dist/scenegraph/controllers/billboard-controller.js +156 -0
  477. package/dist/scenegraph/controllers/billboard-controller.js.map +1 -0
  478. package/dist/scenegraph/controllers/joint-controller.cjs +71 -0
  479. package/dist/scenegraph/controllers/joint-controller.d.ts +30 -0
  480. package/dist/scenegraph/controllers/joint-controller.d.ts.map +1 -0
  481. package/dist/scenegraph/controllers/joint-controller.js +53 -0
  482. package/dist/scenegraph/controllers/joint-controller.js.map +1 -0
  483. package/dist/scenegraph/controllers/material-variants.cjs +61 -0
  484. package/dist/scenegraph/controllers/material-variants.d.ts +42 -0
  485. package/dist/scenegraph/controllers/material-variants.d.ts.map +1 -0
  486. package/dist/scenegraph/controllers/material-variants.js +40 -0
  487. package/dist/scenegraph/controllers/material-variants.js.map +1 -0
  488. package/dist/scenegraph/controllers/morph-controller.cjs +61 -0
  489. package/dist/scenegraph/controllers/morph-controller.d.ts +19 -0
  490. package/dist/scenegraph/controllers/morph-controller.d.ts.map +1 -0
  491. package/dist/scenegraph/controllers/morph-controller.js +41 -0
  492. package/dist/scenegraph/controllers/morph-controller.js.map +1 -0
  493. package/dist/scenegraph/controllers/skin-controller.cjs +111 -0
  494. package/dist/scenegraph/controllers/skin-controller.d.ts +36 -0
  495. package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -0
  496. package/dist/scenegraph/controllers/skin-controller.js +90 -0
  497. package/dist/scenegraph/controllers/skin-controller.js.map +1 -0
  498. package/dist/scenegraph/group-node.cjs +129 -0
  499. package/dist/scenegraph/model-node.cjs +68 -0
  500. package/dist/scenegraph/physics-transforms.cjs +95 -0
  501. package/dist/scenegraph/physics-transforms.d.ts +13 -0
  502. package/dist/scenegraph/physics-transforms.d.ts.map +1 -0
  503. package/dist/scenegraph/physics-transforms.js +72 -0
  504. package/dist/scenegraph/physics-transforms.js.map +1 -0
  505. package/dist/scenegraph/published-transforms.cjs +37 -0
  506. package/dist/scenegraph/published-transforms.d.ts +17 -0
  507. package/dist/scenegraph/published-transforms.d.ts.map +1 -0
  508. package/dist/scenegraph/published-transforms.js +16 -0
  509. package/dist/scenegraph/published-transforms.js.map +1 -0
  510. package/dist/scenegraph/scenegraph-bounds.cjs +51 -0
  511. package/dist/scenegraph/scenegraph-node.cjs +182 -0
  512. package/dist/shader-inputs.cjs +231 -0
  513. package/dist/shader-inputs.d.ts +1 -1
  514. package/dist/shader-inputs.d.ts.map +1 -1
  515. package/dist/utils/buffer-layout-helper.cjs +52 -0
  516. package/dist/utils/buffer-layout-order.cjs +37 -0
  517. package/dist/utils/deep-equal.cjs +65 -0
  518. package/dist/utils/get-platform-info.cjs +21 -0
  519. package/dist/utils/get-platform-info.d.ts +2 -0
  520. package/dist/utils/get-platform-info.d.ts.map +1 -0
  521. package/dist/utils/get-platform-info.js +5 -0
  522. package/dist/utils/get-platform-info.js.map +1 -0
  523. package/dist/utils/gpu-vector-batch-structure.cjs +45 -0
  524. package/dist/utils/gpu-vector-batch-structure.d.ts +12 -0
  525. package/dist/utils/gpu-vector-batch-structure.d.ts.map +1 -0
  526. package/dist/utils/gpu-vector-batch-structure.js +27 -0
  527. package/dist/utils/gpu-vector-batch-structure.js.map +1 -0
  528. package/dist/utils/shader-module-utils.cjs +148 -0
  529. package/dist/utils/uid.cjs +32 -0
  530. package/package.json +47 -8
  531. package/src/animation/deform-positions.ts +62 -0
  532. package/src/animation/node-animation-binding.ts +54 -0
  533. package/src/animation/property-animation-binding.ts +212 -0
  534. package/src/animation/scenegraph-animator.ts +117 -0
  535. package/src/animation/texture-transform.ts +59 -0
  536. package/src/animation-loop/animation-loop.ts +10 -3
  537. package/src/audio/audio-controller.ts +583 -0
  538. package/src/audio/audio-environment.ts +202 -0
  539. package/src/audio/audio-graph.ts +253 -0
  540. package/src/compute/buffer-transform.ts +71 -16
  541. package/src/compute/computation.ts +4 -19
  542. package/src/compute/texture-transform.ts +25 -12
  543. package/src/controls/orbit-controls.ts +4 -1
  544. package/src/dynamic-buffer/dynamic-buffer.ts +15 -449
  545. package/src/dynamic-texture/dynamic-texture.ts +5 -760
  546. package/src/dynamic-texture/texture-binding-source.ts +8 -90
  547. package/src/dynamic-texture/texture-data.ts +31 -340
  548. package/src/dynamic-texture/video-texture.ts +1 -1
  549. package/src/experimental/controls/comparison-splitter.ts +269 -0
  550. package/src/experimental/controls/flat-controller.ts +403 -0
  551. package/src/experimental/controls/index.ts +16 -0
  552. package/src/experimental/controls/orbit-controls.ts +6 -0
  553. package/src/experimental/materials/emissive-material.ts +120 -0
  554. package/src/experimental/materials/glass-material.ts +607 -0
  555. package/src/experimental/materials/glass-transmission.ts +1023 -0
  556. package/src/experimental/materials/index.ts +49 -0
  557. package/src/experimental/materials/optical-caustics.ts +234 -0
  558. package/src/experimental/materials/optical-lighting.ts +148 -0
  559. package/src/experimental/materials/optical-point-lights.ts +288 -0
  560. package/src/experimental/materials/reflective-material.ts +214 -0
  561. package/src/experimental/textures/html-texture.ts +285 -0
  562. package/src/experimental/textures/index.ts +8 -0
  563. package/src/experimental/textures/packed-pixels.ts +351 -0
  564. package/src/experimental/textures/rgba-decoder.ts +79 -0
  565. package/src/experimental/webxr/index.ts +21 -0
  566. package/src/experimental/webxr/webxr-animation-frame-provider.ts +22 -0
  567. package/src/experimental/webxr/webxr-camera-texture.ts +195 -0
  568. package/src/experimental/webxr/webxr-input.ts +117 -0
  569. package/src/experimental/webxr/webxr-manager.ts +524 -0
  570. package/src/experimental/webxr/webxr-types.ts +192 -0
  571. package/src/geometry/edge-geometry.ts +7 -3
  572. package/src/geometry/geometry-primitives.ts +226 -0
  573. package/src/geometry/geometry-utils.ts +16 -71
  574. package/src/geometry/geometry.ts +36 -163
  575. package/src/geometry/gpu-geometry.ts +9 -4
  576. package/src/geometry/gpu-vector-geometry-adapter.ts +78 -0
  577. package/src/geometry/gpu-vector-geometry.ts +33 -0
  578. package/src/geometry/ring-geometry.ts +117 -0
  579. package/src/graph/models/index.ts +45 -0
  580. package/src/graph/models/path/path-attribute-model.ts +563 -0
  581. package/src/graph/models/path/path-storage-model.ts +996 -0
  582. package/src/graph/models/path/path-trips-storage-model.ts +286 -0
  583. package/src/graph/models/polygon/polygon-attribute-model.ts +165 -0
  584. package/src/graph/models/polygon/polygon-shaders.ts +279 -0
  585. package/src/graph/models/polygon/polygon-storage-model.ts +146 -0
  586. package/src/graph/physics/index.ts +24 -0
  587. package/src/graph/physics/physics-scenegraph.ts +112 -0
  588. package/src/graph/physics/scenegraph-behaviors.ts +169 -0
  589. package/src/graph/physics/scenegraph-instance.ts +296 -0
  590. package/src/graph/physics/scenegraph-joints.ts +37 -0
  591. package/src/graph/physics/scenegraph-motion.ts +175 -0
  592. package/src/graph/physics/scenegraph-properties.ts +241 -0
  593. package/src/graph/physics/scenegraph-publication.ts +116 -0
  594. package/src/graph/physics/scenegraph-session.ts +317 -0
  595. package/src/graph/tables/gpu-table-geometry.ts +88 -0
  596. package/src/graph/tables/gpu-table-model.ts +661 -0
  597. package/src/graph/tables/gpu-table-transform.ts +497 -0
  598. package/src/graph/tables/index.ts +18 -0
  599. package/src/index.ts +144 -27
  600. package/src/interactivity/interactivity.ts +670 -0
  601. package/src/interactivity/physics.ts +19 -0
  602. package/src/material/material-factory.ts +1 -1
  603. package/src/material/material.ts +2 -2
  604. package/src/model/gpu-vector-bindings.ts +276 -0
  605. package/src/model/gpu-vector-draw-batches.ts +116 -0
  606. package/src/model/gpu-vector-model-batches.ts +142 -0
  607. package/src/model/gpu-vector-model.ts +1819 -0
  608. package/src/model/model.ts +91 -1444
  609. package/src/model/split-uniforms-and-bindings.ts +6 -3
  610. package/src/models/billboard-texture-model.ts +1 -1
  611. package/src/models/clip-space.ts +21 -14
  612. package/src/models/directional-light-model.ts +1 -1
  613. package/src/models/point-light-model.ts +1 -1
  614. package/src/models/spot-light-model.ts +1 -1
  615. package/src/modules/picking/legacy-picking-manager.ts +1 -1
  616. package/src/modules/picking/picking-uniforms.ts +1 -1
  617. package/src/passes/shader-pass-renderer.ts +2 -2
  618. package/src/scenegraph/controllers/area-light-controller.ts +152 -0
  619. package/src/scenegraph/controllers/billboard-controller.ts +204 -0
  620. package/src/scenegraph/controllers/joint-controller.ts +81 -0
  621. package/src/scenegraph/controllers/material-variants.ts +70 -0
  622. package/src/scenegraph/controllers/morph-controller.ts +61 -0
  623. package/src/scenegraph/controllers/skin-controller.ts +125 -0
  624. package/src/scenegraph/physics-transforms.ts +82 -0
  625. package/src/scenegraph/published-transforms.ts +18 -0
  626. package/src/shader-inputs.ts +1 -1
  627. package/src/utils/get-platform-info.ts +5 -0
  628. package/src/utils/gpu-vector-batch-structure.ts +36 -0
  629. package/dist/compute/kernel.d.ts +0 -54
  630. package/dist/compute/kernel.d.ts.map +0 -1
  631. package/dist/compute/kernel.js +0 -103
  632. package/dist/compute/kernel.js.map +0 -1
  633. package/dist/compute/render-kernel.d.ts +0 -65
  634. package/dist/compute/render-kernel.d.ts.map +0 -1
  635. package/dist/compute/render-kernel.js +0 -129
  636. package/dist/compute/render-kernel.js.map +0 -1
  637. package/dist/geometries/cone-geometry.d.ts +0 -12
  638. package/dist/geometries/cone-geometry.d.ts.map +0 -1
  639. package/dist/geometries/cone-geometry.js +0 -19
  640. package/dist/geometries/cone-geometry.js.map +0 -1
  641. package/dist/geometries/cube-geometry.d.ts +0 -14
  642. package/dist/geometries/cube-geometry.d.ts.map +0 -1
  643. package/dist/geometries/cube-geometry.js +0 -222
  644. package/dist/geometries/cube-geometry.js.map +0 -1
  645. package/dist/geometries/cylinder-geometry.d.ts +0 -11
  646. package/dist/geometries/cylinder-geometry.d.ts.map +0 -1
  647. package/dist/geometries/cylinder-geometry.js +0 -17
  648. package/dist/geometries/cylinder-geometry.js.map +0 -1
  649. package/dist/geometries/ico-sphere-geometry.d.ts +0 -11
  650. package/dist/geometries/ico-sphere-geometry.d.ts.map +0 -1
  651. package/dist/geometries/ico-sphere-geometry.js +0 -158
  652. package/dist/geometries/ico-sphere-geometry.js.map +0 -1
  653. package/dist/geometries/plane-geometry.d.ts +0 -20
  654. package/dist/geometries/plane-geometry.d.ts.map +0 -1
  655. package/dist/geometries/plane-geometry.js +0 -106
  656. package/dist/geometries/plane-geometry.js.map +0 -1
  657. package/dist/geometries/sphere-geometry.d.ts +0 -12
  658. package/dist/geometries/sphere-geometry.d.ts.map +0 -1
  659. package/dist/geometries/sphere-geometry.js +0 -88
  660. package/dist/geometries/sphere-geometry.js.map +0 -1
  661. package/dist/geometries/truncated-cone-geometry.d.ts +0 -23
  662. package/dist/geometries/truncated-cone-geometry.d.ts.map +0 -1
  663. package/dist/geometries/truncated-cone-geometry.js +0 -112
  664. package/dist/geometries/truncated-cone-geometry.js.map +0 -1
  665. package/src/compute/kernel.ts +0 -146
  666. package/src/compute/render-kernel.ts +0 -192
  667. package/src/geometries/cone-geometry.ts +0 -31
  668. package/src/geometries/cube-geometry.ts +0 -258
  669. package/src/geometries/cylinder-geometry.ts +0 -28
  670. package/src/geometries/ico-sphere-geometry.ts +0 -193
  671. package/src/geometries/plane-geometry.ts +0 -142
  672. package/src/geometries/sphere-geometry.ts +0 -113
  673. package/src/geometries/truncated-cone-geometry.ts +0 -145
@@ -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
+ });
@@ -1,3 +1,4 @@
1
+ import type { Geometry as MathGeometry } from '@math.gl/geometry';
1
2
  import { Geometry } from "./geometry.js";
2
3
  export type MakeEdgeGeometryOptions = {
3
4
  /** Keep coplanar internal edges to inspect the original triangulation. Defaults to false. */
@@ -10,7 +11,7 @@ export type MakeEdgeGeometryOptions = {
10
11
  positionAttribute?: string;
11
12
  };
12
13
  /** Extracts boundary, crease, and non-manifold edges from a triangle-list CPU geometry. */
13
- export declare function makeEdgeGeometry(geometry: Geometry, options?: MakeEdgeGeometryOptions): Geometry;
14
+ export declare function makeEdgeGeometry(geometry: MathGeometry, options?: MakeEdgeGeometryOptions): Geometry;
14
15
  /** Classifies adjacent meshes together to suppress coplanar tile seams and duplicate edges. */
15
- export declare function makeEdgeGeometryFromGeometries(geometries: readonly Geometry[], options?: MakeEdgeGeometryOptions): Geometry;
16
+ export declare function makeEdgeGeometryFromGeometries(geometries: readonly MathGeometry[], options?: MakeEdgeGeometryOptions): Geometry;
16
17
  //# sourceMappingURL=edge-geometry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edge-geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/edge-geometry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,QAAQ,EAAyB,sBAAmB;AAE5D,MAAM,MAAM,uBAAuB,GAAG;IACpC,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAKF,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,uBAA4B,GACpC,QAAQ,CAiHV;AAED,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,SAAS,QAAQ,EAAE,EAC/B,OAAO,GAAE,uBAA4B,GACpC,QAAQ,CA2CV"}
1
+ {"version":3,"file":"edge-geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/edge-geometry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,QAAQ,IAAI,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAyB,sBAAmB;AAE5D,MAAM,MAAM,uBAAuB,GAAG;IACpC,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAKF,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,uBAA4B,GACpC,QAAQ,CAiHV;AAED,+FAA+F;AAC/F,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,OAAO,GAAE,uBAA4B,GACpC,QAAQ,CA2CV"}
@@ -1 +1 @@
1
- {"version":3,"file":"edge-geometry.js","sourceRoot":"","sources":["../../src/geometry/edge-geometry.ts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O,CACR,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,QAAsB,EACtB,iBAAyB;IAEzB,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACzD,uFAAuF;IACvF,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,eAAe,IAAI,SAAS,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,WAAW,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,MAAM,CACJ,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAC9F,CAAC;IACF,MAAM,CACJ,QAAQ,CAAC,WAAW,IAAI,CAAC;QACvB,QAAQ,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CACzF,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -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
+ });
@@ -0,0 +1,60 @@
1
+ import { type GeometryAttributeInput, type SphereGeometryProps, type IcoSphereGeometryProps, type TruncatedConeGeometryProps } from '@math.gl/geometry';
2
+ import { type TorusGeometryProps } from '@math.gl/geometry';
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
+ }
9
+ export type { SphereGeometryProps, IcoSphereGeometryProps, TruncatedConeGeometryProps };
10
+ export type CubeGeometryProps = {
11
+ id?: string;
12
+ indices?: boolean;
13
+ attributes?: Record<string, GeometryAttributeInput>;
14
+ };
15
+ /** Compatibility defaults and face metadata over the math.gl box tessellator. */
16
+ export declare class CubeGeometry extends Geometry {
17
+ constructor(props?: CubeGeometryProps);
18
+ }
19
+ export declare class SphereGeometry extends Geometry {
20
+ constructor(props?: SphereGeometryProps);
21
+ }
22
+ export declare class IcoSphereGeometry extends Geometry {
23
+ constructor(props?: IcoSphereGeometryProps);
24
+ }
25
+ export declare class TruncatedConeGeometry extends Geometry {
26
+ constructor(props?: TruncatedConeGeometryProps);
27
+ }
28
+ export type CylinderGeometryProps = Omit<TruncatedConeGeometryProps, 'topRadius' | 'bottomRadius'> & {
29
+ radius?: number;
30
+ };
31
+ export declare class CylinderGeometry extends TruncatedConeGeometry {
32
+ constructor(props?: CylinderGeometryProps);
33
+ }
34
+ export type ConeGeometryProps = Omit<TruncatedConeGeometryProps, 'topRadius' | 'bottomRadius' | 'topCap' | 'bottomCap'> & {
35
+ radius?: number;
36
+ cap?: boolean;
37
+ };
38
+ export declare class ConeGeometry extends TruncatedConeGeometry {
39
+ constructor(props?: ConeGeometryProps);
40
+ }
41
+ export type PlaneGeometryProps = {
42
+ id?: string;
43
+ radius?: number;
44
+ attributes?: Record<string, GeometryAttributeInput>;
45
+ type?: 'x,y' | 'x,z' | 'y,z';
46
+ offset?: number;
47
+ flipCull?: boolean;
48
+ unpack?: boolean;
49
+ xlen?: number;
50
+ ylen?: number;
51
+ zlen?: number;
52
+ nx?: number;
53
+ ny?: number;
54
+ nz?: number;
55
+ };
56
+ /** Adapts legacy plane axes and facing to math.gl's XZ plane. */
57
+ export declare class PlaneGeometry extends Geometry {
58
+ constructor(props?: PlaneGeometryProps);
59
+ }
60
+ //# sourceMappingURL=geometry-primitives.d.ts.map
@@ -0,0 +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,EAAqC,KAAK,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAC,QAAQ,EAAC,sBAAmB;AAEpC,YAAY,EAAC,kBAAkB,EAAC,CAAC;AAEjC,oFAAoF;AACpF,qBAAa,aAAc,SAAQ,QAAQ;gBAC7B,KAAK,GAAE,kBAAuB;CAI3C;AAED,YAAY,EAAC,mBAAmB,EAAE,sBAAsB,EAAE,0BAA0B,EAAC,CAAC;AAEtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAA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AC,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"}
@@ -0,0 +1,161 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
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';
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
+ }
14
+ /** Compatibility defaults and face metadata over the math.gl box tessellator. */
15
+ export class CubeGeometry extends Geometry {
16
+ constructor(props = {}) {
17
+ const source = new MathCubeGeometry({ size: 2 });
18
+ const faceIndices = new Uint32Array(24);
19
+ // The renderer's semantic face order is +Z, -Z, +Y, -Y, +X, -X.
20
+ const faceOrder = [4, 5, 2, 3, 0, 1];
21
+ for (let vertexIndex = 0; vertexIndex < faceIndices.length; vertexIndex++) {
22
+ faceIndices[vertexIndex] = faceOrder[Math.floor(vertexIndex / 4)];
23
+ }
24
+ source.attributes['faceIndex'] = { size: 1, value: faceIndices };
25
+ if (props.indices === false) {
26
+ source.attributes['COLOR_0'] = {
27
+ size: 3,
28
+ value: new Float32Array(Array.from(source.attributes['POSITION'].value, value => (value + 1) / 2))
29
+ };
30
+ }
31
+ const data = props.indices === false ? unpackIndexedGeometry(source) : source;
32
+ super({
33
+ id: props.id,
34
+ topology: source.topology,
35
+ indices: props.indices === false ? undefined : source.indices,
36
+ attributes: mergeAttributes(data.attributes, props.attributes)
37
+ });
38
+ }
39
+ }
40
+ export class SphereGeometry extends Geometry {
41
+ constructor(props = {}) {
42
+ const source = new MathSphereGeometry({
43
+ ...props,
44
+ attributes: undefined,
45
+ radius: props.radius ?? 1
46
+ });
47
+ // Retain the legacy longitude-to-UV mapping while math.gl tessellates the sphere.
48
+ for (const name of ['POSITION', 'NORMAL']) {
49
+ const values = source.attributes[name].value;
50
+ for (let index = 0; index < values.length; index += 3) {
51
+ const horizontal = values[index];
52
+ values[index] = values[index + 2];
53
+ values[index + 2] = horizontal;
54
+ }
55
+ }
56
+ const indices = source.indices?.value;
57
+ if (indices) {
58
+ for (let index = 0; index < indices.length; index += 3) {
59
+ const second = indices[index + 1];
60
+ indices[index + 1] = indices[index + 2];
61
+ indices[index + 2] = second;
62
+ }
63
+ }
64
+ super({ ...source, attributes: { ...source.attributes, ...props.attributes } });
65
+ }
66
+ }
67
+ export class IcoSphereGeometry extends Geometry {
68
+ constructor(props = {}) {
69
+ const source = new MathIcoSphereGeometry({ ...props, radius: props.radius ?? 1 });
70
+ super({ ...source, attributes: source.attributes });
71
+ }
72
+ }
73
+ export class TruncatedConeGeometry extends Geometry {
74
+ constructor(props = {}) {
75
+ const source = new MathTruncatedConeGeometry({ ...props, bottomRadius: props.bottomRadius ?? 1 });
76
+ super({ ...source, attributes: source.attributes });
77
+ }
78
+ }
79
+ export class CylinderGeometry extends TruncatedConeGeometry {
80
+ constructor(props = {}) {
81
+ const radius = props.radius ?? 1;
82
+ super({ ...props, topRadius: radius, bottomRadius: radius });
83
+ }
84
+ }
85
+ export class ConeGeometry extends TruncatedConeGeometry {
86
+ constructor(props = {}) {
87
+ const cap = props.cap ?? true;
88
+ super({ ...props, topRadius: 0, bottomRadius: props.radius ?? 1, topCap: cap, bottomCap: cap });
89
+ }
90
+ }
91
+ /** Adapts legacy plane axes and facing to math.gl's XZ plane. */
92
+ export class PlaneGeometry extends Geometry {
93
+ constructor(props = {}) {
94
+ const { type = 'x,y', offset = 0, flipCull = false } = props;
95
+ const planeAxes = {
96
+ 'x,y': { sizeX: props.xlen, sizeZ: props.ylen, nx: props.nx, nz: props.ny },
97
+ 'x,z': { sizeX: props.xlen, sizeZ: props.zlen, nx: props.nx, nz: props.nz },
98
+ 'y,z': { sizeX: props.ylen, sizeZ: props.zlen, nx: props.ny, nz: props.nz }
99
+ }[type];
100
+ // Only the three legacy axis pairs are supported.
101
+ if (!planeAxes)
102
+ throw new Error('Invalid plane axes');
103
+ const source = new MathPlaneGeometry({
104
+ sizeX: planeAxes.sizeX || 1,
105
+ sizeZ: planeAxes.sizeZ || 1,
106
+ nx: planeAxes.nx || 1,
107
+ nz: planeAxes.nz || 1
108
+ });
109
+ orientPlane(source, type, offset, flipCull);
110
+ const data = props.unpack ? unpackIndexedGeometry(source) : source;
111
+ super({
112
+ id: props.id,
113
+ topology: source.topology,
114
+ indices: props.unpack ? undefined : source.indices,
115
+ attributes: mergeAttributes(data.attributes, props.attributes)
116
+ });
117
+ }
118
+ }
119
+ function orientPlane(geometry, type, offset, flipCull) {
120
+ const positions = geometry.attributes['POSITION'].value;
121
+ const normals = geometry.attributes['NORMAL'].value;
122
+ const texCoords = geometry.attributes['TEXCOORD_0'].value;
123
+ for (let vertexIndex = 0; vertexIndex < positions.length / 3; vertexIndex++) {
124
+ const positionIndex = vertexIndex * 3;
125
+ const horizontal = Number(positions[positionIndex]) * (flipCull ? -1 : 1);
126
+ const vertical = -Number(positions[positionIndex + 2]);
127
+ const normal = flipCull ? 1 : -1;
128
+ if (type === 'x,y') {
129
+ positions.set([horizontal, vertical, offset], positionIndex);
130
+ normals.set([0, 0, normal], positionIndex);
131
+ }
132
+ else if (type === 'x,z') {
133
+ positions.set([horizontal, offset, vertical], positionIndex);
134
+ normals.set([0, normal, 0], positionIndex);
135
+ }
136
+ else {
137
+ positions.set([offset, horizontal, vertical], positionIndex);
138
+ normals.set([normal, 0, 0], positionIndex);
139
+ }
140
+ if (flipCull)
141
+ texCoords[vertexIndex * 2] = 1 - Number(texCoords[vertexIndex * 2]);
142
+ }
143
+ // The legacy XY and YZ planes face the negative perpendicular axis.
144
+ if (type !== 'x,z' && geometry.indices) {
145
+ const indices = geometry.indices.value;
146
+ for (let index = 0; index < indices.length; index += 3) {
147
+ const second = indices[index + 1];
148
+ indices[index + 1] = indices[index + 2];
149
+ indices[index + 2] = second;
150
+ }
151
+ }
152
+ }
153
+ function mergeAttributes(source, overrides = {}) {
154
+ const attributes = {};
155
+ for (const [name, attribute] of Object.entries(source)) {
156
+ if (attribute)
157
+ attributes[name] = attribute;
158
+ }
159
+ return { ...attributes, ...overrides };
160
+ }
161
+ //# sourceMappingURL=geometry-primitives.js.map