@cesium/engine 24.0.0 → 26.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-6WLHJFD3.js → chunk-3VFEWOBI.js} +59 -32
- package/Build/Workers/{chunk-UQU4RXLT.js → chunk-424RNO3D.js} +50 -45
- package/Build/Workers/chunk-4MGMYHOO.js +147 -0
- package/Build/Workers/{chunk-AMIHNSST.js → chunk-4S7IE3LB.js} +2 -2
- package/Build/Workers/{chunk-J6AW5YHS.js → chunk-52JDLOEM.js} +14 -14
- package/Build/Workers/{chunk-6RMS4S72.js → chunk-54I6Y66F.js} +6 -6
- package/Build/Workers/{chunk-C6P4IG5P.js → chunk-6YEE6JDR.js} +6 -6
- package/Build/Workers/{chunk-72VYSVEW.js → chunk-7J2HKPRH.js} +11 -10
- package/Build/Workers/{chunk-7O5XJTVE.js → chunk-7WM2PX4V.js} +5 -5
- package/Build/Workers/{chunk-5A2SW66E.js → chunk-ACXQXN46.js} +16 -16
- package/Build/Workers/{chunk-VLDEUTOP.js → chunk-AYKR4VBR.js} +2 -2
- package/Build/Workers/{chunk-YQFTYQMZ.js → chunk-C6J67V5A.js} +3 -2
- package/Build/Workers/{chunk-D4EJ2NXG.js → chunk-C6KNZ7T4.js} +17 -17
- package/Build/Workers/{chunk-7MDYBRYJ.js → chunk-CFQP6LYM.js} +4 -4
- package/Build/Workers/{chunk-YAOZMOFL.js → chunk-CXOYE2WM.js} +5 -5
- package/Build/Workers/{chunk-B6SCUUFP.js → chunk-CZEYZU4N.js} +10 -10
- package/Build/Workers/{chunk-NPF7SSHZ.js → chunk-DBOEKL43.js} +7 -7
- package/Build/Workers/{chunk-44EMEGKW.js → chunk-DDWSZVMY.js} +5 -5
- package/Build/Workers/{chunk-7X322WP2.js → chunk-DOBXCNC3.js} +13 -13
- package/Build/Workers/{chunk-JCI63T3K.js → chunk-E7VQ76KE.js} +6 -6
- package/Build/Workers/{chunk-7TYLCBGK.js → chunk-EBSIOBXY.js} +12 -10
- package/Build/Workers/{chunk-GQUNK2XC.js → chunk-EF2QYXGA.js} +14 -14
- package/Build/Workers/{chunk-BJD6QGXZ.js → chunk-EPYXRCDB.js} +12 -12
- package/Build/Workers/{chunk-63SIWPLS.js → chunk-F6QDY6HU.js} +13 -13
- package/Build/Workers/{chunk-XY6HMDGI.js → chunk-FRQZECAO.js} +5 -5
- package/Build/Workers/{chunk-VMVOUQ5J.js → chunk-G7PXZRVF.js} +7 -7
- package/Build/Workers/{chunk-N65BAKSH.js → chunk-INUEEEQA.js} +8 -8
- package/Build/Workers/{chunk-7QRFIKWQ.js → chunk-IRBKFCEJ.js} +2 -2
- package/Build/Workers/{chunk-UIGVOKKI.js → chunk-IYOUHCZB.js} +3 -2
- package/Build/Workers/{chunk-5GXYJQ2K.js → chunk-J6BWOHUF.js} +3 -3
- package/Build/Workers/{chunk-A47HVBC5.js → chunk-KFSTQKNM.js} +7 -7
- package/Build/Workers/{chunk-EV3VGO6Y.js → chunk-KKOSKAZB.js} +17 -17
- package/Build/Workers/{chunk-6MPGQEHA.js → chunk-KSSWJIZW.js} +2 -2
- package/Build/Workers/{chunk-DHKPFLSJ.js → chunk-M3B5JKSM.js} +3 -2
- package/Build/Workers/chunk-MPZHGZU6.js +2342 -0
- package/Build/Workers/{chunk-YJZGW74L.js → chunk-MYP774IS.js} +2213 -1349
- package/Build/Workers/{chunk-LIB2H534.js → chunk-O3EA5HS7.js} +12 -11
- package/Build/Workers/{chunk-ILMFADZA.js → chunk-P3CK7MCY.js} +27 -5
- package/Build/Workers/chunk-Q3PY526V.js +3201 -0
- package/Build/Workers/chunk-QN67VG36.js +973 -0
- package/Build/Workers/{chunk-XJRBB253.js → chunk-QRWGUWI6.js} +11 -11
- package/Build/Workers/{chunk-AF3MU2RL.js → chunk-S4MCOY6I.js} +7 -6
- package/Build/Workers/{chunk-Y7HNNPNK.js → chunk-SMQZZOW6.js} +10 -10
- package/Build/Workers/{chunk-PVV64VFW.js → chunk-TKKIREQ6.js} +3 -2
- package/Build/Workers/{chunk-MKM27KGV.js → chunk-U3ZA64U7.js} +2 -2
- package/Build/Workers/{chunk-2N4KDHS3.js → chunk-UA25D5MX.js} +12 -11
- package/Build/Workers/{chunk-RQNJD3O4.js → chunk-UOOIQ3KX.js} +12 -12
- package/Build/Workers/{chunk-GOQBUCXH.js → chunk-V7VQKN6N.js} +709 -431
- package/Build/Workers/{chunk-LXMCPFFS.js → chunk-VQYETPWC.js} +4 -4
- package/Build/Workers/{chunk-NKT5K3K3.js → chunk-VWV2IJRB.js} +13 -12
- package/Build/Workers/chunk-XZMBNNDX.js +1287 -0
- package/Build/Workers/{chunk-ISY4EZCA.js → chunk-Y57HREW5.js} +4 -4
- package/Build/Workers/{chunk-EDXL4W76.js → chunk-Y5BF6AFU.js} +2 -2
- package/Build/Workers/{chunk-Q3C6VQH6.js → chunk-YLY7NKAB.js} +4 -4
- package/Build/Workers/{chunk-4TIG36AW.js → chunk-ZK3CF7ZD.js} +12 -12
- package/Build/Workers/{chunk-AJLTU6PF.js → chunk-ZP7JMQV4.js} +4 -1
- package/Build/Workers/{chunk-HXJMS2ZI.js → chunk-ZZ46LWL6.js} +1 -1
- 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/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +2 -3
- package/Source/Core/Cartesian4.js +1 -1
- 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 +39 -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 +40 -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/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- 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/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- 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 +10 -3
- 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/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- 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/BufferPoint.js +1 -0
- package/Source/Scene/BufferPointCollection.js +17 -1
- package/Source/Scene/BufferPolygon.js +3 -2
- package/Source/Scene/BufferPolygonCollection.js +13 -1
- package/Source/Scene/BufferPolyline.js +1 -0
- package/Source/Scene/BufferPolylineCollection.js +5 -1
- package/Source/Scene/BufferPrimitiveCollection.js +210 -43
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraEventType.js +6 -1
- package/Source/Scene/Cesium3DTile.js +54 -1
- package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- 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 +46 -6
- package/Source/Scene/ClassificationType.js +3 -1
- package/Source/Scene/CloudType.js +3 -1
- package/Source/Scene/ColorBlendMode.js +4 -1
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/CullFace.js +6 -1
- package/Source/Scene/DepthFunction.js +6 -1
- package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/EquirectangularPanorama.js +1 -0
- package/Source/Scene/ExpressionNodeType.js +6 -1
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- 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 +109 -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/Implicit3DTileContent.js +179 -214
- 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/MVTDataProvider.js +147 -0
- 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 +78 -337
- 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/Model.js +34 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -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/ModelUtility.js +4 -0
- 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 +500 -139
- 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 +47 -2
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- 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/Scene.js +26 -0
- 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/Tileset3DTileContent.js +113 -146
- package/Source/Scene/Tonemapper.js +5 -1
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
- package/Source/Scene/Vector3DTileContent.js +205 -234
- package/Source/Scene/VectorGltf3DTileContent.js +131 -61
- 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/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -90
- package/Source/Scene/VoxelShapeType.js +3 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/decodeMVT.js +634 -0
- package/Source/Scene/renderBufferPointCollection.js +124 -127
- package/Source/Scene/renderBufferPolygonCollection.js +122 -122
- package/Source/Scene/renderBufferPolylineCollection.js +386 -238
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -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/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- 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 +595 -343
- package/index.js +392 -378
- package/package.json +3 -3
- 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
package/Source/Core/Ellipsoid.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
import Cartesian2 from "./Cartesian2.js";
|
|
2
4
|
import Cartesian3 from "./Cartesian3.js";
|
|
3
5
|
import Cartographic from "./Cartographic.js";
|
|
@@ -7,6 +9,26 @@ import DeveloperError from "./DeveloperError.js";
|
|
|
7
9
|
import CesiumMath from "./Math.js";
|
|
8
10
|
import scaleToGeodeticSurface from "./scaleToGeodeticSurface.js";
|
|
9
11
|
|
|
12
|
+
/** @import Rectangle from "./Rectangle.js"; */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A real valued scalar function.
|
|
16
|
+
* @callback EllipsoidRealValuedScalarFunction
|
|
17
|
+
*
|
|
18
|
+
* @param {number} x The value used to evaluate the function.
|
|
19
|
+
* @returns {number} The value of the function at x.
|
|
20
|
+
*
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {Ellipsoid} ellipsoid
|
|
26
|
+
* @param {number} x
|
|
27
|
+
* @param {number} y
|
|
28
|
+
* @param {number} z
|
|
29
|
+
*
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
10
32
|
function initialize(ellipsoid, x, y, z) {
|
|
11
33
|
x = x ?? 0.0;
|
|
12
34
|
y = y ?? 0.0;
|
|
@@ -59,215 +81,157 @@ function initialize(ellipsoid, x, y, z) {
|
|
|
59
81
|
*
|
|
60
82
|
* Rather than constructing this object directly, one of the provided
|
|
61
83
|
* constants is normally used.
|
|
62
|
-
* @alias Ellipsoid
|
|
63
|
-
* @constructor
|
|
64
|
-
*
|
|
65
|
-
* @param {number} [x=0] The radius in the x direction.
|
|
66
|
-
* @param {number} [y=0] The radius in the y direction.
|
|
67
|
-
* @param {number} [z=0] The radius in the z direction.
|
|
68
|
-
*
|
|
69
|
-
* @exception {DeveloperError} All radii components must be greater than or equal to zero.
|
|
70
84
|
*
|
|
71
85
|
* @see Ellipsoid.fromCartesian3
|
|
72
86
|
* @see Ellipsoid.WGS84
|
|
73
87
|
* @see Ellipsoid.UNIT_SPHERE
|
|
74
88
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
class Ellipsoid {
|
|
90
|
+
/**
|
|
91
|
+
* @param {number} [x=0] The radius in the x direction.
|
|
92
|
+
* @param {number} [y=0] The radius in the y direction.
|
|
93
|
+
* @param {number} [z=0] The radius in the z direction.
|
|
94
|
+
*
|
|
95
|
+
* @exception {DeveloperError} All radii components must be greater than or equal to zero.
|
|
96
|
+
*/
|
|
97
|
+
constructor(x, y, z) {
|
|
98
|
+
this._radii = undefined;
|
|
99
|
+
this._radiiSquared = undefined;
|
|
100
|
+
this._radiiToTheFourth = undefined;
|
|
101
|
+
this._oneOverRadii = undefined;
|
|
102
|
+
this._oneOverRadiiSquared = undefined;
|
|
103
|
+
this._minimumRadius = undefined;
|
|
104
|
+
this._maximumRadius = undefined;
|
|
105
|
+
this._centerToleranceSquared = undefined;
|
|
106
|
+
this._squaredXOverSquaredZ = undefined;
|
|
107
|
+
|
|
108
|
+
initialize(this, x, y, z);
|
|
109
|
+
}
|
|
88
110
|
|
|
89
|
-
Object.defineProperties(Ellipsoid.prototype, {
|
|
90
111
|
/**
|
|
91
112
|
* Gets the radii of the ellipsoid.
|
|
92
|
-
* @memberof Ellipsoid.prototype
|
|
93
113
|
* @type {Cartesian3}
|
|
94
114
|
* @readonly
|
|
95
115
|
*/
|
|
96
|
-
radii
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
116
|
+
get radii() {
|
|
117
|
+
return this._radii;
|
|
118
|
+
}
|
|
119
|
+
|
|
101
120
|
/**
|
|
102
121
|
* Gets the squared radii of the ellipsoid.
|
|
103
|
-
* @memberof Ellipsoid.prototype
|
|
104
122
|
* @type {Cartesian3}
|
|
105
123
|
* @readonly
|
|
106
124
|
*/
|
|
107
|
-
radiiSquared
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
125
|
+
get radiiSquared() {
|
|
126
|
+
return this._radiiSquared;
|
|
127
|
+
}
|
|
128
|
+
|
|
112
129
|
/**
|
|
113
130
|
* Gets the radii of the ellipsoid raise to the fourth power.
|
|
114
|
-
* @memberof Ellipsoid.prototype
|
|
115
131
|
* @type {Cartesian3}
|
|
116
132
|
* @readonly
|
|
117
133
|
*/
|
|
118
|
-
radiiToTheFourth
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
134
|
+
get radiiToTheFourth() {
|
|
135
|
+
return this._radiiToTheFourth;
|
|
136
|
+
}
|
|
137
|
+
|
|
123
138
|
/**
|
|
124
139
|
* Gets one over the radii of the ellipsoid.
|
|
125
|
-
* @memberof Ellipsoid.prototype
|
|
126
140
|
* @type {Cartesian3}
|
|
127
141
|
* @readonly
|
|
128
142
|
*/
|
|
129
|
-
oneOverRadii
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
143
|
+
get oneOverRadii() {
|
|
144
|
+
return this._oneOverRadii;
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
/**
|
|
135
148
|
* Gets one over the squared radii of the ellipsoid.
|
|
136
|
-
* @memberof Ellipsoid.prototype
|
|
137
149
|
* @type {Cartesian3}
|
|
138
150
|
* @readonly
|
|
139
151
|
*/
|
|
140
|
-
oneOverRadiiSquared
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
152
|
+
get oneOverRadiiSquared() {
|
|
153
|
+
return this._oneOverRadiiSquared;
|
|
154
|
+
}
|
|
155
|
+
|
|
145
156
|
/**
|
|
146
157
|
* Gets the minimum radius of the ellipsoid.
|
|
147
|
-
* @memberof Ellipsoid.prototype
|
|
148
158
|
* @type {number}
|
|
149
159
|
* @readonly
|
|
150
160
|
*/
|
|
151
|
-
minimumRadius
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
161
|
+
get minimumRadius() {
|
|
162
|
+
return this._minimumRadius;
|
|
163
|
+
}
|
|
164
|
+
|
|
156
165
|
/**
|
|
157
166
|
* Gets the maximum radius of the ellipsoid.
|
|
158
|
-
* @memberof Ellipsoid.prototype
|
|
159
167
|
* @type {number}
|
|
160
168
|
* @readonly
|
|
161
169
|
*/
|
|
162
|
-
maximumRadius
|
|
163
|
-
|
|
164
|
-
return this._maximumRadius;
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Duplicates an Ellipsoid instance.
|
|
171
|
-
*
|
|
172
|
-
* @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
|
|
173
|
-
* @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
|
|
174
|
-
* instance should be created.
|
|
175
|
-
* @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
|
|
176
|
-
*/
|
|
177
|
-
Ellipsoid.clone = function (ellipsoid, result) {
|
|
178
|
-
if (!defined(ellipsoid)) {
|
|
179
|
-
return undefined;
|
|
180
|
-
}
|
|
181
|
-
const radii = ellipsoid._radii;
|
|
182
|
-
|
|
183
|
-
if (!defined(result)) {
|
|
184
|
-
return new Ellipsoid(radii.x, radii.y, radii.z);
|
|
170
|
+
get maximumRadius() {
|
|
171
|
+
return this._maximumRadius;
|
|
185
172
|
}
|
|
186
173
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
result =
|
|
215
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Duplicates an Ellipsoid instance.
|
|
176
|
+
*
|
|
177
|
+
* @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
|
|
178
|
+
* @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
|
|
179
|
+
* instance should be created.
|
|
180
|
+
* @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
|
|
181
|
+
*/
|
|
182
|
+
static clone(ellipsoid, result) {
|
|
183
|
+
if (!defined(ellipsoid)) {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
const radii = ellipsoid._radii;
|
|
187
|
+
|
|
188
|
+
if (!defined(result)) {
|
|
189
|
+
return new Ellipsoid(radii.x, radii.y, radii.z);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
Cartesian3.clone(radii, result._radii);
|
|
193
|
+
Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);
|
|
194
|
+
Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
|
|
195
|
+
Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
|
|
196
|
+
Cartesian3.clone(
|
|
197
|
+
ellipsoid._oneOverRadiiSquared,
|
|
198
|
+
result._oneOverRadiiSquared,
|
|
199
|
+
);
|
|
200
|
+
result._minimumRadius = ellipsoid._minimumRadius;
|
|
201
|
+
result._maximumRadius = ellipsoid._maximumRadius;
|
|
202
|
+
result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
|
|
216
203
|
|
|
217
|
-
if (!defined(cartesian)) {
|
|
218
204
|
return result;
|
|
219
205
|
}
|
|
220
206
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
Ellipsoid.WGS84
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
* @type {Ellipsoid}
|
|
239
|
-
* @constant
|
|
240
|
-
*/
|
|
241
|
-
Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));
|
|
207
|
+
/**
|
|
208
|
+
* Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
|
|
209
|
+
*
|
|
210
|
+
* @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.
|
|
211
|
+
* @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
|
|
212
|
+
* instance should be created.
|
|
213
|
+
* @returns {Ellipsoid} A new Ellipsoid instance.
|
|
214
|
+
*
|
|
215
|
+
* @exception {DeveloperError} All radii components must be greater than or equal to zero.
|
|
216
|
+
*
|
|
217
|
+
* @see Ellipsoid.WGS84
|
|
218
|
+
* @see Ellipsoid.UNIT_SPHERE
|
|
219
|
+
*/
|
|
220
|
+
static fromCartesian3(cartesian, result) {
|
|
221
|
+
if (!defined(result)) {
|
|
222
|
+
result = new Ellipsoid();
|
|
223
|
+
}
|
|
242
224
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* @type {Ellipsoid}
|
|
247
|
-
* @constant
|
|
248
|
-
*/
|
|
249
|
-
Ellipsoid.MOON = Object.freeze(
|
|
250
|
-
new Ellipsoid(
|
|
251
|
-
CesiumMath.LUNAR_RADIUS,
|
|
252
|
-
CesiumMath.LUNAR_RADIUS,
|
|
253
|
-
CesiumMath.LUNAR_RADIUS,
|
|
254
|
-
),
|
|
255
|
-
);
|
|
225
|
+
if (!defined(cartesian)) {
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
256
228
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
*
|
|
261
|
-
* @type {Ellipsoid}
|
|
262
|
-
* @constant
|
|
263
|
-
*/
|
|
264
|
-
Ellipsoid.MARS = Object.freeze(new Ellipsoid(3396190.0, 3396190.0, 3376200.0));
|
|
229
|
+
initialize(result, cartesian.x, cartesian.y, cartesian.z);
|
|
230
|
+
return result;
|
|
231
|
+
}
|
|
265
232
|
|
|
266
|
-
Ellipsoid._default = Ellipsoid.WGS84;
|
|
267
|
-
Object.defineProperties(Ellipsoid, {
|
|
268
233
|
/**
|
|
269
234
|
* The default ellipsoid used when not otherwise specified.
|
|
270
|
-
* @memberof Ellipsoid
|
|
271
235
|
* @type {Ellipsoid}
|
|
272
236
|
* @example
|
|
273
237
|
* Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;
|
|
@@ -278,514 +242,584 @@ Object.defineProperties(Ellipsoid, {
|
|
|
278
242
|
* 23.47315,
|
|
279
243
|
* );
|
|
280
244
|
*/
|
|
281
|
-
default
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
set: function (value) {
|
|
286
|
-
//>>includeStart('debug', pragmas.debug);
|
|
287
|
-
Check.typeOf.object("value", value);
|
|
288
|
-
//>>includeEnd('debug');
|
|
289
|
-
|
|
290
|
-
Ellipsoid._default = value;
|
|
291
|
-
Cartesian3._ellipsoidRadiiSquared = value.radiiSquared;
|
|
292
|
-
Cartographic._ellipsoidOneOverRadii = value.oneOverRadii;
|
|
293
|
-
Cartographic._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;
|
|
294
|
-
Cartographic._ellipsoidCenterToleranceSquared =
|
|
295
|
-
value._centerToleranceSquared;
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
});
|
|
245
|
+
static get default() {
|
|
246
|
+
return Ellipsoid._default;
|
|
247
|
+
}
|
|
299
248
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
249
|
+
static set default(value) {
|
|
250
|
+
//>>includeStart('debug', pragmas.debug);
|
|
251
|
+
Check.typeOf.object("value", value);
|
|
252
|
+
//>>includeEnd('debug');
|
|
253
|
+
|
|
254
|
+
Ellipsoid._default = value;
|
|
255
|
+
Cartesian3._ellipsoidRadiiSquared = value.radiiSquared;
|
|
256
|
+
Cartographic._ellipsoidOneOverRadii = value.oneOverRadii;
|
|
257
|
+
Cartographic._ellipsoidOneOverRadiiSquared = value.oneOverRadiiSquared;
|
|
258
|
+
Cartographic._ellipsoidCenterToleranceSquared =
|
|
259
|
+
value._centerToleranceSquared;
|
|
260
|
+
}
|
|
310
261
|
|
|
311
|
-
/**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Duplicates an Ellipsoid instance.
|
|
264
|
+
*
|
|
265
|
+
* @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
|
|
266
|
+
* instance should be created.
|
|
267
|
+
* @returns {Ellipsoid} The cloned Ellipsoid.
|
|
268
|
+
*/
|
|
269
|
+
clone(result) {
|
|
270
|
+
return Ellipsoid.clone(this, result);
|
|
271
|
+
}
|
|
316
272
|
|
|
317
|
-
/**
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Stores the provided instance into the provided array.
|
|
275
|
+
*
|
|
276
|
+
* @param {Ellipsoid} value The value to pack.
|
|
277
|
+
* @param {number[]} array The array to pack into.
|
|
278
|
+
* @param {number} [startingIndex=0] The index into the array at which to start packing the elements.
|
|
279
|
+
*
|
|
280
|
+
* @returns {number[]} The array that was packed into
|
|
281
|
+
*/
|
|
282
|
+
static pack(value, array, startingIndex) {
|
|
283
|
+
//>>includeStart('debug', pragmas.debug);
|
|
284
|
+
Check.typeOf.object("value", value);
|
|
285
|
+
Check.defined("array", array);
|
|
286
|
+
//>>includeEnd('debug');
|
|
331
287
|
|
|
332
|
-
|
|
288
|
+
startingIndex = startingIndex ?? 0;
|
|
333
289
|
|
|
334
|
-
|
|
290
|
+
Cartesian3.pack(value._radii, array, startingIndex);
|
|
335
291
|
|
|
336
|
-
|
|
337
|
-
}
|
|
292
|
+
return array;
|
|
293
|
+
}
|
|
338
294
|
|
|
339
|
-
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
295
|
+
/**
|
|
296
|
+
* Retrieves an instance from a packed array.
|
|
297
|
+
*
|
|
298
|
+
* @param {number[]} array The packed array.
|
|
299
|
+
* @param {number} [startingIndex=0] The starting index of the element to be unpacked.
|
|
300
|
+
* @param {Ellipsoid} [result] The object into which to store the result.
|
|
301
|
+
* @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.
|
|
302
|
+
*/
|
|
303
|
+
static unpack(array, startingIndex, result) {
|
|
304
|
+
//>>includeStart('debug', pragmas.debug);
|
|
305
|
+
Check.defined("array", array);
|
|
306
|
+
//>>includeEnd('debug');
|
|
351
307
|
|
|
352
|
-
|
|
308
|
+
startingIndex = startingIndex ?? 0;
|
|
353
309
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
310
|
+
const radii = Cartesian3.unpack(array, startingIndex);
|
|
311
|
+
return Ellipsoid.fromCartesian3(radii, result);
|
|
312
|
+
}
|
|
357
313
|
|
|
358
|
-
/**
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
|
|
316
|
+
*
|
|
317
|
+
* @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.
|
|
318
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
319
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
|
|
320
|
+
*/
|
|
321
|
+
geodeticSurfaceNormalCartographic(cartographic, result) {
|
|
322
|
+
//>>includeStart('debug', pragmas.debug);
|
|
323
|
+
Check.typeOf.object("cartographic", cartographic);
|
|
324
|
+
//>>includeEnd('debug');
|
|
325
|
+
|
|
326
|
+
const longitude = cartographic.longitude;
|
|
327
|
+
const latitude = cartographic.latitude;
|
|
328
|
+
const cosLatitude = Math.cos(latitude);
|
|
329
|
+
|
|
330
|
+
const x = cosLatitude * Math.cos(longitude);
|
|
331
|
+
const y = cosLatitude * Math.sin(longitude);
|
|
332
|
+
const z = Math.sin(latitude);
|
|
333
|
+
|
|
334
|
+
if (!defined(result)) {
|
|
335
|
+
result = new Cartesian3();
|
|
336
|
+
}
|
|
337
|
+
result.x = x;
|
|
338
|
+
result.y = y;
|
|
339
|
+
result.z = z;
|
|
340
|
+
return Cartesian3.normalize(result, result);
|
|
341
|
+
}
|
|
367
342
|
|
|
368
|
-
/**
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
) {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
343
|
+
/**
|
|
344
|
+
* Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
|
|
345
|
+
*
|
|
346
|
+
* @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.
|
|
347
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
348
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
|
|
349
|
+
*/
|
|
350
|
+
geodeticSurfaceNormal(cartesian, result) {
|
|
351
|
+
//>>includeStart('debug', pragmas.debug);
|
|
352
|
+
Check.typeOf.object("cartesian", cartesian);
|
|
353
|
+
if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {
|
|
354
|
+
throw new DeveloperError("cartesian has a NaN component");
|
|
355
|
+
}
|
|
356
|
+
//>>includeEnd('debug');
|
|
357
|
+
if (
|
|
358
|
+
Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)
|
|
359
|
+
) {
|
|
360
|
+
return undefined;
|
|
361
|
+
}
|
|
362
|
+
if (!defined(result)) {
|
|
363
|
+
result = new Cartesian3();
|
|
364
|
+
}
|
|
365
|
+
result = Cartesian3.multiplyComponents(
|
|
366
|
+
cartesian,
|
|
367
|
+
this._oneOverRadiiSquared,
|
|
368
|
+
result,
|
|
369
|
+
);
|
|
370
|
+
return Cartesian3.normalize(result, result);
|
|
371
|
+
}
|
|
382
372
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
373
|
+
/**
|
|
374
|
+
* Converts the provided cartographic to Cartesian representation.
|
|
375
|
+
*
|
|
376
|
+
* @param {Cartographic} cartographic The cartographic position.
|
|
377
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
378
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
|
|
382
|
+
* const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
|
|
383
|
+
* const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
|
|
384
|
+
*/
|
|
385
|
+
cartographicToCartesian(cartographic, result) {
|
|
386
|
+
//`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.
|
|
387
|
+
const n = cartographicToCartesianNormal;
|
|
388
|
+
const k = cartographicToCartesianK;
|
|
389
|
+
this.geodeticSurfaceNormalCartographic(cartographic, n);
|
|
390
|
+
Cartesian3.multiplyComponents(this._radiiSquared, n, k);
|
|
391
|
+
const gamma = Math.sqrt(Cartesian3.dot(n, k));
|
|
392
|
+
Cartesian3.divideByScalar(k, gamma, k);
|
|
393
|
+
Cartesian3.multiplyByScalar(n, cartographic.height, n);
|
|
394
|
+
|
|
395
|
+
if (!defined(result)) {
|
|
396
|
+
result = new Cartesian3();
|
|
397
|
+
}
|
|
398
|
+
return Cartesian3.add(k, n, result);
|
|
399
|
+
}
|
|
386
400
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
401
|
+
/**
|
|
402
|
+
* Converts the provided array of cartographics to an array of Cartesians.
|
|
403
|
+
*
|
|
404
|
+
* @param {Cartographic[]} cartographics An array of cartographic positions.
|
|
405
|
+
* @param {Cartesian3[]} [result] The object onto which to store the result.
|
|
406
|
+
* @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
|
|
410
|
+
* const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
|
|
411
|
+
* new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
|
|
412
|
+
* new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
|
|
413
|
+
* const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
|
|
414
|
+
*/
|
|
415
|
+
cartographicArrayToCartesianArray(cartographics, result) {
|
|
416
|
+
//>>includeStart('debug', pragmas.debug);
|
|
417
|
+
Check.defined("cartographics", cartographics);
|
|
418
|
+
//>>includeEnd('debug');
|
|
419
|
+
|
|
420
|
+
const length = cartographics.length;
|
|
421
|
+
if (!defined(result)) {
|
|
422
|
+
result = new Array(length);
|
|
423
|
+
} else {
|
|
424
|
+
result.length = length;
|
|
425
|
+
}
|
|
426
|
+
for (let i = 0; i < length; i++) {
|
|
427
|
+
result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
|
|
428
|
+
}
|
|
429
|
+
return result;
|
|
430
|
+
}
|
|
390
431
|
|
|
391
|
-
|
|
392
|
-
|
|
432
|
+
/**
|
|
433
|
+
* Converts the provided cartesian to cartographic representation.
|
|
434
|
+
* The cartesian is undefined at the center of the ellipsoid.
|
|
435
|
+
*
|
|
436
|
+
* @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
|
|
437
|
+
* @param {Cartographic} [result] The object onto which to store the result.
|
|
438
|
+
* @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.
|
|
439
|
+
*
|
|
440
|
+
* @example
|
|
441
|
+
* //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
|
|
442
|
+
* const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
|
|
443
|
+
* const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
|
|
444
|
+
*/
|
|
445
|
+
cartesianToCartographic(cartesian, result) {
|
|
446
|
+
//`cartesian is required.` is thrown from scaleToGeodeticSurface
|
|
447
|
+
const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);
|
|
448
|
+
|
|
449
|
+
if (!defined(p)) {
|
|
450
|
+
return undefined;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);
|
|
454
|
+
const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);
|
|
455
|
+
|
|
456
|
+
const longitude = Math.atan2(n.y, n.x);
|
|
457
|
+
const latitude = Math.asin(n.z);
|
|
458
|
+
const height =
|
|
459
|
+
CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);
|
|
460
|
+
|
|
461
|
+
if (!defined(result)) {
|
|
462
|
+
return new Cartographic(longitude, latitude, height);
|
|
463
|
+
}
|
|
464
|
+
result.longitude = longitude;
|
|
465
|
+
result.latitude = latitude;
|
|
466
|
+
result.height = height;
|
|
467
|
+
return result;
|
|
393
468
|
}
|
|
394
|
-
result.x = x;
|
|
395
|
-
result.y = y;
|
|
396
|
-
result.z = z;
|
|
397
|
-
return Cartesian3.normalize(result, result);
|
|
398
|
-
};
|
|
399
469
|
|
|
400
|
-
/**
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
470
|
+
/**
|
|
471
|
+
* Converts the provided array of cartesians to an array of cartographics.
|
|
472
|
+
*
|
|
473
|
+
* @param {Cartesian3[]} cartesians An array of Cartesian positions.
|
|
474
|
+
* @param {Cartographic[]} [result] The object onto which to store the result.
|
|
475
|
+
* @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
|
|
479
|
+
* const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
|
|
480
|
+
* new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
|
|
481
|
+
* new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
|
|
482
|
+
* const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
|
|
483
|
+
*/
|
|
484
|
+
cartesianArrayToCartographicArray(cartesians, result) {
|
|
485
|
+
//>>includeStart('debug', pragmas.debug);
|
|
486
|
+
Check.defined("cartesians", cartesians);
|
|
487
|
+
//>>includeEnd('debug');
|
|
488
|
+
|
|
489
|
+
const length = cartesians.length;
|
|
490
|
+
if (!defined(result)) {
|
|
491
|
+
result = new Array(length);
|
|
492
|
+
} else {
|
|
493
|
+
result.length = length;
|
|
494
|
+
}
|
|
495
|
+
for (let i = 0; i < length; ++i) {
|
|
496
|
+
result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
|
|
497
|
+
}
|
|
498
|
+
return result;
|
|
412
499
|
}
|
|
413
|
-
//>>includeEnd('debug');
|
|
414
|
-
if (
|
|
415
|
-
Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)
|
|
416
|
-
) {
|
|
417
|
-
return undefined;
|
|
418
|
-
}
|
|
419
|
-
if (!defined(result)) {
|
|
420
|
-
result = new Cartesian3();
|
|
421
|
-
}
|
|
422
|
-
result = Cartesian3.multiplyComponents(
|
|
423
|
-
cartesian,
|
|
424
|
-
this._oneOverRadiiSquared,
|
|
425
|
-
result,
|
|
426
|
-
);
|
|
427
|
-
return Cartesian3.normalize(result, result);
|
|
428
|
-
};
|
|
429
500
|
|
|
430
|
-
|
|
431
|
-
|
|
501
|
+
/**
|
|
502
|
+
* Scales the provided Cartesian position along the geodetic surface normal
|
|
503
|
+
* so that it is on the surface of this ellipsoid. If the position is
|
|
504
|
+
* at the center of the ellipsoid, this function returns undefined.
|
|
505
|
+
*
|
|
506
|
+
* @param {Cartesian3} cartesian The Cartesian position to scale.
|
|
507
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
508
|
+
* @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
|
|
509
|
+
*/
|
|
510
|
+
scaleToGeodeticSurface(cartesian, result) {
|
|
511
|
+
return scaleToGeodeticSurface(
|
|
512
|
+
cartesian,
|
|
513
|
+
this._oneOverRadii,
|
|
514
|
+
this._oneOverRadiiSquared,
|
|
515
|
+
this._centerToleranceSquared,
|
|
516
|
+
result,
|
|
517
|
+
);
|
|
518
|
+
}
|
|
432
519
|
|
|
433
|
-
/**
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
520
|
+
/**
|
|
521
|
+
* Scales the provided Cartesian position along the geocentric surface normal
|
|
522
|
+
* so that it is on the surface of this ellipsoid.
|
|
523
|
+
*
|
|
524
|
+
* @param {Cartesian3} cartesian The Cartesian position to scale.
|
|
525
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
526
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
|
|
527
|
+
*/
|
|
528
|
+
scaleToGeocentricSurface(cartesian, result) {
|
|
529
|
+
//>>includeStart('debug', pragmas.debug);
|
|
530
|
+
Check.typeOf.object("cartesian", cartesian);
|
|
531
|
+
//>>includeEnd('debug');
|
|
532
|
+
|
|
533
|
+
if (!defined(result)) {
|
|
534
|
+
result = new Cartesian3();
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
const positionX = cartesian.x;
|
|
538
|
+
const positionY = cartesian.y;
|
|
539
|
+
const positionZ = cartesian.z;
|
|
540
|
+
const oneOverRadiiSquared = this._oneOverRadiiSquared;
|
|
541
|
+
|
|
542
|
+
const beta =
|
|
543
|
+
1.0 /
|
|
544
|
+
Math.sqrt(
|
|
545
|
+
positionX * positionX * oneOverRadiiSquared.x +
|
|
546
|
+
positionY * positionY * oneOverRadiiSquared.y +
|
|
547
|
+
positionZ * positionZ * oneOverRadiiSquared.z,
|
|
548
|
+
);
|
|
549
|
+
|
|
550
|
+
return Cartesian3.multiplyByScalar(cartesian, beta, result);
|
|
551
|
+
}
|
|
460
552
|
|
|
461
|
-
/**
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
Ellipsoid.prototype.cartographicArrayToCartesianArray = function (
|
|
476
|
-
cartographics,
|
|
477
|
-
result,
|
|
478
|
-
) {
|
|
479
|
-
//>>includeStart('debug', pragmas.debug);
|
|
480
|
-
Check.defined("cartographics", cartographics);
|
|
481
|
-
//>>includeEnd('debug');
|
|
553
|
+
/**
|
|
554
|
+
* Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
|
|
555
|
+
* its components by the result of {@link Ellipsoid#oneOverRadii}.
|
|
556
|
+
*
|
|
557
|
+
* @param {Cartesian3} position The position to transform.
|
|
558
|
+
* @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
|
|
559
|
+
* return a new instance.
|
|
560
|
+
* @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the
|
|
561
|
+
* one passed as the result parameter if it is not undefined, or a new instance of it is.
|
|
562
|
+
*/
|
|
563
|
+
transformPositionToScaledSpace(position, result) {
|
|
564
|
+
if (!defined(result)) {
|
|
565
|
+
result = new Cartesian3();
|
|
566
|
+
}
|
|
482
567
|
|
|
483
|
-
|
|
484
|
-
if (!defined(result)) {
|
|
485
|
-
result = new Array(length);
|
|
486
|
-
} else {
|
|
487
|
-
result.length = length;
|
|
488
|
-
}
|
|
489
|
-
for (let i = 0; i < length; i++) {
|
|
490
|
-
result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
|
|
568
|
+
return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);
|
|
491
569
|
}
|
|
492
|
-
return result;
|
|
493
|
-
};
|
|
494
570
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
* const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
|
|
510
|
-
* const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
|
|
511
|
-
*/
|
|
512
|
-
Ellipsoid.prototype.cartesianToCartographic = function (cartesian, result) {
|
|
513
|
-
//`cartesian is required.` is thrown from scaleToGeodeticSurface
|
|
514
|
-
const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);
|
|
571
|
+
/**
|
|
572
|
+
* Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
|
|
573
|
+
* its components by the result of {@link Ellipsoid#radii}.
|
|
574
|
+
*
|
|
575
|
+
* @param {Cartesian3} position The position to transform.
|
|
576
|
+
* @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
|
|
577
|
+
* return a new instance.
|
|
578
|
+
* @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the
|
|
579
|
+
* one passed as the result parameter if it is not undefined, or a new instance of it is.
|
|
580
|
+
*/
|
|
581
|
+
transformPositionFromScaledSpace(position, result) {
|
|
582
|
+
if (!defined(result)) {
|
|
583
|
+
result = new Cartesian3();
|
|
584
|
+
}
|
|
515
585
|
|
|
516
|
-
|
|
517
|
-
return undefined;
|
|
586
|
+
return Cartesian3.multiplyComponents(position, this._radii, result);
|
|
518
587
|
}
|
|
519
588
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
589
|
+
/**
|
|
590
|
+
* Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
|
|
591
|
+
* <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
592
|
+
*
|
|
593
|
+
* @param {Ellipsoid} [right] The other Ellipsoid.
|
|
594
|
+
* @returns {boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
595
|
+
*/
|
|
596
|
+
equals(right) {
|
|
597
|
+
return (
|
|
598
|
+
this === right ||
|
|
599
|
+
(defined(right) && Cartesian3.equals(this._radii, right._radii))
|
|
600
|
+
);
|
|
601
|
+
}
|
|
527
602
|
|
|
528
|
-
|
|
529
|
-
|
|
603
|
+
/**
|
|
604
|
+
* Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
|
|
605
|
+
*
|
|
606
|
+
* @returns {string} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
|
|
607
|
+
*/
|
|
608
|
+
toString() {
|
|
609
|
+
return this._radii.toString();
|
|
530
610
|
}
|
|
531
|
-
result.longitude = longitude;
|
|
532
|
-
result.latitude = latitude;
|
|
533
|
-
result.height = height;
|
|
534
|
-
return result;
|
|
535
|
-
};
|
|
536
611
|
|
|
537
|
-
/**
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
Ellipsoid.
|
|
552
|
-
|
|
553
|
-
result
|
|
554
|
-
)
|
|
555
|
-
|
|
556
|
-
Check.defined("cartesians", cartesians);
|
|
557
|
-
//>>includeEnd('debug');
|
|
612
|
+
/**
|
|
613
|
+
* Computes a point which is the intersection of the surface normal with the z-axis.
|
|
614
|
+
*
|
|
615
|
+
* @param {Cartesian3} position the position. must be on the surface of the ellipsoid.
|
|
616
|
+
* @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
|
|
617
|
+
* 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.
|
|
618
|
+
* In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
|
|
619
|
+
* Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
|
|
620
|
+
* @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and
|
|
621
|
+
* return a new instance.
|
|
622
|
+
* @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise
|
|
623
|
+
*
|
|
624
|
+
* @exception {DeveloperError} position is required.
|
|
625
|
+
* @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).
|
|
626
|
+
* @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.
|
|
627
|
+
*/
|
|
628
|
+
getSurfaceNormalIntersectionWithZAxis(position, buffer, result) {
|
|
629
|
+
//>>includeStart('debug', pragmas.debug);
|
|
630
|
+
Check.typeOf.object("position", position);
|
|
558
631
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
632
|
+
if (
|
|
633
|
+
!CesiumMath.equalsEpsilon(
|
|
634
|
+
this._radii.x,
|
|
635
|
+
this._radii.y,
|
|
636
|
+
CesiumMath.EPSILON15,
|
|
637
|
+
)
|
|
638
|
+
) {
|
|
639
|
+
throw new DeveloperError(
|
|
640
|
+
"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)",
|
|
641
|
+
);
|
|
642
|
+
}
|
|
570
643
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
* so that it is on the surface of this ellipsoid. If the position is
|
|
574
|
-
* at the center of the ellipsoid, this function returns undefined.
|
|
575
|
-
*
|
|
576
|
-
* @param {Cartesian3} cartesian The Cartesian position to scale.
|
|
577
|
-
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
578
|
-
* @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
|
|
579
|
-
*/
|
|
580
|
-
Ellipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {
|
|
581
|
-
return scaleToGeodeticSurface(
|
|
582
|
-
cartesian,
|
|
583
|
-
this._oneOverRadii,
|
|
584
|
-
this._oneOverRadiiSquared,
|
|
585
|
-
this._centerToleranceSquared,
|
|
586
|
-
result,
|
|
587
|
-
);
|
|
588
|
-
};
|
|
644
|
+
Check.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
|
|
645
|
+
//>>includeEnd('debug');
|
|
589
646
|
|
|
590
|
-
|
|
591
|
-
* Scales the provided Cartesian position along the geocentric surface normal
|
|
592
|
-
* so that it is on the surface of this ellipsoid.
|
|
593
|
-
*
|
|
594
|
-
* @param {Cartesian3} cartesian The Cartesian position to scale.
|
|
595
|
-
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
596
|
-
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
|
|
597
|
-
*/
|
|
598
|
-
Ellipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {
|
|
599
|
-
//>>includeStart('debug', pragmas.debug);
|
|
600
|
-
Check.typeOf.object("cartesian", cartesian);
|
|
601
|
-
//>>includeEnd('debug');
|
|
647
|
+
buffer = buffer ?? 0.0;
|
|
602
648
|
|
|
603
|
-
|
|
604
|
-
result = new Cartesian3();
|
|
605
|
-
}
|
|
649
|
+
const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
|
|
606
650
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const oneOverRadiiSquared = this._oneOverRadiiSquared;
|
|
651
|
+
if (!defined(result)) {
|
|
652
|
+
result = new Cartesian3();
|
|
653
|
+
}
|
|
611
654
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
positionX * positionX * oneOverRadiiSquared.x +
|
|
616
|
-
positionY * positionY * oneOverRadiiSquared.y +
|
|
617
|
-
positionZ * positionZ * oneOverRadiiSquared.z,
|
|
618
|
-
);
|
|
655
|
+
result.x = 0.0;
|
|
656
|
+
result.y = 0.0;
|
|
657
|
+
result.z = position.z * (1 - squaredXOverSquaredZ);
|
|
619
658
|
|
|
620
|
-
|
|
621
|
-
|
|
659
|
+
if (Math.abs(result.z) >= this._radii.z - buffer) {
|
|
660
|
+
return undefined;
|
|
661
|
+
}
|
|
622
662
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
result
|
|
636
|
-
)
|
|
637
|
-
|
|
638
|
-
|
|
663
|
+
return result;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Computes the ellipsoid curvatures at a given position on the surface.
|
|
668
|
+
*
|
|
669
|
+
* @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.
|
|
670
|
+
* @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.
|
|
671
|
+
* @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.
|
|
672
|
+
*
|
|
673
|
+
* @exception {DeveloperError} position is required.
|
|
674
|
+
*/
|
|
675
|
+
getLocalCurvature(surfacePosition, result) {
|
|
676
|
+
//>>includeStart('debug', pragmas.debug);
|
|
677
|
+
Check.typeOf.object("surfacePosition", surfacePosition);
|
|
678
|
+
//>>includeEnd('debug');
|
|
679
|
+
|
|
680
|
+
if (!defined(result)) {
|
|
681
|
+
result = new Cartesian2();
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
const primeVerticalEndpoint = this.getSurfaceNormalIntersectionWithZAxis(
|
|
685
|
+
surfacePosition,
|
|
686
|
+
0.0,
|
|
687
|
+
scratchEndpoint,
|
|
688
|
+
);
|
|
689
|
+
const primeVerticalRadius = Cartesian3.distance(
|
|
690
|
+
surfacePosition,
|
|
691
|
+
primeVerticalEndpoint,
|
|
692
|
+
);
|
|
693
|
+
// meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2
|
|
694
|
+
// where 1 - e^2 = b^2 / a^2,
|
|
695
|
+
// so meridional = b^2 * primeVerticalRadius^3 / a^4
|
|
696
|
+
// = (b * primeVerticalRadius / a^2)^2 * primeVertical
|
|
697
|
+
const radiusRatio =
|
|
698
|
+
(this.minimumRadius * primeVerticalRadius) / this.maximumRadius ** 2;
|
|
699
|
+
const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;
|
|
700
|
+
|
|
701
|
+
return Cartesian2.fromElements(
|
|
702
|
+
1.0 / primeVerticalRadius,
|
|
703
|
+
1.0 / meridionalRadius,
|
|
704
|
+
result,
|
|
705
|
+
);
|
|
639
706
|
}
|
|
640
707
|
|
|
641
|
-
|
|
642
|
-
|
|
708
|
+
/**
|
|
709
|
+
* Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
|
|
710
|
+
* Gauss-Legendre 10th order quadrature.
|
|
711
|
+
*
|
|
712
|
+
* @param {Rectangle} rectangle The rectangle used for computing the surface area.
|
|
713
|
+
* @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.
|
|
714
|
+
*/
|
|
715
|
+
surfaceArea(rectangle) {
|
|
716
|
+
//>>includeStart('debug', pragmas.debug);
|
|
717
|
+
Check.typeOf.object("rectangle", rectangle);
|
|
718
|
+
//>>includeEnd('debug');
|
|
719
|
+
const minLongitude = rectangle.west;
|
|
720
|
+
let maxLongitude = rectangle.east;
|
|
721
|
+
const minLatitude = rectangle.south;
|
|
722
|
+
const maxLatitude = rectangle.north;
|
|
723
|
+
|
|
724
|
+
while (maxLongitude < minLongitude) {
|
|
725
|
+
maxLongitude += CesiumMath.TWO_PI;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
const radiiSquared = this._radiiSquared;
|
|
729
|
+
const a2 = radiiSquared.x;
|
|
730
|
+
const b2 = radiiSquared.y;
|
|
731
|
+
const c2 = radiiSquared.z;
|
|
732
|
+
const a2b2 = a2 * b2;
|
|
733
|
+
return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {
|
|
734
|
+
// phi represents the angle measured from the north pole
|
|
735
|
+
// sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar
|
|
736
|
+
const sinPhi = Math.cos(lat);
|
|
737
|
+
const cosPhi = Math.sin(lat);
|
|
738
|
+
return (
|
|
739
|
+
Math.cos(lat) *
|
|
740
|
+
gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {
|
|
741
|
+
const cosTheta = Math.cos(lon);
|
|
742
|
+
const sinTheta = Math.sin(lon);
|
|
743
|
+
return Math.sqrt(
|
|
744
|
+
a2b2 * cosPhi * cosPhi +
|
|
745
|
+
c2 *
|
|
746
|
+
(b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *
|
|
747
|
+
sinPhi *
|
|
748
|
+
sinPhi,
|
|
749
|
+
);
|
|
750
|
+
})
|
|
751
|
+
);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}
|
|
643
755
|
|
|
644
756
|
/**
|
|
645
|
-
*
|
|
646
|
-
* its components by the result of {@link Ellipsoid#radii}.
|
|
757
|
+
* An Ellipsoid instance initialized to the WGS84 standard.
|
|
647
758
|
*
|
|
648
|
-
* @
|
|
649
|
-
* @
|
|
650
|
-
* return a new instance.
|
|
651
|
-
* @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the
|
|
652
|
-
* one passed as the result parameter if it is not undefined, or a new instance of it is.
|
|
759
|
+
* @type {Ellipsoid}
|
|
760
|
+
* @constant
|
|
653
761
|
*/
|
|
654
|
-
Ellipsoid.
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
) {
|
|
658
|
-
if (!defined(result)) {
|
|
659
|
-
result = new Cartesian3();
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
return Cartesian3.multiplyComponents(position, this._radii, result);
|
|
663
|
-
};
|
|
762
|
+
Ellipsoid.WGS84 = Object.freeze(
|
|
763
|
+
new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793),
|
|
764
|
+
);
|
|
664
765
|
|
|
665
766
|
/**
|
|
666
|
-
*
|
|
667
|
-
* <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
767
|
+
* An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
|
|
668
768
|
*
|
|
669
|
-
* @
|
|
670
|
-
* @
|
|
769
|
+
* @type {Ellipsoid}
|
|
770
|
+
* @constant
|
|
671
771
|
*/
|
|
672
|
-
Ellipsoid.
|
|
673
|
-
return (
|
|
674
|
-
this === right ||
|
|
675
|
-
(defined(right) && Cartesian3.equals(this._radii, right._radii))
|
|
676
|
-
);
|
|
677
|
-
};
|
|
772
|
+
Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));
|
|
678
773
|
|
|
679
774
|
/**
|
|
680
|
-
*
|
|
775
|
+
* An Ellipsoid instance initialized to a sphere with the lunar radius.
|
|
681
776
|
*
|
|
682
|
-
* @
|
|
777
|
+
* @type {Ellipsoid}
|
|
778
|
+
* @constant
|
|
683
779
|
*/
|
|
684
|
-
Ellipsoid.
|
|
685
|
-
|
|
686
|
-
|
|
780
|
+
Ellipsoid.MOON = Object.freeze(
|
|
781
|
+
new Ellipsoid(
|
|
782
|
+
CesiumMath.LUNAR_RADIUS,
|
|
783
|
+
CesiumMath.LUNAR_RADIUS,
|
|
784
|
+
CesiumMath.LUNAR_RADIUS,
|
|
785
|
+
),
|
|
786
|
+
);
|
|
687
787
|
|
|
688
788
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
* @param {Cartesian3} position the position. must be on the surface of the ellipsoid.
|
|
692
|
-
* @param {number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
|
|
693
|
-
* 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.
|
|
694
|
-
* In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
|
|
695
|
-
* Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
|
|
696
|
-
* @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and
|
|
697
|
-
* return a new instance.
|
|
698
|
-
* @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise
|
|
789
|
+
* An Ellipsoid instance initialized to a sphere with the mean radii of Mars.
|
|
790
|
+
* Source: https://epsg.io/104905
|
|
699
791
|
*
|
|
700
|
-
* @
|
|
701
|
-
* @
|
|
702
|
-
* @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.
|
|
792
|
+
* @type {Ellipsoid}
|
|
793
|
+
* @constant
|
|
703
794
|
*/
|
|
704
|
-
Ellipsoid.
|
|
705
|
-
position,
|
|
706
|
-
buffer,
|
|
707
|
-
result,
|
|
708
|
-
) {
|
|
709
|
-
//>>includeStart('debug', pragmas.debug);
|
|
710
|
-
Check.typeOf.object("position", position);
|
|
711
|
-
|
|
712
|
-
if (
|
|
713
|
-
!CesiumMath.equalsEpsilon(
|
|
714
|
-
this._radii.x,
|
|
715
|
-
this._radii.y,
|
|
716
|
-
CesiumMath.EPSILON15,
|
|
717
|
-
)
|
|
718
|
-
) {
|
|
719
|
-
throw new DeveloperError(
|
|
720
|
-
"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)",
|
|
721
|
-
);
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
Check.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
|
|
725
|
-
//>>includeEnd('debug');
|
|
726
|
-
|
|
727
|
-
buffer = buffer ?? 0.0;
|
|
728
|
-
|
|
729
|
-
const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
|
|
730
|
-
|
|
731
|
-
if (!defined(result)) {
|
|
732
|
-
result = new Cartesian3();
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
result.x = 0.0;
|
|
736
|
-
result.y = 0.0;
|
|
737
|
-
result.z = position.z * (1 - squaredXOverSquaredZ);
|
|
738
|
-
|
|
739
|
-
if (Math.abs(result.z) >= this._radii.z - buffer) {
|
|
740
|
-
return undefined;
|
|
741
|
-
}
|
|
795
|
+
Ellipsoid.MARS = Object.freeze(new Ellipsoid(3396190.0, 3396190.0, 3376200.0));
|
|
742
796
|
|
|
743
|
-
|
|
744
|
-
};
|
|
797
|
+
Ellipsoid._default = Ellipsoid.WGS84;
|
|
745
798
|
|
|
746
|
-
|
|
799
|
+
/**
|
|
800
|
+
* The number of elements used to pack the object into an array.
|
|
801
|
+
* @type {number}
|
|
802
|
+
*/
|
|
803
|
+
Ellipsoid.packedLength = Cartesian3.packedLength;
|
|
747
804
|
|
|
748
805
|
/**
|
|
749
|
-
* Computes the
|
|
750
|
-
*
|
|
751
|
-
* @param {Cartesian3} surfacePosition The position on the ellipsoid surface where curvatures will be calculated.
|
|
752
|
-
* @param {Cartesian2} [result] The cartesian to which to copy the result, or undefined to create and return a new instance.
|
|
753
|
-
* @returns {Cartesian2} The local curvature of the ellipsoid surface at the provided position, in east and north directions.
|
|
806
|
+
* Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
|
|
807
|
+
* @function
|
|
754
808
|
*
|
|
755
|
-
* @
|
|
809
|
+
* @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.
|
|
810
|
+
* @param {Cartesian3} [result] The object onto which to store the result.
|
|
811
|
+
* @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
|
|
756
812
|
*/
|
|
757
|
-
Ellipsoid.prototype.
|
|
758
|
-
//>>includeStart('debug', pragmas.debug);
|
|
759
|
-
Check.typeOf.object("surfacePosition", surfacePosition);
|
|
760
|
-
//>>includeEnd('debug');
|
|
813
|
+
Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;
|
|
761
814
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}
|
|
815
|
+
const cartographicToCartesianNormal = new Cartesian3();
|
|
816
|
+
const cartographicToCartesianK = new Cartesian3();
|
|
765
817
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const primeVerticalRadius = Cartesian3.distance(
|
|
772
|
-
surfacePosition,
|
|
773
|
-
primeVerticalEndpoint,
|
|
774
|
-
);
|
|
775
|
-
// meridional radius = (1 - e^2) * primeVerticalRadius^3 / a^2
|
|
776
|
-
// where 1 - e^2 = b^2 / a^2,
|
|
777
|
-
// so meridional = b^2 * primeVerticalRadius^3 / a^4
|
|
778
|
-
// = (b * primeVerticalRadius / a^2)^2 * primeVertical
|
|
779
|
-
const radiusRatio =
|
|
780
|
-
(this.minimumRadius * primeVerticalRadius) / this.maximumRadius ** 2;
|
|
781
|
-
const meridionalRadius = primeVerticalRadius * radiusRatio ** 2;
|
|
782
|
-
|
|
783
|
-
return Cartesian2.fromElements(
|
|
784
|
-
1.0 / primeVerticalRadius,
|
|
785
|
-
1.0 / meridionalRadius,
|
|
786
|
-
result,
|
|
787
|
-
);
|
|
788
|
-
};
|
|
818
|
+
const cartesianToCartographicN = new Cartesian3();
|
|
819
|
+
const cartesianToCartographicP = new Cartesian3();
|
|
820
|
+
const cartesianToCartographicH = new Cartesian3();
|
|
821
|
+
|
|
822
|
+
const scratchEndpoint = new Cartesian3();
|
|
789
823
|
|
|
790
824
|
const abscissas = [
|
|
791
825
|
0.14887433898163, 0.43339539412925, 0.67940956829902, 0.86506336668898,
|
|
@@ -801,7 +835,7 @@ const weights = [
|
|
|
801
835
|
*
|
|
802
836
|
* @param {number} a The lower bound for the integration.
|
|
803
837
|
* @param {number} b The upper bound for the integration.
|
|
804
|
-
* @param {
|
|
838
|
+
* @param {EllipsoidRealValuedScalarFunction} func The function to integrate.
|
|
805
839
|
* @returns {number} The value of the integral of the given function over the given domain.
|
|
806
840
|
*
|
|
807
841
|
* @private
|
|
@@ -829,61 +863,4 @@ function gaussLegendreQuadrature(a, b, func) {
|
|
|
829
863
|
return sum;
|
|
830
864
|
}
|
|
831
865
|
|
|
832
|
-
/**
|
|
833
|
-
* A real valued scalar function.
|
|
834
|
-
* @callback Ellipsoid~RealValuedScalarFunction
|
|
835
|
-
*
|
|
836
|
-
* @param {number} x The value used to evaluate the function.
|
|
837
|
-
* @returns {number} The value of the function at x.
|
|
838
|
-
*
|
|
839
|
-
* @private
|
|
840
|
-
*/
|
|
841
|
-
|
|
842
|
-
/**
|
|
843
|
-
* Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
|
|
844
|
-
* Gauss-Legendre 10th order quadrature.
|
|
845
|
-
*
|
|
846
|
-
* @param {Rectangle} rectangle The rectangle used for computing the surface area.
|
|
847
|
-
* @returns {number} The approximate area of the rectangle on the surface of this ellipsoid.
|
|
848
|
-
*/
|
|
849
|
-
Ellipsoid.prototype.surfaceArea = function (rectangle) {
|
|
850
|
-
//>>includeStart('debug', pragmas.debug);
|
|
851
|
-
Check.typeOf.object("rectangle", rectangle);
|
|
852
|
-
//>>includeEnd('debug');
|
|
853
|
-
const minLongitude = rectangle.west;
|
|
854
|
-
let maxLongitude = rectangle.east;
|
|
855
|
-
const minLatitude = rectangle.south;
|
|
856
|
-
const maxLatitude = rectangle.north;
|
|
857
|
-
|
|
858
|
-
while (maxLongitude < minLongitude) {
|
|
859
|
-
maxLongitude += CesiumMath.TWO_PI;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
const radiiSquared = this._radiiSquared;
|
|
863
|
-
const a2 = radiiSquared.x;
|
|
864
|
-
const b2 = radiiSquared.y;
|
|
865
|
-
const c2 = radiiSquared.z;
|
|
866
|
-
const a2b2 = a2 * b2;
|
|
867
|
-
return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {
|
|
868
|
-
// phi represents the angle measured from the north pole
|
|
869
|
-
// sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar
|
|
870
|
-
const sinPhi = Math.cos(lat);
|
|
871
|
-
const cosPhi = Math.sin(lat);
|
|
872
|
-
return (
|
|
873
|
-
Math.cos(lat) *
|
|
874
|
-
gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {
|
|
875
|
-
const cosTheta = Math.cos(lon);
|
|
876
|
-
const sinTheta = Math.sin(lon);
|
|
877
|
-
return Math.sqrt(
|
|
878
|
-
a2b2 * cosPhi * cosPhi +
|
|
879
|
-
c2 *
|
|
880
|
-
(b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *
|
|
881
|
-
sinPhi *
|
|
882
|
-
sinPhi,
|
|
883
|
-
);
|
|
884
|
-
})
|
|
885
|
-
);
|
|
886
|
-
});
|
|
887
|
-
};
|
|
888
|
-
|
|
889
866
|
export default Ellipsoid;
|