@cesium/engine 24.0.0 → 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.
- package/Build/Workers/{chunk-NKT5K3K3.js → chunk-35H3UBIO.js} +13 -12
- package/Build/Workers/{chunk-5A2SW66E.js → chunk-3LSD7OOA.js} +16 -16
- package/Build/Workers/{chunk-HXJMS2ZI.js → chunk-3RFFPH4M.js} +1 -1
- package/Build/Workers/{chunk-EDXL4W76.js → chunk-3TKLDHV3.js} +2 -2
- package/Build/Workers/{chunk-GQUNK2XC.js → chunk-3VDDRF2E.js} +14 -14
- package/Build/Workers/{chunk-Q3C6VQH6.js → chunk-3XY3MVPG.js} +4 -4
- package/Build/Workers/{chunk-A47HVBC5.js → chunk-4GF4MVPY.js} +7 -7
- package/Build/Workers/{chunk-YQFTYQMZ.js → chunk-4MTRQFJP.js} +3 -2
- package/Build/Workers/{chunk-N65BAKSH.js → chunk-4QQXGTCE.js} +8 -8
- package/Build/Workers/{chunk-EV3VGO6Y.js → chunk-4XXHJI6Y.js} +17 -17
- package/Build/Workers/{chunk-DHKPFLSJ.js → chunk-5T6QQAJW.js} +3 -2
- package/Build/Workers/{chunk-UIGVOKKI.js → chunk-6SDGQI27.js} +3 -2
- package/Build/Workers/{chunk-ILMFADZA.js → chunk-77RL3MBD.js} +6 -5
- package/Build/Workers/{chunk-2N4KDHS3.js → chunk-7LSFAEWF.js} +12 -11
- package/Build/Workers/{chunk-44EMEGKW.js → chunk-A7A433MD.js} +5 -5
- package/Build/Workers/{chunk-J6AW5YHS.js → chunk-A7ZBMVFS.js} +14 -14
- package/Build/Workers/{chunk-XJRBB253.js → chunk-ACFFCHHZ.js} +11 -11
- package/Build/Workers/{chunk-MKM27KGV.js → chunk-AEAVLYPS.js} +2 -2
- package/Build/Workers/{chunk-7MDYBRYJ.js → chunk-AWFZHD2B.js} +4 -4
- package/Build/Workers/{chunk-UQU4RXLT.js → chunk-BTX2NL3P.js} +50 -45
- package/Build/Workers/{chunk-4TIG36AW.js → chunk-BVAIWR7O.js} +12 -12
- package/Build/Workers/chunk-CKQP3DSS.js +973 -0
- package/Build/Workers/{chunk-VLDEUTOP.js → chunk-CZ23Y3RM.js} +2 -2
- package/Build/Workers/{chunk-NPF7SSHZ.js → chunk-DFEI5MAV.js} +7 -7
- package/Build/Workers/{chunk-AJLTU6PF.js → chunk-DH26SNAB.js} +4 -1
- package/Build/Workers/{chunk-5GXYJQ2K.js → chunk-DYT5NR6P.js} +3 -3
- package/Build/Workers/{chunk-63SIWPLS.js → chunk-EZARA5FJ.js} +13 -13
- package/Build/Workers/{chunk-AMIHNSST.js → chunk-FIBS5S7R.js} +2 -2
- package/Build/Workers/{chunk-Y7HNNPNK.js → chunk-FVLVVOBQ.js} +10 -10
- package/Build/Workers/{chunk-XY6HMDGI.js → chunk-GL7DNVUS.js} +5 -5
- package/Build/Workers/{chunk-6WLHJFD3.js → chunk-GPIGURCG.js} +59 -32
- package/Build/Workers/{chunk-B6SCUUFP.js → chunk-H2A4USJR.js} +10 -10
- package/Build/Workers/chunk-HSVQATK2.js +147 -0
- package/Build/Workers/{chunk-72VYSVEW.js → chunk-HVMG6AG4.js} +11 -10
- package/Build/Workers/{chunk-LXMCPFFS.js → chunk-I3A6DXYZ.js} +4 -4
- package/Build/Workers/{chunk-7QRFIKWQ.js → chunk-ITD2IN7N.js} +2 -2
- package/Build/Workers/{chunk-RQNJD3O4.js → chunk-J3OFS2RD.js} +12 -12
- package/Build/Workers/{chunk-C6P4IG5P.js → chunk-J647NNZW.js} +6 -6
- package/Build/Workers/{chunk-7X322WP2.js → chunk-J7KQEKPK.js} +13 -13
- package/Build/Workers/{chunk-7O5XJTVE.js → chunk-K6NFIRFB.js} +5 -5
- package/Build/Workers/{chunk-AF3MU2RL.js → chunk-LH5SF3XV.js} +7 -6
- package/Build/Workers/{chunk-GOQBUCXH.js → chunk-ND3NTTOF.js} +708 -430
- package/Build/Workers/chunk-QO2CGXMP.js +2342 -0
- package/Build/Workers/chunk-QSDY4NS7.js +1287 -0
- package/Build/Workers/chunk-QXNQQYPV.js +3201 -0
- package/Build/Workers/{chunk-YAOZMOFL.js → chunk-ST2UWDUU.js} +5 -5
- package/Build/Workers/{chunk-PVV64VFW.js → chunk-TA777BGS.js} +3 -2
- package/Build/Workers/{chunk-ISY4EZCA.js → chunk-TAI4HLII.js} +4 -4
- package/Build/Workers/{chunk-JCI63T3K.js → chunk-URUCCIPS.js} +6 -6
- package/Build/Workers/{chunk-VMVOUQ5J.js → chunk-VQKLRBIK.js} +7 -7
- package/Build/Workers/{chunk-6MPGQEHA.js → chunk-WC57YYBN.js} +2 -2
- package/Build/Workers/{chunk-BJD6QGXZ.js → chunk-WN6P5UDH.js} +12 -12
- package/Build/Workers/{chunk-LIB2H534.js → chunk-WNN5D4W3.js} +12 -11
- package/Build/Workers/{chunk-D4EJ2NXG.js → chunk-WTQGE7Q6.js} +17 -17
- package/Build/Workers/{chunk-YJZGW74L.js → chunk-WUBKZFF6.js} +2213 -1349
- package/Build/Workers/{chunk-7TYLCBGK.js → chunk-ZAPOS52G.js} +12 -10
- package/Build/Workers/{chunk-6RMS4S72.js → chunk-ZCCIIBZT.js} +6 -6
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +175 -118
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +24 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +12 -9
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/ArcType.js +6 -1
- package/Source/Core/ArticulationStageType.js +5 -1
- package/Source/Core/AssociativeArray.js +100 -94
- package/Source/Core/BoundingSphere.js +1296 -1300
- package/Source/Core/Cartesian3.js +1 -2
- package/Source/Core/Cartographic.js +257 -249
- package/Source/Core/ClockRange.js +6 -1
- package/Source/Core/ClockStep.js +6 -1
- package/Source/Core/Color.js +844 -835
- package/Source/Core/ComponentDatatype.js +4 -1
- package/Source/Core/CornerType.js +6 -1
- package/Source/Core/Credit.js +121 -124
- package/Source/Core/Ellipsoid.js +637 -660
- package/Source/Core/ExtrapolationType.js +6 -1
- package/Source/Core/GeocodeType.js +6 -1
- package/Source/Core/GeographicProjection.js +74 -74
- package/Source/Core/GeographicTilingScheme.js +179 -198
- package/Source/Core/GeometryOffsetAttribute.js +7 -1
- package/Source/Core/GeometryType.js +7 -1
- package/Source/Core/HeightmapEncoding.js +6 -1
- package/Source/Core/Iau2006XysData.js +24 -13
- package/Source/Core/IndexDatatype.js +3 -1
- package/Source/Core/InterpolationType.js +5 -1
- package/Source/Core/Intersect.js +6 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonGeocodeProviderType.js +5 -1
- package/Source/Core/JulianDate.js +850 -848
- package/Source/Core/KeyboardEventModifier.js +6 -1
- package/Source/Core/MapProjection.js +39 -44
- package/Source/Core/Matrix2.js +906 -893
- package/Source/Core/Matrix3.js +1643 -1575
- package/Source/Core/Matrix4.js +2903 -2872
- package/Source/Core/PixelFormat.js +3 -1
- package/Source/Core/PrimitiveType.js +11 -1
- package/Source/Core/Ray.js +62 -60
- package/Source/Core/Rectangle.js +913 -904
- package/Source/Core/ReferenceFrame.js +6 -1
- package/Source/Core/RequestScheduler.js +8 -3
- package/Source/Core/RequestState.js +6 -1
- package/Source/Core/RequestType.js +6 -1
- package/Source/Core/ScreenSpaceEventType.js +6 -1
- package/Source/Core/TerrainQuantization.js +6 -1
- package/Source/Core/TilingScheme.js +100 -98
- package/Source/Core/TimeConstants.js +6 -1
- package/Source/Core/TimeStandard.js +6 -1
- package/Source/Core/TrackingReferenceFrame.js +6 -1
- package/Source/Core/Visibility.js +6 -1
- package/Source/Core/VulkanConstants.js +6 -1
- package/Source/Core/WebGLConstants.js +6 -1
- package/Source/Core/WebMercatorProjection.js +108 -109
- package/Source/Core/WebMercatorTilingScheme.js +246 -242
- package/Source/Core/WindingOrder.js +3 -1
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +1 -0
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +1 -0
- package/Source/DataSources/StripeOrientation.js +6 -1
- package/Source/Renderer/BufferUsage.js +20 -9
- package/Source/Renderer/Context.js +2 -29
- package/Source/Renderer/DrawCommand.js +435 -403
- package/Source/Renderer/MipmapHint.js +5 -1
- package/Source/Renderer/Pass.js +7 -1
- package/Source/Renderer/PickId.js +44 -0
- package/Source/Renderer/PixelDatatype.js +3 -1
- package/Source/Renderer/RenderbufferFormat.js +5 -1
- package/Source/Renderer/ShaderDestination.js +4 -1
- package/Source/Renderer/TextureMagnificationFilter.js +3 -1
- package/Source/Renderer/TextureMinificationFilter.js +3 -1
- package/Source/Renderer/TextureWrap.js +5 -1
- package/Source/Scene/AlphaMode.js +5 -1
- package/Source/Scene/ArcGisBaseMapType.js +6 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/AttributeType.js +3 -1
- package/Source/Scene/Axis.js +3 -1
- package/Source/Scene/BingMapsStyle.js +6 -1
- package/Source/Scene/BlendEquation.js +6 -1
- package/Source/Scene/BlendFunction.js +6 -1
- package/Source/Scene/BlendOption.js +6 -1
- package/Source/Scene/BlendingState.js +6 -1
- package/Source/Scene/BufferLoader.js +0 -2
- package/Source/Scene/BufferPointCollection.js +4 -1
- package/Source/Scene/BufferPolygonCollection.js +3 -1
- package/Source/Scene/BufferPolylineCollection.js +3 -1
- package/Source/Scene/BufferPrimitiveCollection.js +140 -24
- package/Source/Scene/CameraEventType.js +6 -1
- package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
- package/Source/Scene/Cesium3DTileContentState.js +6 -1
- package/Source/Scene/Cesium3DTileContentType.js +3 -1
- package/Source/Scene/Cesium3DTileFeature.js +289 -306
- package/Source/Scene/Cesium3DTileOptimizationHint.js +6 -1
- package/Source/Scene/Cesium3DTilePass.js +5 -1
- package/Source/Scene/Cesium3DTilePointFeature.js +433 -511
- package/Source/Scene/Cesium3DTileRefine.js +6 -1
- package/Source/Scene/Cesium3DTileVectorFeature.js +586 -0
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/ClassificationType.js +3 -1
- package/Source/Scene/CloudType.js +3 -1
- package/Source/Scene/ColorBlendMode.js +4 -1
- package/Source/Scene/CullFace.js +6 -1
- package/Source/Scene/DepthFunction.js +6 -1
- package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
- package/Source/Scene/EquirectangularPanorama.js +1 -0
- package/Source/Scene/ExpressionNodeType.js +6 -1
- package/Source/Scene/GltfBufferViewLoader.js +0 -2
- package/Source/Scene/GltfDracoLoader.js +0 -2
- package/Source/Scene/GltfImageLoader.js +0 -3
- package/Source/Scene/GltfIndexBufferLoader.js +0 -4
- package/Source/Scene/GltfJsonLoader.js +0 -2
- package/Source/Scene/GltfLoader.js +0 -5
- package/Source/Scene/GltfLoaderUtil.js +14 -0
- package/Source/Scene/GltfSpzLoader.js +0 -2
- package/Source/Scene/GltfStructuralMetadataLoader.js +0 -2
- package/Source/Scene/GltfTextureLoader.js +0 -2
- package/Source/Scene/GltfVertexBufferLoader.js +0 -4
- package/Source/Scene/HeightReference.js +5 -1
- package/Source/Scene/HorizontalOrigin.js +6 -1
- package/Source/Scene/ImageryProvider.js +1 -1
- package/Source/Scene/ImageryState.js +6 -1
- package/Source/Scene/ImplicitSubdivisionScheme.js +3 -1
- package/Source/Scene/InstanceAttributeSemantic.js +3 -1
- package/Source/Scene/IonWorldImageryStyle.js +6 -1
- package/Source/Scene/JobType.js +6 -1
- package/Source/Scene/LabelStyle.js +6 -1
- package/Source/Scene/MapMode2D.js +6 -1
- package/Source/Scene/MetadataComponentType.js +3 -1
- package/Source/Scene/MetadataSchemaLoader.js +0 -2
- package/Source/Scene/MetadataSemantic.js +6 -2
- package/Source/Scene/MetadataType.js +3 -1
- package/Source/Scene/Model/B3dmLoader.js +0 -3
- package/Source/Scene/Model/CustomShaderMode.js +3 -1
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +5 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +44 -71
- package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +5 -1
- package/Source/Scene/Model/Extensions/Gpm/StorageType.js +5 -1
- package/Source/Scene/Model/GeoJsonLoader.js +0 -2
- package/Source/Scene/Model/I3dmLoader.js +0 -3
- package/Source/Scene/Model/InstancingPipelineStage.js +1 -1
- package/Source/Scene/Model/LightingModel.js +5 -1
- package/Source/Scene/Model/MaterialPipelineStage.js +184 -3
- package/Source/Scene/Model/ModelReader.js +474 -3
- package/Source/Scene/Model/ModelRuntimePrimitive.js +2 -1
- package/Source/Scene/Model/ModelType.js +3 -1
- package/Source/Scene/Model/PntsLoader.js +4 -3
- package/Source/Scene/Model/StyleCommandsNeeded.js +3 -1
- package/Source/Scene/Model/UniformType.js +5 -1
- package/Source/Scene/Model/VaryingType.js +5 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +73 -28
- package/Source/Scene/Model/pickModel.js +94 -299
- package/Source/Scene/ModelAnimationLoop.js +6 -1
- package/Source/Scene/ModelAnimationState.js +6 -1
- package/Source/Scene/ModelComponents.js +8 -1
- package/Source/Scene/PrimitiveState.js +7 -1
- package/Source/Scene/QuadtreeOccluders.js +20 -15
- package/Source/Scene/QuadtreeTile.js +547 -541
- package/Source/Scene/QuadtreeTileLoadState.js +6 -1
- package/Source/Scene/QuadtreeTileProvider.js +159 -175
- package/Source/Scene/ResourceLoader.js +0 -1
- package/Source/Scene/ResourceLoaderState.js +7 -1
- package/Source/Scene/SceneMode.js +4 -1
- package/Source/Scene/ShadowMode.js +3 -1
- package/Source/Scene/SkyBox.js +1 -1
- package/Source/Scene/SplitDirection.js +6 -1
- package/Source/Scene/StencilFunction.js +6 -1
- package/Source/Scene/StencilOperation.js +6 -1
- package/Source/Scene/TerrainState.js +7 -1
- package/Source/Scene/TileState.js +7 -1
- package/Source/Scene/Tonemapper.js +5 -1
- package/Source/Scene/VectorGltf3DTileContent.js +72 -51
- package/Source/Scene/VertexAttributeSemantic.js +3 -1
- package/Source/Scene/VerticalOrigin.js +6 -1
- package/Source/Scene/VoxelBoxShape.js +12 -6
- package/Source/Scene/VoxelContent.js +2 -0
- package/Source/Scene/VoxelCylinderShape.js +39 -38
- package/Source/Scene/VoxelEllipsoidShape.js +46 -96
- package/Source/Scene/VoxelMetadataOrder.js +6 -1
- package/Source/Scene/VoxelProvider.js +1 -0
- package/Source/Scene/VoxelShapeType.js +3 -1
- package/Source/Scene/renderBufferPointCollection.js +17 -66
- package/Source/Scene/renderBufferPolygonCollection.js +21 -68
- package/Source/Scene/renderBufferPolylineCollection.js +22 -73
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
- package/Source/Shaders/Model/ConstantLodStageFS.glsl +60 -0
- package/Source/Shaders/Model/ConstantLodStageFS.js +62 -0
- package/Source/Shaders/Model/ConstantLodStageVS.glsl +12 -0
- package/Source/Shaders/Model/ConstantLodStageVS.js +13 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +46 -20
- package/Source/Shaders/Model/MaterialStageFS.js +46 -20
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +0 -1
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +0 -1
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +7 -9
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +7 -9
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +7 -17
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +7 -17
- package/Source/Widget/CesiumWidget.js +11 -4
- package/index.d.ts +343 -309
- package/index.js +443 -438
- package/package.json +2 -2
- package/Build/Workers/chunk-DVB56LG7.js +0 -114
- package/Build/Workers/chunk-HKUES6UG.js +0 -2357
- package/Build/Workers/chunk-HRHRYFHS.js +0 -940
- package/Build/Workers/chunk-KLPGTXS3.js +0 -642
- package/Build/Workers/chunk-ZBZRTRJB.js +0 -1829
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 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-
|
|
28
|
+
} from "./chunk-QO2CGXMP.js";
|
|
29
29
|
import {
|
|
30
30
|
Math_default
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-DYT5NR6P.js";
|
|
32
32
|
import {
|
|
33
33
|
Check_default,
|
|
34
34
|
DeveloperError_default
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CZ23Y3RM.js";
|
|
36
36
|
import {
|
|
37
|
+
__publicField,
|
|
37
38
|
defined_default
|
|
38
|
-
} from "./chunk-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
ellipsoid
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
211
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
Cartographic.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
231
|
-
|
|
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
|
|
@@ -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
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
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
|
-
|
|
876
|
-
|
|
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
|
-
|
|
887
|
-
|
|
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
|
-
|
|
898
|
-
|
|
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
|
-
|
|
909
|
-
|
|
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
|
-
|
|
920
|
-
|
|
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
|
-
|
|
931
|
-
|
|
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
|
-
|
|
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
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
result
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
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
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
Ellipsoid
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
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);
|
|
1053
1116
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
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;
|
|
1056
1132
|
}
|
|
1057
|
-
|
|
1058
|
-
|
|
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);
|
|
1059
1146
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
result =
|
|
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);
|
|
1079
1169
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
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);
|
|
1089
1194
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
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);
|
|
1092
1219
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
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;
|
|
1110
1246
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
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;
|
|
1123
1277
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
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;
|
|
1126
1304
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
)
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
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
|
+
);
|
|
1142
1322
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
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);
|
|
1155
1344
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
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);
|
|
1161
1360
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
throw new DeveloperError_default(
|
|
1178
|
-
"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
|
|
1179
|
-
);
|
|
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);
|
|
1180
1376
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
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);
|
|
1186
1386
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
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();
|
|
1192
1394
|
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
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
|
+
});
|
|
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
|