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,1261 @@
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
+ CorridorGeometryLibrary_default
28
+ } from "./chunk-SDIDRZDG.js";
29
+ import {
30
+ CornerType_default
31
+ } from "./chunk-MVM4JV5U.js";
32
+ import "./chunk-LNSWJ43X.js";
33
+ import "./chunk-LS3KVHYY.js";
34
+ import {
35
+ GeometryOffsetAttribute_default
36
+ } from "./chunk-5S5OOA6U.js";
37
+ import {
38
+ VertexFormat_default
39
+ } from "./chunk-4CHMVQTQ.js";
40
+ import "./chunk-VCNOFQYH.js";
41
+ import "./chunk-B4GSRXE3.js";
42
+ import {
43
+ PolygonPipeline_default
44
+ } from "./chunk-K4AH3TDT.js";
45
+ import {
46
+ arrayRemoveDuplicates_default
47
+ } from "./chunk-ZMNLEL6W.js";
48
+ import "./chunk-3QLSKXKF.js";
49
+ import "./chunk-EWDGNOJE.js";
50
+ import "./chunk-LJBJM6VI.js";
51
+ import {
52
+ IndexDatatype_default
53
+ } from "./chunk-D7ZBZPHV.js";
54
+ import {
55
+ GeometryAttributes_default
56
+ } from "./chunk-TY4DKOWR.js";
57
+ import {
58
+ GeometryAttribute_default,
59
+ Geometry_default,
60
+ PrimitiveType_default
61
+ } from "./chunk-HUFQVUMY.js";
62
+ import {
63
+ BoundingSphere_default
64
+ } from "./chunk-FYGLNDKG.js";
65
+ import {
66
+ Rectangle_default
67
+ } from "./chunk-WEHZP4SE.js";
68
+ import {
69
+ ComponentDatatype_default
70
+ } from "./chunk-KSYBJA4M.js";
71
+ import {
72
+ Cartesian3_default,
73
+ Cartographic_default,
74
+ Ellipsoid_default
75
+ } from "./chunk-KM6MITPF.js";
76
+ import {
77
+ Math_default
78
+ } from "./chunk-F4CUH4MR.js";
79
+ import "./chunk-ED6GLQTK.js";
80
+ import "./chunk-5KWRW7YL.js";
81
+ import {
82
+ defaultValue_default
83
+ } from "./chunk-TVL3F7IU.js";
84
+ import {
85
+ Check_default
86
+ } from "./chunk-OMXHEJTK.js";
87
+ import {
88
+ defined_default
89
+ } from "./chunk-KHWLAQVA.js";
90
+
91
+ // packages/engine/Source/Core/CorridorGeometry.js
92
+ var cartesian1 = new Cartesian3_default();
93
+ var cartesian2 = new Cartesian3_default();
94
+ var cartesian3 = new Cartesian3_default();
95
+ var cartesian4 = new Cartesian3_default();
96
+ var cartesian5 = new Cartesian3_default();
97
+ var cartesian6 = new Cartesian3_default();
98
+ var scratch1 = new Cartesian3_default();
99
+ var scratch2 = new Cartesian3_default();
100
+ function scaleToSurface(positions, ellipsoid) {
101
+ for (let i = 0; i < positions.length; i++) {
102
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
103
+ }
104
+ return positions;
105
+ }
106
+ function addNormals(attr, normal, left, front, back, vertexFormat) {
107
+ const normals = attr.normals;
108
+ const tangents = attr.tangents;
109
+ const bitangents = attr.bitangents;
110
+ const forward = Cartesian3_default.normalize(
111
+ Cartesian3_default.cross(left, normal, scratch1),
112
+ scratch1
113
+ );
114
+ if (vertexFormat.normal) {
115
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, front, back);
116
+ }
117
+ if (vertexFormat.tangent) {
118
+ CorridorGeometryLibrary_default.addAttribute(tangents, forward, front, back);
119
+ }
120
+ if (vertexFormat.bitangent) {
121
+ CorridorGeometryLibrary_default.addAttribute(bitangents, left, front, back);
122
+ }
123
+ }
124
+ function combine(computedPositions, vertexFormat, ellipsoid) {
125
+ const positions = computedPositions.positions;
126
+ const corners = computedPositions.corners;
127
+ const endPositions = computedPositions.endPositions;
128
+ const computedLefts = computedPositions.lefts;
129
+ const computedNormals = computedPositions.normals;
130
+ const attributes = new GeometryAttributes_default();
131
+ let corner;
132
+ let leftCount = 0;
133
+ let rightCount = 0;
134
+ let i;
135
+ let indicesLength = 0;
136
+ let length;
137
+ for (i = 0; i < positions.length; i += 2) {
138
+ length = positions[i].length - 3;
139
+ leftCount += length;
140
+ indicesLength += length * 2;
141
+ rightCount += positions[i + 1].length - 3;
142
+ }
143
+ leftCount += 3;
144
+ rightCount += 3;
145
+ for (i = 0; i < corners.length; i++) {
146
+ corner = corners[i];
147
+ const leftSide = corners[i].leftPositions;
148
+ if (defined_default(leftSide)) {
149
+ length = leftSide.length;
150
+ leftCount += length;
151
+ indicesLength += length;
152
+ } else {
153
+ length = corners[i].rightPositions.length;
154
+ rightCount += length;
155
+ indicesLength += length;
156
+ }
157
+ }
158
+ const addEndPositions = defined_default(endPositions);
159
+ let endPositionLength;
160
+ if (addEndPositions) {
161
+ endPositionLength = endPositions[0].length - 3;
162
+ leftCount += endPositionLength;
163
+ rightCount += endPositionLength;
164
+ endPositionLength /= 3;
165
+ indicesLength += endPositionLength * 6;
166
+ }
167
+ const size = leftCount + rightCount;
168
+ const finalPositions = new Float64Array(size);
169
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
170
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
171
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
172
+ const attr = {
173
+ normals,
174
+ tangents,
175
+ bitangents
176
+ };
177
+ let front = 0;
178
+ let back = size - 1;
179
+ let UL, LL, UR, LR;
180
+ let normal = cartesian1;
181
+ let left = cartesian2;
182
+ let rightPos, leftPos;
183
+ const halfLength = endPositionLength / 2;
184
+ const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength);
185
+ let index = 0;
186
+ if (addEndPositions) {
187
+ leftPos = cartesian3;
188
+ rightPos = cartesian4;
189
+ const firstEndPositions = endPositions[0];
190
+ normal = Cartesian3_default.fromArray(computedNormals, 0, normal);
191
+ left = Cartesian3_default.fromArray(computedLefts, 0, left);
192
+ for (i = 0; i < halfLength; i++) {
193
+ leftPos = Cartesian3_default.fromArray(
194
+ firstEndPositions,
195
+ (halfLength - 1 - i) * 3,
196
+ leftPos
197
+ );
198
+ rightPos = Cartesian3_default.fromArray(
199
+ firstEndPositions,
200
+ (halfLength + i) * 3,
201
+ rightPos
202
+ );
203
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
204
+ CorridorGeometryLibrary_default.addAttribute(
205
+ finalPositions,
206
+ leftPos,
207
+ void 0,
208
+ back
209
+ );
210
+ addNormals(attr, normal, left, front, back, vertexFormat);
211
+ LL = front / 3;
212
+ LR = LL + 1;
213
+ UL = (back - 2) / 3;
214
+ UR = UL - 1;
215
+ indices[index++] = UL;
216
+ indices[index++] = LL;
217
+ indices[index++] = UR;
218
+ indices[index++] = UR;
219
+ indices[index++] = LL;
220
+ indices[index++] = LR;
221
+ front += 3;
222
+ back -= 3;
223
+ }
224
+ }
225
+ let posIndex = 0;
226
+ let compIndex = 0;
227
+ let rightEdge = positions[posIndex++];
228
+ let leftEdge = positions[posIndex++];
229
+ finalPositions.set(rightEdge, front);
230
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
231
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
232
+ let rightNormal;
233
+ let leftNormal;
234
+ length = leftEdge.length - 3;
235
+ for (i = 0; i < length; i += 3) {
236
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
237
+ Cartesian3_default.fromArray(rightEdge, i, scratch1),
238
+ scratch1
239
+ );
240
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
241
+ Cartesian3_default.fromArray(leftEdge, length - i, scratch2),
242
+ scratch2
243
+ );
244
+ normal = Cartesian3_default.normalize(
245
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
246
+ normal
247
+ );
248
+ addNormals(attr, normal, left, front, back, vertexFormat);
249
+ LL = front / 3;
250
+ LR = LL + 1;
251
+ UL = (back - 2) / 3;
252
+ UR = UL - 1;
253
+ indices[index++] = UL;
254
+ indices[index++] = LL;
255
+ indices[index++] = UR;
256
+ indices[index++] = UR;
257
+ indices[index++] = LL;
258
+ indices[index++] = LR;
259
+ front += 3;
260
+ back -= 3;
261
+ }
262
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
263
+ Cartesian3_default.fromArray(rightEdge, length, scratch1),
264
+ scratch1
265
+ );
266
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
267
+ Cartesian3_default.fromArray(leftEdge, length, scratch2),
268
+ scratch2
269
+ );
270
+ normal = Cartesian3_default.normalize(
271
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
272
+ normal
273
+ );
274
+ compIndex += 3;
275
+ for (i = 0; i < corners.length; i++) {
276
+ let j;
277
+ corner = corners[i];
278
+ const l = corner.leftPositions;
279
+ const r = corner.rightPositions;
280
+ let pivot;
281
+ let start;
282
+ let outsidePoint = cartesian6;
283
+ let previousPoint = cartesian3;
284
+ let nextPoint = cartesian4;
285
+ normal = Cartesian3_default.fromArray(computedNormals, compIndex, normal);
286
+ if (defined_default(l)) {
287
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
288
+ back -= 3;
289
+ pivot = LR;
290
+ start = UR;
291
+ for (j = 0; j < l.length / 3; j++) {
292
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
293
+ indices[index++] = pivot;
294
+ indices[index++] = start - j - 1;
295
+ indices[index++] = start - j;
296
+ CorridorGeometryLibrary_default.addAttribute(
297
+ finalPositions,
298
+ outsidePoint,
299
+ void 0,
300
+ back
301
+ );
302
+ previousPoint = Cartesian3_default.fromArray(
303
+ finalPositions,
304
+ (start - j - 1) * 3,
305
+ previousPoint
306
+ );
307
+ nextPoint = Cartesian3_default.fromArray(finalPositions, pivot * 3, nextPoint);
308
+ left = Cartesian3_default.normalize(
309
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
310
+ left
311
+ );
312
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
313
+ back -= 3;
314
+ }
315
+ outsidePoint = Cartesian3_default.fromArray(
316
+ finalPositions,
317
+ pivot * 3,
318
+ outsidePoint
319
+ );
320
+ previousPoint = Cartesian3_default.subtract(
321
+ Cartesian3_default.fromArray(finalPositions, start * 3, previousPoint),
322
+ outsidePoint,
323
+ previousPoint
324
+ );
325
+ nextPoint = Cartesian3_default.subtract(
326
+ Cartesian3_default.fromArray(finalPositions, (start - j) * 3, nextPoint),
327
+ outsidePoint,
328
+ nextPoint
329
+ );
330
+ left = Cartesian3_default.normalize(
331
+ Cartesian3_default.add(previousPoint, nextPoint, left),
332
+ left
333
+ );
334
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
335
+ front += 3;
336
+ } else {
337
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
338
+ front += 3;
339
+ pivot = UR;
340
+ start = LR;
341
+ for (j = 0; j < r.length / 3; j++) {
342
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
343
+ indices[index++] = pivot;
344
+ indices[index++] = start + j;
345
+ indices[index++] = start + j + 1;
346
+ CorridorGeometryLibrary_default.addAttribute(
347
+ finalPositions,
348
+ outsidePoint,
349
+ front
350
+ );
351
+ previousPoint = Cartesian3_default.fromArray(
352
+ finalPositions,
353
+ pivot * 3,
354
+ previousPoint
355
+ );
356
+ nextPoint = Cartesian3_default.fromArray(
357
+ finalPositions,
358
+ (start + j) * 3,
359
+ nextPoint
360
+ );
361
+ left = Cartesian3_default.normalize(
362
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
363
+ left
364
+ );
365
+ addNormals(attr, normal, left, front, void 0, vertexFormat);
366
+ front += 3;
367
+ }
368
+ outsidePoint = Cartesian3_default.fromArray(
369
+ finalPositions,
370
+ pivot * 3,
371
+ outsidePoint
372
+ );
373
+ previousPoint = Cartesian3_default.subtract(
374
+ Cartesian3_default.fromArray(finalPositions, (start + j) * 3, previousPoint),
375
+ outsidePoint,
376
+ previousPoint
377
+ );
378
+ nextPoint = Cartesian3_default.subtract(
379
+ Cartesian3_default.fromArray(finalPositions, start * 3, nextPoint),
380
+ outsidePoint,
381
+ nextPoint
382
+ );
383
+ left = Cartesian3_default.normalize(
384
+ Cartesian3_default.negate(Cartesian3_default.add(nextPoint, previousPoint, left), left),
385
+ left
386
+ );
387
+ addNormals(attr, normal, left, void 0, back, vertexFormat);
388
+ back -= 3;
389
+ }
390
+ rightEdge = positions[posIndex++];
391
+ leftEdge = positions[posIndex++];
392
+ rightEdge.splice(0, 3);
393
+ leftEdge.splice(leftEdge.length - 3, 3);
394
+ finalPositions.set(rightEdge, front);
395
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
396
+ length = leftEdge.length - 3;
397
+ compIndex += 3;
398
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
399
+ for (j = 0; j < leftEdge.length; j += 3) {
400
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
401
+ Cartesian3_default.fromArray(rightEdge, j, scratch1),
402
+ scratch1
403
+ );
404
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
405
+ Cartesian3_default.fromArray(leftEdge, length - j, scratch2),
406
+ scratch2
407
+ );
408
+ normal = Cartesian3_default.normalize(
409
+ Cartesian3_default.add(rightNormal, leftNormal, normal),
410
+ normal
411
+ );
412
+ addNormals(attr, normal, left, front, back, vertexFormat);
413
+ LR = front / 3;
414
+ LL = LR - 1;
415
+ UR = (back - 2) / 3;
416
+ UL = UR + 1;
417
+ indices[index++] = UL;
418
+ indices[index++] = LL;
419
+ indices[index++] = UR;
420
+ indices[index++] = UR;
421
+ indices[index++] = LL;
422
+ indices[index++] = LR;
423
+ front += 3;
424
+ back -= 3;
425
+ }
426
+ front -= 3;
427
+ back += 3;
428
+ }
429
+ normal = Cartesian3_default.fromArray(
430
+ computedNormals,
431
+ computedNormals.length - 3,
432
+ normal
433
+ );
434
+ addNormals(attr, normal, left, front, back, vertexFormat);
435
+ if (addEndPositions) {
436
+ front += 3;
437
+ back -= 3;
438
+ leftPos = cartesian3;
439
+ rightPos = cartesian4;
440
+ const lastEndPositions = endPositions[1];
441
+ for (i = 0; i < halfLength; i++) {
442
+ leftPos = Cartesian3_default.fromArray(
443
+ lastEndPositions,
444
+ (endPositionLength - i - 1) * 3,
445
+ leftPos
446
+ );
447
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
448
+ CorridorGeometryLibrary_default.addAttribute(
449
+ finalPositions,
450
+ leftPos,
451
+ void 0,
452
+ back
453
+ );
454
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
455
+ addNormals(attr, normal, left, front, back, vertexFormat);
456
+ LR = front / 3;
457
+ LL = LR - 1;
458
+ UR = (back - 2) / 3;
459
+ UL = UR + 1;
460
+ indices[index++] = UL;
461
+ indices[index++] = LL;
462
+ indices[index++] = UR;
463
+ indices[index++] = UR;
464
+ indices[index++] = LL;
465
+ indices[index++] = LR;
466
+ front += 3;
467
+ back -= 3;
468
+ }
469
+ }
470
+ attributes.position = new GeometryAttribute_default({
471
+ componentDatatype: ComponentDatatype_default.DOUBLE,
472
+ componentsPerAttribute: 3,
473
+ values: finalPositions
474
+ });
475
+ if (vertexFormat.st) {
476
+ const st = new Float32Array(size / 3 * 2);
477
+ let rightSt;
478
+ let leftSt;
479
+ let stIndex = 0;
480
+ if (addEndPositions) {
481
+ leftCount /= 3;
482
+ rightCount /= 3;
483
+ const theta = Math.PI / (endPositionLength + 1);
484
+ leftSt = 1 / (leftCount - endPositionLength + 1);
485
+ rightSt = 1 / (rightCount - endPositionLength + 1);
486
+ let a;
487
+ const halfEndPos = endPositionLength / 2;
488
+ for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
489
+ a = Math_default.PI_OVER_TWO + theta * i;
490
+ st[stIndex++] = rightSt * (1 + Math.cos(a));
491
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
492
+ }
493
+ for (i = 1; i < rightCount - endPositionLength + 1; i++) {
494
+ st[stIndex++] = i * rightSt;
495
+ st[stIndex++] = 0;
496
+ }
497
+ for (i = endPositionLength; i > halfEndPos; i--) {
498
+ a = Math_default.PI_OVER_TWO - i * theta;
499
+ st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
500
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
501
+ }
502
+ for (i = halfEndPos; i > 0; i--) {
503
+ a = Math_default.PI_OVER_TWO - theta * i;
504
+ st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
505
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
506
+ }
507
+ for (i = leftCount - endPositionLength; i > 0; i--) {
508
+ st[stIndex++] = i * leftSt;
509
+ st[stIndex++] = 1;
510
+ }
511
+ for (i = 1; i < halfEndPos + 1; i++) {
512
+ a = Math_default.PI_OVER_TWO + theta * i;
513
+ st[stIndex++] = leftSt * (1 + Math.cos(a));
514
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
515
+ }
516
+ } else {
517
+ leftCount /= 3;
518
+ rightCount /= 3;
519
+ leftSt = 1 / (leftCount - 1);
520
+ rightSt = 1 / (rightCount - 1);
521
+ for (i = 0; i < rightCount; i++) {
522
+ st[stIndex++] = i * rightSt;
523
+ st[stIndex++] = 0;
524
+ }
525
+ for (i = leftCount; i > 0; i--) {
526
+ st[stIndex++] = (i - 1) * leftSt;
527
+ st[stIndex++] = 1;
528
+ }
529
+ }
530
+ attributes.st = new GeometryAttribute_default({
531
+ componentDatatype: ComponentDatatype_default.FLOAT,
532
+ componentsPerAttribute: 2,
533
+ values: st
534
+ });
535
+ }
536
+ if (vertexFormat.normal) {
537
+ attributes.normal = new GeometryAttribute_default({
538
+ componentDatatype: ComponentDatatype_default.FLOAT,
539
+ componentsPerAttribute: 3,
540
+ values: attr.normals
541
+ });
542
+ }
543
+ if (vertexFormat.tangent) {
544
+ attributes.tangent = new GeometryAttribute_default({
545
+ componentDatatype: ComponentDatatype_default.FLOAT,
546
+ componentsPerAttribute: 3,
547
+ values: attr.tangents
548
+ });
549
+ }
550
+ if (vertexFormat.bitangent) {
551
+ attributes.bitangent = new GeometryAttribute_default({
552
+ componentDatatype: ComponentDatatype_default.FLOAT,
553
+ componentsPerAttribute: 3,
554
+ values: attr.bitangents
555
+ });
556
+ }
557
+ return {
558
+ attributes,
559
+ indices
560
+ };
561
+ }
562
+ function extrudedAttributes(attributes, vertexFormat) {
563
+ if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) {
564
+ return attributes;
565
+ }
566
+ const positions = attributes.position.values;
567
+ let topNormals;
568
+ let topBitangents;
569
+ if (vertexFormat.normal || vertexFormat.bitangent) {
570
+ topNormals = attributes.normal.values;
571
+ topBitangents = attributes.bitangent.values;
572
+ }
573
+ const size = attributes.position.values.length / 18;
574
+ const threeSize = size * 3;
575
+ const twoSize = size * 2;
576
+ const sixSize = threeSize * 2;
577
+ let i;
578
+ if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
579
+ const normals = vertexFormat.normal ? new Float32Array(threeSize * 6) : void 0;
580
+ const tangents = vertexFormat.tangent ? new Float32Array(threeSize * 6) : void 0;
581
+ const bitangents = vertexFormat.bitangent ? new Float32Array(threeSize * 6) : void 0;
582
+ let topPosition = cartesian1;
583
+ let bottomPosition = cartesian2;
584
+ let previousPosition = cartesian3;
585
+ let normal = cartesian4;
586
+ let tangent = cartesian5;
587
+ let bitangent = cartesian6;
588
+ let attrIndex = sixSize;
589
+ for (i = 0; i < threeSize; i += 3) {
590
+ const attrIndexOffset = attrIndex + sixSize;
591
+ topPosition = Cartesian3_default.fromArray(positions, i, topPosition);
592
+ bottomPosition = Cartesian3_default.fromArray(
593
+ positions,
594
+ i + threeSize,
595
+ bottomPosition
596
+ );
597
+ previousPosition = Cartesian3_default.fromArray(
598
+ positions,
599
+ (i + 3) % threeSize,
600
+ previousPosition
601
+ );
602
+ bottomPosition = Cartesian3_default.subtract(
603
+ bottomPosition,
604
+ topPosition,
605
+ bottomPosition
606
+ );
607
+ previousPosition = Cartesian3_default.subtract(
608
+ previousPosition,
609
+ topPosition,
610
+ previousPosition
611
+ );
612
+ normal = Cartesian3_default.normalize(
613
+ Cartesian3_default.cross(bottomPosition, previousPosition, normal),
614
+ normal
615
+ );
616
+ if (vertexFormat.normal) {
617
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndexOffset);
618
+ CorridorGeometryLibrary_default.addAttribute(
619
+ normals,
620
+ normal,
621
+ attrIndexOffset + 3
622
+ );
623
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex);
624
+ CorridorGeometryLibrary_default.addAttribute(normals, normal, attrIndex + 3);
625
+ }
626
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
627
+ bitangent = Cartesian3_default.fromArray(topNormals, i, bitangent);
628
+ if (vertexFormat.bitangent) {
629
+ CorridorGeometryLibrary_default.addAttribute(
630
+ bitangents,
631
+ bitangent,
632
+ attrIndexOffset
633
+ );
634
+ CorridorGeometryLibrary_default.addAttribute(
635
+ bitangents,
636
+ bitangent,
637
+ attrIndexOffset + 3
638
+ );
639
+ CorridorGeometryLibrary_default.addAttribute(
640
+ bitangents,
641
+ bitangent,
642
+ attrIndex
643
+ );
644
+ CorridorGeometryLibrary_default.addAttribute(
645
+ bitangents,
646
+ bitangent,
647
+ attrIndex + 3
648
+ );
649
+ }
650
+ if (vertexFormat.tangent) {
651
+ tangent = Cartesian3_default.normalize(
652
+ Cartesian3_default.cross(bitangent, normal, tangent),
653
+ tangent
654
+ );
655
+ CorridorGeometryLibrary_default.addAttribute(
656
+ tangents,
657
+ tangent,
658
+ attrIndexOffset
659
+ );
660
+ CorridorGeometryLibrary_default.addAttribute(
661
+ tangents,
662
+ tangent,
663
+ attrIndexOffset + 3
664
+ );
665
+ CorridorGeometryLibrary_default.addAttribute(tangents, tangent, attrIndex);
666
+ CorridorGeometryLibrary_default.addAttribute(
667
+ tangents,
668
+ tangent,
669
+ attrIndex + 3
670
+ );
671
+ }
672
+ }
673
+ attrIndex += 6;
674
+ }
675
+ if (vertexFormat.normal) {
676
+ normals.set(topNormals);
677
+ for (i = 0; i < threeSize; i += 3) {
678
+ normals[i + threeSize] = -topNormals[i];
679
+ normals[i + threeSize + 1] = -topNormals[i + 1];
680
+ normals[i + threeSize + 2] = -topNormals[i + 2];
681
+ }
682
+ attributes.normal.values = normals;
683
+ } else {
684
+ attributes.normal = void 0;
685
+ }
686
+ if (vertexFormat.bitangent) {
687
+ bitangents.set(topBitangents);
688
+ bitangents.set(topBitangents, threeSize);
689
+ attributes.bitangent.values = bitangents;
690
+ } else {
691
+ attributes.bitangent = void 0;
692
+ }
693
+ if (vertexFormat.tangent) {
694
+ const topTangents = attributes.tangent.values;
695
+ tangents.set(topTangents);
696
+ tangents.set(topTangents, threeSize);
697
+ attributes.tangent.values = tangents;
698
+ }
699
+ }
700
+ if (vertexFormat.st) {
701
+ const topSt = attributes.st.values;
702
+ const st = new Float32Array(twoSize * 6);
703
+ st.set(topSt);
704
+ st.set(topSt, twoSize);
705
+ let index = twoSize * 2;
706
+ for (let j = 0; j < 2; j++) {
707
+ st[index++] = topSt[0];
708
+ st[index++] = topSt[1];
709
+ for (i = 2; i < twoSize; i += 2) {
710
+ const s = topSt[i];
711
+ const t = topSt[i + 1];
712
+ st[index++] = s;
713
+ st[index++] = t;
714
+ st[index++] = s;
715
+ st[index++] = t;
716
+ }
717
+ st[index++] = topSt[0];
718
+ st[index++] = topSt[1];
719
+ }
720
+ attributes.st.values = st;
721
+ }
722
+ return attributes;
723
+ }
724
+ function addWallPositions(positions, index, wallPositions) {
725
+ wallPositions[index++] = positions[0];
726
+ wallPositions[index++] = positions[1];
727
+ wallPositions[index++] = positions[2];
728
+ for (let i = 3; i < positions.length; i += 3) {
729
+ const x = positions[i];
730
+ const y = positions[i + 1];
731
+ const z = positions[i + 2];
732
+ wallPositions[index++] = x;
733
+ wallPositions[index++] = y;
734
+ wallPositions[index++] = z;
735
+ wallPositions[index++] = x;
736
+ wallPositions[index++] = y;
737
+ wallPositions[index++] = z;
738
+ }
739
+ wallPositions[index++] = positions[0];
740
+ wallPositions[index++] = positions[1];
741
+ wallPositions[index++] = positions[2];
742
+ return wallPositions;
743
+ }
744
+ function computePositionsExtruded(params, vertexFormat) {
745
+ const topVertexFormat = new VertexFormat_default({
746
+ position: vertexFormat.position,
747
+ normal: vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
748
+ tangent: vertexFormat.tangent,
749
+ bitangent: vertexFormat.normal || vertexFormat.bitangent,
750
+ st: vertexFormat.st
751
+ });
752
+ const ellipsoid = params.ellipsoid;
753
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
754
+ const attr = combine(computedPositions, topVertexFormat, ellipsoid);
755
+ const height = params.height;
756
+ const extrudedHeight = params.extrudedHeight;
757
+ let attributes = attr.attributes;
758
+ const indices = attr.indices;
759
+ let positions = attributes.position.values;
760
+ let length = positions.length;
761
+ const newPositions = new Float64Array(length * 6);
762
+ let extrudedPositions = new Float64Array(length);
763
+ extrudedPositions.set(positions);
764
+ let wallPositions = new Float64Array(length * 4);
765
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
766
+ positions,
767
+ height,
768
+ ellipsoid
769
+ );
770
+ wallPositions = addWallPositions(positions, 0, wallPositions);
771
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
772
+ extrudedPositions,
773
+ extrudedHeight,
774
+ ellipsoid
775
+ );
776
+ wallPositions = addWallPositions(
777
+ extrudedPositions,
778
+ length * 2,
779
+ wallPositions
780
+ );
781
+ newPositions.set(positions);
782
+ newPositions.set(extrudedPositions, length);
783
+ newPositions.set(wallPositions, length * 2);
784
+ attributes.position.values = newPositions;
785
+ attributes = extrudedAttributes(attributes, vertexFormat);
786
+ let i;
787
+ const size = length / 3;
788
+ if (params.shadowVolume) {
789
+ const topNormals = attributes.normal.values;
790
+ length = topNormals.length;
791
+ let extrudeNormals = new Float32Array(length * 6);
792
+ for (i = 0; i < length; i++) {
793
+ topNormals[i] = -topNormals[i];
794
+ }
795
+ extrudeNormals.set(topNormals, length);
796
+ extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals);
797
+ attributes.extrudeDirection = new GeometryAttribute_default({
798
+ componentDatatype: ComponentDatatype_default.FLOAT,
799
+ componentsPerAttribute: 3,
800
+ values: extrudeNormals
801
+ });
802
+ if (!vertexFormat.normal) {
803
+ attributes.normal = void 0;
804
+ }
805
+ }
806
+ if (defined_default(params.offsetAttribute)) {
807
+ let applyOffset = new Uint8Array(size * 6);
808
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
809
+ applyOffset = applyOffset.fill(1, 0, size).fill(1, size * 2, size * 4);
810
+ } else {
811
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
812
+ applyOffset = applyOffset.fill(applyOffsetValue);
813
+ }
814
+ attributes.applyOffset = new GeometryAttribute_default({
815
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
816
+ componentsPerAttribute: 1,
817
+ values: applyOffset
818
+ });
819
+ }
820
+ const iLength = indices.length;
821
+ const twoSize = size + size;
822
+ const newIndices = IndexDatatype_default.createTypedArray(
823
+ newPositions.length / 3,
824
+ iLength * 2 + twoSize * 3
825
+ );
826
+ newIndices.set(indices);
827
+ let index = iLength;
828
+ for (i = 0; i < iLength; i += 3) {
829
+ const v0 = indices[i];
830
+ const v1 = indices[i + 1];
831
+ const v2 = indices[i + 2];
832
+ newIndices[index++] = v2 + size;
833
+ newIndices[index++] = v1 + size;
834
+ newIndices[index++] = v0 + size;
835
+ }
836
+ let UL, LL, UR, LR;
837
+ for (i = 0; i < twoSize; i += 2) {
838
+ UL = i + twoSize;
839
+ LL = UL + twoSize;
840
+ UR = UL + 1;
841
+ LR = LL + 1;
842
+ newIndices[index++] = UL;
843
+ newIndices[index++] = LL;
844
+ newIndices[index++] = UR;
845
+ newIndices[index++] = UR;
846
+ newIndices[index++] = LL;
847
+ newIndices[index++] = LR;
848
+ }
849
+ return {
850
+ attributes,
851
+ indices: newIndices
852
+ };
853
+ }
854
+ var scratchCartesian1 = new Cartesian3_default();
855
+ var scratchCartesian2 = new Cartesian3_default();
856
+ var scratchCartographic = new Cartographic_default();
857
+ function computeOffsetPoints(position1, position2, ellipsoid, halfWidth, min, max) {
858
+ const direction = Cartesian3_default.subtract(
859
+ position2,
860
+ position1,
861
+ scratchCartesian1
862
+ );
863
+ Cartesian3_default.normalize(direction, direction);
864
+ const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
865
+ const offsetDirection = Cartesian3_default.cross(
866
+ direction,
867
+ normal,
868
+ scratchCartesian1
869
+ );
870
+ Cartesian3_default.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
871
+ let minLat = min.latitude;
872
+ let minLon = min.longitude;
873
+ let maxLat = max.latitude;
874
+ let maxLon = max.longitude;
875
+ Cartesian3_default.add(position1, offsetDirection, scratchCartesian2);
876
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
877
+ let lat = scratchCartographic.latitude;
878
+ let lon = scratchCartographic.longitude;
879
+ minLat = Math.min(minLat, lat);
880
+ minLon = Math.min(minLon, lon);
881
+ maxLat = Math.max(maxLat, lat);
882
+ maxLon = Math.max(maxLon, lon);
883
+ Cartesian3_default.subtract(position1, offsetDirection, scratchCartesian2);
884
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
885
+ lat = scratchCartographic.latitude;
886
+ lon = scratchCartographic.longitude;
887
+ minLat = Math.min(minLat, lat);
888
+ minLon = Math.min(minLon, lon);
889
+ maxLat = Math.max(maxLat, lat);
890
+ maxLon = Math.max(maxLon, lon);
891
+ min.latitude = minLat;
892
+ min.longitude = minLon;
893
+ max.latitude = maxLat;
894
+ max.longitude = maxLon;
895
+ }
896
+ var scratchCartesianOffset = new Cartesian3_default();
897
+ var scratchCartesianEnds = new Cartesian3_default();
898
+ var scratchCartographicMin = new Cartographic_default();
899
+ var scratchCartographicMax = new Cartographic_default();
900
+ function computeRectangle(positions, ellipsoid, width, cornerType, result) {
901
+ positions = scaleToSurface(positions, ellipsoid);
902
+ const cleanPositions = arrayRemoveDuplicates_default(
903
+ positions,
904
+ Cartesian3_default.equalsEpsilon
905
+ );
906
+ const length = cleanPositions.length;
907
+ if (length < 2 || width <= 0) {
908
+ return new Rectangle_default();
909
+ }
910
+ const halfWidth = width * 0.5;
911
+ scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
912
+ scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
913
+ scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
914
+ scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
915
+ let lat, lon;
916
+ if (cornerType === CornerType_default.ROUNDED) {
917
+ const first = cleanPositions[0];
918
+ Cartesian3_default.subtract(first, cleanPositions[1], scratchCartesianOffset);
919
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
920
+ Cartesian3_default.multiplyByScalar(
921
+ scratchCartesianOffset,
922
+ halfWidth,
923
+ scratchCartesianOffset
924
+ );
925
+ Cartesian3_default.add(first, scratchCartesianOffset, scratchCartesianEnds);
926
+ ellipsoid.cartesianToCartographic(
927
+ scratchCartesianEnds,
928
+ scratchCartographic
929
+ );
930
+ lat = scratchCartographic.latitude;
931
+ lon = scratchCartographic.longitude;
932
+ scratchCartographicMin.latitude = Math.min(
933
+ scratchCartographicMin.latitude,
934
+ lat
935
+ );
936
+ scratchCartographicMin.longitude = Math.min(
937
+ scratchCartographicMin.longitude,
938
+ lon
939
+ );
940
+ scratchCartographicMax.latitude = Math.max(
941
+ scratchCartographicMax.latitude,
942
+ lat
943
+ );
944
+ scratchCartographicMax.longitude = Math.max(
945
+ scratchCartographicMax.longitude,
946
+ lon
947
+ );
948
+ }
949
+ for (let i = 0; i < length - 1; ++i) {
950
+ computeOffsetPoints(
951
+ cleanPositions[i],
952
+ cleanPositions[i + 1],
953
+ ellipsoid,
954
+ halfWidth,
955
+ scratchCartographicMin,
956
+ scratchCartographicMax
957
+ );
958
+ }
959
+ const last = cleanPositions[length - 1];
960
+ Cartesian3_default.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
961
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
962
+ Cartesian3_default.multiplyByScalar(
963
+ scratchCartesianOffset,
964
+ halfWidth,
965
+ scratchCartesianOffset
966
+ );
967
+ Cartesian3_default.add(last, scratchCartesianOffset, scratchCartesianEnds);
968
+ computeOffsetPoints(
969
+ last,
970
+ scratchCartesianEnds,
971
+ ellipsoid,
972
+ halfWidth,
973
+ scratchCartographicMin,
974
+ scratchCartographicMax
975
+ );
976
+ if (cornerType === CornerType_default.ROUNDED) {
977
+ ellipsoid.cartesianToCartographic(
978
+ scratchCartesianEnds,
979
+ scratchCartographic
980
+ );
981
+ lat = scratchCartographic.latitude;
982
+ lon = scratchCartographic.longitude;
983
+ scratchCartographicMin.latitude = Math.min(
984
+ scratchCartographicMin.latitude,
985
+ lat
986
+ );
987
+ scratchCartographicMin.longitude = Math.min(
988
+ scratchCartographicMin.longitude,
989
+ lon
990
+ );
991
+ scratchCartographicMax.latitude = Math.max(
992
+ scratchCartographicMax.latitude,
993
+ lat
994
+ );
995
+ scratchCartographicMax.longitude = Math.max(
996
+ scratchCartographicMax.longitude,
997
+ lon
998
+ );
999
+ }
1000
+ const rectangle = defined_default(result) ? result : new Rectangle_default();
1001
+ rectangle.north = scratchCartographicMax.latitude;
1002
+ rectangle.south = scratchCartographicMin.latitude;
1003
+ rectangle.east = scratchCartographicMax.longitude;
1004
+ rectangle.west = scratchCartographicMin.longitude;
1005
+ return rectangle;
1006
+ }
1007
+ function CorridorGeometry(options) {
1008
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1009
+ const positions = options.positions;
1010
+ const width = options.width;
1011
+ Check_default.defined("options.positions", positions);
1012
+ Check_default.defined("options.width", width);
1013
+ const height = defaultValue_default(options.height, 0);
1014
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
1015
+ this._positions = positions;
1016
+ this._ellipsoid = Ellipsoid_default.clone(
1017
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.default)
1018
+ );
1019
+ this._vertexFormat = VertexFormat_default.clone(
1020
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
1021
+ );
1022
+ this._width = width;
1023
+ this._height = Math.max(height, extrudedHeight);
1024
+ this._extrudedHeight = Math.min(height, extrudedHeight);
1025
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1026
+ this._granularity = defaultValue_default(
1027
+ options.granularity,
1028
+ Math_default.RADIANS_PER_DEGREE
1029
+ );
1030
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
1031
+ this._workerName = "createCorridorGeometry";
1032
+ this._offsetAttribute = options.offsetAttribute;
1033
+ this._rectangle = void 0;
1034
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
1035
+ }
1036
+ CorridorGeometry.pack = function(value, array, startingIndex) {
1037
+ Check_default.defined("value", value);
1038
+ Check_default.defined("array", array);
1039
+ startingIndex = defaultValue_default(startingIndex, 0);
1040
+ const positions = value._positions;
1041
+ const length = positions.length;
1042
+ array[startingIndex++] = length;
1043
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1044
+ Cartesian3_default.pack(positions[i], array, startingIndex);
1045
+ }
1046
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
1047
+ startingIndex += Ellipsoid_default.packedLength;
1048
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
1049
+ startingIndex += VertexFormat_default.packedLength;
1050
+ array[startingIndex++] = value._width;
1051
+ array[startingIndex++] = value._height;
1052
+ array[startingIndex++] = value._extrudedHeight;
1053
+ array[startingIndex++] = value._cornerType;
1054
+ array[startingIndex++] = value._granularity;
1055
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
1056
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
1057
+ return array;
1058
+ };
1059
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
1060
+ var scratchVertexFormat = new VertexFormat_default();
1061
+ var scratchOptions = {
1062
+ positions: void 0,
1063
+ ellipsoid: scratchEllipsoid,
1064
+ vertexFormat: scratchVertexFormat,
1065
+ width: void 0,
1066
+ height: void 0,
1067
+ extrudedHeight: void 0,
1068
+ cornerType: void 0,
1069
+ granularity: void 0,
1070
+ shadowVolume: void 0,
1071
+ offsetAttribute: void 0
1072
+ };
1073
+ CorridorGeometry.unpack = function(array, startingIndex, result) {
1074
+ Check_default.defined("array", array);
1075
+ startingIndex = defaultValue_default(startingIndex, 0);
1076
+ const length = array[startingIndex++];
1077
+ const positions = new Array(length);
1078
+ for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
1079
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
1080
+ }
1081
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
1082
+ startingIndex += Ellipsoid_default.packedLength;
1083
+ const vertexFormat = VertexFormat_default.unpack(
1084
+ array,
1085
+ startingIndex,
1086
+ scratchVertexFormat
1087
+ );
1088
+ startingIndex += VertexFormat_default.packedLength;
1089
+ const width = array[startingIndex++];
1090
+ const height = array[startingIndex++];
1091
+ const extrudedHeight = array[startingIndex++];
1092
+ const cornerType = array[startingIndex++];
1093
+ const granularity = array[startingIndex++];
1094
+ const shadowVolume = array[startingIndex++] === 1;
1095
+ const offsetAttribute = array[startingIndex];
1096
+ if (!defined_default(result)) {
1097
+ scratchOptions.positions = positions;
1098
+ scratchOptions.width = width;
1099
+ scratchOptions.height = height;
1100
+ scratchOptions.extrudedHeight = extrudedHeight;
1101
+ scratchOptions.cornerType = cornerType;
1102
+ scratchOptions.granularity = granularity;
1103
+ scratchOptions.shadowVolume = shadowVolume;
1104
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1105
+ return new CorridorGeometry(scratchOptions);
1106
+ }
1107
+ result._positions = positions;
1108
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
1109
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
1110
+ result._width = width;
1111
+ result._height = height;
1112
+ result._extrudedHeight = extrudedHeight;
1113
+ result._cornerType = cornerType;
1114
+ result._granularity = granularity;
1115
+ result._shadowVolume = shadowVolume;
1116
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
1117
+ return result;
1118
+ };
1119
+ CorridorGeometry.computeRectangle = function(options, result) {
1120
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
1121
+ const positions = options.positions;
1122
+ const width = options.width;
1123
+ Check_default.defined("options.positions", positions);
1124
+ Check_default.defined("options.width", width);
1125
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.default);
1126
+ const cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
1127
+ return computeRectangle(positions, ellipsoid, width, cornerType, result);
1128
+ };
1129
+ CorridorGeometry.createGeometry = function(corridorGeometry) {
1130
+ let positions = corridorGeometry._positions;
1131
+ const width = corridorGeometry._width;
1132
+ const ellipsoid = corridorGeometry._ellipsoid;
1133
+ positions = scaleToSurface(positions, ellipsoid);
1134
+ const cleanPositions = arrayRemoveDuplicates_default(
1135
+ positions,
1136
+ Cartesian3_default.equalsEpsilon
1137
+ );
1138
+ if (cleanPositions.length < 2 || width <= 0) {
1139
+ return;
1140
+ }
1141
+ const height = corridorGeometry._height;
1142
+ const extrudedHeight = corridorGeometry._extrudedHeight;
1143
+ const extrude = !Math_default.equalsEpsilon(
1144
+ height,
1145
+ extrudedHeight,
1146
+ 0,
1147
+ Math_default.EPSILON2
1148
+ );
1149
+ const vertexFormat = corridorGeometry._vertexFormat;
1150
+ const params = {
1151
+ ellipsoid,
1152
+ positions: cleanPositions,
1153
+ width,
1154
+ cornerType: corridorGeometry._cornerType,
1155
+ granularity: corridorGeometry._granularity,
1156
+ saveAttributes: true
1157
+ };
1158
+ let attr;
1159
+ if (extrude) {
1160
+ params.height = height;
1161
+ params.extrudedHeight = extrudedHeight;
1162
+ params.shadowVolume = corridorGeometry._shadowVolume;
1163
+ params.offsetAttribute = corridorGeometry._offsetAttribute;
1164
+ attr = computePositionsExtruded(params, vertexFormat);
1165
+ } else {
1166
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
1167
+ attr = combine(computedPositions, vertexFormat, ellipsoid);
1168
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
1169
+ attr.attributes.position.values,
1170
+ height,
1171
+ ellipsoid
1172
+ );
1173
+ if (defined_default(corridorGeometry._offsetAttribute)) {
1174
+ const applyOffsetValue = corridorGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
1175
+ const length = attr.attributes.position.values.length;
1176
+ const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
1177
+ attr.attributes.applyOffset = new GeometryAttribute_default({
1178
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
1179
+ componentsPerAttribute: 1,
1180
+ values: applyOffset
1181
+ });
1182
+ }
1183
+ }
1184
+ const attributes = attr.attributes;
1185
+ const boundingSphere = BoundingSphere_default.fromVertices(
1186
+ attributes.position.values,
1187
+ void 0,
1188
+ 3
1189
+ );
1190
+ if (!vertexFormat.position) {
1191
+ attr.attributes.position.values = void 0;
1192
+ }
1193
+ return new Geometry_default({
1194
+ attributes,
1195
+ indices: attr.indices,
1196
+ primitiveType: PrimitiveType_default.TRIANGLES,
1197
+ boundingSphere,
1198
+ offsetAttribute: corridorGeometry._offsetAttribute
1199
+ });
1200
+ };
1201
+ CorridorGeometry.createShadowVolume = function(corridorGeometry, minHeightFunc, maxHeightFunc) {
1202
+ const granularity = corridorGeometry._granularity;
1203
+ const ellipsoid = corridorGeometry._ellipsoid;
1204
+ const minHeight = minHeightFunc(granularity, ellipsoid);
1205
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
1206
+ return new CorridorGeometry({
1207
+ positions: corridorGeometry._positions,
1208
+ width: corridorGeometry._width,
1209
+ cornerType: corridorGeometry._cornerType,
1210
+ ellipsoid,
1211
+ granularity,
1212
+ extrudedHeight: minHeight,
1213
+ height: maxHeight,
1214
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
1215
+ shadowVolume: true
1216
+ });
1217
+ };
1218
+ Object.defineProperties(CorridorGeometry.prototype, {
1219
+ /**
1220
+ * @private
1221
+ */
1222
+ rectangle: {
1223
+ get: function() {
1224
+ if (!defined_default(this._rectangle)) {
1225
+ this._rectangle = computeRectangle(
1226
+ this._positions,
1227
+ this._ellipsoid,
1228
+ this._width,
1229
+ this._cornerType
1230
+ );
1231
+ }
1232
+ return this._rectangle;
1233
+ }
1234
+ },
1235
+ /**
1236
+ * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
1237
+ *
1238
+ * Corridors don't support stRotation,
1239
+ * so just return the corners of the original system.
1240
+ * @private
1241
+ */
1242
+ textureCoordinateRotationPoints: {
1243
+ get: function() {
1244
+ return [0, 0, 0, 1, 1, 0];
1245
+ }
1246
+ }
1247
+ });
1248
+ var CorridorGeometry_default = CorridorGeometry;
1249
+
1250
+ // packages/engine/Source/Workers/createCorridorGeometry.js
1251
+ function createCorridorGeometry(corridorGeometry, offset) {
1252
+ if (defined_default(offset)) {
1253
+ corridorGeometry = CorridorGeometry_default.unpack(corridorGeometry, offset);
1254
+ }
1255
+ corridorGeometry._ellipsoid = Ellipsoid_default.clone(corridorGeometry._ellipsoid);
1256
+ return CorridorGeometry_default.createGeometry(corridorGeometry);
1257
+ }
1258
+ var createCorridorGeometry_default = createCorridorGeometry;
1259
+ export {
1260
+ createCorridorGeometry_default as default
1261
+ };