@cesium/engine 26.2.0 → 26.3.1-wasm.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 (393) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +707 -600
  2. package/Build/Workers/chunk-2P3WKV6V.js +290 -0
  3. package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
  4. package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
  5. package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
  6. package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
  7. package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
  8. package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
  9. package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
  10. package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
  11. package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
  12. package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
  13. package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
  14. package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
  15. package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
  16. package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
  17. package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
  18. package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
  19. package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
  20. package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
  21. package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
  22. package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
  23. package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
  24. package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
  25. package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
  26. package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
  27. package/Build/Workers/chunk-NYKURYFR.js +2131 -0
  28. package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
  29. package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
  30. package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
  31. package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
  32. package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
  33. package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
  34. package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
  35. package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
  36. package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
  37. package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
  38. package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
  39. package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
  40. package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
  41. package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
  42. package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
  43. package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
  44. package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
  45. package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
  46. package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
  47. package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
  48. package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
  49. package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
  50. package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
  51. package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
  52. package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
  53. package/Build/Workers/chunk-YUICDZKO.js +2660 -0
  54. package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
  55. package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
  56. package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
  57. package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
  58. package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
  59. package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
  60. package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
  61. package/Build/Workers/combineGeometry.js +24 -24
  62. package/Build/Workers/createBoxGeometry.js +18 -18
  63. package/Build/Workers/createBoxOutlineGeometry.js +20 -19
  64. package/Build/Workers/createCircleGeometry.js +28 -27
  65. package/Build/Workers/createCircleOutlineGeometry.js +21 -20
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
  68. package/Build/Workers/createCorridorGeometry.js +31 -31
  69. package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
  70. package/Build/Workers/createCylinderGeometry.js +20 -20
  71. package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
  72. package/Build/Workers/createEllipseGeometry.js +26 -26
  73. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  74. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  76. package/Build/Workers/createFrustumGeometry.js +18 -18
  77. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  78. package/Build/Workers/createGeometry.js +27 -26
  79. package/Build/Workers/createGroundPolylineGeometry.js +27 -26
  80. package/Build/Workers/createPlaneGeometry.js +18 -17
  81. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  82. package/Build/Workers/createPolygonGeometry.js +35 -35
  83. package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
  84. package/Build/Workers/createPolylineGeometry.js +28 -29
  85. package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
  87. package/Build/Workers/createRectangleGeometry.js +30 -30
  88. package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
  89. package/Build/Workers/createSimplePolylineGeometry.js +26 -27
  90. package/Build/Workers/createSphereGeometry.js +19 -19
  91. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  92. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  93. package/Build/Workers/createVectorTileClampedPolylines.js +17 -16
  94. package/Build/Workers/createVectorTileGeometries.js +24 -24
  95. package/Build/Workers/createVectorTilePoints.js +13 -13
  96. package/Build/Workers/createVectorTilePolygons.js +22 -22
  97. package/Build/Workers/createVectorTilePolylines.js +17 -16
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
  100. package/Build/Workers/createVerticesFromHeightmap.js +24 -25
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  102. package/Build/Workers/createWallGeometry.js +27 -28
  103. package/Build/Workers/createWallOutlineGeometry.js +26 -27
  104. package/Build/Workers/decodeDraco.js +16 -12
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
  106. package/Build/Workers/decodeI3S.js +17 -12
  107. package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
  108. package/Build/Workers/decodeSpz.js +1960 -0
  109. package/Build/Workers/gaussianSplatSorter.js +13 -6
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
  112. package/Build/Workers/transcodeKTX2.js +26 -12
  113. package/Build/Workers/transferTypedArrayTest.js +1 -1
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  116. package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
  117. package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/IonResource.js +5 -0
  120. package/Source/Core/IonSnapGeometryType.js +59 -0
  121. package/Source/Core/IonSnapHeat.js +33 -0
  122. package/Source/Core/IonSnapMode.js +45 -0
  123. package/Source/Core/IonSnapParentGeometryType.js +52 -0
  124. package/Source/Core/IonSnapService.js +369 -0
  125. package/Source/Core/KTX2Transcoder.js +99 -5
  126. package/Source/Core/Resource.js +2 -0
  127. package/Source/Core/SnapService.js +63 -0
  128. package/Source/Core/TaskProcessor.js +249 -129
  129. package/Source/Core/TrustedServers.js +34 -1
  130. package/Source/Core/VectorPipeline.js +139 -45
  131. package/Source/Core/VectorProvider.js +311 -71
  132. package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
  133. package/Source/Core/fetchWebAssemblyBinary.js +52 -0
  134. package/Source/Renderer/AutomaticUniforms.js +44 -2
  135. package/Source/Renderer/ShaderBuilder.js +1 -1
  136. package/Source/Renderer/UniformState.js +47 -1
  137. package/Source/Scene/ArcGisMapService.js +1 -1
  138. package/Source/Scene/BufferPointCollection.js +4 -7
  139. package/Source/Scene/BufferPolygonCollection.js +56 -27
  140. package/Source/Scene/BufferPolylineCollection.js +61 -8
  141. package/Source/Scene/BufferPolylineMaterial.js +6 -5
  142. package/Source/Scene/BufferPrimitiveCollection.js +199 -29
  143. package/Source/Scene/Cesium3DTile.js +12 -0
  144. package/Source/Scene/Cesium3DTileset.js +61 -8
  145. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
  146. package/Source/Scene/Cesium3DTilesetCache.js +15 -0
  147. package/Source/Scene/ClippingPolygon.js +154 -100
  148. package/Source/Scene/ClippingPolygonCollection.js +352 -694
  149. package/Source/Scene/CreditDisplay.js +62 -0
  150. package/Source/Scene/GaussianSplatPrimitive.js +153 -66
  151. package/Source/Scene/GeoJsonPrimitive.js +114 -24
  152. package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
  153. package/Source/Scene/GlobeSurfaceTile.js +14 -1
  154. package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
  155. package/Source/Scene/GltfBufferViewLoader.js +25 -13
  156. package/Source/Scene/GltfLoader.js +56 -6
  157. package/Source/Scene/GltfSpzLoader.js +5 -4
  158. package/Source/Scene/HeightReference.js +1 -1
  159. package/Source/Scene/MVTDataProvider.js +9 -0
  160. package/Source/Scene/Model/Model.js +242 -16
  161. package/Source/Scene/Model/Model3DTileContent.js +5 -0
  162. package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
  163. package/Source/Scene/Model/ModelRenderResources.js +2 -3
  164. package/Source/Scene/Model/ModelSceneGraph.js +10 -1
  165. package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
  166. package/Source/Scene/Model/PickingPipelineStage.js +4 -0
  167. package/Source/Scene/PostProcessStage.js +22 -3
  168. package/Source/Scene/Scene.js +56 -1
  169. package/Source/Scene/Snapping.js +57 -0
  170. package/Source/Scene/SpzDecoder.js +106 -0
  171. package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
  172. package/Source/Scene/VectorGltf3DTileContent.js +10 -2
  173. package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
  174. package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
  175. package/Source/Scene/renderBufferPolylineCollection.js +5 -1
  176. package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
  177. package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
  178. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
  179. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
  180. package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
  181. package/Source/Shaders/GlobeFS.glsl +10 -9
  182. package/Source/Shaders/GlobeFS.js +11 -9
  183. package/Source/Shaders/GlobeVS.glsl +0 -32
  184. package/Source/Shaders/GlobeVS.js +0 -32
  185. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
  186. package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
  187. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
  188. package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
  189. package/Source/Shaders/Model/ModelFS.glsl +4 -0
  190. package/Source/Shaders/Model/ModelFS.js +4 -0
  191. package/Source/Shaders/Model/ModelVS.glsl +7 -2
  192. package/Source/Shaders/Model/ModelVS.js +7 -2
  193. package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
  194. package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
  195. package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
  196. package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
  197. package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
  198. package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
  199. package/Source/Shaders/VectorCommon.glsl +177 -50
  200. package/Source/Shaders/VectorCommon.js +251 -19
  201. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
  202. package/Source/ThirdParty/zip-module.wasm +0 -0
  203. package/Source/Workers/createTaskProcessorWorker.js +2 -0
  204. package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
  205. package/Source/Workers/decodeDraco.js +7 -3
  206. package/Source/Workers/decodeI3S.js +7 -3
  207. package/Source/Workers/decodeMeshopt.js +21 -0
  208. package/Source/Workers/decodeSpz.js +20 -0
  209. package/Source/Workers/gaussianSplatSorter.js +7 -3
  210. package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
  211. package/Source/Workers/transcodeKTX2.js +22 -5
  212. package/index.d.ts +649 -55
  213. package/index.js +23 -13
  214. package/package.json +6 -6
  215. package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
  216. package/Build/Workers/chunk-2H5264K7.js +0 -1284
  217. package/Build/Workers/chunk-2H73KDBM.js +0 -511
  218. package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
  219. package/Build/Workers/chunk-36NI5E6W.js +0 -3820
  220. package/Build/Workers/chunk-37SW7SYS.js +0 -778
  221. package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
  222. package/Build/Workers/chunk-3LB4UVPU.js +0 -387
  223. package/Build/Workers/chunk-3PONLKEL.js +0 -778
  224. package/Build/Workers/chunk-3QR662HH.js +0 -3820
  225. package/Build/Workers/chunk-3SX2WYSO.js +0 -973
  226. package/Build/Workers/chunk-3UDN6LYX.js +0 -476
  227. package/Build/Workers/chunk-47MCBSXI.js +0 -9237
  228. package/Build/Workers/chunk-4E626OCE.js +0 -1067
  229. package/Build/Workers/chunk-4NW2MJKH.js +0 -455
  230. package/Build/Workers/chunk-52YK5BSN.js +0 -198
  231. package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
  232. package/Build/Workers/chunk-5YPQBFRD.js +0 -519
  233. package/Build/Workers/chunk-6FHT43QR.js +0 -140
  234. package/Build/Workers/chunk-6HK6IXK2.js +0 -138
  235. package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
  236. package/Build/Workers/chunk-7A2OGDHT.js +0 -305
  237. package/Build/Workers/chunk-7CGEQUM2.js +0 -305
  238. package/Build/Workers/chunk-7D2HZKH7.js +0 -455
  239. package/Build/Workers/chunk-7I325HV6.js +0 -1344
  240. package/Build/Workers/chunk-7KVKHY7O.js +0 -147
  241. package/Build/Workers/chunk-7TKLTCZW.js +0 -219
  242. package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
  243. package/Build/Workers/chunk-7W6DUHAB.js +0 -693
  244. package/Build/Workers/chunk-7XM5JK5F.js +0 -162
  245. package/Build/Workers/chunk-7YG3ND3P.js +0 -454
  246. package/Build/Workers/chunk-A3O6EDBK.js +0 -73
  247. package/Build/Workers/chunk-A6X24AZI.js +0 -1992
  248. package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
  249. package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
  250. package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
  251. package/Build/Workers/chunk-AHWAZRBV.js +0 -82
  252. package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
  253. package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
  254. package/Build/Workers/chunk-BKPQFCXH.js +0 -511
  255. package/Build/Workers/chunk-BSPCI2LO.js +0 -959
  256. package/Build/Workers/chunk-BUJWSX5S.js +0 -301
  257. package/Build/Workers/chunk-C7JQVRLM.js +0 -497
  258. package/Build/Workers/chunk-C7QDUNI3.js +0 -138
  259. package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
  260. package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
  261. package/Build/Workers/chunk-CLCTQVVL.js +0 -241
  262. package/Build/Workers/chunk-CQNFIAZU.js +0 -56
  263. package/Build/Workers/chunk-DBD5WWG2.js +0 -959
  264. package/Build/Workers/chunk-DZBQUULR.js +0 -138
  265. package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
  266. package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
  267. package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
  268. package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
  269. package/Build/Workers/chunk-ELE6SC2C.js +0 -837
  270. package/Build/Workers/chunk-ENNFMWDW.js +0 -789
  271. package/Build/Workers/chunk-EOWDZN5S.js +0 -288
  272. package/Build/Workers/chunk-ERKUET22.js +0 -3201
  273. package/Build/Workers/chunk-F2IMBMZY.js +0 -241
  274. package/Build/Workers/chunk-F4CSNRZO.js +0 -219
  275. package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
  276. package/Build/Workers/chunk-FDK4K5IA.js +0 -280
  277. package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
  278. package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
  279. package/Build/Workers/chunk-FQ42MT7M.js +0 -58
  280. package/Build/Workers/chunk-GGNWQWSB.js +0 -301
  281. package/Build/Workers/chunk-GNKXEN4C.js +0 -682
  282. package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
  283. package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
  284. package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
  285. package/Build/Workers/chunk-H2WCFXLP.js +0 -241
  286. package/Build/Workers/chunk-HHV3MCGV.js +0 -162
  287. package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
  288. package/Build/Workers/chunk-HS6AD4P2.js +0 -398
  289. package/Build/Workers/chunk-HT6FASOT.js +0 -973
  290. package/Build/Workers/chunk-IDVHUDZT.js +0 -352
  291. package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
  292. package/Build/Workers/chunk-ILME5BXA.js +0 -301
  293. package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
  294. package/Build/Workers/chunk-IUIFLOYO.js +0 -44
  295. package/Build/Workers/chunk-J73T2VOY.js +0 -171
  296. package/Build/Workers/chunk-JALGQYDY.js +0 -288
  297. package/Build/Workers/chunk-JW6OZT4R.js +0 -288
  298. package/Build/Workers/chunk-JXYLJCTC.js +0 -124
  299. package/Build/Workers/chunk-K27QOAW6.js +0 -97
  300. package/Build/Workers/chunk-KMV25A63.js +0 -789
  301. package/Build/Workers/chunk-KZWFWJML.js +0 -2719
  302. package/Build/Workers/chunk-LCXRRALY.js +0 -387
  303. package/Build/Workers/chunk-LD64RPYV.js +0 -368
  304. package/Build/Workers/chunk-LGNDTZVX.js +0 -97
  305. package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
  306. package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
  307. package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
  308. package/Build/Workers/chunk-MEENMEAH.js +0 -198
  309. package/Build/Workers/chunk-NAWU5RF4.js +0 -162
  310. package/Build/Workers/chunk-NIWITKQK.js +0 -693
  311. package/Build/Workers/chunk-OA6MYL2C.js +0 -837
  312. package/Build/Workers/chunk-OBEU25PI.js +0 -1067
  313. package/Build/Workers/chunk-OHP4ELS7.js +0 -198
  314. package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
  315. package/Build/Workers/chunk-PD4GK4EM.js +0 -57
  316. package/Build/Workers/chunk-PEDU33QG.js +0 -2342
  317. package/Build/Workers/chunk-PVTSNNVI.js +0 -288
  318. package/Build/Workers/chunk-QHPZH22L.js +0 -241
  319. package/Build/Workers/chunk-QIZDWZK6.js +0 -301
  320. package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
  321. package/Build/Workers/chunk-QVLAFFJY.js +0 -56
  322. package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
  323. package/Build/Workers/chunk-R4K7EHOU.js +0 -171
  324. package/Build/Workers/chunk-R7JGHDD6.js +0 -789
  325. package/Build/Workers/chunk-RASQEYD4.js +0 -1483
  326. package/Build/Workers/chunk-RG4F5R57.js +0 -454
  327. package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
  328. package/Build/Workers/chunk-RYSQVJR6.js +0 -398
  329. package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
  330. package/Build/Workers/chunk-SDFHDNS4.js +0 -147
  331. package/Build/Workers/chunk-SF6K72D7.js +0 -124
  332. package/Build/Workers/chunk-SGRGNDOD.js +0 -682
  333. package/Build/Workers/chunk-SM2CDCYF.js +0 -198
  334. package/Build/Workers/chunk-SS5ABQGY.js +0 -102
  335. package/Build/Workers/chunk-T5QBPLE3.js +0 -414
  336. package/Build/Workers/chunk-TN35HP5B.js +0 -1067
  337. package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
  338. package/Build/Workers/chunk-TOAF47AQ.js +0 -102
  339. package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
  340. package/Build/Workers/chunk-TSDSILQB.js +0 -124
  341. package/Build/Workers/chunk-TVZD72WJ.js +0 -778
  342. package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
  343. package/Build/Workers/chunk-UEY73NRN.js +0 -38
  344. package/Build/Workers/chunk-UF46SZEZ.js +0 -789
  345. package/Build/Workers/chunk-UNRTMCET.js +0 -398
  346. package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
  347. package/Build/Workers/chunk-UVO6COT2.js +0 -352
  348. package/Build/Workers/chunk-V46YGZE6.js +0 -352
  349. package/Build/Workers/chunk-VAL7DYNR.js +0 -278
  350. package/Build/Workers/chunk-VDGOCROW.js +0 -57
  351. package/Build/Workers/chunk-VFWSSBPT.js +0 -511
  352. package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
  353. package/Build/Workers/chunk-VXWHPYQM.js +0 -837
  354. package/Build/Workers/chunk-VXYUBRSB.js +0 -219
  355. package/Build/Workers/chunk-VZLDLEWI.js +0 -387
  356. package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
  357. package/Build/Workers/chunk-WBSY7HDY.js +0 -837
  358. package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
  359. package/Build/Workers/chunk-WPRUWXGV.js +0 -693
  360. package/Build/Workers/chunk-WTO2ERBP.js +0 -414
  361. package/Build/Workers/chunk-WVHMDVG4.js +0 -959
  362. package/Build/Workers/chunk-XGA23TAX.js +0 -73
  363. package/Build/Workers/chunk-XLQZNQ4Z.js +0 -163
  364. package/Build/Workers/chunk-XLXSDIP5.js +0 -973
  365. package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
  366. package/Build/Workers/chunk-XQH66YJC.js +0 -147
  367. package/Build/Workers/chunk-XTA7BXJG.js +0 -682
  368. package/Build/Workers/chunk-XTIDAFRS.js +0 -476
  369. package/Build/Workers/chunk-XUEDWBUD.js +0 -682
  370. package/Build/Workers/chunk-XYFLRH3H.js +0 -124
  371. package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
  372. package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
  373. package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
  374. package/Build/Workers/chunk-YEYOSTJX.js +0 -219
  375. package/Build/Workers/chunk-YGFVAGYF.js +0 -630
  376. package/Build/Workers/chunk-YIIACKQO.js +0 -368
  377. package/Build/Workers/chunk-YJGSP6PE.js +0 -511
  378. package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
  379. package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
  380. package/Build/Workers/chunk-Z66EVE2A.js +0 -44
  381. package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
  382. package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
  383. package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
  384. package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
  385. package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
  386. package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
  387. package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
  388. package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
  389. package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
  390. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
  391. package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
  392. package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
  393. package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
@@ -1,1992 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.143.0
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
- Cartesian3_default
28
- } from "./chunk-PEDU33QG.js";
29
- import {
30
- Math_default
31
- } from "./chunk-C7JQVRLM.js";
32
- import {
33
- Check_default,
34
- DeveloperError_default
35
- } from "./chunk-6YR6JBMY.js";
36
- import {
37
- __publicField,
38
- defined_default
39
- } from "./chunk-AHWAZRBV.js";
40
-
41
- // packages/engine/Source/Core/scaleToGeodeticSurface.js
42
- var scaleToGeodeticSurfaceIntersection = new Cartesian3_default();
43
- var scaleToGeodeticSurfaceGradient = new Cartesian3_default();
44
- function scaleToGeodeticSurface(cartesian, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, result) {
45
- if (!defined_default(cartesian)) {
46
- throw new DeveloperError_default("cartesian is required.");
47
- }
48
- if (!defined_default(oneOverRadii)) {
49
- throw new DeveloperError_default("oneOverRadii is required.");
50
- }
51
- if (!defined_default(oneOverRadiiSquared)) {
52
- throw new DeveloperError_default("oneOverRadiiSquared is required.");
53
- }
54
- if (!defined_default(centerToleranceSquared)) {
55
- throw new DeveloperError_default("centerToleranceSquared is required.");
56
- }
57
- const positionX = cartesian.x;
58
- const positionY = cartesian.y;
59
- const positionZ = cartesian.z;
60
- const oneOverRadiiX = oneOverRadii.x;
61
- const oneOverRadiiY = oneOverRadii.y;
62
- const oneOverRadiiZ = oneOverRadii.z;
63
- const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
64
- const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
65
- const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
66
- const squaredNorm = x2 + y2 + z2;
67
- const ratio = Math.sqrt(1 / squaredNorm);
68
- const intersection = Cartesian3_default.multiplyByScalar(
69
- cartesian,
70
- ratio,
71
- scaleToGeodeticSurfaceIntersection
72
- );
73
- if (squaredNorm < centerToleranceSquared) {
74
- return !isFinite(ratio) ? void 0 : Cartesian3_default.clone(intersection, result);
75
- }
76
- const oneOverRadiiSquaredX = oneOverRadiiSquared.x;
77
- const oneOverRadiiSquaredY = oneOverRadiiSquared.y;
78
- const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
79
- const gradient = scaleToGeodeticSurfaceGradient;
80
- gradient.x = intersection.x * oneOverRadiiSquaredX * 2;
81
- gradient.y = intersection.y * oneOverRadiiSquaredY * 2;
82
- gradient.z = intersection.z * oneOverRadiiSquaredZ * 2;
83
- let lambda = (1 - ratio) * Cartesian3_default.magnitude(cartesian) / (0.5 * Cartesian3_default.magnitude(gradient));
84
- let correction = 0;
85
- let func;
86
- let denominator;
87
- let xMultiplier;
88
- let yMultiplier;
89
- let zMultiplier;
90
- let xMultiplier2;
91
- let yMultiplier2;
92
- let zMultiplier2;
93
- let xMultiplier3;
94
- let yMultiplier3;
95
- let zMultiplier3;
96
- do {
97
- lambda -= correction;
98
- xMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredX);
99
- yMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredY);
100
- zMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredZ);
101
- xMultiplier2 = xMultiplier * xMultiplier;
102
- yMultiplier2 = yMultiplier * yMultiplier;
103
- zMultiplier2 = zMultiplier * zMultiplier;
104
- xMultiplier3 = xMultiplier2 * xMultiplier;
105
- yMultiplier3 = yMultiplier2 * yMultiplier;
106
- zMultiplier3 = zMultiplier2 * zMultiplier;
107
- func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1;
108
- denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;
109
- const derivative = -2 * denominator;
110
- correction = func / derivative;
111
- } while (Math.abs(func) > Math_default.EPSILON12);
112
- if (!defined_default(result)) {
113
- return new Cartesian3_default(
114
- positionX * xMultiplier,
115
- positionY * yMultiplier,
116
- positionZ * zMultiplier
117
- );
118
- }
119
- result.x = positionX * xMultiplier;
120
- result.y = positionY * yMultiplier;
121
- result.z = positionZ * zMultiplier;
122
- return result;
123
- }
124
- var scaleToGeodeticSurface_default = scaleToGeodeticSurface;
125
-
126
- // packages/engine/Source/Core/Cartographic.js
127
- var _Cartographic = class _Cartographic {
128
- /**
129
- * @param {number} [longitude=0.0] The longitude, in radians.
130
- * @param {number} [latitude=0.0] The latitude, in radians.
131
- * @param {number} [height=0.0] The height, in meters, above the ellipsoid.
132
- */
133
- constructor(longitude, latitude, height) {
134
- this.longitude = longitude ?? 0;
135
- this.latitude = latitude ?? 0;
136
- this.height = height ?? 0;
137
- }
138
- /**
139
- * Creates a new Cartographic instance from longitude and latitude
140
- * specified in radians.
141
- *
142
- * @param {number} longitude The longitude, in radians.
143
- * @param {number} latitude The latitude, in radians.
144
- * @param {number} [height=0.0] The height, in meters, above the ellipsoid.
145
- * @param {Cartographic} [result] The object onto which to store the result.
146
- * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
147
- */
148
- static fromRadians(longitude, latitude, height, result) {
149
- Check_default.typeOf.number("longitude", longitude);
150
- Check_default.typeOf.number("latitude", latitude);
151
- height = height ?? 0;
152
- if (!defined_default(result)) {
153
- return new _Cartographic(longitude, latitude, height);
154
- }
155
- result.longitude = longitude;
156
- result.latitude = latitude;
157
- result.height = height;
158
- return result;
159
- }
160
- /**
161
- * Creates a new Cartographic instance from longitude and latitude
162
- * specified in degrees. The values in the resulting object will
163
- * be in radians.
164
- *
165
- * @param {number} longitude The longitude, in degrees.
166
- * @param {number} latitude The latitude, in degrees.
167
- * @param {number} [height=0.0] The height, in meters, above the ellipsoid.
168
- * @param {Cartographic} [result] The object onto which to store the result.
169
- * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
170
- */
171
- static fromDegrees(longitude, latitude, height, result) {
172
- Check_default.typeOf.number("longitude", longitude);
173
- Check_default.typeOf.number("latitude", latitude);
174
- longitude = Math_default.toRadians(longitude);
175
- latitude = Math_default.toRadians(latitude);
176
- return _Cartographic.fromRadians(longitude, latitude, height, result);
177
- }
178
- /**
179
- * Creates a new Cartographic instance from a Cartesian position. The values in the
180
- * resulting object will be in radians.
181
- *
182
- * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
183
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.
184
- * @param {Cartographic} [result] The object onto which to store the result.
185
- * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
186
- */
187
- static fromCartesian(cartesian, ellipsoid, result) {
188
- const oneOverRadii = defined_default(ellipsoid) ? ellipsoid.oneOverRadii : _Cartographic._ellipsoidOneOverRadii;
189
- const oneOverRadiiSquared = defined_default(ellipsoid) ? ellipsoid.oneOverRadiiSquared : _Cartographic._ellipsoidOneOverRadiiSquared;
190
- const centerToleranceSquared = defined_default(ellipsoid) ? ellipsoid._centerToleranceSquared : _Cartographic._ellipsoidCenterToleranceSquared;
191
- const p = scaleToGeodeticSurface_default(
192
- cartesian,
193
- oneOverRadii,
194
- oneOverRadiiSquared,
195
- centerToleranceSquared,
196
- cartesianToCartographicP
197
- );
198
- if (!defined_default(p)) {
199
- return void 0;
200
- }
201
- let n = Cartesian3_default.multiplyComponents(
202
- p,
203
- oneOverRadiiSquared,
204
- cartesianToCartographicN
205
- );
206
- n = Cartesian3_default.normalize(n, n);
207
- const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH);
208
- const longitude = Math.atan2(n.y, n.x);
209
- const latitude = Math.asin(n.z);
210
- const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
211
- if (!defined_default(result)) {
212
- return new _Cartographic(longitude, latitude, height);
213
- }
214
- result.longitude = longitude;
215
- result.latitude = latitude;
216
- result.height = height;
217
- return result;
218
- }
219
- /**
220
- * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
221
- * object should be in radians.
222
- *
223
- * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.
224
- * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the position lies.
225
- * @param {Cartesian3} [result] The object onto which to store the result.
226
- * @returns {Cartesian3} The position
227
- */
228
- static toCartesian(cartographic, ellipsoid, result) {
229
- Check_default.defined("cartographic", cartographic);
230
- return Cartesian3_default.fromRadians(
231
- cartographic.longitude,
232
- cartographic.latitude,
233
- cartographic.height,
234
- ellipsoid,
235
- result
236
- );
237
- }
238
- /**
239
- * Duplicates a Cartographic instance.
240
- *
241
- * @param {Cartographic} cartographic The cartographic to duplicate.
242
- * @param {Cartographic} [result] The object onto which to store the result.
243
- * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
244
- */
245
- static clone(cartographic, result) {
246
- if (!defined_default(cartographic)) {
247
- return void 0;
248
- }
249
- if (!defined_default(result)) {
250
- return new _Cartographic(
251
- cartographic.longitude,
252
- cartographic.latitude,
253
- cartographic.height
254
- );
255
- }
256
- result.longitude = cartographic.longitude;
257
- result.latitude = cartographic.latitude;
258
- result.height = cartographic.height;
259
- return result;
260
- }
261
- /**
262
- * Compares the provided cartographics componentwise and returns
263
- * <code>true</code> if they are equal, <code>false</code> otherwise.
264
- *
265
- * @param {Cartographic} [left] The first cartographic.
266
- * @param {Cartographic} [right] The second cartographic.
267
- * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
268
- */
269
- static equals(left, right) {
270
- return left === right || defined_default(left) && defined_default(right) && left.longitude === right.longitude && left.latitude === right.latitude && left.height === right.height;
271
- }
272
- /**
273
- * Compares the provided cartographics componentwise and returns
274
- * <code>true</code> if they are within the provided epsilon,
275
- * <code>false</code> otherwise.
276
- *
277
- * @param {Cartographic} [left] The first cartographic.
278
- * @param {Cartographic} [right] The second cartographic.
279
- * @param {number} [epsilon=0] The epsilon to use for equality testing.
280
- * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
281
- */
282
- static equalsEpsilon(left, right, epsilon) {
283
- epsilon = epsilon ?? 0;
284
- return left === right || defined_default(left) && defined_default(right) && Math.abs(left.longitude - right.longitude) <= epsilon && Math.abs(left.latitude - right.latitude) <= epsilon && Math.abs(left.height - right.height) <= epsilon;
285
- }
286
- /**
287
- * Duplicates this instance.
288
- *
289
- * @param {Cartographic} [result] The object onto which to store the result.
290
- * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
291
- */
292
- clone(result) {
293
- return _Cartographic.clone(this, result);
294
- }
295
- /**
296
- * Compares the provided against this cartographic componentwise and returns
297
- * <code>true</code> if they are equal, <code>false</code> otherwise.
298
- *
299
- * @param {Cartographic} [right] The second cartographic.
300
- * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
301
- */
302
- equals(right) {
303
- return _Cartographic.equals(this, right);
304
- }
305
- /**
306
- * Compares the provided against this cartographic componentwise and returns
307
- * <code>true</code> if they are within the provided epsilon,
308
- * <code>false</code> otherwise.
309
- *
310
- * @param {Cartographic} [right] The second cartographic.
311
- * @param {number} [epsilon=0] The epsilon to use for equality testing.
312
- * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
313
- */
314
- equalsEpsilon(right, epsilon) {
315
- return _Cartographic.equalsEpsilon(this, right, epsilon);
316
- }
317
- /**
318
- * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
319
- *
320
- * @returns {string} A string representing the provided cartographic in the format '(longitude, latitude, height)'.
321
- */
322
- toString() {
323
- return `(${this.longitude}, ${this.latitude}, ${this.height})`;
324
- }
325
- };
326
- // To avoid circular dependencies, these are set by Ellipsoid when Ellipsoid.default is set.
327
- __publicField(_Cartographic, "_ellipsoidOneOverRadii", new Cartesian3_default(
328
- 1 / 6378137,
329
- 1 / 6378137,
330
- 1 / 6356752314245179e-9
331
- ));
332
- __publicField(_Cartographic, "_ellipsoidOneOverRadiiSquared", new Cartesian3_default(
333
- 1 / (6378137 * 6378137),
334
- 1 / (6378137 * 6378137),
335
- 1 / (6356752314245179e-9 * 6356752314245179e-9)
336
- ));
337
- __publicField(_Cartographic, "_ellipsoidCenterToleranceSquared", Math_default.EPSILON1);
338
- var Cartographic = _Cartographic;
339
- Cartographic.ZERO = Object.freeze(new Cartographic(0, 0, 0));
340
- var cartesianToCartographicN = new Cartesian3_default();
341
- var cartesianToCartographicP = new Cartesian3_default();
342
- var cartesianToCartographicH = new Cartesian3_default();
343
- var Cartographic_default = Cartographic;
344
-
345
- // packages/engine/Source/Core/Cartesian2.js
346
- var Cartesian2 = class _Cartesian2 {
347
- /**
348
- * @param {number} [x=0.0] The X component.
349
- * @param {number} [y=0.0] The Y component.
350
- */
351
- constructor(x, y) {
352
- this.x = x ?? 0;
353
- this.y = y ?? 0;
354
- }
355
- /**
356
- * Creates a Cartesian2 instance from x and y coordinates.
357
- *
358
- * @param {number} x The x coordinate.
359
- * @param {number} y The y coordinate.
360
- * @param {Cartesian2} [result] The object onto which to store the result.
361
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
362
- */
363
- static fromElements(x, y, result) {
364
- if (!defined_default(result)) {
365
- return new _Cartesian2(x, y);
366
- }
367
- result.x = x;
368
- result.y = y;
369
- return result;
370
- }
371
- /**
372
- * Duplicates a Cartesian2 instance.
373
- *
374
- * @param {Cartesian2} cartesian The Cartesian to duplicate.
375
- * @param {Cartesian2} [result] The object onto which to store the result.
376
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
377
- */
378
- static clone(cartesian, result) {
379
- if (!defined_default(cartesian)) {
380
- return void 0;
381
- }
382
- if (!defined_default(result)) {
383
- return new _Cartesian2(cartesian.x, cartesian.y);
384
- }
385
- result.x = cartesian.x;
386
- result.y = cartesian.y;
387
- return result;
388
- }
389
- /**
390
- * Stores the provided instance into the provided array.
391
- *
392
- * @param {Cartesian2} value The value to pack.
393
- * @param {number[]} array The array to pack into.
394
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
395
- *
396
- * @returns {number[]} The array that was packed into
397
- */
398
- static pack(value, array, startingIndex) {
399
- Check_default.typeOf.object("value", value);
400
- Check_default.defined("array", array);
401
- startingIndex = startingIndex ?? 0;
402
- array[startingIndex++] = value.x;
403
- array[startingIndex] = value.y;
404
- return array;
405
- }
406
- /**
407
- * Retrieves an instance from a packed array.
408
- *
409
- * @param {number[]} array The packed array.
410
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
411
- * @param {Cartesian2} [result] The object into which to store the result.
412
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
413
- */
414
- static unpack(array, startingIndex, result) {
415
- Check_default.defined("array", array);
416
- startingIndex = startingIndex ?? 0;
417
- if (!defined_default(result)) {
418
- result = new _Cartesian2();
419
- }
420
- result.x = array[startingIndex++];
421
- result.y = array[startingIndex];
422
- return result;
423
- }
424
- /**
425
- * Flattens an array of Cartesian2s into an array of components.
426
- *
427
- * @param {Cartesian2[]} array The array of cartesians to pack.
428
- * @param {number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.
429
- * @returns {number[]} The packed array.
430
- */
431
- static packArray(array, result) {
432
- Check_default.defined("array", array);
433
- const length = array.length;
434
- const resultLength = length * 2;
435
- if (!defined_default(result)) {
436
- result = new Array(resultLength);
437
- } else if (!Array.isArray(result) && result.length !== resultLength) {
438
- throw new DeveloperError_default(
439
- "If result is a typed array, it must have exactly array.length * 2 elements"
440
- );
441
- } else if (result.length !== resultLength) {
442
- result.length = resultLength;
443
- }
444
- for (let i = 0; i < length; ++i) {
445
- _Cartesian2.pack(array[i], result, i * 2);
446
- }
447
- return result;
448
- }
449
- /**
450
- * Unpacks an array of cartesian components into an array of Cartesian2s.
451
- *
452
- * @param {number[]} array The array of components to unpack.
453
- * @param {Cartesian2[]} [result] The array onto which to store the result.
454
- * @returns {Cartesian2[]} The unpacked array.
455
- */
456
- static unpackArray(array, result) {
457
- Check_default.defined("array", array);
458
- Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 2);
459
- if (array.length % 2 !== 0) {
460
- throw new DeveloperError_default("array length must be a multiple of 2.");
461
- }
462
- const length = array.length;
463
- if (!defined_default(result)) {
464
- result = new Array(length / 2);
465
- } else {
466
- result.length = length / 2;
467
- }
468
- for (let i = 0; i < length; i += 2) {
469
- const index = i / 2;
470
- result[index] = _Cartesian2.unpack(array, i, result[index]);
471
- }
472
- return result;
473
- }
474
- /**
475
- * Computes the value of the maximum component for the supplied Cartesian.
476
- *
477
- * @param {Cartesian2} cartesian The cartesian to use.
478
- * @returns {number} The value of the maximum component.
479
- */
480
- static maximumComponent(cartesian) {
481
- Check_default.typeOf.object("cartesian", cartesian);
482
- return Math.max(cartesian.x, cartesian.y);
483
- }
484
- /**
485
- * Computes the value of the minimum component for the supplied Cartesian.
486
- *
487
- * @param {Cartesian2} cartesian The cartesian to use.
488
- * @returns {number} The value of the minimum component.
489
- */
490
- static minimumComponent(cartesian) {
491
- Check_default.typeOf.object("cartesian", cartesian);
492
- return Math.min(cartesian.x, cartesian.y);
493
- }
494
- /**
495
- * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
496
- *
497
- * @param {Cartesian2} first A cartesian to compare.
498
- * @param {Cartesian2} second A cartesian to compare.
499
- * @param {Cartesian2} result The object into which to store the result.
500
- * @returns {Cartesian2} A cartesian with the minimum components.
501
- */
502
- static minimumByComponent(first, second, result) {
503
- Check_default.typeOf.object("first", first);
504
- Check_default.typeOf.object("second", second);
505
- Check_default.typeOf.object("result", result);
506
- result.x = Math.min(first.x, second.x);
507
- result.y = Math.min(first.y, second.y);
508
- return result;
509
- }
510
- /**
511
- * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
512
- *
513
- * @param {Cartesian2} first A cartesian to compare.
514
- * @param {Cartesian2} second A cartesian to compare.
515
- * @param {Cartesian2} result The object into which to store the result.
516
- * @returns {Cartesian2} A cartesian with the maximum components.
517
- */
518
- static maximumByComponent(first, second, result) {
519
- Check_default.typeOf.object("first", first);
520
- Check_default.typeOf.object("second", second);
521
- Check_default.typeOf.object("result", result);
522
- result.x = Math.max(first.x, second.x);
523
- result.y = Math.max(first.y, second.y);
524
- return result;
525
- }
526
- /**
527
- * Constrain a value to lie between two values.
528
- *
529
- * @param {Cartesian2} value The value to clamp.
530
- * @param {Cartesian2} min The minimum bound.
531
- * @param {Cartesian2} max The maximum bound.
532
- * @param {Cartesian2} result The object into which to store the result.
533
- * @returns {Cartesian2} The clamped value such that min <= result <= max.
534
- */
535
- static clamp(value, min, max, result) {
536
- Check_default.typeOf.object("value", value);
537
- Check_default.typeOf.object("min", min);
538
- Check_default.typeOf.object("max", max);
539
- Check_default.typeOf.object("result", result);
540
- const x = Math_default.clamp(value.x, min.x, max.x);
541
- const y = Math_default.clamp(value.y, min.y, max.y);
542
- result.x = x;
543
- result.y = y;
544
- return result;
545
- }
546
- /**
547
- * Computes the provided Cartesian's squared magnitude.
548
- *
549
- * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.
550
- * @returns {number} The squared magnitude.
551
- */
552
- static magnitudeSquared(cartesian) {
553
- Check_default.typeOf.object("cartesian", cartesian);
554
- return cartesian.x * cartesian.x + cartesian.y * cartesian.y;
555
- }
556
- /**
557
- * Computes the Cartesian's magnitude (length).
558
- *
559
- * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.
560
- * @returns {number} The magnitude.
561
- */
562
- static magnitude(cartesian) {
563
- return Math.sqrt(_Cartesian2.magnitudeSquared(cartesian));
564
- }
565
- /**
566
- * Computes the distance between two points.
567
- *
568
- * @param {Cartesian2} left The first point to compute the distance from.
569
- * @param {Cartesian2} right The second point to compute the distance to.
570
- * @returns {number} The distance between two points.
571
- *
572
- * @example
573
- * // Returns 1.0
574
- * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
575
- */
576
- static distance(left, right) {
577
- Check_default.typeOf.object("left", left);
578
- Check_default.typeOf.object("right", right);
579
- _Cartesian2.subtract(left, right, distanceScratch);
580
- return _Cartesian2.magnitude(distanceScratch);
581
- }
582
- /**
583
- * Computes the squared distance between two points. Comparing squared distances
584
- * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
585
- *
586
- * @param {Cartesian2} left The first point to compute the distance from.
587
- * @param {Cartesian2} right The second point to compute the distance to.
588
- * @returns {number} The distance between two points.
589
- *
590
- * @example
591
- * // Returns 4.0, not 2.0
592
- * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
593
- */
594
- static distanceSquared(left, right) {
595
- Check_default.typeOf.object("left", left);
596
- Check_default.typeOf.object("right", right);
597
- _Cartesian2.subtract(left, right, distanceScratch);
598
- return _Cartesian2.magnitudeSquared(distanceScratch);
599
- }
600
- /**
601
- * Computes the normalized form of the supplied Cartesian.
602
- *
603
- * @param {Cartesian2} cartesian The Cartesian to be normalized.
604
- * @param {Cartesian2} result The object onto which to store the result.
605
- * @returns {Cartesian2} The modified result parameter.
606
- */
607
- static normalize(cartesian, result) {
608
- Check_default.typeOf.object("cartesian", cartesian);
609
- Check_default.typeOf.object("result", result);
610
- const magnitude = _Cartesian2.magnitude(cartesian);
611
- result.x = cartesian.x / magnitude;
612
- result.y = cartesian.y / magnitude;
613
- if (isNaN(result.x) || isNaN(result.y)) {
614
- throw new DeveloperError_default("normalized result is not a number");
615
- }
616
- return result;
617
- }
618
- /**
619
- * Computes the dot (scalar) product of two Cartesians.
620
- *
621
- * @param {Cartesian2} left The first Cartesian.
622
- * @param {Cartesian2} right The second Cartesian.
623
- * @returns {number} The dot product.
624
- */
625
- static dot(left, right) {
626
- Check_default.typeOf.object("left", left);
627
- Check_default.typeOf.object("right", right);
628
- return left.x * right.x + left.y * right.y;
629
- }
630
- /**
631
- * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
632
- *
633
- * @param {Cartesian2} left The first Cartesian.
634
- * @param {Cartesian2} right The second Cartesian.
635
- * @returns {number} The cross product.
636
- */
637
- static cross(left, right) {
638
- Check_default.typeOf.object("left", left);
639
- Check_default.typeOf.object("right", right);
640
- return left.x * right.y - left.y * right.x;
641
- }
642
- /**
643
- * Computes the componentwise product of two Cartesians.
644
- *
645
- * @param {Cartesian2} left The first Cartesian.
646
- * @param {Cartesian2} right The second Cartesian.
647
- * @param {Cartesian2} result The object onto which to store the result.
648
- * @returns {Cartesian2} The modified result parameter.
649
- */
650
- static multiplyComponents(left, right, result) {
651
- Check_default.typeOf.object("left", left);
652
- Check_default.typeOf.object("right", right);
653
- Check_default.typeOf.object("result", result);
654
- result.x = left.x * right.x;
655
- result.y = left.y * right.y;
656
- return result;
657
- }
658
- /**
659
- * Computes the componentwise quotient of two Cartesians.
660
- *
661
- * @param {Cartesian2} left The first Cartesian.
662
- * @param {Cartesian2} right The second Cartesian.
663
- * @param {Cartesian2} result The object onto which to store the result.
664
- * @returns {Cartesian2} The modified result parameter.
665
- */
666
- static divideComponents(left, right, result) {
667
- Check_default.typeOf.object("left", left);
668
- Check_default.typeOf.object("right", right);
669
- Check_default.typeOf.object("result", result);
670
- result.x = left.x / right.x;
671
- result.y = left.y / right.y;
672
- return result;
673
- }
674
- /**
675
- * Computes the componentwise sum of two Cartesians.
676
- *
677
- * @param {Cartesian2} left The first Cartesian.
678
- * @param {Cartesian2} right The second Cartesian.
679
- * @param {Cartesian2} result The object onto which to store the result.
680
- * @returns {Cartesian2} The modified result parameter.
681
- */
682
- static add(left, right, result) {
683
- Check_default.typeOf.object("left", left);
684
- Check_default.typeOf.object("right", right);
685
- Check_default.typeOf.object("result", result);
686
- result.x = left.x + right.x;
687
- result.y = left.y + right.y;
688
- return result;
689
- }
690
- /**
691
- * Computes the componentwise difference of two Cartesians.
692
- *
693
- * @param {Cartesian2} left The first Cartesian.
694
- * @param {Cartesian2} right The second Cartesian.
695
- * @param {Cartesian2} result The object onto which to store the result.
696
- * @returns {Cartesian2} The modified result parameter.
697
- */
698
- static subtract(left, right, result) {
699
- Check_default.typeOf.object("left", left);
700
- Check_default.typeOf.object("right", right);
701
- Check_default.typeOf.object("result", result);
702
- result.x = left.x - right.x;
703
- result.y = left.y - right.y;
704
- return result;
705
- }
706
- /**
707
- * Multiplies the provided Cartesian componentwise by the provided scalar.
708
- *
709
- * @param {Cartesian2} cartesian The Cartesian to be scaled.
710
- * @param {number} scalar The scalar to multiply with.
711
- * @param {Cartesian2} result The object onto which to store the result.
712
- * @returns {Cartesian2} The modified result parameter.
713
- */
714
- static multiplyByScalar(cartesian, scalar, result) {
715
- Check_default.typeOf.object("cartesian", cartesian);
716
- Check_default.typeOf.number("scalar", scalar);
717
- Check_default.typeOf.object("result", result);
718
- result.x = cartesian.x * scalar;
719
- result.y = cartesian.y * scalar;
720
- return result;
721
- }
722
- /**
723
- * Divides the provided Cartesian componentwise by the provided scalar.
724
- *
725
- * @param {Cartesian2} cartesian The Cartesian to be divided.
726
- * @param {number} scalar The scalar to divide by.
727
- * @param {Cartesian2} result The object onto which to store the result.
728
- * @returns {Cartesian2} The modified result parameter.
729
- */
730
- static divideByScalar(cartesian, scalar, result) {
731
- Check_default.typeOf.object("cartesian", cartesian);
732
- Check_default.typeOf.number("scalar", scalar);
733
- Check_default.typeOf.object("result", result);
734
- result.x = cartesian.x / scalar;
735
- result.y = cartesian.y / scalar;
736
- return result;
737
- }
738
- /**
739
- * Negates the provided Cartesian.
740
- *
741
- * @param {Cartesian2} cartesian The Cartesian to be negated.
742
- * @param {Cartesian2} result The object onto which to store the result.
743
- * @returns {Cartesian2} The modified result parameter.
744
- */
745
- static negate(cartesian, result) {
746
- Check_default.typeOf.object("cartesian", cartesian);
747
- Check_default.typeOf.object("result", result);
748
- result.x = -cartesian.x;
749
- result.y = -cartesian.y;
750
- return result;
751
- }
752
- /**
753
- * Computes the absolute value of the provided Cartesian.
754
- *
755
- * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.
756
- * @param {Cartesian2} result The object onto which to store the result.
757
- * @returns {Cartesian2} The modified result parameter.
758
- */
759
- static abs(cartesian, result) {
760
- Check_default.typeOf.object("cartesian", cartesian);
761
- Check_default.typeOf.object("result", result);
762
- result.x = Math.abs(cartesian.x);
763
- result.y = Math.abs(cartesian.y);
764
- return result;
765
- }
766
- /**
767
- * Computes the linear interpolation or extrapolation at t using the provided cartesians.
768
- *
769
- * @param {Cartesian2} start The value corresponding to t at 0.0.
770
- * @param {Cartesian2} end The value corresponding to t at 1.0.
771
- * @param {number} t The point along t at which to interpolate.
772
- * @param {Cartesian2} result The object onto which to store the result.
773
- * @returns {Cartesian2} The modified result parameter.
774
- */
775
- static lerp(start, end, t, result) {
776
- Check_default.typeOf.object("start", start);
777
- Check_default.typeOf.object("end", end);
778
- Check_default.typeOf.number("t", t);
779
- Check_default.typeOf.object("result", result);
780
- _Cartesian2.multiplyByScalar(end, t, lerpScratch);
781
- result = _Cartesian2.multiplyByScalar(start, 1 - t, result);
782
- return _Cartesian2.add(lerpScratch, result, result);
783
- }
784
- /**
785
- * Returns the angle, in radians, between the provided Cartesians.
786
- *
787
- * @param {Cartesian2} left The first Cartesian.
788
- * @param {Cartesian2} right The second Cartesian.
789
- * @returns {number} The angle between the Cartesians.
790
- */
791
- static angleBetween(left, right) {
792
- Check_default.typeOf.object("left", left);
793
- Check_default.typeOf.object("right", right);
794
- _Cartesian2.normalize(left, angleBetweenScratch);
795
- _Cartesian2.normalize(right, angleBetweenScratch2);
796
- return Math_default.acosClamped(
797
- _Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2)
798
- );
799
- }
800
- /**
801
- * Returns the axis that is most orthogonal to the provided Cartesian.
802
- *
803
- * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.
804
- * @param {Cartesian2} result The object onto which to store the result.
805
- * @returns {Cartesian2} The most orthogonal axis.
806
- */
807
- static mostOrthogonalAxis(cartesian, result) {
808
- Check_default.typeOf.object("cartesian", cartesian);
809
- Check_default.typeOf.object("result", result);
810
- const f = _Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);
811
- _Cartesian2.abs(f, f);
812
- if (f.x <= f.y) {
813
- result = _Cartesian2.clone(_Cartesian2.UNIT_X, result);
814
- } else {
815
- result = _Cartesian2.clone(_Cartesian2.UNIT_Y, result);
816
- }
817
- return result;
818
- }
819
- /**
820
- * Compares the provided Cartesians componentwise and returns
821
- * <code>true</code> if they are equal, <code>false</code> otherwise.
822
- *
823
- * @param {Cartesian2} [left] The first Cartesian.
824
- * @param {Cartesian2} [right] The second Cartesian.
825
- * @returns {boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
826
- */
827
- static equals(left, right) {
828
- return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y;
829
- }
830
- /**
831
- * @param {Cartesian2} cartesian
832
- * @param {number[]} array
833
- * @param {number} offset
834
- * @ignore
835
- */
836
- static equalsArray(cartesian, array, offset) {
837
- return cartesian.x === array[offset] && cartesian.y === array[offset + 1];
838
- }
839
- /**
840
- * Compares the provided Cartesians componentwise and returns
841
- * <code>true</code> if they pass an absolute or relative tolerance test,
842
- * <code>false</code> otherwise.
843
- *
844
- * @param {Cartesian2} [left] The first Cartesian.
845
- * @param {Cartesian2} [right] The second Cartesian.
846
- * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
847
- * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
848
- * @returns {boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
849
- */
850
- static equalsEpsilon(left, right, relativeEpsilon, absoluteEpsilon) {
851
- return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
852
- left.x,
853
- right.x,
854
- relativeEpsilon,
855
- absoluteEpsilon
856
- ) && Math_default.equalsEpsilon(
857
- left.y,
858
- right.y,
859
- relativeEpsilon,
860
- absoluteEpsilon
861
- );
862
- }
863
- /**
864
- * Duplicates this Cartesian2 instance.
865
- *
866
- * @param {Cartesian2} [result] The object onto which to store the result.
867
- * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
868
- */
869
- clone(result) {
870
- return _Cartesian2.clone(this, result);
871
- }
872
- /**
873
- * Compares this Cartesian against the provided Cartesian componentwise and returns
874
- * <code>true</code> if they are equal, <code>false</code> otherwise.
875
- *
876
- * @param {Cartesian2} [right] The right hand side Cartesian.
877
- * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
878
- */
879
- equals(right) {
880
- return _Cartesian2.equals(this, right);
881
- }
882
- /**
883
- * Compares this Cartesian against the provided Cartesian componentwise and returns
884
- * <code>true</code> if they pass an absolute or relative tolerance test,
885
- * <code>false</code> otherwise.
886
- *
887
- * @param {Cartesian2} [right] The right hand side Cartesian.
888
- * @param {number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
889
- * @param {number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
890
- * @returns {boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
891
- */
892
- equalsEpsilon(right, relativeEpsilon, absoluteEpsilon) {
893
- return _Cartesian2.equalsEpsilon(
894
- this,
895
- right,
896
- relativeEpsilon,
897
- absoluteEpsilon
898
- );
899
- }
900
- /**
901
- * Creates a string representing this Cartesian in the format '(x, y)'.
902
- *
903
- * @returns {string} A string representing the provided Cartesian in the format '(x, y)'.
904
- */
905
- toString() {
906
- return `(${this.x}, ${this.y})`;
907
- }
908
- };
909
- Cartesian2.fromCartesian3 = Cartesian2.clone;
910
- Cartesian2.fromCartesian4 = Cartesian2.clone;
911
- Cartesian2.packedLength = 2;
912
- Cartesian2.fromArray = Cartesian2.unpack;
913
- var distanceScratch = new Cartesian2();
914
- var lerpScratch = new Cartesian2();
915
- var angleBetweenScratch = new Cartesian2();
916
- var angleBetweenScratch2 = new Cartesian2();
917
- var mostOrthogonalAxisScratch = new Cartesian2();
918
- Cartesian2.ZERO = Object.freeze(new Cartesian2(0, 0));
919
- Cartesian2.ONE = Object.freeze(new Cartesian2(1, 1));
920
- Cartesian2.UNIT_X = Object.freeze(new Cartesian2(1, 0));
921
- Cartesian2.UNIT_Y = Object.freeze(new Cartesian2(0, 1));
922
- var Cartesian2_default = Cartesian2;
923
-
924
- // packages/engine/Source/Core/Ellipsoid.js
925
- function initialize(ellipsoid, x, y, z) {
926
- x = x ?? 0;
927
- y = y ?? 0;
928
- z = z ?? 0;
929
- Check_default.typeOf.number.greaterThanOrEquals("x", x, 0);
930
- Check_default.typeOf.number.greaterThanOrEquals("y", y, 0);
931
- Check_default.typeOf.number.greaterThanOrEquals("z", z, 0);
932
- ellipsoid._radii = new Cartesian3_default(x, y, z);
933
- ellipsoid._radiiSquared = new Cartesian3_default(x * x, y * y, z * z);
934
- ellipsoid._radiiToTheFourth = new Cartesian3_default(
935
- x * x * x * x,
936
- y * y * y * y,
937
- z * z * z * z
938
- );
939
- ellipsoid._oneOverRadii = new Cartesian3_default(
940
- x === 0 ? 0 : 1 / x,
941
- y === 0 ? 0 : 1 / y,
942
- z === 0 ? 0 : 1 / z
943
- );
944
- ellipsoid._oneOverRadiiSquared = new Cartesian3_default(
945
- x === 0 ? 0 : 1 / (x * x),
946
- y === 0 ? 0 : 1 / (y * y),
947
- z === 0 ? 0 : 1 / (z * z)
948
- );
949
- ellipsoid._minimumRadius = Math.min(x, y, z);
950
- ellipsoid._maximumRadius = Math.max(x, y, z);
951
- ellipsoid._centerToleranceSquared = Math_default.EPSILON1;
952
- if (ellipsoid._radiiSquared.z !== 0) {
953
- ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
954
- }
955
- }
956
- var Ellipsoid = class _Ellipsoid {
957
- /**
958
- * @param {number} [x=0] The radius in the x direction.
959
- * @param {number} [y=0] The radius in the y direction.
960
- * @param {number} [z=0] The radius in the z direction.
961
- *
962
- * @exception {DeveloperError} All radii components must be greater than or equal to zero.
963
- */
964
- constructor(x, y, z) {
965
- this._radii = void 0;
966
- this._radiiSquared = void 0;
967
- this._radiiToTheFourth = void 0;
968
- this._oneOverRadii = void 0;
969
- this._oneOverRadiiSquared = void 0;
970
- this._minimumRadius = void 0;
971
- this._maximumRadius = void 0;
972
- this._centerToleranceSquared = void 0;
973
- this._squaredXOverSquaredZ = void 0;
974
- initialize(this, x, y, z);
975
- }
976
- /**
977
- * Gets the radii of the ellipsoid.
978
- * @type {Cartesian3}
979
- * @readonly
980
- */
981
- get radii() {
982
- return this._radii;
983
- }
984
- /**
985
- * Gets the squared radii of the ellipsoid.
986
- * @type {Cartesian3}
987
- * @readonly
988
- */
989
- get radiiSquared() {
990
- return this._radiiSquared;
991
- }
992
- /**
993
- * Gets the radii of the ellipsoid raise to the fourth power.
994
- * @type {Cartesian3}
995
- * @readonly
996
- */
997
- get radiiToTheFourth() {
998
- return this._radiiToTheFourth;
999
- }
1000
- /**
1001
- * Gets one over the radii of the ellipsoid.
1002
- * @type {Cartesian3}
1003
- * @readonly
1004
- */
1005
- get oneOverRadii() {
1006
- return this._oneOverRadii;
1007
- }
1008
- /**
1009
- * Gets one over the squared radii of the ellipsoid.
1010
- * @type {Cartesian3}
1011
- * @readonly
1012
- */
1013
- get oneOverRadiiSquared() {
1014
- return this._oneOverRadiiSquared;
1015
- }
1016
- /**
1017
- * Gets the minimum radius of the ellipsoid.
1018
- * @type {number}
1019
- * @readonly
1020
- */
1021
- get minimumRadius() {
1022
- return this._minimumRadius;
1023
- }
1024
- /**
1025
- * Gets the maximum radius of the ellipsoid.
1026
- * @type {number}
1027
- * @readonly
1028
- */
1029
- get maximumRadius() {
1030
- return this._maximumRadius;
1031
- }
1032
- /**
1033
- * Duplicates an Ellipsoid instance.
1034
- *
1035
- * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
1036
- * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
1037
- * instance should be created.
1038
- * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
1039
- */
1040
- static clone(ellipsoid, result) {
1041
- if (!defined_default(ellipsoid)) {
1042
- return void 0;
1043
- }
1044
- const radii = ellipsoid._radii;
1045
- if (!defined_default(result)) {
1046
- return new _Ellipsoid(radii.x, radii.y, radii.z);
1047
- }
1048
- Cartesian3_default.clone(radii, result._radii);
1049
- Cartesian3_default.clone(ellipsoid._radiiSquared, result._radiiSquared);
1050
- Cartesian3_default.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
1051
- Cartesian3_default.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
1052
- Cartesian3_default.clone(
1053
- ellipsoid._oneOverRadiiSquared,
1054
- result._oneOverRadiiSquared
1055
- );
1056
- result._minimumRadius = ellipsoid._minimumRadius;
1057
- result._maximumRadius = ellipsoid._maximumRadius;
1058
- result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
1059
- return result;
1060
- }
1061
- /**
1062
- * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
1063
- *
1064
- * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.
1065
- * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
1066
- * instance should be created.
1067
- * @returns {Ellipsoid} A new Ellipsoid instance.
1068
- *
1069
- * @exception {DeveloperError} All radii components must be greater than or equal to zero.
1070
- *
1071
- * @see Ellipsoid.WGS84
1072
- * @see Ellipsoid.UNIT_SPHERE
1073
- */
1074
- static fromCartesian3(cartesian, result) {
1075
- if (!defined_default(result)) {
1076
- result = new _Ellipsoid();
1077
- }
1078
- if (!defined_default(cartesian)) {
1079
- return result;
1080
- }
1081
- initialize(result, cartesian.x, cartesian.y, cartesian.z);
1082
- return result;
1083
- }
1084
- /**
1085
- * The default ellipsoid used when not otherwise specified.
1086
- * @type {Ellipsoid}
1087
- * @example
1088
- * Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;
1089
- *
1090
- * // Apollo 11 landing site
1091
- * const position = Cesium.Cartesian3.fromRadians(
1092
- * 0.67416,
1093
- * 23.47315,
1094
- * );
1095
- */
1096
- static get default() {
1097
- return _Ellipsoid._default;
1098
- }
1099
- static set default(value) {
1100
- Check_default.typeOf.object("value", value);
1101
- _Ellipsoid._default = value;
1102
- Cartesian3_default._ellipsoidRadiiSquared = value.radiiSquared;
1103
- Cartographic_default._ellipsoidOneOverRadii = value.oneOverRadii;
1104
- Cartographic_default._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;
1105
- Cartographic_default._ellipsoidCenterToleranceSquared = value._centerToleranceSquared;
1106
- }
1107
- /**
1108
- * Duplicates an Ellipsoid instance.
1109
- *
1110
- * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
1111
- * instance should be created.
1112
- * @returns {Ellipsoid} The cloned Ellipsoid.
1113
- */
1114
- clone(result) {
1115
- return _Ellipsoid.clone(this, result);
1116
- }
1117
- /**
1118
- * Stores the provided instance into the provided array.
1119
- *
1120
- * @param {Ellipsoid} value The value to pack.
1121
- * @param {number[]} array The array to pack into.
1122
- * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
1123
- *
1124
- * @returns {number[]} The array that was packed into
1125
- */
1126
- static pack(value, array, startingIndex) {
1127
- Check_default.typeOf.object("value", value);
1128
- Check_default.defined("array", array);
1129
- startingIndex = startingIndex ?? 0;
1130
- Cartesian3_default.pack(value._radii, array, startingIndex);
1131
- return array;
1132
- }
1133
- /**
1134
- * Retrieves an instance from a packed array.
1135
- *
1136
- * @param {number[]} array The packed array.
1137
- * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
1138
- * @param {Ellipsoid} [result] The object into which to store the result.
1139
- * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.
1140
- */
1141
- static unpack(array, startingIndex, result) {
1142
- Check_default.defined("array", array);
1143
- startingIndex = startingIndex ?? 0;
1144
- const radii = Cartesian3_default.unpack(array, startingIndex);
1145
- return _Ellipsoid.fromCartesian3(radii, result);
1146
- }
1147
- /**
1148
- * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
1149
- *
1150
- * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.
1151
- * @param {Cartesian3} [result] The object onto which to store the result.
1152
- * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
1153
- */
1154
- geodeticSurfaceNormalCartographic(cartographic, result) {
1155
- Check_default.typeOf.object("cartographic", cartographic);
1156
- const longitude = cartographic.longitude;
1157
- const latitude = cartographic.latitude;
1158
- const cosLatitude = Math.cos(latitude);
1159
- const x = cosLatitude * Math.cos(longitude);
1160
- const y = cosLatitude * Math.sin(longitude);
1161
- const z = Math.sin(latitude);
1162
- if (!defined_default(result)) {
1163
- result = new Cartesian3_default();
1164
- }
1165
- result.x = x;
1166
- result.y = y;
1167
- result.z = z;
1168
- return Cartesian3_default.normalize(result, result);
1169
- }
1170
- /**
1171
- * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
1172
- *
1173
- * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.
1174
- * @param {Cartesian3} [result] The object onto which to store the result.
1175
- * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
1176
- */
1177
- geodeticSurfaceNormal(cartesian, result) {
1178
- Check_default.typeOf.object("cartesian", cartesian);
1179
- if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {
1180
- throw new DeveloperError_default("cartesian has a NaN component");
1181
- }
1182
- if (Cartesian3_default.equalsEpsilon(cartesian, Cartesian3_default.ZERO, Math_default.EPSILON14)) {
1183
- return void 0;
1184
- }
1185
- if (!defined_default(result)) {
1186
- result = new Cartesian3_default();
1187
- }
1188
- result = Cartesian3_default.multiplyComponents(
1189
- cartesian,
1190
- this._oneOverRadiiSquared,
1191
- result
1192
- );
1193
- return Cartesian3_default.normalize(result, result);
1194
- }
1195
- /**
1196
- * Converts the provided cartographic to Cartesian representation.
1197
- *
1198
- * @param {Cartographic} cartographic The cartographic position.
1199
- * @param {Cartesian3} [result] The object onto which to store the result.
1200
- * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
1201
- *
1202
- * @example
1203
- * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
1204
- * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
1205
- * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
1206
- */
1207
- cartographicToCartesian(cartographic, result) {
1208
- const n = cartographicToCartesianNormal;
1209
- const k = cartographicToCartesianK;
1210
- this.geodeticSurfaceNormalCartographic(cartographic, n);
1211
- Cartesian3_default.multiplyComponents(this._radiiSquared, n, k);
1212
- const gamma = Math.sqrt(Cartesian3_default.dot(n, k));
1213
- Cartesian3_default.divideByScalar(k, gamma, k);
1214
- Cartesian3_default.multiplyByScalar(n, cartographic.height, n);
1215
- if (!defined_default(result)) {
1216
- result = new Cartesian3_default();
1217
- }
1218
- return Cartesian3_default.add(k, n, result);
1219
- }
1220
- /**
1221
- * Converts the provided array of cartographics to an array of Cartesians.
1222
- *
1223
- * @param {Cartographic[]} cartographics An array of cartographic positions.
1224
- * @param {Cartesian3[]} [result] The object onto which to store the result.
1225
- * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.
1226
- *
1227
- * @example
1228
- * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
1229
- * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
1230
- * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
1231
- * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
1232
- * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
1233
- */
1234
- cartographicArrayToCartesianArray(cartographics, result) {
1235
- Check_default.defined("cartographics", cartographics);
1236
- const length = cartographics.length;
1237
- if (!defined_default(result)) {
1238
- result = new Array(length);
1239
- } else {
1240
- result.length = length;
1241
- }
1242
- for (let i = 0; i < length; i++) {
1243
- result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
1244
- }
1245
- return result;
1246
- }
1247
- /**
1248
- * Converts the provided cartesian to cartographic representation.
1249
- * The cartesian is undefined at the center of the ellipsoid.
1250
- *
1251
- * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
1252
- * @param {Cartographic} [result] The object onto which to store the result.
1253
- * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
1254
- *
1255
- * @example
1256
- * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
1257
- * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
1258
- * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
1259
- */
1260
- cartesianToCartographic(cartesian, result) {
1261
- const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP2);
1262
- if (!defined_default(p)) {
1263
- return void 0;
1264
- }
1265
- const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN2);
1266
- const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH2);
1267
- const longitude = Math.atan2(n.y, n.x);
1268
- const latitude = Math.asin(n.z);
1269
- const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
1270
- if (!defined_default(result)) {
1271
- return new Cartographic_default(longitude, latitude, height);
1272
- }
1273
- result.longitude = longitude;
1274
- result.latitude = latitude;
1275
- result.height = height;
1276
- return result;
1277
- }
1278
- /**
1279
- * Converts the provided array of cartesians to an array of cartographics.
1280
- *
1281
- * @param {Cartesian3[]} cartesians An array of Cartesian positions.
1282
- * @param {Cartographic[]} [result] The object onto which to store the result.
1283
- * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.
1284
- *
1285
- * @example
1286
- * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
1287
- * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
1288
- * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
1289
- * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
1290
- * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
1291
- */
1292
- cartesianArrayToCartographicArray(cartesians, result) {
1293
- Check_default.defined("cartesians", cartesians);
1294
- const length = cartesians.length;
1295
- if (!defined_default(result)) {
1296
- result = new Array(length);
1297
- } else {
1298
- result.length = length;
1299
- }
1300
- for (let i = 0; i < length; ++i) {
1301
- result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
1302
- }
1303
- return result;
1304
- }
1305
- /**
1306
- * Scales the provided Cartesian position along the geodetic surface normal
1307
- * so that it is on the surface of this ellipsoid. If the position is
1308
- * at the center of the ellipsoid, this function returns undefined.
1309
- *
1310
- * @param {Cartesian3} cartesian The Cartesian position to scale.
1311
- * @param {Cartesian3} [result] The object onto which to store the result.
1312
- * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
1313
- */
1314
- scaleToGeodeticSurface(cartesian, result) {
1315
- return scaleToGeodeticSurface_default(
1316
- cartesian,
1317
- this._oneOverRadii,
1318
- this._oneOverRadiiSquared,
1319
- this._centerToleranceSquared,
1320
- result
1321
- );
1322
- }
1323
- /**
1324
- * Scales the provided Cartesian position along the geocentric surface normal
1325
- * so that it is on the surface of this ellipsoid.
1326
- *
1327
- * @param {Cartesian3} cartesian The Cartesian position to scale.
1328
- * @param {Cartesian3} [result] The object onto which to store the result.
1329
- * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
1330
- */
1331
- scaleToGeocentricSurface(cartesian, result) {
1332
- Check_default.typeOf.object("cartesian", cartesian);
1333
- if (!defined_default(result)) {
1334
- result = new Cartesian3_default();
1335
- }
1336
- const positionX = cartesian.x;
1337
- const positionY = cartesian.y;
1338
- const positionZ = cartesian.z;
1339
- const oneOverRadiiSquared = this._oneOverRadiiSquared;
1340
- const beta = 1 / Math.sqrt(
1341
- positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z
1342
- );
1343
- return Cartesian3_default.multiplyByScalar(cartesian, beta, result);
1344
- }
1345
- /**
1346
- * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
1347
- * its components by the result of {@link Ellipsoid#oneOverRadii}.
1348
- *
1349
- * @param {Cartesian3} position The position to transform.
1350
- * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
1351
- * return a new instance.
1352
- * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the
1353
- * one passed as the result parameter if it is not undefined, or a new instance of it is.
1354
- */
1355
- transformPositionToScaledSpace(position, result) {
1356
- if (!defined_default(result)) {
1357
- result = new Cartesian3_default();
1358
- }
1359
- return Cartesian3_default.multiplyComponents(position, this._oneOverRadii, result);
1360
- }
1361
- /**
1362
- * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
1363
- * its components by the result of {@link Ellipsoid#radii}.
1364
- *
1365
- * @param {Cartesian3} position The position to transform.
1366
- * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
1367
- * return a new instance.
1368
- * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the
1369
- * one passed as the result parameter if it is not undefined, or a new instance of it is.
1370
- */
1371
- transformPositionFromScaledSpace(position, result) {
1372
- if (!defined_default(result)) {
1373
- result = new Cartesian3_default();
1374
- }
1375
- return Cartesian3_default.multiplyComponents(position, this._radii, result);
1376
- }
1377
- /**
1378
- * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
1379
- * <code>true</code> if they are equal, <code>false</code> otherwise.
1380
- *
1381
- * @param {Ellipsoid} [right] The other Ellipsoid.
1382
- * @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
1383
- */
1384
- equals(right) {
1385
- return this === right || defined_default(right) && Cartesian3_default.equals(this._radii, right._radii);
1386
- }
1387
- /**
1388
- * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
1389
- *
1390
- * @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
1391
- */
1392
- toString() {
1393
- return this._radii.toString();
1394
- }
1395
- /**
1396
- * Computes a point which is the intersection of the surface normal with the z-axis.
1397
- *
1398
- * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.
1399
- * @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
1400
- * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.
1401
- * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
1402
- * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
1403
- * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and
1404
- * return a new instance.
1405
- * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise
1406
- *
1407
- * @exception {DeveloperError} position is required.
1408
- * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).
1409
- * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.
1410
- */
1411
- getSurfaceNormalIntersectionWithZAxis(position, buffer, result) {
1412
- Check_default.typeOf.object("position", position);
1413
- if (!Math_default.equalsEpsilon(
1414
- this._radii.x,
1415
- this._radii.y,
1416
- Math_default.EPSILON15
1417
- )) {
1418
- throw new DeveloperError_default(
1419
- "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
1420
- );
1421
- }
1422
- Check_default.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
1423
- buffer = buffer ?? 0;
1424
- const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
1425
- if (!defined_default(result)) {
1426
- result = new Cartesian3_default();
1427
- }
1428
- result.x = 0;
1429
- result.y = 0;
1430
- result.z = position.z * (1 - squaredXOverSquaredZ);
1431
- if (Math.abs(result.z) >= this._radii.z - buffer) {
1432
- return void 0;
1433
- }
1434
- return result;
1435
- }
1436
- /**
1437
- * Computes the ellipsoid curvatures at a given position on the surface.
1438
- *
1439
- * @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.
1440
- * @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.
1441
- * @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.
1442
- *
1443
- * @exception {DeveloperError} position is required.
1444
- */
1445
- getLocalCurvature(surfacePosition, result) {
1446
- Check_default.typeOf.object("surfacePosition", surfacePosition);
1447
- if (!defined_default(result)) {
1448
- result = new Cartesian2_default();
1449
- }
1450
- const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(
1451
- surfacePosition,
1452
- 0,
1453
- scratchEndpoint
1454
- );
1455
- const primeVerticalRadius = Cartesian3_default.distance(
1456
- surfacePosition,
1457
- primeVerticalEndpoint
1458
- );
1459
- const radiusRatio = this.minimumRadius * primeVerticalRadius / this.maximumRadius ** 2;
1460
- const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;
1461
- return Cartesian2_default.fromElements(
1462
- 1 / primeVerticalRadius,
1463
- 1 / meridionalRadius,
1464
- result
1465
- );
1466
- }
1467
- /**
1468
- * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
1469
- * Gauss-Legendre 10th order quadrature.
1470
- *
1471
- * @param {Rectangle} rectangle The rectangle used for computing the surface area.
1472
- * @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.
1473
- */
1474
- surfaceArea(rectangle) {
1475
- Check_default.typeOf.object("rectangle", rectangle);
1476
- const minLongitude = rectangle.west;
1477
- let maxLongitude = rectangle.east;
1478
- const minLatitude = rectangle.south;
1479
- const maxLatitude = rectangle.north;
1480
- while (maxLongitude < minLongitude) {
1481
- maxLongitude += Math_default.TWO_PI;
1482
- }
1483
- const radiiSquared = this._radiiSquared;
1484
- const a2 = radiiSquared.x;
1485
- const b2 = radiiSquared.y;
1486
- const c2 = radiiSquared.z;
1487
- const a2b2 = a2 * b2;
1488
- return gaussLegendreQuadrature(minLatitude, maxLatitude, function(lat) {
1489
- const sinPhi = Math.cos(lat);
1490
- const cosPhi = Math.sin(lat);
1491
- return Math.cos(lat) * gaussLegendreQuadrature(minLongitude, maxLongitude, function(lon) {
1492
- const cosTheta = Math.cos(lon);
1493
- const sinTheta = Math.sin(lon);
1494
- return Math.sqrt(
1495
- a2b2 * cosPhi * cosPhi + c2 * (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) * sinPhi * sinPhi
1496
- );
1497
- });
1498
- });
1499
- }
1500
- };
1501
- Ellipsoid.WGS84 = Object.freeze(
1502
- new Ellipsoid(6378137, 6378137, 6356752314245179e-9)
1503
- );
1504
- Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1, 1, 1));
1505
- Ellipsoid.MOON = Object.freeze(
1506
- new Ellipsoid(
1507
- Math_default.LUNAR_RADIUS,
1508
- Math_default.LUNAR_RADIUS,
1509
- Math_default.LUNAR_RADIUS
1510
- )
1511
- );
1512
- Ellipsoid.MARS = Object.freeze(new Ellipsoid(3396190, 3396190, 3376200));
1513
- Ellipsoid._default = Ellipsoid.WGS84;
1514
- Ellipsoid.packedLength = Cartesian3_default.packedLength;
1515
- Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3_default.normalize;
1516
- var cartographicToCartesianNormal = new Cartesian3_default();
1517
- var cartographicToCartesianK = new Cartesian3_default();
1518
- var cartesianToCartographicN2 = new Cartesian3_default();
1519
- var cartesianToCartographicP2 = new Cartesian3_default();
1520
- var cartesianToCartographicH2 = new Cartesian3_default();
1521
- var scratchEndpoint = new Cartesian3_default();
1522
- var abscissas = [
1523
- 0.14887433898163,
1524
- 0.43339539412925,
1525
- 0.67940956829902,
1526
- 0.86506336668898,
1527
- 0.97390652851717,
1528
- 0
1529
- ];
1530
- var weights = [
1531
- 0.29552422471475,
1532
- 0.26926671930999,
1533
- 0.21908636251598,
1534
- 0.14945134915058,
1535
- 0.066671344308684,
1536
- 0
1537
- ];
1538
- function gaussLegendreQuadrature(a, b, func) {
1539
- Check_default.typeOf.number("a", a);
1540
- Check_default.typeOf.number("b", b);
1541
- Check_default.typeOf.func("func", func);
1542
- const xMean = 0.5 * (b + a);
1543
- const xRange = 0.5 * (b - a);
1544
- let sum = 0;
1545
- for (let i = 0; i < 5; i++) {
1546
- const dx = xRange * abscissas[i];
1547
- sum += weights[i] * (func(xMean + dx) + func(xMean - dx));
1548
- }
1549
- sum *= xRange;
1550
- return sum;
1551
- }
1552
- var Ellipsoid_default = Ellipsoid;
1553
-
1554
- // packages/engine/Source/Core/Fullscreen.js
1555
- var _supportsFullscreen;
1556
- var _names = {
1557
- requestFullscreen: void 0,
1558
- exitFullscreen: void 0,
1559
- fullscreenEnabled: void 0,
1560
- fullscreenElement: void 0,
1561
- fullscreenchange: void 0,
1562
- fullscreenerror: void 0
1563
- };
1564
- var Fullscreen = {};
1565
- Object.defineProperties(Fullscreen, {
1566
- /**
1567
- * The element that is currently fullscreen, if any. To simply check if the
1568
- * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
1569
- * @memberof Fullscreen
1570
- * @type {object}
1571
- * @readonly
1572
- */
1573
- element: {
1574
- get: function() {
1575
- if (!Fullscreen.supportsFullscreen()) {
1576
- return void 0;
1577
- }
1578
- return document[_names.fullscreenElement];
1579
- }
1580
- },
1581
- /**
1582
- * The name of the event on the document that is fired when fullscreen is
1583
- * entered or exited. This event name is intended for use with addEventListener.
1584
- * In your event handler, to determine if the browser is in fullscreen mode or not,
1585
- * use {@link Fullscreen#fullscreen}.
1586
- * @memberof Fullscreen
1587
- * @type {string}
1588
- * @readonly
1589
- */
1590
- changeEventName: {
1591
- get: function() {
1592
- if (!Fullscreen.supportsFullscreen()) {
1593
- return void 0;
1594
- }
1595
- return _names.fullscreenchange;
1596
- }
1597
- },
1598
- /**
1599
- * The name of the event that is fired when a fullscreen error
1600
- * occurs. This event name is intended for use with addEventListener.
1601
- * @memberof Fullscreen
1602
- * @type {string}
1603
- * @readonly
1604
- */
1605
- errorEventName: {
1606
- get: function() {
1607
- if (!Fullscreen.supportsFullscreen()) {
1608
- return void 0;
1609
- }
1610
- return _names.fullscreenerror;
1611
- }
1612
- },
1613
- /**
1614
- * Determine whether the browser will allow an element to be made fullscreen, or not.
1615
- * For example, by default, iframes cannot go fullscreen unless the containing page
1616
- * adds an "allowfullscreen" attribute (or prefixed equivalent).
1617
- * @memberof Fullscreen
1618
- * @type {boolean}
1619
- * @readonly
1620
- */
1621
- enabled: {
1622
- get: function() {
1623
- if (!Fullscreen.supportsFullscreen()) {
1624
- return void 0;
1625
- }
1626
- return document[_names.fullscreenEnabled];
1627
- }
1628
- },
1629
- /**
1630
- * Determines if the browser is currently in fullscreen mode.
1631
- * @memberof Fullscreen
1632
- * @type {boolean}
1633
- * @readonly
1634
- */
1635
- fullscreen: {
1636
- get: function() {
1637
- if (!Fullscreen.supportsFullscreen()) {
1638
- return void 0;
1639
- }
1640
- return Fullscreen.element !== null;
1641
- }
1642
- }
1643
- });
1644
- Fullscreen.supportsFullscreen = function() {
1645
- if (defined_default(_supportsFullscreen)) {
1646
- return _supportsFullscreen;
1647
- }
1648
- _supportsFullscreen = false;
1649
- const body = document.body;
1650
- if (typeof body.requestFullscreen === "function") {
1651
- _names.requestFullscreen = "requestFullscreen";
1652
- _names.exitFullscreen = "exitFullscreen";
1653
- _names.fullscreenEnabled = "fullscreenEnabled";
1654
- _names.fullscreenElement = "fullscreenElement";
1655
- _names.fullscreenchange = "fullscreenchange";
1656
- _names.fullscreenerror = "fullscreenerror";
1657
- _supportsFullscreen = true;
1658
- return _supportsFullscreen;
1659
- }
1660
- const prefixes = ["webkit", "moz", "o", "ms", "khtml"];
1661
- let name;
1662
- for (let i = 0, len = prefixes.length; i < len; ++i) {
1663
- const prefix = prefixes[i];
1664
- name = `${prefix}RequestFullscreen`;
1665
- if (typeof body[name] === "function") {
1666
- _names.requestFullscreen = name;
1667
- _supportsFullscreen = true;
1668
- } else {
1669
- name = `${prefix}RequestFullScreen`;
1670
- if (typeof body[name] === "function") {
1671
- _names.requestFullscreen = name;
1672
- _supportsFullscreen = true;
1673
- }
1674
- }
1675
- name = `${prefix}ExitFullscreen`;
1676
- if (typeof document[name] === "function") {
1677
- _names.exitFullscreen = name;
1678
- } else {
1679
- name = `${prefix}CancelFullScreen`;
1680
- if (typeof document[name] === "function") {
1681
- _names.exitFullscreen = name;
1682
- }
1683
- }
1684
- name = `${prefix}FullscreenEnabled`;
1685
- if (document[name] !== void 0) {
1686
- _names.fullscreenEnabled = name;
1687
- } else {
1688
- name = `${prefix}FullScreenEnabled`;
1689
- if (document[name] !== void 0) {
1690
- _names.fullscreenEnabled = name;
1691
- }
1692
- }
1693
- name = `${prefix}FullscreenElement`;
1694
- if (document[name] !== void 0) {
1695
- _names.fullscreenElement = name;
1696
- } else {
1697
- name = `${prefix}FullScreenElement`;
1698
- if (document[name] !== void 0) {
1699
- _names.fullscreenElement = name;
1700
- }
1701
- }
1702
- name = `${prefix}fullscreenchange`;
1703
- if (document[`on${name}`] !== void 0) {
1704
- if (prefix === "ms") {
1705
- name = "MSFullscreenChange";
1706
- }
1707
- _names.fullscreenchange = name;
1708
- }
1709
- name = `${prefix}fullscreenerror`;
1710
- if (document[`on${name}`] !== void 0) {
1711
- if (prefix === "ms") {
1712
- name = "MSFullscreenError";
1713
- }
1714
- _names.fullscreenerror = name;
1715
- }
1716
- }
1717
- return _supportsFullscreen;
1718
- };
1719
- Fullscreen.requestFullscreen = function(element, vrDevice) {
1720
- if (!Fullscreen.supportsFullscreen()) {
1721
- return;
1722
- }
1723
- element[_names.requestFullscreen]({ vrDisplay: vrDevice });
1724
- };
1725
- Fullscreen.exitFullscreen = function() {
1726
- if (!Fullscreen.supportsFullscreen()) {
1727
- return;
1728
- }
1729
- document[_names.exitFullscreen]();
1730
- };
1731
- Fullscreen._names = _names;
1732
- var Fullscreen_default = Fullscreen;
1733
-
1734
- // packages/engine/Source/Core/FeatureDetection.js
1735
- var theNavigator;
1736
- if (typeof navigator !== "undefined") {
1737
- theNavigator = navigator;
1738
- } else {
1739
- theNavigator = {};
1740
- }
1741
- function extractVersion(versionString) {
1742
- const parts = versionString.split(".");
1743
- for (let i = 0, len = parts.length; i < len; ++i) {
1744
- parts[i] = parseInt(parts[i], 10);
1745
- }
1746
- return parts;
1747
- }
1748
- var isChromeResult;
1749
- var chromeVersionResult;
1750
- function isChrome() {
1751
- if (!defined_default(isChromeResult)) {
1752
- isChromeResult = false;
1753
- if (!isEdge()) {
1754
- const fields = / Chrome\/([\.0-9]+)/.exec(theNavigator.userAgent);
1755
- if (fields !== null) {
1756
- isChromeResult = true;
1757
- chromeVersionResult = extractVersion(fields[1]);
1758
- }
1759
- }
1760
- }
1761
- return isChromeResult;
1762
- }
1763
- function chromeVersion() {
1764
- return isChrome() && chromeVersionResult;
1765
- }
1766
- var isSafariResult;
1767
- var safariVersionResult;
1768
- function isSafari() {
1769
- if (!defined_default(isSafariResult)) {
1770
- isSafariResult = false;
1771
- if (!isChrome() && !isEdge() && / Safari\/[\.0-9]+/.test(theNavigator.userAgent)) {
1772
- const fields = / Version\/([\.0-9]+)/.exec(theNavigator.userAgent);
1773
- if (fields !== null) {
1774
- isSafariResult = true;
1775
- safariVersionResult = extractVersion(fields[1]);
1776
- }
1777
- }
1778
- }
1779
- return isSafariResult;
1780
- }
1781
- function safariVersion() {
1782
- return isSafari() && safariVersionResult;
1783
- }
1784
- var isWebkitResult;
1785
- var webkitVersionResult;
1786
- function isWebkit() {
1787
- if (!defined_default(isWebkitResult)) {
1788
- isWebkitResult = false;
1789
- const fields = / AppleWebKit\/([\.0-9]+)(\+?)/.exec(theNavigator.userAgent);
1790
- if (fields !== null) {
1791
- isWebkitResult = true;
1792
- webkitVersionResult = extractVersion(fields[1]);
1793
- webkitVersionResult.isNightly = !!fields[2];
1794
- }
1795
- }
1796
- return isWebkitResult;
1797
- }
1798
- function webkitVersion() {
1799
- return isWebkit() && webkitVersionResult;
1800
- }
1801
- var isEdgeResult;
1802
- var edgeVersionResult;
1803
- function isEdge() {
1804
- if (!defined_default(isEdgeResult)) {
1805
- isEdgeResult = false;
1806
- const fields = / Edg\/([\.0-9]+)/.exec(theNavigator.userAgent);
1807
- if (fields !== null) {
1808
- isEdgeResult = true;
1809
- edgeVersionResult = extractVersion(fields[1]);
1810
- }
1811
- }
1812
- return isEdgeResult;
1813
- }
1814
- function edgeVersion() {
1815
- return isEdge() && edgeVersionResult;
1816
- }
1817
- var isFirefoxResult;
1818
- var firefoxVersionResult;
1819
- function isFirefox() {
1820
- if (!defined_default(isFirefoxResult)) {
1821
- isFirefoxResult = false;
1822
- const fields = /Firefox\/([\.0-9]+)/.exec(theNavigator.userAgent);
1823
- if (fields !== null) {
1824
- isFirefoxResult = true;
1825
- firefoxVersionResult = extractVersion(fields[1]);
1826
- }
1827
- }
1828
- return isFirefoxResult;
1829
- }
1830
- var isWindowsResult;
1831
- function isWindows() {
1832
- if (!defined_default(isWindowsResult)) {
1833
- isWindowsResult = /Windows/i.test(theNavigator.appVersion);
1834
- }
1835
- return isWindowsResult;
1836
- }
1837
- var isIPadOrIOSResult;
1838
- function isIPadOrIOS() {
1839
- if (!defined_default(isIPadOrIOSResult)) {
1840
- isIPadOrIOSResult = navigator.platform === "iPhone" || navigator.platform === "iPod" || navigator.platform === "iPad";
1841
- }
1842
- return isIPadOrIOSResult;
1843
- }
1844
- function firefoxVersion() {
1845
- return isFirefox() && firefoxVersionResult;
1846
- }
1847
- var hasPointerEvents;
1848
- function supportsPointerEvents() {
1849
- if (!defined_default(hasPointerEvents)) {
1850
- hasPointerEvents = !isFirefox() && typeof PointerEvent !== "undefined" && (!defined_default(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);
1851
- }
1852
- return hasPointerEvents;
1853
- }
1854
- var imageRenderingValueResult;
1855
- var supportsImageRenderingPixelatedResult;
1856
- function supportsImageRenderingPixelated() {
1857
- if (!defined_default(supportsImageRenderingPixelatedResult)) {
1858
- const canvas = document.createElement("canvas");
1859
- canvas.setAttribute(
1860
- "style",
1861
- "image-rendering: -moz-crisp-edges;image-rendering: pixelated;"
1862
- );
1863
- const tmp = canvas.style.imageRendering;
1864
- supportsImageRenderingPixelatedResult = defined_default(tmp) && tmp !== "";
1865
- if (supportsImageRenderingPixelatedResult) {
1866
- imageRenderingValueResult = tmp;
1867
- }
1868
- }
1869
- return supportsImageRenderingPixelatedResult;
1870
- }
1871
- function imageRenderingValue() {
1872
- return supportsImageRenderingPixelated() ? imageRenderingValueResult : void 0;
1873
- }
1874
- function supportsWebP() {
1875
- if (!supportsWebP.initialized) {
1876
- throw new DeveloperError_default(
1877
- "You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP"
1878
- );
1879
- }
1880
- return supportsWebP._result;
1881
- }
1882
- supportsWebP._promise = void 0;
1883
- supportsWebP._result = void 0;
1884
- supportsWebP.initialize = function() {
1885
- if (defined_default(supportsWebP._promise)) {
1886
- return supportsWebP._promise;
1887
- }
1888
- supportsWebP._promise = new Promise((resolve) => {
1889
- const image = new Image();
1890
- image.onload = function() {
1891
- supportsWebP._result = image.width > 0 && image.height > 0;
1892
- resolve(supportsWebP._result);
1893
- };
1894
- image.onerror = function() {
1895
- supportsWebP._result = false;
1896
- resolve(supportsWebP._result);
1897
- };
1898
- image.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
1899
- });
1900
- return supportsWebP._promise;
1901
- };
1902
- Object.defineProperties(supportsWebP, {
1903
- initialized: {
1904
- get: function() {
1905
- return defined_default(supportsWebP._result);
1906
- }
1907
- }
1908
- });
1909
- var typedArrayTypes = [];
1910
- if (typeof ArrayBuffer !== "undefined") {
1911
- typedArrayTypes.push(
1912
- Int8Array,
1913
- Uint8Array,
1914
- Int16Array,
1915
- Uint16Array,
1916
- Int32Array,
1917
- Uint32Array,
1918
- Float32Array,
1919
- Float64Array
1920
- );
1921
- if (typeof Uint8ClampedArray !== "undefined") {
1922
- typedArrayTypes.push(Uint8ClampedArray);
1923
- }
1924
- if (typeof Uint8ClampedArray !== "undefined") {
1925
- typedArrayTypes.push(Uint8ClampedArray);
1926
- }
1927
- if (typeof BigInt64Array !== "undefined") {
1928
- typedArrayTypes.push(BigInt64Array);
1929
- }
1930
- if (typeof BigUint64Array !== "undefined") {
1931
- typedArrayTypes.push(BigUint64Array);
1932
- }
1933
- }
1934
- var FeatureDetection = {
1935
- isChrome,
1936
- chromeVersion,
1937
- isSafari,
1938
- safariVersion,
1939
- isWebkit,
1940
- webkitVersion,
1941
- isEdge,
1942
- edgeVersion,
1943
- isFirefox,
1944
- firefoxVersion,
1945
- isWindows,
1946
- isIPadOrIOS,
1947
- hardwareConcurrency: theNavigator.hardwareConcurrency ?? 3,
1948
- supportsPointerEvents,
1949
- supportsImageRenderingPixelated,
1950
- supportsWebP,
1951
- imageRenderingValue,
1952
- typedArrayTypes
1953
- };
1954
- FeatureDetection.supportsBasis = function(scene) {
1955
- return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;
1956
- };
1957
- FeatureDetection.supportsFullscreen = function() {
1958
- return Fullscreen_default.supportsFullscreen();
1959
- };
1960
- FeatureDetection.supportsTypedArrays = function() {
1961
- return typeof ArrayBuffer !== "undefined";
1962
- };
1963
- FeatureDetection.supportsBigInt64Array = function() {
1964
- return typeof BigInt64Array !== "undefined";
1965
- };
1966
- FeatureDetection.supportsBigUint64Array = function() {
1967
- return typeof BigUint64Array !== "undefined";
1968
- };
1969
- FeatureDetection.supportsBigInt = function() {
1970
- return typeof BigInt !== "undefined";
1971
- };
1972
- FeatureDetection.supportsWebWorkers = function() {
1973
- return typeof Worker !== "undefined";
1974
- };
1975
- FeatureDetection.supportsWebAssembly = function() {
1976
- return typeof WebAssembly !== "undefined";
1977
- };
1978
- FeatureDetection.supportsWebgl2 = function(scene) {
1979
- Check_default.defined("scene", scene);
1980
- return scene.context.webgl2;
1981
- };
1982
- FeatureDetection.supportsEsmWebWorkers = function() {
1983
- return !isFirefox() || parseInt(firefoxVersionResult) >= 114;
1984
- };
1985
- var FeatureDetection_default = FeatureDetection;
1986
-
1987
- export {
1988
- Cartographic_default,
1989
- Cartesian2_default,
1990
- Ellipsoid_default,
1991
- FeatureDetection_default
1992
- };