@cesium/engine 26.1.0 → 26.3.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/ThirdParty/Workers/zip-web-worker.js +764 -520
- package/Build/Workers/{chunk-HS6AD4P2.js → chunk-2DKJSPYF.js} +14 -14
- package/Build/Workers/{chunk-QVLAFFJY.js → chunk-2PWVICP6.js} +1 -1
- package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
- package/Build/Workers/{chunk-ENNFMWDW.js → chunk-4DMAXPKB.js} +12 -12
- package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-4LRFYRBX.js} +2 -2
- package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
- package/Build/Workers/{chunk-A6X24AZI.js → chunk-6BSNYZZG.js} +5 -5
- package/Build/Workers/{chunk-IGAZBTFZ.js → chunk-6R6SGKYN.js} +6 -6
- package/Build/Workers/{chunk-SS5ABQGY.js → chunk-6V2KDEHL.js} +4 -4
- package/Build/Workers/{chunk-ZMBHFYOX.js → chunk-75BC2IHI.js} +7 -7
- package/Build/Workers/{chunk-LGNDTZVX.js → chunk-7SESBH2I.js} +4 -4
- package/Build/Workers/{chunk-CLCTQVVL.js → chunk-7WXBTNRV.js} +8 -8
- package/Build/Workers/{chunk-WBSY7HDY.js → chunk-A7SMPV6B.js} +12 -12
- package/Build/Workers/{chunk-CEEZE3YZ.js → chunk-ATSXKJ3L.js} +7 -7
- package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
- package/Build/Workers/{chunk-6HK6IXK2.js → chunk-B7Q2WF6Q.js} +4 -4
- package/Build/Workers/{chunk-YKU2Q3A2.js → chunk-BNDSDQ7D.js} +9 -12
- package/Build/Workers/{chunk-R4FPNAZ2.js → chunk-CKK6CUXK.js} +9 -9
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
- package/Build/Workers/{chunk-7D2HZKH7.js → chunk-CQ4TZXAT.js} +7 -7
- package/Build/Workers/{chunk-TVZD72WJ.js → chunk-DKSANM4A.js} +12 -12
- package/Build/Workers/{chunk-FDK4K5IA.js → chunk-DZK34ZVD.js} +1 -1
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
- package/Build/Workers/{chunk-2EFYUSUY.js → chunk-F34TJJLA.js} +16 -16
- package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
- package/Build/Workers/{chunk-T5QBPLE3.js → chunk-GS7RY2DH.js} +11 -11
- package/Build/Workers/{chunk-C7JQVRLM.js → chunk-HDD3RFLT.js} +25 -3
- package/Build/Workers/{chunk-E7NZJOK7.js → chunk-HDPNFEPP.js} +121 -93
- package/Build/Workers/{chunk-VAL7DYNR.js → chunk-JBJ6BRIM.js} +4 -4
- package/Build/Workers/{chunk-XQ3SKCMM.js → chunk-JKTWW7IO.js} +5 -5
- package/Build/Workers/{chunk-UVO6COT2.js → chunk-JL4NWWQY.js} +5 -5
- package/Build/Workers/{chunk-DBD5WWG2.js → chunk-JMUUAW4X.js} +10 -10
- package/Build/Workers/{chunk-UEY73NRN.js → chunk-KBGAHN5R.js} +1 -1
- package/Build/Workers/{chunk-LD64RPYV.js → chunk-KEWK6VZL.js} +12 -12
- package/Build/Workers/{chunk-JW6OZT4R.js → chunk-L73K5UPP.js} +10 -10
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-LL2SGJYH.js} +6 -6
- package/Build/Workers/{chunk-XLXSDIP5.js → chunk-LYJUL4XQ.js} +6 -6
- package/Build/Workers/{chunk-SM2CDCYF.js → chunk-M6W46OAP.js} +7 -7
- package/Build/Workers/{chunk-EHTS2YPT.js → chunk-MDDKCLMF.js} +17 -17
- package/Build/Workers/{chunk-FGQFQHN5.js → chunk-MUW4DJV7.js} +18 -18
- package/Build/Workers/{chunk-HHV3MCGV.js → chunk-N5YK44FS.js} +5 -5
- package/Build/Workers/{chunk-RG4F5R57.js → chunk-NZQUP52G.js} +9 -9
- package/Build/Workers/{chunk-B4CQSLZJ.js → chunk-PKZA44LH.js} +6 -6
- package/Build/Workers/{chunk-OBEU25PI.js → chunk-Q2JS5LCB.js} +17 -17
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
- package/Build/Workers/{chunk-NIWITKQK.js → chunk-SEJIXZZ4.js} +11 -11
- package/Build/Workers/{chunk-SGRGNDOD.js → chunk-SL2HCFYW.js} +10 -10
- package/Build/Workers/{chunk-SF6K72D7.js → chunk-SLHK3KAR.js} +5 -5
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
- package/Build/Workers/{chunk-LNSQVXFH.js → chunk-VRECSMG3.js} +2 -2
- package/Build/Workers/{chunk-A3O6EDBK.js → chunk-X27HKF5E.js} +2 -2
- package/Build/Workers/{chunk-7KVKHY7O.js → chunk-XBY3354M.js} +6 -6
- package/Build/Workers/{chunk-GSWMAFTE.js → chunk-XRZCS3HE.js} +23 -16
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-XSIUYAT6.js} +2 -2
- package/Build/Workers/{chunk-ZSGUV73H.js → chunk-Z2DW5NM2.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 +35 -35
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +31 -33
- package/Build/Workers/createCorridorOutlineGeometry.js +29 -31
- 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 +24 -24
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +34 -34
- package/Build/Workers/createPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createPolylineGeometry.js +26 -26
- 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 +21 -21
- package/Build/Workers/createSimplePolylineGeometry.js +24 -24
- 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 +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- 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 +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +2 -2
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +1 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +5 -0
- package/Source/Core/IonSnapGeometryType.js +59 -0
- package/Source/Core/IonSnapHeat.js +33 -0
- package/Source/Core/IonSnapMode.js +45 -0
- package/Source/Core/IonSnapParentGeometryType.js +52 -0
- package/Source/Core/IonSnapService.js +369 -0
- package/Source/Core/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +2 -2
- package/Source/Core/Matrix3.js +2 -2
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainPicker.js +179 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1211 -0
- package/Source/Core/VectorProvider.js +669 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +2 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -2
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +67 -2
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -10
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/Texture.js +11 -0
- package/Source/Renderer/UniformState.js +54 -1
- package/Source/Renderer/VertexArray.js +0 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +7 -3
- package/Source/Scene/BufferPointCollection.js +4 -7
- package/Source/Scene/BufferPolygonCollection.js +56 -27
- package/Source/Scene/BufferPolylineCollection.js +61 -8
- package/Source/Scene/BufferPolylineMaterial.js +6 -5
- package/Source/Scene/BufferPrimitiveCollection.js +226 -34
- package/Source/Scene/Camera.js +71 -5
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +62 -9
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/DerivedCommand.js +94 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/Globe.js +20 -0
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +42 -53
- package/Source/Scene/GlobeSurfaceTile.js +61 -10
- package/Source/Scene/GlobeSurfaceTileProvider.js +351 -26
- package/Source/Scene/GltfLoader.js +88 -9
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +188 -4
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +1 -1
- package/Source/Scene/MVTDataProvider.js +11 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +250 -26
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelDrawCommand.js +160 -16
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +31 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +33 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/ModelComponents.js +71 -0
- package/Source/Scene/Picking.js +16 -5
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -1
- package/Source/Scene/PostProcessStage.js +26 -5
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +16 -13
- package/Source/Scene/Scene.js +258 -6
- package/Source/Scene/ScreenSpaceCameraController.js +1 -2
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +241 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +13 -2
- package/Source/Scene/Vector3DTileContent.js +2 -3
- package/Source/Scene/VectorGltf3DTileContent.js +31 -3
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/renderBufferPointCollection.js +1 -2
- package/Source/Scene/renderBufferPolygonCollection.js +1 -2
- package/Source/Scene/renderBufferPolylineCollection.js +6 -3
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +20 -14
- package/Source/Shaders/GlobeFS.js +20 -14
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
- package/Source/Shaders/Model/ModelFS.glsl +109 -0
- package/Source/Shaders/Model/ModelFS.js +109 -0
- package/Source/Shaders/Model/ModelVS.glsl +7 -2
- package/Source/Shaders/Model/ModelVS.js +7 -2
- package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
- package/Source/Shaders/VectorCommon.glsl +305 -0
- package/Source/Shaders/VectorCommon.js +307 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/index.d.ts +1326 -65
- package/index.js +179 -155
- package/package.json +6 -6
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
- package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
package/Source/Scene/View.js
CHANGED
|
@@ -11,6 +11,7 @@ import Pass from "../Renderer/Pass.js";
|
|
|
11
11
|
import PassState from "../Renderer/PassState.js";
|
|
12
12
|
import Camera from "./Camera.js";
|
|
13
13
|
import EdgeFramebuffer from "./EdgeFramebuffer.js";
|
|
14
|
+
import PlanarFillIdFramebuffer from "./PlanarFillIdFramebuffer.js";
|
|
14
15
|
import FrustumCommands from "./FrustumCommands.js";
|
|
15
16
|
import GlobeDepth from "./GlobeDepth.js";
|
|
16
17
|
import GlobeTranslucencyFramebuffer from "./GlobeTranslucencyFramebuffer.js";
|
|
@@ -62,9 +63,11 @@ function View(scene, camera, viewport) {
|
|
|
62
63
|
this.viewport = viewport;
|
|
63
64
|
this.passState = passState;
|
|
64
65
|
this.pickFramebuffer = new PickFramebuffer(context);
|
|
66
|
+
this.snapFramebuffer = undefined;
|
|
65
67
|
this.pickDepthFramebuffer = new PickDepthFramebuffer();
|
|
66
68
|
this.sceneFramebuffer = new SceneFramebuffer();
|
|
67
69
|
this.edgeFramebuffer = new EdgeFramebuffer();
|
|
70
|
+
this.planarFillIdFramebuffer = new PlanarFillIdFramebuffer();
|
|
68
71
|
this.globeDepth = globeDepth;
|
|
69
72
|
this.globeTranslucencyFramebuffer = new GlobeTranslucencyFramebuffer();
|
|
70
73
|
this.oit = oit;
|
|
@@ -211,15 +214,11 @@ function updateFrustums(view, scene, near, far) {
|
|
|
211
214
|
curNear = Math.max(near, Math.pow(farToNearRatio, m) * near);
|
|
212
215
|
curFar = Math.min(far, farToNearRatio * curNear);
|
|
213
216
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
frustumCommands = frustumCommandsList[m] = new FrustumCommands(
|
|
217
|
-
curNear,
|
|
218
|
-
curFar,
|
|
219
|
-
);
|
|
217
|
+
if (!defined(frustumCommandsList[m])) {
|
|
218
|
+
frustumCommandsList[m] = new FrustumCommands(curNear, curFar);
|
|
220
219
|
} else {
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
frustumCommandsList[m].near = curNear;
|
|
221
|
+
frustumCommandsList[m].far = curFar;
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
}
|
|
@@ -443,11 +442,14 @@ View.prototype.createPotentiallyVisibleSet = function (scene) {
|
|
|
443
442
|
|
|
444
443
|
View.prototype.destroy = function () {
|
|
445
444
|
this.pickFramebuffer = this.pickFramebuffer && this.pickFramebuffer.destroy();
|
|
445
|
+
this.snapFramebuffer = this.snapFramebuffer && this.snapFramebuffer.destroy();
|
|
446
446
|
this.pickDepthFramebuffer =
|
|
447
447
|
this.pickDepthFramebuffer && this.pickDepthFramebuffer.destroy();
|
|
448
448
|
this.sceneFramebuffer =
|
|
449
449
|
this.sceneFramebuffer && this.sceneFramebuffer.destroy();
|
|
450
450
|
this.edgeFramebuffer = this.edgeFramebuffer && this.edgeFramebuffer.destroy();
|
|
451
|
+
this.planarFillIdFramebuffer =
|
|
452
|
+
this.planarFillIdFramebuffer && this.planarFillIdFramebuffer.destroy();
|
|
451
453
|
this.globeDepth = this.globeDepth && this.globeDepth.destroy();
|
|
452
454
|
this.oit = this.oit && this.oit.destroy();
|
|
453
455
|
this.translucentTileClassification =
|
|
@@ -602,7 +602,7 @@ function updateKeyframeNodes(that, frameState) {
|
|
|
602
602
|
that._primitive.tileFailed.raiseEvent();
|
|
603
603
|
continue;
|
|
604
604
|
}
|
|
605
|
-
let addNodeIndex
|
|
605
|
+
let addNodeIndex;
|
|
606
606
|
if (megatexture.isFull()) {
|
|
607
607
|
// If the megatexture is full, try removing a discardable node with the lowest priority.
|
|
608
608
|
addNodeIndex = keyframeNodesInMegatextureCount - 1 - destroyedCount;
|
|
@@ -48,7 +48,10 @@ const excludesReverseAxis = [
|
|
|
48
48
|
* @property {object} [getFeatureInfoParameters=WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
|
|
49
49
|
* @property {Resource|string} [getFeatureInfoUrl] The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.
|
|
50
50
|
* @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats
|
|
51
|
-
* in which to try WMS GetFeatureInfo requests.
|
|
51
|
+
* in which to try WMS GetFeatureInfo requests. Since feature info responses vary across WMS services,
|
|
52
|
+
* you may need to supply a custom format and parsing callback; see the
|
|
53
|
+
* {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete
|
|
54
|
+
* example of writing your own callback.
|
|
52
55
|
* @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.
|
|
53
56
|
* @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme to use to divide the world into tiles.
|
|
54
57
|
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
|
|
@@ -90,6 +93,7 @@ const excludesReverseAxis = [
|
|
|
90
93
|
*
|
|
91
94
|
* @see {@link https://enterprise.arcgis.com/en/server/latest/publish-services/linux/wms-services.htm|ArcGIS Server WMS Services}
|
|
92
95
|
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
|
|
96
|
+
* @see {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Custom GetFeatureInfo Sandcastle Example}
|
|
93
97
|
*
|
|
94
98
|
* @example
|
|
95
99
|
* // WMS servers operated by the US government https://apps.nationalmap.gov/services/
|
|
@@ -29,7 +29,10 @@ import GetFeatureInfoFormat from "./GetFeatureInfoFormat.js";
|
|
|
29
29
|
* @property {object} [getFeatureInfoParameters] Additional parameters to include in GetFeatureInfo requests. Keys are lowercased internally.
|
|
30
30
|
* @property {Resource|string} [getFeatureInfoUrl] The GetFeatureInfo URL of the WMTS service. If not specified, the value of <code>url</code> is used.
|
|
31
31
|
* @property {GetFeatureInfoFormat[]} [getFeatureInfoFormats=WebMapTileServiceImageryProvider.DefaultGetFeatureInfoFormats] The formats
|
|
32
|
-
* in which to try WMTS GetFeatureInfo requests.
|
|
32
|
+
* in which to try WMTS GetFeatureInfo requests. Since feature info responses vary across WMTS services,
|
|
33
|
+
* you may need to supply a custom format and parsing callback; see the
|
|
34
|
+
* {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Sandcastle example} for a complete
|
|
35
|
+
* example of writing your own callback.
|
|
33
36
|
* @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle covered by the layer.
|
|
34
37
|
* @property {TilingScheme} [tilingScheme] The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
|
|
35
38
|
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
|
|
@@ -176,6 +179,8 @@ import GetFeatureInfoFormat from "./GetFeatureInfoFormat.js";
|
|
|
176
179
|
* @see TileMapServiceImageryProvider
|
|
177
180
|
* @see WebMapServiceImageryProvider
|
|
178
181
|
* @see UrlTemplateImageryProvider
|
|
182
|
+
*
|
|
183
|
+
* @see {@link https://sandcastle.cesium.com/?id=web-map-tile-service-picking|Custom GetFeatureInfo Sandcastle Example}
|
|
179
184
|
*/
|
|
180
185
|
function WebMapTileServiceImageryProvider(options) {
|
|
181
186
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -306,8 +306,7 @@ function renderBufferPointCollection(collection, frameState, renderContext) {
|
|
|
306
306
|
|
|
307
307
|
frameState.commandList.push(command);
|
|
308
308
|
|
|
309
|
-
collection.
|
|
310
|
-
collection._dirtyOffset = 0;
|
|
309
|
+
collection._makeClean();
|
|
311
310
|
|
|
312
311
|
return renderContext;
|
|
313
312
|
}
|
|
@@ -332,8 +332,7 @@ function renderBufferPolygonCollection(collection, frameState, renderContext) {
|
|
|
332
332
|
|
|
333
333
|
frameState.commandList.push(command);
|
|
334
334
|
|
|
335
|
-
collection.
|
|
336
|
-
collection._dirtyOffset = 0;
|
|
335
|
+
collection._makeClean();
|
|
337
336
|
|
|
338
337
|
return renderContext;
|
|
339
338
|
}
|
|
@@ -168,6 +168,8 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
|
|
|
168
168
|
if (collection._dirtyCount > 0) {
|
|
169
169
|
const { _dirtyOffset, _dirtyCount } = collection;
|
|
170
170
|
|
|
171
|
+
const widthInMeters = collection.widthUnits === "meters";
|
|
172
|
+
|
|
171
173
|
const indexArray = renderContext.indexArray;
|
|
172
174
|
|
|
173
175
|
const {
|
|
@@ -200,6 +202,8 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
|
|
|
200
202
|
polyline.getMaterial(material);
|
|
201
203
|
const encodedColor = AttributeCompression.encodeRGB8(material.color);
|
|
202
204
|
const colorAlpha = material.color.alpha;
|
|
205
|
+
// A negative width marks a width in meters, which the shader converts to pixels.
|
|
206
|
+
const signedWidth = widthInMeters ? -material.width : material.width;
|
|
203
207
|
Color.fromRgba(polyline._pickId, pickColor);
|
|
204
208
|
const show = polyline.show;
|
|
205
209
|
|
|
@@ -306,7 +310,7 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
|
|
|
306
310
|
|
|
307
311
|
showColorWidthAndTexCoordArray[vOffset * 4] = show ? 1 : 0;
|
|
308
312
|
showColorWidthAndTexCoordArray[vOffset * 4 + 1] = encodedColor;
|
|
309
|
-
showColorWidthAndTexCoordArray[vOffset * 4 + 2] =
|
|
313
|
+
showColorWidthAndTexCoordArray[vOffset * 4 + 2] = signedWidth;
|
|
310
314
|
showColorWidthAndTexCoordArray[vOffset * 4 + 3] = j / (jl - 1);
|
|
311
315
|
|
|
312
316
|
alphaArray[vOffset] = colorAlpha * 255.0;
|
|
@@ -544,8 +548,7 @@ function renderBufferPolylineCollection(collection, frameState, renderContext) {
|
|
|
544
548
|
|
|
545
549
|
frameState.commandList.push(command);
|
|
546
550
|
|
|
547
|
-
collection.
|
|
548
|
-
collection._dirtyOffset = 0;
|
|
551
|
+
collection._makeClean();
|
|
549
552
|
|
|
550
553
|
return renderContext;
|
|
551
554
|
}
|
|
@@ -24,7 +24,7 @@ void main()
|
|
|
24
24
|
{
|
|
25
25
|
float show = showColorWidthAndTexCoord.x;
|
|
26
26
|
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
|
|
27
|
-
float
|
|
27
|
+
float signedWidth = showColorWidthAndTexCoord.z;
|
|
28
28
|
float texCoord = showColorWidthAndTexCoord.w;
|
|
29
29
|
|
|
30
30
|
///////////////////////////////////////////////////////////////////////////
|
|
@@ -37,11 +37,23 @@ void main()
|
|
|
37
37
|
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
38
38
|
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
|
|
39
39
|
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
|
|
40
|
-
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
41
40
|
#else
|
|
42
41
|
vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
43
42
|
vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);
|
|
44
43
|
vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
// A negative width is in meters; see renderBufferPolylineCollection. The quad is
|
|
47
|
+
// extruded in window coordinates, so convert it at this vertex's depth.
|
|
48
|
+
float width = abs(signedWidth);
|
|
49
|
+
if (signedWidth < 0.0)
|
|
50
|
+
{
|
|
51
|
+
width /= max(czm_metersPerPixel(positionEC), czm_epsilon7);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
#ifdef USE_FLOAT64
|
|
55
|
+
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
56
|
+
#else
|
|
45
57
|
// Positions are already in eye space; use the EC variant to skip the redundant transform.
|
|
46
58
|
vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
47
59
|
#endif
|
|
@@ -25,7 +25,7 @@ void main()\n\
|
|
|
25
25
|
{\n\
|
|
26
26
|
float show = showColorWidthAndTexCoord.x;\n\
|
|
27
27
|
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);\n\
|
|
28
|
-
float
|
|
28
|
+
float signedWidth = showColorWidthAndTexCoord.z;\n\
|
|
29
29
|
float texCoord = showColorWidthAndTexCoord.w;\n\
|
|
30
30
|
\n\
|
|
31
31
|
///////////////////////////////////////////////////////////////////////////\n\
|
|
@@ -38,11 +38,23 @@ void main()\n\
|
|
|
38
38
|
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);\n\
|
|
39
39
|
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);\n\
|
|
40
40
|
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);\n\
|
|
41
|
-
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
|
|
42
41
|
#else\n\
|
|
43
42
|
vec4 positionEC = czm_modelView * vec4(position, 1.0);\n\
|
|
44
43
|
vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0);\n\
|
|
45
44
|
vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0);\n\
|
|
45
|
+
#endif\n\
|
|
46
|
+
\n\
|
|
47
|
+
// A negative width is in meters; see renderBufferPolylineCollection. The quad is\n\
|
|
48
|
+
// extruded in window coordinates, so convert it at this vertex's depth.\n\
|
|
49
|
+
float width = abs(signedWidth);\n\
|
|
50
|
+
if (signedWidth < 0.0)\n\
|
|
51
|
+
{\n\
|
|
52
|
+
width /= max(czm_metersPerPixel(positionEC), czm_epsilon7);\n\
|
|
53
|
+
}\n\
|
|
54
|
+
\n\
|
|
55
|
+
#ifdef USE_FLOAT64\n\
|
|
56
|
+
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
|
|
57
|
+
#else\n\
|
|
46
58
|
// Positions are already in eye space; use the EC variant to skip the redundant transform.\n\
|
|
47
59
|
vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);\n\
|
|
48
60
|
#endif\n\
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "/**\n\
|
|
3
|
+
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_PLANAR_FILL_ID}\n\
|
|
4
|
+
*\n\
|
|
5
|
+
* @name czm_passCesium3DTilePlanarFillId\n\
|
|
6
|
+
* @glslConstant\n\
|
|
7
|
+
*\n\
|
|
8
|
+
* @see czm_pass\n\
|
|
9
|
+
*/\n\
|
|
10
|
+
const float czm_passCesium3DTilePlanarFillId = 5.0;\n\
|
|
11
|
+
";
|
|
@@ -16,6 +16,7 @@ import czm_passCesium3DTileClassification from './Constants/passCesium3DTileClas
|
|
|
16
16
|
import czm_passCesium3DTileClassificationIgnoreShow from './Constants/passCesium3DTileClassificationIgnoreShow.js'
|
|
17
17
|
import czm_passCesium3DTileEdges from './Constants/passCesium3DTileEdges.js'
|
|
18
18
|
import czm_passCesium3DTileEdgesDirect from './Constants/passCesium3DTileEdgesDirect.js'
|
|
19
|
+
import czm_passCesium3DTilePlanarFillId from './Constants/passCesium3DTilePlanarFillId.js'
|
|
19
20
|
import czm_passClassification from './Constants/passClassification.js'
|
|
20
21
|
import czm_passCompute from './Constants/passCompute.js'
|
|
21
22
|
import czm_passEnvironment from './Constants/passEnvironment.js'
|
|
@@ -66,7 +67,6 @@ import czm_cascadeColor from './Functions/cascadeColor.js'
|
|
|
66
67
|
import czm_cascadeDistance from './Functions/cascadeDistance.js'
|
|
67
68
|
import czm_cascadeMatrix from './Functions/cascadeMatrix.js'
|
|
68
69
|
import czm_cascadeWeights from './Functions/cascadeWeights.js'
|
|
69
|
-
import czm_clipPolygons from './Functions/clipPolygons.js'
|
|
70
70
|
import czm_columbusViewMorph from './Functions/columbusViewMorph.js'
|
|
71
71
|
import czm_computeAtmosphereColor from './Functions/computeAtmosphereColor.js'
|
|
72
72
|
import czm_computeGroundAtmosphereScattering from './Functions/computeGroundAtmosphereScattering.js'
|
|
@@ -82,6 +82,7 @@ import czm_ellipsoidContainsPoint from './Functions/ellipsoidContainsPoint.js'
|
|
|
82
82
|
import czm_ellipsoidTextureCoordinates from './Functions/ellipsoidTextureCoordinates.js'
|
|
83
83
|
import czm_equalsEpsilon from './Functions/equalsEpsilon.js'
|
|
84
84
|
import czm_eyeOffset from './Functions/eyeOffset.js'
|
|
85
|
+
import czm_eyeToCartographicDelta from './Functions/eyeToCartographicDelta.js'
|
|
85
86
|
import czm_eyeToWindowCoordinates from './Functions/eyeToWindowCoordinates.js'
|
|
86
87
|
import czm_fastApproximateAtan from './Functions/fastApproximateAtan.js'
|
|
87
88
|
import czm_fog from './Functions/fog.js'
|
|
@@ -130,7 +131,6 @@ import czm_transformPlane from './Functions/transformPlane.js'
|
|
|
130
131
|
import czm_translateRelativeToEye from './Functions/translateRelativeToEye.js'
|
|
131
132
|
import czm_translucentPhong from './Functions/translucentPhong.js'
|
|
132
133
|
import czm_transpose from './Functions/transpose.js'
|
|
133
|
-
import czm_unpackClippingExtents from './Functions/unpackClippingExtents.js'
|
|
134
134
|
import czm_unpackDepth from './Functions/unpackDepth.js'
|
|
135
135
|
import czm_unpackFloat from './Functions/unpackFloat.js'
|
|
136
136
|
import czm_unpackTexture from './Functions/unpackTexture.js'
|
|
@@ -160,6 +160,7 @@ export default {
|
|
|
160
160
|
czm_passCesium3DTileClassificationIgnoreShow : czm_passCesium3DTileClassificationIgnoreShow,
|
|
161
161
|
czm_passCesium3DTileEdges : czm_passCesium3DTileEdges,
|
|
162
162
|
czm_passCesium3DTileEdgesDirect : czm_passCesium3DTileEdgesDirect,
|
|
163
|
+
czm_passCesium3DTilePlanarFillId : czm_passCesium3DTilePlanarFillId,
|
|
163
164
|
czm_passClassification : czm_passClassification,
|
|
164
165
|
czm_passCompute : czm_passCompute,
|
|
165
166
|
czm_passEnvironment : czm_passEnvironment,
|
|
@@ -210,7 +211,6 @@ export default {
|
|
|
210
211
|
czm_cascadeDistance : czm_cascadeDistance,
|
|
211
212
|
czm_cascadeMatrix : czm_cascadeMatrix,
|
|
212
213
|
czm_cascadeWeights : czm_cascadeWeights,
|
|
213
|
-
czm_clipPolygons : czm_clipPolygons,
|
|
214
214
|
czm_columbusViewMorph : czm_columbusViewMorph,
|
|
215
215
|
czm_computeAtmosphereColor : czm_computeAtmosphereColor,
|
|
216
216
|
czm_computeGroundAtmosphereScattering : czm_computeGroundAtmosphereScattering,
|
|
@@ -226,6 +226,7 @@ export default {
|
|
|
226
226
|
czm_ellipsoidTextureCoordinates : czm_ellipsoidTextureCoordinates,
|
|
227
227
|
czm_equalsEpsilon : czm_equalsEpsilon,
|
|
228
228
|
czm_eyeOffset : czm_eyeOffset,
|
|
229
|
+
czm_eyeToCartographicDelta : czm_eyeToCartographicDelta,
|
|
229
230
|
czm_eyeToWindowCoordinates : czm_eyeToWindowCoordinates,
|
|
230
231
|
czm_fastApproximateAtan : czm_fastApproximateAtan,
|
|
231
232
|
czm_fog : czm_fog,
|
|
@@ -274,7 +275,6 @@ export default {
|
|
|
274
275
|
czm_translateRelativeToEye : czm_translateRelativeToEye,
|
|
275
276
|
czm_translucentPhong : czm_translucentPhong,
|
|
276
277
|
czm_transpose : czm_transpose,
|
|
277
|
-
czm_unpackClippingExtents : czm_unpackClippingExtents,
|
|
278
278
|
czm_unpackDepth : czm_unpackDepth,
|
|
279
279
|
czm_unpackFloat : czm_unpackFloat,
|
|
280
280
|
czm_unpackTexture : czm_unpackTexture,
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Computes the geodetic offset (delta longitude, latitude, and height) from a reference cartographic position
|
|
3
|
+
* to a point given in eye coordinates.
|
|
4
|
+
*
|
|
5
|
+
* This is designed to preserve precision. Rather than converting the point's absolute world position to
|
|
6
|
+
* cartographic -- which is too large to process precisely at 32 bits -- it works entirely with the small
|
|
7
|
+
* delta between the point and the camera. By projecting the eye-space offset onto the ellipsoid's equatorial
|
|
8
|
+
* and meridional planes, it derives the change in (longitude, latitude, height) as small, precisely-representable
|
|
9
|
+
* quantities. The delta gets smaller and more precise as one zooms in.
|
|
10
|
+
* <br /><br />
|
|
11
|
+
* This assumes an ellipsoid of revolution (equatorial radii equal, as with WGS84), so that longitude is exact.
|
|
12
|
+
* The latitude calculation is only first-order accurate, since the meridian is an ellipse rather than a circle.
|
|
13
|
+
*
|
|
14
|
+
* @name czm_eyeToCartographicDelta
|
|
15
|
+
* @glslFunction
|
|
16
|
+
*
|
|
17
|
+
* @param {vec3} positionEC The position, in eye coordinates, to measure to.
|
|
18
|
+
*
|
|
19
|
+
* @returns {vec3} The geodetic offset from the camera to <code>positionEC</code>, as (delta longitude, delta latitude in radians, delta height in meters).
|
|
20
|
+
*/
|
|
21
|
+
vec3 czm_eyeToCartographicDelta(vec3 positionEC)
|
|
22
|
+
{
|
|
23
|
+
// A vector representing the camera-to-vertex offset, in an ENU oriented reference frame (centered at the camera)
|
|
24
|
+
vec3 cameraToVertex = czm_eyeToEnu * positionEC;
|
|
25
|
+
|
|
26
|
+
float cosLatitude = cos(czm_eyeCartographic.y);
|
|
27
|
+
float sinLatitude = sin(czm_eyeCartographic.y);
|
|
28
|
+
|
|
29
|
+
// To derive longitude, project the camera and vertex onto the equatorial plane, in a frame such that the camera lies along the +x axis. In this frame,
|
|
30
|
+
// the vertex's (delta) longitude is simply the atan of its x and y components.
|
|
31
|
+
float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x;
|
|
32
|
+
vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0);
|
|
33
|
+
vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x);
|
|
34
|
+
float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x);
|
|
35
|
+
|
|
36
|
+
// Deriving latitude is a bit harder: we can't directly project the vertex onto the camera's meridian — the latitude projection is dependent on the longitude.
|
|
37
|
+
// Instead we can rotate the vertex (by -deltaLongitude) onto the camera's meridional plane. (Note: (unlike the exact longitude case) this is only first-order accurate because the meridian is an ellipse rather than a circle)
|
|
38
|
+
// Using a 2D rotation formula introduces precision issues (subtraction of large-magnitude quantities), so instead we can calculate the vector difference
|
|
39
|
+
// between the vertex and its rotated version, and apply that offset to the cameraToVertex vector. Then, the cameraToVertex vector accurately
|
|
40
|
+
// reflects the difference between the camera and the _rotated_ vertex, so we can then project the camera onto the meridional plane and apply this offset - just as we did for deltaLongitude, above.
|
|
41
|
+
// Best of all, we can do this all with small delta quantities which preserve precision.
|
|
42
|
+
//
|
|
43
|
+
// (I suggest drawing this out -- with the vertex and camera vectors projected onto the equatorial plane, with the camera on the +x axis)
|
|
44
|
+
// Mathematically: if you compare (subtract) vertexEquatorialPos and the same vector rotated onto the camera's meridional plane, you get
|
|
45
|
+
// |dx| = |vertexEquatorialPos| - vertexEquatorialPos.x = (r - x) = r * (1 - cos(deltaLongitude))
|
|
46
|
+
// |dy| = cameraToVertex.x (the east component)
|
|
47
|
+
// (To avoid precision issues, we'll use the identity (1 - cos(x) = 2 * sin^2(x/2)))
|
|
48
|
+
//
|
|
49
|
+
// Since these offsets were produced in the equatorial plane, and cameraToVertex is in the camera's ENU frame, we need to deconstruct along the camera's north and up axes. And we only care about
|
|
50
|
+
// dx, since dy is in the camera's east direction, and that component gets zeroed out when projecting onto the camera's meridional plane.
|
|
51
|
+
float sinHalfLongitude = sin(deltaLongitude * 0.5);
|
|
52
|
+
float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude;
|
|
53
|
+
vec3 meridionalOffset = vec3(
|
|
54
|
+
0.0, // east
|
|
55
|
+
cameraToVertex.y - dx * sinLatitude, // north
|
|
56
|
+
cameraToVertex.z + dx * cosLatitude // up
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// Reframe the camera in a meridional plane, where it lies along the +z axis, and apply the meridionalOffset to get the vertex's position in that plane.
|
|
60
|
+
// Then, deltaLatitude is simply the atan of its x and y components.
|
|
61
|
+
float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y;
|
|
62
|
+
vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0);
|
|
63
|
+
vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y);
|
|
64
|
+
float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x);
|
|
65
|
+
|
|
66
|
+
// Finally, derive the change in height above the ellipsoid. This is the meridional-plane analogue of the dx step above:
|
|
67
|
+
// there we rotated the vertex (in the equatorial plane) to the camera's longitude; here we rotate it (in the meridional plane, by -deltaLatitude)
|
|
68
|
+
// to the camera's latitude, aligning it with the camera's radial (up) direction.
|
|
69
|
+
float sinHalfLatitude = sin(deltaLatitude * 0.5);
|
|
70
|
+
float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude;
|
|
71
|
+
float deltaHeight = meridionalOffset.z + dz;
|
|
72
|
+
|
|
73
|
+
return vec3(deltaLongitude, deltaLatitude, deltaHeight);
|
|
74
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//This file is automatically rebuilt by the Cesium build process.
|
|
2
|
+
export default "/**\n\
|
|
3
|
+
* Computes the geodetic offset (delta longitude, latitude, and height) from a reference cartographic position\n\
|
|
4
|
+
* to a point given in eye coordinates.\n\
|
|
5
|
+
*\n\
|
|
6
|
+
* This is designed to preserve precision. Rather than converting the point's absolute world position to\n\
|
|
7
|
+
* cartographic -- which is too large to process precisely at 32 bits -- it works entirely with the small\n\
|
|
8
|
+
* delta between the point and the camera. By projecting the eye-space offset onto the ellipsoid's equatorial\n\
|
|
9
|
+
* and meridional planes, it derives the change in (longitude, latitude, height) as small, precisely-representable\n\
|
|
10
|
+
* quantities. The delta gets smaller and more precise as one zooms in.\n\
|
|
11
|
+
* <br /><br />\n\
|
|
12
|
+
* This assumes an ellipsoid of revolution (equatorial radii equal, as with WGS84), so that longitude is exact.\n\
|
|
13
|
+
* The latitude calculation is only first-order accurate, since the meridian is an ellipse rather than a circle.\n\
|
|
14
|
+
*\n\
|
|
15
|
+
* @name czm_eyeToCartographicDelta\n\
|
|
16
|
+
* @glslFunction\n\
|
|
17
|
+
*\n\
|
|
18
|
+
* @param {vec3} positionEC The position, in eye coordinates, to measure to.\n\
|
|
19
|
+
*\n\
|
|
20
|
+
* @returns {vec3} The geodetic offset from the camera to <code>positionEC</code>, as (delta longitude, delta latitude in radians, delta height in meters).\n\
|
|
21
|
+
*/\n\
|
|
22
|
+
vec3 czm_eyeToCartographicDelta(vec3 positionEC)\n\
|
|
23
|
+
{\n\
|
|
24
|
+
// A vector representing the camera-to-vertex offset, in an ENU oriented reference frame (centered at the camera)\n\
|
|
25
|
+
vec3 cameraToVertex = czm_eyeToEnu * positionEC;\n\
|
|
26
|
+
\n\
|
|
27
|
+
float cosLatitude = cos(czm_eyeCartographic.y);\n\
|
|
28
|
+
float sinLatitude = sin(czm_eyeCartographic.y);\n\
|
|
29
|
+
\n\
|
|
30
|
+
// To derive longitude, project the camera and vertex onto the equatorial plane, in a frame such that the camera lies along the +x axis. In this frame,\n\
|
|
31
|
+
// the vertex's (delta) longitude is simply the atan of its x and y components.\n\
|
|
32
|
+
float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x;\n\
|
|
33
|
+
vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0);\n\
|
|
34
|
+
vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x);\n\
|
|
35
|
+
float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x);\n\
|
|
36
|
+
\n\
|
|
37
|
+
// Deriving latitude is a bit harder: we can't directly project the vertex onto the camera's meridian — the latitude projection is dependent on the longitude.\n\
|
|
38
|
+
// Instead we can rotate the vertex (by -deltaLongitude) onto the camera's meridional plane. (Note: (unlike the exact longitude case) this is only first-order accurate because the meridian is an ellipse rather than a circle)\n\
|
|
39
|
+
// Using a 2D rotation formula introduces precision issues (subtraction of large-magnitude quantities), so instead we can calculate the vector difference\n\
|
|
40
|
+
// between the vertex and its rotated version, and apply that offset to the cameraToVertex vector. Then, the cameraToVertex vector accurately\n\
|
|
41
|
+
// reflects the difference between the camera and the _rotated_ vertex, so we can then project the camera onto the meridional plane and apply this offset - just as we did for deltaLongitude, above.\n\
|
|
42
|
+
// Best of all, we can do this all with small delta quantities which preserve precision.\n\
|
|
43
|
+
//\n\
|
|
44
|
+
// (I suggest drawing this out -- with the vertex and camera vectors projected onto the equatorial plane, with the camera on the +x axis)\n\
|
|
45
|
+
// Mathematically: if you compare (subtract) vertexEquatorialPos and the same vector rotated onto the camera's meridional plane, you get\n\
|
|
46
|
+
// |dx| = |vertexEquatorialPos| - vertexEquatorialPos.x = (r - x) = r * (1 - cos(deltaLongitude))\n\
|
|
47
|
+
// |dy| = cameraToVertex.x (the east component)\n\
|
|
48
|
+
// (To avoid precision issues, we'll use the identity (1 - cos(x) = 2 * sin^2(x/2)))\n\
|
|
49
|
+
//\n\
|
|
50
|
+
// Since these offsets were produced in the equatorial plane, and cameraToVertex is in the camera's ENU frame, we need to deconstruct along the camera's north and up axes. And we only care about\n\
|
|
51
|
+
// dx, since dy is in the camera's east direction, and that component gets zeroed out when projecting onto the camera's meridional plane.\n\
|
|
52
|
+
float sinHalfLongitude = sin(deltaLongitude * 0.5);\n\
|
|
53
|
+
float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude;\n\
|
|
54
|
+
vec3 meridionalOffset = vec3(\n\
|
|
55
|
+
0.0, // east\n\
|
|
56
|
+
cameraToVertex.y - dx * sinLatitude, // north\n\
|
|
57
|
+
cameraToVertex.z + dx * cosLatitude // up\n\
|
|
58
|
+
);\n\
|
|
59
|
+
\n\
|
|
60
|
+
// Reframe the camera in a meridional plane, where it lies along the +z axis, and apply the meridionalOffset to get the vertex's position in that plane.\n\
|
|
61
|
+
// Then, deltaLatitude is simply the atan of its x and y components.\n\
|
|
62
|
+
float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y;\n\
|
|
63
|
+
vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0);\n\
|
|
64
|
+
vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y);\n\
|
|
65
|
+
float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x);\n\
|
|
66
|
+
\n\
|
|
67
|
+
// Finally, derive the change in height above the ellipsoid. This is the meridional-plane analogue of the dx step above:\n\
|
|
68
|
+
// there we rotated the vertex (in the equatorial plane) to the camera's longitude; here we rotate it (in the meridional plane, by -deltaLatitude)\n\
|
|
69
|
+
// to the camera's latitude, aligning it with the camera's radial (up) direction.\n\
|
|
70
|
+
float sinHalfLatitude = sin(deltaLatitude * 0.5);\n\
|
|
71
|
+
float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude;\n\
|
|
72
|
+
float deltaHeight = meridionalOffset.z + dz;\n\
|
|
73
|
+
\n\
|
|
74
|
+
return vec3(deltaLongitude, deltaLatitude, deltaHeight);\n\
|
|
75
|
+
}\n\
|
|
76
|
+
";
|