@cesium/engine 26.1.0 → 26.2.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 +586 -480
- package/Build/Workers/chunk-27FWRTJI.js +454 -0
- package/Build/Workers/chunk-2H5264K7.js +1284 -0
- package/Build/Workers/chunk-2H73KDBM.js +511 -0
- package/Build/Workers/chunk-2RGJPWQX.js +1284 -0
- package/Build/Workers/chunk-2Z4ZLVOD.js +352 -0
- package/Build/Workers/chunk-2ZKH2QZB.js +387 -0
- package/Build/Workers/chunk-36NI5E6W.js +3820 -0
- package/Build/Workers/chunk-37SW7SYS.js +778 -0
- package/Build/Workers/chunk-3GHVJ3SO.js +455 -0
- package/Build/Workers/chunk-3LB4UVPU.js +387 -0
- package/Build/Workers/chunk-3PONLKEL.js +778 -0
- package/Build/Workers/chunk-3PSS3T43.js +102 -0
- package/Build/Workers/chunk-3QR662HH.js +3820 -0
- package/Build/Workers/chunk-3SX2WYSO.js +973 -0
- package/Build/Workers/chunk-3UDN6LYX.js +476 -0
- package/Build/Workers/chunk-47MCBSXI.js +9237 -0
- package/Build/Workers/chunk-4E626OCE.js +1067 -0
- package/Build/Workers/chunk-4NW2MJKH.js +455 -0
- package/Build/Workers/chunk-52YK5BSN.js +198 -0
- package/Build/Workers/chunk-5RNAQZK6.js +9234 -0
- package/Build/Workers/chunk-5YPQBFRD.js +519 -0
- package/Build/Workers/chunk-6FHT43QR.js +140 -0
- package/Build/Workers/chunk-6FZDPMTO.js +455 -0
- package/Build/Workers/chunk-6R5X2GUA.js +1284 -0
- package/Build/Workers/chunk-7A2OGDHT.js +305 -0
- package/Build/Workers/chunk-7CGEQUM2.js +305 -0
- package/Build/Workers/chunk-7I325HV6.js +1344 -0
- package/Build/Workers/chunk-7MM3N2VE.js +1067 -0
- package/Build/Workers/chunk-7TKLTCZW.js +219 -0
- package/Build/Workers/chunk-7UUKBDH6.js +1054 -0
- package/Build/Workers/chunk-7W6DUHAB.js +693 -0
- package/Build/Workers/chunk-7XM5JK5F.js +162 -0
- package/Build/Workers/chunk-7YG3ND3P.js +454 -0
- package/Build/Workers/chunk-A62YI6S6.js +305 -0
- package/Build/Workers/chunk-A7TTWVTF.js +2719 -0
- package/Build/Workers/chunk-ACTVJHSP.js +519 -0
- package/Build/Workers/chunk-ADX3CBKD.js +9234 -0
- package/Build/Workers/chunk-AF7DTMJ7.js +398 -0
- package/Build/Workers/chunk-AJSFRY4U.js +1344 -0
- package/Build/Workers/chunk-ARZICEEP.js +301 -0
- package/Build/Workers/chunk-B3QHNA4A.js +147 -0
- package/Build/Workers/chunk-BKPQFCXH.js +511 -0
- package/Build/Workers/chunk-BSPCI2LO.js +959 -0
- package/Build/Workers/chunk-BUJWSX5S.js +301 -0
- package/Build/Workers/chunk-C7QDUNI3.js +138 -0
- package/Build/Workers/chunk-CIV5DJOQ.js +778 -0
- package/Build/Workers/chunk-CQNFIAZU.js +56 -0
- package/Build/Workers/chunk-CRCGE4J4.js +9237 -0
- package/Build/Workers/chunk-CUTRKXUQ.js +288 -0
- package/Build/Workers/chunk-D6AY775A.js +3201 -0
- package/Build/Workers/chunk-DSGLDRTI.js +278 -0
- package/Build/Workers/chunk-DZBQUULR.js +138 -0
- package/Build/Workers/chunk-DZUFEE4L.js +140 -0
- package/Build/Workers/chunk-E2NKV5YT.js +3820 -0
- package/Build/Workers/chunk-EB3Y5P3A.js +368 -0
- package/Build/Workers/chunk-ELE6SC2C.js +837 -0
- package/Build/Workers/chunk-EOWDZN5S.js +288 -0
- package/Build/Workers/chunk-ERKUET22.js +3201 -0
- package/Build/Workers/chunk-EZGQPOIG.js +162 -0
- package/Build/Workers/chunk-F2IMBMZY.js +241 -0
- package/Build/Workers/chunk-F4CSNRZO.js +219 -0
- package/Build/Workers/chunk-FBP4DUQJ.js +693 -0
- package/Build/Workers/chunk-FJWZMGOQ.js +1992 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FU4BGABC.js +398 -0
- package/Build/Workers/chunk-FX3VEAIU.js +2719 -0
- package/Build/Workers/chunk-GGNWQWSB.js +301 -0
- package/Build/Workers/chunk-GHXVQVUM.js +1344 -0
- package/Build/Workers/chunk-GNKXEN4C.js +682 -0
- package/Build/Workers/chunk-GVA7XQI2.js +368 -0
- package/Build/Workers/chunk-GXDHRC4J.js +1344 -0
- package/Build/Workers/chunk-GYSYP6PC.js +1067 -0
- package/Build/Workers/chunk-H2WCFXLP.js +241 -0
- package/Build/Workers/chunk-HDL4HOXZ.js +778 -0
- package/Build/Workers/chunk-HLW2ZRVK.js +368 -0
- package/Build/Workers/chunk-HT6FASOT.js +973 -0
- package/Build/Workers/chunk-I74ZH5LK.js +959 -0
- package/Build/Workers/chunk-IDVHUDZT.js +352 -0
- package/Build/Workers/chunk-IJZJMIUY.js +789 -0
- package/Build/Workers/chunk-IMBVP57H.js +44 -0
- package/Build/Workers/chunk-IOO7Z2AV.js +57 -0
- package/Build/Workers/chunk-IUIFLOYO.js +44 -0
- package/Build/Workers/chunk-J73T2VOY.js +171 -0
- package/Build/Workers/chunk-JALGQYDY.js +288 -0
- package/Build/Workers/chunk-JXYLJCTC.js +124 -0
- package/Build/Workers/chunk-K27QOAW6.js +97 -0
- package/Build/Workers/chunk-KMV25A63.js +789 -0
- package/Build/Workers/chunk-KP5QD7WU.js +693 -0
- package/Build/Workers/chunk-KZWFWJML.js +2719 -0
- package/Build/Workers/chunk-LCXRRALY.js +387 -0
- package/Build/Workers/chunk-LDRQSYBN.js +1800 -0
- package/Build/Workers/chunk-M4JZ6TSZ.js +959 -0
- package/Build/Workers/chunk-M6QKXVAU.js +1054 -0
- package/Build/Workers/chunk-MAAHFYPC.js +198 -0
- package/Build/Workers/chunk-MCJDRDJQ.js +102 -0
- package/Build/Workers/chunk-MEENMEAH.js +198 -0
- package/Build/Workers/chunk-NAWU5RF4.js +162 -0
- package/Build/Workers/chunk-NCL22ZUX.js +56 -0
- package/Build/Workers/chunk-NEFDMMLY.js +241 -0
- package/Build/Workers/chunk-NJVBJG63.js +124 -0
- package/Build/Workers/chunk-NLLCQBX3.js +73 -0
- package/Build/Workers/chunk-NSKZ6SBK.js +1483 -0
- package/Build/Workers/chunk-NXGQBQWE.js +837 -0
- package/Build/Workers/chunk-O3DKEX7Q.js +352 -0
- package/Build/Workers/chunk-O3XFXGPZ.js +476 -0
- package/Build/Workers/chunk-OA6MYL2C.js +837 -0
- package/Build/Workers/chunk-OHP4ELS7.js +198 -0
- package/Build/Workers/chunk-OZGPS7FB.js +138 -0
- package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
- package/Build/Workers/chunk-PD4GK4EM.js +57 -0
- package/Build/Workers/chunk-PEDU33QG.js +2342 -0
- package/Build/Workers/chunk-PRWUMCXF.js +682 -0
- package/Build/Workers/chunk-PVTSNNVI.js +288 -0
- package/Build/Workers/chunk-QFSSCLLZ.js +973 -0
- package/Build/Workers/chunk-QHPZH22L.js +241 -0
- package/Build/Workers/chunk-QIZDWZK6.js +301 -0
- package/Build/Workers/chunk-QV6DG2YX.js +1483 -0
- package/Build/Workers/chunk-R4K7EHOU.js +171 -0
- package/Build/Workers/chunk-R7JGHDD6.js +789 -0
- package/Build/Workers/chunk-RASQEYD4.js +1483 -0
- package/Build/Workers/chunk-RW6ITX7Q.js +3820 -0
- package/Build/Workers/chunk-RYSQVJR6.js +398 -0
- package/Build/Workers/chunk-S6RJU5NM.js +1054 -0
- package/Build/Workers/chunk-SA2A2AN5.js +2342 -0
- package/Build/Workers/chunk-SDFHDNS4.js +147 -0
- package/Build/Workers/chunk-SJYSIOEM.js +414 -0
- package/Build/Workers/chunk-SMTGMFBL.js +97 -0
- package/Build/Workers/chunk-SXSP3JHS.js +38 -0
- package/Build/Workers/chunk-TN35HP5B.js +1067 -0
- package/Build/Workers/chunk-TNWKJNUZ.js +454 -0
- package/Build/Workers/chunk-TOAF47AQ.js +102 -0
- package/Build/Workers/chunk-TQ4QCOXT.js +2719 -0
- package/Build/Workers/chunk-TSDSILQB.js +124 -0
- package/Build/Workers/chunk-U5LV3F3Z.js +1054 -0
- package/Build/Workers/chunk-UAZUP4I5.js +1992 -0
- package/Build/Workers/chunk-UF46SZEZ.js +789 -0
- package/Build/Workers/chunk-UNRTMCET.js +398 -0
- package/Build/Workers/chunk-UTB7U3O6.js +1992 -0
- package/Build/Workers/chunk-V46YGZE6.js +352 -0
- package/Build/Workers/chunk-VDGOCROW.js +57 -0
- package/Build/Workers/chunk-VFWSSBPT.js +511 -0
- package/Build/Workers/chunk-VVYMXI3I.js +1284 -0
- package/Build/Workers/chunk-VXWHPYQM.js +837 -0
- package/Build/Workers/chunk-VXYUBRSB.js +219 -0
- package/Build/Workers/chunk-VZLDLEWI.js +387 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-WN3F4CVG.js +3201 -0
- package/Build/Workers/chunk-WPRUWXGV.js +693 -0
- package/Build/Workers/chunk-WTO2ERBP.js +414 -0
- package/Build/Workers/chunk-WVHMDVG4.js +959 -0
- package/Build/Workers/chunk-XCBZVTIV.js +280 -0
- package/Build/Workers/chunk-XGA23TAX.js +73 -0
- package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
- package/Build/Workers/chunk-XQH66YJC.js +147 -0
- package/Build/Workers/chunk-XTA7BXJG.js +682 -0
- package/Build/Workers/chunk-XTIDAFRS.js +476 -0
- package/Build/Workers/chunk-XUEDWBUD.js +682 -0
- package/Build/Workers/chunk-XYFLRH3H.js +124 -0
- package/Build/Workers/chunk-Y7JRTRTO.js +305 -0
- package/Build/Workers/chunk-Y7QSMDCJ.js +352 -0
- package/Build/Workers/chunk-YCB5TYTR.js +1483 -0
- package/Build/Workers/chunk-YEYOSTJX.js +219 -0
- package/Build/Workers/chunk-YGFVAGYF.js +630 -0
- package/Build/Workers/chunk-YIIACKQO.js +368 -0
- package/Build/Workers/chunk-YJGSP6PE.js +511 -0
- package/Build/Workers/chunk-Z4LR5EHE.js +454 -0
- package/Build/Workers/chunk-Z66EVE2A.js +44 -0
- package/Build/Workers/chunk-ZHIHHHTB.js +414 -0
- package/Build/Workers/chunk-ZNWHFSLE.js +171 -0
- package/Build/Workers/chunk-ZQLZG4IN.js +2342 -0
- package/Build/Workers/chunk-ZRTSMUZ2.js +414 -0
- package/Build/Workers/chunk-ZZUVT5BM.js +476 -0
- package/Build/Workers/combineGeometry.js +16 -16
- package/Build/Workers/createBoxGeometry.js +10 -10
- package/Build/Workers/createBoxOutlineGeometry.js +8 -8
- package/Build/Workers/createCircleGeometry.js +18 -18
- package/Build/Workers/createCircleOutlineGeometry.js +11 -11
- package/Build/Workers/createCoplanarPolygonGeometry.js +27 -27
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +23 -23
- package/Build/Workers/createCorridorGeometry.js +23 -25
- package/Build/Workers/createCorridorOutlineGeometry.js +21 -23
- package/Build/Workers/createCylinderGeometry.js +12 -12
- package/Build/Workers/createCylinderOutlineGeometry.js +10 -10
- package/Build/Workers/createEllipseGeometry.js +18 -18
- package/Build/Workers/createEllipseOutlineGeometry.js +11 -11
- package/Build/Workers/createEllipsoidGeometry.js +11 -11
- package/Build/Workers/createEllipsoidOutlineGeometry.js +10 -10
- package/Build/Workers/createFrustumGeometry.js +11 -11
- package/Build/Workers/createFrustumOutlineGeometry.js +11 -11
- package/Build/Workers/createGeometry.js +16 -16
- package/Build/Workers/createGroundPolylineGeometry.js +16 -16
- package/Build/Workers/createPlaneGeometry.js +9 -9
- package/Build/Workers/createPlaneOutlineGeometry.js +8 -8
- package/Build/Workers/createPolygonGeometry.js +25 -25
- package/Build/Workers/createPolygonOutlineGeometry.js +22 -22
- package/Build/Workers/createPolylineGeometry.js +18 -18
- package/Build/Workers/createPolylineVolumeGeometry.js +24 -24
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +20 -20
- package/Build/Workers/createRectangleGeometry.js +19 -19
- package/Build/Workers/createRectangleOutlineGeometry.js +13 -13
- package/Build/Workers/createSimplePolylineGeometry.js +16 -16
- package/Build/Workers/createSphereGeometry.js +11 -11
- package/Build/Workers/createSphereOutlineGeometry.js +10 -10
- package/Build/Workers/createVectorTileClampedPolylines.js +7 -7
- package/Build/Workers/createVectorTileGeometries.js +15 -15
- package/Build/Workers/createVectorTilePoints.js +6 -6
- package/Build/Workers/createVectorTilePolygons.js +14 -14
- package/Build/Workers/createVectorTilePolylines.js +7 -7
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +17 -17
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +14 -14
- package/Build/Workers/createVerticesFromHeightmap.js +14 -14
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +12 -12
- package/Build/Workers/createWallGeometry.js +17 -17
- package/Build/Workers/createWallOutlineGeometry.js +17 -17
- package/Build/Workers/decodeDraco.js +2 -2
- package/Build/Workers/decodeI3S.js +5 -5
- package/Build/Workers/incrementallyBuildTerrainPicker.js +4 -4
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +14 -14
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +17 -17
- 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/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/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 +1117 -0
- package/Source/Core/VectorProvider.js +429 -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 +23 -0
- 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/Texture.js +11 -0
- package/Source/Renderer/UniformState.js +7 -0
- 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/BufferPrimitiveCollection.js +27 -5
- package/Source/Scene/Camera.js +71 -5
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- 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/DerivedCommand.js +94 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/Globe.js +20 -0
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +12 -2
- package/Source/Scene/GlobeSurfaceTile.js +48 -10
- package/Source/Scene/GlobeSurfaceTileProvider.js +121 -3
- package/Source/Scene/GltfLoader.js +32 -3
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- 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 +2 -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 +8 -10
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelDrawCommand.js +160 -16
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelSceneGraph.js +21 -0
- package/Source/Scene/Model/PickingPipelineStage.js +29 -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 +4 -2
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +16 -13
- package/Source/Scene/Scene.js +202 -5
- 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 +184 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +1 -1
- package/Source/Scene/Vector3DTileContent.js +2 -3
- package/Source/Scene/VectorGltf3DTileContent.js +23 -3
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelTraversal.js +1 -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 +1 -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 +2 -0
- package/Source/Shaders/GlobeFS.glsl +10 -5
- package/Source/Shaders/GlobeFS.js +9 -5
- 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/ModelFS.glsl +105 -0
- package/Source/Shaders/Model/ModelFS.js +105 -0
- package/Source/Shaders/VectorCommon.glsl +178 -0
- package/Source/Shaders/VectorCommon.js +75 -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 +770 -10
- package/index.js +177 -160
- package/package.json +1 -1
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import Cartesian2 from "../../Core/Cartesian2.js";
|
|
2
|
+
import Cartesian3 from "../../Core/Cartesian3.js";
|
|
3
|
+
import defined from "../../Core/defined.js";
|
|
4
|
+
import Frozen from "../../Core/Frozen.js";
|
|
5
|
+
import getTimestamp from "../../Core/getTimestamp.js";
|
|
6
|
+
import CesiumMath from "../../Core/Math.js";
|
|
7
|
+
import ScreenSpaceEventHandler from "../../Core/ScreenSpaceEventHandler.js";
|
|
8
|
+
import ScreenSpaceEventType from "../../Core/ScreenSpaceEventType.js";
|
|
9
|
+
import defaultPickWorldPosition from "./defaultPickWorldPosition.js";
|
|
10
|
+
import ScreenSpaceInputBindings from "./ScreenSpaceInputBindings.js";
|
|
11
|
+
import TimeConstants from "../../Core/TimeConstants.js";
|
|
12
|
+
import MouseButton from "./MouseButton.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {object} ControllerOptions
|
|
16
|
+
* @memberof ScreenSpaceZoomCameraController
|
|
17
|
+
* @property {ScreenSpaceInputBindings.InputBinding[]} [dragInputs] The drag input bindings that control zooming.
|
|
18
|
+
* @property {ScreenSpaceEventType[]} [scrollInputs] The scroll input bindings that control zooming.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A camera controller that allows zooming the camera in and out based on the pointer location in screen space.
|
|
23
|
+
* @class
|
|
24
|
+
* @implements Controller
|
|
25
|
+
* @example
|
|
26
|
+
* viewer.scene.screenSpaceCameraController.enableInputs = false;
|
|
27
|
+
* viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
|
|
28
|
+
*
|
|
29
|
+
* const zoomCameraController = new Cesium.ScreenSpaceZoomCameraController();
|
|
30
|
+
* viewer.addController(zoomCameraController);
|
|
31
|
+
*/
|
|
32
|
+
class ScreenSpaceZoomCameraController {
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
* @returns {ScreenSpaceInputBindings.InputBinding[]} The default drag input bindings.
|
|
36
|
+
*/
|
|
37
|
+
static _getDefaultDragInputs() {
|
|
38
|
+
return [
|
|
39
|
+
Object.freeze({
|
|
40
|
+
button: MouseButton.MIDDLE,
|
|
41
|
+
}),
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
* @returns {ScreenSpaceEventType[]} The default scroll input bindings.
|
|
48
|
+
*/
|
|
49
|
+
static _getDefaultScrollInputs() {
|
|
50
|
+
return [ScreenSpaceEventType.WHEEL];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new instance of <code>ScreenSpaceZoomCameraController</code>.
|
|
55
|
+
* @param {ScreenSpaceZoomCameraController.ControllerOptions} [options] The options for configuring the controller.
|
|
56
|
+
*/
|
|
57
|
+
constructor(options = Frozen.EMPTY_OBJECT) {
|
|
58
|
+
this._enabled = true;
|
|
59
|
+
this._handler = undefined;
|
|
60
|
+
this._lastUpdateTime = undefined;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* If false, the camera will zoom to the position at the center of the screen. If true, the camera will zoom to the position under the cursor or tap when dragging starts or when scrolling with the scroll wheel.
|
|
64
|
+
* @type {boolean}
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
this.usePointerPosition = false;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The drag input bindings that control zooming. Each binding is a combination of the mouse button
|
|
71
|
+
* and an optional keyboard modifier.
|
|
72
|
+
* @type {ScreenSpaceInputBindings.InputBinding[]}
|
|
73
|
+
* @see ScreenSpaceEventHandler
|
|
74
|
+
*/
|
|
75
|
+
this.dragInputs =
|
|
76
|
+
options.dragInputs ??
|
|
77
|
+
ScreenSpaceZoomCameraController._getDefaultDragInputs();
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The scroll input bindings that control zooming.
|
|
81
|
+
* @type {ScreenSpaceEventType[]}
|
|
82
|
+
* @see ScreenSpaceEventHandler
|
|
83
|
+
* @default [ScreenSpaceEventType.WHEEL]
|
|
84
|
+
*/
|
|
85
|
+
this.scrollInputs =
|
|
86
|
+
options.scrollInputs ??
|
|
87
|
+
ScreenSpaceZoomCameraController._getDefaultScrollInputs();
|
|
88
|
+
|
|
89
|
+
this._dragInputState = undefined;
|
|
90
|
+
this._dragDelta = new Cartesian2();
|
|
91
|
+
this._scrollDelta = 0.0;
|
|
92
|
+
this._zoomInputVelocity = 0.0;
|
|
93
|
+
this._screenSpaceScrollPosition = new Cartesian2();
|
|
94
|
+
this._screenSpaceDragPosition = new Cartesian2();
|
|
95
|
+
this._screenSpaceOrigin = new Cartesian2();
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The rate at which the camera zooms in and out based on the mouse wheel delta.
|
|
99
|
+
* @type {number}
|
|
100
|
+
* @default 0.2
|
|
101
|
+
*/
|
|
102
|
+
this.zoomSensitivity = 0.2;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A callback function used to pick the world position from which to zoom. The function is called with {@link Scene}, the {@link Cartesian2} screen space position, and a {@link Cartesian3} instance to store the result. The function should return the {@link Cartesian3} world position from which to zoom, or <code>undefined</code> if no position could be picked.
|
|
106
|
+
* @type {Function(Scene, Cartesian2, Cartesian3): Cartesian3|undefined}
|
|
107
|
+
* @default defaultPickWorldPosition
|
|
108
|
+
* @example
|
|
109
|
+
* const zoomCameraController = new Cesium.ScreenSpaceZoomCameraController();
|
|
110
|
+
* zoomCameraController.pickWorldPosition = function (scene, windowPosition, result) {
|
|
111
|
+
* // Pick the world position from the depth buffer
|
|
112
|
+
* return scene.pickPosition(windowPosition, result);
|
|
113
|
+
* };
|
|
114
|
+
* viewer.addController(zoomCameraController);
|
|
115
|
+
*/
|
|
116
|
+
this.pickWorldPosition = defaultPickWorldPosition;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The ratio of the camera's distance to the zoom target that defines how much the camera zooms in and out per second.
|
|
120
|
+
* @type {number}
|
|
121
|
+
* @default 0.4
|
|
122
|
+
*/
|
|
123
|
+
this.zoomDistanceRatio = 0.4;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Enable or disable inertia when zooming. When enabled, the camera will continue to move after the user input stops, gradually slowing down based on {@link ScreenSpaceZoomCameraController#inertialDecay}.
|
|
127
|
+
* @type {boolean}
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
this.inertiaEnabled = false;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The rate at which the camera's zoom velocity decays over time.
|
|
134
|
+
* @type {number}
|
|
135
|
+
* @default 6.0
|
|
136
|
+
*/
|
|
137
|
+
this.inertialDecay = 6.0;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @private
|
|
141
|
+
* @type number
|
|
142
|
+
* @default 0.0
|
|
143
|
+
*/
|
|
144
|
+
this.minimumZoomDistance = 0.0;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Maximum distance from the zoom target that the camera can move away.
|
|
148
|
+
* @type {number}
|
|
149
|
+
* @default 100000.0
|
|
150
|
+
*/
|
|
151
|
+
this.maximumZoomDistance = 100000.0;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @private
|
|
155
|
+
* @type {number}
|
|
156
|
+
* @default CesiumMath.EPSILON20
|
|
157
|
+
*/
|
|
158
|
+
this.minimumZoomVelocity = CesiumMath.EPSILON20;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The maximum zoom velocity in meters per second. This limits the speed at which the camera can zoom in and out.
|
|
162
|
+
* @type {number}
|
|
163
|
+
* @default 1.0
|
|
164
|
+
*/
|
|
165
|
+
this.maximumZoomVelocity = 1.0;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Enables or disables damping for zooming. Damping smooths out the camera movement and makes it feel more natural or weighty, but it can also introduce a slight delay in the camera response. If damping is disabled, the camera will respond immediately to user input.
|
|
169
|
+
* @type {boolean}
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
172
|
+
this.dampingEnabled = true;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Specifies the length of time in seconds in which a single zoom animation is targeted to complete.
|
|
176
|
+
* @type {number}
|
|
177
|
+
* @default 0.45
|
|
178
|
+
*/
|
|
179
|
+
this.zoomAnimationDuration = 0.45;
|
|
180
|
+
|
|
181
|
+
this._target = new Cartesian3();
|
|
182
|
+
this._zoomDirection = new Cartesian3();
|
|
183
|
+
this._zoomDampenedResults = {
|
|
184
|
+
velocity: 0.0,
|
|
185
|
+
value: 0.0,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @inheritdoc
|
|
191
|
+
*/
|
|
192
|
+
get enabled() {
|
|
193
|
+
return this._enabled;
|
|
194
|
+
}
|
|
195
|
+
set enabled(value) {
|
|
196
|
+
this._enabled = value;
|
|
197
|
+
|
|
198
|
+
if (value) {
|
|
199
|
+
this._lastUpdateTime = getTimestamp();
|
|
200
|
+
this._scrollDelta = 0.0;
|
|
201
|
+
this._dragDelta.x = 0.0;
|
|
202
|
+
this._dragDelta.y = 0.0;
|
|
203
|
+
} else if (defined(this._dragInputState)) {
|
|
204
|
+
this._dragInputState.isDragging = false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @private
|
|
210
|
+
* @type {boolean}
|
|
211
|
+
*/
|
|
212
|
+
get isDragging() {
|
|
213
|
+
return defined(this._dragInputState) && this._dragInputState.isDragging;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @inheritdoc
|
|
218
|
+
* @param {HTMLElement} element The DOM element containing the Cesium scene.
|
|
219
|
+
*/
|
|
220
|
+
connectedCallback(element) {
|
|
221
|
+
const handler = new ScreenSpaceEventHandler(element);
|
|
222
|
+
this._handler = handler;
|
|
223
|
+
|
|
224
|
+
for (const input of this.scrollInputs) {
|
|
225
|
+
handler.setInputAction(this._handleZoom.bind(this), input);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
handler.setInputAction(
|
|
229
|
+
this._handleZoomPosition.bind(this),
|
|
230
|
+
ScreenSpaceEventType.MOUSE_MOVE,
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
this._dragInputState = ScreenSpaceInputBindings.registerDragInputBindings(
|
|
234
|
+
handler,
|
|
235
|
+
this.dragInputs,
|
|
236
|
+
{
|
|
237
|
+
start: this._handleStartDrag.bind(this),
|
|
238
|
+
change: this._handleDrag.bind(this),
|
|
239
|
+
},
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @inheritdoc
|
|
245
|
+
* @param {HTMLElement} element The DOM element containing the Cesium scene.
|
|
246
|
+
*/
|
|
247
|
+
disconnectedCallback(element) {
|
|
248
|
+
const handler = this._handler;
|
|
249
|
+
if (defined(handler) && !handler.isDestroyed()) {
|
|
250
|
+
handler.destroy();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @inheritdoc
|
|
256
|
+
*/
|
|
257
|
+
firstUpdate() {
|
|
258
|
+
this._lastUpdateTime = getTimestamp();
|
|
259
|
+
this._scrollDelta = 0.0;
|
|
260
|
+
this._dragDelta.x = 0.0;
|
|
261
|
+
this._dragDelta.y = 0.0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The current zoom distance of the camera in meters. This is the distance from the camera to the zoom target.
|
|
266
|
+
* @type {number}
|
|
267
|
+
* @private
|
|
268
|
+
*/
|
|
269
|
+
get zoomDistance() {
|
|
270
|
+
return this._zoomDampenedResults.value;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The current zoom velocity of the camera in radians per second.
|
|
275
|
+
* @type {number}
|
|
276
|
+
* @private
|
|
277
|
+
*/
|
|
278
|
+
get zoomVelocity() {
|
|
279
|
+
return this._zoomDampenedResults.velocity;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The current zoom velocity of the camera in radians per second.
|
|
284
|
+
* @type {number}
|
|
285
|
+
* @private
|
|
286
|
+
*/
|
|
287
|
+
set zoomVelocity(value) {
|
|
288
|
+
this._zoomDampenedResults.velocity = value;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @inheritdoc
|
|
293
|
+
* @param {Scene} scene
|
|
294
|
+
*/
|
|
295
|
+
update(scene) {
|
|
296
|
+
const now = getTimestamp();
|
|
297
|
+
const dt =
|
|
298
|
+
(now - this._lastUpdateTime) * TimeConstants.SECONDS_PER_MILLISECOND;
|
|
299
|
+
|
|
300
|
+
const { canvas } = scene;
|
|
301
|
+
const { clientWidth, clientHeight } = canvas;
|
|
302
|
+
if (dt === 0 || clientWidth === 0 || clientHeight === 0) {
|
|
303
|
+
this._lastUpdateTime = getTimestamp();
|
|
304
|
+
this._scrollDelta = 0.0;
|
|
305
|
+
this._dragDelta.x = 0;
|
|
306
|
+
this._dragDelta.y = 0;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
let dz = this._scrollDelta + this._dragDelta.y;
|
|
311
|
+
if (dz === 0.0 && this.inertiaEnabled) {
|
|
312
|
+
const damping = Math.exp(-this.inertialDecay * dt);
|
|
313
|
+
this._zoomInputVelocity *= damping;
|
|
314
|
+
dz = this._zoomInputVelocity * dt;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (
|
|
318
|
+
Math.abs(this.zoomVelocity) < this.minimumZoomVelocity &&
|
|
319
|
+
dz <= CesiumMath.EPSILON3 &&
|
|
320
|
+
dz >= -CesiumMath.EPSILON3 &&
|
|
321
|
+
this.zoomVelocity <= CesiumMath.EPSILON3
|
|
322
|
+
) {
|
|
323
|
+
this._lastUpdateTime = getTimestamp();
|
|
324
|
+
this._scrollDelta = 0.0;
|
|
325
|
+
this._dragDelta.x = 0;
|
|
326
|
+
this._dragDelta.y = 0;
|
|
327
|
+
this.zoomVelocity = 0.0;
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
this._zoomInputVelocity = CesiumMath.clamp(
|
|
332
|
+
dz / dt,
|
|
333
|
+
-this.maximumZoomVelocity,
|
|
334
|
+
this.maximumZoomVelocity,
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
const { camera, ellipsoid } = scene;
|
|
338
|
+
|
|
339
|
+
let direction = camera.direction;
|
|
340
|
+
let distance =
|
|
341
|
+
Cartesian3.magnitude(camera.positionWC) - ellipsoid.maximumRadius;
|
|
342
|
+
|
|
343
|
+
let windowPosition = this.isDragging
|
|
344
|
+
? this._screenSpaceDragPosition
|
|
345
|
+
: this._screenSpaceScrollPosition;
|
|
346
|
+
if (!this.useDragPosition) {
|
|
347
|
+
windowPosition = this._screenSpaceOrigin;
|
|
348
|
+
windowPosition.x = clientWidth / 2.0;
|
|
349
|
+
windowPosition.y = clientHeight / 2.0;
|
|
350
|
+
}
|
|
351
|
+
const target = this.pickWorldPosition(scene, windowPosition, this._target);
|
|
352
|
+
if (defined(target)) {
|
|
353
|
+
direction = Cartesian3.subtract(
|
|
354
|
+
target,
|
|
355
|
+
camera.positionWC,
|
|
356
|
+
this._zoomDirection,
|
|
357
|
+
);
|
|
358
|
+
direction = Cartesian3.normalize(direction, this._zoomDirection);
|
|
359
|
+
distance = Cartesian3.distance(target, camera.positionWC);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
distance = CesiumMath.clamp(
|
|
363
|
+
distance,
|
|
364
|
+
distance > 0.0 ? this.minimumZoomDistance : -this.maximumZoomDistance,
|
|
365
|
+
distance > 0.0 ? this.maximumZoomDistance : -this.minimumZoomDistance,
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
const zoom = dz * distance * this.zoomDistanceRatio;
|
|
369
|
+
|
|
370
|
+
const smoothTime = this.dampingEnabled
|
|
371
|
+
? this.zoomAnimationDuration
|
|
372
|
+
: undefined;
|
|
373
|
+
this._zoomDampenedResults = CesiumMath.smoothDamp(
|
|
374
|
+
0.0,
|
|
375
|
+
zoom,
|
|
376
|
+
this.zoomVelocity,
|
|
377
|
+
dt,
|
|
378
|
+
undefined,
|
|
379
|
+
smoothTime,
|
|
380
|
+
this._zoomDampenedResults,
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
camera.move(direction, this.zoomDistance);
|
|
384
|
+
|
|
385
|
+
// Reset for next frame
|
|
386
|
+
this._lastUpdateTime = getTimestamp();
|
|
387
|
+
this._scrollDelta = 0.0;
|
|
388
|
+
this._dragDelta.x = 0;
|
|
389
|
+
this._dragDelta.y = 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* @private
|
|
394
|
+
* @param {number} amount
|
|
395
|
+
*/
|
|
396
|
+
_handleZoom(amount) {
|
|
397
|
+
this._scrollDelta += amount * this.zoomSensitivity;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* @private
|
|
402
|
+
*/
|
|
403
|
+
_handleZoomPosition(event) {
|
|
404
|
+
this._screenSpaceScrollPosition.x = event.endPosition.x;
|
|
405
|
+
this._screenSpaceScrollPosition.y = event.endPosition.y;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @private
|
|
410
|
+
*/
|
|
411
|
+
_handleStartDrag(event) {
|
|
412
|
+
if (!this.enabled) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
this._screenSpaceDragPosition.x = event.position.x;
|
|
417
|
+
this._screenSpaceDragPosition.y = event.position.y;
|
|
418
|
+
this._dragDelta.x = 0.0;
|
|
419
|
+
this._dragDelta.y = 0.0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @private
|
|
424
|
+
*/
|
|
425
|
+
_handleDrag(event) {
|
|
426
|
+
this._dragDelta.x += event.endPosition.x - event.startPosition.x;
|
|
427
|
+
this._dragDelta.y += event.endPosition.y - event.startPosition.y;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export default ScreenSpaceZoomCameraController;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Cartesian3 from "../../Core/Cartesian3.js";
|
|
2
|
+
import Cartesian2 from "../../Core/Cartesian2.js";
|
|
3
|
+
import Check from "../../Core/Check.js";
|
|
4
|
+
import defined from "../../Core/defined.js";
|
|
5
|
+
import IntersectionTests from "../../Core/IntersectionTests.js";
|
|
6
|
+
import Plane from "../../Core/Plane.js";
|
|
7
|
+
import Ray from "../../Core/Ray.js";
|
|
8
|
+
|
|
9
|
+
const scratchSurfaceCartesian = new Cartesian3();
|
|
10
|
+
const scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);
|
|
11
|
+
const scratchRay = new Ray();
|
|
12
|
+
const defaultTargetPixelSize = new Cartesian2(1.0, 1.0, 1.0);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Picks a cartesian worldspace position based on the specified window coordinates and the camera's current position and orientation.
|
|
16
|
+
* <ol>
|
|
17
|
+
* <li>If the camera is above the scene's defined ellipsoid, the position is picked on the ellipsoid.</li>
|
|
18
|
+
* <li> If the camera is below the ellipsoid, a temporary plane is created relative to the camera's position and orientation, and the position is picked on that plane.</li>
|
|
19
|
+
* </ol>
|
|
20
|
+
* @param {Scene} scene The scene to pick the world position from.
|
|
21
|
+
* @param {Cartesian2} windowPosition The x and y coordinates of a pixel.
|
|
22
|
+
* @param {Cartesian3} result The object onto which to store the result.
|
|
23
|
+
* @param {Cartesian2} targetPixelSize The pixel size at the target position, used to preserve relative camera distance from the target position when navigating.
|
|
24
|
+
* @returns {Cartesian3|undefined} The picked cartesian worldspace position, or <code>undefined</code> if no position could be picked.
|
|
25
|
+
* @see {@link ScreenSpaceMapCameraController#pickWorldPosition}
|
|
26
|
+
* @see {@link ScreenSpaceElevatorCameraController#pickWorldPosition}
|
|
27
|
+
* @see {@link ScreenSpaceTiltOrbitCameraController#pickWorldPosition}
|
|
28
|
+
* @see {@link ScreenSpaceZoomCameraController#pickWorldPosition}
|
|
29
|
+
*/
|
|
30
|
+
export default function (
|
|
31
|
+
scene,
|
|
32
|
+
windowPosition,
|
|
33
|
+
result,
|
|
34
|
+
targetPixelSize = defaultTargetPixelSize,
|
|
35
|
+
) {
|
|
36
|
+
//>>includeStart('debug', pragmas.debug);
|
|
37
|
+
Check.typeOf.object("scene", scene);
|
|
38
|
+
Check.typeOf.object("windowPosition", windowPosition);
|
|
39
|
+
Check.typeOf.object("result", result);
|
|
40
|
+
//>>includeEnd('debug');
|
|
41
|
+
|
|
42
|
+
const { camera, ellipsoid } = scene;
|
|
43
|
+
const surface = ellipsoid.scaleToGeodeticSurface(
|
|
44
|
+
camera.positionWC,
|
|
45
|
+
scratchSurfaceCartesian,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Camera is at the origin
|
|
49
|
+
if (!defined(surface)) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const cameraMagnitude = Cartesian3.magnitude(camera.positionWC);
|
|
54
|
+
const surfaceMagnitude = Cartesian3.magnitude(surface);
|
|
55
|
+
const belowEllipsoid = cameraMagnitude <= surfaceMagnitude;
|
|
56
|
+
|
|
57
|
+
const normal = ellipsoid.geodeticSurfaceNormal(
|
|
58
|
+
camera.positionWC,
|
|
59
|
+
scratchSurfaceCartesian,
|
|
60
|
+
);
|
|
61
|
+
const dot = Cartesian3.dot(normal, camera.directionWC);
|
|
62
|
+
const lookingUp = dot > 0.0;
|
|
63
|
+
|
|
64
|
+
if (belowEllipsoid || lookingUp) {
|
|
65
|
+
// Camera is inside the ellipsoid. When underground, create a temporary plane beneath the ellipsoid surface to avoid picking a position on the inside and opposite side of the ellipsoid.
|
|
66
|
+
|
|
67
|
+
const plane = Plane.fromPointNormal(
|
|
68
|
+
camera.positionWC,
|
|
69
|
+
normal,
|
|
70
|
+
scratchPlane,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const { clientHeight } = scene.canvas;
|
|
74
|
+
const focusDistance =
|
|
75
|
+
(targetPixelSize.y * clientHeight) /
|
|
76
|
+
(2.0 * Math.tan(camera.frustum.fovy * 0.5));
|
|
77
|
+
|
|
78
|
+
plane.distance -= dot * focusDistance;
|
|
79
|
+
const ray = camera.getPickRay(windowPosition, scratchRay);
|
|
80
|
+
return IntersectionTests.rayPlane(ray, plane, result);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return camera.pickEllipsoid(windowPosition, ellipsoid, result);
|
|
84
|
+
}
|
|
@@ -346,6 +346,100 @@ DerivedCommand.createPickDerivedCommand = function (
|
|
|
346
346
|
return result;
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
+
// Repacks an RGBA8-normalized pick color into the uint32 pick ID so it can be
|
|
350
|
+
// carried losslessly in the R channel of the RGBA32F snap framebuffer.
|
|
351
|
+
// Injected only into snap-derived shaders; referenced by DrawCommand.snapId
|
|
352
|
+
// expressions built in PickingPipelineStage.
|
|
353
|
+
const snapHelperSource = `uint rgba8UnormToUint32(vec4 c)
|
|
354
|
+
{
|
|
355
|
+
uvec4 b = uvec4(c * 255.0 + 0.5);
|
|
356
|
+
return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u);
|
|
357
|
+
}
|
|
358
|
+
`;
|
|
359
|
+
|
|
360
|
+
function getSnapShaderProgram(context, shaderProgram, snapId) {
|
|
361
|
+
const cachedShader = context.shaderCache.getDerivedShaderProgram(
|
|
362
|
+
shaderProgram,
|
|
363
|
+
"snap",
|
|
364
|
+
);
|
|
365
|
+
if (defined(cachedShader)) {
|
|
366
|
+
return cachedShader;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const attributeLocations = shaderProgram._attributeLocations;
|
|
370
|
+
const { sources, defines } = shaderProgram.fragmentShaderSource;
|
|
371
|
+
|
|
372
|
+
const hasFragData = sources.some((source) => source.includes("out_FragData"));
|
|
373
|
+
const outputColorVariable = hasFragData ? "out_FragData_0" : "out_FragColor";
|
|
374
|
+
const newMain = `${snapHelperSource}
|
|
375
|
+
void main ()
|
|
376
|
+
{
|
|
377
|
+
czm_non_snap_main();
|
|
378
|
+
if (${outputColorVariable}.a == 0.0) {
|
|
379
|
+
discard;
|
|
380
|
+
}
|
|
381
|
+
${outputColorVariable} = ${snapId};
|
|
382
|
+
} `;
|
|
383
|
+
|
|
384
|
+
const length = sources.length;
|
|
385
|
+
const newSources = new Array(length + 1);
|
|
386
|
+
for (let i = 0; i < length; ++i) {
|
|
387
|
+
newSources[i] = ShaderSource.replaceMain(sources[i], "czm_non_snap_main");
|
|
388
|
+
}
|
|
389
|
+
newSources[length] = newMain;
|
|
390
|
+
const fragmentShaderSource = new ShaderSource({
|
|
391
|
+
sources: newSources,
|
|
392
|
+
defines: defines,
|
|
393
|
+
});
|
|
394
|
+
return context.shaderCache.createDerivedShaderProgram(shaderProgram, "snap", {
|
|
395
|
+
vertexShaderSource: shaderProgram.vertexShaderSource,
|
|
396
|
+
fragmentShaderSource: fragmentShaderSource,
|
|
397
|
+
attributeLocations: attributeLocations,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Derives the command used during a snapping pass (see Scene#snap). Identical
|
|
403
|
+
* in structure to the pick derived command, but the fragment shader writes the
|
|
404
|
+
* float snap payload (DrawCommand.snapId) into the RGBA32F snap framebuffer
|
|
405
|
+
* instead of the RGBA8 pick color.
|
|
406
|
+
*
|
|
407
|
+
* @private
|
|
408
|
+
*/
|
|
409
|
+
DerivedCommand.createSnapDerivedCommand = function (
|
|
410
|
+
scene,
|
|
411
|
+
command,
|
|
412
|
+
context,
|
|
413
|
+
result,
|
|
414
|
+
) {
|
|
415
|
+
if (!defined(result)) {
|
|
416
|
+
result = {};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const shader = result.snapCommand?.shaderProgram;
|
|
420
|
+
const renderState = result.snapCommand?.renderState;
|
|
421
|
+
|
|
422
|
+
result.snapCommand = DrawCommand.shallowClone(command, result.snapCommand);
|
|
423
|
+
|
|
424
|
+
if (!defined(shader) || result.shaderProgramId !== command.shaderProgram.id) {
|
|
425
|
+
result.snapCommand.shaderProgram = getSnapShaderProgram(
|
|
426
|
+
context,
|
|
427
|
+
command.shaderProgram,
|
|
428
|
+
command.snapId,
|
|
429
|
+
);
|
|
430
|
+
result.snapCommand.renderState = getPickRenderState(
|
|
431
|
+
scene,
|
|
432
|
+
command.renderState,
|
|
433
|
+
);
|
|
434
|
+
result.shaderProgramId = command.shaderProgram.id;
|
|
435
|
+
} else {
|
|
436
|
+
result.snapCommand.shaderProgram = shader;
|
|
437
|
+
result.snapCommand.renderState = renderState;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return result;
|
|
441
|
+
};
|
|
442
|
+
|
|
349
443
|
/**
|
|
350
444
|
* Replaces the value of the specified 'define' directive identifier
|
|
351
445
|
* with the given value.
|
|
@@ -9,16 +9,12 @@ import ClearCommand from "../Renderer/ClearCommand.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates and manages framebuffers for edge visibility rendering.
|
|
11
11
|
*
|
|
12
|
-
* @param {Object} options Object with the following properties:
|
|
13
|
-
*
|
|
14
12
|
* @alias EdgeFramebuffer
|
|
15
13
|
* @constructor
|
|
16
14
|
*
|
|
17
15
|
* @private
|
|
18
16
|
*/
|
|
19
|
-
function EdgeFramebuffer(
|
|
20
|
-
options = options || {};
|
|
21
|
-
|
|
17
|
+
function EdgeFramebuffer() {
|
|
22
18
|
// Create framebuffer manager with multiple render targets (MRT)
|
|
23
19
|
// Color attachment 0: edge color output (visualization / debug)
|
|
24
20
|
// Color attachment 1: R: edge type, G: featureId (metadata / ids)
|
|
@@ -190,6 +190,7 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
190
190
|
* @property {boolean} render <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise.
|
|
191
191
|
* @property {boolean} pick <code>true</code> if the primitive should update for a picking pass, <code>false</code> otherwise.
|
|
192
192
|
* @property {boolean} pickVoxel <code>true</code> if the primitive should update for a voxel picking pass, <code>false</code> otherwise.
|
|
193
|
+
* @property {boolean} snap <code>true</code> if the current picking pass is a snapping pass (see {@link Scene#snap}), <code>false</code> otherwise. Only ever <code>true</code> while <code>pick</code> is also <code>true</code>.
|
|
193
194
|
* @property {boolean} depth <code>true</code> if the primitive should update for a depth only pass, <code>false</code> otherwise.
|
|
194
195
|
* @property {boolean} postProcess <code>true</code> if the primitive should update for a per-feature post-process pass, <code>false</code> otherwise.
|
|
195
196
|
* @property {boolean} offscreen <code>true</code> if the primitive should update for an offscreen pass, <code>false</code> otherwise.
|
|
@@ -211,6 +212,10 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
211
212
|
* @default false
|
|
212
213
|
*/
|
|
213
214
|
pickVoxel: false,
|
|
215
|
+
/**
|
|
216
|
+
* @default false
|
|
217
|
+
*/
|
|
218
|
+
snap: false,
|
|
214
219
|
/**
|
|
215
220
|
* @default false
|
|
216
221
|
*/
|
|
@@ -473,6 +478,18 @@ function FrameState(context, creditDisplay, jobScheduler) {
|
|
|
473
478
|
* @private
|
|
474
479
|
*/
|
|
475
480
|
this.edgeVisibilityRequested = false;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Internal toggle indicating that at least one primitive for this frame has
|
|
484
|
+
* the BENTLEY_materials_planar_fill extension present. This allows lazy
|
|
485
|
+
* allocation of the planar fill feature-ID framebuffer.
|
|
486
|
+
* Set by MaterialPipelineStage at draw command build time and renewed
|
|
487
|
+
* per frame by ModelSceneGraph while planar fill primitives render.
|
|
488
|
+
* Consumed by Scene to update its _enablePlanarFillId flag.
|
|
489
|
+
* @type {boolean}
|
|
490
|
+
* @private
|
|
491
|
+
*/
|
|
492
|
+
this.planarFillRequested = false;
|
|
476
493
|
}
|
|
477
494
|
|
|
478
495
|
/**
|