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