gm-builds 4.3.0

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 (319) hide show
  1. package/README.md +59 -0
  2. package/dist/gm.min.css +1 -0
  3. package/dist/gm.min.js +16269 -0
  4. package/dist/gm.module.js +32 -0
  5. package/dist/index.js +16267 -0
  6. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  7. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  8. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  9. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  10. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  11. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  12. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  13. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  14. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  15. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  16. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  17. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  18. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  19. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  20. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  21. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  22. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  23. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  24. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  25. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  26. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  27. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  28. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  29. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  30. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  31. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  32. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  33. package/dist/resources/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  34. package/dist/resources/Assets/Images/bing_maps_credit.png +0 -0
  35. package/dist/resources/Assets/Images/cesium_credit.png +0 -0
  36. package/dist/resources/Assets/Images/google_earth_credit.png +0 -0
  37. package/dist/resources/Assets/Images/ion-credit.png +0 -0
  38. package/dist/resources/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  39. package/dist/resources/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  40. package/dist/resources/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  41. package/dist/resources/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  42. package/dist/resources/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  43. package/dist/resources/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  44. package/dist/resources/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  45. package/dist/resources/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  46. package/dist/resources/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  47. package/dist/resources/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  48. package/dist/resources/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  49. package/dist/resources/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  50. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  51. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  52. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  53. package/dist/resources/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  54. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  55. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  56. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  57. package/dist/resources/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  58. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  59. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  60. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  61. package/dist/resources/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  62. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  63. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  64. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  65. package/dist/resources/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  66. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  67. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  68. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  69. package/dist/resources/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  70. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  71. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  72. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  73. package/dist/resources/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  74. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  75. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  76. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  77. package/dist/resources/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  78. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  79. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  80. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  81. package/dist/resources/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  82. package/dist/resources/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  83. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  84. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  85. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  86. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  87. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  88. package/dist/resources/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  89. package/dist/resources/Assets/Textures/maki/airfield.png +0 -0
  90. package/dist/resources/Assets/Textures/maki/airport.png +0 -0
  91. package/dist/resources/Assets/Textures/maki/alcohol-shop.png +0 -0
  92. package/dist/resources/Assets/Textures/maki/america-football.png +0 -0
  93. package/dist/resources/Assets/Textures/maki/art-gallery.png +0 -0
  94. package/dist/resources/Assets/Textures/maki/bakery.png +0 -0
  95. package/dist/resources/Assets/Textures/maki/bank.png +0 -0
  96. package/dist/resources/Assets/Textures/maki/bar.png +0 -0
  97. package/dist/resources/Assets/Textures/maki/baseball.png +0 -0
  98. package/dist/resources/Assets/Textures/maki/basketball.png +0 -0
  99. package/dist/resources/Assets/Textures/maki/beer.png +0 -0
  100. package/dist/resources/Assets/Textures/maki/bicycle.png +0 -0
  101. package/dist/resources/Assets/Textures/maki/building.png +0 -0
  102. package/dist/resources/Assets/Textures/maki/bus.png +0 -0
  103. package/dist/resources/Assets/Textures/maki/cafe.png +0 -0
  104. package/dist/resources/Assets/Textures/maki/camera.png +0 -0
  105. package/dist/resources/Assets/Textures/maki/campsite.png +0 -0
  106. package/dist/resources/Assets/Textures/maki/car.png +0 -0
  107. package/dist/resources/Assets/Textures/maki/cemetery.png +0 -0
  108. package/dist/resources/Assets/Textures/maki/cesium.png +0 -0
  109. package/dist/resources/Assets/Textures/maki/chemist.png +0 -0
  110. package/dist/resources/Assets/Textures/maki/cinema.png +0 -0
  111. package/dist/resources/Assets/Textures/maki/circle-stroked.png +0 -0
  112. package/dist/resources/Assets/Textures/maki/circle.png +0 -0
  113. package/dist/resources/Assets/Textures/maki/city.png +0 -0
  114. package/dist/resources/Assets/Textures/maki/clothing-store.png +0 -0
  115. package/dist/resources/Assets/Textures/maki/college.png +0 -0
  116. package/dist/resources/Assets/Textures/maki/commercial.png +0 -0
  117. package/dist/resources/Assets/Textures/maki/cricket.png +0 -0
  118. package/dist/resources/Assets/Textures/maki/cross.png +0 -0
  119. package/dist/resources/Assets/Textures/maki/dam.png +0 -0
  120. package/dist/resources/Assets/Textures/maki/danger.png +0 -0
  121. package/dist/resources/Assets/Textures/maki/disability.png +0 -0
  122. package/dist/resources/Assets/Textures/maki/dog-park.png +0 -0
  123. package/dist/resources/Assets/Textures/maki/embassy.png +0 -0
  124. package/dist/resources/Assets/Textures/maki/emergency-telephone.png +0 -0
  125. package/dist/resources/Assets/Textures/maki/entrance.png +0 -0
  126. package/dist/resources/Assets/Textures/maki/farm.png +0 -0
  127. package/dist/resources/Assets/Textures/maki/fast-food.png +0 -0
  128. package/dist/resources/Assets/Textures/maki/ferry.png +0 -0
  129. package/dist/resources/Assets/Textures/maki/fire-station.png +0 -0
  130. package/dist/resources/Assets/Textures/maki/fuel.png +0 -0
  131. package/dist/resources/Assets/Textures/maki/garden.png +0 -0
  132. package/dist/resources/Assets/Textures/maki/gift.png +0 -0
  133. package/dist/resources/Assets/Textures/maki/golf.png +0 -0
  134. package/dist/resources/Assets/Textures/maki/grocery.png +0 -0
  135. package/dist/resources/Assets/Textures/maki/hairdresser.png +0 -0
  136. package/dist/resources/Assets/Textures/maki/harbor.png +0 -0
  137. package/dist/resources/Assets/Textures/maki/heart.png +0 -0
  138. package/dist/resources/Assets/Textures/maki/heliport.png +0 -0
  139. package/dist/resources/Assets/Textures/maki/hospital.png +0 -0
  140. package/dist/resources/Assets/Textures/maki/ice-cream.png +0 -0
  141. package/dist/resources/Assets/Textures/maki/industrial.png +0 -0
  142. package/dist/resources/Assets/Textures/maki/land-use.png +0 -0
  143. package/dist/resources/Assets/Textures/maki/laundry.png +0 -0
  144. package/dist/resources/Assets/Textures/maki/library.png +0 -0
  145. package/dist/resources/Assets/Textures/maki/lighthouse.png +0 -0
  146. package/dist/resources/Assets/Textures/maki/lodging.png +0 -0
  147. package/dist/resources/Assets/Textures/maki/logging.png +0 -0
  148. package/dist/resources/Assets/Textures/maki/london-underground.png +0 -0
  149. package/dist/resources/Assets/Textures/maki/marker-stroked.png +0 -0
  150. package/dist/resources/Assets/Textures/maki/marker.png +0 -0
  151. package/dist/resources/Assets/Textures/maki/minefield.png +0 -0
  152. package/dist/resources/Assets/Textures/maki/mobilephone.png +0 -0
  153. package/dist/resources/Assets/Textures/maki/monument.png +0 -0
  154. package/dist/resources/Assets/Textures/maki/museum.png +0 -0
  155. package/dist/resources/Assets/Textures/maki/music.png +0 -0
  156. package/dist/resources/Assets/Textures/maki/oil-well.png +0 -0
  157. package/dist/resources/Assets/Textures/maki/park.png +0 -0
  158. package/dist/resources/Assets/Textures/maki/park2.png +0 -0
  159. package/dist/resources/Assets/Textures/maki/parking-garage.png +0 -0
  160. package/dist/resources/Assets/Textures/maki/parking.png +0 -0
  161. package/dist/resources/Assets/Textures/maki/pharmacy.png +0 -0
  162. package/dist/resources/Assets/Textures/maki/pitch.png +0 -0
  163. package/dist/resources/Assets/Textures/maki/place-of-worship.png +0 -0
  164. package/dist/resources/Assets/Textures/maki/playground.png +0 -0
  165. package/dist/resources/Assets/Textures/maki/police.png +0 -0
  166. package/dist/resources/Assets/Textures/maki/polling-place.png +0 -0
  167. package/dist/resources/Assets/Textures/maki/post.png +0 -0
  168. package/dist/resources/Assets/Textures/maki/prison.png +0 -0
  169. package/dist/resources/Assets/Textures/maki/rail-above.png +0 -0
  170. package/dist/resources/Assets/Textures/maki/rail-light.png +0 -0
  171. package/dist/resources/Assets/Textures/maki/rail-metro.png +0 -0
  172. package/dist/resources/Assets/Textures/maki/rail-underground.png +0 -0
  173. package/dist/resources/Assets/Textures/maki/rail.png +0 -0
  174. package/dist/resources/Assets/Textures/maki/religious-christian.png +0 -0
  175. package/dist/resources/Assets/Textures/maki/religious-jewish.png +0 -0
  176. package/dist/resources/Assets/Textures/maki/religious-muslim.png +0 -0
  177. package/dist/resources/Assets/Textures/maki/restaurant.png +0 -0
  178. package/dist/resources/Assets/Textures/maki/roadblock.png +0 -0
  179. package/dist/resources/Assets/Textures/maki/rocket.png +0 -0
  180. package/dist/resources/Assets/Textures/maki/school.png +0 -0
  181. package/dist/resources/Assets/Textures/maki/scooter.png +0 -0
  182. package/dist/resources/Assets/Textures/maki/shop.png +0 -0
  183. package/dist/resources/Assets/Textures/maki/skiing.png +0 -0
  184. package/dist/resources/Assets/Textures/maki/slaughterhouse.png +0 -0
  185. package/dist/resources/Assets/Textures/maki/soccer.png +0 -0
  186. package/dist/resources/Assets/Textures/maki/square-stroked.png +0 -0
  187. package/dist/resources/Assets/Textures/maki/square.png +0 -0
  188. package/dist/resources/Assets/Textures/maki/star-stroked.png +0 -0
  189. package/dist/resources/Assets/Textures/maki/star.png +0 -0
  190. package/dist/resources/Assets/Textures/maki/suitcase.png +0 -0
  191. package/dist/resources/Assets/Textures/maki/swimming.png +0 -0
  192. package/dist/resources/Assets/Textures/maki/telephone.png +0 -0
  193. package/dist/resources/Assets/Textures/maki/tennis.png +0 -0
  194. package/dist/resources/Assets/Textures/maki/theatre.png +0 -0
  195. package/dist/resources/Assets/Textures/maki/toilets.png +0 -0
  196. package/dist/resources/Assets/Textures/maki/town-hall.png +0 -0
  197. package/dist/resources/Assets/Textures/maki/town.png +0 -0
  198. package/dist/resources/Assets/Textures/maki/triangle-stroked.png +0 -0
  199. package/dist/resources/Assets/Textures/maki/triangle.png +0 -0
  200. package/dist/resources/Assets/Textures/maki/village.png +0 -0
  201. package/dist/resources/Assets/Textures/maki/warehouse.png +0 -0
  202. package/dist/resources/Assets/Textures/maki/waste-basket.png +0 -0
  203. package/dist/resources/Assets/Textures/maki/water.png +0 -0
  204. package/dist/resources/Assets/Textures/maki/wetland.png +0 -0
  205. package/dist/resources/Assets/Textures/maki/zoo.png +0 -0
  206. package/dist/resources/Assets/Textures/moonSmall.jpg +0 -0
  207. package/dist/resources/Assets/Textures/pin.svg +1 -0
  208. package/dist/resources/Assets/Textures/waterNormals.jpg +0 -0
  209. package/dist/resources/Assets/Textures/waterNormalsSmall.jpg +0 -0
  210. package/dist/resources/Assets/approximateTerrainHeights.json +1 -0
  211. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +21 -0
  212. package/dist/resources/ThirdParty/Workers/package.json +1 -0
  213. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +2 -0
  214. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +2 -0
  215. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -0
  216. package/dist/resources/ThirdParty/basis_transcoder.wasm +0 -0
  217. package/dist/resources/ThirdParty/draco_decoder.wasm +0 -0
  218. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  219. package/dist/resources/Workers/chunk-3JBEPBPL.js +390 -0
  220. package/dist/resources/Workers/chunk-3LYROPON.js +781 -0
  221. package/dist/resources/Workers/chunk-3PIZQT3I.js +305 -0
  222. package/dist/resources/Workers/chunk-3QLSKXKF.js +456 -0
  223. package/dist/resources/Workers/chunk-4CHMVQTQ.js +138 -0
  224. package/dist/resources/Workers/chunk-5KWRW7YL.js +58 -0
  225. package/dist/resources/Workers/chunk-5S5OOA6U.js +37 -0
  226. package/dist/resources/Workers/chunk-77XPS7ZA.js +758 -0
  227. package/dist/resources/Workers/chunk-7EO56M5R.js +1800 -0
  228. package/dist/resources/Workers/chunk-7UHKH6M3.js +634 -0
  229. package/dist/resources/Workers/chunk-7ZB2RVIQ.js +834 -0
  230. package/dist/resources/Workers/chunk-B4GSRXE3.js +157 -0
  231. package/dist/resources/Workers/chunk-CI2HEJFC.js +1481 -0
  232. package/dist/resources/Workers/chunk-D7ZBZPHV.js +139 -0
  233. package/dist/resources/Workers/chunk-DT5NFR5C.js +239 -0
  234. package/dist/resources/Workers/chunk-ED6GLQTK.js +629 -0
  235. package/dist/resources/Workers/chunk-EWDGNOJE.js +1258 -0
  236. package/dist/resources/Workers/chunk-F4CUH4MR.js +500 -0
  237. package/dist/resources/Workers/chunk-FFBJDW4A.js +196 -0
  238. package/dist/resources/Workers/chunk-FX4R4MTH.js +115 -0
  239. package/dist/resources/Workers/chunk-FYGLNDKG.js +963 -0
  240. package/dist/resources/Workers/chunk-G3BVMPWG.js +101 -0
  241. package/dist/resources/Workers/chunk-HEZHXDYB.js +55 -0
  242. package/dist/resources/Workers/chunk-HKHQ3EDR.js +102 -0
  243. package/dist/resources/Workers/chunk-HUFQVUMY.js +300 -0
  244. package/dist/resources/Workers/chunk-J7IH4EYI.js +220 -0
  245. package/dist/resources/Workers/chunk-JHBPC4LK.js +435 -0
  246. package/dist/resources/Workers/chunk-JPDKYBLF.js +511 -0
  247. package/dist/resources/Workers/chunk-K4AH3TDT.js +959 -0
  248. package/dist/resources/Workers/chunk-KHWLAQVA.js +75 -0
  249. package/dist/resources/Workers/chunk-KM6MITPF.js +2857 -0
  250. package/dist/resources/Workers/chunk-KSYBJA4M.js +262 -0
  251. package/dist/resources/Workers/chunk-LJBJM6VI.js +171 -0
  252. package/dist/resources/Workers/chunk-LNSWJ43X.js +421 -0
  253. package/dist/resources/Workers/chunk-LOZ4NKY3.js +684 -0
  254. package/dist/resources/Workers/chunk-LS3KVHYY.js +353 -0
  255. package/dist/resources/Workers/chunk-MVM4JV5U.js +691 -0
  256. package/dist/resources/Workers/chunk-N2XAJBC6.js +368 -0
  257. package/dist/resources/Workers/chunk-OMXHEJTK.js +163 -0
  258. package/dist/resources/Workers/chunk-PWF4EY5P.js +122 -0
  259. package/dist/resources/Workers/chunk-Q4ZVWJXX.js +59 -0
  260. package/dist/resources/Workers/chunk-SDIDRZDG.js +476 -0
  261. package/dist/resources/Workers/chunk-TVL3F7IU.js +39 -0
  262. package/dist/resources/Workers/chunk-TY4DKOWR.js +44 -0
  263. package/dist/resources/Workers/chunk-VCNOFQYH.js +287 -0
  264. package/dist/resources/Workers/chunk-WEHZP4SE.js +10357 -0
  265. package/dist/resources/Workers/chunk-WVNLSTOF.js +73 -0
  266. package/dist/resources/Workers/chunk-XK4OP6VA.js +1073 -0
  267. package/dist/resources/Workers/chunk-YJX7X577.js +2717 -0
  268. package/dist/resources/Workers/chunk-Z3QWTHI7.js +398 -0
  269. package/dist/resources/Workers/chunk-ZGFIT57T.js +1048 -0
  270. package/dist/resources/Workers/chunk-ZMNLEL6W.js +100 -0
  271. package/dist/resources/Workers/combineGeometry.js +64 -0
  272. package/dist/resources/Workers/createBoxGeometry.js +56 -0
  273. package/dist/resources/Workers/createBoxOutlineGeometry.js +233 -0
  274. package/dist/resources/Workers/createCircleGeometry.js +199 -0
  275. package/dist/resources/Workers/createCircleOutlineGeometry.js +145 -0
  276. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +505 -0
  277. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +223 -0
  278. package/dist/resources/Workers/createCorridorGeometry.js +1261 -0
  279. package/dist/resources/Workers/createCorridorOutlineGeometry.js +566 -0
  280. package/dist/resources/Workers/createCylinderGeometry.js +58 -0
  281. package/dist/resources/Workers/createCylinderOutlineGeometry.js +229 -0
  282. package/dist/resources/Workers/createEllipseGeometry.js +69 -0
  283. package/dist/resources/Workers/createEllipseOutlineGeometry.js +62 -0
  284. package/dist/resources/Workers/createEllipsoidGeometry.js +57 -0
  285. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +59 -0
  286. package/dist/resources/Workers/createFrustumGeometry.js +56 -0
  287. package/dist/resources/Workers/createFrustumOutlineGeometry.js +234 -0
  288. package/dist/resources/Workers/createGeometry.js +168 -0
  289. package/dist/resources/Workers/createGroundPolylineGeometry.js +1606 -0
  290. package/dist/resources/Workers/createPlaneGeometry.js +222 -0
  291. package/dist/resources/Workers/createPlaneOutlineGeometry.js +122 -0
  292. package/dist/resources/Workers/createPolygonGeometry.js +1405 -0
  293. package/dist/resources/Workers/createPolygonOutlineGeometry.js +533 -0
  294. package/dist/resources/Workers/createPolylineGeometry.js +494 -0
  295. package/dist/resources/Workers/createPolylineVolumeGeometry.js +377 -0
  296. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +275 -0
  297. package/dist/resources/Workers/createRectangleGeometry.js +1270 -0
  298. package/dist/resources/Workers/createRectangleOutlineGeometry.js +477 -0
  299. package/dist/resources/Workers/createSimplePolylineGeometry.js +398 -0
  300. package/dist/resources/Workers/createSphereGeometry.js +116 -0
  301. package/dist/resources/Workers/createSphereOutlineGeometry.js +116 -0
  302. package/dist/resources/Workers/createTaskProcessorWorker.js +32 -0
  303. package/dist/resources/Workers/createVectorTileClampedPolylines.js +490 -0
  304. package/dist/resources/Workers/createVectorTileGeometries.js +385 -0
  305. package/dist/resources/Workers/createVectorTilePoints.js +112 -0
  306. package/dist/resources/Workers/createVectorTilePolygons.js +383 -0
  307. package/dist/resources/Workers/createVectorTilePolylines.js +260 -0
  308. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +563 -0
  309. package/dist/resources/Workers/createVerticesFromHeightmap.js +2276 -0
  310. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +753 -0
  311. package/dist/resources/Workers/createWallGeometry.js +488 -0
  312. package/dist/resources/Workers/createWallOutlineGeometry.js +336 -0
  313. package/dist/resources/Workers/decodeDraco.js +370 -0
  314. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2666 -0
  315. package/dist/resources/Workers/decodeI3S.js +1343 -0
  316. package/dist/resources/Workers/transcodeKTX2.js +3387 -0
  317. package/dist/resources/Workers/transferTypedArrayTest.js +41 -0
  318. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +817 -0
  319. package/package.json +22 -0
@@ -0,0 +1,817 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.126
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ EllipsoidalOccluder_default,
28
+ TerrainEncoding_default
29
+ } from "./chunk-77XPS7ZA.js";
30
+ import {
31
+ createTaskProcessorWorker_default
32
+ } from "./chunk-G3BVMPWG.js";
33
+ import {
34
+ OrientedBoundingBox_default
35
+ } from "./chunk-7ZB2RVIQ.js";
36
+ import {
37
+ AttributeCompression_default
38
+ } from "./chunk-JHBPC4LK.js";
39
+ import "./chunk-VCNOFQYH.js";
40
+ import "./chunk-B4GSRXE3.js";
41
+ import "./chunk-EWDGNOJE.js";
42
+ import "./chunk-LJBJM6VI.js";
43
+ import {
44
+ IndexDatatype_default
45
+ } from "./chunk-D7ZBZPHV.js";
46
+ import {
47
+ BoundingSphere_default
48
+ } from "./chunk-FYGLNDKG.js";
49
+ import {
50
+ Rectangle_default
51
+ } from "./chunk-WEHZP4SE.js";
52
+ import "./chunk-KSYBJA4M.js";
53
+ import {
54
+ Cartesian2_default,
55
+ Cartesian3_default,
56
+ Cartographic_default,
57
+ Ellipsoid_default
58
+ } from "./chunk-KM6MITPF.js";
59
+ import {
60
+ Math_default
61
+ } from "./chunk-F4CUH4MR.js";
62
+ import "./chunk-ED6GLQTK.js";
63
+ import "./chunk-5KWRW7YL.js";
64
+ import "./chunk-TVL3F7IU.js";
65
+ import {
66
+ Check_default,
67
+ DeveloperError_default
68
+ } from "./chunk-OMXHEJTK.js";
69
+ import {
70
+ defined_default
71
+ } from "./chunk-KHWLAQVA.js";
72
+
73
+ // packages/engine/Source/Core/Intersections2D.js
74
+ var Intersections2D = {};
75
+ Intersections2D.clipTriangleAtAxisAlignedThreshold = function(threshold, keepAbove, u0, u1, u2, result) {
76
+ if (!defined_default(threshold)) {
77
+ throw new DeveloperError_default("threshold is required.");
78
+ }
79
+ if (!defined_default(keepAbove)) {
80
+ throw new DeveloperError_default("keepAbove is required.");
81
+ }
82
+ if (!defined_default(u0)) {
83
+ throw new DeveloperError_default("u0 is required.");
84
+ }
85
+ if (!defined_default(u1)) {
86
+ throw new DeveloperError_default("u1 is required.");
87
+ }
88
+ if (!defined_default(u2)) {
89
+ throw new DeveloperError_default("u2 is required.");
90
+ }
91
+ if (!defined_default(result)) {
92
+ result = [];
93
+ } else {
94
+ result.length = 0;
95
+ }
96
+ let u0Behind;
97
+ let u1Behind;
98
+ let u2Behind;
99
+ if (keepAbove) {
100
+ u0Behind = u0 < threshold;
101
+ u1Behind = u1 < threshold;
102
+ u2Behind = u2 < threshold;
103
+ } else {
104
+ u0Behind = u0 > threshold;
105
+ u1Behind = u1 > threshold;
106
+ u2Behind = u2 > threshold;
107
+ }
108
+ const numBehind = u0Behind + u1Behind + u2Behind;
109
+ let u01Ratio;
110
+ let u02Ratio;
111
+ let u12Ratio;
112
+ let u10Ratio;
113
+ let u20Ratio;
114
+ let u21Ratio;
115
+ if (numBehind === 1) {
116
+ if (u0Behind) {
117
+ u01Ratio = (threshold - u0) / (u1 - u0);
118
+ u02Ratio = (threshold - u0) / (u2 - u0);
119
+ result.push(1);
120
+ result.push(2);
121
+ if (u02Ratio !== 1) {
122
+ result.push(-1);
123
+ result.push(0);
124
+ result.push(2);
125
+ result.push(u02Ratio);
126
+ }
127
+ if (u01Ratio !== 1) {
128
+ result.push(-1);
129
+ result.push(0);
130
+ result.push(1);
131
+ result.push(u01Ratio);
132
+ }
133
+ } else if (u1Behind) {
134
+ u12Ratio = (threshold - u1) / (u2 - u1);
135
+ u10Ratio = (threshold - u1) / (u0 - u1);
136
+ result.push(2);
137
+ result.push(0);
138
+ if (u10Ratio !== 1) {
139
+ result.push(-1);
140
+ result.push(1);
141
+ result.push(0);
142
+ result.push(u10Ratio);
143
+ }
144
+ if (u12Ratio !== 1) {
145
+ result.push(-1);
146
+ result.push(1);
147
+ result.push(2);
148
+ result.push(u12Ratio);
149
+ }
150
+ } else if (u2Behind) {
151
+ u20Ratio = (threshold - u2) / (u0 - u2);
152
+ u21Ratio = (threshold - u2) / (u1 - u2);
153
+ result.push(0);
154
+ result.push(1);
155
+ if (u21Ratio !== 1) {
156
+ result.push(-1);
157
+ result.push(2);
158
+ result.push(1);
159
+ result.push(u21Ratio);
160
+ }
161
+ if (u20Ratio !== 1) {
162
+ result.push(-1);
163
+ result.push(2);
164
+ result.push(0);
165
+ result.push(u20Ratio);
166
+ }
167
+ }
168
+ } else if (numBehind === 2) {
169
+ if (!u0Behind && u0 !== threshold) {
170
+ u10Ratio = (threshold - u1) / (u0 - u1);
171
+ u20Ratio = (threshold - u2) / (u0 - u2);
172
+ result.push(0);
173
+ result.push(-1);
174
+ result.push(1);
175
+ result.push(0);
176
+ result.push(u10Ratio);
177
+ result.push(-1);
178
+ result.push(2);
179
+ result.push(0);
180
+ result.push(u20Ratio);
181
+ } else if (!u1Behind && u1 !== threshold) {
182
+ u21Ratio = (threshold - u2) / (u1 - u2);
183
+ u01Ratio = (threshold - u0) / (u1 - u0);
184
+ result.push(1);
185
+ result.push(-1);
186
+ result.push(2);
187
+ result.push(1);
188
+ result.push(u21Ratio);
189
+ result.push(-1);
190
+ result.push(0);
191
+ result.push(1);
192
+ result.push(u01Ratio);
193
+ } else if (!u2Behind && u2 !== threshold) {
194
+ u02Ratio = (threshold - u0) / (u2 - u0);
195
+ u12Ratio = (threshold - u1) / (u2 - u1);
196
+ result.push(2);
197
+ result.push(-1);
198
+ result.push(0);
199
+ result.push(2);
200
+ result.push(u02Ratio);
201
+ result.push(-1);
202
+ result.push(1);
203
+ result.push(2);
204
+ result.push(u12Ratio);
205
+ }
206
+ } else if (numBehind !== 3) {
207
+ result.push(0);
208
+ result.push(1);
209
+ result.push(2);
210
+ }
211
+ return result;
212
+ };
213
+ Intersections2D.computeBarycentricCoordinates = function(x, y, x1, y1, x2, y2, x3, y3, result) {
214
+ if (!defined_default(x)) {
215
+ throw new DeveloperError_default("x is required.");
216
+ }
217
+ if (!defined_default(y)) {
218
+ throw new DeveloperError_default("y is required.");
219
+ }
220
+ if (!defined_default(x1)) {
221
+ throw new DeveloperError_default("x1 is required.");
222
+ }
223
+ if (!defined_default(y1)) {
224
+ throw new DeveloperError_default("y1 is required.");
225
+ }
226
+ if (!defined_default(x2)) {
227
+ throw new DeveloperError_default("x2 is required.");
228
+ }
229
+ if (!defined_default(y2)) {
230
+ throw new DeveloperError_default("y2 is required.");
231
+ }
232
+ if (!defined_default(x3)) {
233
+ throw new DeveloperError_default("x3 is required.");
234
+ }
235
+ if (!defined_default(y3)) {
236
+ throw new DeveloperError_default("y3 is required.");
237
+ }
238
+ const x1mx3 = x1 - x3;
239
+ const x3mx2 = x3 - x2;
240
+ const y2my3 = y2 - y3;
241
+ const y1my3 = y1 - y3;
242
+ const inverseDeterminant = 1 / (y2my3 * x1mx3 + x3mx2 * y1my3);
243
+ const ymy3 = y - y3;
244
+ const xmx3 = x - x3;
245
+ const l1 = (y2my3 * xmx3 + x3mx2 * ymy3) * inverseDeterminant;
246
+ const l2 = (-y1my3 * xmx3 + x1mx3 * ymy3) * inverseDeterminant;
247
+ const l3 = 1 - l1 - l2;
248
+ if (defined_default(result)) {
249
+ result.x = l1;
250
+ result.y = l2;
251
+ result.z = l3;
252
+ return result;
253
+ }
254
+ return new Cartesian3_default(l1, l2, l3);
255
+ };
256
+ Intersections2D.computeLineSegmentLineSegmentIntersection = function(x00, y00, x01, y01, x10, y10, x11, y11, result) {
257
+ Check_default.typeOf.number("x00", x00);
258
+ Check_default.typeOf.number("y00", y00);
259
+ Check_default.typeOf.number("x01", x01);
260
+ Check_default.typeOf.number("y01", y01);
261
+ Check_default.typeOf.number("x10", x10);
262
+ Check_default.typeOf.number("y10", y10);
263
+ Check_default.typeOf.number("x11", x11);
264
+ Check_default.typeOf.number("y11", y11);
265
+ const numerator1A = (x11 - x10) * (y00 - y10) - (y11 - y10) * (x00 - x10);
266
+ const numerator1B = (x01 - x00) * (y00 - y10) - (y01 - y00) * (x00 - x10);
267
+ const denominator1 = (y11 - y10) * (x01 - x00) - (x11 - x10) * (y01 - y00);
268
+ if (denominator1 === 0) {
269
+ return;
270
+ }
271
+ const ua1 = numerator1A / denominator1;
272
+ const ub1 = numerator1B / denominator1;
273
+ if (ua1 >= 0 && ua1 <= 1 && ub1 >= 0 && ub1 <= 1) {
274
+ if (!defined_default(result)) {
275
+ result = new Cartesian2_default();
276
+ }
277
+ result.x = x00 + ua1 * (x01 - x00);
278
+ result.y = y00 + ua1 * (y01 - y00);
279
+ return result;
280
+ }
281
+ };
282
+ var Intersections2D_default = Intersections2D;
283
+
284
+ // packages/engine/Source/Workers/upsampleQuantizedTerrainMesh.js
285
+ var maxShort = 32767;
286
+ var halfMaxShort = maxShort / 2 | 0;
287
+ var clipScratch = [];
288
+ var clipScratch2 = [];
289
+ var verticesScratch = [];
290
+ var cartographicScratch = new Cartographic_default();
291
+ var cartesian3Scratch = new Cartesian3_default();
292
+ var uScratch = [];
293
+ var vScratch = [];
294
+ var heightScratch = [];
295
+ var indicesScratch = [];
296
+ var normalsScratch = [];
297
+ var horizonOcclusionPointScratch = new Cartesian3_default();
298
+ var boundingSphereScratch = new BoundingSphere_default();
299
+ var orientedBoundingBoxScratch = new OrientedBoundingBox_default();
300
+ var decodeTexCoordsScratch = new Cartesian2_default();
301
+ var octEncodedNormalScratch = new Cartesian3_default();
302
+ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) {
303
+ const isEastChild = parameters.isEastChild;
304
+ const isNorthChild = parameters.isNorthChild;
305
+ const minU = isEastChild ? halfMaxShort : 0;
306
+ const maxU = isEastChild ? maxShort : halfMaxShort;
307
+ const minV = isNorthChild ? halfMaxShort : 0;
308
+ const maxV = isNorthChild ? maxShort : halfMaxShort;
309
+ const uBuffer = uScratch;
310
+ const vBuffer = vScratch;
311
+ const heightBuffer = heightScratch;
312
+ const normalBuffer = normalsScratch;
313
+ uBuffer.length = 0;
314
+ vBuffer.length = 0;
315
+ heightBuffer.length = 0;
316
+ normalBuffer.length = 0;
317
+ const indices = indicesScratch;
318
+ indices.length = 0;
319
+ const vertexMap = {};
320
+ const parentVertices = parameters.vertices;
321
+ let parentIndices = parameters.indices;
322
+ parentIndices = parentIndices.subarray(0, parameters.indexCountWithoutSkirts);
323
+ const encoding = TerrainEncoding_default.clone(parameters.encoding);
324
+ const hasVertexNormals = encoding.hasVertexNormals;
325
+ let vertexCount = 0;
326
+ const quantizedVertexCount = parameters.vertexCountWithoutSkirts;
327
+ const parentMinimumHeight = parameters.minimumHeight;
328
+ const parentMaximumHeight = parameters.maximumHeight;
329
+ const parentUBuffer = new Array(quantizedVertexCount);
330
+ const parentVBuffer = new Array(quantizedVertexCount);
331
+ const parentHeightBuffer = new Array(quantizedVertexCount);
332
+ const parentNormalBuffer = hasVertexNormals ? new Array(quantizedVertexCount * 2) : void 0;
333
+ const threshold = 20;
334
+ let height;
335
+ let i, n;
336
+ let u, v;
337
+ for (i = 0, n = 0; i < quantizedVertexCount; ++i, n += 2) {
338
+ const texCoords = encoding.decodeTextureCoordinates(
339
+ parentVertices,
340
+ i,
341
+ decodeTexCoordsScratch
342
+ );
343
+ height = encoding.decodeHeight(parentVertices, i);
344
+ u = Math_default.clamp(texCoords.x * maxShort | 0, 0, maxShort);
345
+ v = Math_default.clamp(texCoords.y * maxShort | 0, 0, maxShort);
346
+ parentHeightBuffer[i] = Math_default.clamp(
347
+ (height - parentMinimumHeight) / (parentMaximumHeight - parentMinimumHeight) * maxShort | 0,
348
+ 0,
349
+ maxShort
350
+ );
351
+ if (u < threshold) {
352
+ u = 0;
353
+ }
354
+ if (v < threshold) {
355
+ v = 0;
356
+ }
357
+ if (maxShort - u < threshold) {
358
+ u = maxShort;
359
+ }
360
+ if (maxShort - v < threshold) {
361
+ v = maxShort;
362
+ }
363
+ parentUBuffer[i] = u;
364
+ parentVBuffer[i] = v;
365
+ if (hasVertexNormals) {
366
+ const encodedNormal = encoding.getOctEncodedNormal(
367
+ parentVertices,
368
+ i,
369
+ octEncodedNormalScratch
370
+ );
371
+ parentNormalBuffer[n] = encodedNormal.x;
372
+ parentNormalBuffer[n + 1] = encodedNormal.y;
373
+ }
374
+ if ((isEastChild && u >= halfMaxShort || !isEastChild && u <= halfMaxShort) && (isNorthChild && v >= halfMaxShort || !isNorthChild && v <= halfMaxShort)) {
375
+ vertexMap[i] = vertexCount;
376
+ uBuffer.push(u);
377
+ vBuffer.push(v);
378
+ heightBuffer.push(parentHeightBuffer[i]);
379
+ if (hasVertexNormals) {
380
+ normalBuffer.push(parentNormalBuffer[n]);
381
+ normalBuffer.push(parentNormalBuffer[n + 1]);
382
+ }
383
+ ++vertexCount;
384
+ }
385
+ }
386
+ const triangleVertices = [];
387
+ triangleVertices.push(new Vertex());
388
+ triangleVertices.push(new Vertex());
389
+ triangleVertices.push(new Vertex());
390
+ const clippedTriangleVertices = [];
391
+ clippedTriangleVertices.push(new Vertex());
392
+ clippedTriangleVertices.push(new Vertex());
393
+ clippedTriangleVertices.push(new Vertex());
394
+ let clippedIndex;
395
+ let clipped2;
396
+ for (i = 0; i < parentIndices.length; i += 3) {
397
+ const i0 = parentIndices[i];
398
+ const i1 = parentIndices[i + 1];
399
+ const i2 = parentIndices[i + 2];
400
+ const u0 = parentUBuffer[i0];
401
+ const u1 = parentUBuffer[i1];
402
+ const u2 = parentUBuffer[i2];
403
+ triangleVertices[0].initializeIndexed(
404
+ parentUBuffer,
405
+ parentVBuffer,
406
+ parentHeightBuffer,
407
+ parentNormalBuffer,
408
+ i0
409
+ );
410
+ triangleVertices[1].initializeIndexed(
411
+ parentUBuffer,
412
+ parentVBuffer,
413
+ parentHeightBuffer,
414
+ parentNormalBuffer,
415
+ i1
416
+ );
417
+ triangleVertices[2].initializeIndexed(
418
+ parentUBuffer,
419
+ parentVBuffer,
420
+ parentHeightBuffer,
421
+ parentNormalBuffer,
422
+ i2
423
+ );
424
+ const clipped = Intersections2D_default.clipTriangleAtAxisAlignedThreshold(
425
+ halfMaxShort,
426
+ isEastChild,
427
+ u0,
428
+ u1,
429
+ u2,
430
+ clipScratch
431
+ );
432
+ clippedIndex = 0;
433
+ if (clippedIndex >= clipped.length) {
434
+ continue;
435
+ }
436
+ clippedIndex = clippedTriangleVertices[0].initializeFromClipResult(
437
+ clipped,
438
+ clippedIndex,
439
+ triangleVertices
440
+ );
441
+ if (clippedIndex >= clipped.length) {
442
+ continue;
443
+ }
444
+ clippedIndex = clippedTriangleVertices[1].initializeFromClipResult(
445
+ clipped,
446
+ clippedIndex,
447
+ triangleVertices
448
+ );
449
+ if (clippedIndex >= clipped.length) {
450
+ continue;
451
+ }
452
+ clippedIndex = clippedTriangleVertices[2].initializeFromClipResult(
453
+ clipped,
454
+ clippedIndex,
455
+ triangleVertices
456
+ );
457
+ clipped2 = Intersections2D_default.clipTriangleAtAxisAlignedThreshold(
458
+ halfMaxShort,
459
+ isNorthChild,
460
+ clippedTriangleVertices[0].getV(),
461
+ clippedTriangleVertices[1].getV(),
462
+ clippedTriangleVertices[2].getV(),
463
+ clipScratch2
464
+ );
465
+ addClippedPolygon(
466
+ uBuffer,
467
+ vBuffer,
468
+ heightBuffer,
469
+ normalBuffer,
470
+ indices,
471
+ vertexMap,
472
+ clipped2,
473
+ clippedTriangleVertices,
474
+ hasVertexNormals
475
+ );
476
+ if (clippedIndex < clipped.length) {
477
+ clippedTriangleVertices[2].clone(clippedTriangleVertices[1]);
478
+ clippedTriangleVertices[2].initializeFromClipResult(
479
+ clipped,
480
+ clippedIndex,
481
+ triangleVertices
482
+ );
483
+ clipped2 = Intersections2D_default.clipTriangleAtAxisAlignedThreshold(
484
+ halfMaxShort,
485
+ isNorthChild,
486
+ clippedTriangleVertices[0].getV(),
487
+ clippedTriangleVertices[1].getV(),
488
+ clippedTriangleVertices[2].getV(),
489
+ clipScratch2
490
+ );
491
+ addClippedPolygon(
492
+ uBuffer,
493
+ vBuffer,
494
+ heightBuffer,
495
+ normalBuffer,
496
+ indices,
497
+ vertexMap,
498
+ clipped2,
499
+ clippedTriangleVertices,
500
+ hasVertexNormals
501
+ );
502
+ }
503
+ }
504
+ const uOffset = isEastChild ? -maxShort : 0;
505
+ const vOffset = isNorthChild ? -maxShort : 0;
506
+ const westIndices = [];
507
+ const southIndices = [];
508
+ const eastIndices = [];
509
+ const northIndices = [];
510
+ let minimumHeight = Number.MAX_VALUE;
511
+ let maximumHeight = -minimumHeight;
512
+ const cartesianVertices = verticesScratch;
513
+ cartesianVertices.length = 0;
514
+ const ellipsoid = Ellipsoid_default.clone(parameters.ellipsoid);
515
+ const rectangle = Rectangle_default.clone(parameters.childRectangle);
516
+ const north = rectangle.north;
517
+ const south = rectangle.south;
518
+ let east = rectangle.east;
519
+ const west = rectangle.west;
520
+ if (east < west) {
521
+ east += Math_default.TWO_PI;
522
+ }
523
+ for (i = 0; i < uBuffer.length; ++i) {
524
+ u = Math.round(uBuffer[i]);
525
+ if (u <= minU) {
526
+ westIndices.push(i);
527
+ u = 0;
528
+ } else if (u >= maxU) {
529
+ eastIndices.push(i);
530
+ u = maxShort;
531
+ } else {
532
+ u = u * 2 + uOffset;
533
+ }
534
+ uBuffer[i] = u;
535
+ v = Math.round(vBuffer[i]);
536
+ if (v <= minV) {
537
+ southIndices.push(i);
538
+ v = 0;
539
+ } else if (v >= maxV) {
540
+ northIndices.push(i);
541
+ v = maxShort;
542
+ } else {
543
+ v = v * 2 + vOffset;
544
+ }
545
+ vBuffer[i] = v;
546
+ height = Math_default.lerp(
547
+ parentMinimumHeight,
548
+ parentMaximumHeight,
549
+ heightBuffer[i] / maxShort
550
+ );
551
+ if (height < minimumHeight) {
552
+ minimumHeight = height;
553
+ }
554
+ if (height > maximumHeight) {
555
+ maximumHeight = height;
556
+ }
557
+ heightBuffer[i] = height;
558
+ cartographicScratch.longitude = Math_default.lerp(west, east, u / maxShort);
559
+ cartographicScratch.latitude = Math_default.lerp(south, north, v / maxShort);
560
+ cartographicScratch.height = height;
561
+ ellipsoid.cartographicToCartesian(cartographicScratch, cartesian3Scratch);
562
+ cartesianVertices.push(cartesian3Scratch.x);
563
+ cartesianVertices.push(cartesian3Scratch.y);
564
+ cartesianVertices.push(cartesian3Scratch.z);
565
+ }
566
+ const boundingSphere = BoundingSphere_default.fromVertices(
567
+ cartesianVertices,
568
+ Cartesian3_default.ZERO,
569
+ 3,
570
+ boundingSphereScratch
571
+ );
572
+ const orientedBoundingBox = OrientedBoundingBox_default.fromRectangle(
573
+ rectangle,
574
+ minimumHeight,
575
+ maximumHeight,
576
+ ellipsoid,
577
+ orientedBoundingBoxScratch
578
+ );
579
+ const occluder = new EllipsoidalOccluder_default(ellipsoid);
580
+ const horizonOcclusionPoint = occluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(
581
+ boundingSphere.center,
582
+ cartesianVertices,
583
+ 3,
584
+ boundingSphere.center,
585
+ minimumHeight,
586
+ horizonOcclusionPointScratch
587
+ );
588
+ const heightRange = maximumHeight - minimumHeight;
589
+ const vertices = new Uint16Array(
590
+ uBuffer.length + vBuffer.length + heightBuffer.length
591
+ );
592
+ for (i = 0; i < uBuffer.length; ++i) {
593
+ vertices[i] = uBuffer[i];
594
+ }
595
+ let start = uBuffer.length;
596
+ for (i = 0; i < vBuffer.length; ++i) {
597
+ vertices[start + i] = vBuffer[i];
598
+ }
599
+ start += vBuffer.length;
600
+ for (i = 0; i < heightBuffer.length; ++i) {
601
+ vertices[start + i] = maxShort * (heightBuffer[i] - minimumHeight) / heightRange;
602
+ }
603
+ const indicesTypedArray = IndexDatatype_default.createTypedArray(
604
+ uBuffer.length,
605
+ indices
606
+ );
607
+ let encodedNormals;
608
+ if (hasVertexNormals) {
609
+ const normalArray = new Uint8Array(normalBuffer);
610
+ transferableObjects.push(
611
+ vertices.buffer,
612
+ indicesTypedArray.buffer,
613
+ normalArray.buffer
614
+ );
615
+ encodedNormals = normalArray.buffer;
616
+ } else {
617
+ transferableObjects.push(vertices.buffer, indicesTypedArray.buffer);
618
+ }
619
+ return {
620
+ vertices: vertices.buffer,
621
+ encodedNormals,
622
+ indices: indicesTypedArray.buffer,
623
+ minimumHeight,
624
+ maximumHeight,
625
+ westIndices,
626
+ southIndices,
627
+ eastIndices,
628
+ northIndices,
629
+ boundingSphere,
630
+ orientedBoundingBox,
631
+ horizonOcclusionPoint
632
+ };
633
+ }
634
+ function Vertex() {
635
+ this.vertexBuffer = void 0;
636
+ this.index = void 0;
637
+ this.first = void 0;
638
+ this.second = void 0;
639
+ this.ratio = void 0;
640
+ }
641
+ Vertex.prototype.clone = function(result) {
642
+ if (!defined_default(result)) {
643
+ result = new Vertex();
644
+ }
645
+ result.uBuffer = this.uBuffer;
646
+ result.vBuffer = this.vBuffer;
647
+ result.heightBuffer = this.heightBuffer;
648
+ result.normalBuffer = this.normalBuffer;
649
+ result.index = this.index;
650
+ result.first = this.first;
651
+ result.second = this.second;
652
+ result.ratio = this.ratio;
653
+ return result;
654
+ };
655
+ Vertex.prototype.initializeIndexed = function(uBuffer, vBuffer, heightBuffer, normalBuffer, index) {
656
+ this.uBuffer = uBuffer;
657
+ this.vBuffer = vBuffer;
658
+ this.heightBuffer = heightBuffer;
659
+ this.normalBuffer = normalBuffer;
660
+ this.index = index;
661
+ this.first = void 0;
662
+ this.second = void 0;
663
+ this.ratio = void 0;
664
+ };
665
+ Vertex.prototype.initializeFromClipResult = function(clipResult, index, vertices) {
666
+ let nextIndex = index + 1;
667
+ if (clipResult[index] !== -1) {
668
+ vertices[clipResult[index]].clone(this);
669
+ } else {
670
+ this.vertexBuffer = void 0;
671
+ this.index = void 0;
672
+ this.first = vertices[clipResult[nextIndex]];
673
+ ++nextIndex;
674
+ this.second = vertices[clipResult[nextIndex]];
675
+ ++nextIndex;
676
+ this.ratio = clipResult[nextIndex];
677
+ ++nextIndex;
678
+ }
679
+ return nextIndex;
680
+ };
681
+ Vertex.prototype.getKey = function() {
682
+ if (this.isIndexed()) {
683
+ return this.index;
684
+ }
685
+ return JSON.stringify({
686
+ first: this.first.getKey(),
687
+ second: this.second.getKey(),
688
+ ratio: this.ratio
689
+ });
690
+ };
691
+ Vertex.prototype.isIndexed = function() {
692
+ return defined_default(this.index);
693
+ };
694
+ Vertex.prototype.getH = function() {
695
+ if (defined_default(this.index)) {
696
+ return this.heightBuffer[this.index];
697
+ }
698
+ return Math_default.lerp(this.first.getH(), this.second.getH(), this.ratio);
699
+ };
700
+ Vertex.prototype.getU = function() {
701
+ if (defined_default(this.index)) {
702
+ return this.uBuffer[this.index];
703
+ }
704
+ return Math_default.lerp(this.first.getU(), this.second.getU(), this.ratio);
705
+ };
706
+ Vertex.prototype.getV = function() {
707
+ if (defined_default(this.index)) {
708
+ return this.vBuffer[this.index];
709
+ }
710
+ return Math_default.lerp(this.first.getV(), this.second.getV(), this.ratio);
711
+ };
712
+ var encodedScratch = new Cartesian2_default();
713
+ var depth = -1;
714
+ var cartesianScratch1 = [new Cartesian3_default(), new Cartesian3_default()];
715
+ var cartesianScratch2 = [new Cartesian3_default(), new Cartesian3_default()];
716
+ function lerpOctEncodedNormal(vertex, result) {
717
+ ++depth;
718
+ let first = cartesianScratch1[depth];
719
+ let second = cartesianScratch2[depth];
720
+ first = AttributeCompression_default.octDecode(
721
+ vertex.first.getNormalX(),
722
+ vertex.first.getNormalY(),
723
+ first
724
+ );
725
+ second = AttributeCompression_default.octDecode(
726
+ vertex.second.getNormalX(),
727
+ vertex.second.getNormalY(),
728
+ second
729
+ );
730
+ cartesian3Scratch = Cartesian3_default.lerp(
731
+ first,
732
+ second,
733
+ vertex.ratio,
734
+ cartesian3Scratch
735
+ );
736
+ Cartesian3_default.normalize(cartesian3Scratch, cartesian3Scratch);
737
+ AttributeCompression_default.octEncode(cartesian3Scratch, result);
738
+ --depth;
739
+ return result;
740
+ }
741
+ Vertex.prototype.getNormalX = function() {
742
+ if (defined_default(this.index)) {
743
+ return this.normalBuffer[this.index * 2];
744
+ }
745
+ encodedScratch = lerpOctEncodedNormal(this, encodedScratch);
746
+ return encodedScratch.x;
747
+ };
748
+ Vertex.prototype.getNormalY = function() {
749
+ if (defined_default(this.index)) {
750
+ return this.normalBuffer[this.index * 2 + 1];
751
+ }
752
+ encodedScratch = lerpOctEncodedNormal(this, encodedScratch);
753
+ return encodedScratch.y;
754
+ };
755
+ var polygonVertices = [];
756
+ polygonVertices.push(new Vertex());
757
+ polygonVertices.push(new Vertex());
758
+ polygonVertices.push(new Vertex());
759
+ polygonVertices.push(new Vertex());
760
+ function addClippedPolygon(uBuffer, vBuffer, heightBuffer, normalBuffer, indices, vertexMap, clipped, triangleVertices, hasVertexNormals) {
761
+ if (clipped.length === 0) {
762
+ return;
763
+ }
764
+ let numVertices = 0;
765
+ let clippedIndex = 0;
766
+ while (clippedIndex < clipped.length) {
767
+ clippedIndex = polygonVertices[numVertices++].initializeFromClipResult(
768
+ clipped,
769
+ clippedIndex,
770
+ triangleVertices
771
+ );
772
+ }
773
+ for (let i = 0; i < numVertices; ++i) {
774
+ const polygonVertex = polygonVertices[i];
775
+ if (!polygonVertex.isIndexed()) {
776
+ const key = polygonVertex.getKey();
777
+ if (defined_default(vertexMap[key])) {
778
+ polygonVertex.newIndex = vertexMap[key];
779
+ } else {
780
+ const newIndex = uBuffer.length;
781
+ uBuffer.push(polygonVertex.getU());
782
+ vBuffer.push(polygonVertex.getV());
783
+ heightBuffer.push(polygonVertex.getH());
784
+ if (hasVertexNormals) {
785
+ normalBuffer.push(polygonVertex.getNormalX());
786
+ normalBuffer.push(polygonVertex.getNormalY());
787
+ }
788
+ polygonVertex.newIndex = newIndex;
789
+ vertexMap[key] = newIndex;
790
+ }
791
+ } else {
792
+ polygonVertex.newIndex = vertexMap[polygonVertex.index];
793
+ polygonVertex.uBuffer = uBuffer;
794
+ polygonVertex.vBuffer = vBuffer;
795
+ polygonVertex.heightBuffer = heightBuffer;
796
+ if (hasVertexNormals) {
797
+ polygonVertex.normalBuffer = normalBuffer;
798
+ }
799
+ }
800
+ }
801
+ if (numVertices === 3) {
802
+ indices.push(polygonVertices[0].newIndex);
803
+ indices.push(polygonVertices[1].newIndex);
804
+ indices.push(polygonVertices[2].newIndex);
805
+ } else if (numVertices === 4) {
806
+ indices.push(polygonVertices[0].newIndex);
807
+ indices.push(polygonVertices[1].newIndex);
808
+ indices.push(polygonVertices[2].newIndex);
809
+ indices.push(polygonVertices[0].newIndex);
810
+ indices.push(polygonVertices[2].newIndex);
811
+ indices.push(polygonVertices[3].newIndex);
812
+ }
813
+ }
814
+ var upsampleQuantizedTerrainMesh_default = createTaskProcessorWorker_default(upsampleQuantizedTerrainMesh);
815
+ export {
816
+ upsampleQuantizedTerrainMesh_default as default
817
+ };