@pggis/pg-sdk 3.2.9

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