@hztxi/cesium-engine 25.0.6 → 26.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/chunk-2GJAWJJT.js +1344 -0
- package/Build/Workers/chunk-2J2VS5RI.js +288 -0
- package/Build/Workers/chunk-2NCNUVAT.js +56 -0
- package/Build/Workers/chunk-2ZYRUVVU.js +301 -0
- package/Build/Workers/chunk-36IU7N4V.js +1284 -0
- package/Build/Workers/chunk-375SHKGW.js +44 -0
- package/Build/Workers/chunk-3BDLET5S.js +198 -0
- package/Build/Workers/chunk-3PRHI4KX.js +241 -0
- package/Build/Workers/chunk-3R6E2SH4.js +672 -0
- package/Build/Workers/chunk-3ZKKXEXL.js +415 -0
- package/Build/Workers/chunk-47KVKPTO.js +415 -0
- package/Build/Workers/chunk-4N227IPR.js +973 -0
- package/Build/Workers/chunk-4P6OAPBM.js +97 -0
- package/Build/Workers/chunk-4ZOLEPZK.js +519 -0
- package/Build/Workers/chunk-5EF3WWQG.js +352 -0
- package/Build/Workers/chunk-5FYUSABU.js +945 -0
- package/Build/Workers/chunk-5I76476T.js +288 -0
- package/Build/Workers/chunk-5PBZKBAP.js +511 -0
- package/Build/Workers/chunk-5RVAAW26.js +82 -0
- package/Build/Workers/chunk-5VWK76PO.js +511 -0
- package/Build/Workers/chunk-5WU37CUJ.js +630 -0
- package/Build/Workers/chunk-6EBDN5WS.js +97 -0
- package/Build/Workers/chunk-75HIWCEV.js +301 -0
- package/Build/Workers/chunk-77DBX23X.js +455 -0
- package/Build/Workers/chunk-7AMVPXZY.js +1992 -0
- package/Build/Workers/chunk-7BMDD6SM.js +124 -0
- package/Build/Workers/chunk-7GQOWCSN.js +959 -0
- package/Build/Workers/chunk-7J2ONMKC.js +198 -0
- package/Build/Workers/chunk-7MHUHXZZ.js +219 -0
- package/Build/Workers/chunk-7MQPHOAS.js +455 -0
- package/Build/Workers/chunk-7NJ5O7TP.js +387 -0
- package/Build/Workers/chunk-7OME2OKM.js +171 -0
- package/Build/Workers/chunk-7Y642MCO.js +352 -0
- package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
- package/Build/Workers/chunk-A2BROW3D.js +352 -0
- package/Build/Workers/chunk-A7LGY5XS.js +140 -0
- package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
- package/Build/Workers/chunk-B4XOVZGA.js +476 -0
- package/Build/Workers/chunk-B7PT2VL5.js +630 -0
- package/Build/Workers/chunk-C6XQGBPV.js +476 -0
- package/Build/Workers/chunk-CAEC5DA2.js +57 -0
- package/Build/Workers/chunk-CBCOHH5O.js +837 -0
- package/Build/Workers/chunk-CDLPLYLV.js +1287 -0
- package/Build/Workers/chunk-CEKCKPFN.js +368 -0
- package/Build/Workers/chunk-CEMXKBQO.js +1800 -0
- package/Build/Workers/chunk-CHMDKP5L.js +2342 -0
- package/Build/Workers/chunk-CKW3STKA.js +1067 -0
- package/Build/Workers/chunk-CV5RICKT.js +1992 -0
- package/Build/Workers/chunk-CWGB3D4Z.js +257 -0
- package/Build/Workers/chunk-DBWSISJT.js +56 -0
- package/Build/Workers/chunk-DQEUGBGA.js +2719 -0
- package/Build/Workers/chunk-DSBSPPPJ.js +1344 -0
- package/Build/Workers/chunk-DSGLDRTI.js +278 -0
- package/Build/Workers/chunk-DUBE5G2H.js +497 -0
- package/Build/Workers/chunk-DXD7OPSP.js +1992 -0
- package/Build/Workers/chunk-DXECZBSA.js +368 -0
- package/Build/Workers/chunk-DZIRO6ZK.js +682 -0
- package/Build/Workers/chunk-E4CRPGX5.js +140 -0
- package/Build/Workers/chunk-E4IVMEBH.js +52 -0
- package/Build/Workers/chunk-E4PBNWWK.js +58 -0
- package/Build/Workers/chunk-E5MWOMVC.js +57 -0
- package/Build/Workers/chunk-ECN3VUMA.js +73 -0
- package/Build/Workers/chunk-ECSKVHUB.js +476 -0
- package/Build/Workers/chunk-EE3XBOQI.js +1483 -0
- package/Build/Workers/chunk-EHA2ZDPZ.js +415 -0
- package/Build/Workers/chunk-EKEKPAJF.js +454 -0
- package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
- package/Build/Workers/chunk-EOHKUXPX.js +198 -0
- package/Build/Workers/chunk-ERENMHG2.js +754 -0
- package/Build/Workers/chunk-ESQGFRLZ.js +163 -0
- package/Build/Workers/chunk-FAYBQGKO.js +219 -0
- package/Build/Workers/chunk-FGCXPEZM.js +3201 -0
- package/Build/Workers/chunk-FHCRXPA6.js +44 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
- package/Build/Workers/chunk-FTCBY5HH.js +138 -0
- package/Build/Workers/chunk-FV4OWDV4.js +9230 -0
- package/Build/Workers/chunk-FYRNNQSL.js +280 -0
- package/Build/Workers/chunk-GI5RWJAY.js +101 -0
- package/Build/Workers/chunk-GNLMSDRO.js +945 -0
- package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
- package/Build/Workers/chunk-HCGU7OCG.js +97 -0
- package/Build/Workers/chunk-HRIPVWSC.js +58 -0
- package/Build/Workers/chunk-IC3BR6SC.js +102 -0
- package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
- package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
- package/Build/Workers/chunk-JMF4ATAS.js +3794 -0
- package/Build/Workers/chunk-KEJKMITY.js +82 -0
- package/Build/Workers/chunk-KSIEJYNL.js +3822 -0
- package/Build/Workers/chunk-KT3GG7AW.js +754 -0
- package/Build/Workers/chunk-KW2QZDUS.js +147 -0
- package/Build/Workers/chunk-KYCEM22I.js +1800 -0
- package/Build/Workers/chunk-L6B5XPBL.js +73 -0
- package/Build/Workers/chunk-LGJXN2VP.js +352 -0
- package/Build/Workers/chunk-LJTQW46H.js +57 -0
- package/Build/Workers/chunk-LMQGYJME.js +672 -0
- package/Build/Workers/chunk-LOBYJQA4.js +76 -0
- package/Build/Workers/chunk-LOF32O7F.js +163 -0
- package/Build/Workers/chunk-LOTIJA7D.js +124 -0
- package/Build/Workers/chunk-LY2UG3HV.js +38 -0
- package/Build/Workers/chunk-M7Z3MPAX.js +973 -0
- package/Build/Workers/chunk-MHNLTQHO.js +3201 -0
- package/Build/Workers/chunk-ML7OMD72.js +2342 -0
- package/Build/Workers/chunk-NBTGXEMT.js +945 -0
- package/Build/Workers/chunk-NCPJBP24.js +140 -0
- package/Build/Workers/chunk-NFY5V6MR.js +102 -0
- package/Build/Workers/chunk-NQZC37F7.js +38 -0
- package/Build/Workers/chunk-O3X3D2Z3.js +352 -0
- package/Build/Workers/chunk-OBUIHPKF.js +352 -0
- package/Build/Workers/chunk-OYPSUED3.js +1067 -0
- package/Build/Workers/chunk-PAEWNYIV.js +138 -0
- package/Build/Workers/chunk-PANJ7YH6.js +102 -0
- package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
- package/Build/Workers/chunk-PIIUGRQD.js +387 -0
- package/Build/Workers/chunk-POKD22OT.js +2719 -0
- package/Build/Workers/chunk-PQMA7MFS.js +9237 -0
- package/Build/Workers/chunk-PURIPUSY.js +682 -0
- package/Build/Workers/chunk-QIOOTLWN.js +56 -0
- package/Build/Workers/chunk-QQZPPXY4.js +3822 -0
- package/Build/Workers/chunk-QUPRALOD.js +101 -0
- package/Build/Workers/chunk-QXLQLGL2.js +1067 -0
- package/Build/Workers/chunk-RBEVHHXK.js +3201 -0
- package/Build/Workers/chunk-RC4YC3VU.js +278 -0
- package/Build/Workers/chunk-RGNNWVR6.js +171 -0
- package/Build/Workers/chunk-RHO5HV52.js +305 -0
- package/Build/Workers/chunk-SBBIEHYT.js +44 -0
- package/Build/Workers/chunk-SVCZUP5R.js +837 -0
- package/Build/Workers/chunk-SWVZTU6X.js +305 -0
- package/Build/Workers/chunk-T3EUPM5A.js +454 -0
- package/Build/Workers/chunk-TA6IU2XL.js +171 -0
- package/Build/Workers/chunk-TBHW5UME.js +973 -0
- package/Build/Workers/chunk-TLSGD5TR.js +280 -0
- package/Build/Workers/chunk-TOXDLWKZ.js +368 -0
- package/Build/Workers/chunk-TPOX6IOR.js +1054 -0
- package/Build/Workers/chunk-TZBM6TAB.js +124 -0
- package/Build/Workers/chunk-U2OY6MX6.js +398 -0
- package/Build/Workers/chunk-UCY4B5EV.js +288 -0
- package/Build/Workers/chunk-ULNBTI6R.js +138 -0
- package/Build/Workers/chunk-UMUS2AQQ.js +398 -0
- package/Build/Workers/chunk-UZ7GTP2L.js +162 -0
- package/Build/Workers/chunk-V52FEPCV.js +754 -0
- package/Build/Workers/chunk-VBEXZBG5.js +147 -0
- package/Build/Workers/chunk-VC76B6GM.js +959 -0
- package/Build/Workers/chunk-VCUOYHWC.js +519 -0
- package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
- package/Build/Workers/chunk-VMF7KOGY.js +162 -0
- package/Build/Workers/chunk-W3C7OHXF.js +387 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-WB5GWYDP.js +455 -0
- package/Build/Workers/chunk-WN6MAL25.js +682 -0
- package/Build/Workers/chunk-WTR7KMQA.js +693 -0
- package/Build/Workers/chunk-WTTFMU3P.js +241 -0
- package/Build/Workers/chunk-WULONJZC.js +1800 -0
- package/Build/Workers/chunk-WZPMAVTV.js +511 -0
- package/Build/Workers/chunk-XHT5SVP4.js +52 -0
- package/Build/Workers/chunk-XITBARMZ.js +2342 -0
- package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
- package/Build/Workers/chunk-XZ6HDXKM.js +76 -0
- package/Build/Workers/chunk-Y7KVUJEB.js +219 -0
- package/Build/Workers/chunk-Y7NDFEQ3.js +398 -0
- package/Build/Workers/chunk-YBBQDYX2.js +301 -0
- package/Build/Workers/chunk-YHPYPVAB.js +837 -0
- package/Build/Workers/chunk-YNKK6BXY.js +454 -0
- package/Build/Workers/chunk-YRAJ74HR.js +305 -0
- package/Build/Workers/chunk-YULTZK5O.js +147 -0
- package/Build/Workers/chunk-YUNQYP3Z.js +9237 -0
- package/Build/Workers/chunk-Z6JV4DZG.js +1046 -0
- package/Build/Workers/chunk-Z7BONRW2.js +241 -0
- package/Build/Workers/chunk-ZK2R3DEJ.js +1054 -0
- package/Build/Workers/chunk-ZTK5EBUI.js +76 -0
- package/Build/Workers/chunk-ZZPDORJK.js +56 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +18 -18
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +39 -39
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createCorridorGeometry.js +36 -37
- package/Build/Workers/createCorridorOutlineGeometry.js +34 -35
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -20
- 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 +20 -20
- package/Build/Workers/createGeometry.js +25 -24
- package/Build/Workers/createGroundPolylineGeometry.js +98 -34
- package/Build/Workers/createMvtTile.js +111 -19
- package/Build/Workers/createPlaneGeometry.js +18 -18
- package/Build/Workers/createPlaneOutlineGeometry.js +17 -17
- package/Build/Workers/createPolygonGeometry.js +36 -36
- package/Build/Workers/createPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createPolylineGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeGeometry.js +38 -36
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +32 -31
- package/Build/Workers/createRectangleGeometry.js +29 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -23
- package/Build/Workers/createSimplePolylineGeometry.js +26 -26
- 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 +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +23 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- package/Build/Workers/createWallGeometry.js +26 -26
- package/Build/Workers/createWallOutlineGeometry.js +26 -26
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +993 -2334
- 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 +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- 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 +99 -4
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +58 -50
- 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/MapProjection.js +1 -0
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +3 -3
- package/Source/Core/Matrix3.js +3 -3
- package/Source/Core/Matrix4.js +1 -1
- 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/PolylinePipeline.js +9 -2
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +180 -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/createColorRamp.js +37 -0
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +14 -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 +529 -557
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/DataSources/PolylineGeometryUpdater.js +125 -7
- 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 -9
- package/Source/Renderer/Texture.js +12 -1
- package/Source/Renderer/UniformState.js +7 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- 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 +15 -5
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/BufferPointCollection.js +11 -1
- package/Source/Scene/BufferPolygonCollection.js +26 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +105 -32
- package/Source/Scene/Camera.js +137 -8
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraFlightPath.js +17 -0
- package/Source/Scene/Cesium3DTile.js +102 -4
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileStyle.js +40 -0
- package/Source/Scene/Cesium3DTileset.js +213 -8
- package/Source/Scene/Cesium3DTilesetTraversal.js +14 -0
- package/Source/Scene/ClippingPlaneCollection.js +4 -4
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/ColumbusWorlds.js +190 -0
- package/Source/Scene/Composite3DTileContent.js +254 -292
- 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 +98 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/FrameState.js +27 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/Globe.js +110 -22
- package/Source/Scene/GlobeDepth.js +243 -6
- package/Source/Scene/GlobeSurfaceShaderSet.js +637 -540
- package/Source/Scene/GlobeSurfaceTile.js +575 -398
- package/Source/Scene/GlobeSurfaceTileProvider.js +2289 -1842
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +146 -3
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/GroundPolylinePrimitive.js +2 -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/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +190 -6
- package/Source/Scene/Implicit3DTileContent.js +192 -216
- package/Source/Scene/ImplicitTileCoordinates.js +17 -0
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +4 -1
- package/Source/Scene/MVTDataProvider.js +555 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +82 -312
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- 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 +45 -10
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelDrawCommand.js +180 -8
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelSceneGraph.js +21 -0
- package/Source/Scene/Model/ModelUtility.js +5 -0
- package/Source/Scene/Model/PickingPipelineStage.js +29 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +645 -153
- package/Source/Scene/ModelComponents.js +112 -0
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/MvtLabelCandidates.js +295 -0
- package/Source/Scene/MvtLabelManager.js +1069 -0
- package/Source/Scene/Picking.js +19 -3
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +1 -1
- package/Source/Scene/Polyline.js +32 -5
- package/Source/Scene/PolylineCollection.js +39 -0
- package/Source/Scene/PostProcessStage.js +4 -2
- package/Source/Scene/Primitive.js +12 -13
- package/Source/Scene/PrimitivePipeline.js +158 -28
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +21 -18
- package/Source/Scene/Scene.js +655 -6
- package/Source/Scene/SceneTransforms.js +18 -0
- package/Source/Scene/ScreenSpaceCameraController.js +12 -3
- 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/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +543 -0
- package/Source/Scene/Vector3DTileContent.js +207 -237
- package/Source/Scene/VectorGltf3DTileContent.js +185 -45
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1208 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/decodeMVT.js +877 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +114 -64
- package/Source/Scene/renderBufferPolygonCollection.js +245 -53
- package/Source/Scene/renderBufferPolylineCollection.js +271 -145
- package/Source/Shaders/BillboardCollectionVS.glsl +23 -25
- package/Source/Shaders/BillboardCollectionVS.js +23 -25
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +13 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +22 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +23 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- 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/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- 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/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.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 -0
- package/Source/Shaders/GlobeFS.glsl +10 -6
- package/Source/Shaders/GlobeFS.js +10 -6
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -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/PolylineShadowVolumeFS.glsl +14 -0
- package/Source/Shaders/PolylineShadowVolumeFS.js +14 -0
- package/Source/Shaders/RestoreDepth.glsl +8 -0
- package/Source/Shaders/RestoreDepth.js +10 -0
- package/Source/Shaders/VectorCommon.glsl +178 -0
- package/Source/Shaders/VectorCommon.js +180 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/Source/Workers/createMvtTile.js +39 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.d.ts +535 -1393
- package/index.js +125 -93
- package/package.json +13 -13
|
@@ -10,6 +10,7 @@ import Matrix4 from "../Core/Matrix4.js";
|
|
|
10
10
|
import OrthographicFrustum from "../Core/OrthographicFrustum.js";
|
|
11
11
|
import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
|
|
12
12
|
import Transforms from "../Core/Transforms.js";
|
|
13
|
+
import ColumbusWorlds from "./ColumbusWorlds.js";
|
|
13
14
|
import SceneMode from "./SceneMode.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -132,6 +133,23 @@ SceneTransforms.worldWithEyeOffsetToWindowCoordinates = function (
|
|
|
132
133
|
viewport.height = canvas.clientHeight;
|
|
133
134
|
|
|
134
135
|
const camera = scene.camera;
|
|
136
|
+
|
|
137
|
+
if (
|
|
138
|
+
(frameState.mode === SceneMode.SCENE2D ||
|
|
139
|
+
frameState.mode === SceneMode.COLUMBUS_VIEW) &&
|
|
140
|
+
frameState.columbusRepeatWorlds === true
|
|
141
|
+
) {
|
|
142
|
+
// Repeat worlds: rendering replicates the data onto every world copy, so
|
|
143
|
+
// screen-space consumers (HTML overlays, editor handles) must project onto
|
|
144
|
+
// the copy nearest the camera as well. Both 2D and Columbus View place the
|
|
145
|
+
// map-u axis on world y, so the copy offset applies to y.
|
|
146
|
+
actualPosition.y = ColumbusWorlds.nearestWorldU(
|
|
147
|
+
camera.positionWC.y,
|
|
148
|
+
actualPosition.y,
|
|
149
|
+
scene.mapProjection,
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
135
153
|
let cameraCentered = false;
|
|
136
154
|
|
|
137
155
|
if (frameState.mode === SceneMode.SCENE2D) {
|
|
@@ -20,6 +20,7 @@ import VerticalExaggeration from "../Core/VerticalExaggeration.js";
|
|
|
20
20
|
import Transforms from "../Core/Transforms.js";
|
|
21
21
|
import CameraEventAggregator from "./CameraEventAggregator.js";
|
|
22
22
|
import CameraEventType from "./CameraEventType.js";
|
|
23
|
+
import ColumbusWorlds from "./ColumbusWorlds.js";
|
|
23
24
|
import MapMode2D from "./MapMode2D.js";
|
|
24
25
|
import SceneMode from "./SceneMode.js";
|
|
25
26
|
import SceneTransforms from "./SceneTransforms.js";
|
|
@@ -1959,7 +1960,7 @@ function spin3D(controller, startPosition, movement) {
|
|
|
1959
1960
|
scratchMousePosition,
|
|
1960
1961
|
);
|
|
1961
1962
|
if (defined(mousePos)) {
|
|
1962
|
-
let strafing
|
|
1963
|
+
let strafing;
|
|
1963
1964
|
const ray = camera.getPickRay(
|
|
1964
1965
|
movement.startPosition,
|
|
1965
1966
|
pickGlobeScratchRay,
|
|
@@ -2367,7 +2368,6 @@ function zoom3D(controller, startPosition, movement) {
|
|
|
2367
2368
|
if (!defined(controller._globe) && defined(distance)) {
|
|
2368
2369
|
const targetDistance = camera.getMagnitude();
|
|
2369
2370
|
if (targetDistance < distance) {
|
|
2370
|
-
intersection = undefined;
|
|
2371
2371
|
distance = undefined;
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
@@ -2993,8 +2993,17 @@ ScreenSpaceCameraController.prototype.onMap = function () {
|
|
|
2993
2993
|
const camera = scene.camera;
|
|
2994
2994
|
|
|
2995
2995
|
if (mode === SceneMode.COLUMBUS_VIEW) {
|
|
2996
|
+
let positionX = camera.position.x;
|
|
2997
|
+
if (scene.columbusRepeatWorlds === true) {
|
|
2998
|
+
// Columbus repeat worlds: the camera may sit on any world copy; wrap
|
|
2999
|
+
// its map-u coordinate into the primary world for the bounds check.
|
|
3000
|
+
const worldWidth = ColumbusWorlds.getWorldWidth(scene.mapProjection);
|
|
3001
|
+
positionX =
|
|
3002
|
+
CesiumMath.mod(positionX + worldWidth * 0.5, worldWidth) -
|
|
3003
|
+
worldWidth * 0.5;
|
|
3004
|
+
}
|
|
2996
3005
|
return (
|
|
2997
|
-
Math.abs(
|
|
3006
|
+
Math.abs(positionX) - this._maxCoord.x < 0 &&
|
|
2998
3007
|
Math.abs(camera.position.y) - this._maxCoord.y < 0
|
|
2999
3008
|
);
|
|
3000
3009
|
}
|
|
@@ -1719,20 +1719,25 @@ function createCastDerivedCommand(
|
|
|
1719
1719
|
const isPointLight = shadowMap._isPointLight;
|
|
1720
1720
|
const usesDepthTexture = shadowMap._usesDepthTexture;
|
|
1721
1721
|
|
|
1722
|
+
const vertexShaderSource = shaderProgram.vertexShaderSource;
|
|
1723
|
+
const fragmentShaderSource = shaderProgram.fragmentShaderSource;
|
|
1724
|
+
|
|
1725
|
+
const hasClipping =
|
|
1726
|
+
isOpaque &&
|
|
1727
|
+
ShadowMapShader.hasClippingForShadowCast(fragmentShaderSource);
|
|
1728
|
+
|
|
1722
1729
|
const keyword = ShadowMapShader.getShadowCastShaderKeyword(
|
|
1723
1730
|
isPointLight,
|
|
1724
1731
|
isTerrain,
|
|
1725
1732
|
usesDepthTexture,
|
|
1726
1733
|
isOpaque,
|
|
1734
|
+
hasClipping,
|
|
1727
1735
|
);
|
|
1728
1736
|
castShader = context.shaderCache.getDerivedShaderProgram(
|
|
1729
1737
|
shaderProgram,
|
|
1730
1738
|
keyword,
|
|
1731
1739
|
);
|
|
1732
1740
|
if (!defined(castShader)) {
|
|
1733
|
-
const vertexShaderSource = shaderProgram.vertexShaderSource;
|
|
1734
|
-
const fragmentShaderSource = shaderProgram.fragmentShaderSource;
|
|
1735
|
-
|
|
1736
1741
|
const castVS = ShadowMapShader.createShadowCastVertexShader(
|
|
1737
1742
|
vertexShaderSource,
|
|
1738
1743
|
isPointLight,
|
|
@@ -1743,6 +1748,7 @@ function createCastDerivedCommand(
|
|
|
1743
1748
|
isPointLight,
|
|
1744
1749
|
usesDepthTexture,
|
|
1745
1750
|
isOpaque,
|
|
1751
|
+
hasClipping,
|
|
1746
1752
|
);
|
|
1747
1753
|
|
|
1748
1754
|
castShader = context.shaderCache.createDerivedShaderProgram(
|
|
@@ -6,13 +6,48 @@ import ShaderSource from "../Renderer/ShaderSource.js";
|
|
|
6
6
|
*/
|
|
7
7
|
function ShadowMapShader() {}
|
|
8
8
|
|
|
9
|
+
const clippingDefines = {
|
|
10
|
+
HAS_CLIPPING_PLANES: true,
|
|
11
|
+
ENABLE_CLIPPING_POLYGONS: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if the fragment shader clips fragments via a
|
|
16
|
+
* ClippingPlaneCollection or ClippingPolygonCollection, in which case the
|
|
17
|
+
* shadow cast pass must run the original main so that clipped fragments
|
|
18
|
+
* are discarded and do not cast shadows.
|
|
19
|
+
*
|
|
20
|
+
* @param {ShaderSource} fragmentShaderSource
|
|
21
|
+
* @returns {boolean}
|
|
22
|
+
*/
|
|
23
|
+
ShadowMapShader.hasClippingForShadowCast = function (fragmentShaderSource) {
|
|
24
|
+
const defines = fragmentShaderSource.defines;
|
|
25
|
+
return (
|
|
26
|
+
defined(defines) &&
|
|
27
|
+
defines.some(function (define) {
|
|
28
|
+
return clippingDefines[define] === true;
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {boolean} isPointLight
|
|
35
|
+
* @param {boolean} isTerrain
|
|
36
|
+
* @param {boolean} usesDepthTexture
|
|
37
|
+
* @param {boolean} isOpaque
|
|
38
|
+
* @param {boolean} hasClipping True if the fragment shader discards clipped
|
|
39
|
+
* fragments. Differentiates cached shader variants so that a shader that
|
|
40
|
+
* must call czm_shadow_cast_main() is never reused for one that does not.
|
|
41
|
+
* @returns {string}
|
|
42
|
+
*/
|
|
9
43
|
ShadowMapShader.getShadowCastShaderKeyword = function (
|
|
10
44
|
isPointLight,
|
|
11
45
|
isTerrain,
|
|
12
46
|
usesDepthTexture,
|
|
13
47
|
isOpaque,
|
|
48
|
+
hasClipping,
|
|
14
49
|
) {
|
|
15
|
-
return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque}`;
|
|
50
|
+
return `castShadow ${isPointLight} ${isTerrain} ${usesDepthTexture} ${isOpaque} ${hasClipping}`;
|
|
16
51
|
};
|
|
17
52
|
|
|
18
53
|
ShadowMapShader.createShadowCastVertexShader = function (
|
|
@@ -54,11 +89,22 @@ ShadowMapShader.createShadowCastVertexShader = function (
|
|
|
54
89
|
});
|
|
55
90
|
};
|
|
56
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @param {ShaderSource} fs
|
|
94
|
+
* @param {boolean} isPointLight
|
|
95
|
+
* @param {boolean} usesDepthTexture
|
|
96
|
+
* @param {boolean} opaque
|
|
97
|
+
* @param {boolean} hasClipping True if the fragment shader discards clipped
|
|
98
|
+
* fragments. When true, czm_shadow_cast_main() (the renamed original main)
|
|
99
|
+
* is called first so that clipping discards execute during the shadow cast pass.
|
|
100
|
+
* @returns {ShaderSource}
|
|
101
|
+
*/
|
|
57
102
|
ShadowMapShader.createShadowCastFragmentShader = function (
|
|
58
103
|
fs,
|
|
59
104
|
isPointLight,
|
|
60
105
|
usesDepthTexture,
|
|
61
106
|
opaque,
|
|
107
|
+
hasClipping,
|
|
62
108
|
) {
|
|
63
109
|
const defines = fs.defines.slice(0);
|
|
64
110
|
const sources = fs.sources.slice(0);
|
|
@@ -85,7 +131,9 @@ ShadowMapShader.createShadowCastFragmentShader = function (
|
|
|
85
131
|
fsSource += "uniform vec4 shadowMap_lightPositionEC; \n";
|
|
86
132
|
}
|
|
87
133
|
|
|
88
|
-
if (opaque) {
|
|
134
|
+
if (opaque && hasClipping) {
|
|
135
|
+
fsSource += "void main() \n" + "{ \n" + " czm_shadow_cast_main(); \n";
|
|
136
|
+
} else if (opaque) {
|
|
89
137
|
fsSource += "void main() \n" + "{ \n";
|
|
90
138
|
} else {
|
|
91
139
|
fsSource +=
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
2
|
+
import defined from "../Core/defined.js";
|
|
3
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
4
|
+
import PixelFormat from "../Core/PixelFormat.js";
|
|
5
|
+
import FramebufferManager from "../Renderer/FramebufferManager.js";
|
|
6
|
+
import PassState from "../Renderer/PassState.js";
|
|
7
|
+
import PixelDatatype from "../Renderer/PixelDatatype.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
function SnapFramebuffer(context) {
|
|
13
|
+
const passState = new PassState(context);
|
|
14
|
+
passState.blendingEnabled = false;
|
|
15
|
+
passState.scissorTest = {
|
|
16
|
+
enabled: true,
|
|
17
|
+
rectangle: new BoundingRectangle(),
|
|
18
|
+
};
|
|
19
|
+
passState.viewport = new BoundingRectangle();
|
|
20
|
+
|
|
21
|
+
this._context = context;
|
|
22
|
+
this._fb = new FramebufferManager({
|
|
23
|
+
depthStencil: true,
|
|
24
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
25
|
+
pixelFormat: PixelFormat.RGBA,
|
|
26
|
+
});
|
|
27
|
+
this._passState = passState;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getSnapObjectsFromPixels(context, pixels, width, height) {
|
|
31
|
+
const max = Math.max(width, height);
|
|
32
|
+
const length = max * max;
|
|
33
|
+
const halfWidth = Math.floor(width * 0.5);
|
|
34
|
+
const halfHeight = Math.floor(height * 0.5);
|
|
35
|
+
|
|
36
|
+
let x = 0;
|
|
37
|
+
let y = 0;
|
|
38
|
+
let dx = 0;
|
|
39
|
+
let dy = -1;
|
|
40
|
+
|
|
41
|
+
const results = [];
|
|
42
|
+
for (let i = 0; i < length; ++i) {
|
|
43
|
+
if (
|
|
44
|
+
-halfWidth <= x &&
|
|
45
|
+
x <= halfWidth &&
|
|
46
|
+
-halfHeight <= y &&
|
|
47
|
+
y <= halfHeight
|
|
48
|
+
) {
|
|
49
|
+
const index = 4 * ((halfHeight - y) * width + x + halfWidth);
|
|
50
|
+
|
|
51
|
+
const pickColor = pixels[index];
|
|
52
|
+
const object = context.getObjectByPickColor(pickColor);
|
|
53
|
+
if (defined(object)) {
|
|
54
|
+
results.push({
|
|
55
|
+
object: object,
|
|
56
|
+
isEdge: pixels[index + 1] > 0.0,
|
|
57
|
+
depth: pixels[index + 2],
|
|
58
|
+
x: x,
|
|
59
|
+
y: y,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (x === y || (x < 0 && -x === y) || (x > 0 && x === 1 - y)) {
|
|
65
|
+
const temp = dx;
|
|
66
|
+
dx = -dy;
|
|
67
|
+
dy = temp;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
x += dx;
|
|
71
|
+
y += dy;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
SnapFramebuffer.prototype.begin = function (screenSpaceRectangle, viewport) {
|
|
78
|
+
const context = this._context;
|
|
79
|
+
const { width, height } = viewport;
|
|
80
|
+
|
|
81
|
+
BoundingRectangle.clone(
|
|
82
|
+
screenSpaceRectangle,
|
|
83
|
+
this._passState.scissorTest.rectangle,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
this._fb.update(context, width, height);
|
|
87
|
+
this._passState.framebuffer = this._fb.framebuffer;
|
|
88
|
+
|
|
89
|
+
this._passState.viewport.width = width;
|
|
90
|
+
this._passState.viewport.height = height;
|
|
91
|
+
|
|
92
|
+
return this._passState;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
SnapFramebuffer.prototype.end = function (screenSpaceRectangle) {
|
|
96
|
+
const width = screenSpaceRectangle.width ?? 1.0;
|
|
97
|
+
const height = screenSpaceRectangle.height ?? 1.0;
|
|
98
|
+
|
|
99
|
+
const context = this._context;
|
|
100
|
+
const pixels = context.readPixels({
|
|
101
|
+
x: screenSpaceRectangle.x,
|
|
102
|
+
y: screenSpaceRectangle.y,
|
|
103
|
+
width: width,
|
|
104
|
+
height: height,
|
|
105
|
+
pixelDatatype: PixelDatatype.FLOAT,
|
|
106
|
+
framebuffer: this._fb.framebuffer,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return getSnapObjectsFromPixels(context, pixels, width, height);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
SnapFramebuffer.prototype.isDestroyed = function () {
|
|
113
|
+
return false;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
SnapFramebuffer.prototype.destroy = function () {
|
|
117
|
+
this._fb.destroy();
|
|
118
|
+
return destroyObject(this);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default SnapFramebuffer;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
2
|
+
import Cartesian2 from "../Core/Cartesian2.js";
|
|
3
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
4
|
+
import Check from "../Core/Check.js";
|
|
5
|
+
import defined from "../Core/defined.js";
|
|
6
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
7
|
+
import Ray from "../Core/Ray.js";
|
|
8
|
+
import { pickBegin, pickEnd } from "./Picking.js";
|
|
9
|
+
import SnapFramebuffer from "./SnapFramebuffer.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Implementation of {@link Scene#snap}: snap-to-geometry picking.
|
|
13
|
+
*
|
|
14
|
+
* A snapping pass is an offscreen pick render (it reuses the pick render
|
|
15
|
+
* machinery via <code>pickBegin</code>/<code>pickEnd</code>) that targets a
|
|
16
|
+
* dedicated RGBA32F framebuffer instead of the RGBA8 pick framebuffer. Each
|
|
17
|
+
* pixel carries a fuller payload than a pick color:
|
|
18
|
+
* <ul>
|
|
19
|
+
* <li>R: pick ID (uint32)</li>
|
|
20
|
+
* <li>G: isEdge flag (0.0/1.0)</li>
|
|
21
|
+
* <li>B: linear eye-space depth (meters)</li>
|
|
22
|
+
* <li>A: unused</li>
|
|
23
|
+
* </ul>
|
|
24
|
+
* The payload expression is built in PickingPipelineStage (DrawCommand.snapId)
|
|
25
|
+
* and compiled into a snap-derived shader by
|
|
26
|
+
* DerivedCommand.createSnapDerivedCommand. Only commands with a
|
|
27
|
+
* <code>snapId</code> (i.e. Model-pipeline primitives) render during a
|
|
28
|
+
* snapping pass.
|
|
29
|
+
*
|
|
30
|
+
* @namespace Snapping
|
|
31
|
+
*
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
const Snapping = {};
|
|
35
|
+
|
|
36
|
+
const scratchRectangle = new BoundingRectangle(0.0, 0.0, 3.0, 3.0);
|
|
37
|
+
const scratchSnapCoord = new Cartesian2();
|
|
38
|
+
const scratchSnapRay = new Ray();
|
|
39
|
+
const scratchSnapOffset = new Cartesian3();
|
|
40
|
+
|
|
41
|
+
// Radius around the crosshair, in pixels, used to sample the nearest surface
|
|
42
|
+
// (the occluder the cursor is on).
|
|
43
|
+
const SNAP_OCCLUDER_RADIUS_PIXELS = 3.0;
|
|
44
|
+
|
|
45
|
+
// An edge more than this fraction deeper than that surface is treated as
|
|
46
|
+
// occluded by it (the edge is only visible because it pokes through a gap in a
|
|
47
|
+
// nearer silhouette), so snap doesn't punch through to geometry behind the
|
|
48
|
+
// object the cursor is on.
|
|
49
|
+
const SNAP_OCCLUSION_TOLERANCE = 0.1;
|
|
50
|
+
|
|
51
|
+
function cursorDist(hit) {
|
|
52
|
+
return Math.sqrt(hit.x * hit.x + hit.y * hit.y);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function selectBestHit(hits) {
|
|
56
|
+
// Depth of the nearest surface under the crosshair; edges well behind it are
|
|
57
|
+
// occluded by the object the cursor is on and must not win.
|
|
58
|
+
let occluderDepth = Number.POSITIVE_INFINITY;
|
|
59
|
+
for (const hit of hits) {
|
|
60
|
+
if (!hit.isEdge && cursorDist(hit) <= SNAP_OCCLUDER_RADIUS_PIXELS) {
|
|
61
|
+
occluderDepth = Math.min(occluderDepth, hit.depth);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const maxEdgeDepth = occluderDepth * (1.0 + SNAP_OCCLUSION_TOLERANCE);
|
|
65
|
+
|
|
66
|
+
// Edges outrank surfaces, but only edges in front of (or at) the occluder;
|
|
67
|
+
// otherwise fall back to the closest surface. Within the chosen group the
|
|
68
|
+
// hit closest to the crosshair wins.
|
|
69
|
+
const visible = hits.filter(
|
|
70
|
+
(hit) => !hit.isEdge || hit.depth <= maxEdgeDepth,
|
|
71
|
+
);
|
|
72
|
+
const wantEdge = visible.some((hit) => hit.isEdge);
|
|
73
|
+
const group = visible.filter((hit) => hit.isEdge === wantEdge);
|
|
74
|
+
return group.reduce((best, hit) =>
|
|
75
|
+
cursorDist(hit) < cursorDist(best) ? hit : best,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Unproject a snap hit's eye-space depth (channel B of the snap framebuffer,
|
|
80
|
+
// written by the snap shader at the edge fragment itself) into a world
|
|
81
|
+
// position.
|
|
82
|
+
function snapHitToWorld(scene, windowPosition, hit) {
|
|
83
|
+
const coords = scratchSnapCoord;
|
|
84
|
+
coords.x = windowPosition.x + hit.x;
|
|
85
|
+
coords.y = windowPosition.y + hit.y;
|
|
86
|
+
|
|
87
|
+
const ray = scene.camera.getPickRay(coords, scratchSnapRay);
|
|
88
|
+
if (!defined(ray)) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// hit.depth is perpendicular distance from the camera plane along the view
|
|
93
|
+
// direction; convert to distance along the (non-axis-aligned) pick ray.
|
|
94
|
+
const cos = Cartesian3.dot(ray.direction, scene.camera.directionWC);
|
|
95
|
+
if (cos <= 0.0) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const t = hit.depth / cos;
|
|
99
|
+
|
|
100
|
+
const offset = Cartesian3.multiplyByScalar(
|
|
101
|
+
ray.direction,
|
|
102
|
+
t,
|
|
103
|
+
scratchSnapOffset,
|
|
104
|
+
);
|
|
105
|
+
return Cartesian3.add(ray.origin, offset, new Cartesian3());
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Returns the best snap target in a screen-space region around
|
|
110
|
+
* <code>windowPosition</code>. See {@link Scene#snap} for the public API.
|
|
111
|
+
*
|
|
112
|
+
* @param {Scene} scene
|
|
113
|
+
* @param {Cartesian2} windowPosition Window coordinates at the center of the search region.
|
|
114
|
+
* @param {object} [options] Object with the following properties:
|
|
115
|
+
* @param {number} [options.width=25] Width of the search region in pixels.
|
|
116
|
+
* @param {number} [options.height=options.width] Height of the search region in pixels.
|
|
117
|
+
* @returns {SceneSnapResult | undefined}
|
|
118
|
+
*
|
|
119
|
+
* @private
|
|
120
|
+
*/
|
|
121
|
+
Snapping.snap = function (scene, windowPosition, options) {
|
|
122
|
+
//>>includeStart('debug', pragmas.debug);
|
|
123
|
+
Check.defined("windowPosition", windowPosition);
|
|
124
|
+
//>>includeEnd('debug');
|
|
125
|
+
|
|
126
|
+
const width = options?.width ?? 25;
|
|
127
|
+
const height = options?.height ?? width;
|
|
128
|
+
|
|
129
|
+
const { context, defaultView } = scene;
|
|
130
|
+
|
|
131
|
+
// The snap framebuffer is RGBA32F; rendering to it requires float color
|
|
132
|
+
// attachment support.
|
|
133
|
+
if (!context.colorBufferFloat) {
|
|
134
|
+
oneTimeWarning(
|
|
135
|
+
"snap-color-buffer-float",
|
|
136
|
+
"Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.",
|
|
137
|
+
);
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Created lazily so applications that never snap pay no framebuffer cost.
|
|
142
|
+
if (!defined(defaultView.snapFramebuffer)) {
|
|
143
|
+
defaultView.snapFramebuffer = new SnapFramebuffer(context);
|
|
144
|
+
}
|
|
145
|
+
const snapFramebuffer = defaultView.snapFramebuffer;
|
|
146
|
+
|
|
147
|
+
const drawingBufferRectangle = scratchRectangle;
|
|
148
|
+
pickBegin(scene, windowPosition, drawingBufferRectangle, width, height, {
|
|
149
|
+
framebuffer: snapFramebuffer,
|
|
150
|
+
snap: true,
|
|
151
|
+
});
|
|
152
|
+
const hits = snapFramebuffer.end(drawingBufferRectangle);
|
|
153
|
+
pickEnd(scene);
|
|
154
|
+
|
|
155
|
+
if (hits.length === 0) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const best = selectBestHit(hits);
|
|
160
|
+
if (!defined(best)) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const position = snapHitToWorld(scene, windowPosition, best);
|
|
165
|
+
if (!defined(position)) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
object: best.object,
|
|
171
|
+
isEdge: best.isEdge,
|
|
172
|
+
position: position,
|
|
173
|
+
screenPosition: new Cartesian2(
|
|
174
|
+
windowPosition.x + best.x,
|
|
175
|
+
windowPosition.y + best.y,
|
|
176
|
+
),
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// Exposed for testing.
|
|
181
|
+
Snapping._selectBestHit = selectBestHit;
|
|
182
|
+
Snapping._snapHitToWorld = snapHitToWorld;
|
|
183
|
+
|
|
184
|
+
export default Snapping;
|
|
@@ -823,6 +823,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {
|
|
|
823
823
|
GlobeSurfaceTile.initialize(
|
|
824
824
|
tile,
|
|
825
825
|
tileProvider.terrainProvider,
|
|
826
|
+
tileProvider.vectorProvider,
|
|
826
827
|
tileProvider._imageryLayers,
|
|
827
828
|
);
|
|
828
829
|
|
|
@@ -1243,7 +1244,7 @@ function createFillMesh(tileProvider, frameState, tile, vertexArraysToDestroy) {
|
|
|
1243
1244
|
|
|
1244
1245
|
indices[indexOut++] = centerIndex;
|
|
1245
1246
|
indices[indexOut++] = i;
|
|
1246
|
-
indices[indexOut
|
|
1247
|
+
indices[indexOut] = 0;
|
|
1247
1248
|
|
|
1248
1249
|
const westIndicesSouthToNorth = [];
|
|
1249
1250
|
for (i = southwestIndex; i >= northwestIndex; --i) {
|
|
@@ -1800,7 +1801,7 @@ function addEdgeMesh(
|
|
|
1800
1801
|
heightRange,
|
|
1801
1802
|
) {
|
|
1802
1803
|
// Handle copying edges across the anti-meridian.
|
|
1803
|
-
let sourceRectangle
|
|
1804
|
+
let sourceRectangle;
|
|
1804
1805
|
if (tileEdge === TileEdge.EAST && terrainFillMesh.tile.x === 0) {
|
|
1805
1806
|
sourceRectangle = Rectangle.clone(
|
|
1806
1807
|
edgeTile.rectangle,
|