@loaders.gl/tile-converter 4.0.0-alpha.8 → 4.0.0-beta.1

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 (300) hide show
  1. package/bin/i3s-server.js +4 -0
  2. package/bin/slpk-extractor.js +4 -0
  3. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +5 -5
  4. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  5. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +10 -5
  6. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
  7. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts +10 -0
  8. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -0
  9. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +2 -1
  10. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -1
  11. package/dist/converter.min.js +172 -103
  12. package/dist/deps-installer/deps-installer.d.ts +3 -2
  13. package/dist/deps-installer/deps-installer.d.ts.map +1 -1
  14. package/dist/dist.min.js +32718 -32568
  15. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +97 -117
  16. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  17. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +24 -22
  18. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  19. package/dist/es5/3d-tiles-converter/helpers/load-i3s.js +63 -0
  20. package/dist/es5/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
  21. package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  22. package/dist/es5/converter-cli.js +25 -65
  23. package/dist/es5/converter-cli.js.map +1 -1
  24. package/dist/es5/deps-installer/deps-installer.js +115 -40
  25. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  26. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +45 -15
  27. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  28. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  29. package/dist/es5/i3s-converter/helpers/feature-attributes.js +8 -18
  30. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
  31. package/dist/es5/i3s-converter/helpers/geometry-attributes.js +83 -43
  32. package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  33. package/dist/es5/i3s-converter/helpers/geometry-converter.js +100 -102
  34. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  35. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  36. package/dist/es5/i3s-converter/helpers/load-3d-tiles.js +70 -4
  37. package/dist/es5/i3s-converter/helpers/load-3d-tiles.js.map +1 -1
  38. package/dist/es5/i3s-converter/helpers/node-index-document.js +3 -2
  39. package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
  40. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +47 -12
  41. package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  42. package/dist/es5/i3s-converter/i3s-converter.js +187 -174
  43. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  44. package/dist/es5/i3s-converter/types.js +11 -11
  45. package/dist/es5/i3s-converter/types.js.map +1 -1
  46. package/dist/es5/i3s-server/README.md +46 -2
  47. package/dist/es5/i3s-server/app.js +23 -15
  48. package/dist/es5/i3s-server/app.js.map +1 -1
  49. package/dist/es5/i3s-server/bin/www.js +33 -0
  50. package/dist/es5/i3s-server/bin/www.js.map +1 -0
  51. package/dist/es5/i3s-server/controllers/index-controller.js +23 -22
  52. package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
  53. package/dist/es5/i3s-server/controllers/slpk-controller.js +35 -38
  54. package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
  55. package/dist/es5/i3s-server/routes/index.js +2 -2
  56. package/dist/es5/i3s-server/routes/index.js.map +1 -1
  57. package/dist/es5/i3s-server/routes/slpk-router.js +14 -13
  58. package/dist/es5/i3s-server/routes/slpk-router.js.map +1 -1
  59. package/dist/es5/i3s-server/utils/create-scene-server.js +7 -4
  60. package/dist/es5/i3s-server/utils/create-scene-server.js.map +1 -1
  61. package/dist/es5/i3s-server/utils/server-utils.js +49 -0
  62. package/dist/es5/i3s-server/utils/server-utils.js.map +1 -0
  63. package/dist/es5/lib/utils/cli-utils.js +57 -0
  64. package/dist/es5/lib/utils/cli-utils.js.map +1 -0
  65. package/dist/es5/lib/utils/compress-util.js +1 -1
  66. package/dist/es5/lib/utils/compress-util.js.map +1 -1
  67. package/dist/es5/lib/utils/lod-conversion-utils.js +10 -4
  68. package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
  69. package/dist/es5/pgm-loader.js +11 -3
  70. package/dist/es5/pgm-loader.js.map +1 -1
  71. package/dist/es5/slpk-extractor/slpk-extractor.js +171 -0
  72. package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -0
  73. package/dist/es5/slpk-extractor-cli.js +117 -0
  74. package/dist/es5/slpk-extractor-cli.js.map +1 -0
  75. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +51 -58
  76. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  77. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +12 -11
  78. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  79. package/dist/esm/3d-tiles-converter/helpers/load-i3s.js +32 -0
  80. package/dist/esm/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
  81. package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
  82. package/dist/esm/converter-cli.js +8 -48
  83. package/dist/esm/converter-cli.js.map +1 -1
  84. package/dist/esm/deps-installer/deps-installer.js +40 -13
  85. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  86. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +28 -11
  87. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  88. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  89. package/dist/esm/i3s-converter/helpers/feature-attributes.js +10 -8
  90. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
  91. package/dist/esm/i3s-converter/helpers/geometry-attributes.js +77 -34
  92. package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
  93. package/dist/esm/i3s-converter/helpers/geometry-converter.js +60 -61
  94. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  95. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  96. package/dist/esm/i3s-converter/helpers/load-3d-tiles.js +33 -4
  97. package/dist/esm/i3s-converter/helpers/load-3d-tiles.js.map +1 -1
  98. package/dist/esm/i3s-converter/helpers/node-index-document.js +2 -1
  99. package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
  100. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +37 -12
  101. package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
  102. package/dist/esm/i3s-converter/i3s-converter.js +101 -73
  103. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  104. package/dist/esm/i3s-converter/types.js +9 -9
  105. package/dist/esm/i3s-converter/types.js.map +1 -1
  106. package/dist/esm/i3s-server/README.md +46 -2
  107. package/dist/esm/i3s-server/app.js +13 -11
  108. package/dist/esm/i3s-server/app.js.map +1 -1
  109. package/dist/esm/i3s-server/bin/i3s-server.min.js +516 -0
  110. package/dist/esm/i3s-server/bin/www.js +30 -0
  111. package/dist/esm/i3s-server/bin/www.js.map +1 -0
  112. package/dist/esm/i3s-server/controllers/index-controller.js +4 -7
  113. package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -1
  114. package/dist/esm/i3s-server/controllers/slpk-controller.js +9 -26
  115. package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
  116. package/dist/esm/i3s-server/routes/index.js +1 -1
  117. package/dist/esm/i3s-server/routes/index.js.map +1 -1
  118. package/dist/esm/i3s-server/routes/slpk-router.js +5 -11
  119. package/dist/esm/i3s-server/routes/slpk-router.js.map +1 -1
  120. package/dist/esm/i3s-server/utils/create-scene-server.js +2 -5
  121. package/dist/esm/i3s-server/utils/create-scene-server.js.map +1 -1
  122. package/dist/esm/i3s-server/utils/server-utils.js +40 -0
  123. package/dist/esm/i3s-server/utils/server-utils.js.map +1 -0
  124. package/dist/esm/lib/utils/cli-utils.js +47 -0
  125. package/dist/esm/lib/utils/cli-utils.js.map +1 -0
  126. package/dist/esm/lib/utils/compress-util.js +1 -1
  127. package/dist/esm/lib/utils/compress-util.js.map +1 -1
  128. package/dist/esm/lib/utils/lod-conversion-utils.js +6 -4
  129. package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
  130. package/dist/esm/pgm-loader.js +7 -4
  131. package/dist/esm/pgm-loader.js.map +1 -1
  132. package/dist/esm/slpk-extractor/slpk-extractor.js +63 -0
  133. package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -0
  134. package/dist/esm/slpk-extractor-cli.js +74 -0
  135. package/dist/esm/slpk-extractor-cli.js.map +1 -0
  136. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +15 -2
  137. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  138. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +1 -2
  139. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
  140. package/dist/i3s-converter/helpers/feature-attributes.d.ts +8 -8
  141. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
  142. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
  143. package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -9
  144. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  145. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +3 -3
  146. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  147. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts +15 -0
  148. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -1
  149. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
  150. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +4 -5
  151. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
  152. package/dist/i3s-converter/i3s-converter.d.ts +3 -2
  153. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  154. package/dist/i3s-converter/types.d.ts +48 -7
  155. package/dist/i3s-converter/types.d.ts.map +1 -1
  156. package/dist/i3s-server/app.d.ts +1 -2
  157. package/dist/i3s-server/app.d.ts.map +1 -1
  158. package/dist/i3s-server/bin/www.d.ts +3 -0
  159. package/dist/i3s-server/bin/www.d.ts.map +1 -0
  160. package/dist/i3s-server/controllers/index-controller.d.ts +6 -1
  161. package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -1
  162. package/dist/i3s-server/controllers/slpk-controller.d.ts +13 -2
  163. package/dist/i3s-server/controllers/slpk-controller.d.ts.map +1 -1
  164. package/dist/i3s-server/routes/index.d.ts +1 -2
  165. package/dist/i3s-server/routes/index.d.ts.map +1 -1
  166. package/dist/i3s-server/routes/slpk-router.d.ts +2 -2
  167. package/dist/i3s-server/routes/slpk-router.d.ts.map +1 -1
  168. package/dist/i3s-server/utils/create-scene-server.d.ts +11 -5
  169. package/dist/i3s-server/utils/create-scene-server.d.ts.map +1 -1
  170. package/dist/i3s-server/utils/server-utils.d.ts +24 -0
  171. package/dist/i3s-server/utils/server-utils.d.ts.map +1 -0
  172. package/dist/lib/utils/cli-utils.d.ts +34 -0
  173. package/dist/lib/utils/cli-utils.d.ts.map +1 -0
  174. package/dist/lib/utils/lod-conversion-utils.d.ts +2 -2
  175. package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -1
  176. package/dist/pgm-loader.d.ts +9 -2
  177. package/dist/pgm-loader.d.ts.map +1 -1
  178. package/dist/slpk-extractor/slpk-extractor.d.ts +23 -0
  179. package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -0
  180. package/dist/slpk-extractor-cli.d.ts +17 -0
  181. package/dist/slpk-extractor-cli.d.ts.map +1 -0
  182. package/dist/slpk-extractor.min.js +189 -0
  183. package/package.json +28 -22
  184. package/src/3d-tiles-converter/3d-tiles-converter.ts +65 -69
  185. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +23 -19
  186. package/src/3d-tiles-converter/helpers/load-i3s.ts +52 -0
  187. package/src/3d-tiles-converter/helpers/texture-atlas.ts +6 -2
  188. package/src/converter-cli.ts +16 -74
  189. package/src/deps-installer/deps-installer.ts +58 -12
  190. package/src/i3s-converter/helpers/batch-ids-extensions.ts +77 -32
  191. package/src/i3s-converter/helpers/coordinate-converter.ts +1 -2
  192. package/src/i3s-converter/helpers/feature-attributes.ts +23 -18
  193. package/src/i3s-converter/helpers/geometry-attributes.ts +81 -44
  194. package/src/i3s-converter/helpers/geometry-converter.ts +149 -126
  195. package/src/i3s-converter/helpers/gltf-attributes.ts +9 -10
  196. package/src/i3s-converter/helpers/load-3d-tiles.ts +61 -5
  197. package/src/i3s-converter/helpers/node-index-document.ts +5 -1
  198. package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +70 -21
  199. package/src/i3s-converter/i3s-converter.ts +145 -73
  200. package/src/i3s-converter/types.ts +49 -7
  201. package/src/i3s-server/README.md +46 -2
  202. package/src/i3s-server/{app.js → app.ts} +11 -9
  203. package/src/i3s-server/bin/www.ts +38 -0
  204. package/src/i3s-server/controllers/{index-controller.js → index-controller.ts} +10 -9
  205. package/src/i3s-server/controllers/slpk-controller.ts +32 -0
  206. package/src/i3s-server/routes/{index.js → index.ts} +2 -1
  207. package/src/i3s-server/routes/{slpk-router.js → slpk-router.ts} +5 -10
  208. package/src/i3s-server/utils/create-scene-server.ts +20 -0
  209. package/src/i3s-server/utils/server-utils.ts +70 -0
  210. package/src/lib/utils/cli-utils.ts +78 -0
  211. package/src/lib/utils/compress-util.ts +1 -1
  212. package/src/lib/utils/lod-conversion-utils.ts +10 -6
  213. package/src/pgm-loader.ts +15 -7
  214. package/src/slpk-extractor/slpk-extractor.ts +101 -0
  215. package/src/slpk-extractor-cli.ts +128 -0
  216. package/dist/3d-tiles-attributes-worker.d.ts +0 -28
  217. package/dist/3d-tiles-attributes-worker.d.ts.map +0 -1
  218. package/dist/3d-tiles-attributes-worker.js +0 -3
  219. package/dist/3d-tiles-attributes-worker.js.map +0 -7
  220. package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -288
  221. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +0 -269
  222. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -23
  223. package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -52
  224. package/dist/3d-tiles-converter/json-templates/tileset.js +0 -43
  225. package/dist/bundle.js +0 -5
  226. package/dist/constants.js +0 -4
  227. package/dist/converter-cli.js +0 -280
  228. package/dist/deps-installer/deps-installer.js +0 -62
  229. package/dist/es5/3d-tiles-attributes-worker.js +0 -25
  230. package/dist/es5/3d-tiles-attributes-worker.js.map +0 -1
  231. package/dist/es5/i3s-attributes-worker.js +0 -25
  232. package/dist/es5/i3s-attributes-worker.js.map +0 -1
  233. package/dist/es5/i3s-server/bin/www +0 -102
  234. package/dist/es5/workers/3d-tiles-attributes-worker.js +0 -28
  235. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +0 -1
  236. package/dist/es5/workers/i3s-attributes-worker.js +0 -30
  237. package/dist/es5/workers/i3s-attributes-worker.js.map +0 -1
  238. package/dist/esm/3d-tiles-attributes-worker.js +0 -16
  239. package/dist/esm/3d-tiles-attributes-worker.js.map +0 -1
  240. package/dist/esm/i3s-attributes-worker.js +0 -16
  241. package/dist/esm/i3s-attributes-worker.js.map +0 -1
  242. package/dist/esm/i3s-server/bin/www +0 -102
  243. package/dist/esm/workers/3d-tiles-attributes-worker.js +0 -8
  244. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +0 -1
  245. package/dist/esm/workers/i3s-attributes-worker.js +0 -7
  246. package/dist/esm/workers/i3s-attributes-worker.js.map +0 -1
  247. package/dist/i3s-attributes-worker.d.ts +0 -45
  248. package/dist/i3s-attributes-worker.d.ts.map +0 -1
  249. package/dist/i3s-attributes-worker.js +0 -9
  250. package/dist/i3s-attributes-worker.js.map +0 -7
  251. package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -138
  252. package/dist/i3s-converter/helpers/coordinate-converter.js +0 -123
  253. package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -28
  254. package/dist/i3s-converter/helpers/feature-attributes.js +0 -216
  255. package/dist/i3s-converter/helpers/geometry-attributes.js +0 -202
  256. package/dist/i3s-converter/helpers/geometry-converter.js +0 -1225
  257. package/dist/i3s-converter/helpers/gltf-attributes.js +0 -128
  258. package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -53
  259. package/dist/i3s-converter/helpers/node-debug.js +0 -120
  260. package/dist/i3s-converter/helpers/node-index-document.js +0 -268
  261. package/dist/i3s-converter/helpers/node-pages.js +0 -316
  262. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -76
  263. package/dist/i3s-converter/helpers/tileset-traversal.js +0 -29
  264. package/dist/i3s-converter/i3s-converter.js +0 -911
  265. package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -87
  266. package/dist/i3s-converter/json-templates/layers.js +0 -139
  267. package/dist/i3s-converter/json-templates/metadata.js +0 -25
  268. package/dist/i3s-converter/json-templates/node.js +0 -89
  269. package/dist/i3s-converter/json-templates/scene-server.js +0 -31
  270. package/dist/i3s-converter/json-templates/shared-resources.js +0 -129
  271. package/dist/i3s-converter/json-templates/store.js +0 -103
  272. package/dist/i3s-converter/types.js +0 -17
  273. package/dist/i3s-server/app.js +0 -22
  274. package/dist/i3s-server/controllers/index-controller.js +0 -23
  275. package/dist/i3s-server/controllers/slpk-controller.js +0 -32
  276. package/dist/i3s-server/routes/index.js +0 -16
  277. package/dist/i3s-server/routes/slpk-router.js +0 -33
  278. package/dist/i3s-server/utils/create-scene-server.js +0 -14
  279. package/dist/index.js +0 -10
  280. package/dist/lib/utils/compress-util.js +0 -257
  281. package/dist/lib/utils/file-utils.js +0 -139
  282. package/dist/lib/utils/geometry-utils.js +0 -18
  283. package/dist/lib/utils/lod-conversion-utils.js +0 -76
  284. package/dist/lib/utils/queue.js +0 -18
  285. package/dist/lib/utils/statistic-utills.js +0 -64
  286. package/dist/lib/utils/write-queue.js +0 -80
  287. package/dist/pgm-loader.js +0 -24
  288. package/dist/workers/3d-tiles-attributes-worker.d.ts +0 -2
  289. package/dist/workers/3d-tiles-attributes-worker.d.ts.map +0 -1
  290. package/dist/workers/3d-tiles-attributes-worker.js +0 -9
  291. package/dist/workers/i3s-attributes-worker.d.ts +0 -2
  292. package/dist/workers/i3s-attributes-worker.d.ts.map +0 -1
  293. package/dist/workers/i3s-attributes-worker.js +0 -5
  294. package/src/3d-tiles-attributes-worker.ts +0 -43
  295. package/src/i3s-attributes-worker.ts +0 -59
  296. package/src/i3s-server/bin/www +0 -102
  297. package/src/i3s-server/controllers/slpk-controller.js +0 -38
  298. package/src/i3s-server/utils/create-scene-server.js +0 -15
  299. package/src/workers/3d-tiles-attributes-worker.ts +0 -6
  300. package/src/workers/i3s-attributes-worker.ts +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js", "../../../node_modules/@babel/runtime/helpers/typeof.js", "../../../node_modules/@babel/runtime/helpers/classCallCheck.js", "../../../node_modules/@babel/runtime/helpers/toPrimitive.js", "../../../node_modules/@babel/runtime/helpers/toPropertyKey.js", "../../../node_modules/@babel/runtime/helpers/createClass.js", "../../../node_modules/@babel/runtime/helpers/setPrototypeOf.js", "../../../node_modules/@babel/runtime/helpers/inherits.js", "../../../node_modules/@babel/runtime/helpers/assertThisInitialized.js", "../../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js", "../../../node_modules/@babel/runtime/helpers/getPrototypeOf.js", "../../../node_modules/@math.gl/core/src/lib/assert.ts", "../../../node_modules/@math.gl/core/src/lib/common.ts", "../../../node_modules/@math.gl/core/src/classes/base/math-array.ts", "../../../node_modules/@math.gl/core/src/lib/validators.ts", "../../../node_modules/@math.gl/core/src/classes/base/vector.ts", "../../../node_modules/gl-matrix/cjs/common.js", "../../../node_modules/gl-matrix/cjs/vec2.js", "../../../node_modules/@math.gl/core/src/lib/gl-matrix-extras.ts", "../../../node_modules/@math.gl/core/src/classes/vector2.ts", "../../../node_modules/gl-matrix/cjs/vec3.js", "../../../node_modules/@math.gl/core/src/classes/vector3.ts", "../../../node_modules/@math.gl/core/src/classes/vector4.ts", "../../../node_modules/@math.gl/core/src/classes/base/matrix.ts", "../../../node_modules/gl-matrix/cjs/mat3.js", "../../../node_modules/@math.gl/core/src/classes/matrix3.ts", "../../../node_modules/gl-matrix/cjs/mat4.js", "../../../node_modules/gl-matrix/cjs/vec4.js", "../../../node_modules/@math.gl/core/src/classes/matrix4.ts", "../../../node_modules/gl-matrix/cjs/quat.js", "../../../node_modules/@math.gl/core/src/classes/quaternion.ts", "../../../node_modules/@babel/runtime/helpers/arrayWithHoles.js", "../../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js", "../../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js", "../../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js", "../../../node_modules/@babel/runtime/helpers/nonIterableRest.js", "../../../node_modules/@babel/runtime/helpers/slicedToArray.js", "../../../node_modules/@babel/runtime/helpers/defineProperty.js", "../../../node_modules/@math.gl/core/src/classes/spherical-coordinates.ts", "../../../node_modules/@math.gl/core/src/classes/euler.ts", "../../../node_modules/@math.gl/core/src/classes/pose.ts", "../../../node_modules/@math.gl/core/src/lib/math-utils.ts", "../../../node_modules/@math.gl/core/src/index.ts", "../../../node_modules/@math.gl/geospatial/src/constants.ts", "../../../node_modules/@math.gl/geospatial/src/type-utils.ts", "../../../node_modules/@math.gl/geospatial/src/ellipsoid/helpers/scale-to-geodetic-surface.ts", "../../../node_modules/@math.gl/geospatial/src/ellipsoid/helpers/ellipsoid-transform.ts", "../../../node_modules/@math.gl/geospatial/src/ellipsoid/ellipsoid.ts", "../../../node_modules/@math.gl/geospatial/src/index.ts", "../../../node_modules/crypt/crypt.js", "../../../node_modules/charenc/charenc.js", "../../../node_modules/is-buffer/index.js", "../../../node_modules/md5/md5.js", "../../worker-utils/src/lib/worker-utils/get-transfer-list.ts", "../../worker-utils/src/lib/worker-farm/worker-body.ts", "../../worker-utils/src/lib/async-queue/async-queue.ts", "../../worker-utils/src/lib/worker-api/create-worker.ts", "../src/i3s-converter/helpers/geometry-converter.ts", "../../loader-utils/src/lib/env-utils/assert.ts", "../../loader-utils/src/lib/binary-utils/array-buffer-utils.ts", "../src/i3s-converter/helpers/batch-ids-extensions.ts", "../../math/src/geometry/constants.ts", "../src/lib/utils/geometry-utils.ts", "../src/workers/i3s-attributes-worker.ts"],
4
- "sourcesContent": ["function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "export default function assert(condition: unknown, message?: string): void {\n if (!condition) {\n throw new Error(`math.gl assertion ${message}`);\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport {NumericArray} from '@math.gl/types';\nimport assert from './assert';\n\nimport type MathArray from '../classes/base/math-array';\n\nexport type ConfigurationOptions = {\n EPSILON: number;\n debug?: boolean;\n precision: number;\n printTypes?: boolean;\n printDegrees?: boolean;\n printRowMajor?: boolean;\n _cartographicRadians?: boolean;\n};\n\nconst RADIANS_TO_DEGREES = (1 / Math.PI) * 180;\nconst DEGREES_TO_RADIANS = (1 / 180) * Math.PI;\n\n// TODO - remove\nexport const config: ConfigurationOptions = {\n EPSILON: 1e-12,\n debug: false,\n precision: 4,\n printTypes: false,\n printDegrees: false,\n printRowMajor: true\n};\n\nexport function configure(options?: Partial<ConfigurationOptions>): ConfigurationOptions {\n // Only copy existing keys\n for (const key in options) {\n assert(key in config);\n config[key] = options[key];\n }\n return config;\n}\n\n/**\n * Formats a value into a string\n * @param value\n * @param param1\n * @returns\n */\nexport function formatValue(\n value: number,\n {precision = config.precision}: {precision?: number} = {}\n): string {\n value = round(value);\n // get rid of trailing zeros\n return `${parseFloat(value.toPrecision(precision))}`;\n}\n\n/**\n * Check if value is an \"array\"\n * Returns `true` if value is either an array or a typed array\n *\n * Note: returns `false` for `ArrayBuffer` and `DataView` instances\n */\nexport function isArray(value: unknown): boolean {\n return Array.isArray(value) || (ArrayBuffer.isView(value) && !(value instanceof DataView));\n}\n\nexport function clone(array: NumericArray | MathArray): NumericArray {\n return 'clone' in array ? array.clone() : array.slice();\n}\n\nexport function toRadians(degrees: number): number;\nexport function toRadians(degrees: NumericArray): NumericArray;\n\nexport function toRadians(degrees: number | NumericArray): number | NumericArray {\n return radians(degrees as NumericArray);\n}\n\nexport function toDegrees(degrees: number): number;\nexport function toDegrees(degrees: NumericArray): NumericArray;\n\nexport function toDegrees(radians: number | NumericArray): number | NumericArray {\n return degrees(radians as NumericArray);\n}\n\n// GLSL math function equivalents - Works on both single values and vectors\n\n/**\n * \"GLSL equivalent\" radians: Works on single values and vectors\n */\nexport function radians(degrees: number): number;\nexport function radians(degrees: NumericArray, result?: NumericArray): NumericArray;\n\nexport function radians(\n degrees: number | NumericArray,\n result?: NumericArray\n): number | NumericArray {\n return map(degrees, (degrees) => degrees * DEGREES_TO_RADIANS, result);\n}\n\n/**\n * \"GLSL equivalent\" degrees: Works on single values and vectors\n */\nexport function degrees(radians: number): number;\nexport function degrees(radians: NumericArray, result?: NumericArray): NumericArray;\n\nexport function degrees(\n radians: number | NumericArray,\n result?: NumericArray\n): number | NumericArray {\n return map(radians, (radians) => radians * RADIANS_TO_DEGREES, result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.sin`: Works on single values and vectors\n * @deprecated\n */\nexport function sin(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.sin(angle), result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.cos`: Works on single values and vectors\n * @deprecated\n */\nexport function cos(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.cos(angle), result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.tan`: Works on single values and vectors\n * @deprecated\n */\nexport function tan(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.tan(angle), result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.asin`: Works on single values and vectors\n * @deprecated\n */\nexport function asin(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.asin(angle), result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.acos`: Works on single values and vectors\n * @deprecated\n */\nexport function acos(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.acos(angle), result);\n}\n\n/**\n * \"GLSL equivalent\" of `Math.atan`: Works on single values and vectors\n * @deprecated\n */\nexport function atan(radians: number | NumericArray, result?: NumericArray): number | NumericArray {\n return map(radians, (angle) => Math.atan(angle), result);\n}\n\n/**\n * GLSL style value clamping: Works on single values and vectors\n */\nexport function clamp(value: number, min: number, max: number): number;\nexport function clamp(value: NumericArray, min: number, max: number): NumericArray;\n\nexport function clamp(\n value: number | NumericArray,\n min: number,\n max: number\n): number | NumericArray {\n return map(value, (value) => Math.max(min, Math.min(max, value)));\n}\n\n/**\n * Interpolate between two numbers or two arrays\n */\nexport function lerp(a: number, b: number, t: number): number;\nexport function lerp(a: NumericArray, b: NumericArray, t: number): NumericArray;\n\nexport function lerp(\n a: number | NumericArray,\n b: number | NumericArray,\n t: number\n): number | NumericArray {\n if (isArray(a)) {\n return (a as NumericArray).map((ai: number, i: number) => lerp(ai, (b as NumericArray)[i], t));\n }\n return t * (b as number) + (1 - t) * (a as number);\n}\n\n/* eslint-disable */\n\n/**\n * Compares any two math objects, using `equals` method if available.\n * @param a\n * @param b\n * @param epsilon\n * @returns\n */\nexport function equals(a: any, b: any, epsilon?: number): boolean {\n const oldEpsilon = config.EPSILON;\n if (epsilon) {\n config.EPSILON = epsilon;\n }\n try {\n if (a === b) {\n return true;\n }\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n // eslint-disable-next-line max-depth\n if (!equals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (a && a.equals) {\n return a.equals(b);\n }\n if (b && b.equals) {\n return b.equals(a);\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.abs(a - b) <= config.EPSILON * Math.max(1, Math.abs(a), Math.abs(b));\n }\n return false;\n } finally {\n config.EPSILON = oldEpsilon;\n }\n}\n\nexport function exactEquals(a: any, b: any): boolean {\n if (a === b) {\n return true;\n }\n if (a && typeof a === 'object' && b && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.exactEquals) {\n return a.exactEquals(b);\n }\n }\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; ++i) {\n if (!exactEquals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n\n/* eslint-enable */\n\nexport function withEpsilon<T>(epsilon: number, func: () => T): T {\n const oldPrecision = config.EPSILON;\n config.EPSILON = epsilon;\n let value: T;\n try {\n value = func();\n } finally {\n config.EPSILON = oldPrecision;\n }\n return value;\n}\n\n// HELPERS\n\nfunction round(value: number): number {\n return Math.round(value / config.EPSILON) * config.EPSILON;\n}\n\n// If the array has a clone function, calls it, otherwise returns a copy\nfunction duplicateArray(array: NumericArray): NumericArray {\n // @ts-expect-error We check for math.gl class methods\n return array.clone ? array.clone() : (new Array(array.length) as number[]);\n}\n\n// If the argument value is an array, applies the func element wise,\n// otherwise applies func to the argument value\nfunction map(\n value: number | NumericArray,\n func: (x: number, index?: number, result?: NumericArray) => number,\n result?: NumericArray\n): number | NumericArray {\n if (isArray(value)) {\n const array = value as NumericArray;\n result = result || duplicateArray(array);\n for (let i = 0; i < result.length && i < array.length; ++i) {\n result[i] = func(value[i], i, result);\n }\n return result;\n }\n return func(value as number);\n}\n", "// math.gl, MIT License\nimport {NumericArray} from '@math.gl/types';\nimport {ConfigurationOptions, config, formatValue, equals, isArray} from '../../lib/common';\n\n/** Base class for vectors and matrices */\nexport default abstract class MathArray extends Array<number> {\n /** Number of elements (values) in this array */\n abstract get ELEMENTS(): number;\n\n abstract copy(vector: Readonly<NumericArray>): this;\n\n abstract fromObject(object: object): this;\n\n // Common methods\n\n /**\n * Clone the current object\n * @returns a new copy of this object\n */\n clone(): this {\n // @ts-expect-error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.\n return new this.constructor().copy(this); // eslint-disable-line\n }\n\n fromArray(array: Readonly<NumericArray>, offset: number = 0): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = array[i + offset];\n }\n return this.check();\n }\n\n toArray<TypedArray>(targetArray: TypedArray, offset?: number): TypedArray;\n toArray(targetArray?: number[], offset?: number): NumericArray;\n\n toArray(targetArray: NumericArray = [], offset: number = 0): NumericArray {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n targetArray[offset + i] = this[i];\n }\n return targetArray;\n }\n\n from(arrayOrObject: Readonly<NumericArray> | object): this {\n return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);\n }\n\n to<T extends NumericArray | object>(arrayOrObject: T): T {\n // @ts-ignore\n if (arrayOrObject === this) {\n return this;\n }\n // @ts-expect-error TS2339: Property 'toObject' does not exist on type 'MathArray'.\n return isArray(arrayOrObject) ? this.toArray(arrayOrObject) : this.toObject(arrayOrObject);\n }\n\n toTarget(target: this): this {\n return target ? this.to(target) : this;\n }\n\n /** @deprecated */\n toFloat32Array(): Float32Array {\n return new Float32Array(this);\n }\n\n toString(): string {\n return this.formatString(config);\n }\n\n /** Formats string according to options */\n formatString(opts: ConfigurationOptions): string {\n let string = '';\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += (i > 0 ? ', ' : '') + formatValue(this[i], opts);\n }\n return `${opts.printTypes ? this.constructor.name : ''}[${string}]`;\n }\n\n equals(array: Readonly<NumericArray>): boolean {\n if (!array || this.length !== array.length) {\n return false;\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (!equals(this[i], array[i])) {\n return false;\n }\n }\n return true;\n }\n\n exactEquals(array: Readonly<NumericArray>): boolean {\n if (!array || this.length !== array.length) {\n return false;\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n if (this[i] !== array[i]) {\n return false;\n }\n }\n return true;\n }\n\n // Modifiers\n\n /** Negates all values in this object */\n negate(): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = -this[i];\n }\n return this.check();\n }\n\n /** Linearly interpolates between two values */\n lerp(a: Readonly<NumericArray>, t: number): this;\n lerp(a: Readonly<NumericArray>, b: Readonly<NumericArray>, t: number): this;\n\n lerp(a: Readonly<NumericArray>, b: Readonly<NumericArray> | number, t?: number): this {\n if (t === undefined) {\n return this.lerp(this, a, b as number);\n }\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const ai = a[i];\n this[i] = ai + t * (b[i] - ai);\n }\n return this.check();\n }\n\n /** Minimal */\n min(vector: Readonly<NumericArray>): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(vector[i], this[i]);\n }\n return this.check();\n }\n\n /** Maximal */\n max(vector: Readonly<NumericArray>): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.max(vector[i], this[i]);\n }\n return this.check();\n }\n\n clamp(minVector: Readonly<NumericArray>, maxVector: Readonly<NumericArray>): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], minVector[i]), maxVector[i]);\n }\n return this.check();\n }\n\n add(...vectors: Readonly<NumericArray>[]): this {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += vector[i];\n }\n }\n return this.check();\n }\n\n subtract(...vectors: Readonly<NumericArray>[]): this {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] -= vector[i];\n }\n }\n return this.check();\n }\n\n scale(scale: number | Readonly<NumericArray>): this {\n if (typeof scale === 'number') {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scale;\n }\n } else {\n for (let i = 0; i < this.ELEMENTS && i < scale.length; ++i) {\n this[i] *= scale[i];\n }\n }\n return this.check();\n }\n\n /**\n * Multiplies all elements by `scale`\n * Note: `Matrix4.multiplyByScalar` only scales its 3x3 \"minor\"\n */\n multiplyByScalar(scalar: number): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n return this.check();\n }\n\n // Debug checks\n\n /** Throws an error if array length is incorrect or contains illegal values */\n check(): this {\n if (config.debug && !this.validate()) {\n throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);\n }\n return this;\n }\n\n /** Returns false if the array length is incorrect or contains illegal values */\n validate(): boolean {\n let valid = this.length === this.ELEMENTS;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n valid = valid && Number.isFinite(this[i]);\n }\n return valid;\n }\n\n // three.js compatibility\n\n /** @deprecated */\n sub(a: Readonly<NumericArray>): this {\n return this.subtract(a);\n }\n\n /** @deprecated */\n setScalar(a: number): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = a;\n }\n return this.check();\n }\n\n /** @deprecated */\n addScalar(a: number): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] += a;\n }\n return this.check();\n }\n\n /** @deprecated */\n subScalar(a: number): this {\n return this.addScalar(-a);\n }\n\n /** @deprecated */\n multiplyScalar(scalar: number): this {\n // Multiplies all elements\n // `Matrix4.scale` only scales its 3x3 \"minor\"\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= scalar;\n }\n return this.check();\n }\n\n /** @deprecated */\n divideScalar(a: number): this {\n return this.multiplyByScalar(1 / a);\n }\n\n /** @deprecated */\n clampScalar(min: number, max: number): this {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] = Math.min(Math.max(this[i], min), max);\n }\n return this.check();\n }\n\n /** @deprecated */\n get elements(): NumericArray {\n return this;\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport {NumberArray} from '@math.gl/types';\nimport {config} from './common';\n\nexport function validateVector(v: NumberArray, length: number): boolean {\n if (v.length !== length) {\n return false;\n }\n // Could be arguments \"array\" (v.every not availasble)\n for (let i = 0; i < v.length; ++i) {\n if (!Number.isFinite(v[i])) {\n return false;\n }\n }\n return true;\n}\n\nexport function checkNumber(value: any): number {\n if (!Number.isFinite(value)) {\n throw new Error(`Invalid number ${value}`);\n }\n return value as number;\n}\n\nexport function checkVector<T extends NumberArray>(\n v: T,\n length: number,\n callerName: string = ''\n): T {\n if (config.debug && !validateVector(v, length)) {\n throw new Error(`math.gl: ${callerName} some fields set to invalid numbers'`);\n }\n return v;\n}\n\nconst map = {};\n\nexport function deprecated(method: string, version: string): void {\n if (!map[method]) {\n map[method] = true;\n // eslint-disable-next-line\n console.warn(\n `${method} has been removed in version ${version}, see upgrade guide for more information`\n );\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport {NumericArray} from '@math.gl/types';\nimport MathArray from './math-array';\nimport {checkNumber} from '../../lib/validators';\nimport assert from '../../lib/assert';\n\n/** Base class for vectors with at least 2 elements */\nexport default abstract class Vector extends MathArray {\n // ACCESSORS\n\n get x(): number {\n return this[0];\n }\n\n set x(value: number) {\n this[0] = checkNumber(value);\n }\n\n get y(): number {\n return this[1];\n }\n\n set y(value: number) {\n this[1] = checkNumber(value);\n }\n\n /**\n * Returns the length of the vector from the origin to the point described by this vector\n *\n * @note `length` is a reserved word for Arrays, so `v.length()` will return number of elements\n * Instead we provide `len` and `magnitude`\n */\n len(): number {\n return Math.sqrt(this.lengthSquared());\n }\n\n /**\n * Returns the length of the vector from the origin to the point described by this vector\n */\n magnitude(): number {\n return this.len();\n }\n\n /**\n * Returns the squared length of the vector from the origin to the point described by this vector\n */\n lengthSquared(): number {\n let length = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n length += this[i] * this[i];\n }\n return length;\n }\n\n /**\n * Returns the squared length of the vector from the origin to the point described by this vector\n */\n magnitudeSquared(): number {\n return this.lengthSquared();\n }\n\n distance(mathArray: Readonly<NumericArray>): number {\n return Math.sqrt(this.distanceSquared(mathArray));\n }\n\n distanceSquared(mathArray: Readonly<NumericArray>): number {\n let length = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n const dist = this[i] - mathArray[i];\n length += dist * dist;\n }\n return checkNumber(length);\n }\n\n dot(mathArray: Readonly<NumericArray>): number {\n let product = 0;\n for (let i = 0; i < this.ELEMENTS; ++i) {\n product += this[i] * mathArray[i];\n }\n return checkNumber(product);\n }\n\n // MODIFIERS\n\n normalize(): this {\n const length = this.magnitude();\n if (length !== 0) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= length;\n }\n }\n return this.check();\n }\n\n multiply(...vectors: Readonly<NumericArray>[]): this {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] *= vector[i];\n }\n }\n return this.check();\n }\n\n divide(...vectors: Readonly<NumericArray>[]): this {\n for (const vector of vectors) {\n for (let i = 0; i < this.ELEMENTS; ++i) {\n this[i] /= vector[i];\n }\n }\n return this.check();\n }\n\n // THREE.js compatibility\n\n lengthSq(): number {\n return this.lengthSquared();\n }\n distanceTo(vector: Readonly<NumericArray>): number {\n return this.distance(vector);\n }\n distanceToSquared(vector: Readonly<NumericArray>): number {\n return this.distanceSquared(vector);\n }\n\n getComponent(i: number): number {\n assert(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n return checkNumber(this[i]);\n }\n\n setComponent(i: number, value: number): this {\n assert(i >= 0 && i < this.ELEMENTS, 'index is out of range');\n this[i] = value;\n return this.check();\n }\n\n addVectors(a: Readonly<NumericArray>, b: Readonly<NumericArray>): this {\n return this.copy(a).add(b);\n }\n\n subVectors(a: Readonly<NumericArray>, b: Readonly<NumericArray>): this {\n return this.copy(a).subtract(b);\n }\n\n multiplyVectors(a: Readonly<NumericArray>, b: Readonly<NumericArray>): this {\n return this.copy(a).multiply(b);\n }\n\n addScaledVector(a: Readonly<NumericArray>, b: number): this {\n // @ts-expect-error error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.\n return this.add(new this.constructor(a).multiplyScalar(b));\n }\n}\n", "\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.setMatrixArrayType = setMatrixArrayType;\nexports.toRadian = toRadian;\nexports.equals = equals;\nexports.RANDOM = exports.ARRAY_TYPE = exports.EPSILON = void 0;\n\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nexports.EPSILON = EPSILON;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexports.ARRAY_TYPE = ARRAY_TYPE;\nvar RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nexports.RANDOM = RANDOM;\n\nfunction setMatrixArrayType(type) {\n exports.ARRAY_TYPE = ARRAY_TYPE = type;\n}\n\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\n\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.clone = clone;\nexports.fromValues = fromValues;\nexports.copy = copy;\nexports.set = set;\nexports.add = add;\nexports.subtract = subtract;\nexports.multiply = multiply;\nexports.divide = divide;\nexports.ceil = ceil;\nexports.floor = floor;\nexports.min = min;\nexports.max = max;\nexports.round = round;\nexports.scale = scale;\nexports.scaleAndAdd = scaleAndAdd;\nexports.distance = distance;\nexports.squaredDistance = squaredDistance;\nexports.length = length;\nexports.squaredLength = squaredLength;\nexports.negate = negate;\nexports.inverse = inverse;\nexports.normalize = normalize;\nexports.dot = dot;\nexports.cross = cross;\nexports.lerp = lerp;\nexports.random = random;\nexports.transformMat2 = transformMat2;\nexports.transformMat2d = transformMat2d;\nexports.transformMat3 = transformMat3;\nexports.transformMat4 = transformMat4;\nexports.rotate = rotate;\nexports.angle = angle;\nexports.zero = zero;\nexports.str = str;\nexports.exactEquals = exactEquals;\nexports.equals = equals;\nexports.forEach = exports.sqrLen = exports.sqrDist = exports.dist = exports.div = exports.mul = exports.sub = exports.len = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(2);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\n\nfunction clone(a) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\n\nfunction fromValues(x, y) {\n var out = new glMatrix.ARRAY_TYPE(2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\n\nvar len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nexports.len = len;\nvar sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nexports.sub = sub;\nvar mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nexports.mul = mul;\nvar div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nexports.div = div;\nvar dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nexports.dist = dist;\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nexports.sqrDist = sqrDist;\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexports.sqrLen = sqrLen;\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\nexports.forEach = forEach;", "/* eslint-disable camelcase */\nimport {NumericArray} from '@math.gl/types';\n// vec2 additions\n\nexport function vec2_transformMat4AsVector<T extends NumericArray>(\n out: T,\n a: Readonly<NumericArray>,\n m: Readonly<NumericArray>\n): T {\n const x = a[0];\n const y = a[1];\n const w = m[3] * x + m[7] * y || 1.0;\n out[0] = (m[0] * x + m[4] * y) / w;\n out[1] = (m[1] * x + m[5] * y) / w;\n return out;\n}\n\n// vec3 additions\n\n// Transform as vector, only uses 3x3 minor matrix\nexport function vec3_transformMat4AsVector<T extends NumericArray>(\n out: T,\n a: Readonly<NumericArray>,\n m: Readonly<NumericArray>\n): T {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n const w = m[3] * x + m[7] * y + m[11] * z || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z) / w;\n return out;\n}\n\nexport function vec3_transformMat2<T extends NumericArray>(\n out: T,\n a: Readonly<NumericArray>,\n m: Readonly<NumericArray>\n): T {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n return out;\n}\n\n// vec4 additions\n\nexport function vec4_transformMat2<T extends NumericArray>(\n out: T,\n a: Readonly<NumericArray>,\n m: Readonly<NumericArray>\n): T {\n const x = a[0];\n const y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\nexport function vec4_transformMat3<T extends NumericArray>(\n out: T,\n a: Readonly<NumericArray>,\n m: Readonly<NumericArray>\n): T {\n const x = a[0];\n const y = a[1];\n const z = a[2];\n out[0] = m[0] * x + m[3] * y + m[6] * z;\n out[1] = m[1] * x + m[4] * y + m[7] * z;\n out[2] = m[2] * x + m[5] * y + m[8] * z;\n out[3] = a[3];\n return out;\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport Vector from './base/vector';\nimport {config, isArray} from '../lib/common';\nimport {checkNumber} from '../lib/validators';\nimport * as vec2 from 'gl-matrix/vec2';\n/* eslint-disable camelcase */\nimport {vec2_transformMat4AsVector} from '../lib/gl-matrix-extras';\nimport {NumericArray} from '@math.gl/types';\n\n/**\n * Two-element vector class.\n * Subclass of Array<number>\n */\nexport default class Vector2 extends Vector {\n // Creates a new, empty vec2\n constructor(x: number | Readonly<NumericArray> = 0, y: number = 0) {\n // PERF NOTE: initialize elements as double precision numbers\n super(2); // -0, -0);\n if (isArray(x) && arguments.length === 1) {\n this.copy(x as Readonly<NumericArray>);\n } else {\n if (config.debug) {\n checkNumber(x);\n checkNumber(y);\n }\n this[0] = x as number;\n this[1] = y;\n }\n }\n\n set(x: number, y: number): this {\n this[0] = x;\n this[1] = y;\n return this.check();\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n return this.check();\n }\n\n fromObject(object: {x: number; y: number}): this {\n if (config.debug) {\n checkNumber(object.x);\n checkNumber(object.y);\n }\n this[0] = object.x;\n this[1] = object.y;\n return this.check();\n }\n\n toObject(object: {x?: number; y?: number}): {x: number; y: number} {\n object.x = this[0];\n object.y = this[1];\n return object as {x: number; y: number};\n }\n\n // Getters/setters\n\n get ELEMENTS(): number {\n return 2;\n }\n\n /**\n * Returns angle from x axis\n * @returns\n */\n horizontalAngle(): number {\n return Math.atan2(this.y, this.x);\n }\n\n /**\n * Returns angle from y axis\n * @returns\n */\n verticalAngle(): number {\n return Math.atan2(this.x, this.y);\n }\n\n // Transforms\n\n /**\n * Transforms as point\n * @param matrix4\n * @returns\n */\n transform(matrix4: Readonly<NumericArray>): this {\n return this.transformAsPoint(matrix4);\n }\n\n /**\n * transforms as point (4th component is implicitly 1)\n * @param matrix4\n * @returns\n */\n transformAsPoint(matrix4: Readonly<NumericArray>): this {\n vec2.transformMat4(this, this, matrix4);\n return this.check();\n }\n\n /**\n * transforms as vector (4th component is implicitly 0, ignores translation. slightly faster)\n * @param matrix4\n * @returns\n */\n transformAsVector(matrix4: Readonly<NumericArray>): this {\n vec2_transformMat4AsVector(this, this, matrix4);\n return this.check();\n }\n\n transformByMatrix3(matrix3: Readonly<NumericArray>): this {\n vec2.transformMat3(this, this, matrix3);\n return this.check();\n }\n\n transformByMatrix2x3(matrix2x3: Readonly<NumericArray>): this {\n vec2.transformMat2d(this, this, matrix2x3);\n return this.check();\n }\n\n transformByMatrix2(matrix2: Readonly<NumericArray>): this {\n vec2.transformMat2(this, this, matrix2);\n return this.check();\n }\n}\n", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.clone = clone;\nexports.length = length;\nexports.fromValues = fromValues;\nexports.copy = copy;\nexports.set = set;\nexports.add = add;\nexports.subtract = subtract;\nexports.multiply = multiply;\nexports.divide = divide;\nexports.ceil = ceil;\nexports.floor = floor;\nexports.min = min;\nexports.max = max;\nexports.round = round;\nexports.scale = scale;\nexports.scaleAndAdd = scaleAndAdd;\nexports.distance = distance;\nexports.squaredDistance = squaredDistance;\nexports.squaredLength = squaredLength;\nexports.negate = negate;\nexports.inverse = inverse;\nexports.normalize = normalize;\nexports.dot = dot;\nexports.cross = cross;\nexports.lerp = lerp;\nexports.hermite = hermite;\nexports.bezier = bezier;\nexports.random = random;\nexports.transformMat4 = transformMat4;\nexports.transformMat3 = transformMat3;\nexports.transformQuat = transformQuat;\nexports.rotateX = rotateX;\nexports.rotateY = rotateY;\nexports.rotateZ = rotateZ;\nexports.angle = angle;\nexports.zero = zero;\nexports.str = str;\nexports.exactEquals = exactEquals;\nexports.equals = equals;\nexports.forEach = exports.sqrLen = exports.len = exports.sqrDist = exports.dist = exports.div = exports.mul = exports.sub = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(3);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\n\nfunction clone(a) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\n\nfunction fromValues(x, y, z) {\n var out = new glMatrix.ARRAY_TYPE(3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n var z = glMatrix.RANDOM() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\n\nvar sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nexports.sub = sub;\nvar mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nexports.mul = mul;\nvar div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nexports.div = div;\nvar dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nexports.dist = dist;\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nexports.sqrDist = sqrDist;\nvar len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nexports.len = len;\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexports.sqrLen = sqrLen;\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\nexports.forEach = forEach;", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport {NumericArray} from '@math.gl/types';\nimport Vector from './base/vector';\nimport {config, isArray} from '../lib/common';\nimport {checkNumber} from '../lib/validators';\nimport * as vec3 from 'gl-matrix/vec3';\n/* eslint-disable camelcase */\nimport {vec3_transformMat2, vec3_transformMat4AsVector} from '../lib/gl-matrix-extras';\n\nconst ORIGIN = [0, 0, 0];\n\nlet ZERO: Vector3;\n\n/**\n * Three-element vector class.\n * Subclass of Array<number>\n */\nexport default class Vector3 extends Vector {\n static get ZERO(): Vector3 {\n if (!ZERO) {\n ZERO = new Vector3(0, 0, 0);\n Object.freeze(ZERO);\n }\n return ZERO;\n }\n\n /**\n * @class\n * @param x\n * @param y\n * @param z\n */\n constructor(x: number | Readonly<NumericArray> = 0, y: number = 0, z: number = 0) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0);\n if (arguments.length === 1 && isArray(x)) {\n this.copy(x as NumericArray);\n } else {\n // this.set(x, y, z);\n if (config.debug) {\n checkNumber(x);\n checkNumber(y);\n checkNumber(z);\n }\n // @ts-expect-error TS2412: Property '0' of type 'number | [number, number, number]' is not assignable to numeric index type 'number'\n this[0] = x;\n this[1] = y;\n this[2] = z;\n }\n }\n\n set(x: number, y: number, z: number): this {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n return this.check();\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n return this.check();\n }\n\n fromObject(object: {x: number; y: number; z: number}): this {\n if (config.debug) {\n checkNumber(object.x);\n checkNumber(object.y);\n checkNumber(object.z);\n }\n this[0] = object.x;\n this[1] = object.y;\n this[2] = object.z;\n return this.check();\n }\n\n toObject(object: {x?: number; y?: number; z?: number}): {x: number; y: number; z: number} {\n object.x = this[0];\n object.y = this[1];\n object.z = this[2];\n return object as {x: number; y: number; z: number};\n }\n\n // Getters/setters\n\n get ELEMENTS(): number {\n return 3;\n }\n get z(): number {\n return this[2];\n }\n set z(value: number) {\n this[2] = checkNumber(value);\n }\n\n // ACCESSORS\n\n angle(vector: Readonly<NumericArray>): number {\n return vec3.angle(this, vector);\n }\n\n // MODIFIERS\n\n cross(vector: Readonly<NumericArray>): this {\n vec3.cross(this, this, vector);\n return this.check();\n }\n\n rotateX({radians, origin = ORIGIN}: {radians: number; origin?: Readonly<NumericArray>}): this {\n vec3.rotateX(this, this, origin, radians);\n return this.check();\n }\n\n rotateY({radians, origin = ORIGIN}: {radians: number; origin?: Readonly<NumericArray>}): this {\n vec3.rotateY(this, this, origin, radians);\n return this.check();\n }\n\n rotateZ({radians, origin = ORIGIN}: {radians: number; origin?: Readonly<NumericArray>}): this {\n vec3.rotateZ(this, this, origin, radians);\n return this.check();\n }\n\n // Transforms\n\n // transforms as point (4th component is implicitly 1)\n transform(matrix4: Readonly<NumericArray>): this {\n return this.transformAsPoint(matrix4);\n }\n\n // transforms as point (4th component is implicitly 1)\n transformAsPoint(matrix4: Readonly<NumericArray>): this {\n vec3.transformMat4(this, this, matrix4);\n return this.check();\n }\n\n // transforms as vector (4th component is implicitly 0, ignores translation. slightly faster)\n transformAsVector(matrix4: Readonly<NumericArray>): this {\n vec3_transformMat4AsVector(this, this, matrix4);\n return this.check();\n }\n\n transformByMatrix3(matrix3: Readonly<NumericArray>): this {\n vec3.transformMat3(this, this, matrix3);\n return this.check();\n }\n\n transformByMatrix2(matrix2: Readonly<NumericArray>): this {\n vec3_transformMat2(this, this, matrix2);\n return this.check();\n }\n\n transformByQuaternion(quaternion: Readonly<NumericArray>): this {\n vec3.transformQuat(this, this, quaternion);\n return this.check();\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\n\nimport Vector from './base/vector';\nimport {config, isArray} from '../lib/common';\nimport {checkNumber} from '../lib/validators';\nimport * as vec4 from 'gl-matrix/vec3';\n/* eslint-disable camelcase */\nimport {vec4_transformMat2, vec4_transformMat3} from '../lib/gl-matrix-extras';\nimport {NumericArray} from '@math.gl/types';\n\nimport type Matrix4 from './matrix4';\n\nlet ZERO: Vector4;\n\n/**\n * Four-element vector class.\n * Subclass of Array<number>\n */\nexport default class Vector4 extends Vector {\n static get ZERO(): Vector4 {\n if (!ZERO) {\n ZERO = new Vector4(0, 0, 0, 0);\n Object.freeze(ZERO);\n }\n return ZERO;\n }\n\n constructor(x: number | Readonly<NumericArray> = 0, y: number = 0, z: number = 0, w: number = 0) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0);\n if (isArray(x) && arguments.length === 1) {\n this.copy(x as Readonly<NumericArray>);\n } else {\n // this.set(x, y, z, w);\n if (config.debug) {\n checkNumber(x);\n checkNumber(y);\n checkNumber(z);\n checkNumber(w);\n }\n this[0] = x as number;\n this[1] = y;\n this[2] = z;\n this[3] = w;\n }\n }\n\n set(x: number, y: number, z: number, w: number): this {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n this[3] = w;\n return this.check();\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n return this.check();\n }\n\n fromObject(object: {x: number; y: number; z: number; w: number}): this {\n if (config.debug) {\n checkNumber(object.x);\n checkNumber(object.y);\n checkNumber(object.z);\n checkNumber(object.w);\n }\n this[0] = object.x;\n this[1] = object.y;\n this[2] = object.z;\n this[3] = object.w;\n return this;\n }\n\n toObject(object: {x?: number; y?: number; z?: number; w?: number}): {\n x: number;\n y: number;\n z: number;\n w: number;\n } {\n object.x = this[0];\n object.y = this[1];\n object.z = this[2];\n object.w = this[3];\n return object as {\n x: number;\n y: number;\n z: number;\n w: number;\n };\n }\n\n // Getters/setters\n /* eslint-disable no-multi-spaces, brace-style, no-return-assign */\n get ELEMENTS(): number {\n return 4;\n }\n\n get z(): number {\n return this[2];\n }\n set z(value: number) {\n this[2] = checkNumber(value);\n }\n get w(): number {\n return this[3];\n }\n set w(value: number) {\n this[3] = checkNumber(value);\n }\n\n transform(matrix4: Readonly<NumericArray>): this {\n vec4.transformMat4(this, this, matrix4);\n return this.check();\n }\n\n transformByMatrix3(matrix3: Readonly<NumericArray>): this {\n vec4_transformMat3(this, this, matrix3);\n return this.check();\n }\n\n transformByMatrix2(matrix2: Readonly<NumericArray>): this {\n vec4_transformMat2(this, this, matrix2);\n return this.check();\n }\n\n transformByQuaternion(quaternion: Readonly<NumericArray>): this {\n vec4.transformQuat(this, this, quaternion);\n return this.check();\n }\n\n // three.js compatibility\n applyMatrix4(m: Matrix4): this {\n m.transform(this, this);\n return this;\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport {NumericArray} from '@math.gl/types';\nimport MathArray from './math-array';\nimport {checkNumber} from '../../lib/validators';\nimport {config} from '../../lib/common';\n\n/** Base class for matrices */\nexport default abstract class Matrix extends MathArray {\n abstract get RANK(): number;\n\n // fromObject(object) {\n // const array = object.elements;\n // return this.fromRowMajor(array);\n // }\n // toObject(object) {\n // const array = object.elements;\n // this.toRowMajor(array);\n // return object;\n // }\n\n // TODO better override formatString?\n toString(): string {\n let string = '[';\n if (config.printRowMajor) {\n string += 'row-major:';\n for (let row = 0; row < this.RANK; ++row) {\n for (let col = 0; col < this.RANK; ++col) {\n string += ` ${this[col * this.RANK + row]}`;\n }\n }\n } else {\n string += 'column-major:';\n for (let i = 0; i < this.ELEMENTS; ++i) {\n string += ` ${this[i]}`;\n }\n }\n string += ']';\n return string;\n }\n\n getElementIndex(row: number, col: number): number {\n return col * this.RANK + row;\n }\n\n // By default assumes row major indices\n getElement(row: number, col: number): number {\n return this[col * this.RANK + row];\n }\n\n // By default assumes row major indices\n setElement(row: number, col: number, value: number): this {\n this[col * this.RANK + row] = checkNumber(value);\n return this;\n }\n getColumn<NumArrayT>(columnIndex: number, result: NumArrayT): NumArrayT;\n getColumn(columnIndex: number): number[];\n\n getColumn(columnIndex: number, result: number[] = new Array(this.RANK).fill(-0)): number[] {\n const firstIndex = columnIndex * this.RANK;\n for (let i = 0; i < this.RANK; ++i) {\n result[i] = this[firstIndex + i];\n }\n return result;\n }\n\n setColumn(columnIndex: number, columnVector: Readonly<NumericArray>): this {\n const firstIndex = columnIndex * this.RANK;\n for (let i = 0; i < this.RANK; ++i) {\n this[firstIndex + i] = columnVector[i];\n }\n return this;\n }\n}\n", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.fromMat4 = fromMat4;\nexports.clone = clone;\nexports.copy = copy;\nexports.fromValues = fromValues;\nexports.set = set;\nexports.identity = identity;\nexports.transpose = transpose;\nexports.invert = invert;\nexports.adjoint = adjoint;\nexports.determinant = determinant;\nexports.multiply = multiply;\nexports.translate = translate;\nexports.rotate = rotate;\nexports.scale = scale;\nexports.fromTranslation = fromTranslation;\nexports.fromRotation = fromRotation;\nexports.fromScaling = fromScaling;\nexports.fromMat2d = fromMat2d;\nexports.fromQuat = fromQuat;\nexports.normalFromMat4 = normalFromMat4;\nexports.projection = projection;\nexports.str = str;\nexports.frob = frob;\nexports.add = add;\nexports.subtract = subtract;\nexports.multiplyScalar = multiplyScalar;\nexports.multiplyScalarAndAdd = multiplyScalarAndAdd;\nexports.exactEquals = exactEquals;\nexports.equals = equals;\nexports.sub = exports.mul = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(9);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\n\n\nfunction fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\n\nfunction clone(a) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\n\nfunction fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new glMatrix.ARRAY_TYPE(9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\n\nfunction set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\n\nfunction translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\n\nfunction rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\n\nfunction fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\n\nfunction normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\n\nfunction projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\n\nfunction str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\n\nvar mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nexports.mul = mul;\nvar sub = subtract;\nexports.sub = sub;", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport Matrix from './base/matrix';\nimport {checkVector} from '../lib/validators';\n/* eslint-disable camelcase */\nimport {vec4_transformMat3} from '../lib/gl-matrix-extras';\nimport * as mat3 from 'gl-matrix/mat3';\nimport * as vec2 from 'gl-matrix/vec2';\nimport * as vec3 from 'gl-matrix/vec3';\nimport {NumericArray} from '@math.gl/types';\n\nenum INDICES {\n COL0ROW0 = 0,\n COL0ROW1 = 1,\n COL0ROW2 = 2,\n COL1ROW0 = 3,\n COL1ROW1 = 4,\n COL1ROW2 = 5,\n COL2ROW0 = 6,\n COL2ROW1 = 7,\n COL2ROW2 = 8\n}\n\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n\nexport default class Matrix3 extends Matrix {\n static get IDENTITY(): Readonly<Matrix3> {\n return getIdentityMatrix();\n }\n\n static get ZERO(): Readonly<Matrix3> {\n return getZeroMatrix();\n }\n\n get ELEMENTS(): number {\n return 9;\n }\n\n get RANK(): number {\n return 3;\n }\n\n get INDICES(): typeof INDICES {\n return INDICES;\n }\n\n constructor(array?: Readonly<NumericArray>);\n /** @deprecated */\n constructor(...args: number[]);\n\n constructor(array?: number | Readonly<NumericArray>, ...args: number[]) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0);\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n } else if (args.length > 0) {\n this.copy([array as number, ...args]);\n } else {\n this.identity();\n }\n }\n\n copy(array: Readonly<NumericArray>): this {\n // Element wise copy for performance\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n return this.check();\n }\n\n // Constructors\n\n identity(): this {\n return this.copy(IDENTITY_MATRIX);\n }\n\n /**\n *\n * @param object\n * @returns self\n */\n fromObject(object: {[key: string]: any}): this {\n return this.check();\n }\n\n // Calculates a 3x3 matrix from the given quaternion\n // q quat Quaternion to create matrix from\n fromQuaternion(q: Readonly<NumericArray>): this {\n mat3.fromQuat(this, q);\n return this.check();\n }\n\n /**\n * accepts column major order, stores in column major order\n */\n // eslint-disable-next-line max-params\n set(\n m00: number,\n m10: number,\n m20: number,\n m01: number,\n m11: number,\n m21: number,\n m02: number,\n m12: number,\n m22: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m01;\n this[4] = m11;\n this[5] = m21;\n this[6] = m02;\n this[7] = m12;\n this[8] = m22;\n return this.check();\n }\n\n /**\n * accepts row major order, stores as column major\n */\n // eslint-disable-next-line max-params\n setRowMajor(\n m00: number,\n m01: number,\n m02: number,\n m10: number,\n m11: number,\n m12: number,\n m20: number,\n m21: number,\n m22: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m01;\n this[4] = m11;\n this[5] = m21;\n this[6] = m02;\n this[7] = m12;\n this[8] = m22;\n return this.check();\n }\n\n // Accessors\n\n determinant(): number {\n return mat3.determinant(this);\n }\n\n // Modifiers\n transpose(): this {\n mat3.transpose(this, this);\n return this.check();\n }\n\n /** Invert a matrix. Note that this can fail if the matrix is not invertible */\n invert(): this {\n mat3.invert(this, this);\n return this.check();\n }\n\n // Operations\n multiplyLeft(a: NumericArray): this {\n mat3.multiply(this, a, this);\n return this.check();\n }\n\n multiplyRight(a: NumericArray): this {\n mat3.multiply(this, this, a);\n return this.check();\n }\n\n rotate(radians: number): NumericArray {\n mat3.rotate(this, this, radians);\n return this.check();\n }\n\n scale(factor: NumericArray | number): this {\n if (Array.isArray(factor)) {\n mat3.scale(this, this, factor);\n } else {\n mat3.scale(this, this, [factor as number, factor as number]);\n }\n return this.check();\n }\n\n translate(vec: NumericArray): this {\n mat3.translate(this, this, vec);\n return this.check();\n }\n\n // Transforms\n transform(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n let out: NumericArray;\n switch (vector.length) {\n case 2:\n out = vec2.transformMat3(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3.transformMat3(result || [-0, -0, -0], vector, this);\n break;\n case 4:\n out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /** @deprecated */\n transformVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transform(vector, result);\n }\n\n /** @deprecated */\n transformVector2(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transform(vector, result);\n }\n\n /** @deprecated */\n transformVector3(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transform(vector, result);\n }\n}\n\nlet ZERO_MATRIX3;\nlet IDENTITY_MATRIX3;\n\nfunction getZeroMatrix(): Readonly<Matrix3> {\n if (!ZERO_MATRIX3) {\n ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO_MATRIX3);\n }\n return ZERO_MATRIX3;\n}\n\nfunction getIdentityMatrix(): Matrix3 {\n if (!IDENTITY_MATRIX3) {\n IDENTITY_MATRIX3 = new Matrix3();\n Object.freeze(IDENTITY_MATRIX3);\n }\n return IDENTITY_MATRIX3;\n}\n", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.clone = clone;\nexports.copy = copy;\nexports.fromValues = fromValues;\nexports.set = set;\nexports.identity = identity;\nexports.transpose = transpose;\nexports.invert = invert;\nexports.adjoint = adjoint;\nexports.determinant = determinant;\nexports.multiply = multiply;\nexports.translate = translate;\nexports.scale = scale;\nexports.rotate = rotate;\nexports.rotateX = rotateX;\nexports.rotateY = rotateY;\nexports.rotateZ = rotateZ;\nexports.fromTranslation = fromTranslation;\nexports.fromScaling = fromScaling;\nexports.fromRotation = fromRotation;\nexports.fromXRotation = fromXRotation;\nexports.fromYRotation = fromYRotation;\nexports.fromZRotation = fromZRotation;\nexports.fromRotationTranslation = fromRotationTranslation;\nexports.fromQuat2 = fromQuat2;\nexports.getTranslation = getTranslation;\nexports.getScaling = getScaling;\nexports.getRotation = getRotation;\nexports.fromRotationTranslationScale = fromRotationTranslationScale;\nexports.fromRotationTranslationScaleOrigin = fromRotationTranslationScaleOrigin;\nexports.fromQuat = fromQuat;\nexports.frustum = frustum;\nexports.perspectiveNO = perspectiveNO;\nexports.perspectiveZO = perspectiveZO;\nexports.perspectiveFromFieldOfView = perspectiveFromFieldOfView;\nexports.orthoNO = orthoNO;\nexports.orthoZO = orthoZO;\nexports.lookAt = lookAt;\nexports.targetTo = targetTo;\nexports.str = str;\nexports.frob = frob;\nexports.add = add;\nexports.subtract = subtract;\nexports.multiplyScalar = multiplyScalar;\nexports.multiplyScalarAndAdd = multiplyScalarAndAdd;\nexports.exactEquals = exactEquals;\nexports.equals = equals;\nexports.sub = exports.mul = exports.ortho = exports.perspective = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(16);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\n\nfunction clone(a) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new glMatrix.ARRAY_TYPE(16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < glMatrix.EPSILON) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\n\nfunction fromQuat2(out, a) {\n var translation = new glMatrix.ARRAY_TYPE(3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\n\nfunction getRotation(out, mat) {\n var scaling = new glMatrix.ARRAY_TYPE(3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\n\nfunction perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\n\nvar perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexports.perspective = perspective;\n\nfunction perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\n\nfunction orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\n\nvar ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexports.ortho = ortho;\n\nfunction orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\n\nvar mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nexports.mul = mul;\nvar sub = subtract;\nexports.sub = sub;", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.clone = clone;\nexports.fromValues = fromValues;\nexports.copy = copy;\nexports.set = set;\nexports.add = add;\nexports.subtract = subtract;\nexports.multiply = multiply;\nexports.divide = divide;\nexports.ceil = ceil;\nexports.floor = floor;\nexports.min = min;\nexports.max = max;\nexports.round = round;\nexports.scale = scale;\nexports.scaleAndAdd = scaleAndAdd;\nexports.distance = distance;\nexports.squaredDistance = squaredDistance;\nexports.length = length;\nexports.squaredLength = squaredLength;\nexports.negate = negate;\nexports.inverse = inverse;\nexports.normalize = normalize;\nexports.dot = dot;\nexports.cross = cross;\nexports.lerp = lerp;\nexports.random = random;\nexports.transformMat4 = transformMat4;\nexports.transformQuat = transformQuat;\nexports.zero = zero;\nexports.str = str;\nexports.exactEquals = exactEquals;\nexports.equals = equals;\nexports.forEach = exports.sqrLen = exports.len = exports.sqrDist = exports.dist = exports.div = exports.mul = exports.sub = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\n\nfunction clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\n\nfunction fromValues(x, y, z, w) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = glMatrix.RANDOM() * 2 - 1;\n v2 = glMatrix.RANDOM() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = glMatrix.RANDOM() * 2 - 1;\n v4 = glMatrix.RANDOM() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\n\nvar sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nexports.sub = sub;\nvar mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nexports.mul = mul;\nvar div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nexports.div = div;\nvar dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nexports.dist = dist;\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nexports.sqrDist = sqrDist;\nvar len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nexports.len = len;\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexports.sqrLen = sqrLen;\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\nexports.forEach = forEach;", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport Matrix from './base/matrix';\nimport {NumericArray} from '@math.gl/types';\nimport {checkVector} from '../lib/validators';\n\n/* eslint-disable camelcase */\nimport {vec2_transformMat4AsVector, vec3_transformMat4AsVector} from '../lib/gl-matrix-extras';\nimport * as mat4 from 'gl-matrix/mat4';\nimport * as vec2 from 'gl-matrix/vec2';\nimport * as vec3 from 'gl-matrix/vec3';\nimport * as vec4 from 'gl-matrix/vec4';\n\nenum INDICES {\n COL0ROW0 = 0,\n COL0ROW1 = 1,\n COL0ROW2 = 2,\n COL0ROW3 = 3,\n COL1ROW0 = 4,\n COL1ROW1 = 5,\n COL1ROW2 = 6,\n COL1ROW3 = 7,\n COL2ROW0 = 8,\n COL2ROW1 = 9,\n COL2ROW2 = 10,\n COL2ROW3 = 11,\n COL3ROW0 = 12,\n COL3ROW1 = 13,\n COL3ROW2 = 14,\n COL3ROW3 = 15\n}\n\nconst DEFAULT_FOVY = (45 * Math.PI) / 180;\nconst DEFAULT_ASPECT = 1;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 500;\n\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);\n\n/** 4x4 matrix */\nexport default class Matrix4 extends Matrix {\n static get IDENTITY(): Readonly<Matrix4> {\n return getIdentityMatrix();\n }\n\n static get ZERO(): Readonly<Matrix4> {\n return getZeroMatrix();\n }\n\n get ELEMENTS(): number {\n return 16;\n }\n\n get RANK(): number {\n return 4;\n }\n\n get INDICES(): typeof INDICES {\n return INDICES;\n }\n\n constructor(array?: Readonly<NumericArray>) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n } else {\n this.identity();\n }\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n this[9] = array[9];\n this[10] = array[10];\n this[11] = array[11];\n this[12] = array[12];\n this[13] = array[13];\n this[14] = array[14];\n this[15] = array[15];\n return this.check();\n }\n\n // eslint-disable-next-line max-params\n set(\n m00: number,\n m10: number,\n m20: number,\n m30: number,\n m01: number,\n m11: number,\n m21: number,\n m31: number,\n m02: number,\n m12: number,\n m22: number,\n m32: number,\n m03: number,\n m13: number,\n m23: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n // accepts row major order, stores as column major\n // eslint-disable-next-line max-params\n setRowMajor(\n m00: number,\n m01: number,\n m02: number,\n m03: number,\n m10: number,\n m11: number,\n m12: number,\n m13: number,\n m20: number,\n m21: number,\n m22: number,\n m23: number,\n m30: number,\n m31: number,\n m32: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n toRowMajor(result: NumericArray): NumericArray {\n result[0] = this[0];\n result[1] = this[4];\n result[2] = this[8];\n result[3] = this[12];\n result[4] = this[1];\n result[5] = this[5];\n result[6] = this[9];\n result[7] = this[13];\n result[8] = this[2];\n result[9] = this[6];\n result[10] = this[10];\n result[11] = this[14];\n result[12] = this[3];\n result[13] = this[7];\n result[14] = this[11];\n result[15] = this[15];\n return result;\n }\n\n // Constructors\n\n /** Set to identity matrix */\n identity(): this {\n return this.copy(IDENTITY_MATRIX);\n }\n\n /**\n *\n * @param object\n * @returns self\n */\n fromObject(object: {[key: string]: any}): this {\n return this.check();\n }\n\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @param quaternion Quaternion to create matrix from\n * @returns self\n */\n fromQuaternion(quaternion: Readonly<NumericArray>): this {\n mat4.fromQuat(this, quaternion);\n return this.check();\n }\n\n /**\n * Generates a frustum matrix with the given bounds\n * @param view.left - Left bound of the frustum\n * @param view.right - Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top - Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far - Far bound of the frustum. Can be set to Infinity.\n * @returns self\n */\n frustum(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n if (far === Infinity) {\n computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);\n } else {\n mat4.frustum(this, left, right, bottom, top, near, far);\n }\n return this.check();\n }\n\n /**\n * Generates a look-at matrix with the given eye position, focal point,\n * and up axis\n * @param view.eye - (vector) Position of the viewer\n * @param view.center - (vector) Point the viewer is looking at\n * @param view.up - (vector) Up axis\n * @returns self\n */\n lookAt(view: {\n eye: Readonly<NumericArray>;\n center?: Readonly<NumericArray>;\n up?: Readonly<NumericArray>;\n }): this {\n const {eye, center = [0, 0, 0], up = [0, 1, 0]} = view;\n mat4.lookAt(this, eye, center, up);\n return this.check();\n }\n\n /**\n * Generates a orthogonal projection matrix with the given bounds\n * from \"traditional\" view space parameters\n * @param view.left - Left bound of the frustum\n * @param view.right number Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top number Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far number Far bound of the frustum\n * @returns self\n */\n ortho(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near?: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n mat4.ortho(this, left, right, bottom, top, near, far);\n return this.check();\n }\n\n /**\n * Generates an orthogonal projection matrix with the same parameters\n * as a perspective matrix (plus focalDistance)\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. Typically viewport width / viewport height\n * @param view.focalDistance Distance in the view frustum used for extent calculations\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n orthographic(view: {\n fovy?: number;\n aspect?: number;\n focalDistance?: number;\n near?: number;\n far?: number;\n }): this {\n const {\n fovy = DEFAULT_FOVY,\n aspect = DEFAULT_ASPECT,\n focalDistance = 1,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n\n checkRadians(fovy);\n\n const halfY = fovy / 2;\n const top = focalDistance * Math.tan(halfY); // focus_plane is the distance from the camera\n const right = top * aspect;\n\n return this.ortho({\n left: -right,\n right,\n bottom: -top,\n top,\n near,\n far\n });\n }\n\n /**\n * Generates a perspective projection matrix with the given bounds\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. typically viewport width/height\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n perspective(view: {fovy: number; aspect?: number; near?: number; far?: number}): this {\n const {fovy = (45 * Math.PI) / 180, aspect = 1, near = 0.1, far = 500} = view;\n checkRadians(fovy);\n mat4.perspective(this, fovy, aspect, near, far);\n return this.check();\n }\n\n // Accessors\n\n determinant(): number {\n return mat4.determinant(this);\n }\n\n /**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n * The scales are the \"lengths\" of the column vectors in the upper-left 3x3 matrix.\n * @param result\n * @returns self\n */\n getScale(result: NumericArray = [-0, -0, -0]): NumericArray {\n // explicit is faster than hypot...\n result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);\n result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);\n result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);\n // result[0] = Math.hypot(this[0], this[1], this[2]);\n // result[1] = Math.hypot(this[4], this[5], this[6]);\n // result[2] = Math.hypot(this[8], this[9], this[10]);\n return result;\n }\n\n /**\n * Gets the translation portion, assuming the matrix is a affine transformation matrix.\n * @param result\n * @returns self\n */\n getTranslation(result: NumericArray = [-0, -0, -0]): NumericArray {\n result[0] = this[12];\n result[1] = this[13];\n result[2] = this[14];\n return result;\n }\n\n /**\n * Gets upper left 3x3 pure rotation matrix (non-scaling), assume affine transformation matrix\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotation(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = 0;\n result[4] = this[4] * inverseScale0;\n result[5] = this[5] * inverseScale1;\n result[6] = this[6] * inverseScale2;\n result[7] = 0;\n result[8] = this[8] * inverseScale0;\n result[9] = this[9] * inverseScale1;\n result[10] = this[10] * inverseScale2;\n result[11] = 0;\n result[12] = 0;\n result[13] = 0;\n result[14] = 0;\n result[15] = 1;\n return result;\n }\n\n /**\n *\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotationMatrix3(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = this[4] * inverseScale0;\n result[4] = this[5] * inverseScale1;\n result[5] = this[6] * inverseScale2;\n result[6] = this[8] * inverseScale0;\n result[7] = this[9] * inverseScale1;\n result[8] = this[10] * inverseScale2;\n return result;\n }\n\n // Modifiers\n\n transpose(): this {\n mat4.transpose(this, this);\n return this.check();\n }\n\n invert(): this {\n mat4.invert(this, this);\n return this.check();\n }\n\n // Operations\n\n multiplyLeft(a: Readonly<NumericArray>): this {\n mat4.multiply(this, a, this);\n return this.check();\n }\n\n multiplyRight(a: Readonly<NumericArray>): this {\n mat4.multiply(this, this, a);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the X axis\n rotateX(radians: number): this {\n mat4.rotateX(this, this, radians);\n // mat4.rotate(this, this, radians, [1, 0, 0]);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the Y axis.\n rotateY(radians: number): this {\n mat4.rotateY(this, this, radians);\n // mat4.rotate(this, this, radians, [0, 1, 0]);\n return this.check();\n }\n\n /**\n * Rotates a matrix by the given angle around the Z axis.\n * @param radians\n * @returns self\n */\n rotateZ(radians: number): this {\n mat4.rotateZ(this, this, radians);\n // mat4.rotate(this, this, radians, [0, 0, 1]);\n return this.check();\n }\n\n /**\n *\n * @param param0\n * @returns self\n */\n rotateXYZ(angleXYZ: Readonly<NumericArray>): this {\n return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);\n }\n\n /**\n *\n * @param radians\n * @param axis\n * @returns self\n */\n rotateAxis(radians: number, axis: Readonly<NumericArray>): this {\n mat4.rotate(this, this, radians, axis);\n return this.check();\n }\n\n /**\n *\n * @param factor\n * @returns self\n */\n scale(factor: number | Readonly<NumericArray>): this {\n mat4.scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);\n return this.check();\n }\n\n /**\n *\n * @param vec\n * @returns self\n */\n translate(vector: Readonly<NumericArray>): this {\n mat4.translate(this, this, vector);\n return this.check();\n }\n\n // Transforms\n\n /**\n * Transforms any 2, 3 or 4 element vector. 2 and 3 elements are treated as points\n * @param vector\n * @param result\n * @returns self\n */\n transform(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n if (vector.length === 4) {\n result = vec4.transformMat4(result || [-0, -0, -0, -0], vector, this);\n checkVector(result, 4);\n return result;\n }\n return this.transformAsPoint(vector, result);\n }\n\n /**\n * Transforms any 2 or 3 element array as point (w implicitly 1)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n const {length} = vector;\n let out: NumericArray;\n switch (length) {\n case 2:\n out = vec2.transformMat4(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3.transformMat4(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /**\n * Transforms any 2 or 3 element array as vector (w implicitly 0)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n let out: NumericArray;\n switch (vector.length) {\n case 2:\n out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /** @deprecated */\n transformPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformDirection(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsVector(vector, result);\n }\n\n // three.js math API compatibility\n\n makeRotationX(radians: number): this {\n return this.identity().rotateX(radians);\n }\n\n makeTranslation(x: number, y: number, z: number): this {\n return this.identity().translate([x, y, z]);\n }\n}\n\n// TODO initializing static members directly is an option, but make sure no tree-shaking issues\nlet ZERO: Matrix4;\nlet IDENTITY: Matrix4;\n\nfunction getZeroMatrix(): Readonly<Matrix4> {\n if (!ZERO) {\n ZERO = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO);\n }\n return ZERO;\n}\n\nfunction getIdentityMatrix(): Matrix4 {\n if (!IDENTITY) {\n IDENTITY = new Matrix4();\n Object.freeze(IDENTITY);\n }\n return IDENTITY;\n}\n\n// HELPER FUNCTIONS\n\nfunction checkRadians(possiblyDegrees: number) {\n if (possiblyDegrees > Math.PI * 2) {\n throw Error('expected radians');\n }\n}\n\n// eslint-disable-next-line max-params\nfunction computeInfinitePerspectiveOffCenter(\n result: NumericArray,\n left: number,\n right: number,\n bottom: number,\n top: number,\n near: number\n): NumericArray {\n const column0Row0 = (2 * near) / (right - left);\n const column1Row1 = (2 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1;\n const column2Row3 = -1;\n const column3Row2 = -2 * near;\n result[0] = column0Row0;\n result[1] = 0;\n result[2] = 0;\n result[3] = 0;\n result[4] = 0;\n result[5] = column1Row1;\n result[6] = 0;\n result[7] = 0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0;\n result[13] = 0;\n result[14] = column3Row2;\n result[15] = 0;\n return result;\n}\n", "\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = create;\nexports.identity = identity;\nexports.setAxisAngle = setAxisAngle;\nexports.getAxisAngle = getAxisAngle;\nexports.getAngle = getAngle;\nexports.multiply = multiply;\nexports.rotateX = rotateX;\nexports.rotateY = rotateY;\nexports.rotateZ = rotateZ;\nexports.calculateW = calculateW;\nexports.exp = exp;\nexports.ln = ln;\nexports.pow = pow;\nexports.slerp = slerp;\nexports.random = random;\nexports.invert = invert;\nexports.conjugate = conjugate;\nexports.fromMat3 = fromMat3;\nexports.fromEuler = fromEuler;\nexports.str = str;\nexports.setAxes = exports.sqlerp = exports.rotationTo = exports.equals = exports.exactEquals = exports.normalize = exports.sqrLen = exports.squaredLength = exports.len = exports.length = exports.lerp = exports.dot = exports.scale = exports.mul = exports.add = exports.set = exports.copy = exports.fromValues = exports.clone = void 0;\n\nvar glMatrix = _interopRequireWildcard(require(\"./common.js\"));\n\nvar mat3 = _interopRequireWildcard(require(\"./mat3.js\"));\n\nvar vec3 = _interopRequireWildcard(require(\"./vec3.js\"));\n\nvar vec4 = _interopRequireWildcard(require(\"./vec4.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\nfunction create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\n\n\nfunction setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {ReadonlyQuat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\n\n\nfunction getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > glMatrix.EPSILON) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n\n\nfunction getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\n\n\nfunction multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\n\nfunction rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\n\nfunction rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\n\nfunction rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\n\n\nfunction calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\n\nfunction exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\n\nfunction ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\n\n\nfunction pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\n\nfunction slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > glMatrix.EPSILON) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\n\nfunction random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = glMatrix.RANDOM();\n var u2 = glMatrix.RANDOM();\n var u3 = glMatrix.RANDOM();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\n\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\n\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\n\n\nfunction fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\n\n\nfunction fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\n * Returns a string representation of a quatenion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\n\nfunction str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\n\n\nvar clone = vec4.clone;\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\n\nexports.clone = clone;\nvar fromValues = vec4.fromValues;\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\n\nexports.fromValues = fromValues;\nvar copy = vec4.copy;\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\n\nexports.copy = copy;\nvar set = vec4.set;\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\n\nexports.set = set;\nvar add = vec4.add;\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\n\nexports.add = add;\nvar mul = multiply;\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\n\nexports.mul = mul;\nvar scale = vec4.scale;\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nexports.scale = scale;\nvar dot = vec4.dot;\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\n\nexports.dot = dot;\nvar lerp = vec4.lerp;\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexports.lerp = lerp;\nvar length = vec4.length;\n/**\n * Alias for {@link quat.length}\n * @function\n */\n\nexports.length = length;\nvar len = length;\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nexports.len = len;\nvar squaredLength = vec4.squaredLength;\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\n\nexports.squaredLength = squaredLength;\nvar sqrLen = squaredLength;\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\n\nexports.sqrLen = sqrLen;\nvar normalize = vec4.normalize;\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexports.normalize = normalize;\nvar exactEquals = vec4.exactEquals;\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat} a The first vector.\n * @param {ReadonlyQuat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexports.exactEquals = exactEquals;\nvar equals = vec4.equals;\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\n\nexports.equals = equals;\n\nvar rotationTo = function () {\n var tmpvec3 = vec3.create();\n var xUnitVec3 = vec3.fromValues(1, 0, 0);\n var yUnitVec3 = vec3.fromValues(0, 1, 0);\n return function (out, a, b) {\n var dot = vec3.dot(a, b);\n\n if (dot < -0.999999) {\n vec3.cross(tmpvec3, xUnitVec3, a);\n if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n vec3.normalize(tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n vec3.cross(tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\n\nexports.rotationTo = rotationTo;\n\nvar sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\n\n\nexports.sqlerp = sqlerp;\n\nvar setAxes = function () {\n var matr = mat3.create();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();\n\nexports.setAxes = setAxes;", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport MathArray from './base/math-array';\nimport {checkNumber, checkVector} from '../lib/validators';\nimport Vector4 from './vector4';\nimport * as quat from 'gl-matrix/quat';\nimport * as vec4 from 'gl-matrix/vec4';\nimport {NumericArray} from '@math.gl/types';\n\nconst IDENTITY_QUATERNION = [0, 0, 0, 1] as const;\n\nexport default class Quaternion extends MathArray {\n constructor(x: number | Readonly<NumericArray> = 0, y = 0, z = 0, w = 1) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0);\n // eslint-disable-next-line prefer-rest-params\n if (Array.isArray(x) && arguments.length === 1) {\n this.copy(x);\n } else {\n this.set(x as number, y, z, w);\n }\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n return this.check();\n }\n\n set(x: number, y: number, z: number, w: number): this {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n this[3] = w;\n return this.check();\n }\n\n fromObject(object: {x: number; y: number; z: number; w: number}): this {\n this[0] = object.x;\n this[1] = object.y;\n this[2] = object.z;\n this[3] = object.w;\n return this.check();\n }\n\n /**\n * Creates a quaternion from the given 3x3 rotation matrix.\n * NOTE: The resultant quaternion is not normalized, so you should\n * be sure to renormalize the quaternion yourself where necessary.\n * @param m\n * @returns\n */\n fromMatrix3(m: Readonly<NumericArray>): this {\n quat.fromMat3(this, m);\n return this.check();\n }\n\n fromAxisRotation(axis: Readonly<NumericArray>, rad: number): this {\n quat.setAxisAngle(this, axis, rad);\n return this.check();\n }\n\n /** Set a quat to the identity quaternion */\n identity(): this {\n quat.identity(this);\n return this.check();\n }\n\n // Set the components of a quat to the given values\n // set(i, j, k, l) {\n // quat.set(this, i, j, k, l);\n // return this.check();\n // }\n\n // Sets a quat from the given angle and rotation axis, then returns it.\n setAxisAngle(axis: Readonly<NumericArray>, rad: number): this {\n return this.fromAxisRotation(axis, rad);\n }\n\n // Getters/setters\n get ELEMENTS(): number {\n return 4;\n }\n\n get x(): number {\n return this[0];\n }\n set x(value: number) {\n this[0] = checkNumber(value);\n }\n\n get y(): number {\n return this[1];\n }\n set y(value: number) {\n this[1] = checkNumber(value);\n }\n\n get z(): number {\n return this[2];\n }\n set z(value: number) {\n this[2] = checkNumber(value);\n }\n\n get w(): number {\n return this[3];\n }\n set w(value: number) {\n this[3] = checkNumber(value);\n }\n\n // Calculates the length of a quat\n len(): number {\n return quat.length(this);\n }\n\n // Calculates the squared length of a quat\n lengthSquared(): number {\n return quat.squaredLength(this);\n }\n\n // Calculates the dot product of two quat's\n // @return {Number}\n dot(a: Readonly<NumericArray>): number {\n return quat.dot(this, a);\n }\n\n // Gets the rotation axis and angle for a given quaternion.\n // If a quaternion is created with setAxisAngle, this method will\n // return the same values as providied in the original parameter\n // list OR functionally equivalent values.\n // Example: The quaternion formed by axis [0, 0, 1] and angle -90\n // is the same as the quaternion formed by [0, 0, 1] and 270.\n // This method favors the latter.\n // @return {{[x,y,z], Number}}\n // getAxisAngle() {\n // const axis = [];\n // const angle = quat.getAxisAngle(axis, this);\n // return {axis, angle};\n // }\n // MODIFIERS\n // Sets a quaternion to represent the shortest rotation from one vector\n // to another. Both vectors are assumed to be unit length.\n rotationTo(vectorA: NumericArray, vectorB: NumericArray): this {\n quat.rotationTo(this, vectorA, vectorB);\n return this.check();\n }\n\n // Sets the specified quaternion with values corresponding to the given axes.\n // Each axis is a vec3 and is expected to be unit length and perpendicular\n // to all other specified axes.\n // setAxes() {\n // Number\n // }\n // Performs a spherical linear interpolation with two control points\n // sqlerp() {\n // Number;\n // }\n // Adds two quat's\n add(a: Readonly<NumericArray>): this {\n quat.add(this, this, a);\n return this.check();\n }\n\n // Calculates the W component of a quat from the X, Y, and Z components.\n // Any existing W component will be ignored.\n calculateW(): this {\n quat.calculateW(this, this);\n return this.check();\n }\n\n // Calculates the conjugate of a quat If the quaternion is normalized,\n // this function is faster than quat.inverse and produces the same result.\n conjugate(): this {\n quat.conjugate(this, this);\n return this.check();\n }\n\n // Calculates the inverse of a quat\n invert(): this {\n quat.invert(this, this);\n return this.check();\n }\n\n // Performs a linear interpolation between two quat's\n lerp(a: Readonly<NumericArray>, b: Readonly<NumericArray> | number, t?: number): this {\n if (t === undefined) {\n return this.lerp(this, a, b as number);\n }\n quat.lerp(this, a, b as NumericArray, t);\n return this.check();\n }\n\n // Multiplies two quat's\n multiplyRight(a: Readonly<NumericArray>): this {\n quat.multiply(this, this, a);\n return this.check();\n }\n\n multiplyLeft(a: Readonly<NumericArray>): this {\n quat.multiply(this, a, this);\n return this.check();\n }\n\n // Normalize a quat\n normalize(): this {\n // Handle 0 case\n const length = this.len();\n const l = length > 0 ? 1 / length : 0;\n this[0] = this[0] * l;\n this[1] = this[1] * l;\n this[2] = this[2] * l;\n this[3] = this[3] * l;\n // Set to [0, 0, 0, 1] if length is 0\n if (length === 0) {\n this[3] = 1;\n }\n return this.check();\n }\n\n // Rotates a quaternion by the given angle about the X axis\n rotateX(rad: number): this {\n quat.rotateX(this, this, rad);\n return this.check();\n }\n\n // Rotates a quaternion by the given angle about the Y axis\n rotateY(rad: number): this {\n quat.rotateY(this, this, rad);\n return this.check();\n }\n\n // Rotates a quaternion by the given angle about the Z axis\n rotateZ(rad: number): this {\n quat.rotateZ(this, this, rad);\n return this.check();\n }\n\n // Scales a quat by a scalar number\n scale(b: number): this {\n quat.scale(this, this, b);\n return this.check();\n }\n\n slerp(target: Readonly<NumericArray>, ratio: number): this;\n slerp(start: Readonly<NumericArray>, target: Readonly<NumericArray>, ratio: number): this;\n slerp(params: {\n start: Readonly<NumericArray>;\n target: Readonly<NumericArray>;\n ratio: number;\n }): this;\n\n // Performs a spherical linear interpolation between two quat\n slerp(\n arg0:\n | Readonly<NumericArray>\n | {\n start: Readonly<NumericArray>;\n target: Readonly<NumericArray>;\n ratio: number;\n },\n arg1?: Readonly<NumericArray> | number,\n arg2?: number\n ): this {\n let start: Readonly<NumericArray>;\n let target: Readonly<NumericArray>;\n let ratio: number;\n // eslint-disable-next-line prefer-rest-params\n switch (arguments.length) {\n case 1: // Deprecated signature ({start, target, ratio})\n // eslint-disable-next-line prefer-rest-params\n ({\n start = IDENTITY_QUATERNION,\n target,\n ratio\n } = arg0 as {\n start: Readonly<NumericArray>;\n target: Readonly<NumericArray>;\n ratio: number;\n });\n break;\n case 2: // THREE.js compatibility signature (target, ration)\n start = this; // eslint-disable-line\n target = arg0 as Readonly<NumericArray>;\n ratio = arg1 as number;\n break;\n default:\n // Default signature: (start, target, ratio)\n start = arg0 as Readonly<NumericArray>;\n target = arg1 as Readonly<NumericArray>;\n ratio = arg2;\n }\n quat.slerp(this, start, target, ratio);\n return this.check();\n }\n\n transformVector4(\n vector: Readonly<NumericArray>,\n result: NumericArray = new Vector4()\n ): NumericArray {\n vec4.transformQuat(result, vector, this);\n return checkVector(result, 4);\n }\n\n // THREE.js Math API compatibility\n lengthSq(): number {\n return this.lengthSquared();\n }\n\n setFromAxisAngle(axis: Readonly<NumericArray>, rad: number): this {\n return this.setAxisAngle(axis, rad);\n }\n\n premultiply(a: Readonly<NumericArray>): this {\n return this.multiplyLeft(a);\n }\n\n multiply(a: Readonly<NumericArray>): this {\n return this.multiplyRight(a);\n }\n}\n", "function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\n// Adaptation of THREE.js Spherical class, under MIT license\nimport Vector3 from './vector3';\nimport {formatValue, equals, config} from '../lib/common';\nimport {degrees, radians, clamp} from '../lib/common';\nimport * as vec3 from 'gl-matrix/vec3';\nimport {NumericArray} from '@math.gl/types';\n\ntype SphericalCoordinatesOptions = {\n phi?: number;\n theta?: number;\n radius?: number;\n bearing?: number;\n pitch?: number;\n altitude?: number;\n radiusScale?: number;\n};\n\ntype FormatOptions = {\n printTypes?: boolean;\n};\n\n// TODO - import epsilon\nconst EPSILON = 0.000001;\nconst EARTH_RADIUS_METERS = 6371000;\n\n/**\n * The poles (phi) are at the positive and negative y axis.\n * The equator starts at positive z.\n * @link https://en.wikipedia.org/wiki/Spherical_coordinate_system\n */\nexport default class SphericalCoordinates {\n phi: number;\n theta: number;\n radius: number;\n radiusScale: number;\n // bearing: number;\n // pitch: number;\n // altitude: number;\n\n // lnglatZ coordinates\n // longitude: number;\n // latitude: number;\n // lng: number;\n // lat: number;\n // z: number;\n\n /**\n * Creates a new SphericalCoordinates object\n * @param options\n * @param [options.phi] =0 - rotation around X (latitude)\n * @param [options.theta] =0 - rotation around Y (longitude)\n * @param [options.radius] =1 - Distance from center\n * @param [options.bearing]\n * @param [options.pitch]\n * @param [options.altitude]\n * @param [options.radiusScale] =1\n */\n // eslint-disable-next-line complexity\n constructor({\n phi = 0,\n theta = 0,\n radius = 1,\n bearing,\n pitch,\n altitude,\n radiusScale = EARTH_RADIUS_METERS\n }: SphericalCoordinatesOptions = {}) {\n this.phi = phi;\n this.theta = theta;\n // TODO - silently accepts illegal 0\n this.radius = radius || altitude || 1; // radial distance from center\n this.radiusScale = radiusScale || 1; // Used by lngLatZ\n if (bearing !== undefined) {\n this.bearing = bearing; // up / down towards top and bottom pole\n }\n if (pitch !== undefined) {\n this.pitch = pitch; // around the equator of the sphere\n }\n this.check();\n }\n\n toString(): string {\n return this.formatString(config);\n }\n\n formatString({printTypes = false}: FormatOptions): string {\n const f = formatValue;\n return `${printTypes ? 'Spherical' : ''}\\\n[rho:${f(this.radius)},theta:${f(this.theta)},phi:${f(this.phi)}]`;\n }\n\n equals(other: SphericalCoordinates): boolean {\n return (\n equals(this.radius, other.radius) &&\n equals(this.theta, other.theta) &&\n equals(this.phi, other.phi)\n );\n }\n\n exactEquals(other: SphericalCoordinates): boolean {\n return this.radius === other.radius && this.theta === other.theta && this.phi === other.phi;\n }\n\n /* eslint-disable brace-style */\n // Cartographic (bearing 0 north, pitch 0 look from above)\n get bearing(): number {\n return 180 - degrees(this.phi);\n }\n\n set bearing(v: number) {\n this.phi = Math.PI - radians(v);\n }\n\n get pitch(): number {\n return degrees(this.theta);\n }\n\n set pitch(v: number) {\n this.theta = radians(v);\n }\n\n // get pitch() { return 90 - degrees(this.phi); }\n // set pitch(v) { this.phi = radians(v) + Math.PI / 2; }\n // get altitude() { return this.radius - 1; } // relative altitude\n // lnglatZ coordinates\n get longitude(): number {\n return degrees(this.phi);\n }\n\n get latitude(): number {\n return degrees(this.theta);\n }\n\n get lng(): number {\n return degrees(this.phi);\n }\n\n get lat(): number {\n return degrees(this.theta);\n }\n\n get z(): number {\n return (this.radius - 1) * this.radiusScale;\n }\n\n /* eslint-enable brace-style */\n set(radius: number, phi: number, theta: number): this {\n this.radius = radius;\n this.phi = phi;\n this.theta = theta;\n return this.check();\n }\n\n clone(): SphericalCoordinates {\n return new SphericalCoordinates().copy(this);\n }\n\n copy(other: SphericalCoordinates): this {\n this.radius = other.radius;\n this.phi = other.phi;\n this.theta = other.theta;\n return this.check();\n }\n\n fromLngLatZ([lng, lat, z]: [number, number, number]): this {\n this.radius = 1 + z / this.radiusScale;\n this.phi = radians(lat);\n this.theta = radians(lng);\n return this.check();\n }\n\n fromVector3(v: Readonly<NumericArray>): this {\n this.radius = vec3.length(v);\n if (this.radius > 0) {\n this.theta = Math.atan2(v[0], v[1]); // equator angle around y-up axis\n this.phi = Math.acos(clamp(v[2] / this.radius, -1, 1)); // polar angle\n }\n return this.check();\n }\n\n toVector3(): Vector3 {\n return new Vector3(0, 0, this.radius)\n .rotateX({radians: this.theta})\n .rotateZ({radians: this.phi});\n }\n\n // restrict phi to be betwee EPS and PI-EPS\n makeSafe(): this {\n this.phi = Math.max(EPSILON, Math.min(Math.PI - EPSILON, this.phi));\n return this;\n }\n\n check(): this {\n // this.makeSafe();\n if (!Number.isFinite(this.phi) || !Number.isFinite(this.theta) || !(this.radius > 0)) {\n throw new Error('SphericalCoordinates: some fields set to invalid numbers');\n }\n return this;\n }\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport MathArray from './base/math-array';\nimport Quaternion from './quaternion';\nimport {NumericArray} from '@math.gl/types';\n\nimport {clamp} from '../lib/common';\nimport {checkNumber} from '../lib/validators';\n\n// Internal constants\nconst ERR_UNKNOWN_ORDER = 'Unknown Euler angle order';\nconst ALMOST_ONE = 0.99999;\n\nenum RotationOrder {\n ZYX = 0,\n YXZ = 1,\n XZY = 2,\n ZXY = 3,\n YZX = 4,\n XYZ = 5\n}\n\nexport default class Euler extends MathArray {\n // Constants\n static get ZYX(): RotationOrder {\n return RotationOrder.ZYX;\n }\n static get YXZ(): RotationOrder {\n return RotationOrder.YXZ;\n }\n static get XZY(): RotationOrder {\n return RotationOrder.XZY;\n }\n static get ZXY(): RotationOrder {\n return RotationOrder.ZXY;\n }\n static get YZX(): RotationOrder {\n return RotationOrder.YZX;\n }\n static get XYZ(): RotationOrder {\n return RotationOrder.XYZ;\n }\n static get RollPitchYaw(): RotationOrder {\n return RotationOrder.ZYX;\n }\n static get DefaultOrder(): RotationOrder {\n return RotationOrder.ZYX;\n }\n static get RotationOrders(): typeof RotationOrder {\n return RotationOrder;\n }\n static rotationOrder(order: RotationOrder): string {\n return RotationOrder[order];\n }\n get ELEMENTS(): number {\n return 4;\n }\n\n /**\n * @class\n * @param {Number | Number[]} x\n * @param {Number=} [y]\n * @param {Number=} [z]\n * @param {Number=} [order]\n */\n constructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0);\n // eslint-disable-next-line prefer-rest-params\n if (arguments.length > 0 && Array.isArray(arguments[0])) {\n // eslint-disable-next-line prefer-rest-params\n // @ts-expect-error\n this.fromVector3(...arguments);\n } else {\n this.set(x, y, z, order);\n }\n }\n\n fromQuaternion(quaternion: Readonly<NumericArray>): this {\n const [x, y, z, w] = quaternion;\n const ysqr = y * y;\n const t0 = -2 * (ysqr + z * z) + 1;\n const t1 = +2 * (x * y + w * z);\n let t2 = -2 * (x * z - w * y);\n const t3 = +2 * (y * z + w * x);\n const t4 = -2 * (x * x + ysqr) + 1;\n t2 = t2 > 1 ? 1 : t2;\n t2 = t2 < -1 ? -1 : t2;\n const roll = Math.atan2(t3, t4);\n const pitch = Math.asin(t2);\n const yaw = Math.atan2(t1, t0);\n return this.set(roll, pitch, yaw, Euler.RollPitchYaw);\n }\n\n fromObject(object: object): this {\n throw new Error('not implemented');\n // return this.set(object.x, object.y, object.z, object.order);\n }\n\n // fromQuaternion(q, order) {\n // this._fromRotationMat[-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n // return this.check();\n // }\n // If copied array does contain fourth element, preserves currently set order\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n // @ts-expect-error\n this[3] = Number.isFinite(array[3]) || this.order;\n return this.check();\n }\n\n // Sets the three angles, and optionally sets the rotation order\n // If order is not specified, preserves currently set order\n set(x = 0, y = 0, z = 0, order: RotationOrder): this {\n this[0] = x;\n this[1] = y;\n this[2] = z;\n this[3] = Number.isFinite(order) ? order : this[3];\n return this.check();\n }\n\n validate(): boolean {\n return (\n validateOrder(this[3]) &&\n Number.isFinite(this[0]) &&\n Number.isFinite(this[1]) &&\n Number.isFinite(this[2])\n );\n }\n\n // Does not copy the orientation element\n toArray(array: NumericArray = [], offset: number = 0): NumericArray {\n array[offset] = this[0];\n array[offset + 1] = this[1];\n array[offset + 2] = this[2];\n return array;\n }\n\n // Copies the orientation element\n toArray4(array: NumericArray = [], offset: number = 0): NumericArray {\n array[offset] = this[0];\n array[offset + 1] = this[1];\n array[offset + 2] = this[2];\n array[offset + 3] = this[3];\n return array;\n }\n\n toVector3(result: NumericArray = [-0, -0, -0]): NumericArray {\n result[0] = this[0];\n result[1] = this[1];\n result[2] = this[2];\n return result;\n }\n /* eslint-disable no-multi-spaces, brace-style, no-return-assign */\n // x, y, z angle notation (note: only corresponds to axis in XYZ orientation)\n\n get x(): number {\n return this[0];\n }\n set x(value: number) {\n this[0] = checkNumber(value);\n }\n\n get y(): number {\n return this[1];\n }\n set y(value: number) {\n this[1] = checkNumber(value);\n }\n\n get z(): number {\n return this[2];\n }\n set z(value: number) {\n this[2] = checkNumber(value);\n }\n // alpha, beta, gamma angle notation\n get alpha(): number {\n return this[0];\n }\n set alpha(value: number) {\n this[0] = checkNumber(value);\n }\n\n get beta(): number {\n return this[1];\n }\n set beta(value: number) {\n this[1] = checkNumber(value);\n }\n\n get gamma(): number {\n return this[2];\n }\n set gamma(value: number) {\n this[2] = checkNumber(value);\n }\n\n // phi, theta, psi angle notation\n get phi(): number {\n return this[0];\n }\n set phi(value: number) {\n this[0] = checkNumber(value);\n }\n\n get theta(): number {\n return this[1];\n }\n set theta(value: number) {\n this[1] = checkNumber(value);\n }\n\n get psi(): number {\n return this[2];\n }\n set psi(value: number) {\n this[2] = checkNumber(value);\n }\n // roll, pitch, yaw angle notation\n\n get roll(): number {\n return this[0];\n }\n set roll(value: number) {\n this[0] = checkNumber(value);\n }\n\n get pitch(): number {\n return this[1];\n }\n set pitch(value: number) {\n this[1] = checkNumber(value);\n }\n\n get yaw(): number {\n return this[2];\n }\n set yaw(value: number) {\n this[2] = checkNumber(value);\n }\n\n // rotation order, in all three angle notations\n get order(): RotationOrder {\n return this[3];\n }\n set order(value: RotationOrder) {\n this[3] = checkOrder(value);\n }\n\n // Constructors\n fromVector3(v: Readonly<NumericArray>, order: RotationOrder): this {\n return this.set(v[0], v[1], v[2], Number.isFinite(order) ? order : this[3]);\n }\n\n // TODO - with and without 4th element\n fromArray(array: Readonly<NumericArray>, offset: number = 0): this {\n this[0] = array[0 + offset];\n this[1] = array[1 + offset];\n this[2] = array[2 + offset];\n if (array[3] !== undefined) {\n this[3] = array[3];\n }\n return this.check();\n }\n\n // Common ZYX rotation order\n fromRollPitchYaw(roll: number, pitch: number, yaw: number): this {\n return this.set(roll, pitch, yaw, RotationOrder.ZYX);\n }\n\n fromRotationMatrix(m: Readonly<NumericArray>, order: RotationOrder = Euler.DefaultOrder): this {\n this._fromRotationMatrix(m, order);\n return this.check();\n }\n\n // ACCESSORS\n\n getRotationMatrix(m: NumericArray): NumericArray {\n return this._getRotationMatrix(m);\n }\n\n // TODO - move to Quaternion\n getQuaternion(): Quaternion {\n const q = new Quaternion();\n switch (this[4]) {\n case RotationOrder.XYZ:\n return q.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);\n case RotationOrder.YXZ:\n return q.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);\n case RotationOrder.ZXY:\n return q.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);\n case RotationOrder.ZYX:\n return q.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);\n case RotationOrder.YZX:\n return q.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);\n case RotationOrder.XZY:\n return q.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);\n default:\n throw new Error(ERR_UNKNOWN_ORDER);\n }\n }\n\n // INTERNAL METHODS\n // Conversion from Euler to rotation matrix and from matrix to Euler\n // Adapted from three.js under MIT license\n // // WARNING: this discards revolution information -bhouston\n // reorder(newOrder) {\n // const q = new Quaternion().setFromEuler(this);\n // return this.setFromQuaternion(q, newOrder);\n /* eslint-disable complexity, max-statements, one-var */\n _fromRotationMatrix(m: Readonly<NumericArray>, order = Euler.DefaultOrder): this {\n // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n const m11 = m[0],\n m12 = m[4],\n m13 = m[8];\n const m21 = m[1],\n m22 = m[5],\n m23 = m[9];\n const m31 = m[2],\n m32 = m[6],\n m33 = m[10];\n order = order || this[3];\n switch (order) {\n case Euler.XYZ:\n this[1] = Math.asin(clamp(m13, -1, 1));\n if (Math.abs(m13) < ALMOST_ONE) {\n this[0] = Math.atan2(-m23, m33);\n this[2] = Math.atan2(-m12, m11);\n } else {\n this[0] = Math.atan2(m32, m22);\n this[2] = 0;\n }\n break;\n case Euler.YXZ:\n this[0] = Math.asin(-clamp(m23, -1, 1));\n if (Math.abs(m23) < ALMOST_ONE) {\n this[1] = Math.atan2(m13, m33);\n this[2] = Math.atan2(m21, m22);\n } else {\n this[1] = Math.atan2(-m31, m11);\n this[2] = 0;\n }\n break;\n case Euler.ZXY:\n this[0] = Math.asin(clamp(m32, -1, 1));\n if (Math.abs(m32) < ALMOST_ONE) {\n this[1] = Math.atan2(-m31, m33);\n this[2] = Math.atan2(-m12, m22);\n } else {\n this[1] = 0;\n this[2] = Math.atan2(m21, m11);\n }\n break;\n case Euler.ZYX:\n this[1] = Math.asin(-clamp(m31, -1, 1));\n if (Math.abs(m31) < ALMOST_ONE) {\n this[0] = Math.atan2(m32, m33);\n this[2] = Math.atan2(m21, m11);\n } else {\n this[0] = 0;\n this[2] = Math.atan2(-m12, m22);\n }\n break;\n case Euler.YZX:\n this[2] = Math.asin(clamp(m21, -1, 1));\n if (Math.abs(m21) < ALMOST_ONE) {\n this[0] = Math.atan2(-m23, m22);\n this[1] = Math.atan2(-m31, m11);\n } else {\n this[0] = 0;\n this[1] = Math.atan2(m13, m33);\n }\n break;\n case Euler.XZY:\n this[2] = Math.asin(-clamp(m12, -1, 1));\n if (Math.abs(m12) < ALMOST_ONE) {\n this[0] = Math.atan2(m32, m22);\n this[1] = Math.atan2(m13, m11);\n } else {\n this[0] = Math.atan2(-m23, m33);\n this[1] = 0;\n }\n break;\n default:\n throw new Error(ERR_UNKNOWN_ORDER);\n }\n this[3] = order;\n return this;\n }\n\n _getRotationMatrix(result: NumericArray): NumericArray {\n const te = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n const x = this.x,\n y = this.y,\n z = this.z;\n const a = Math.cos(x);\n const c = Math.cos(y);\n const e = Math.cos(z);\n const b = Math.sin(x);\n const d = Math.sin(y);\n const f = Math.sin(z);\n switch (this[3]) {\n case Euler.XYZ: {\n const ae = a * e,\n af = a * f,\n be = b * e,\n bf = b * f;\n te[0] = c * e;\n te[4] = -c * f;\n te[8] = d;\n te[1] = af + be * d;\n te[5] = ae - bf * d;\n te[9] = -b * c;\n te[2] = bf - ae * d;\n te[6] = be + af * d;\n te[10] = a * c;\n break;\n }\n case Euler.YXZ: {\n const ce = c * e,\n cf = c * f,\n de = d * e,\n df = d * f;\n te[0] = ce + df * b;\n te[4] = de * b - cf;\n te[8] = a * d;\n te[1] = a * f;\n te[5] = a * e;\n te[9] = -b;\n te[2] = cf * b - de;\n te[6] = df + ce * b;\n te[10] = a * c;\n break;\n }\n case Euler.ZXY: {\n const ce = c * e,\n cf = c * f,\n de = d * e,\n df = d * f;\n te[0] = ce - df * b;\n te[4] = -a * f;\n te[8] = de + cf * b;\n te[1] = cf + de * b;\n te[5] = a * e;\n te[9] = df - ce * b;\n te[2] = -a * d;\n te[6] = b;\n te[10] = a * c;\n break;\n }\n case Euler.ZYX: {\n const ae = a * e,\n af = a * f,\n be = b * e,\n bf = b * f;\n te[0] = c * e;\n te[4] = be * d - af;\n te[8] = ae * d + bf;\n te[1] = c * f;\n te[5] = bf * d + ae;\n te[9] = af * d - be;\n te[2] = -d;\n te[6] = b * c;\n te[10] = a * c;\n break;\n }\n case Euler.YZX: {\n const ac = a * c,\n ad = a * d,\n bc = b * c,\n bd = b * d;\n te[0] = c * e;\n te[4] = bd - ac * f;\n te[8] = bc * f + ad;\n te[1] = f;\n te[5] = a * e;\n te[9] = -b * e;\n te[2] = -d * e;\n te[6] = ad * f + bc;\n te[10] = ac - bd * f;\n break;\n }\n case Euler.XZY: {\n const ac = a * c,\n ad = a * d,\n bc = b * c,\n bd = b * d;\n te[0] = c * e;\n te[4] = -f;\n te[8] = d * e;\n te[1] = ac * f + bd;\n te[5] = a * e;\n te[9] = ad * f - bc;\n te[2] = bc * f - ad;\n te[6] = b * e;\n te[10] = bd * f + ac;\n break;\n }\n default:\n throw new Error(ERR_UNKNOWN_ORDER);\n }\n // last column\n te[3] = 0;\n te[7] = 0;\n te[11] = 0;\n // bottom row\n te[12] = 0;\n te[13] = 0;\n te[14] = 0;\n te[15] = 1;\n return te;\n }\n\n toQuaternion(): Quaternion {\n // Abbreviations for the various angular functions\n const cy = Math.cos(this.yaw * 0.5);\n const sy = Math.sin(this.yaw * 0.5);\n const cr = Math.cos(this.roll * 0.5);\n const sr = Math.sin(this.roll * 0.5);\n const cp = Math.cos(this.pitch * 0.5);\n const sp = Math.sin(this.pitch * 0.5);\n const w = cy * cr * cp + sy * sr * sp;\n const x = cy * sr * cp - sy * cr * sp;\n const y = cy * cr * sp + sy * sr * cp;\n const z = sy * cr * cp - cy * sr * sp;\n return new Quaternion(x, y, z, w);\n }\n}\n\n// HELPER FUNCTIONS\n\nfunction validateOrder(value: number): boolean {\n return value >= 0 && value < 6;\n}\n\nfunction checkOrder(value: number) {\n if (value < 0 && value >= 6) {\n throw new Error(ERR_UNKNOWN_ORDER);\n }\n return value;\n}\n", "// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\nimport Matrix4 from './matrix4';\nimport Vector3 from './vector3';\nimport Euler from './euler';\nimport {NumericArray} from '@math.gl/types';\n\ntype PoseOptions = {\n position?: Readonly<NumericArray>;\n orientation?: Readonly<NumericArray>;\n x?: number;\n y?: number;\n z?: number;\n roll?: number;\n pitch?: number;\n yaw?: number;\n};\n\nexport default class Pose {\n readonly position: Vector3;\n readonly orientation: Euler;\n\n constructor({\n x = 0,\n y = 0,\n z = 0,\n roll = 0,\n pitch = 0,\n yaw = 0,\n position,\n orientation\n }: PoseOptions = {}) {\n if (Array.isArray(position) && position.length === 3) {\n this.position = new Vector3(position);\n } else {\n this.position = new Vector3(x, y, z);\n }\n if (Array.isArray(orientation) && orientation.length === 4) {\n // @ts-expect-error\n this.orientation = new Euler(orientation, orientation[3]);\n } else {\n this.orientation = new Euler(roll, pitch, yaw, Euler.RollPitchYaw);\n }\n }\n\n get x(): number {\n return this.position.x;\n }\n\n set x(value: number) {\n this.position.x = value;\n }\n\n get y(): number {\n return this.position.y;\n }\n\n set y(value: number) {\n this.position.y = value;\n }\n\n get z(): number {\n return this.position.z;\n }\n\n set z(value: number) {\n this.position.z = value;\n }\n\n get roll(): number {\n return this.orientation.roll;\n }\n\n set roll(value: number) {\n this.orientation.roll = value;\n }\n\n get pitch(): number {\n return this.orientation.pitch;\n }\n set pitch(value: number) {\n this.orientation.pitch = value;\n }\n\n get yaw(): number {\n return this.orientation.yaw;\n }\n\n set yaw(value: number) {\n this.orientation.yaw = value;\n }\n\n getPosition(): Vector3 {\n return this.position;\n }\n\n getOrientation(): Euler {\n return this.orientation;\n }\n\n equals(pose: Pose): boolean {\n if (!pose) {\n return false;\n }\n return this.position.equals(pose.position) && this.orientation.equals(pose.orientation);\n }\n\n exactEquals(pose: Pose): boolean {\n if (!pose) {\n return false;\n }\n return (\n this.position.exactEquals(pose.position) && this.orientation.exactEquals(pose.orientation)\n );\n }\n\n getTransformationMatrix(): Matrix4 {\n // setup pre computations for the sin/cos of the angles\n const sr = Math.sin(this.roll);\n const sp = Math.sin(this.pitch);\n const sw = Math.sin(this.yaw);\n const cr = Math.cos(this.roll);\n const cp = Math.cos(this.pitch);\n const cw = Math.cos(this.yaw);\n\n // Create matrix\n return new Matrix4().setRowMajor(\n cw * cp, // 0,0\n -sw * cr + cw * sp * sr, // 0,1\n sw * sr + cw * sp * cr, // 0,2\n this.x, // 0,3\n sw * cp, // 1,0\n cw * cr + sw * sp * sr, // 1,1\n -cw * sr + sw * sp * cr, // 1,2\n this.y, // 1,3\n -sp, // 2,0\n cp * sr, // 2,1\n cp * cr, // 2,2\n this.z, // 2,3\n 0,\n 0,\n 0,\n 1\n );\n }\n\n getTransformationMatrixFromPose(pose: Pose): Matrix4 {\n return new Matrix4()\n .multiplyRight(this.getTransformationMatrix())\n .multiplyRight(pose.getTransformationMatrix().invert());\n }\n\n getTransformationMatrixToPose(pose: Pose): Matrix4 {\n return new Matrix4()\n .multiplyRight(pose.getTransformationMatrix())\n .multiplyRight(this.getTransformationMatrix().invert());\n }\n}\n", "// NOTE: Added to make Cesium-derived test cases work\n// TODO: Determine if/how to keep\nexport default {\n EPSILON1: 1e-1,\n EPSILON2: 1e-2,\n EPSILON3: 1e-3,\n EPSILON4: 1e-4,\n EPSILON5: 1e-5,\n EPSILON6: 1e-6,\n EPSILON7: 1e-7,\n EPSILON8: 1e-8,\n EPSILON9: 1e-9,\n EPSILON10: 1e-10,\n EPSILON11: 1e-11,\n EPSILON12: 1e-12,\n EPSILON13: 1e-13,\n EPSILON14: 1e-14,\n EPSILON15: 1e-15,\n EPSILON16: 1e-16,\n EPSILON17: 1e-17,\n EPSILON18: 1e-18,\n EPSILON19: 1e-19,\n EPSILON20: 1e-20,\n\n PI_OVER_TWO: Math.PI / 2,\n PI_OVER_FOUR: Math.PI / 4,\n PI_OVER_SIX: Math.PI / 6,\n\n TWO_PI: Math.PI * 2\n};\n", "// luma.gl, MIT license\n\n// types\nexport type {TypedArray, NumericArray} from '@math.gl/types';\n\n// classes\nexport {default as Vector2} from './classes/vector2';\nexport {default as Vector3} from './classes/vector3';\nexport {default as Vector4} from './classes/vector4';\nexport {default as Matrix3} from './classes/matrix3';\nexport {default as Matrix4} from './classes/matrix4';\nexport {default as Quaternion} from './classes/quaternion';\n\n// experimental\nexport {default as SphericalCoordinates} from './classes/spherical-coordinates';\nexport {default as Pose} from './classes/pose';\nexport {default as Euler} from './classes/euler';\n\nexport {default as _MathUtils} from './lib/math-utils';\n\n// lib\nexport {default as assert} from './lib/assert';\n\nexport {\n // math.gl global utility methods\n config,\n configure,\n formatValue,\n isArray,\n clone,\n equals,\n exactEquals,\n toRadians,\n toDegrees,\n // math.gl \"GLSL\"-style functions\n radians,\n degrees,\n sin,\n cos,\n tan,\n asin,\n acos,\n atan,\n clamp,\n lerp,\n withEpsilon\n} from './lib/common';\n\n// DEPRECATED\nexport {default as _SphericalCoordinates} from './classes/spherical-coordinates';\nexport {default as _Pose} from './classes/pose';\nexport {default as _Euler} from './classes/euler';\n", "// This file is derived from the Cesium math library under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nexport const WGS84_RADIUS_X = 6378137.0;\nexport const WGS84_RADIUS_Y = 6378137.0;\nexport const WGS84_RADIUS_Z = 6356752.3142451793;\n\n// Pre-calculated ellipsoid defaults to avoid utils depending on `ellipsoid.js`\n\nexport const WGS84_CONSTANTS = {\n radii: [WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z],\n radiiSquared: [\n WGS84_RADIUS_X * WGS84_RADIUS_X,\n WGS84_RADIUS_Y * WGS84_RADIUS_Y,\n WGS84_RADIUS_Z * WGS84_RADIUS_Z\n ],\n oneOverRadii: [1.0 / WGS84_RADIUS_X, 1.0 / WGS84_RADIUS_Y, 1.0 / WGS84_RADIUS_Z],\n oneOverRadiiSquared: [\n 1.0 / (WGS84_RADIUS_X * WGS84_RADIUS_X),\n 1.0 / (WGS84_RADIUS_Y * WGS84_RADIUS_Y),\n 1.0 / (WGS84_RADIUS_Z * WGS84_RADIUS_Z)\n ],\n maximumRadius: Math.max(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z),\n centerToleranceSquared: 1e-1 // EPSILON1;\n};\n", "// This file is derived from the Cesium math library under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport type {NumericArray} from '@math.gl/core';\nimport {Vector3, toRadians, toDegrees, config} from '@math.gl/core';\nimport {WGS84_CONSTANTS} from './constants';\n\ntype LngLatHeightObject = {\n longitude: number;\n latitude: number;\n height: number;\n};\n\ntype XYZObject = {\n x: number;\n y: number;\n z: number;\n};\n\ntype Cartographic = LngLatHeightObject | XYZObject | NumericArray;\n\nfunction identity(x: number): number {\n return x;\n}\n\nconst scratchVector = new Vector3();\n\nexport function fromCartographic(cartographic: Cartographic): number[];\nexport function fromCartographic<NumArrayT>(\n cartographic: Cartographic,\n result: NumArrayT,\n map?: (x: number) => number\n): NumArrayT;\nexport function fromCartographic(\n cartographic: Cartographic,\n result = [] as number[],\n map = identity\n): number[] {\n if ('longitude' in cartographic) {\n result[0] = map(cartographic.longitude);\n result[1] = map(cartographic.latitude);\n result[2] = cartographic.height;\n } else if ('x' in cartographic) {\n result[0] = map(cartographic.x);\n result[1] = map(cartographic.y);\n result[2] = cartographic.z;\n } else {\n result[0] = map(cartographic[0]);\n result[1] = map(cartographic[1]);\n result[2] = cartographic[2];\n }\n return result;\n}\n\nexport function fromCartographicToRadians(cartographic: Cartographic, result?: number[]): number[];\nexport function fromCartographicToRadians<TArray>(\n cartographic: Cartographic,\n result: TArray\n): TArray;\nexport function fromCartographicToRadians(\n cartographic: Cartographic,\n vector = [] as number[]\n): number[] {\n return fromCartographic(cartographic, vector, config._cartographicRadians ? identity : toRadians);\n}\n\nexport function fromCartographicToDegrees(cartographic: Cartographic, result?: number[]): number[];\nexport function fromCartographicToDegrees<TArray>(\n cartographic: Cartographic,\n result: TArray\n): TArray;\nexport function fromCartographicToDegrees(\n cartographic: Cartographic,\n vector = [] as number[]\n): number[] {\n return fromCartographic(cartographic, vector, config._cartographicRadians ? toDegrees : identity);\n}\n\nexport function toCartographic<T extends Cartographic>(\n vector: Readonly<NumericArray>,\n cartographic: T,\n map: (x: number) => number = identity\n): T {\n if ('longitude' in cartographic) {\n cartographic.longitude = map(vector[0]);\n cartographic.latitude = map(vector[1]);\n cartographic.height = vector[2];\n } else if ('x' in cartographic) {\n cartographic.x = map(vector[0]);\n cartographic.y = map(vector[1]);\n cartographic.z = vector[2];\n } else {\n cartographic[0] = map(vector[0]);\n cartographic[1] = map(vector[1]);\n cartographic[2] = vector[2];\n }\n return cartographic;\n}\n\nexport function toCartographicFromRadians<T extends Cartographic>(\n vector: Readonly<NumericArray>,\n cartographic: T\n): T {\n return toCartographic(vector, cartographic, config._cartographicRadians ? identity : toDegrees);\n}\n\nexport function toCartographicFromDegrees<T extends Cartographic>(\n vector: Readonly<NumericArray>,\n cartographic: T\n): T {\n return toCartographic(vector, cartographic, config._cartographicRadians ? toRadians : identity);\n}\n\n// Estimates if a vector is close to the surface of the WGS84 Ellipsoid\nexport function isWGS84(vector: Readonly<NumericArray>): boolean {\n if (!vector) {\n return false;\n }\n scratchVector.from(vector);\n const {oneOverRadiiSquared, centerToleranceSquared} = WGS84_CONSTANTS;\n const x2 = vector[0] * vector[0] * oneOverRadiiSquared[0];\n const y2 = vector[1] * vector[1] * oneOverRadiiSquared[1];\n const z2 = vector[2] * vector[2] * oneOverRadiiSquared[2];\n return Math.abs(x2 + y2 + z2 - 1) < centerToleranceSquared;\n}\n\n/*\n\nexport function fromCartographic(cartographic: Cartographic, result?: number[]): number[];\nexport function fromCartographic(cartographic: Cartographic, result: TypedArray): TypedArray;\nexport function fromCartographicToRadians(cartographic: Cartographic, result?: number[]): number[];\nexport function fromCartographicToRadians(\n cartographic: Cartographic,\n result: TypedArray\n): TypedArray;\nexport function fromCartographicToDegrees(cartographic: Cartographic, result?: number[]): number[];\nexport function fromCartographicToDegrees(\n cartographic: Cartographic,\n result: TypedArray\n): TypedArray;\n\nexport function toCartographic(vector: number[] | TypedArray, result: Cartographic): number[];\nexport function toCartographicFromRadians(\n vector: number[] | TypedArray,\n result: Cartographic\n): number[];\nexport function toCartographicFromDegrees(\n vector: number[] | TypedArray,\n result: Cartographic\n): number[];\n\n// Estimates if a vector is close to the surface of the WGS84 Ellipsoid\nexport function isWGS84(vector: number[] | TypedArray): boolean;\n*/\n", "/* eslint-disable */\nimport {Vector3, _MathUtils} from '@math.gl/core';\nimport type Ellipsoid from '../ellipsoid';\n\nconst scratchVector = new Vector3();\nconst scaleToGeodeticSurfaceIntersection = new Vector3();\nconst scaleToGeodeticSurfaceGradient = new Vector3();\n\n// Scales the provided Cartesian position along the geodetic surface normal\n// so that it is on the surface of this ellipsoid. If the position is\n// at the center of the ellipsoid, this function returns undefined.\nexport default function scaleToGeodeticSurface(\n cartesian: number[],\n ellipsoid: Ellipsoid,\n result: number[] = []\n): number[] {\n const {oneOverRadii, oneOverRadiiSquared, centerToleranceSquared} = ellipsoid;\n\n scratchVector.from(cartesian);\n\n const positionX = scratchVector.x;\n const positionY = scratchVector.y;\n const positionZ = scratchVector.z;\n\n const oneOverRadiiX = oneOverRadii.x;\n const oneOverRadiiY = oneOverRadii.y;\n const oneOverRadiiZ = oneOverRadii.z;\n\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\n\n // Compute the squared ellipsoid norm.\n const squaredNorm = x2 + y2 + z2;\n const ratio = Math.sqrt(1.0 / squaredNorm);\n\n // When very close to center or at center\n if (!Number.isFinite(ratio)) {\n return undefined;\n }\n\n // As an initial approximation, assume that the radial intersection is the projection point.\n const intersection = scaleToGeodeticSurfaceIntersection;\n intersection.copy(cartesian).scale(ratio);\n\n // If the position is near the center, the iteration will not converge.\n if (squaredNorm < centerToleranceSquared) {\n return intersection.to(result);\n }\n\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\n\n // Use the gradient at the intersection point in place of the true unit normal.\n // The difference in magnitude will be absorbed in the multiplier.\n const gradient = scaleToGeodeticSurfaceGradient;\n gradient.set(\n intersection.x * oneOverRadiiSquaredX * 2.0,\n intersection.y * oneOverRadiiSquaredY * 2.0,\n intersection.z * oneOverRadiiSquaredZ * 2.0\n );\n\n // Compute the initial guess at the normal vector multiplier, lambda.\n let lambda = ((1.0 - ratio) * scratchVector.len()) / (0.5 * gradient.len());\n let correction = 0.0;\n\n let xMultiplier;\n let yMultiplier;\n let zMultiplier;\n let func;\n\n do {\n lambda -= correction;\n\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\n\n const xMultiplier2 = xMultiplier * xMultiplier;\n const yMultiplier2 = yMultiplier * yMultiplier;\n const zMultiplier2 = zMultiplier * zMultiplier;\n\n const xMultiplier3 = xMultiplier2 * xMultiplier;\n const yMultiplier3 = yMultiplier2 * yMultiplier;\n const zMultiplier3 = zMultiplier2 * zMultiplier;\n\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\n\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\n // computations in the sections to follow.\n const denominator =\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\n\n const derivative = -2.0 * denominator;\n\n correction = func / derivative;\n } while (Math.abs(func) > _MathUtils.EPSILON12);\n\n return scratchVector.scale([xMultiplier, yMultiplier, zMultiplier]).to(result);\n}\n", "import {Vector3, assert, equals as equalsEpsilon} from '@math.gl/core';\n\nimport type Ellipsoid from '../ellipsoid';\n\nconst EPSILON14 = 1e-14;\n\nconst scratchOrigin = new Vector3();\n\n// Caclulate third axis from given two axii\nconst VECTOR_PRODUCT_LOCAL_FRAME = {\n up: {\n south: 'east',\n north: 'west',\n west: 'south',\n east: 'north'\n },\n down: {\n south: 'west',\n north: 'east',\n west: 'north',\n east: 'south'\n },\n south: {\n up: 'west',\n down: 'east',\n west: 'down',\n east: 'up'\n },\n north: {\n up: 'east',\n down: 'west',\n west: 'up',\n east: 'down'\n },\n west: {\n up: 'north',\n down: 'south',\n north: 'down',\n south: 'up'\n },\n east: {\n up: 'south',\n down: 'north',\n north: 'up',\n south: 'down'\n }\n} as const;\n\nconst degeneratePositionLocalFrame = {\n north: [-1, 0, 0],\n east: [0, 1, 0],\n up: [0, 0, 1],\n south: [1, 0, 0],\n west: [0, -1, 0],\n down: [0, 0, -1]\n} as const;\n\nconst scratchAxisVectors = {\n east: new Vector3(),\n north: new Vector3(),\n up: new Vector3(),\n west: new Vector3(),\n south: new Vector3(),\n down: new Vector3()\n};\n\nconst scratchVector1 = new Vector3();\nconst scratchVector2 = new Vector3();\nconst scratchVector3 = new Vector3();\n\ntype Axis = 'up' | 'down' | 'north' | 'east' | 'south' | 'west';\n\n// Computes a 4x4 transformation matrix from a reference frame\n// centered at the provided origin to the provided ellipsoid's fixed reference frame.\n// eslint-disable-next-line max-statements, max-params, complexity\nexport default function localFrameToFixedFrame(\n ellipsoid: Ellipsoid,\n firstAxis: Axis,\n secondAxis: Axis,\n thirdAxis: Axis,\n cartesianOrigin: number[],\n result: number[]\n): number[] {\n const thirdAxisInferred =\n VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] &&\n (VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis] as Axis);\n // firstAxis and secondAxis must be east, north, up, west, south or down.');\n assert(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));\n\n let firstAxisVector: Vector3;\n let secondAxisVector: Vector3;\n let thirdAxisVector: Vector3;\n\n const origin = scratchOrigin.copy(cartesianOrigin);\n\n // If x and y are zero, assume origin is at a pole, which is a special case.\n const atPole = equalsEpsilon(origin.x, 0.0, EPSILON14) && equalsEpsilon(origin.y, 0.0, EPSILON14);\n\n if (atPole) {\n // Look up axis value and adjust\n const sign = Math.sign(origin.z);\n\n firstAxisVector = scratchVector1.fromArray(degeneratePositionLocalFrame[firstAxis]);\n if (firstAxis !== 'east' && firstAxis !== 'west') {\n firstAxisVector.scale(sign);\n }\n\n secondAxisVector = scratchVector2.fromArray(degeneratePositionLocalFrame[secondAxis]);\n if (secondAxis !== 'east' && secondAxis !== 'west') {\n secondAxisVector.scale(sign);\n }\n\n thirdAxisVector = scratchVector3.fromArray(degeneratePositionLocalFrame[thirdAxis]);\n if (thirdAxis !== 'east' && thirdAxis !== 'west') {\n thirdAxisVector.scale(sign);\n }\n } else {\n // Calculate all axis\n const {up, east, north} = scratchAxisVectors;\n\n east.set(-origin.y, origin.x, 0.0).normalize();\n ellipsoid.geodeticSurfaceNormal(origin, up);\n north.copy(up).cross(east);\n\n const {down, west, south} = scratchAxisVectors;\n\n down.copy(up).scale(-1);\n west.copy(east).scale(-1);\n south.copy(north).scale(-1);\n\n // Pick three axis based on desired orientation\n firstAxisVector = scratchAxisVectors[firstAxis];\n secondAxisVector = scratchAxisVectors[secondAxis];\n thirdAxisVector = scratchAxisVectors[thirdAxis];\n }\n\n // TODO - assuming the result is column-major\n result[0] = firstAxisVector.x;\n result[1] = firstAxisVector.y;\n result[2] = firstAxisVector.z;\n result[3] = 0.0;\n result[4] = secondAxisVector.x;\n result[5] = secondAxisVector.y;\n result[6] = secondAxisVector.z;\n result[7] = 0.0;\n result[8] = thirdAxisVector.x;\n result[9] = thirdAxisVector.y;\n result[10] = thirdAxisVector.z;\n result[11] = 0.0;\n result[12] = origin.x;\n result[13] = origin.y;\n result[14] = origin.z;\n result[15] = 1.0;\n return result;\n}\n", "// This file is derived from the Cesium math library under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\n/* eslint-disable */\nimport {\n Vector3,\n Matrix4,\n toRadians,\n toDegrees,\n assert,\n equals,\n _MathUtils,\n NumericArray\n} from '@math.gl/core';\nimport * as vec3 from 'gl-matrix/vec3';\n\nimport {WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z} from '../constants';\nimport {fromCartographicToRadians, toCartographicFromRadians} from '../type-utils';\n\nimport scaleToGeodeticSurface from './helpers/scale-to-geodetic-surface';\nimport localFrameToFixedFrame from './helpers/ellipsoid-transform';\n\nconst scratchVector = new Vector3();\nconst scratchNormal = new Vector3();\nconst scratchK = new Vector3();\nconst scratchPosition = new Vector3();\nconst scratchHeight = new Vector3();\nconst scratchCartesian = new Vector3();\n\nlet wgs84;\n\n/**\n * A quadratic surface defined in Cartesian coordinates by the equation\n * `(x / a)^2 + (y / b)^2 + (z / c)^2 = 1`. Primarily used\n * to represent the shape of planetary bodies.\n */\nexport default class Ellipsoid {\n /** An Ellipsoid instance initialized to the WGS84 standard. */\n static readonly WGS84: Ellipsoid = new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);\n\n readonly radii: Vector3;\n readonly radiiSquared: Vector3;\n readonly radiiToTheFourth: Vector3;\n readonly oneOverRadii: Vector3;\n readonly oneOverRadiiSquared: Vector3;\n readonly minimumRadius: number;\n readonly maximumRadius: number;\n readonly centerToleranceSquared: number = _MathUtils.EPSILON1;\n readonly squaredXOverSquaredZ: number;\n\n /** Creates an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. */\n constructor(x: number, y: number, z: number);\n constructor();\n\n constructor(x = 0.0, y = 0.0, z = 0.0) {\n assert(x >= 0.0);\n assert(y >= 0.0);\n assert(z >= 0.0);\n\n this.radii = new Vector3(x, y, z);\n\n this.radiiSquared = new Vector3(x * x, y * y, z * z);\n\n this.radiiToTheFourth = new Vector3(x * x * x * x, y * y * y * y, z * z * z * z);\n\n this.oneOverRadii = new Vector3(\n x === 0.0 ? 0.0 : 1.0 / x,\n y === 0.0 ? 0.0 : 1.0 / y,\n z === 0.0 ? 0.0 : 1.0 / z\n );\n\n this.oneOverRadiiSquared = new Vector3(\n x === 0.0 ? 0.0 : 1.0 / (x * x),\n y === 0.0 ? 0.0 : 1.0 / (y * y),\n z === 0.0 ? 0.0 : 1.0 / (z * z)\n );\n\n this.minimumRadius = Math.min(x, y, z);\n\n this.maximumRadius = Math.max(x, y, z);\n\n if (this.radiiSquared.z !== 0) {\n this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;\n }\n\n Object.freeze(this);\n }\n\n /** Compares this Ellipsoid against the provided Ellipsoid componentwise */\n equals(right: Ellipsoid): boolean {\n return this === right || Boolean(right && this.radii.equals(right.radii));\n }\n\n /** Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'. */\n toString(): string {\n return this.radii.toString();\n }\n\n /** Converts the provided cartographic to Cartesian representation. */\n cartographicToCartesian(cartographic: number[], result: Vector3): Vector3;\n cartographicToCartesian(cartographic: number[], result?: number[]): number[];\n\n cartographicToCartesian(cartographic, result = [0, 0, 0]) {\n const normal = scratchNormal;\n const k = scratchK;\n\n const [, , height] = cartographic;\n this.geodeticSurfaceNormalCartographic(cartographic, normal);\n k.copy(this.radiiSquared).scale(normal);\n\n const gamma = Math.sqrt(normal.dot(k));\n k.scale(1 / gamma);\n\n normal.scale(height);\n\n k.add(normal);\n\n return k.to(result);\n }\n\n /** Converts the provided cartesian to cartographic (lng/lat/z) representation.\n * The cartesian is undefined at the center of the ellipsoid. */\n cartesianToCartographic(cartesian: number[], result: Vector3): Vector3;\n cartesianToCartographic(cartesian: number[], result?: number[]): number[];\n\n cartesianToCartographic(cartesian, result = [0, 0, 0]) {\n scratchCartesian.from(cartesian);\n const point = this.scaleToGeodeticSurface(scratchCartesian, scratchPosition);\n\n if (!point) {\n return undefined;\n }\n\n const normal = this.geodeticSurfaceNormal(point, scratchNormal);\n\n const h = scratchHeight;\n h.copy(scratchCartesian).subtract(point);\n\n const longitude = Math.atan2(normal.y, normal.x);\n const latitude = Math.asin(normal.z);\n const height = Math.sign(vec3.dot(h, scratchCartesian)) * vec3.length(h);\n\n return toCartographicFromRadians([longitude, latitude, height], result);\n }\n\n /** Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes\n * centered at the provided origin to the provided ellipsoid's fixed reference frame. */\n eastNorthUpToFixedFrame(origin: number[], result?: Matrix4): Matrix4;\n eastNorthUpToFixedFrame(origin: number[], result: number[]): number[];\n\n eastNorthUpToFixedFrame(origin, result = new Matrix4()) {\n return localFrameToFixedFrame(this, 'east', 'north', 'up', origin, result);\n }\n\n /** Computes a 4x4 transformation matrix from a reference frame centered at\n * the provided origin to the ellipsoid's fixed reference frame.\n */\n localFrameToFixedFrame(\n firstAxis: string,\n secondAxis: string,\n thirdAxis: string,\n origin: Readonly<NumericArray>,\n result?: Matrix4\n ): Matrix4;\n localFrameToFixedFrame<Matrix4T>(\n firstAxis: string,\n secondAxis: string,\n thirdAxis: string,\n origin: Readonly<NumericArray>,\n result: number[]\n ): number[];\n\n // Computes a 4x4 transformation matrix from a reference frame centered at\n // the provided origin to the ellipsoid's fixed reference frame.\n localFrameToFixedFrame(firstAxis, secondAxis, thirdAxis, origin, result = new Matrix4()) {\n return localFrameToFixedFrame(this, firstAxis, secondAxis, thirdAxis, origin, result);\n }\n\n /** Computes the unit vector directed from the center of this ellipsoid toward\n * the provided Cartesian position. */\n geocentricSurfaceNormal(cartesian: number[], result?: number[]): number[];\n geocentricSurfaceNormal<NumArray>(cartesian: number[], result: NumArray): NumArray;\n geocentricSurfaceNormal(cartesian, result = [0, 0, 0]) {\n return scratchVector.from(cartesian).normalize().to(result);\n }\n\n /** Computes the normal of the plane tangent to the surface of the ellipsoid at provided position. */\n geodeticSurfaceNormalCartographic<NumArray>(cartographic: number[], result: NumArray): NumArray;\n geodeticSurfaceNormalCartographic(cartographic: number[]): number[];\n geodeticSurfaceNormalCartographic(cartographic, result = [0, 0, 0]) {\n const cartographicVectorRadians = fromCartographicToRadians(cartographic);\n\n const longitude = cartographicVectorRadians[0];\n const latitude = cartographicVectorRadians[1];\n\n const cosLatitude = Math.cos(latitude);\n\n scratchVector\n .set(cosLatitude * Math.cos(longitude), cosLatitude * Math.sin(longitude), Math.sin(latitude))\n .normalize();\n\n return scratchVector.to(result);\n }\n\n /** Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position. */\n geodeticSurfaceNormal<NumArrayT>(cartesian: number[], result: NumArrayT): NumArrayT;\n geodeticSurfaceNormal(cartesian: number[]): number[];\n geodeticSurfaceNormal(cartesian, result = [0, 0, 0]) {\n return scratchVector.from(cartesian).scale(this.oneOverRadiiSquared).normalize().to(result);\n }\n\n /** Scales the provided Cartesian position along the geodetic surface normal\n * so that it is on the surface of this ellipsoid. If the position is\n * at the center of the ellipsoid, this function returns undefined. */\n scaleToGeodeticSurface(cartesian: number[], result?: number[]): number[] {\n return scaleToGeodeticSurface(cartesian, this, result);\n }\n\n /** Scales the provided Cartesian position along the geocentric surface normal\n * so that it is on the surface of this ellipsoid. */\n scaleToGeocentricSurface(cartesian: number[], result: number[] = [0, 0, 0]): number[] {\n scratchPosition.from(cartesian);\n\n const positionX = scratchPosition.x;\n const positionY = scratchPosition.y;\n const positionZ = scratchPosition.z;\n const oneOverRadiiSquared = this.oneOverRadiiSquared;\n\n const beta =\n 1.0 /\n Math.sqrt(\n positionX * positionX * oneOverRadiiSquared.x +\n positionY * positionY * oneOverRadiiSquared.y +\n positionZ * positionZ * oneOverRadiiSquared.z\n );\n\n return scratchPosition.multiplyScalar(beta).to(result);\n }\n\n /** Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\n * its components by the result of `Ellipsoid#oneOverRadii` */\n transformPositionToScaledSpace(position: number[], result: number[] = [0, 0, 0]): number[] {\n return scratchPosition.from(position).scale(this.oneOverRadii).to(result);\n }\n\n /** Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\n * its components by the result of `Ellipsoid#radii`. */\n transformPositionFromScaledSpace(position: number[], result: number[] = [0, 0, 0]): number[] {\n return scratchPosition.from(position).scale(this.radii).to(result);\n }\n\n /** Computes a point which is the intersection of the surface normal with the z-axis. */\n getSurfaceNormalIntersectionWithZAxis(\n position: number[],\n buffer: number = 0,\n result: number[] = [0, 0, 0]\n ): number[] {\n // Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\n assert(equals(this.radii.x, this.radii.y, _MathUtils.EPSILON15));\n assert(this.radii.z > 0);\n\n scratchPosition.from(position);\n const z = scratchPosition.z * (1 - this.squaredXOverSquaredZ);\n\n if (Math.abs(z) >= this.radii.z - buffer) {\n return undefined;\n }\n\n return scratchPosition.set(0.0, 0.0, z).to(result);\n }\n}\n", "export {default as Ellipsoid} from './ellipsoid/ellipsoid';\nexport {isWGS84} from './type-utils';\n", "(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n", "var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n", "/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n", "(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n", "// NOTE - there is a copy of this function is both in core and loader-utils\n// core does not need all the utils in loader-utils, just this one.\n\n/**\n * Returns an array of Transferrable objects that can be used with postMessage\n * https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage\n * @param object data to be sent via postMessage\n * @param recursive - not for application use\n * @param transfers - not for application use\n * @returns a transfer list that can be passed to postMessage\n */\nexport function getTransferList(\n object: any,\n recursive: boolean = true,\n transfers?: Set<any>\n): Transferable[] {\n // Make sure that items in the transfer list is unique\n const transfersSet = transfers || new Set();\n\n if (!object) {\n // ignore\n } else if (isTransferable(object)) {\n transfersSet.add(object);\n } else if (isTransferable(object.buffer)) {\n // Typed array\n transfersSet.add(object.buffer);\n } else if (ArrayBuffer.isView(object)) {\n // object is a TypeArray viewing into a SharedArrayBuffer (not transferable)\n // Do not iterate through the content in this case\n } else if (recursive && typeof object === 'object') {\n for (const key in object) {\n // Avoid perf hit - only go one level deep\n getTransferList(object[key], recursive, transfersSet);\n }\n }\n\n // If transfers is defined, is internal recursive call\n // Otherwise it's called by the user\n return transfers === undefined ? Array.from(transfersSet) : [];\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Transferable\nfunction isTransferable(object: unknown) {\n if (!object) {\n return false;\n }\n if (object instanceof ArrayBuffer) {\n return true;\n }\n if (typeof MessagePort !== 'undefined' && object instanceof MessagePort) {\n return true;\n }\n if (typeof ImageBitmap !== 'undefined' && object instanceof ImageBitmap) {\n return true;\n }\n // @ts-ignore\n if (typeof OffscreenCanvas !== 'undefined' && object instanceof OffscreenCanvas) {\n return true;\n }\n return false;\n}\n\n/**\n * Recursively drop non serializable values like functions and regexps.\n * @param object\n */\nexport function getTransferListForWriter(object: object | null): object {\n if (object === null) {\n return {};\n }\n const clone = Object.assign({}, object);\n\n Object.keys(clone).forEach((key) => {\n // Typed Arrays and Arrays are passed with no change\n if (\n typeof object[key] === 'object' &&\n !ArrayBuffer.isView(object[key]) &&\n !(object[key] instanceof Array)\n ) {\n clone[key] = getTransferListForWriter(object[key]);\n } else if (typeof clone[key] === 'function' || clone[key] instanceof RegExp) {\n clone[key] = {};\n } else {\n clone[key] = object[key];\n }\n });\n\n return clone;\n}\n", "import type {WorkerMessageData, WorkerMessageType, WorkerMessagePayload} from '../../types';\nimport {getTransferList} from '../worker-utils/get-transfer-list';\n\n/** Vile hack to defeat over-zealous bundlers from stripping out the require */\nfunction getParentPort() {\n // const isNode = globalThis.process;\n let parentPort;\n try {\n // prettier-ignore\n eval('globalThis.parentPort = require(\\'worker_threads\\').parentPort'); // eslint-disable-line no-eval\n parentPort = globalThis.parentPort;\n // eslint-disable-next-line no-empty\n } catch {}\n return parentPort;\n}\n\nconst onMessageWrapperMap = new Map();\n\n/**\n * Type safe wrapper for worker code\n */\nexport default class WorkerBody {\n /** Check that we are actually in a worker thread */\n static inWorkerThread(): boolean {\n return typeof self !== 'undefined' || Boolean(getParentPort());\n }\n\n /*\n * (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n */\n static set onmessage(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any) {\n function handleMessage(message) {\n // Confusingly the message itself also has a 'type' field which is always set to 'message'\n const parentPort = getParentPort();\n const {type, payload} = parentPort ? message : message.data;\n // if (!isKnownMessage(message)) {\n // return;\n // }\n onMessage(type, payload);\n }\n\n const parentPort = getParentPort();\n if (parentPort) {\n parentPort.on('message', handleMessage);\n // if (message == 'exit') { parentPort.unref(); }\n // eslint-disable-next-line\n parentPort.on('exit', () => console.debug('Node worker closing'));\n } else {\n // eslint-disable-next-line no-restricted-globals\n globalThis.onmessage = handleMessage;\n }\n }\n\n static addEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n let onMessageWrapper = onMessageWrapperMap.get(onMessage);\n\n if (!onMessageWrapper) {\n onMessageWrapper = (message: MessageEvent<any>) => {\n if (!isKnownMessage(message)) {\n return;\n }\n\n // Confusingly in the browser, the message itself also has a 'type' field which is always set to 'message'\n const parentPort = getParentPort();\n const {type, payload} = parentPort ? message : message.data;\n onMessage(type, payload);\n };\n }\n\n const parentPort = getParentPort();\n if (parentPort) {\n console.error('not implemented'); // eslint-disable-line\n } else {\n globalThis.addEventListener('message', onMessageWrapper);\n }\n }\n\n static removeEventListener(\n onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any\n ) {\n const onMessageWrapper = onMessageWrapperMap.get(onMessage);\n onMessageWrapperMap.delete(onMessage);\n const parentPort = getParentPort();\n if (parentPort) {\n console.error('not implemented'); // eslint-disable-line\n } else {\n globalThis.removeEventListener('message', onMessageWrapper);\n }\n }\n\n /**\n * Send a message from a worker to creating thread (main thread)\n * @param type\n * @param payload\n */\n static postMessage(type: WorkerMessageType, payload: WorkerMessagePayload): void {\n const data: WorkerMessageData = {source: 'loaders.gl', type, payload};\n // console.log('posting message', data);\n const transferList = getTransferList(payload);\n\n const parentPort = getParentPort();\n if (parentPort) {\n parentPort.postMessage(data, transferList);\n // console.log('posted message', data);\n } else {\n // @ts-ignore\n globalThis.postMessage(data, transferList);\n }\n }\n}\n\n// Filter out noise messages sent to workers\nfunction isKnownMessage(message: MessageEvent<any>) {\n const {type, data} = message;\n return (\n type === 'message' &&\n data &&\n typeof data.source === 'string' &&\n data.source.startsWith('loaders.gl')\n );\n}\n", "// From https://github.com/rauschma/async-iter-demo/tree/master/src under MIT license\n// http://2ality.com/2016/10/asynchronous-iteration.html\n\n/**\n * Async Queue\n * - AsyncIterable: An async iterator can be\n * - Values can be pushed onto the queue\n * @example\n * const asyncQueue = new AsyncQueue();\n * setTimeout(() => asyncQueue.enqueue('tick'), 1000);\n * setTimeout(() => asyncQueue.enqueue(new Error('done')), 10000);\n * for await (const value of asyncQueue) {\n * console.log(value); // tick\n * }\n */\nexport default class AsyncQueue<T> {\n private _values: any[];\n private _settlers: any[];\n private _closed: boolean;\n\n constructor() {\n this._values = []; // enqueues > dequeues\n this._settlers = []; // dequeues > enqueues\n this._closed = false;\n }\n\n /** Return an async iterator for this queue */\n [Symbol.asyncIterator](): AsyncIterator<T> {\n return this;\n }\n\n /** Push a new value - the async iterator will yield a promise resolved to this value */\n push(value: T): void {\n return this.enqueue(value);\n }\n\n /**\n * Push a new value - the async iterator will yield a promise resolved to this value\n * Add an error - the async iterator will yield a promise rejected with this value\n */\n enqueue(value: T | Error): void {\n if (this._closed) {\n throw new Error('Closed');\n }\n\n if (this._settlers.length > 0) {\n if (this._values.length > 0) {\n throw new Error('Illegal internal state');\n }\n const settler = this._settlers.shift();\n if (value instanceof Error) {\n settler.reject(value);\n } else {\n settler.resolve({value});\n }\n } else {\n this._values.push(value);\n }\n }\n\n /** Indicate that we not waiting for more values - The async iterator will be done */\n close(): void {\n while (this._settlers.length > 0) {\n const settler = this._settlers.shift();\n settler.resolve({done: true});\n }\n this._closed = true;\n }\n\n // ITERATOR IMPLEMENTATION\n\n /** @returns a Promise for an IteratorResult */\n next(): Promise<IteratorResult<T, any>> {\n // If values in queue, yield the first value\n if (this._values.length > 0) {\n const value = this._values.shift();\n if (value instanceof Error) {\n return Promise.reject(value);\n }\n return Promise.resolve({done: false, value});\n }\n\n // If queue is closed, the iterator is done\n if (this._closed) {\n if (this._settlers.length > 0) {\n throw new Error('Illegal internal state');\n }\n return Promise.resolve({done: true, value: undefined});\n }\n\n // Yield a promise that waits for new values to be enqueued\n return new Promise((resolve, reject) => {\n this._settlers.push({resolve, reject});\n });\n }\n}\n", "import type {\n WorkerMessageType,\n WorkerMessagePayload,\n WorkerContext,\n Process,\n ProcessInBatches\n} from '../../types';\nimport AsyncQueue from '../async-queue/async-queue';\nimport WorkerBody from '../worker-farm/worker-body';\n// import {validateWorkerVersion} from './validate-worker-version';\n\n/** Counter for jobs */\nlet requestId = 0;\nlet inputBatches: AsyncQueue<any>;\nlet options: {[key: string]: any};\n\nexport type ProcessOnMainThread = (\n data: any,\n options?: {[key: string]: any},\n context?: WorkerContext\n) => any;\n\n/**\n * Set up a WebWorkerGlobalScope to talk with the main thread\n */\nexport function createWorker(process: Process, processInBatches?: ProcessInBatches): void {\n if (!WorkerBody.inWorkerThread()) {\n return;\n }\n\n const context: WorkerContext = {\n process: processOnMainThread\n };\n\n // eslint-disable-next-line complexity\n WorkerBody.onmessage = async (type: WorkerMessageType, payload: WorkerMessagePayload) => {\n try {\n switch (type) {\n case 'process':\n if (!process) {\n throw new Error('Worker does not support atomic processing');\n }\n const result = await process(payload.input, payload.options || {}, context);\n WorkerBody.postMessage('done', {result});\n break;\n\n case 'process-in-batches':\n if (!processInBatches) {\n throw new Error('Worker does not support batched processing');\n }\n inputBatches = new AsyncQueue<any>();\n options = payload.options || {};\n const resultIterator = processInBatches(inputBatches, options, context);\n for await (const batch of resultIterator) {\n WorkerBody.postMessage('output-batch', {result: batch});\n }\n WorkerBody.postMessage('done', {});\n break;\n\n case 'input-batch':\n inputBatches.push(payload.input);\n break;\n\n case 'input-done':\n inputBatches.close();\n break;\n\n default:\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : '';\n WorkerBody.postMessage('error', {error: message});\n }\n };\n}\n\nfunction processOnMainThread(arrayBuffer: ArrayBuffer, options = {}) {\n return new Promise((resolve, reject) => {\n const id = requestId++;\n\n /**\n */\n const onMessage = (type: string, payload: WorkerMessagePayload) => {\n if (payload.id !== id) {\n // not ours\n return;\n }\n\n switch (type) {\n case 'done':\n WorkerBody.removeEventListener(onMessage);\n resolve(payload.result);\n break;\n\n case 'error':\n WorkerBody.removeEventListener(onMessage);\n reject(payload.error);\n break;\n\n default:\n // ignore\n }\n };\n\n WorkerBody.addEventListener(onMessage);\n\n // Ask the main thread to decode data\n const payload = {id, input: arrayBuffer, options};\n WorkerBody.postMessage('process', payload);\n });\n}\n", "import type {FeatureTableJson, Tiles3DTileContent} from '@loaders.gl/3d-tiles';\nimport type {\n GLTF_EXT_feature_metadata,\n GLTF_EXT_mesh_features,\n GLTFAccessorPostprocessed,\n GLTFMaterialPostprocessed,\n GLTFNodePostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFMeshPostprocessed,\n GLTFTexturePostprocessed\n} from '@loaders.gl/gltf';\n\nimport {Vector3, Matrix4, Vector4} from '@math.gl/core';\nimport {Ellipsoid} from '@math.gl/geospatial';\n\nimport {DracoWriterWorker} from '@loaders.gl/draco';\nimport {assert, encode} from '@loaders.gl/core';\nimport {concatenateArrayBuffers, concatenateTypedArrays} from '@loaders.gl/loader-utils';\nimport md5 from 'md5';\nimport {v4 as uuidv4} from 'uuid';\nimport {generateAttributes} from './geometry-attributes';\nimport {createBoundingVolumesFromGeometry} from './coordinate-converter';\nimport {\n ConvertedAttributes,\n I3SConvertedResources,\n I3SMaterialWithTexture,\n MergedMaterial,\n SharedResourcesArrays\n} from '../types';\nimport {\n AttributeStorageInfo,\n I3SMaterialDefinition,\n MaterialDefinitionInfo,\n TextureDefinitionInfo\n} from '@loaders.gl/i3s';\nimport {NumberArray, TypedArray} from '@loaders.gl/loader-utils';\nimport {Geoid} from '@math.gl/geoid';\n/** Usage of worker here brings more overhead than advantage */\nimport {\n B3DMAttributesData /*, transformI3SAttributesOnWorker*/,\n TextureImageProperties\n} from '../../i3s-attributes-worker';\nimport {prepareDataForAttributesConversion} from './gltf-attributes';\nimport {handleBatchIdsExtensions} from './batch-ids-extensions';\nimport {checkPropertiesLength, flattenPropertyTableByFeatureIds} from './feature-attributes';\nimport {GL} from '@loaders.gl/math';\n\n/*\n At the moment of writing the type TypedArrayConstructor is not exported in '@math.gl/types'.\n So the following import is replaced with the local import\n import type {TypedArrayConstructor} from '@math.gl/types'; \n*/\nimport type {TypedArrayConstructor} from '../types';\nimport {generateSyntheticIndices} from '../../lib/utils/geometry-utils';\nimport {BoundingSphere, OrientedBoundingBox} from '@math.gl/culling';\n\n// Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/pbrMetallicRoughness.cmn.md\nconst DEFAULT_ROUGHNESS_FACTOR = 1;\nconst DEFAULT_METALLIC_FACTOR = 1;\n\nconst VALUES_PER_VERTEX = 3;\nconst VALUES_PER_TEX_COORD = 2;\nconst VALUES_PER_COLOR_ELEMENT = 4;\n\nconst STRING_TYPE = 'string';\nconst SHORT_INT_TYPE = 'Int32';\nconst DOUBLE_TYPE = 'Float64';\nconst OBJECT_ID_TYPE = 'Oid32';\n/*\n * 'CUSTOM_ATTRIBUTE_2' - Attribute name which includes batch info and used by New York map.\n * _BATCHID - Default attribute name which includes batch info.\n * BATCHID - Legacy attribute name which includes batch info.\n */\nconst BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ['CUSTOM_ATTRIBUTE_2', '_BATCHID', 'BATCHID'];\n\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\nconst EXT_MESH_FEATURES = 'EXT_mesh_features';\n\nlet scratchVector = new Vector3();\n\n/**\n * Convert binary data from b3dm file to i3s resources\n *\n * @param tileContent - 3d tile content\n * @param tileTransform - transformation matrix of the tile, calculated recursively multiplying\n * transform of all parent tiles and transform of the current tile\n * @param tileBoundingVolume - initialized bounding volume of the source tile\n * @param addNodeToNodePage - function to add new node to node pages\n * @param propertyTable - batch table (corresponding to feature attributes data)\n * @param featuresHashArray - hash array of features that is needed to not to mix up same features in parent and child nodes\n * @param attributeStorageInfo - attributes metadata from 3DSceneLayer json\n * @param draco - is converter should create draco compressed geometry\n * @param generateBoundingVolumes - is converter should create accurate bounding voulmes from geometry attributes\n * @param shouldMergeMaterials - Try to merge similar materials to be able to merge meshes into one node\n * @param geoidHeightModel - model to convert elevation from elipsoidal to geoid\n * @param workerSource - source code of used workers\n * @returns Array of node resources to create one or more i3s nodes\n */\nexport default async function convertB3dmToI3sGeometry(\n tileContent: Tiles3DTileContent,\n tileTransform: Matrix4,\n tileBoundingVolume: OrientedBoundingBox | BoundingSphere,\n addNodeToNodePage: () => Promise<number>,\n propertyTable: FeatureTableJson | null,\n featuresHashArray: string[],\n attributeStorageInfo: AttributeStorageInfo[] | undefined,\n draco: boolean,\n generateBoundingVolumes: boolean,\n shouldMergeMaterials: boolean,\n geoidHeightModel: Geoid,\n workerSource: {[key: string]: string}\n): Promise<I3SConvertedResources[] | null> {\n const useCartesianPositions = generateBoundingVolumes;\n const materialAndTextureList: I3SMaterialWithTexture[] = await convertMaterials(\n tileContent.gltf?.materials,\n shouldMergeMaterials\n );\n\n const dataForAttributesConversion = prepareDataForAttributesConversion(\n tileContent,\n tileTransform,\n tileBoundingVolume\n );\n const convertedAttributesMap: Map<string, ConvertedAttributes> = await convertAttributes(\n dataForAttributesConversion,\n materialAndTextureList,\n useCartesianPositions\n );\n /** Usage of worker here brings more overhead than advantage */\n // const convertedAttributesMap: Map<string, ConvertedAttributes> =\n // await transformI3SAttributesOnWorker(dataForAttributesConversion, {\n // reuseWorkers: true,\n // _nodeWorkers: true,\n // useCartesianPositions,\n // source: workerSource.I3SAttributes\n // });\n\n if (generateBoundingVolumes) {\n _generateBoundingVolumesFromGeometry(convertedAttributesMap, geoidHeightModel);\n }\n\n const result: I3SConvertedResources[] = [];\n for (const materialAndTexture of materialAndTextureList) {\n const originarMaterialId = materialAndTexture.mergedMaterials[0].originalMaterialId;\n if (!convertedAttributesMap.has(originarMaterialId)) {\n continue; // eslint-disable-line no-continue\n }\n const convertedAttributes = convertedAttributesMap.get(originarMaterialId);\n if (!convertedAttributes) {\n continue;\n }\n const {material, texture} = materialAndTexture;\n const nodeId = await addNodeToNodePage();\n result.push(\n await _makeNodeResources({\n convertedAttributes,\n material,\n texture,\n tileContent,\n nodeId,\n featuresHashArray,\n propertyTable,\n attributeStorageInfo,\n draco,\n workerSource\n })\n );\n }\n\n if (!result.length) {\n return null;\n }\n return result;\n}\n\n/**\n * Create bounding volumes based on positions\n * @param convertedAttributesMap - geometry attributes map\n * @param geoidHeightModel - geoid height model to convert elevation from elipsoidal to geoid\n */\nfunction _generateBoundingVolumesFromGeometry(\n convertedAttributesMap: Map<string, ConvertedAttributes>,\n geoidHeightModel: Geoid\n) {\n for (const attributes of convertedAttributesMap.values()) {\n const boundingVolumes = createBoundingVolumesFromGeometry(\n attributes.positions,\n geoidHeightModel\n );\n\n attributes.boundingVolumes = boundingVolumes;\n const cartographicOrigin = boundingVolumes.obb.center;\n\n for (let index = 0; index < attributes.positions.length; index += VALUES_PER_VERTEX) {\n const vertex = attributes.positions.subarray(index, index + VALUES_PER_VERTEX);\n Ellipsoid.WGS84.cartesianToCartographic(Array.from(vertex), scratchVector);\n scratchVector[2] =\n scratchVector[2] - geoidHeightModel.getHeight(scratchVector[1], scratchVector[0]);\n scratchVector = scratchVector.subtract(cartographicOrigin);\n attributes.positions.set(scratchVector, index);\n }\n }\n}\n\n/**\n *\n * @param params\n * @param params.convertedAttributes - Converted geometry attributes\n * @param params.material - I3S PBR-like material definition\n * @param params.texture - texture content\n * @param params.tileContent - 3DTiles decoded content\n * @param params.nodeId - new node ID\n * @param params.featuresHashArray - hash array of features that is needed to not to mix up same features in parent and child nodes\n * @param params.propertyTable - batch table (corresponding to feature attributes data)\n * @param params.attributeStorageInfo - attributes metadata from 3DSceneLayer json\n * @param params.draco - is converter should create draco compressed geometry\n * @param params.workerSource - source code of used workers\n * @returns Array of I3S node resources\n */\nasync function _makeNodeResources({\n convertedAttributes,\n material,\n texture,\n tileContent,\n nodeId,\n featuresHashArray,\n propertyTable,\n attributeStorageInfo,\n draco,\n workerSource\n}: {\n convertedAttributes: ConvertedAttributes;\n material: I3SMaterialDefinition;\n texture?: {};\n tileContent: Tiles3DTileContent;\n nodeId: number;\n featuresHashArray: string[];\n propertyTable: FeatureTableJson | null;\n attributeStorageInfo?: AttributeStorageInfo[];\n draco: boolean;\n workerSource: {[key: string]: string};\n}): Promise<I3SConvertedResources> {\n const boundingVolumes = convertedAttributes.boundingVolumes;\n const vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX;\n const {faceRange, featureIds, positions, normals, colors, uvRegions, texCoords, featureCount} =\n generateAttributes(convertedAttributes);\n\n if (tileContent.batchTableJson) {\n makeFeatureIdsUnique(\n featureIds,\n convertedAttributes.featureIndices,\n featuresHashArray,\n tileContent.batchTableJson\n );\n }\n\n const header = new Uint32Array(2);\n const typedFeatureIds = generateBigUint64Array(featureIds);\n\n header.set([vertexCount, featureCount], 0);\n const fileBuffer = new Uint8Array(\n concatenateArrayBuffers(\n header.buffer,\n positions.buffer,\n normals.buffer,\n texture ? texCoords.buffer : new ArrayBuffer(0),\n colors.buffer,\n uvRegions,\n typedFeatureIds.buffer,\n faceRange.buffer\n )\n );\n const compressedGeometry = draco\n ? generateCompressedGeometry(\n vertexCount,\n convertedAttributes,\n {\n positions,\n normals,\n texCoords: texture ? texCoords : new Float32Array(0),\n colors,\n uvRegions,\n featureIds,\n faceRange\n },\n workerSource.draco\n )\n : null;\n\n let attributes: ArrayBuffer[] = [];\n\n if (attributeStorageInfo && propertyTable) {\n attributes = convertPropertyTableToAttributeBuffers(\n featureIds,\n propertyTable,\n attributeStorageInfo\n );\n }\n\n return {\n nodeId,\n geometry: fileBuffer,\n compressedGeometry,\n texture,\n hasUvRegions: Boolean(uvRegions.length),\n sharedResources: getSharedResources(tileContent.gltf?.materials || [], nodeId),\n meshMaterial: material,\n vertexCount,\n attributes,\n featureCount,\n boundingVolumes\n };\n}\n\n/**\n * Convert attributes from the gltf nodes tree to i3s plain geometry\n * @param attributesData - geometry attributes from gltf\n * @param materialAndTextureList - array of data about materials and textures of the content\n * @param useCartesianPositions - convert positions to absolute cartesian coordinates instead of cartographic offsets.\n * Cartesian coordinates will be required for creating bounding voulmest from geometry positions\n * @returns map of converted geometry attributes\n */\nexport async function convertAttributes(\n attributesData: B3DMAttributesData,\n materialAndTextureList: I3SMaterialWithTexture[],\n useCartesianPositions: boolean\n): Promise<Map<string, ConvertedAttributes>> {\n const {nodes, images, cartographicOrigin, cartesianModelMatrix} = attributesData;\n const attributesMap = new Map<string, ConvertedAttributes>();\n\n for (const materialAndTexture of materialAndTextureList) {\n const attributes = {\n positions: new Float32Array(0),\n normals: new Float32Array(0),\n texCoords: new Float32Array(0),\n colors: new Uint8Array(0),\n uvRegions: new Uint16Array(0),\n featureIndicesGroups: [],\n featureIndices: [],\n boundingVolumes: null,\n mergedMaterials: materialAndTexture.mergedMaterials\n };\n for (const mergedMaterial of materialAndTexture.mergedMaterials) {\n attributesMap.set(mergedMaterial.originalMaterialId, attributes);\n }\n }\n\n convertNodes(\n nodes,\n images,\n cartographicOrigin,\n cartesianModelMatrix,\n attributesMap,\n useCartesianPositions\n );\n\n for (const attrKey of attributesMap.keys()) {\n const attributes = attributesMap.get(attrKey);\n if (!attributes) {\n continue;\n }\n if (attributes.positions.length === 0) {\n attributesMap.delete(attrKey);\n continue; // eslint-disable-line no-continue\n }\n if (attributes.featureIndicesGroups) {\n attributes.featureIndices = attributes.featureIndicesGroups.reduce((acc, value) =>\n acc.concat(value)\n );\n delete attributes.featureIndicesGroups;\n }\n }\n\n return attributesMap;\n}\n\n/**\n * Gltf has hierarchical structure of nodes. This function converts nodes starting from those which are in gltf scene object.\n * The goal is applying tranformation matrix for all children. Functions \"convertNodes\" and \"convertNode\" work together recursively.\n * @param nodes - gltf nodes array\n * @param images - gltf images array\n * @param cartographicOrigin - cartographic origin of bounding volume\n * @param cartesianModelMatrix - cartesian model matrix to convert coordinates to cartographic\n * @param attributesMap - for recursive concatenation of attributes\n * @param useCartesianPositions - convert positions to absolute cartesian coordinates instead of cartographic offsets.\n * Cartesian coordinates will be required for creating bounding voulmest from geometry positions\n * @param matrix - transformation matrix - cumulative transformation matrix formed from all parent node matrices\n * @returns {void}\n */\nfunction convertNodes(\n nodes: GLTFNodePostprocessed[],\n images: (TextureImageProperties | null)[],\n cartographicOrigin: Vector3,\n cartesianModelMatrix: Matrix4,\n attributesMap: Map<string, ConvertedAttributes>,\n useCartesianPositions: boolean,\n matrix: Matrix4 = new Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])\n) {\n if (nodes) {\n for (const node of nodes) {\n convertNode(\n node,\n images,\n cartographicOrigin,\n cartesianModelMatrix,\n attributesMap,\n useCartesianPositions,\n matrix\n );\n }\n }\n}\n\n/**\n * Generate transformation matrix for node\n * Aapply all gltf transformations to initial transformation matrix.\n * @param node\n * @param matrix\n */\nfunction getCompositeTransformationMatrix(node: GLTFNodePostprocessed, matrix: Matrix4) {\n let transformationMatrix = matrix;\n\n const {matrix: nodeMatrix, rotation, scale, translation} = node;\n\n if (nodeMatrix) {\n transformationMatrix = matrix.multiplyRight(nodeMatrix);\n }\n\n if (translation) {\n transformationMatrix = transformationMatrix.translate(translation);\n }\n\n if (rotation) {\n transformationMatrix = transformationMatrix.rotateXYZ(rotation);\n }\n\n if (scale) {\n transformationMatrix = transformationMatrix.scale(scale);\n }\n\n return transformationMatrix;\n}\n\n/**\n * Convert all primitives of node and all children nodes\n * @param node - gltf node\n * @param images - gltf images array\n * @param cartographicOrigin - cartographic origin of bounding volume\n * @param cartesianModelMatrix - cartesian model matrix to convert coordinates to cartographic\n * @param {Map} attributesMap Map<{positions: Float32Array, normals: Float32Array, texCoords: Float32Array, colors: Uint8Array, featureIndices: Array}> - for recursive concatenation of\n * attributes\n * @param useCartesianPositions - convert positions to absolute cartesian coordinates instead of cartographic offsets.\n * Cartesian coordinates will be required for creating bounding voulmest from geometry positions\n * @param {Matrix4} matrix - transformation matrix - cumulative transformation matrix formed from all parent node matrices\n */\nfunction convertNode(\n node: GLTFNodePostprocessed,\n images: (TextureImageProperties | null)[],\n cartographicOrigin: Vector3,\n cartesianModelMatrix: Matrix4,\n attributesMap: Map<string, ConvertedAttributes>,\n useCartesianPositions,\n matrix = new Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])\n) {\n const transformationMatrix = getCompositeTransformationMatrix(node, matrix);\n\n const mesh = node.mesh;\n\n if (mesh) {\n convertMesh(\n mesh,\n images,\n cartographicOrigin,\n cartesianModelMatrix,\n attributesMap,\n useCartesianPositions,\n transformationMatrix\n );\n }\n\n convertNodes(\n node.children || [],\n images,\n cartographicOrigin,\n cartesianModelMatrix,\n attributesMap,\n useCartesianPositions,\n transformationMatrix\n );\n}\n\n/**\n * Convert all primitives of the mesh\n * @param mesh - gltf mesh data\n * @param images - gltf images array\n * @param cartographicOrigin - cartographic origin of bounding volume\n * @param cartesianModelMatrix - cartesian model matrix to convert coordinates to cartographic\n * @param attributesMap Map<{positions: Float32Array, normals: Float32Array, texCoords: Float32Array, colors: Uint8Array, featureIndices: Array}> - for recursive concatenation of\n * attributes\n * @param useCartesianPositions - convert positions to absolute cartesian coordinates instead of cartographic offsets. \n * Cartesian coordinates will be required for creating bounding voulmest from geometry positions\n * @param attributesMap Map<{positions: Float32Array, normals: Float32Array, texCoords: Float32Array, colors: Uint8Array, featureIndices: Array}> - for recursive concatenation of\n * attributes\n \n * @param {Matrix4} matrix - transformation matrix - cumulative transformation matrix formed from all parent node matrices\n */\nfunction convertMesh(\n mesh: GLTFMeshPostprocessed,\n images: (TextureImageProperties | null)[],\n cartographicOrigin: Vector3,\n cartesianModelMatrix: Matrix4,\n attributesMap: Map<string, ConvertedAttributes>,\n useCartesianPositions = false,\n matrix = new Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])\n) {\n for (const primitive of mesh.primitives) {\n let outputAttributes: ConvertedAttributes | null | undefined = null;\n let materialUvRegion: Uint16Array | undefined;\n if (primitive.material) {\n outputAttributes = attributesMap.get(primitive.material.id);\n materialUvRegion = outputAttributes?.mergedMaterials.find(\n ({originalMaterialId}) => originalMaterialId === primitive.material?.id\n )?.uvRegion;\n } else if (attributesMap.has('default')) {\n outputAttributes = attributesMap.get('default');\n }\n assert(outputAttributes !== null, 'Primitive - material mapping failed');\n // Per the spec https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode\n // GL.TRIANGLES is default. So in case `mode` is `undefined`, it is 'TRIANGLES'\n assert(\n primitive.mode === undefined ||\n primitive.mode === GL.TRIANGLES ||\n primitive.mode === GL.TRIANGLE_STRIP,\n `Primitive - unsupported mode ${primitive.mode}`\n );\n const attributes = primitive.attributes;\n if (!outputAttributes) {\n continue;\n }\n\n const indices = normalizeIndices(primitive);\n outputAttributes.positions = concatenateTypedArrays(\n outputAttributes.positions,\n transformVertexArray({\n vertices: attributes.POSITION.value,\n cartographicOrigin,\n cartesianModelMatrix,\n nodeMatrix: matrix,\n indices,\n attributeSpecificTransformation: transformVertexPositions,\n useCartesianPositions\n })\n );\n outputAttributes.normals = concatenateTypedArrays(\n outputAttributes.normals,\n transformVertexArray({\n vertices: attributes.NORMAL && attributes.NORMAL.value,\n cartographicOrigin,\n cartesianModelMatrix,\n nodeMatrix: matrix,\n indices,\n attributeSpecificTransformation: transformVertexNormals,\n useCartesianPositions: false\n })\n );\n outputAttributes.texCoords = concatenateTypedArrays(\n outputAttributes.texCoords,\n flattenTexCoords(attributes.TEXCOORD_0 && attributes.TEXCOORD_0.value, indices)\n );\n\n outputAttributes.colors = concatenateTypedArrays(\n outputAttributes.colors,\n flattenColors(attributes.COLOR_0, indices)\n );\n\n if (materialUvRegion) {\n outputAttributes.uvRegions = concatenateTypedArrays(\n outputAttributes.uvRegions,\n createUvRegion(materialUvRegion, indices)\n );\n }\n\n outputAttributes.featureIndicesGroups = outputAttributes.featureIndicesGroups || [];\n outputAttributes.featureIndicesGroups.push(\n flattenBatchIds(getBatchIds(attributes, primitive, images), indices)\n );\n }\n}\n/**\n * Converts TRIANGLE-STRIPS to independent TRIANGLES\n * @param primitive - the primitive to get the indices from\n * @returns indices of vertices of the independent triangles\n */\nfunction normalizeIndices(primitive: GLTFMeshPrimitivePostprocessed): TypedArray {\n let indices: TypedArray | undefined = primitive.indices?.value;\n if (!indices) {\n const positions = primitive.attributes.POSITION.value;\n return generateSyntheticIndices(positions.length / VALUES_PER_VERTEX);\n }\n\n if (indices && primitive.mode === GL.TRIANGLE_STRIP) {\n /*\n TRIANGLE_STRIP geometry contains n+2 vertices for n triangles;\n TRIANGLE geometry contains n*3 vertices for n triangles.\n The conversion from TRIANGLE_STRIP to TRIANGLE implies duplicating adjacent vertices.\n */\n const TypedArrayConstructor = indices.constructor as TypedArrayConstructor;\n const newIndices = new TypedArrayConstructor((indices.length - 2) * 3);\n\n // Copy the first triangle indices with no modification like [i0, i1, i2, ...] -> [i0, i1, i2, ...]\n let triangleIndex = 0;\n let currentTriangle = indices.slice(0, 3);\n newIndices.set(currentTriangle, 0);\n\n // The rest triangle indices are being taken from strips using the following logic:\n // [i1, i2, i3, i4, i5, i6, ...] -> [i3, i2, i1, i2, i3, i4, i5, i4, i3, i4, i5, i6, ...]\n for (let i = 1; i + 2 < indices.length; i++) {\n triangleIndex += 3;\n currentTriangle = indices.slice(i, i + 3);\n if (i % 2 === 0) {\n newIndices.set(currentTriangle, triangleIndex);\n } else {\n // The following \"reverce\" is necessary to calculate normals correctly\n newIndices.set(currentTriangle.reverse(), triangleIndex);\n }\n }\n indices = newIndices;\n }\n return indices as TypedArray;\n}\n\n/**\n * Convert vertices attributes (POSITIONS or NORMALS) to i3s compatible format\n * @param args\n * @param args.vertices - gltf primitive POSITION or NORMAL attribute\n * @param args.cartographicOrigin - cartographic origin coordinates\n * @param args.cartesianModelMatrix - a cartesian model matrix to transform coordnates from cartesian to cartographic format\n * @param args.nodeMatrix - a gltf node transformation matrix - cumulative transformation matrix formed from all parent node matrices\n * @param args.indices - gltf primitive indices\n * @param args.attributeSpecificTransformation - function to do attribute - specific transformations\n * @param args.useCartesianPositions - use coordinates as it is.\n * @returns\n */\nfunction transformVertexArray(args: {\n vertices: TypedArray;\n cartographicOrigin: number[];\n cartesianModelMatrix: number[];\n nodeMatrix: Matrix4;\n indices: TypedArray;\n attributeSpecificTransformation: Function;\n useCartesianPositions: boolean;\n}): Float32Array {\n const {vertices, indices, attributeSpecificTransformation} = args;\n const newVertices = new Float32Array(indices.length * VALUES_PER_VERTEX);\n if (!vertices) {\n return newVertices;\n }\n for (let i = 0; i < indices.length; i++) {\n const coordIndex = indices[i] * VALUES_PER_VERTEX;\n const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX);\n let vertexVector = new Vector3(Array.from(vertex));\n\n vertexVector = attributeSpecificTransformation(vertexVector, args);\n\n newVertices[i * VALUES_PER_VERTEX] = vertexVector.x;\n newVertices[i * VALUES_PER_VERTEX + 1] = vertexVector.y;\n newVertices[i * VALUES_PER_VERTEX + 2] = vertexVector.z;\n }\n return newVertices;\n}\n\n/**\n * Trasform positions vector with the attribute specific transformations\n * @param vertexVector - source positions vector to transform\n * @param calleeArgs\n * @param calleeArgs.cartesianModelMatrix - a cartesian model matrix to transform coordnates from cartesian to cartographic format\n * @param calleeArgs.cartographicOrigin - cartographic origin coordinates\n * @param calleeArgs.nodeMatrix - a gltf node transformation matrix - cumulative transformation matrix formed from all parent node matrices\n * @param calleeArgs.useCartesianPositions - use coordinates as it is.\n * @returns transformed positions vector\n */\nfunction transformVertexPositions(vertexVector, calleeArgs): number[] {\n const {cartesianModelMatrix, cartographicOrigin, nodeMatrix, useCartesianPositions} = calleeArgs;\n\n if (nodeMatrix) {\n vertexVector = vertexVector.transform(nodeMatrix);\n }\n\n vertexVector = vertexVector.transform(cartesianModelMatrix);\n\n if (useCartesianPositions) {\n return vertexVector;\n }\n\n Ellipsoid.WGS84.cartesianToCartographic(\n [vertexVector[0], vertexVector[1], vertexVector[2]],\n vertexVector\n );\n vertexVector = vertexVector.subtract(cartographicOrigin);\n return vertexVector;\n}\n\n/**\n * Trasform normals vector with the attribute specific transformations\n * @param vertexVector - source normals vector to transform\n * @param calleeArgs\n * @param calleeArgs.cartesianModelMatrix - a cartesian model matrix to transform coordnates from cartesian to cartographic format\n * @param calleeArgs.nodeMatrix - a gltf node transformation matrix - cumulative transformation matrix formed from all parent node matrices\n * @returns transformed normals vector\n */\nfunction transformVertexNormals(vertexVector, calleeArgs): number[] {\n const {cartesianModelMatrix, nodeMatrix} = calleeArgs;\n\n if (nodeMatrix) {\n vertexVector = vertexVector.transformAsVector(nodeMatrix);\n }\n\n vertexVector = vertexVector.transformAsVector(cartesianModelMatrix);\n return vertexVector;\n}\n\n/**\n * Convert uv0 (texture coordinates) from coords based on indices to plain arrays, compatible with i3s\n * @param texCoords - gltf primitive TEXCOORD_0 attribute\n * @param indices - gltf primitive indices\n * @returns flattened texture coordinates\n */\nfunction flattenTexCoords(texCoords: TypedArray, indices: TypedArray): Float32Array {\n const newTexCoords = new Float32Array(indices.length * VALUES_PER_TEX_COORD);\n if (!texCoords) {\n // We need dummy UV0s because it is required in 1.6\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.6/vertexAttribute.cmn.md\n newTexCoords.fill(1);\n return newTexCoords;\n }\n for (let i = 0; i < indices.length; i++) {\n const coordIndex = indices[i] * VALUES_PER_TEX_COORD;\n const texCoord = texCoords.subarray(coordIndex, coordIndex + VALUES_PER_TEX_COORD);\n newTexCoords[i * VALUES_PER_TEX_COORD] = texCoord[0];\n newTexCoords[i * VALUES_PER_TEX_COORD + 1] = texCoord[1];\n }\n return newTexCoords;\n}\n\n/**\n * Convert color from COLOR_0 based on indices to plain arrays, compatible with i3s\n * @param colorsAttribute - gltf primitive COLOR_0 attribute\n * @param indices - gltf primitive indices\n * @returns flattened colors attribute\n */\nfunction flattenColors(\n colorsAttribute: GLTFAccessorPostprocessed,\n indices: TypedArray\n): Uint8Array {\n const components = colorsAttribute?.components || VALUES_PER_COLOR_ELEMENT;\n const newColors = new Uint8Array(indices.length * components);\n if (!colorsAttribute) {\n // Vertex color multiplies by material color so it must be normalized 1 by default\n newColors.fill(255);\n return newColors;\n }\n const colors = colorsAttribute.value;\n for (let i = 0; i < indices.length; i++) {\n const colorIndex = indices[i] * components;\n const color = colors.subarray(colorIndex, colorIndex + components);\n const colorUint8 = new Uint8Array(components);\n for (let j = 0; j < color.length; j++) {\n colorUint8[j] = color[j] * 255;\n }\n newColors.set(colorUint8, i * components);\n }\n return newColors;\n}\n\n/**\n * Create per-vertex uv-region array\n * @param materialUvRegion - uv-region fragment for a single vertex\n * @param indices - geometry indices data\n * @returns - uv-region array\n */\nfunction createUvRegion(materialUvRegion: Uint16Array, indices: TypedArray): Uint16Array {\n const result = new Uint16Array(indices.length * 4);\n for (let i = 0; i < result.length; i += 4) {\n result.set(materialUvRegion, i);\n }\n return result;\n}\n\n/**\n * Flatten batchedIds list based on indices to right ordered array, compatible with i3s\n * @param batchedIds - gltf primitive\n * @param indices - gltf primitive indices\n * @returns flattened batch ids\n */\nfunction flattenBatchIds(batchedIds: NumberArray, indices: TypedArray): number[] {\n if (!batchedIds.length || !indices.length) {\n return [];\n }\n const newBatchIds: number[] = [];\n for (let i = 0; i < indices.length; i++) {\n const coordIndex = indices[i];\n newBatchIds.push(batchedIds[coordIndex]);\n }\n return newBatchIds;\n}\n\n/**\n * Get batchIds for featureIds creation\n * @param attributes - gltf accessors\n * @param primitive - gltf primitive data\n * @param images - gltf texture images\n */\nfunction getBatchIds(\n attributes: {\n [key: string]: GLTFAccessorPostprocessed;\n },\n primitive: GLTFMeshPrimitivePostprocessed,\n images: (TextureImageProperties | null)[]\n): NumberArray {\n const batchIds: NumberArray = handleBatchIdsExtensions(attributes, primitive, images);\n\n if (batchIds.length) {\n return batchIds;\n }\n\n for (let index = 0; index < BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES.length; index++) {\n const possibleBatchIdAttributeName = BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES[index];\n if (\n attributes[possibleBatchIdAttributeName] &&\n attributes[possibleBatchIdAttributeName].value\n ) {\n return attributes[possibleBatchIdAttributeName].value;\n }\n }\n\n return [];\n}\n\n/**\n * Convert GLTF material to I3S material definitions and textures\n * @param sourceMaterials Source GLTF materials\n * @param shouldMergeMaterials - if true - the converter will try to merge similar materials\n * to be able to merge primitives having those materials\n * @returns Array of Couples I3SMaterialDefinition + texture content\n */\nasync function convertMaterials(\n sourceMaterials: GLTFMaterialPostprocessed[] = [],\n shouldMergeMaterials: boolean\n): Promise<I3SMaterialWithTexture[]> {\n let materials: I3SMaterialWithTexture[] = [];\n for (const sourceMaterial of sourceMaterials) {\n materials.push(convertMaterial(sourceMaterial));\n }\n\n if (shouldMergeMaterials) {\n materials = await mergeAllMaterials(materials);\n }\n\n return materials;\n}\n\n/**\n * Merge materials when possible\n * @param materials materials array\n * @returns merged materials array\n */\nasync function mergeAllMaterials(\n materials: I3SMaterialWithTexture[]\n): Promise<I3SMaterialWithTexture[]> {\n const result: I3SMaterialWithTexture[] = [];\n while (materials.length > 0) {\n let newMaterial = materials.splice(0, 1)[0];\n const mergedIndices: number[] = [];\n for (let i = 0; i < materials.length; i++) {\n const material = materials[i];\n if (\n (newMaterial.texture && material.texture) ||\n (!newMaterial.texture && !material.texture)\n ) {\n newMaterial = await mergeMaterials(newMaterial, material);\n mergedIndices.push(i);\n }\n }\n if (newMaterial.texture && mergedIndices.length) {\n const newWidth = newMaterial.mergedMaterials?.reduce(\n (accum, {textureSize}) => accum + (textureSize?.width || 0),\n 0\n );\n const newHeight = newMaterial.mergedMaterials?.reduce(\n (accum, {textureSize}) => Math.max(accum, textureSize?.height || 0),\n 0\n );\n let currentX = -1;\n for (const aTextureMetadata of newMaterial.mergedMaterials) {\n if (aTextureMetadata.textureSize) {\n const newX =\n currentX +\n 1 +\n (aTextureMetadata.textureSize.width / newWidth) *\n 2 ** (Uint16Array.BYTES_PER_ELEMENT * 8) -\n 1;\n aTextureMetadata.uvRegion = new Uint16Array([\n currentX + 1,\n 0,\n newX,\n (aTextureMetadata.textureSize.height / newHeight) *\n 2 ** (Uint16Array.BYTES_PER_ELEMENT * 8) -\n 1\n ]);\n currentX = newX;\n }\n }\n\n newMaterial.texture.image.width = newWidth;\n newMaterial.texture.image.height = newHeight;\n }\n for (const index of mergedIndices.reverse()) {\n materials.splice(index, 1);\n }\n result.push(newMaterial);\n }\n\n if (!result.length) {\n result.push({\n material: getDefaultMaterial(),\n mergedMaterials: [{originalMaterialId: 'default'}]\n });\n }\n return result;\n}\n\n/**\n * Merge 2 materials including texture\n * @param material1\n * @param material2\n * @returns\n */\nasync function mergeMaterials(\n material1: I3SMaterialWithTexture,\n material2: I3SMaterialWithTexture\n): Promise<I3SMaterialWithTexture> {\n if (\n material1.texture?.bufferView &&\n material2.texture?.bufferView &&\n material1.mergedMaterials &&\n material2.mergedMaterials\n ) {\n const buffer1 = Buffer.from(material1.texture.bufferView.data);\n const buffer2 = Buffer.from(material2.texture.bufferView.data);\n try {\n // @ts-ignore\n const {joinImages} = await import('join-images');\n const sharpData = await joinImages([buffer1, buffer2], {direction: 'horizontal'});\n material1.texture.bufferView.data = await sharpData\n .toFormat(material1.texture.mimeType === 'image/png' ? 'png' : 'jpeg')\n .toBuffer();\n } catch (error) {\n console.log(\n 'Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)'\n );\n throw error;\n }\n // @ts-ignore\n material1.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId = 1;\n }\n material1.mergedMaterials = material1.mergedMaterials.concat(material2.mergedMaterials);\n return material1;\n}\n\n/**\n * Convert texture and material from gltf 2.0 material object\n * @param sourceMaterial - material object\n * @returns I3S material definition and texture\n */\nfunction convertMaterial(sourceMaterial: GLTFMaterialPostprocessed): I3SMaterialWithTexture {\n const material: I3SMaterialDefinition = {\n doubleSided: sourceMaterial.doubleSided,\n emissiveFactor: sourceMaterial.emissiveFactor?.map((c) => Math.round(c * 255)) as [\n number,\n number,\n number\n ],\n // It is in upper case in GLTF: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#alpha-coverage\n // But it is in lower case in I3S: https://github.com/Esri/i3s-spec/blob/master/docs/1.7/materialDefinitions.cmn.md\n alphaMode: convertAlphaMode(sourceMaterial.alphaMode),\n pbrMetallicRoughness: {\n roughnessFactor:\n sourceMaterial?.pbrMetallicRoughness?.roughnessFactor || DEFAULT_ROUGHNESS_FACTOR,\n metallicFactor:\n sourceMaterial?.pbrMetallicRoughness?.metallicFactor || DEFAULT_METALLIC_FACTOR\n }\n };\n\n let texture;\n if (sourceMaterial?.pbrMetallicRoughness?.baseColorTexture) {\n texture = sourceMaterial.pbrMetallicRoughness.baseColorTexture.texture.source;\n material.pbrMetallicRoughness.baseColorTexture = {\n textureSetDefinitionId: 0\n };\n } else if (sourceMaterial.emissiveTexture) {\n texture = sourceMaterial.emissiveTexture.texture.source;\n // ArcGIS webscene doesn't show emissiveTexture but shows baseColorTexture\n material.pbrMetallicRoughness.baseColorTexture = {\n textureSetDefinitionId: 0\n };\n }\n\n sourceMaterial.id = Number.isFinite(sourceMaterial.id) ? sourceMaterial.id : uuidv4();\n let mergedMaterials: MergedMaterial[] = [{originalMaterialId: sourceMaterial.id}];\n if (!texture) {\n // Should use default baseColorFactor if it is not present in source material\n // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-pbrmetallicroughness\n const baseColorFactor = sourceMaterial?.pbrMetallicRoughness?.baseColorFactor;\n material.pbrMetallicRoughness.baseColorFactor =\n ((baseColorFactor && baseColorFactor.map((c) => Math.round(c * 255))) as [\n number,\n number,\n number,\n number\n ]) || undefined;\n } else {\n mergedMaterials[0].textureSize = {width: texture.image.width, height: texture.image.height};\n }\n\n return {material, texture, mergedMaterials};\n}\n\n/**\n * Converts from `alphaMode` material property from GLTF to I3S format\n * @param gltfAlphaMode Gltf material `alphaMode` property\n * @returns I3SMaterialDefinition.alphaMode property\n */\nfunction convertAlphaMode(\n gltfAlphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string\n): 'opaque' | 'mask' | 'blend' {\n switch (gltfAlphaMode) {\n case 'OPAQUE':\n return 'opaque';\n case 'MASK':\n return 'mask';\n case 'BLEND':\n return 'blend';\n default:\n return 'opaque';\n }\n}\n\n/**\n * Form default I3SMaterialDefinition\n * @returns I3S material definition\n */\nfunction getDefaultMaterial(): I3SMaterialDefinition {\n return {\n alphaMode: 'opaque',\n pbrMetallicRoughness: {\n metallicFactor: 1,\n roughnessFactor: 1\n }\n };\n}\n\n/**\n * Form \"sharedResources\" from gltf materials array\n * @param gltfMaterials - GLTF materials array\n * @param nodeId - I3S node ID\n * @returns {materialDefinitionInfos: Object[], textureDefinitionInfos: Object[]} -\n * 2 arrays in format of i3s sharedResources data https://github.com/Esri/i3s-spec/blob/master/docs/1.7/sharedResource.cmn.md\n */\nfunction getSharedResources(\n gltfMaterials: GLTFMaterialPostprocessed[],\n nodeId: number\n): SharedResourcesArrays {\n const i3sResources: SharedResourcesArrays = {};\n\n if (!gltfMaterials || !gltfMaterials.length) {\n return i3sResources;\n }\n\n i3sResources.materialDefinitionInfos = [];\n for (const gltfMaterial of gltfMaterials) {\n const {materialDefinitionInfo, textureDefinitionInfo} = convertGLTFMaterialToI3sSharedResources(\n gltfMaterial,\n nodeId\n );\n i3sResources.materialDefinitionInfos.push(materialDefinitionInfo);\n if (textureDefinitionInfo) {\n i3sResources.textureDefinitionInfos = i3sResources.textureDefinitionInfos || [];\n i3sResources.textureDefinitionInfos.push(textureDefinitionInfo);\n }\n }\n return i3sResources;\n}\n\n/**\n * Convert gltf material into I3S sharedResources data\n * @param gltfMaterial - gltf material data\n * @param nodeId - I3S node ID\n * @returns - Couple {materialDefinitionInfo, textureDefinitionInfo} extracted from gltf material data\n */\nfunction convertGLTFMaterialToI3sSharedResources(\n gltfMaterial: GLTFMaterialPostprocessed,\n nodeId: number\n): {\n materialDefinitionInfo: MaterialDefinitionInfo;\n textureDefinitionInfo: TextureDefinitionInfo | null;\n} {\n const texture =\n gltfMaterial?.pbrMetallicRoughness?.baseColorTexture || gltfMaterial.emissiveTexture;\n let textureDefinitionInfo: TextureDefinitionInfo | null = null;\n if (texture) {\n textureDefinitionInfo = extractSharedResourcesTextureInfo(texture.texture, nodeId);\n }\n const {baseColorFactor, metallicFactor} = gltfMaterial?.pbrMetallicRoughness || {};\n let colorFactor = baseColorFactor;\n // If alpha channel is 0 try to get emissive factor from gltf material.\n if ((!baseColorFactor || baseColorFactor[3] === 0) && gltfMaterial.emissiveFactor) {\n colorFactor = gltfMaterial.emissiveFactor;\n colorFactor[3] = colorFactor[3] || 1;\n }\n\n return {\n materialDefinitionInfo: extractSharedResourcesMaterialInfo(\n colorFactor || [1, 1, 1, 1],\n metallicFactor\n ),\n textureDefinitionInfo\n };\n}\n\n/**\n * Form \"materialDefinition\" which is part of \"sharedResouces\"\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materials\n * See formulas in appendix \"Appendix B: BRDF Implementation\":\n * const dielectricSpecular = rgb(0.04, 0.04, 0.04)\n * const black = rgb(0, 0, 0)\n * cdiff = lerp(baseColor.rgb * (1 - dielectricSpecular.r), black, metallic)\n * F0 = lerp(dieletricSpecular, baseColor.rgb, metallic)\n *\n * Assumption: F0 - specular in i3s (\"specular reflection\" <-> \"reflectance value at normal incidence\")\n * cdiff - diffuse in i3s (\"Diffuse color\" <-> \"'c' diffuse\" (c means color?))\n * @param baseColorFactor - RGBA color in 0..1 format\n * @param metallicFactor - \"metallicFactor\" attribute of gltf material object\n * @returns material definition info for I3S shared resource\n */\nfunction extractSharedResourcesMaterialInfo(\n baseColorFactor: number[],\n metallicFactor: number = 1\n): MaterialDefinitionInfo {\n const matDielectricColorComponent = 0.04 / 255; // Color from rgb (255) to 0..1 resolution\n // All color resolutions are 0..1\n const black = new Vector4(0, 0, 0, 1);\n const unitVector = new Vector4(1, 1, 1, 1);\n const dielectricSpecular = new Vector4(\n matDielectricColorComponent,\n matDielectricColorComponent,\n matDielectricColorComponent,\n 0\n );\n const baseColorVector = new Vector4(baseColorFactor);\n // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material\n // Formulas for Cdiff & F0\n const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);\n const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);\n dielectricSpecular[3] = 1;\n const specular = dielectricSpecular.lerp(dielectricSpecular, baseColorVector, metallicFactor);\n return {\n params: {\n // @ts-expect-error NumericArray\n diffuse: diffuse.toArray(),\n // @ts-expect-error NumericArray\n specular: specular.toArray(),\n renderMode: 'solid'\n }\n };\n}\n\n/**\n * Form \"textureDefinition\" which is part of \"sharedResouces\"\n * @param texture - texture image info\n * @param nodeId - I3S node ID\n * @returns texture definition infor for shared resource\n */\nfunction extractSharedResourcesTextureInfo(\n texture: GLTFTexturePostprocessed,\n nodeId: number\n): TextureDefinitionInfo {\n return {\n encoding: texture?.source?.mimeType ? [texture.source.mimeType] : undefined,\n images: [\n {\n // 'i3s' has just size which is width of the image. Images are supposed to be square.\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/image.cmn.md\n id: generateImageId(texture, nodeId),\n size: texture.source?.image.width,\n length: texture.source?.image.data.length ? [texture.source?.image.data.length] : undefined\n }\n ]\n };\n}\n\n/**\n * Formula for calculating imageId:\n * https://github.com/Esri/i3s-spec/blob/0a6366a9249b831db8436c322f8d27521e86cf07/format/Indexed%203d%20Scene%20Layer%20Format%20Specification.md#generating-image-ids\n * @param texture - texture image info\n * @param nodeId - I3S node ID\n * @returns calculate image ID according to the spec\n */\nfunction generateImageId(texture: GLTFTexturePostprocessed, nodeId: number) {\n const {width, height} = texture.source?.image || {};\n if (!width || !height) {\n return '';\n }\n const levelCountOfTexture = 1;\n const indexOfLevel = 0;\n const indexOfTextureInStore = nodeId + 1;\n\n const zerosCount = 32 - indexOfTextureInStore.toString(2).length;\n const rightHalf = '0'.repeat(zerosCount).concat(indexOfTextureInStore.toString(2));\n\n const shiftedLevelCountOfTexture = levelCountOfTexture << 28;\n const shiftedIndexOfLevel = indexOfLevel << 24;\n const shiftedWidth = (width - 1) << 12;\n const shiftedHeight = (height - 1) << 0;\n\n const leftHalf = shiftedLevelCountOfTexture + shiftedIndexOfLevel + shiftedWidth + shiftedHeight;\n const imageId = BigInt(`0b${leftHalf.toString(2)}${rightHalf}`);\n return imageId.toString();\n}\n\n/**\n * Make all feature ids unique through all nodes in layout.\n * @param featureIds\n * @param featureIndices\n * @param featuresHashArray\n * @param batchTable\n * @returns {void}\n */\nfunction makeFeatureIdsUnique(\n featureIds: number[],\n featureIndices: number[],\n featuresHashArray: string[],\n batchTable: {[key: string]: any}\n) {\n const replaceMap = getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray);\n replaceIndicesByUnique(featureIndices, replaceMap);\n replaceIndicesByUnique(featureIds, replaceMap);\n}\n\n/**\n * Generate replace map to make featureIds unique.\n * @param featureIds\n * @param batchTable\n * @param featuresHashArray\n * @returns\n */\nfunction getFeaturesReplaceMap(\n featureIds: any[],\n batchTable: object,\n featuresHashArray: any[]\n): Record<string, any> {\n const featureMap: Record<string, any> = {};\n\n for (let index = 0; index < featureIds.length; index++) {\n const oldFeatureId = featureIds[index];\n const uniqueFeatureId = getOrCreateUniqueFeatureId(index, batchTable, featuresHashArray);\n featureMap[oldFeatureId.toString()] = uniqueFeatureId;\n }\n\n return featureMap;\n}\n\n/**\n * Generates string for unique batch id creation.\n * @param batchTable\n * @param index\n * @returns\n */\nfunction generateStringFromBatchTableByIndex(batchTable: object, index: number): string {\n let str = '';\n for (const key in batchTable) {\n str += batchTable[key][index];\n }\n return str;\n}\n\n/**\n * Return already exited featureId or creates and returns new to support unique feature ids throw nodes.\n * @param index\n * @param batchTable\n * @param featuresHashArray\n * @returns\n */\nfunction getOrCreateUniqueFeatureId(\n index: number,\n batchTable: object,\n featuresHashArray: any[]\n): number {\n const batchTableStr = generateStringFromBatchTableByIndex(batchTable, index);\n const hash = md5(batchTableStr);\n\n if (featuresHashArray.includes(hash)) {\n return featuresHashArray.indexOf(hash);\n }\n return featuresHashArray.push(hash) - 1;\n}\n\n/**\n * Do replacement of indices for making them unique through all nodes.\n * @param indicesArray\n * @param featureMap\n * @returns\n */\nfunction replaceIndicesByUnique(indicesArray: any[], featureMap: Record<string, []>) {\n for (let index = 0; index < indicesArray.length; index++) {\n indicesArray[index] = featureMap[indicesArray[index]];\n }\n}\n\n/**\n * Convert property table data to attribute buffers.\n * @param featureIds\n * @param propertyTable - table with metadata for particular feature.\n * @param attributeStorageInfo\n * @returns - Array of file buffers.\n */\nfunction convertPropertyTableToAttributeBuffers(\n featureIds: number[],\n propertyTable: FeatureTableJson,\n attributeStorageInfo: AttributeStorageInfo[]\n): any[] {\n const attributeBuffers: ArrayBuffer[] = [];\n\n const needFlattenPropertyTable = checkPropertiesLength(featureIds, propertyTable);\n const properties = needFlattenPropertyTable\n ? flattenPropertyTableByFeatureIds(featureIds, propertyTable)\n : propertyTable;\n\n const propertyTableWithObjectIds = {\n OBJECTID: featureIds,\n ...properties\n };\n\n for (const propertyName in propertyTableWithObjectIds) {\n const type = getAttributeType(propertyName, attributeStorageInfo);\n const value = propertyTableWithObjectIds[propertyName];\n const attributeBuffer = generateAttributeBuffer(type, value);\n\n attributeBuffers.push(attributeBuffer);\n }\n\n return attributeBuffers;\n}\n\n/**\n * Generates attribute buffer based on attribute type\n * @param type\n * @param value\n */\nfunction generateAttributeBuffer(type: string, value: any): ArrayBuffer {\n let attributeBuffer: ArrayBuffer;\n\n switch (type) {\n case OBJECT_ID_TYPE:\n case SHORT_INT_TYPE:\n attributeBuffer = generateShortIntegerAttributeBuffer(value);\n break;\n case DOUBLE_TYPE:\n attributeBuffer = generateDoubleAttributeBuffer(value);\n break;\n case STRING_TYPE:\n attributeBuffer = generateStringAttributeBuffer(value);\n break;\n default:\n attributeBuffer = generateStringAttributeBuffer(value);\n }\n\n return attributeBuffer;\n}\n\n/**\n * Return attribute type.\n * @param key\n * @param attributeStorageInfo\n * @returns attribute type.\n */\nfunction getAttributeType(key: string, attributeStorageInfo: any[]): string {\n const attribute = attributeStorageInfo.find((attr) => attr.name === key);\n return attribute.attributeValues.valueType;\n}\n\n/**\n * Convert short integer to attribute arrayBuffer.\n * @param featureIds\n * @returns - Buffer with objectId data.\n */\nfunction generateShortIntegerAttributeBuffer(featureIds: any[]): ArrayBuffer {\n const count = new Uint32Array([featureIds.length]);\n const valuesArray = new Uint32Array(featureIds);\n return concatenateArrayBuffers(count.buffer, valuesArray.buffer);\n}\n\n/**\n * Convert double to attribute arrayBuffer.\n * @param featureIds\n * @returns - Buffer with objectId data.\n */\nfunction generateDoubleAttributeBuffer(featureIds: any[]): ArrayBuffer {\n const count = new Uint32Array([featureIds.length]);\n const padding = new Uint8Array(4);\n const valuesArray = new Float64Array(featureIds);\n\n return concatenateArrayBuffers(count.buffer, padding.buffer, valuesArray.buffer);\n}\n\n/**\n * Convert batch table attributes to array buffer with batch table data.\n * @param batchAttributes\n * @returns - Buffer with batch table data.\n */\nfunction generateStringAttributeBuffer(batchAttributes: any[]): ArrayBuffer {\n const stringCountArray = new Uint32Array([batchAttributes.length]);\n let totalNumberOfBytes = 0;\n const stringSizesArray = new Uint32Array(batchAttributes.length);\n const stringBufferArray: ArrayBuffer[] = [];\n\n for (let index = 0; index < batchAttributes.length; index++) {\n const currentString = `${String(batchAttributes[index])}\\0`;\n const currentStringBuffer = Buffer.from(currentString);\n const currentStringSize = currentStringBuffer.length;\n totalNumberOfBytes += currentStringSize;\n stringSizesArray[index] = currentStringSize;\n stringBufferArray.push(currentStringBuffer);\n }\n\n const totalBytes = new Uint32Array([totalNumberOfBytes]);\n\n return concatenateArrayBuffers(\n stringCountArray.buffer,\n totalBytes.buffer,\n stringSizesArray.buffer,\n ...stringBufferArray\n );\n}\n\n/**\n * Convert featureIds to BigUint64Array.\n * @param featureIds\n * @returns - Array of feature ids in BigUint64 format.\n */\nfunction generateBigUint64Array(featureIds: any[]): BigUint64Array {\n const typedFeatureIds = new BigUint64Array(featureIds.length);\n for (let index = 0; index < featureIds.length; index++) {\n typedFeatureIds[index] = BigInt(featureIds[index]);\n }\n return typedFeatureIds;\n}\n\n/**\n * Generates draco compressed geometry\n * @param {Number} vertexCount\n * @param {Object} convertedAttributes - get rid of this argument here\n * @param {Object} attributes - geometry attributes to compress\n * @param {string} dracoWorkerSoure - draco worker source code\n * @returns {Promise<object>} - COmpressed geometry.\n */\nasync function generateCompressedGeometry(\n vertexCount: number,\n convertedAttributes: Record<string, any>,\n attributes: Record<string, any>,\n dracoWorkerSoure: string\n): Promise<ArrayBuffer> {\n const {positions, normals, texCoords, colors, uvRegions, featureIds, faceRange} = attributes;\n const indices = new Uint32Array(vertexCount);\n\n for (let index = 0; index < indices.length; index++) {\n indices.set([index], index);\n }\n\n const featureIndices = new Uint32Array(\n convertedAttributes.featureIndices.length ? convertedAttributes.featureIndices : vertexCount\n );\n\n const featureIndex = generateFeatureIndexAttribute(featureIndices, faceRange);\n\n const compressedAttributes: {\n positions: TypedArray;\n normals: TypedArray;\n colors: TypedArray;\n 'feature-index': TypedArray;\n texCoords?: TypedArray;\n 'uv-region'?: TypedArray;\n } = {\n positions,\n normals,\n colors,\n 'feature-index': featureIndex\n };\n\n if (texCoords.length) {\n compressedAttributes.texCoords = texCoords;\n }\n\n const attributesMetadata = {\n 'feature-index': {\n 'i3s-attribute-type': 'feature-index',\n 'i3s-feature-ids': new Int32Array(featureIds)\n }\n };\n\n if (uvRegions.length) {\n compressedAttributes['uv-region'] = uvRegions;\n attributesMetadata['uv-region'] = {\n 'i3s-attribute-type': 'uv-region'\n };\n }\n\n return encode({attributes: compressedAttributes, indices}, DracoWriterWorker, {\n ...DracoWriterWorker.options,\n source: dracoWorkerSoure,\n reuseWorkers: true,\n _nodeWorkers: true,\n draco: {\n method: 'MESH_SEQUENTIAL_ENCODING',\n attributesMetadata\n }\n });\n}\n\n/**\n * Generates ordered feature indices based on face range\n * @param featureIndex\n * @param faceRange\n * @returns\n */\nfunction generateFeatureIndexAttribute(\n featureIndex: Uint32Array,\n faceRange: Uint32Array\n): Uint32Array {\n const orderedFeatureIndices = new Uint32Array(featureIndex.length);\n let fillIndex = 0;\n let startIndex = 0;\n\n for (let index = 1; index < faceRange.length; index += 2) {\n const endIndex = (faceRange[index] + 1) * VALUES_PER_VERTEX;\n\n orderedFeatureIndices.fill(fillIndex, startIndex, endIndex);\n\n fillIndex++;\n startIndex = endIndex + 1;\n }\n\n return orderedFeatureIndices;\n}\n\n/**\n * Find property table in tile\n * For example it can be batchTable for b3dm files or property table in gLTF extension.\n * @param tileContent - 3DTiles tile content\n * @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA\n */\nexport function getPropertyTable(tileContent: Tiles3DTileContent | null): FeatureTableJson | null {\n if (!tileContent) {\n return null;\n }\n\n const batchTableJson = tileContent?.batchTableJson;\n\n if (batchTableJson) {\n return batchTableJson;\n }\n\n const {extensionName, extension} = getPropertyTableExtension(tileContent);\n\n switch (extensionName) {\n case EXT_MESH_FEATURES: {\n console.warn('The I3S converter does not yet support the EXT_mesh_features extension');\n return null;\n }\n case EXT_FEATURE_METADATA: {\n return getPropertyTableFromExtFeatureMetadata(extension as GLTF_EXT_feature_metadata);\n }\n default:\n return null;\n }\n}\n\n/**\n * Check extensions which can be with property table inside.\n * @param tileContent - 3DTiles tile content\n */\nfunction getPropertyTableExtension(\n tileContent: Tiles3DTileContent\n): GLTF_EXT_feature_metadata | GLTF_EXT_mesh_features {\n const extensionsWithPropertyTables = [EXT_FEATURE_METADATA, EXT_MESH_FEATURES];\n const extensionsUsed = tileContent?.gltf?.extensionsUsed;\n\n if (!extensionsUsed) {\n return {extensionName: null, extension: null};\n }\n\n let extensionName: string = '';\n\n for (const extensionItem of tileContent?.gltf?.extensionsUsed || []) {\n if (extensionsWithPropertyTables.includes(extensionItem)) {\n extensionName = extensionItem;\n break;\n }\n }\n\n const extension = tileContent?.gltf?.extensions?.[extensionName];\n\n return {extensionName, extension};\n}\n\n/**\n * Handle EXT_feature_metadata to get property table\n * @param extension\n */\nfunction getPropertyTableFromExtFeatureMetadata(\n extension: GLTF_EXT_feature_metadata\n): FeatureTableJson | null {\n if (extension?.featureTables) {\n /**\n * Take only first feature table to generate attributes storage info object.\n * TODO: Think about getting data from all feature tables?\n * It can be tricky just because 3dTiles is able to have multiple featureId attributes and multiple feature tables.\n * In I3S we should decide which featureIds attribute will be passed to geometry data.\n */\n const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];\n\n if (firstFeatureTableName) {\n const featureTable = extension?.featureTables[firstFeatureTableName];\n const propertyTable = {};\n\n for (const propertyName in featureTable.properties) {\n propertyTable[propertyName] = featureTable.properties[propertyName].data;\n }\n\n return propertyTable;\n }\n }\n\n if (extension?.featureTextures) {\n /**\n * Take only first feature texture to generate attributes storage info object.\n * TODO: Think about getting data from all feature textures?\n * It can be tricky just because 3dTiles is able to have multiple featureTextures.\n * In I3S we should decide which featureTextures will be passed to geometry data.\n */\n const firstTextureName = Object.keys(extension.featureTextures)?.[0];\n if (firstTextureName) {\n const featureTable = extension?.featureTextures[firstTextureName];\n const propertyTable = {};\n\n for (const propertyName in featureTable.properties) {\n propertyTable[propertyName] = featureTable.properties[propertyName].data;\n }\n\n return propertyTable;\n }\n }\n\n console.warn(\n \"The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.\"\n );\n return null;\n}\n", "/**\n * Throws an `Error` with the optional `message` if `condition` is falsy\n * @note Replacement for the external assert method to reduce bundle size\n */\nexport function assert(condition: any, message?: string): void {\n if (!condition) {\n throw new Error(message || 'loader assertion failed.');\n }\n}\n", "import {TypedArray} from '../../types';\n\n/**\n * compare two binary arrays for equality\n * @param a\n * @param b\n * @param byteLength\n */\nexport function compareArrayBuffers(\n arrayBuffer1: ArrayBuffer,\n arrayBuffer2: ArrayBuffer,\n byteLength?: number\n): boolean {\n byteLength = byteLength || arrayBuffer1.byteLength;\n if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {\n return false;\n }\n const array1 = new Uint8Array(arrayBuffer1);\n const array2 = new Uint8Array(arrayBuffer2);\n for (let i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Concatenate a sequence of ArrayBuffers\n * @return A concatenated ArrayBuffer\n */\nexport function concatenateArrayBuffers(...sources: (ArrayBuffer | Uint8Array)[]): ArrayBuffer {\n // Make sure all inputs are wrapped in typed arrays\n const sourceArrays = sources.map((source2) =>\n source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2\n );\n\n // Get length of all inputs\n const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0);\n\n // Allocate array with space for all inputs\n const result = new Uint8Array(byteLength);\n\n // Copy the subarrays\n let offset = 0;\n for (const sourceArray of sourceArrays) {\n result.set(sourceArray, offset);\n offset += sourceArray.byteLength;\n }\n\n // We work with ArrayBuffers, discard the typed array wrapper\n return result.buffer;\n}\n\n/**\n * Concatenate arbitrary count of typed arrays\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays\n * @param - list of arrays. All arrays should be the same type\n * @return A concatenated TypedArray\n */\nexport function concatenateTypedArrays<T>(...typedArrays: T[]): T {\n // @ts-ignore\n const arrays = typedArrays as TypedArray[];\n // @ts-ignore\n const TypedArrayConstructor = (arrays && arrays.length > 1 && arrays[0].constructor) || null;\n if (!TypedArrayConstructor) {\n throw new Error(\n '\"concatenateTypedArrays\" - incorrect quantity of arguments or arguments have incompatible data types'\n );\n }\n\n const sumLength = arrays.reduce((acc, value) => acc + value.length, 0);\n // @ts-ignore typescript does not like dynamic constructors\n const result = new TypedArrayConstructor(sumLength);\n let offset = 0;\n for (const array of arrays) {\n result.set(array, offset);\n offset += array.length;\n }\n return result;\n}\n\n/**\n * Copy a view of an ArrayBuffer into new ArrayBuffer with byteOffset = 0\n * @param arrayBuffer\n * @param byteOffset\n * @param byteLength\n */\nexport function sliceArrayBuffer(\n arrayBuffer: ArrayBuffer,\n byteOffset: number,\n byteLength?: number\n): ArrayBuffer {\n const subArray =\n byteLength !== undefined\n ? new Uint8Array(arrayBuffer).subarray(byteOffset, byteOffset + byteLength)\n : new Uint8Array(arrayBuffer).subarray(byteOffset);\n const arrayCopy = new Uint8Array(subArray);\n return arrayCopy.buffer;\n}\n", "import {GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed} from '@loaders.gl/gltf';\nimport type {NumericArray} from '@loaders.gl/loader-utils';\nimport type {\n GLTF_EXT_feature_metadata_attribute,\n GLTF_EXT_feature_metadata_primitive\n} from '@loaders.gl/gltf';\nimport {TypedArray} from '@math.gl/core';\nimport {TextureImageProperties} from '../../i3s-attributes-worker';\n\nconst EXT_MESH_FEATURES = 'EXT_mesh_features';\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\n\n/**\n * Getting batchIds from 3DTilesNext extensions.\n * @param attributes - gltf accessors\n * @param primitive - gltf primitive data\n * @param images - gltf texture images\n */\nexport function handleBatchIdsExtensions(\n attributes: {\n [key: string]: GLTFAccessorPostprocessed;\n },\n primitive: GLTFMeshPrimitivePostprocessed,\n images: (TextureImageProperties | null)[]\n): NumericArray {\n const extensions = primitive?.extensions;\n\n if (!extensions) {\n return [];\n }\n\n for (const [extensionName, extensionData] of Object.entries(extensions || {})) {\n switch (extensionName) {\n case EXT_FEATURE_METADATA:\n return handleExtFeatureMetadataExtension(\n attributes,\n extensionData as GLTF_EXT_feature_metadata_primitive,\n images\n );\n case EXT_MESH_FEATURES:\n console.warn('EXT_mesh_features extension is not supported yet');\n return [];\n default:\n return [];\n }\n }\n\n return [];\n}\n\n/**\n * Get batchIds from EXT_feature_metadata extension.\n * Docs - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata\n * @param attributes\n * @param extFeatureMetadata\n * @param textures\n */\nfunction handleExtFeatureMetadataExtension(\n attributes: {\n [key: string]: GLTFAccessorPostprocessed;\n },\n extFeatureMetadata: GLTF_EXT_feature_metadata_primitive,\n images: (TextureImageProperties | null)[]\n): NumericArray {\n // Take only first extension object to get batchIds attribute name.\n const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];\n\n if (featureIdAttribute?.featureIds?.attribute) {\n const batchIdsAttribute = attributes[featureIdAttribute.featureIds.attribute];\n return batchIdsAttribute.value;\n }\n\n if (\n featureIdAttribute?.featureIds?.hasOwnProperty('constant') &&\n featureIdAttribute?.featureIds?.hasOwnProperty('divisor')\n ) {\n const featuresCount = attributes?.POSITIONS?.value.length / 3 || 0;\n return generateImplicitFeatureIds(\n featuresCount,\n featureIdAttribute.featureIds.constant,\n featureIdAttribute.featureIds.divisor\n );\n }\n\n // Take only first extension object to get batchIds attribute name.\n const featureIdTexture =\n extFeatureMetadata?.featureIdTextures && extFeatureMetadata?.featureIdTextures[0];\n\n if (featureIdTexture) {\n const textureAttributeIndex = featureIdTexture?.featureIds?.texture?.texCoord || 0;\n const textCoordAttribute = `TEXCOORD_${textureAttributeIndex}`;\n const textureCoordinates = attributes[textCoordAttribute].value;\n return generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, images);\n }\n\n // Take only first extension texture to get batchIds from the root EXT_feature_metadata object.\n const featureTexture =\n extFeatureMetadata?.featureTextures && extFeatureMetadata?.featureTextures[0];\n\n if (featureTexture) {\n const batchIdsAttribute = attributes[featureTexture];\n return batchIdsAttribute.value;\n }\n\n return [];\n}\n\n/**\n * Generates implicit feature ids\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#implicit-feature-ids\n * @param featuresCount\n * @param constant\n * @param devisor\n */\nfunction generateImplicitFeatureIds(\n featuresCount: number,\n constant: number = 0,\n divisor: number = 0\n): number[] {\n let featureIds: number[] = [];\n\n if (divisor > 0) {\n let currentValue = constant;\n let devisorCounter = divisor;\n\n for (let index = 0; index < featuresCount; index++) {\n featureIds.push(currentValue);\n\n devisorCounter -= 1;\n\n if (devisorCounter === 0) {\n currentValue++;\n devisorCounter = divisor;\n }\n }\n } else {\n featureIds = Array<number>(featuresCount).fill(constant, 0, featuresCount);\n }\n\n return featureIds;\n}\n\n/**\n * Get batchIds from texture.\n * @param primitive\n * @param featureIdTextures\n */\nfunction generateBatchIdsFromTexture(\n featureIdTexture: GLTF_EXT_feature_metadata_attribute,\n textureCoordinates: TypedArray,\n images: (TextureImageProperties | null)[]\n) {\n if (!images?.length) {\n return [];\n }\n\n const CHANNELS_MAP = {\n r: 0,\n g: 1,\n b: 2,\n a: 3\n };\n\n const textureIndex = featureIdTexture?.featureIds?.texture?.index;\n const featureChannel = featureIdTexture?.featureIds?.channels;\n\n if (!featureChannel || textureIndex === undefined) {\n return [];\n }\n\n const image = images[textureIndex];\n const batchIds: number[] = [];\n const channels = CHANNELS_MAP[featureChannel];\n\n if (image && image?.width && image?.height && image?.components) {\n for (let index = 0; index < textureCoordinates.length; index += 2) {\n const u = textureCoordinates[index];\n const v = textureCoordinates[index + 1];\n\n const tx = Math.min((emod(u) * image.width) | 0, image.width - 1);\n const ty = Math.min((emod(v) * image.height) | 0, image.height - 1);\n\n const offset = (ty * image.width + tx) * image.components + channels;\n const batchId = new Uint8Array(image.data)[offset];\n\n batchIds.push(batchId);\n }\n } else {\n console.warn(`Can't get batch Ids from ${image?.mimeType || ''} compressed texture`);\n }\n\n return batchIds;\n}\n\n/**\n * Handle UVs if they are out of range [0,1].\n * @param n\n * @param m\n */\nfunction emod(n: number): number {\n return ((n % 1) + 1) % 1;\n}\n", "// Subset of WebGL constants\n\nexport const GL_PRIMITIVE = {\n POINTS: 0x0000, // Points. single points.\n LINES: 0x0001, // Lines. Each vertex connects to the one after it.\n TRIANGLES: 0x0004 // Triangles. Each set of three vertices creates a separate triangle.\n};\n\n// Primitive modes\nexport const GL_PRIMITIVE_MODE = {\n POINTS: 0x0000, // Points. single points.\n LINES: 0x0001, // Lines. Each vertex connects to the one after it.\n LINE_LOOP: 0x0002, // Lines. Each set of two vertices is treated as a separate line segment.\n LINE_STRIP: 0x0003, // Lines/ a connected group of line segments from the first vertex to the last\n TRIANGLES: 0x0004, // Triangles. Each set of three vertices creates a separate triangle.\n TRIANGLE_STRIP: 0x0005, // Triangles. A connected group of triangles.\n TRIANGLE_FAN: 0x0006 // Triangles. A connected group of triangles.\n // Each vertex connects to the previous and the first vertex in the fan.\n};\n\ntype glType = {\n BYTE: number;\n UNSIGNED_BYTE: number;\n SHORT: number;\n UNSIGNED_SHORT: number;\n INT: number;\n UNSIGNED_INT: number;\n FLOAT: number;\n DOUBLE: number;\n};\n\nexport const GL_TYPE: glType = {\n BYTE: 5120,\n UNSIGNED_BYTE: 5121,\n SHORT: 5122,\n UNSIGNED_SHORT: 5123,\n INT: 5124,\n UNSIGNED_INT: 5125,\n FLOAT: 5126,\n DOUBLE: 5130\n};\n\nexport const GL = {\n ...GL_PRIMITIVE_MODE,\n ...GL_TYPE\n};\n", "/**\n * luma.gl can not work without indices now:\n * https://github.com/visgl/luma.gl/blob/d8cad75b9f8ca3e578cf078ed9d19e619c2ddbc9/modules/experimental/src/gltf/gltf-instantiator.js#L115\n * This method generates syntetic indices array: [0, 1, 2, 3, .... , vertexCount-1]\n * @param {number} vertexCount - vertex count in the geometry\n * @returns {Uint32Array} indices array.\n */\nexport const generateSyntheticIndices = (vertexCount: number): Uint32Array => {\n const result = new Uint32Array(vertexCount);\n for (let index = 0; index < vertexCount; index++) {\n result[index] = index;\n }\n return result;\n};\n", "import {createWorker} from '@loaders.gl/worker-utils';\nimport {convertAttributes} from '../i3s-converter/helpers/geometry-converter';\n\ncreateWorker(\n async (data, options = {}) =>\n await convertAttributes(data, options.materialAndTextureList, options.useCartesianPositions)\n);\n"],
5
- "mappings": "+3BAAA,8BAAgC,EAAK,CACnC,MAAO,IAAO,EAAI,WAAa,EAAM,CACnC,QAAW,GAGf,GAAO,QAAU,GAAwB,GAAO,QAAQ,WAAa,GAAM,GAAO,QAAQ,QAAa,GAAO,UCL9G,8BAAiB,EAAK,CAGpB,MAAQ,IAAO,QAAU,GAAU,AAAc,MAAO,SAArB,YAA+B,AAAY,MAAO,QAAO,UAA1B,SAAqC,SAAU,EAAK,CACpH,MAAO,OAAO,IACZ,SAAU,EAAK,CACjB,MAAO,IAAO,AAAc,MAAO,SAArB,YAA+B,EAAI,cAAgB,QAAU,IAAQ,OAAO,UAAY,SAAW,MAAO,IACvH,GAAO,QAAQ,WAAa,GAAM,GAAO,QAAQ,QAAa,GAAO,QAAU,GAAQ,GAE5F,GAAO,QAAU,GAAS,GAAO,QAAQ,WAAa,GAAM,GAAO,QAAQ,QAAa,GAAO,UCT/F,8BAAyB,EAAU,EAAa,CAC9C,GAAI,CAAE,aAAoB,IACxB,KA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