@cesium/engine 23.0.1 → 25.0.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 (398) hide show
  1. package/Build/Workers/{chunk-ZEMJQKHD.js → chunk-35H3UBIO.js} +13 -12
  2. package/Build/Workers/{chunk-PQTSXJBJ.js → chunk-3LSD7OOA.js} +16 -16
  3. package/Build/Workers/{chunk-PUO7BYDY.js → chunk-3RFFPH4M.js} +1 -1
  4. package/Build/Workers/{chunk-PBECJOWF.js → chunk-3TKLDHV3.js} +2 -2
  5. package/Build/Workers/{chunk-TMCTZ5E3.js → chunk-3VDDRF2E.js} +14 -14
  6. package/Build/Workers/{chunk-FKU77FNM.js → chunk-3XY3MVPG.js} +4 -4
  7. package/Build/Workers/{chunk-2OBWHTIC.js → chunk-4GF4MVPY.js} +7 -7
  8. package/Build/Workers/{chunk-JUKGMJX7.js → chunk-4MTRQFJP.js} +3 -2
  9. package/Build/Workers/{chunk-66OWUDO7.js → chunk-4QQXGTCE.js} +8 -8
  10. package/Build/Workers/{chunk-ALTCIHRH.js → chunk-4XXHJI6Y.js} +17 -17
  11. package/Build/Workers/{chunk-K7UTK4OM.js → chunk-5T6QQAJW.js} +3 -2
  12. package/Build/Workers/{chunk-IJ3SUMK3.js → chunk-6SDGQI27.js} +3 -2
  13. package/Build/Workers/{chunk-FXSRA5UG.js → chunk-77RL3MBD.js} +6 -5
  14. package/Build/Workers/{chunk-G6MJ3ZW3.js → chunk-7LSFAEWF.js} +12 -11
  15. package/Build/Workers/{chunk-C6HHBKT5.js → chunk-A7A433MD.js} +5 -5
  16. package/Build/Workers/{chunk-PGZ3B6CB.js → chunk-A7ZBMVFS.js} +14 -14
  17. package/Build/Workers/{chunk-OZYB3AOR.js → chunk-ACFFCHHZ.js} +11 -11
  18. package/Build/Workers/{chunk-DNMASBMH.js → chunk-AEAVLYPS.js} +2 -2
  19. package/Build/Workers/{chunk-VPWYHFQA.js → chunk-AWFZHD2B.js} +4 -4
  20. package/Build/Workers/{chunk-TFPG3ZKW.js → chunk-BTX2NL3P.js} +59 -46
  21. package/Build/Workers/{chunk-TNXOPEIG.js → chunk-BVAIWR7O.js} +12 -12
  22. package/Build/Workers/chunk-CKQP3DSS.js +973 -0
  23. package/Build/Workers/{chunk-N6HRZLS6.js → chunk-CZ23Y3RM.js} +2 -2
  24. package/Build/Workers/{chunk-EIC3VAOZ.js → chunk-DFEI5MAV.js} +7 -7
  25. package/Build/Workers/{chunk-BTP3634E.js → chunk-DH26SNAB.js} +4 -1
  26. package/Build/Workers/{chunk-TXYQNXNW.js → chunk-DYT5NR6P.js} +3 -3
  27. package/Build/Workers/{chunk-O67UP5YO.js → chunk-EZARA5FJ.js} +13 -13
  28. package/Build/Workers/{chunk-YSJRB2UZ.js → chunk-FIBS5S7R.js} +2 -2
  29. package/Build/Workers/{chunk-2M7DKGLW.js → chunk-FVLVVOBQ.js} +10 -10
  30. package/Build/Workers/{chunk-B2VA6IEL.js → chunk-GL7DNVUS.js} +5 -5
  31. package/Build/Workers/{chunk-77DJBHMI.js → chunk-GPIGURCG.js} +59 -32
  32. package/Build/Workers/{chunk-QPXGGVHC.js → chunk-H2A4USJR.js} +10 -10
  33. package/Build/Workers/chunk-HSVQATK2.js +147 -0
  34. package/Build/Workers/{chunk-HXEPZWJN.js → chunk-HVMG6AG4.js} +11 -10
  35. package/Build/Workers/{chunk-H3TVRJLY.js → chunk-I3A6DXYZ.js} +4 -4
  36. package/Build/Workers/{chunk-UEWYSOFD.js → chunk-ITD2IN7N.js} +2 -2
  37. package/Build/Workers/{chunk-CYOPNGPX.js → chunk-J3OFS2RD.js} +12 -12
  38. package/Build/Workers/{chunk-RZX6LOG6.js → chunk-J647NNZW.js} +6 -6
  39. package/Build/Workers/{chunk-GLCPE2BJ.js → chunk-J7KQEKPK.js} +13 -13
  40. package/Build/Workers/{chunk-XPMXRJDD.js → chunk-K6NFIRFB.js} +5 -5
  41. package/Build/Workers/{chunk-CID5SY7L.js → chunk-LH5SF3XV.js} +7 -6
  42. package/Build/Workers/{chunk-UOQB7XQI.js → chunk-ND3NTTOF.js} +713 -435
  43. package/Build/Workers/chunk-QO2CGXMP.js +2342 -0
  44. package/Build/Workers/chunk-QSDY4NS7.js +1287 -0
  45. package/Build/Workers/chunk-QXNQQYPV.js +3201 -0
  46. package/Build/Workers/{chunk-CJ7ZDY77.js → chunk-ST2UWDUU.js} +5 -5
  47. package/Build/Workers/{chunk-YDR5LX5Z.js → chunk-TA777BGS.js} +3 -2
  48. package/Build/Workers/{chunk-U4SWB6TI.js → chunk-TAI4HLII.js} +4 -4
  49. package/Build/Workers/{chunk-VX774SWE.js → chunk-URUCCIPS.js} +6 -6
  50. package/Build/Workers/{chunk-MNSNOONX.js → chunk-VQKLRBIK.js} +7 -7
  51. package/Build/Workers/{chunk-CVAAIRNP.js → chunk-WC57YYBN.js} +2 -2
  52. package/Build/Workers/{chunk-QNABVTTP.js → chunk-WN6P5UDH.js} +12 -12
  53. package/Build/Workers/{chunk-CNLXMOPM.js → chunk-WNN5D4W3.js} +12 -11
  54. package/Build/Workers/{chunk-4JJQRZYL.js → chunk-WTQGE7Q6.js} +17 -17
  55. package/Build/Workers/{chunk-FCJQO4NC.js → chunk-WUBKZFF6.js} +2213 -1349
  56. package/Build/Workers/{chunk-3UQ2YMPP.js → chunk-ZAPOS52G.js} +12 -10
  57. package/Build/Workers/{chunk-LHFC4R7Z.js → chunk-ZCCIIBZT.js} +6 -6
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +175 -118
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +24 -23
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +25 -25
  100. package/Build/Workers/createWallOutlineGeometry.js +24 -24
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  103. package/Build/Workers/decodeI3S.js +12 -12
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +12 -9
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/ArcType.js +6 -1
  112. package/Source/Core/ArticulationStageType.js +5 -1
  113. package/Source/Core/AssociativeArray.js +100 -94
  114. package/Source/Core/BoundingSphere.js +1296 -1300
  115. package/Source/Core/Cartesian2.js +7 -5
  116. package/Source/Core/Cartesian3.js +9 -8
  117. package/Source/Core/Cartesian4.js +8 -6
  118. package/Source/Core/Cartographic.js +257 -249
  119. package/Source/Core/ClockRange.js +6 -1
  120. package/Source/Core/ClockStep.js +6 -1
  121. package/Source/Core/Color.js +846 -835
  122. package/Source/Core/ComponentDatatype.js +4 -1
  123. package/Source/Core/CornerType.js +6 -1
  124. package/Source/Core/Credit.js +121 -124
  125. package/Source/Core/DeveloperError.js +2 -1
  126. package/Source/Core/Ellipsoid.js +637 -660
  127. package/Source/Core/ExtrapolationType.js +6 -1
  128. package/Source/Core/GeocodeType.js +6 -1
  129. package/Source/Core/GeographicProjection.js +74 -74
  130. package/Source/Core/GeographicTilingScheme.js +179 -198
  131. package/Source/Core/GeometryOffsetAttribute.js +7 -1
  132. package/Source/Core/GeometryType.js +7 -1
  133. package/Source/Core/HeightmapEncoding.js +6 -1
  134. package/Source/Core/ITwinPlatform.js +1 -0
  135. package/Source/Core/Iau2006XysData.js +24 -13
  136. package/Source/Core/IndexDatatype.js +3 -1
  137. package/Source/Core/InterpolationType.js +5 -1
  138. package/Source/Core/Intersect.js +6 -1
  139. package/Source/Core/Ion.js +1 -1
  140. package/Source/Core/IonGeocodeProviderType.js +5 -1
  141. package/Source/Core/JulianDate.js +850 -848
  142. package/Source/Core/KeyboardEventModifier.js +6 -1
  143. package/Source/Core/MapProjection.js +39 -44
  144. package/Source/Core/Matrix2.js +906 -893
  145. package/Source/Core/Matrix3.js +1643 -1575
  146. package/Source/Core/Matrix4.js +2903 -2872
  147. package/Source/Core/PixelFormat.js +3 -1
  148. package/Source/Core/PrimitiveType.js +11 -1
  149. package/Source/Core/Ray.js +62 -60
  150. package/Source/Core/Rectangle.js +913 -904
  151. package/Source/Core/ReferenceFrame.js +6 -1
  152. package/Source/Core/RequestScheduler.js +8 -3
  153. package/Source/Core/RequestState.js +6 -1
  154. package/Source/Core/RequestType.js +6 -1
  155. package/Source/Core/S2Cell.js +2 -2
  156. package/Source/Core/ScreenSpaceEventType.js +6 -1
  157. package/Source/Core/TerrainMesh.js +10 -1
  158. package/Source/Core/TerrainPicker.js +1 -0
  159. package/Source/Core/TerrainQuantization.js +6 -1
  160. package/Source/Core/TilingScheme.js +100 -98
  161. package/Source/Core/TimeConstants.js +6 -1
  162. package/Source/Core/TimeStandard.js +6 -1
  163. package/Source/Core/TrackingReferenceFrame.js +6 -1
  164. package/Source/Core/Visibility.js +6 -1
  165. package/Source/Core/VulkanConstants.js +6 -1
  166. package/Source/Core/WallGeometry.js +1 -1
  167. package/Source/Core/WallOutlineGeometry.js +1 -1
  168. package/Source/Core/WebGLConstants.js +6 -1
  169. package/Source/Core/WebMercatorProjection.js +108 -109
  170. package/Source/Core/WebMercatorTilingScheme.js +246 -242
  171. package/Source/Core/WindingOrder.js +3 -1
  172. package/Source/Core/assert.js +27 -0
  173. package/Source/Core/globalTypes.js +4 -0
  174. package/Source/DataSources/CzmlDataSource.js +9 -0
  175. package/Source/DataSources/PathGraphics.js +13 -0
  176. package/Source/DataSources/PathVisualizer.js +330 -18
  177. package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
  178. package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
  179. package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +4 -1
  180. package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +4 -1
  181. package/Source/DataSources/StripeOrientation.js +6 -1
  182. package/Source/Renderer/BufferUsage.js +20 -9
  183. package/Source/Renderer/Context.js +2 -29
  184. package/Source/Renderer/DrawCommand.js +435 -403
  185. package/Source/Renderer/MipmapHint.js +5 -1
  186. package/Source/Renderer/Pass.js +7 -1
  187. package/Source/Renderer/PickId.js +44 -0
  188. package/Source/Renderer/PixelDatatype.js +3 -1
  189. package/Source/Renderer/RenderState.js +2 -2
  190. package/Source/Renderer/RenderbufferFormat.js +5 -1
  191. package/Source/Renderer/ShaderDestination.js +4 -1
  192. package/Source/Renderer/TextureMagnificationFilter.js +3 -1
  193. package/Source/Renderer/TextureMinificationFilter.js +3 -1
  194. package/Source/Renderer/TextureWrap.js +5 -1
  195. package/Source/Renderer/VertexArray.js +80 -0
  196. package/Source/Scene/AlphaMode.js +5 -1
  197. package/Source/Scene/ArcGisBaseMapType.js +6 -1
  198. package/Source/Scene/ArcGisMapService.js +1 -1
  199. package/Source/Scene/AttributeType.js +3 -1
  200. package/Source/Scene/Axis.js +3 -1
  201. package/Source/Scene/BillboardCollection.js +65 -364
  202. package/Source/Scene/BingMapsStyle.js +6 -1
  203. package/Source/Scene/BlendEquation.js +6 -1
  204. package/Source/Scene/BlendFunction.js +6 -1
  205. package/Source/Scene/BlendOption.js +6 -1
  206. package/Source/Scene/BlendingState.js +6 -1
  207. package/Source/Scene/BufferLoader.js +0 -2
  208. package/Source/Scene/BufferPoint.js +148 -0
  209. package/Source/Scene/BufferPointCollection.js +138 -0
  210. package/Source/Scene/BufferPointMaterial.js +95 -0
  211. package/Source/Scene/BufferPolygon.js +516 -0
  212. package/Source/Scene/BufferPolygonCollection.js +370 -0
  213. package/Source/Scene/BufferPolygonMaterial.js +41 -0
  214. package/Source/Scene/BufferPolyline.js +185 -0
  215. package/Source/Scene/BufferPolylineCollection.js +138 -0
  216. package/Source/Scene/BufferPolylineMaterial.js +93 -0
  217. package/Source/Scene/BufferPrimitive.js +347 -0
  218. package/Source/Scene/BufferPrimitiveCollection.js +818 -0
  219. package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
  220. package/Source/Scene/CameraEventType.js +6 -1
  221. package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
  222. package/Source/Scene/Cesium3DTileContent.js +5 -1
  223. package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
  224. package/Source/Scene/Cesium3DTileContentState.js +6 -1
  225. package/Source/Scene/Cesium3DTileContentType.js +3 -1
  226. package/Source/Scene/Cesium3DTileFeature.js +289 -306
  227. package/Source/Scene/Cesium3DTileOptimizationHint.js +6 -1
  228. package/Source/Scene/Cesium3DTilePass.js +5 -1
  229. package/Source/Scene/Cesium3DTilePointFeature.js +433 -511
  230. package/Source/Scene/Cesium3DTileRefine.js +6 -1
  231. package/Source/Scene/Cesium3DTileStyle.js +22 -0
  232. package/Source/Scene/Cesium3DTileVectorFeature.js +586 -0
  233. package/Source/Scene/Cesium3DTileset.js +2 -1
  234. package/Source/Scene/ClassificationType.js +3 -1
  235. package/Source/Scene/ClippingPolygonCollection.js +270 -101
  236. package/Source/Scene/CloudType.js +3 -1
  237. package/Source/Scene/ColorBlendMode.js +4 -1
  238. package/Source/Scene/CubeMapPanorama.js +4 -4
  239. package/Source/Scene/CullFace.js +6 -1
  240. package/Source/Scene/DepthFunction.js +6 -1
  241. package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
  242. package/Source/Scene/EquirectangularPanorama.js +1 -0
  243. package/Source/Scene/ExpressionNodeType.js +6 -1
  244. package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
  245. package/Source/Scene/GaussianSplatPrimitive.js +413 -70
  246. package/Source/Scene/GetFeatureInfoFormat.js +3 -3
  247. package/Source/Scene/GltfBufferViewLoader.js +0 -2
  248. package/Source/Scene/GltfDracoLoader.js +0 -2
  249. package/Source/Scene/GltfImageLoader.js +0 -3
  250. package/Source/Scene/GltfIndexBufferLoader.js +0 -4
  251. package/Source/Scene/GltfJsonLoader.js +0 -2
  252. package/Source/Scene/GltfLoader.js +215 -39
  253. package/Source/Scene/GltfLoaderUtil.js +14 -0
  254. package/Source/Scene/GltfSpzLoader.js +109 -2
  255. package/Source/Scene/GltfStructuralMetadataLoader.js +0 -2
  256. package/Source/Scene/GltfTextureLoader.js +0 -2
  257. package/Source/Scene/GltfVertexBufferLoader.js +0 -4
  258. package/Source/Scene/HeightReference.js +5 -1
  259. package/Source/Scene/HorizontalOrigin.js +6 -1
  260. package/Source/Scene/ITwinData.js +1 -0
  261. package/Source/Scene/ImageryProvider.js +1 -1
  262. package/Source/Scene/ImageryState.js +6 -1
  263. package/Source/Scene/ImplicitSubdivisionScheme.js +3 -1
  264. package/Source/Scene/InstanceAttributeSemantic.js +3 -1
  265. package/Source/Scene/IonWorldImageryStyle.js +6 -1
  266. package/Source/Scene/JobType.js +6 -1
  267. package/Source/Scene/Label.js +32 -0
  268. package/Source/Scene/LabelCollection.js +14 -13
  269. package/Source/Scene/LabelStyle.js +6 -1
  270. package/Source/Scene/MapMode2D.js +6 -1
  271. package/Source/Scene/Material.js +2 -0
  272. package/Source/Scene/Megatexture.js +1 -0
  273. package/Source/Scene/MetadataClassProperty.js +24 -10
  274. package/Source/Scene/MetadataComponentType.js +118 -24
  275. package/Source/Scene/MetadataSchemaLoader.js +0 -2
  276. package/Source/Scene/MetadataSemantic.js +6 -2
  277. package/Source/Scene/MetadataType.js +3 -1
  278. package/Source/Scene/Model/B3dmLoader.js +0 -3
  279. package/Source/Scene/Model/CustomShaderMode.js +3 -1
  280. package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
  281. package/Source/Scene/Model/CustomShaderTranslucencyMode.js +5 -1
  282. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +735 -264
  283. package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +5 -1
  284. package/Source/Scene/Model/Extensions/Gpm/StorageType.js +5 -1
  285. package/Source/Scene/Model/GeoJsonLoader.js +0 -2
  286. package/Source/Scene/Model/I3dmLoader.js +0 -3
  287. package/Source/Scene/Model/InstancingPipelineStage.js +1 -1
  288. package/Source/Scene/Model/LightingModel.js +5 -1
  289. package/Source/Scene/Model/MaterialPipelineStage.js +331 -3
  290. package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
  291. package/Source/Scene/Model/ModelDrawCommand.js +6 -0
  292. package/Source/Scene/Model/ModelReader.js +475 -4
  293. package/Source/Scene/Model/ModelRuntimePrimitive.js +2 -1
  294. package/Source/Scene/Model/ModelType.js +3 -1
  295. package/Source/Scene/Model/ModelUtility.js +3 -1
  296. package/Source/Scene/Model/PntsLoader.js +4 -3
  297. package/Source/Scene/Model/StyleCommandsNeeded.js +3 -1
  298. package/Source/Scene/Model/UniformType.js +5 -1
  299. package/Source/Scene/Model/VaryingType.js +5 -1
  300. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +375 -0
  301. package/Source/Scene/Model/pickModel.js +94 -299
  302. package/Source/Scene/ModelAnimationLoop.js +6 -1
  303. package/Source/Scene/ModelAnimationState.js +6 -1
  304. package/Source/Scene/ModelComponents.js +1639 -1542
  305. package/Source/Scene/PickedMetadataInfo.js +1 -0
  306. package/Source/Scene/PrimitiveState.js +7 -1
  307. package/Source/Scene/QuadtreeOccluders.js +20 -15
  308. package/Source/Scene/QuadtreeTile.js +547 -541
  309. package/Source/Scene/QuadtreeTileLoadState.js +6 -1
  310. package/Source/Scene/QuadtreeTileProvider.js +159 -175
  311. package/Source/Scene/ResourceLoader.js +0 -1
  312. package/Source/Scene/ResourceLoaderState.js +7 -1
  313. package/Source/Scene/SceneMode.js +4 -1
  314. package/Source/Scene/ScreenSpaceCameraController.js +13 -0
  315. package/Source/Scene/ShadowMode.js +3 -1
  316. package/Source/Scene/SkyBox.js +17 -8
  317. package/Source/Scene/SplitDirection.js +6 -1
  318. package/Source/Scene/StencilFunction.js +6 -1
  319. package/Source/Scene/StencilOperation.js +6 -1
  320. package/Source/Scene/TerrainState.js +7 -1
  321. package/Source/Scene/TileBoundingRegion.js +1 -1
  322. package/Source/Scene/TileBoundingS2Cell.js +1 -1
  323. package/Source/Scene/TileBoundingSphere.js +1 -1
  324. package/Source/Scene/TileState.js +7 -1
  325. package/Source/Scene/Tonemapper.js +5 -1
  326. package/Source/Scene/TweenCollection.js +7 -0
  327. package/Source/Scene/VectorGltf3DTileContent.js +403 -0
  328. package/Source/Scene/VertexAttributeSemantic.js +17 -1
  329. package/Source/Scene/VerticalOrigin.js +6 -1
  330. package/Source/Scene/VoxelBoxShape.js +12 -6
  331. package/Source/Scene/VoxelContent.js +2 -0
  332. package/Source/Scene/VoxelCylinderShape.js +39 -38
  333. package/Source/Scene/VoxelEllipsoidShape.js +46 -96
  334. package/Source/Scene/VoxelMetadataOrder.js +6 -1
  335. package/Source/Scene/VoxelProvider.js +1 -0
  336. package/Source/Scene/VoxelShapeType.js +3 -1
  337. package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
  338. package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
  339. package/Source/Scene/parseStructuralMetadata.js +97 -37
  340. package/Source/Scene/renderBufferPointCollection.js +285 -0
  341. package/Source/Scene/renderBufferPolygonCollection.js +339 -0
  342. package/Source/Scene/renderBufferPolylineCollection.js +478 -0
  343. package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
  344. package/Source/Shaders/BillboardCollectionFS.js +2 -77
  345. package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
  346. package/Source/Shaders/BillboardCollectionVS.js +2 -60
  347. package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
  348. package/Source/Shaders/BufferPointMaterialFS.js +29 -0
  349. package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
  350. package/Source/Shaders/BufferPointMaterialVS.js +50 -0
  351. package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
  352. package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
  353. package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
  354. package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
  355. package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
  356. package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
  357. package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
  358. package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
  359. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  360. package/Source/Shaders/Builtin/Functions/computeTextureTransform.glsl +24 -0
  361. package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
  362. package/Source/Shaders/Model/ConstantLodStageFS.glsl +60 -0
  363. package/Source/Shaders/Model/ConstantLodStageFS.js +62 -0
  364. package/Source/Shaders/Model/ConstantLodStageVS.glsl +12 -0
  365. package/Source/Shaders/Model/ConstantLodStageVS.js +13 -0
  366. package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
  367. package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
  368. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
  369. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
  370. package/Source/Shaders/Model/MaterialStageFS.glsl +46 -20
  371. package/Source/Shaders/Model/MaterialStageFS.js +46 -20
  372. package/Source/Shaders/Model/ModelFS.glsl +15 -0
  373. package/Source/Shaders/Model/ModelFS.js +15 -0
  374. package/Source/Shaders/Model/ModelVS.glsl +8 -0
  375. package/Source/Shaders/Model/ModelVS.js +8 -0
  376. package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
  377. package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
  378. package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
  379. package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
  380. package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
  381. package/Source/Shaders/Voxels/VoxelFS.js +1 -1
  382. package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +0 -1
  383. package/Source/Shaders/Voxels/convertLocalToBoxUv.js +0 -1
  384. package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +7 -9
  385. package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +7 -9
  386. package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +7 -17
  387. package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +7 -17
  388. package/Source/Widget/CesiumWidget.js +11 -4
  389. package/Source/Workers/decodeDraco.js +3 -0
  390. package/Source/Workers/decodeI3S.js +5 -2
  391. package/index.d.ts +1332 -402
  392. package/index.js +111 -81
  393. package/package.json +3 -3
  394. package/Build/Workers/chunk-54O3AGOA.js +0 -642
  395. package/Build/Workers/chunk-6U5QMZU3.js +0 -940
  396. package/Build/Workers/chunk-HNDE73JK.js +0 -1829
  397. package/Build/Workers/chunk-PAFMAR7A.js +0 -2357
  398. package/Build/Workers/chunk-S53HSRT6.js +0 -114
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.139.1
4
+ * Version 1.141.0
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -25,17 +25,18 @@
25
25
 
26
26
  import {
27
27
  Cartesian3_default
28
- } from "./chunk-HNDE73JK.js";
28
+ } from "./chunk-QO2CGXMP.js";
29
29
  import {
30
30
  Math_default
31
- } from "./chunk-TXYQNXNW.js";
31
+ } from "./chunk-DYT5NR6P.js";
32
32
  import {
33
33
  Check_default,
34
34
  DeveloperError_default
35
- } from "./chunk-N6HRZLS6.js";
35
+ } from "./chunk-CZ23Y3RM.js";
36
36
  import {
37
+ __publicField,
37
38
  defined_default
38
- } from "./chunk-BTP3634E.js";
39
+ } from "./chunk-DH26SNAB.js";
39
40
 
40
41
  // packages/engine/Source/Core/scaleToGeodeticSurface.js
41
42
  var scaleToGeodeticSurfaceIntersection = new Cartesian3_default();
@@ -123,122 +124,222 @@ function scaleToGeodeticSurface(cartesian, oneOverRadii, oneOverRadiiSquared, ce
123
124
  var scaleToGeodeticSurface_default = scaleToGeodeticSurface;
124
125
 
125
126
  // packages/engine/Source/Core/Cartographic.js
126
- function Cartographic(longitude, latitude, height) {
127
- this.longitude = longitude ?? 0;
128
- this.latitude = latitude ?? 0;
129
- this.height = height ?? 0;
130
- }
131
- Cartographic.fromRadians = function(longitude, latitude, height, result) {
132
- Check_default.typeOf.number("longitude", longitude);
133
- Check_default.typeOf.number("latitude", latitude);
134
- height = height ?? 0;
135
- if (!defined_default(result)) {
136
- return new Cartographic(longitude, latitude, height);
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
137
  }
138
- result.longitude = longitude;
139
- result.latitude = latitude;
140
- result.height = height;
141
- return result;
142
- };
143
- Cartographic.fromDegrees = function(longitude, latitude, height, result) {
144
- Check_default.typeOf.number("longitude", longitude);
145
- Check_default.typeOf.number("latitude", latitude);
146
- longitude = Math_default.toRadians(longitude);
147
- latitude = Math_default.toRadians(latitude);
148
- return Cartographic.fromRadians(longitude, latitude, height, result);
149
- };
150
- var cartesianToCartographicN = new Cartesian3_default();
151
- var cartesianToCartographicP = new Cartesian3_default();
152
- var cartesianToCartographicH = new Cartesian3_default();
153
- Cartographic._ellipsoidOneOverRadii = new Cartesian3_default(
154
- 1 / 6378137,
155
- 1 / 6378137,
156
- 1 / 6356752314245179e-9
157
- );
158
- Cartographic._ellipsoidOneOverRadiiSquared = new Cartesian3_default(
159
- 1 / (6378137 * 6378137),
160
- 1 / (6378137 * 6378137),
161
- 1 / (6356752314245179e-9 * 6356752314245179e-9)
162
- );
163
- Cartographic._ellipsoidCenterToleranceSquared = Math_default.EPSILON1;
164
- Cartographic.fromCartesian = function(cartesian, ellipsoid, result) {
165
- const oneOverRadii = defined_default(ellipsoid) ? ellipsoid.oneOverRadii : Cartographic._ellipsoidOneOverRadii;
166
- const oneOverRadiiSquared = defined_default(ellipsoid) ? ellipsoid.oneOverRadiiSquared : Cartographic._ellipsoidOneOverRadiiSquared;
167
- const centerToleranceSquared = defined_default(ellipsoid) ? ellipsoid._centerToleranceSquared : Cartographic._ellipsoidCenterToleranceSquared;
168
- const p = scaleToGeodeticSurface_default(
169
- cartesian,
170
- oneOverRadii,
171
- oneOverRadiiSquared,
172
- centerToleranceSquared,
173
- cartesianToCartographicP
174
- );
175
- if (!defined_default(p)) {
176
- return void 0;
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;
177
159
  }
178
- let n = Cartesian3_default.multiplyComponents(
179
- p,
180
- oneOverRadiiSquared,
181
- cartesianToCartographicN
182
- );
183
- n = Cartesian3_default.normalize(n, n);
184
- const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH);
185
- const longitude = Math.atan2(n.y, n.x);
186
- const latitude = Math.asin(n.z);
187
- const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
188
- if (!defined_default(result)) {
189
- return new Cartographic(longitude, latitude, height);
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);
190
177
  }
191
- result.longitude = longitude;
192
- result.latitude = latitude;
193
- result.height = height;
194
- return result;
195
- };
196
- Cartographic.toCartesian = function(cartographic, ellipsoid, result) {
197
- Check_default.defined("cartographic", cartographic);
198
- return Cartesian3_default.fromRadians(
199
- cartographic.longitude,
200
- cartographic.latitude,
201
- cartographic.height,
202
- ellipsoid,
203
- result
204
- );
205
- };
206
- Cartographic.clone = function(cartographic, result) {
207
- if (!defined_default(cartographic)) {
208
- return void 0;
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;
209
218
  }
210
- if (!defined_default(result)) {
211
- return new Cartographic(
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(
212
231
  cartographic.longitude,
213
232
  cartographic.latitude,
214
- cartographic.height
233
+ cartographic.height,
234
+ ellipsoid,
235
+ result
215
236
  );
216
237
  }
217
- result.longitude = cartographic.longitude;
218
- result.latitude = cartographic.latitude;
219
- result.height = cartographic.height;
220
- return result;
221
- };
222
- Cartographic.equals = function(left, right) {
223
- return left === right || defined_default(left) && defined_default(right) && left.longitude === right.longitude && left.latitude === right.latitude && left.height === right.height;
224
- };
225
- Cartographic.equalsEpsilon = function(left, right, epsilon) {
226
- epsilon = epsilon ?? 0;
227
- 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;
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
+ }
228
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;
229
339
  Cartographic.ZERO = Object.freeze(new Cartographic(0, 0, 0));
230
- Cartographic.prototype.clone = function(result) {
231
- return Cartographic.clone(this, result);
232
- };
233
- Cartographic.prototype.equals = function(right) {
234
- return Cartographic.equals(this, right);
235
- };
236
- Cartographic.prototype.equalsEpsilon = function(right, epsilon) {
237
- return Cartographic.equalsEpsilon(this, right, epsilon);
238
- };
239
- Cartographic.prototype.toString = function() {
240
- return `(${this.longitude}, ${this.latitude}, ${this.height})`;
241
- };
340
+ var cartesianToCartographicN = new Cartesian3_default();
341
+ var cartesianToCartographicP = new Cartesian3_default();
342
+ var cartesianToCartographicH = new Cartesian3_default();
242
343
  var Cartographic_default = Cartographic;
243
344
 
244
345
  // packages/engine/Source/Core/Cartesian2.js
@@ -289,10 +390,10 @@ var Cartesian2 = class _Cartesian2 {
289
390
  * Stores the provided instance into the provided array.
290
391
  *
291
392
  * @param {Cartesian2} value The value to pack.
292
- * @param {number[]|TypedArray} array The array to pack into.
393
+ * @param {number[]} array The array to pack into.
293
394
  * @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
294
395
  *
295
- * @returns {number[]|TypedArray} The array that was packed into
396
+ * @returns {number[]} The array that was packed into
296
397
  */
297
398
  static pack(value, array, startingIndex) {
298
399
  Check_default.typeOf.object("value", value);
@@ -305,7 +406,7 @@ var Cartesian2 = class _Cartesian2 {
305
406
  /**
306
407
  * Retrieves an instance from a packed array.
307
408
  *
308
- * @param {number[]|TypedArray} array The packed array.
409
+ * @param {number[]} array The packed array.
309
410
  * @param {number} [startingIndex=0] The starting index of the element to be unpacked.
310
411
  * @param {Cartesian2} [result] The object into which to store the result.
311
412
  * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
@@ -324,8 +425,8 @@ var Cartesian2 = class _Cartesian2 {
324
425
  * Flattens an array of Cartesian2s into an array of components.
325
426
  *
326
427
  * @param {Cartesian2[]} array The array of cartesians to pack.
327
- * @param {number[]|TypedArray} [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.
328
- * @returns {number[]|TypedArray} The packed array.
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.
329
430
  */
330
431
  static packArray(array, result) {
331
432
  Check_default.defined("array", array);
@@ -852,142 +953,136 @@ function initialize(ellipsoid, x, y, z) {
852
953
  ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
853
954
  }
854
955
  }
855
- function Ellipsoid(x, y, z) {
856
- this._radii = void 0;
857
- this._radiiSquared = void 0;
858
- this._radiiToTheFourth = void 0;
859
- this._oneOverRadii = void 0;
860
- this._oneOverRadiiSquared = void 0;
861
- this._minimumRadius = void 0;
862
- this._maximumRadius = void 0;
863
- this._centerToleranceSquared = void 0;
864
- this._squaredXOverSquaredZ = void 0;
865
- initialize(this, x, y, z);
866
- }
867
- Object.defineProperties(Ellipsoid.prototype, {
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
+ }
868
976
  /**
869
977
  * Gets the radii of the ellipsoid.
870
- * @memberof Ellipsoid.prototype
871
978
  * @type {Cartesian3}
872
979
  * @readonly
873
980
  */
874
- radii: {
875
- get: function() {
876
- return this._radii;
877
- }
878
- },
981
+ get radii() {
982
+ return this._radii;
983
+ }
879
984
  /**
880
985
  * Gets the squared radii of the ellipsoid.
881
- * @memberof Ellipsoid.prototype
882
986
  * @type {Cartesian3}
883
987
  * @readonly
884
988
  */
885
- radiiSquared: {
886
- get: function() {
887
- return this._radiiSquared;
888
- }
889
- },
989
+ get radiiSquared() {
990
+ return this._radiiSquared;
991
+ }
890
992
  /**
891
993
  * Gets the radii of the ellipsoid raise to the fourth power.
892
- * @memberof Ellipsoid.prototype
893
994
  * @type {Cartesian3}
894
995
  * @readonly
895
996
  */
896
- radiiToTheFourth: {
897
- get: function() {
898
- return this._radiiToTheFourth;
899
- }
900
- },
997
+ get radiiToTheFourth() {
998
+ return this._radiiToTheFourth;
999
+ }
901
1000
  /**
902
1001
  * Gets one over the radii of the ellipsoid.
903
- * @memberof Ellipsoid.prototype
904
1002
  * @type {Cartesian3}
905
1003
  * @readonly
906
1004
  */
907
- oneOverRadii: {
908
- get: function() {
909
- return this._oneOverRadii;
910
- }
911
- },
1005
+ get oneOverRadii() {
1006
+ return this._oneOverRadii;
1007
+ }
912
1008
  /**
913
1009
  * Gets one over the squared radii of the ellipsoid.
914
- * @memberof Ellipsoid.prototype
915
1010
  * @type {Cartesian3}
916
1011
  * @readonly
917
1012
  */
918
- oneOverRadiiSquared: {
919
- get: function() {
920
- return this._oneOverRadiiSquared;
921
- }
922
- },
1013
+ get oneOverRadiiSquared() {
1014
+ return this._oneOverRadiiSquared;
1015
+ }
923
1016
  /**
924
1017
  * Gets the minimum radius of the ellipsoid.
925
- * @memberof Ellipsoid.prototype
926
1018
  * @type {number}
927
1019
  * @readonly
928
1020
  */
929
- minimumRadius: {
930
- get: function() {
931
- return this._minimumRadius;
932
- }
933
- },
1021
+ get minimumRadius() {
1022
+ return this._minimumRadius;
1023
+ }
934
1024
  /**
935
1025
  * Gets the maximum radius of the ellipsoid.
936
- * @memberof Ellipsoid.prototype
937
1026
  * @type {number}
938
1027
  * @readonly
939
1028
  */
940
- maximumRadius: {
941
- get: function() {
942
- return this._maximumRadius;
943
- }
944
- }
945
- });
946
- Ellipsoid.clone = function(ellipsoid, result) {
947
- if (!defined_default(ellipsoid)) {
948
- return void 0;
1029
+ get maximumRadius() {
1030
+ return this._maximumRadius;
949
1031
  }
950
- const radii = ellipsoid._radii;
951
- if (!defined_default(result)) {
952
- return new Ellipsoid(radii.x, radii.y, radii.z);
953
- }
954
- Cartesian3_default.clone(radii, result._radii);
955
- Cartesian3_default.clone(ellipsoid._radiiSquared, result._radiiSquared);
956
- Cartesian3_default.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
957
- Cartesian3_default.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
958
- Cartesian3_default.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
959
- result._minimumRadius = ellipsoid._minimumRadius;
960
- result._maximumRadius = ellipsoid._maximumRadius;
961
- result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
962
- return result;
963
- };
964
- Ellipsoid.fromCartesian3 = function(cartesian, result) {
965
- if (!defined_default(result)) {
966
- result = new Ellipsoid();
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;
967
1060
  }
968
- if (!defined_default(cartesian)) {
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);
969
1082
  return result;
970
1083
  }
971
- initialize(result, cartesian.x, cartesian.y, cartesian.z);
972
- return result;
973
- };
974
- Ellipsoid.WGS84 = Object.freeze(
975
- new Ellipsoid(6378137, 6378137, 6356752314245179e-9)
976
- );
977
- Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1, 1, 1));
978
- Ellipsoid.MOON = Object.freeze(
979
- new Ellipsoid(
980
- Math_default.LUNAR_RADIUS,
981
- Math_default.LUNAR_RADIUS,
982
- Math_default.LUNAR_RADIUS
983
- )
984
- );
985
- Ellipsoid.MARS = Object.freeze(new Ellipsoid(3396190, 3396190, 3376200));
986
- Ellipsoid._default = Ellipsoid.WGS84;
987
- Object.defineProperties(Ellipsoid, {
988
1084
  /**
989
1085
  * The default ellipsoid used when not otherwise specified.
990
- * @memberof Ellipsoid
991
1086
  * @type {Ellipsoid}
992
1087
  * @example
993
1088
  * Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;
@@ -998,223 +1093,432 @@ Object.defineProperties(Ellipsoid, {
998
1093
  * 23.47315,
999
1094
  * );
1000
1095
  */
1001
- default: {
1002
- get: function() {
1003
- return Ellipsoid._default;
1004
- },
1005
- set: function(value) {
1006
- Check_default.typeOf.object("value", value);
1007
- Ellipsoid._default = value;
1008
- Cartesian3_default._ellipsoidRadiiSquared = value.radiiSquared;
1009
- Cartographic_default._ellipsoidOneOverRadii = value.oneOverRadii;
1010
- Cartographic_default._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;
1011
- Cartographic_default._ellipsoidCenterToleranceSquared = value._centerToleranceSquared;
1012
- }
1096
+ static get default() {
1097
+ return _Ellipsoid._default;
1013
1098
  }
1014
- });
1015
- Ellipsoid.prototype.clone = function(result) {
1016
- return Ellipsoid.clone(this, result);
1017
- };
1018
- Ellipsoid.packedLength = Cartesian3_default.packedLength;
1019
- Ellipsoid.pack = function(value, array, startingIndex) {
1020
- Check_default.typeOf.object("value", value);
1021
- Check_default.defined("array", array);
1022
- startingIndex = startingIndex ?? 0;
1023
- Cartesian3_default.pack(value._radii, array, startingIndex);
1024
- return array;
1025
- };
1026
- Ellipsoid.unpack = function(array, startingIndex, result) {
1027
- Check_default.defined("array", array);
1028
- startingIndex = startingIndex ?? 0;
1029
- const radii = Cartesian3_default.unpack(array, startingIndex);
1030
- return Ellipsoid.fromCartesian3(radii, result);
1031
- };
1032
- Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3_default.normalize;
1033
- Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function(cartographic, result) {
1034
- Check_default.typeOf.object("cartographic", cartographic);
1035
- const longitude = cartographic.longitude;
1036
- const latitude = cartographic.latitude;
1037
- const cosLatitude = Math.cos(latitude);
1038
- const x = cosLatitude * Math.cos(longitude);
1039
- const y = cosLatitude * Math.sin(longitude);
1040
- const z = Math.sin(latitude);
1041
- if (!defined_default(result)) {
1042
- result = new Cartesian3_default();
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;
1043
1106
  }
1044
- result.x = x;
1045
- result.y = y;
1046
- result.z = z;
1047
- return Cartesian3_default.normalize(result, result);
1048
- };
1049
- Ellipsoid.prototype.geodeticSurfaceNormal = function(cartesian, result) {
1050
- Check_default.typeOf.object("cartesian", cartesian);
1051
- if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {
1052
- throw new DeveloperError_default("cartesian has a NaN component");
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;
1053
1132
  }
1054
- if (Cartesian3_default.equalsEpsilon(cartesian, Cartesian3_default.ZERO, Math_default.EPSILON14)) {
1055
- return void 0;
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);
1056
1146
  }
1057
- if (!defined_default(result)) {
1058
- result = new Cartesian3_default();
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);
1059
1169
  }
1060
- result = Cartesian3_default.multiplyComponents(
1061
- cartesian,
1062
- this._oneOverRadiiSquared,
1063
- result
1064
- );
1065
- return Cartesian3_default.normalize(result, result);
1066
- };
1067
- var cartographicToCartesianNormal = new Cartesian3_default();
1068
- var cartographicToCartesianK = new Cartesian3_default();
1069
- Ellipsoid.prototype.cartographicToCartesian = function(cartographic, result) {
1070
- const n = cartographicToCartesianNormal;
1071
- const k = cartographicToCartesianK;
1072
- this.geodeticSurfaceNormalCartographic(cartographic, n);
1073
- Cartesian3_default.multiplyComponents(this._radiiSquared, n, k);
1074
- const gamma = Math.sqrt(Cartesian3_default.dot(n, k));
1075
- Cartesian3_default.divideByScalar(k, gamma, k);
1076
- Cartesian3_default.multiplyByScalar(n, cartographic.height, n);
1077
- if (!defined_default(result)) {
1078
- result = new Cartesian3_default();
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);
1079
1194
  }
1080
- return Cartesian3_default.add(k, n, result);
1081
- };
1082
- Ellipsoid.prototype.cartographicArrayToCartesianArray = function(cartographics, result) {
1083
- Check_default.defined("cartographics", cartographics);
1084
- const length = cartographics.length;
1085
- if (!defined_default(result)) {
1086
- result = new Array(length);
1087
- } else {
1088
- result.length = length;
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);
1089
1219
  }
1090
- for (let i = 0; i < length; i++) {
1091
- result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
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;
1092
1246
  }
1093
- return result;
1094
- };
1095
- var cartesianToCartographicN2 = new Cartesian3_default();
1096
- var cartesianToCartographicP2 = new Cartesian3_default();
1097
- var cartesianToCartographicH2 = new Cartesian3_default();
1098
- Ellipsoid.prototype.cartesianToCartographic = function(cartesian, result) {
1099
- const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP2);
1100
- if (!defined_default(p)) {
1101
- return void 0;
1102
- }
1103
- const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN2);
1104
- const h = Cartesian3_default.subtract(cartesian, p, cartesianToCartographicH2);
1105
- const longitude = Math.atan2(n.y, n.x);
1106
- const latitude = Math.asin(n.z);
1107
- const height = Math_default.sign(Cartesian3_default.dot(h, cartesian)) * Cartesian3_default.magnitude(h);
1108
- if (!defined_default(result)) {
1109
- return new Cartographic_default(longitude, latitude, height);
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;
1110
1277
  }
1111
- result.longitude = longitude;
1112
- result.latitude = latitude;
1113
- result.height = height;
1114
- return result;
1115
- };
1116
- Ellipsoid.prototype.cartesianArrayToCartographicArray = function(cartesians, result) {
1117
- Check_default.defined("cartesians", cartesians);
1118
- const length = cartesians.length;
1119
- if (!defined_default(result)) {
1120
- result = new Array(length);
1121
- } else {
1122
- result.length = length;
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;
1123
1304
  }
1124
- for (let i = 0; i < length; ++i) {
1125
- result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
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
+ );
1126
1322
  }
1127
- return result;
1128
- };
1129
- Ellipsoid.prototype.scaleToGeodeticSurface = function(cartesian, result) {
1130
- return scaleToGeodeticSurface_default(
1131
- cartesian,
1132
- this._oneOverRadii,
1133
- this._oneOverRadiiSquared,
1134
- this._centerToleranceSquared,
1135
- result
1136
- );
1137
- };
1138
- Ellipsoid.prototype.scaleToGeocentricSurface = function(cartesian, result) {
1139
- Check_default.typeOf.object("cartesian", cartesian);
1140
- if (!defined_default(result)) {
1141
- result = new Cartesian3_default();
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);
1142
1344
  }
1143
- const positionX = cartesian.x;
1144
- const positionY = cartesian.y;
1145
- const positionZ = cartesian.z;
1146
- const oneOverRadiiSquared = this._oneOverRadiiSquared;
1147
- const beta = 1 / Math.sqrt(
1148
- positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z
1149
- );
1150
- return Cartesian3_default.multiplyByScalar(cartesian, beta, result);
1151
- };
1152
- Ellipsoid.prototype.transformPositionToScaledSpace = function(position, result) {
1153
- if (!defined_default(result)) {
1154
- result = new Cartesian3_default();
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);
1155
1360
  }
1156
- return Cartesian3_default.multiplyComponents(position, this._oneOverRadii, result);
1157
- };
1158
- Ellipsoid.prototype.transformPositionFromScaledSpace = function(position, result) {
1159
- if (!defined_default(result)) {
1160
- result = new Cartesian3_default();
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);
1161
1376
  }
1162
- return Cartesian3_default.multiplyComponents(position, this._radii, result);
1163
- };
1164
- Ellipsoid.prototype.equals = function(right) {
1165
- return this === right || defined_default(right) && Cartesian3_default.equals(this._radii, right._radii);
1166
- };
1167
- Ellipsoid.prototype.toString = function() {
1168
- return this._radii.toString();
1169
- };
1170
- Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function(position, buffer, result) {
1171
- Check_default.typeOf.object("position", position);
1172
- if (!Math_default.equalsEpsilon(
1173
- this._radii.x,
1174
- this._radii.y,
1175
- Math_default.EPSILON15
1176
- )) {
1177
- throw new DeveloperError_default(
1178
- "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
1179
- );
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);
1180
1386
  }
1181
- Check_default.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
1182
- buffer = buffer ?? 0;
1183
- const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
1184
- if (!defined_default(result)) {
1185
- result = new Cartesian3_default();
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;
1186
1435
  }
1187
- result.x = 0;
1188
- result.y = 0;
1189
- result.z = position.z * (1 - squaredXOverSquaredZ);
1190
- if (Math.abs(result.z) >= this._radii.z - buffer) {
1191
- return void 0;
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
+ );
1192
1466
  }
1193
- return result;
1194
- };
1195
- var scratchEndpoint = new Cartesian3_default();
1196
- Ellipsoid.prototype.getLocalCurvature = function(surfacePosition, result) {
1197
- Check_default.typeOf.object("surfacePosition", surfacePosition);
1198
- if (!defined_default(result)) {
1199
- result = new Cartesian2_default();
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
+ });
1200
1499
  }
1201
- const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(
1202
- surfacePosition,
1203
- 0,
1204
- scratchEndpoint
1205
- );
1206
- const primeVerticalRadius = Cartesian3_default.distance(
1207
- surfacePosition,
1208
- primeVerticalEndpoint
1209
- );
1210
- const radiusRatio = this.minimumRadius * primeVerticalRadius / this.maximumRadius ** 2;
1211
- const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;
1212
- return Cartesian2_default.fromElements(
1213
- 1 / primeVerticalRadius,
1214
- 1 / meridionalRadius,
1215
- result
1216
- );
1217
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();
1218
1522
  var abscissas = [
1219
1523
  0.14887433898163,
1220
1524
  0.43339539412925,
@@ -1245,32 +1549,6 @@ function gaussLegendreQuadrature(a, b, func) {
1245
1549
  sum *= xRange;
1246
1550
  return sum;
1247
1551
  }
1248
- Ellipsoid.prototype.surfaceArea = function(rectangle) {
1249
- Check_default.typeOf.object("rectangle", rectangle);
1250
- const minLongitude = rectangle.west;
1251
- let maxLongitude = rectangle.east;
1252
- const minLatitude = rectangle.south;
1253
- const maxLatitude = rectangle.north;
1254
- while (maxLongitude < minLongitude) {
1255
- maxLongitude += Math_default.TWO_PI;
1256
- }
1257
- const radiiSquared = this._radiiSquared;
1258
- const a2 = radiiSquared.x;
1259
- const b2 = radiiSquared.y;
1260
- const c2 = radiiSquared.z;
1261
- const a2b2 = a2 * b2;
1262
- return gaussLegendreQuadrature(minLatitude, maxLatitude, function(lat) {
1263
- const sinPhi = Math.cos(lat);
1264
- const cosPhi = Math.sin(lat);
1265
- return Math.cos(lat) * gaussLegendreQuadrature(minLongitude, maxLongitude, function(lon) {
1266
- const cosTheta = Math.cos(lon);
1267
- const sinTheta = Math.sin(lon);
1268
- return Math.sqrt(
1269
- a2b2 * cosPhi * cosPhi + c2 * (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) * sinPhi * sinPhi
1270
- );
1271
- });
1272
- });
1273
- };
1274
1552
  var Ellipsoid_default = Ellipsoid;
1275
1553
 
1276
1554
  // packages/engine/Source/Core/Fullscreen.js