@cesium/engine 26.1.0 → 26.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/zip-web-worker.js +764 -520
- package/Build/Workers/{chunk-HS6AD4P2.js → chunk-2DKJSPYF.js} +14 -14
- package/Build/Workers/{chunk-QVLAFFJY.js → chunk-2PWVICP6.js} +1 -1
- package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
- package/Build/Workers/{chunk-ENNFMWDW.js → chunk-4DMAXPKB.js} +12 -12
- package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-4LRFYRBX.js} +2 -2
- package/Build/Workers/{chunk-76FDC45O.js → chunk-5JCZHJUU.js} +13 -13
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-5KG7KDDW.js} +7 -7
- package/Build/Workers/{chunk-A6X24AZI.js → chunk-6BSNYZZG.js} +5 -5
- package/Build/Workers/{chunk-IGAZBTFZ.js → chunk-6R6SGKYN.js} +6 -6
- package/Build/Workers/{chunk-SS5ABQGY.js → chunk-6V2KDEHL.js} +4 -4
- package/Build/Workers/{chunk-ZMBHFYOX.js → chunk-75BC2IHI.js} +7 -7
- package/Build/Workers/{chunk-LGNDTZVX.js → chunk-7SESBH2I.js} +4 -4
- package/Build/Workers/{chunk-CLCTQVVL.js → chunk-7WXBTNRV.js} +8 -8
- package/Build/Workers/{chunk-WBSY7HDY.js → chunk-A7SMPV6B.js} +12 -12
- package/Build/Workers/{chunk-CEEZE3YZ.js → chunk-ATSXKJ3L.js} +7 -7
- package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
- package/Build/Workers/{chunk-6HK6IXK2.js → chunk-B7Q2WF6Q.js} +4 -4
- package/Build/Workers/{chunk-YKU2Q3A2.js → chunk-BNDSDQ7D.js} +9 -12
- package/Build/Workers/{chunk-R4FPNAZ2.js → chunk-CKK6CUXK.js} +9 -9
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
- package/Build/Workers/{chunk-7D2HZKH7.js → chunk-CQ4TZXAT.js} +7 -7
- package/Build/Workers/{chunk-TVZD72WJ.js → chunk-DKSANM4A.js} +12 -12
- package/Build/Workers/{chunk-FDK4K5IA.js → chunk-DZK34ZVD.js} +1 -1
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-E7G32DWL.js} +1 -1
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-EDETO6NY.js} +2 -2
- package/Build/Workers/{chunk-2EFYUSUY.js → chunk-F34TJJLA.js} +16 -16
- package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
- package/Build/Workers/{chunk-T5QBPLE3.js → chunk-GS7RY2DH.js} +11 -11
- package/Build/Workers/{chunk-C7JQVRLM.js → chunk-HDD3RFLT.js} +25 -3
- package/Build/Workers/{chunk-E7NZJOK7.js → chunk-HDPNFEPP.js} +121 -93
- package/Build/Workers/{chunk-VAL7DYNR.js → chunk-JBJ6BRIM.js} +4 -4
- package/Build/Workers/{chunk-XQ3SKCMM.js → chunk-JKTWW7IO.js} +5 -5
- package/Build/Workers/{chunk-UVO6COT2.js → chunk-JL4NWWQY.js} +5 -5
- package/Build/Workers/{chunk-DBD5WWG2.js → chunk-JMUUAW4X.js} +10 -10
- package/Build/Workers/{chunk-UEY73NRN.js → chunk-KBGAHN5R.js} +1 -1
- package/Build/Workers/{chunk-LD64RPYV.js → chunk-KEWK6VZL.js} +12 -12
- package/Build/Workers/{chunk-JW6OZT4R.js → chunk-L73K5UPP.js} +10 -10
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-LL2SGJYH.js} +6 -6
- package/Build/Workers/{chunk-XLXSDIP5.js → chunk-LYJUL4XQ.js} +6 -6
- package/Build/Workers/{chunk-SM2CDCYF.js → chunk-M6W46OAP.js} +7 -7
- package/Build/Workers/{chunk-EHTS2YPT.js → chunk-MDDKCLMF.js} +17 -17
- package/Build/Workers/{chunk-FGQFQHN5.js → chunk-MUW4DJV7.js} +18 -18
- package/Build/Workers/{chunk-HHV3MCGV.js → chunk-N5YK44FS.js} +5 -5
- package/Build/Workers/{chunk-RG4F5R57.js → chunk-NZQUP52G.js} +9 -9
- package/Build/Workers/{chunk-B4CQSLZJ.js → chunk-PKZA44LH.js} +6 -6
- package/Build/Workers/{chunk-OBEU25PI.js → chunk-Q2JS5LCB.js} +17 -17
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
- package/Build/Workers/{chunk-NIWITKQK.js → chunk-SEJIXZZ4.js} +11 -11
- package/Build/Workers/{chunk-SGRGNDOD.js → chunk-SL2HCFYW.js} +10 -10
- package/Build/Workers/{chunk-SF6K72D7.js → chunk-SLHK3KAR.js} +5 -5
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
- package/Build/Workers/{chunk-LNSQVXFH.js → chunk-VRECSMG3.js} +2 -2
- package/Build/Workers/{chunk-A3O6EDBK.js → chunk-X27HKF5E.js} +2 -2
- package/Build/Workers/{chunk-7KVKHY7O.js → chunk-XBY3354M.js} +6 -6
- package/Build/Workers/{chunk-GSWMAFTE.js → chunk-XRZCS3HE.js} +23 -16
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-XSIUYAT6.js} +2 -2
- package/Build/Workers/{chunk-ZSGUV73H.js → chunk-Z2DW5NM2.js} +6 -6
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +35 -35
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +31 -33
- package/Build/Workers/createCorridorOutlineGeometry.js +29 -31
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +24 -24
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +34 -34
- package/Build/Workers/createPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createPolylineGeometry.js +26 -26
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +21 -21
- package/Build/Workers/createSimplePolylineGeometry.js +24 -24
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +2 -2
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +1 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +5 -0
- package/Source/Core/IonSnapGeometryType.js +59 -0
- package/Source/Core/IonSnapHeat.js +33 -0
- package/Source/Core/IonSnapMode.js +45 -0
- package/Source/Core/IonSnapParentGeometryType.js +52 -0
- package/Source/Core/IonSnapService.js +369 -0
- package/Source/Core/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +2 -2
- package/Source/Core/Matrix3.js +2 -2
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainPicker.js +179 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1211 -0
- package/Source/Core/VectorProvider.js +669 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +2 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -2
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +67 -2
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -10
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/Texture.js +11 -0
- package/Source/Renderer/UniformState.js +54 -1
- package/Source/Renderer/VertexArray.js +0 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +7 -3
- package/Source/Scene/BufferPointCollection.js +4 -7
- package/Source/Scene/BufferPolygonCollection.js +56 -27
- package/Source/Scene/BufferPolylineCollection.js +61 -8
- package/Source/Scene/BufferPolylineMaterial.js +6 -5
- package/Source/Scene/BufferPrimitiveCollection.js +226 -34
- package/Source/Scene/Camera.js +71 -5
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +62 -9
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/DerivedCommand.js +94 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/FrameState.js +17 -0
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/Globe.js +20 -0
- package/Source/Scene/GlobeDepth.js +27 -1
- package/Source/Scene/GlobeSurfaceShaderSet.js +42 -53
- package/Source/Scene/GlobeSurfaceTile.js +61 -10
- package/Source/Scene/GlobeSurfaceTileProvider.js +351 -26
- package/Source/Scene/GltfLoader.js +88 -9
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +188 -4
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +1 -1
- package/Source/Scene/MVTDataProvider.js +11 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +10 -8
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +250 -26
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelDrawCommand.js +160 -16
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +31 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +33 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/ModelComponents.js +71 -0
- package/Source/Scene/Picking.js +16 -5
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -1
- package/Source/Scene/PostProcessStage.js +26 -5
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +16 -13
- package/Source/Scene/Scene.js +258 -6
- package/Source/Scene/ScreenSpaceCameraController.js +1 -2
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +241 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +13 -2
- package/Source/Scene/Vector3DTileContent.js +2 -3
- package/Source/Scene/VectorGltf3DTileContent.js +31 -3
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/renderBufferPointCollection.js +1 -2
- package/Source/Scene/renderBufferPolygonCollection.js +1 -2
- package/Source/Scene/renderBufferPolylineCollection.js +6 -3
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +20 -14
- package/Source/Shaders/GlobeFS.js +20 -14
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +15 -3
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +20 -24
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +20 -24
- package/Source/Shaders/Model/ModelFS.glsl +109 -0
- package/Source/Shaders/Model/ModelFS.js +109 -0
- package/Source/Shaders/Model/ModelVS.glsl +7 -2
- package/Source/Shaders/Model/ModelVS.js +7 -2
- package/Source/Shaders/Model/ModelVectorLookupStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelVectorLookupStageFS.js +8 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.glsl +15 -0
- package/Source/Shaders/Model/ModelVectorLookupStageVS.js +17 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +9 -10
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +9 -11
- package/Source/Shaders/VectorCommon.glsl +305 -0
- package/Source/Shaders/VectorCommon.js +307 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/index.d.ts +1326 -65
- package/index.js +179 -155
- package/package.json +6 -6
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +0 -37
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +0 -39
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +0 -14
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +0 -15
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +0 -131
- package/Source/Shaders/PolygonSignedDistanceFS.js +0 -132
|
@@ -14,6 +14,8 @@ import PrimitiveType from "../Core/PrimitiveType.js";
|
|
|
14
14
|
import Quaternion from "../Core/Quaternion.js";
|
|
15
15
|
import RuntimeError from "../Core/RuntimeError.js";
|
|
16
16
|
import Sampler from "../Renderer/Sampler.js";
|
|
17
|
+
import TextureMagnificationFilter from "../Renderer/TextureMagnificationFilter.js";
|
|
18
|
+
import TextureMinificationFilter from "../Renderer/TextureMinificationFilter.js";
|
|
17
19
|
import getAccessorByteStride from "./GltfPipeline/getAccessorByteStride.js";
|
|
18
20
|
import getComponentReader from "./GltfPipeline/getComponentReader.js";
|
|
19
21
|
import numberOfComponentsForType from "./GltfPipeline/numberOfComponentsForType.js";
|
|
@@ -61,6 +63,7 @@ const {
|
|
|
61
63
|
Specular,
|
|
62
64
|
Anisotropy,
|
|
63
65
|
Clearcoat,
|
|
66
|
+
PlanarFill,
|
|
64
67
|
LineStyle,
|
|
65
68
|
Material,
|
|
66
69
|
Vector,
|
|
@@ -1569,7 +1572,41 @@ function loadIndices(
|
|
|
1569
1572
|
return indicesPlan;
|
|
1570
1573
|
}
|
|
1571
1574
|
|
|
1572
|
-
|
|
1575
|
+
/**
|
|
1576
|
+
* Returns a copy of <code>sampler</code> with its minification and magnification
|
|
1577
|
+
* filters replaced. Undefined filters keep the value already on the sampler, and
|
|
1578
|
+
* every other property, in particular the wrap modes declared by the glTF, is
|
|
1579
|
+
* carried over unchanged.
|
|
1580
|
+
*
|
|
1581
|
+
* @param {Sampler} sampler The sampler created from the glTF.
|
|
1582
|
+
* @param {TextureMinificationFilter} [minificationFilter] The minification filter to apply instead of the one on <code>sampler</code>.
|
|
1583
|
+
* @param {TextureMagnificationFilter} [magnificationFilter] The magnification filter to apply instead of the one on <code>sampler</code>.
|
|
1584
|
+
* @returns {Sampler} A sampler using the given filters and the original wrap modes.
|
|
1585
|
+
*
|
|
1586
|
+
* @private
|
|
1587
|
+
*/
|
|
1588
|
+
function overrideSamplerFilters(
|
|
1589
|
+
sampler,
|
|
1590
|
+
minificationFilter,
|
|
1591
|
+
magnificationFilter,
|
|
1592
|
+
) {
|
|
1593
|
+
return new Sampler({
|
|
1594
|
+
wrapR: sampler.wrapR,
|
|
1595
|
+
wrapS: sampler.wrapS,
|
|
1596
|
+
wrapT: sampler.wrapT,
|
|
1597
|
+
minificationFilter: minificationFilter ?? sampler.minificationFilter,
|
|
1598
|
+
magnificationFilter: magnificationFilter ?? sampler.magnificationFilter,
|
|
1599
|
+
maximumAnisotropy: sampler.maximumAnisotropy,
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
function loadTexture(
|
|
1604
|
+
loader,
|
|
1605
|
+
textureInfo,
|
|
1606
|
+
frameState,
|
|
1607
|
+
minificationFilterOverride,
|
|
1608
|
+
magnificationFilterOverride,
|
|
1609
|
+
) {
|
|
1573
1610
|
const gltf = loader.gltfJson;
|
|
1574
1611
|
const imageId = GltfLoaderUtil.getImageIdFromTexture({
|
|
1575
1612
|
gltf: gltf,
|
|
@@ -1617,9 +1654,17 @@ function loadTexture(loader, textureInfo, frameState, samplerOverride) {
|
|
|
1617
1654
|
// Save this finish callback by the loader index so it can be called
|
|
1618
1655
|
// in process().
|
|
1619
1656
|
loader._textureCallbacks[index] = () => {
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1657
|
+
const texture = textureLoader.texture;
|
|
1658
|
+
textureReader.texture = texture;
|
|
1659
|
+
if (
|
|
1660
|
+
defined(minificationFilterOverride) ||
|
|
1661
|
+
defined(magnificationFilterOverride)
|
|
1662
|
+
) {
|
|
1663
|
+
texture.sampler = overrideSamplerFilters(
|
|
1664
|
+
texture.sampler,
|
|
1665
|
+
minificationFilterOverride,
|
|
1666
|
+
magnificationFilterOverride,
|
|
1667
|
+
);
|
|
1623
1668
|
}
|
|
1624
1669
|
};
|
|
1625
1670
|
|
|
@@ -1787,6 +1832,23 @@ function loadClearcoat(loader, clearcoatInfo, frameState) {
|
|
|
1787
1832
|
return clearcoat;
|
|
1788
1833
|
}
|
|
1789
1834
|
|
|
1835
|
+
/**
|
|
1836
|
+
* Load properties for the BENTLEY_materials_planar_fill extension.
|
|
1837
|
+
*
|
|
1838
|
+
* Note: The wireframeFill property is loaded but is currently a NO-OP in the
|
|
1839
|
+
* rendering pipeline. CesiumJS does not yet have a proper wireframe rendering
|
|
1840
|
+
* mode, so this value is stored for completeness but has no effect on rendering.
|
|
1841
|
+
* See https://github.com/CesiumGS/cesium/issues/13620 and
|
|
1842
|
+
* MaterialPipelineStage.js for more details.
|
|
1843
|
+
*
|
|
1844
|
+
* @param {object} planarFillInfo The contents of the BENTLEY_materials_planar_fill extension in the parsed glTF JSON
|
|
1845
|
+
* @returns {ModelComponents.PlanarFill}
|
|
1846
|
+
* @private
|
|
1847
|
+
*/
|
|
1848
|
+
function loadPlanarFill(planarFillInfo) {
|
|
1849
|
+
return new PlanarFill(planarFillInfo);
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1790
1852
|
function loadLineStyle(lineStyleInfo) {
|
|
1791
1853
|
if (!defined(lineStyleInfo)) {
|
|
1792
1854
|
return undefined;
|
|
@@ -1833,6 +1895,7 @@ function loadMaterial(loader, gltfMaterial, frameState) {
|
|
|
1833
1895
|
const pbrAnisotropy = extensions.KHR_materials_anisotropy;
|
|
1834
1896
|
const pbrClearcoat = extensions.KHR_materials_clearcoat;
|
|
1835
1897
|
const pbrMetallicRoughness = gltfMaterial.pbrMetallicRoughness;
|
|
1898
|
+
const planarFill = extensions.BENTLEY_materials_planar_fill;
|
|
1836
1899
|
|
|
1837
1900
|
material.unlit = defined(extensions.KHR_materials_unlit);
|
|
1838
1901
|
|
|
@@ -1889,6 +1952,11 @@ function loadMaterial(loader, gltfMaterial, frameState) {
|
|
|
1889
1952
|
material.alphaCutoff = gltfMaterial.alphaCutoff;
|
|
1890
1953
|
material.doubleSided = gltfMaterial.doubleSided;
|
|
1891
1954
|
|
|
1955
|
+
// BENTLEY_materials_planar_fill extension
|
|
1956
|
+
if (defined(planarFill)) {
|
|
1957
|
+
material.planarFill = loadPlanarFill(planarFill);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1892
1960
|
// BENTLEY_materials_point_style extension
|
|
1893
1961
|
const pointStyleExtension = extensions.BENTLEY_materials_point_style;
|
|
1894
1962
|
if (defined(pointStyleExtension) && defined(pointStyleExtension.diameter)) {
|
|
@@ -1989,7 +2057,10 @@ function loadFeatureIdTexture(
|
|
|
1989
2057
|
loader,
|
|
1990
2058
|
textureInfo,
|
|
1991
2059
|
frameState,
|
|
1992
|
-
|
|
2060
|
+
// Feature ID textures require nearest sampling. Only the filters are
|
|
2061
|
+
// overridden so the wrap modes declared by the glTF are preserved.
|
|
2062
|
+
TextureMinificationFilter.NEAREST,
|
|
2063
|
+
TextureMagnificationFilter.NEAREST,
|
|
1993
2064
|
);
|
|
1994
2065
|
|
|
1995
2066
|
// Though the new channel index is more future-proof, this implementation
|
|
@@ -2024,7 +2095,10 @@ function loadFeatureIdTextureLegacy(
|
|
|
2024
2095
|
loader,
|
|
2025
2096
|
textureInfo,
|
|
2026
2097
|
frameState,
|
|
2027
|
-
|
|
2098
|
+
// Feature ID textures require nearest sampling. Only the filters are
|
|
2099
|
+
// overridden so the wrap modes declared by the glTF are preserved.
|
|
2100
|
+
TextureMinificationFilter.NEAREST,
|
|
2101
|
+
TextureMagnificationFilter.NEAREST,
|
|
2028
2102
|
);
|
|
2029
2103
|
|
|
2030
2104
|
featureIdTexture.textureReader.channels = featureIds.channels;
|
|
@@ -2156,7 +2230,7 @@ function loadEdgeVisibilityLineStrings(
|
|
|
2156
2230
|
throw new RuntimeError("Edge visibility line string accessor not found!");
|
|
2157
2231
|
}
|
|
2158
2232
|
|
|
2159
|
-
const indices =
|
|
2233
|
+
const indices = loadAccessorTypedArray(loader, accessor);
|
|
2160
2234
|
const restartIndex = getLineStringPrimitiveRestartValue(
|
|
2161
2235
|
accessor.componentType,
|
|
2162
2236
|
);
|
|
@@ -2188,7 +2262,10 @@ function loadEdgeVisibility(loader, edgeVisibilityExtension) {
|
|
|
2188
2262
|
if (!defined(visibilityAccessor)) {
|
|
2189
2263
|
throw new RuntimeError("Edge visibility accessor not found!");
|
|
2190
2264
|
}
|
|
2191
|
-
edgeVisibility.visibility =
|
|
2265
|
+
edgeVisibility.visibility = loadAccessorTypedArray(
|
|
2266
|
+
loader,
|
|
2267
|
+
visibilityAccessor,
|
|
2268
|
+
);
|
|
2192
2269
|
}
|
|
2193
2270
|
|
|
2194
2271
|
edgeVisibility.materialColor = getEdgeVisibilityMaterialColor(
|
|
@@ -2200,7 +2277,9 @@ function loadEdgeVisibility(loader, edgeVisibilityExtension) {
|
|
|
2200
2277
|
const silhouetteNormalsAccessor =
|
|
2201
2278
|
loader.gltfJson.accessors[edgeVisibilityExtension.silhouetteNormals];
|
|
2202
2279
|
if (defined(silhouetteNormalsAccessor)) {
|
|
2203
|
-
|
|
2280
|
+
// Packed typed array (x0,y0,z0, x1,y1,z1, ...), not an array of
|
|
2281
|
+
// Cartesian3s. Avoids a large JS heap cost for edge-heavy tiles.
|
|
2282
|
+
edgeVisibility.silhouetteNormals = loadAccessorTypedArray(
|
|
2204
2283
|
loader,
|
|
2205
2284
|
silhouetteNormalsAccessor,
|
|
2206
2285
|
);
|
|
@@ -267,7 +267,7 @@ async function loadResources(loader) {
|
|
|
267
267
|
try {
|
|
268
268
|
const bufferViewLoader = resourceCache.getBufferViewLoader({
|
|
269
269
|
gltf: loader._gltf,
|
|
270
|
-
bufferViewId:
|
|
270
|
+
bufferViewId: loader._spz.bufferView,
|
|
271
271
|
gltfResource: loader._gltfResource,
|
|
272
272
|
baseResource: loader._baseResource,
|
|
273
273
|
});
|
|
@@ -29,6 +29,7 @@ class GltfVertexBufferLoader extends ResourceLoader {
|
|
|
29
29
|
* @param {number} [options.bufferViewId] The bufferView ID corresponding to the vertex buffer.
|
|
30
30
|
* @param {object} [options.primitive] The primitive containing the Draco extension.
|
|
31
31
|
* @param {object} [options.draco] The Draco extension object.
|
|
32
|
+
* @param {object} [options.spz] The SPZ extension object.
|
|
32
33
|
* @param {string} [options.attributeSemantic] The attribute semantic, e.g. POSITION or NORMAL.
|
|
33
34
|
* @param {number} [options.accessorId] The accessor id.
|
|
34
35
|
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
@@ -36,7 +37,7 @@ class GltfVertexBufferLoader extends ResourceLoader {
|
|
|
36
37
|
* @param {boolean} [options.loadBuffer=false] Load vertex buffer as a GPU vertex buffer.
|
|
37
38
|
* @param {boolean} [options.loadTypedArray=false] Load vertex buffer as a typed array.
|
|
38
39
|
*
|
|
39
|
-
* @exception {DeveloperError}
|
|
40
|
+
* @exception {DeveloperError} Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.
|
|
40
41
|
* @exception {DeveloperError} When options.draco is defined options.attributeSemantic must also be defined.
|
|
41
42
|
* @exception {DeveloperError} When options.draco is defined options.accessorId must also be defined.
|
|
42
43
|
*/
|
|
@@ -76,9 +77,11 @@ class GltfVertexBufferLoader extends ResourceLoader {
|
|
|
76
77
|
const hasAttributeSemantic = defined(attributeSemantic);
|
|
77
78
|
const hasAccessorId = defined(accessorId);
|
|
78
79
|
const hasSpz = defined(spz);
|
|
79
|
-
|
|
80
|
+
const sourceCount =
|
|
81
|
+
Number(hasBufferViewId) + Number(hasDraco) + Number(hasSpz);
|
|
82
|
+
if (sourceCount !== 1) {
|
|
80
83
|
throw new DeveloperError(
|
|
81
|
-
"
|
|
84
|
+
"Exactly one vertex buffer source must be effective: options.bufferViewId, options.spz, or options.draco for options.attributeSemantic.",
|
|
82
85
|
);
|
|
83
86
|
}
|
|
84
87
|
|
|
@@ -408,7 +408,7 @@ I3SDataProvider.prototype.updateForPass = function (frameState, passState) {
|
|
|
408
408
|
function buildLayerUrl(provider, layerId) {
|
|
409
409
|
const dataProviderUrl = provider.resource.getUrlComponent();
|
|
410
410
|
|
|
411
|
-
let layerUrl
|
|
411
|
+
let layerUrl;
|
|
412
412
|
if (dataProviderUrl.match(/layers\/\d/)) {
|
|
413
413
|
layerUrl = `${dataProviderUrl}`.replace(/\/+$/, "");
|
|
414
414
|
} else {
|
package/Source/Scene/I3SLayer.js
CHANGED
|
@@ -31,7 +31,7 @@ function I3SLayer(dataProvider, layerData, parent) {
|
|
|
31
31
|
|
|
32
32
|
const parentUrl = this._parent.resource.getUrlComponent();
|
|
33
33
|
|
|
34
|
-
let tilesetUrl
|
|
34
|
+
let tilesetUrl;
|
|
35
35
|
if (parentUrl.match(/layers\/\d/)) {
|
|
36
36
|
tilesetUrl = `${parentUrl}`.replace(/\/+$/, "");
|
|
37
37
|
} else {
|
package/Source/Scene/I3SNode.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import defined from "../Core/defined.js";
|
|
2
|
+
import Cartesian2 from "../Core/Cartesian2.js";
|
|
3
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
2
4
|
import destroyObject from "../Core/destroyObject.js";
|
|
3
5
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
4
6
|
import Event from "../Core/Event.js";
|
|
7
|
+
import GeographicProjection from "../Core/GeographicProjection.js";
|
|
5
8
|
import CesiumMath from "../Core/Math.js";
|
|
6
9
|
import Rectangle from "../Core/Rectangle.js";
|
|
7
10
|
import ImageryLayer from "./ImageryLayer.js";
|
|
11
|
+
import ImageryState from "./ImageryState.js";
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* An ordered collection of imagery layers for rendering raster imagery on a {@link Globe} or {@link Cesium3DTileset}.
|
|
@@ -452,6 +456,152 @@ ImageryLayerCollection.prototype.pickImageryLayers = function (ray, scene) {
|
|
|
452
456
|
return imageryLayers;
|
|
453
457
|
};
|
|
454
458
|
|
|
459
|
+
const nativeBoundingRectangleScratch = new Rectangle();
|
|
460
|
+
const nativeApplicableRectangleScratch = new Rectangle();
|
|
461
|
+
const southwestNativeScratch = new Cartesian2();
|
|
462
|
+
const northeastNativeScratch = new Cartesian2();
|
|
463
|
+
const southwestCartographicScratch = new Cartographic();
|
|
464
|
+
const northeastCartographicScratch = new Cartographic();
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Maps a texture coordinate rectangle (UV space on the primitive) back to a
|
|
468
|
+
* geographic rectangle, using the primitive cartographic bounds and the
|
|
469
|
+
* imagery tiling scheme's native coordinates.
|
|
470
|
+
*
|
|
471
|
+
* @private
|
|
472
|
+
*/
|
|
473
|
+
|
|
474
|
+
function computeApplicableGeographicRectangle(
|
|
475
|
+
cartographicBoundingRectangle,
|
|
476
|
+
textureCoordinateRectangle,
|
|
477
|
+
imageryLayer,
|
|
478
|
+
result,
|
|
479
|
+
) {
|
|
480
|
+
const tilingScheme = imageryLayer.imageryProvider.tilingScheme;
|
|
481
|
+
const nativeBoundingRectangle = tilingScheme.rectangleToNativeRectangle(
|
|
482
|
+
cartographicBoundingRectangle,
|
|
483
|
+
nativeBoundingRectangleScratch,
|
|
484
|
+
);
|
|
485
|
+
|
|
486
|
+
const epsilon = 1 / 1024; // 1/4 of a pixel in a typical 256x256 tile.
|
|
487
|
+
const applicableNative = nativeApplicableRectangleScratch;
|
|
488
|
+
applicableNative.west = CesiumMath.lerp(
|
|
489
|
+
nativeBoundingRectangle.west,
|
|
490
|
+
nativeBoundingRectangle.east,
|
|
491
|
+
textureCoordinateRectangle.minX - epsilon,
|
|
492
|
+
);
|
|
493
|
+
applicableNative.east = CesiumMath.lerp(
|
|
494
|
+
nativeBoundingRectangle.west,
|
|
495
|
+
nativeBoundingRectangle.east,
|
|
496
|
+
textureCoordinateRectangle.maxX + epsilon,
|
|
497
|
+
);
|
|
498
|
+
applicableNative.south = CesiumMath.lerp(
|
|
499
|
+
nativeBoundingRectangle.south,
|
|
500
|
+
nativeBoundingRectangle.north,
|
|
501
|
+
textureCoordinateRectangle.minY - epsilon,
|
|
502
|
+
);
|
|
503
|
+
applicableNative.north = CesiumMath.lerp(
|
|
504
|
+
nativeBoundingRectangle.south,
|
|
505
|
+
nativeBoundingRectangle.north,
|
|
506
|
+
textureCoordinateRectangle.maxY + epsilon,
|
|
507
|
+
);
|
|
508
|
+
|
|
509
|
+
if (!defined(result)) {
|
|
510
|
+
result = new Rectangle();
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const projection = tilingScheme.projection;
|
|
514
|
+
if (projection instanceof GeographicProjection) {
|
|
515
|
+
result.west = CesiumMath.toRadians(applicableNative.west);
|
|
516
|
+
result.south = CesiumMath.toRadians(applicableNative.south);
|
|
517
|
+
result.east = CesiumMath.toRadians(applicableNative.east);
|
|
518
|
+
result.north = CesiumMath.toRadians(applicableNative.north);
|
|
519
|
+
return result;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
southwestNativeScratch.x = applicableNative.west;
|
|
523
|
+
southwestNativeScratch.y = applicableNative.south;
|
|
524
|
+
northeastNativeScratch.x = applicableNative.east;
|
|
525
|
+
northeastNativeScratch.y = applicableNative.north;
|
|
526
|
+
|
|
527
|
+
const southwest = projection.unproject(
|
|
528
|
+
southwestNativeScratch,
|
|
529
|
+
southwestCartographicScratch,
|
|
530
|
+
);
|
|
531
|
+
const northeast = projection.unproject(
|
|
532
|
+
northeastNativeScratch,
|
|
533
|
+
northeastCartographicScratch,
|
|
534
|
+
);
|
|
535
|
+
result.west = southwest.longitude;
|
|
536
|
+
result.south = southwest.latitude;
|
|
537
|
+
result.east = northeast.longitude;
|
|
538
|
+
result.north = northeast.latitude;
|
|
539
|
+
return result;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function pickModelFeatures(model, pickedLocation, callback) {
|
|
543
|
+
const modelImagery = model._modelImagery;
|
|
544
|
+
|
|
545
|
+
if (!defined(modelImagery)) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const modelPrimitiveImageries = modelImagery._modelPrimitiveImageries;
|
|
550
|
+
|
|
551
|
+
if (!defined(modelPrimitiveImageries)) {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
for (let j = 0; j < modelPrimitiveImageries.length; j++) {
|
|
556
|
+
const modelPrimitiveImagery = modelPrimitiveImageries[j];
|
|
557
|
+
const coveragesPerLayer = modelPrimitiveImagery._coveragesPerLayer;
|
|
558
|
+
if (!defined(coveragesPerLayer)) {
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
for (let k = coveragesPerLayer.length - 1; k >= 0; --k) {
|
|
563
|
+
const coverages = coveragesPerLayer[k];
|
|
564
|
+
|
|
565
|
+
for (let l = 0; l < coverages.length; l++) {
|
|
566
|
+
const coverage = coverages[l];
|
|
567
|
+
const imagery = coverage.imagery;
|
|
568
|
+
const imageryLayer = imagery.imageryLayer;
|
|
569
|
+
const provider = imageryLayer.imageryProvider;
|
|
570
|
+
|
|
571
|
+
if (!defined(provider.pickFeatures)) {
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
if (!defined(imagery) || imagery.state !== ImageryState.READY) {
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
if (!Rectangle.contains(imagery.rectangle, pickedLocation)) {
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
const mappedPositions =
|
|
584
|
+
modelPrimitiveImagery.mappedPositionsForImageryLayer(imageryLayer);
|
|
585
|
+
const cartographicBoundingRectangle =
|
|
586
|
+
mappedPositions.cartographicBoundingRectangle;
|
|
587
|
+
|
|
588
|
+
const applicableRectangle = computeApplicableGeographicRectangle(
|
|
589
|
+
cartographicBoundingRectangle,
|
|
590
|
+
coverage.textureCoordinateRectangle,
|
|
591
|
+
imageryLayer,
|
|
592
|
+
applicableRectangleScratch,
|
|
593
|
+
);
|
|
594
|
+
|
|
595
|
+
if (!Rectangle.contains(applicableRectangle, pickedLocation)) {
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
callback(imagery);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
455
605
|
/**
|
|
456
606
|
* Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
|
|
457
607
|
* layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
|
|
@@ -485,9 +635,30 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
485
635
|
scene,
|
|
486
636
|
) {
|
|
487
637
|
// Find the picked location on the globe.
|
|
488
|
-
|
|
638
|
+
let pickedPosition;
|
|
639
|
+
|
|
640
|
+
if (defined(scene.globe)) {
|
|
641
|
+
pickedPosition = scene.globe.pick(ray, scene);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
let pickedModel;
|
|
645
|
+
|
|
489
646
|
if (!defined(pickedPosition)) {
|
|
490
|
-
|
|
647
|
+
const result = scene.pickFromRay(ray);
|
|
648
|
+
|
|
649
|
+
if (!defined(result)) {
|
|
650
|
+
return undefined;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
pickedPosition = result.position;
|
|
654
|
+
|
|
655
|
+
if (!defined(pickedPosition)) {
|
|
656
|
+
return undefined;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (defined(result.object) && defined(result.object.detail)) {
|
|
660
|
+
pickedModel = result.object.detail.model;
|
|
661
|
+
}
|
|
491
662
|
}
|
|
492
663
|
|
|
493
664
|
const pickedLocation =
|
|
@@ -496,7 +667,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
496
667
|
const promises = [];
|
|
497
668
|
const imageryLayers = [];
|
|
498
669
|
|
|
499
|
-
|
|
670
|
+
function queuePickFeatures(imagery) {
|
|
500
671
|
if (!imagery.imageryLayer.ready) {
|
|
501
672
|
return undefined;
|
|
502
673
|
}
|
|
@@ -512,11 +683,24 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
512
683
|
promises.push(promise);
|
|
513
684
|
imageryLayers.push(imagery.imageryLayer);
|
|
514
685
|
}
|
|
515
|
-
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (defined(scene.globe)) {
|
|
689
|
+
pickImageryHelper(scene, pickedLocation, true, function (imagery) {
|
|
690
|
+
queuePickFeatures(imagery);
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (defined(pickedModel)) {
|
|
695
|
+
pickModelFeatures(pickedModel, pickedLocation, function (imagery) {
|
|
696
|
+
queuePickFeatures(imagery);
|
|
697
|
+
});
|
|
698
|
+
}
|
|
516
699
|
|
|
517
700
|
if (promises.length === 0) {
|
|
518
701
|
return undefined;
|
|
519
702
|
}
|
|
703
|
+
|
|
520
704
|
return Promise.all(promises).then(function (results) {
|
|
521
705
|
const features = [];
|
|
522
706
|
for (let resultIndex = 0; resultIndex < results.length; ++resultIndex) {
|
|
@@ -26,17 +26,13 @@ import IonImageryProviderFactory from "./IonImageryProviderFactory.js";
|
|
|
26
26
|
* @alias IonImageryProvider
|
|
27
27
|
* @constructor
|
|
28
28
|
*
|
|
29
|
-
* @param {IonImageryProvider.ConstructorOptions} [options] Object describing initialization options
|
|
30
|
-
*
|
|
31
29
|
* @example
|
|
32
30
|
* const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
|
|
33
31
|
* viewer.imageryLayers.add(imageryLayer);
|
|
34
32
|
*
|
|
35
33
|
* @see IonImageryProvider.fromAssetId
|
|
36
34
|
*/
|
|
37
|
-
function IonImageryProvider(
|
|
38
|
-
options = options ?? Frozen.EMPTY_OBJECT;
|
|
39
|
-
|
|
35
|
+
function IonImageryProvider() {
|
|
40
36
|
this._defaultAlpha = undefined;
|
|
41
37
|
this._defaultNightAlpha = undefined;
|
|
42
38
|
this._defaultDayAlpha = undefined;
|
package/Source/Scene/Label.js
CHANGED
|
@@ -1282,10 +1282,10 @@ Label.getScreenSpaceBoundingBox = function (
|
|
|
1282
1282
|
screenSpacePosition,
|
|
1283
1283
|
result,
|
|
1284
1284
|
) {
|
|
1285
|
-
let x
|
|
1286
|
-
let y
|
|
1287
|
-
let width
|
|
1288
|
-
let height
|
|
1285
|
+
let x;
|
|
1286
|
+
let y;
|
|
1287
|
+
let width;
|
|
1288
|
+
let height;
|
|
1289
1289
|
const scale = label.totalScale;
|
|
1290
1290
|
|
|
1291
1291
|
const backgroundBillboard = label._backgroundBillboard;
|
|
@@ -335,7 +335,7 @@ function updateBackgroundBillboard(
|
|
|
335
335
|
// Label is shown and background is hidden - remove the background billboard
|
|
336
336
|
if (label.show && !showBackground) {
|
|
337
337
|
backgroundBillboardCollection.remove(backgroundBillboard);
|
|
338
|
-
label._backgroundBillboard =
|
|
338
|
+
label._backgroundBillboard = undefined;
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
|
|
@@ -12,8 +12,10 @@ import defined from "../Core/defined.js";
|
|
|
12
12
|
|
|
13
13
|
/** @import Cesium3DTile from "./Cesium3DTile.js"; */
|
|
14
14
|
/** @import Cesium3DTileset from "./Cesium3DTileset.js"; */
|
|
15
|
+
/** @import HeightReference from "./HeightReference.js"; */
|
|
15
16
|
/** @import Rectangle from "../Core/Rectangle.js"; */
|
|
16
17
|
/** @import Resource from "../Core/Resource.js"; */
|
|
18
|
+
/** @import Scene from "./Scene.js"; */
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* A Mapbox Vector Tiles (MVT) data provider. Loads .mvt or .pbf tiles, converting tiles
|
|
@@ -23,6 +25,7 @@ import defined from "../Core/defined.js";
|
|
|
23
25
|
* This object is normally not instantiated directly, use {@link MVTDataProvider.fromUrl}.
|
|
24
26
|
* </div>
|
|
25
27
|
*
|
|
28
|
+
* @extends UrlTemplate3DTilesDataProvider
|
|
26
29
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
27
30
|
*/
|
|
28
31
|
class MVTDataProvider extends UrlTemplate3DTilesDataProvider {
|
|
@@ -35,6 +38,13 @@ class MVTDataProvider extends UrlTemplate3DTilesDataProvider {
|
|
|
35
38
|
* @param {number} [options.maxZoom=14] Maximum zoom level represented in the generated tileset.
|
|
36
39
|
* @param {Rectangle} [options.extent] Optional geographic extent in radians to constrain the generated tile tree.
|
|
37
40
|
* @param {string} [options.featureIdProperty] MVT property name to use as feature ID.
|
|
41
|
+
* @param {HeightReference} [options.heightReference] Drapes the decoded points, lines and polygons onto the
|
|
42
|
+
* surfaces selected by the value: {@link HeightReference.CLAMP_TO_TERRAIN} drapes onto the globe,
|
|
43
|
+
* {@link HeightReference.CLAMP_TO_3D_TILE} drapes onto 3D Tiles and models, and
|
|
44
|
+
* {@link HeightReference.CLAMP_TO_GROUND} drapes onto both. Requires <code>options.scene</code>.
|
|
45
|
+
* @param {Scene} [options.scene] The scene the generated tileset is rendered in, required when
|
|
46
|
+
* <code>options.heightReference</code> is a clamping value.
|
|
47
|
+
* @returns {Promise<MVTDataProvider>}
|
|
38
48
|
*/
|
|
39
49
|
static async fromUrl(url, options) {
|
|
40
50
|
return /** @type {Promise<MVTDataProvider>} */ (
|
|
@@ -49,6 +59,7 @@ class MVTDataProvider extends UrlTemplate3DTilesDataProvider {
|
|
|
49
59
|
*/
|
|
50
60
|
_createTilesetLoadOptions() {
|
|
51
61
|
return {
|
|
62
|
+
...super._createTilesetLoadOptions(),
|
|
52
63
|
skipLevelOfDetail: false,
|
|
53
64
|
enablePick: true,
|
|
54
65
|
featureIdLabel: "featureId_0",
|
|
@@ -163,7 +163,6 @@ class B3dmLoader extends ResourceLoader {
|
|
|
163
163
|
|
|
164
164
|
const b3dm = B3dmParser.parse(this._arrayBuffer, this._byteOffset);
|
|
165
165
|
|
|
166
|
-
let batchLength = b3dm.batchLength;
|
|
167
166
|
const featureTableJson = b3dm.featureTableJson;
|
|
168
167
|
const featureTableBinary = b3dm.featureTableBinary;
|
|
169
168
|
const batchTableJson = b3dm.batchTableJson;
|
|
@@ -173,7 +172,7 @@ class B3dmLoader extends ResourceLoader {
|
|
|
173
172
|
featureTableJson,
|
|
174
173
|
featureTableBinary,
|
|
175
174
|
);
|
|
176
|
-
batchLength = featureTable.getGlobalProperty("BATCH_LENGTH");
|
|
175
|
+
const batchLength = featureTable.getGlobalProperty("BATCH_LENGTH");
|
|
177
176
|
// Set batch length.
|
|
178
177
|
this._batchLength = batchLength;
|
|
179
178
|
// Set the RTC Center transform, if present.
|
|
@@ -276,15 +276,17 @@ function generateEdgeFaceNormals(edgeIndices, edgeData, edgeVisibility) {
|
|
|
276
276
|
// No silhouette edges in this primitive, the shader only checks normals for SILHOUETTE edges.
|
|
277
277
|
return edgeFaceNormals;
|
|
278
278
|
}
|
|
279
|
-
|
|
279
|
+
// raw is a packed typed array (x0,y0,z0, x1,y1,z1, ...) of float, byte, or
|
|
280
|
+
// short components. The vectors are normalized below, which cancels the
|
|
281
|
+
// quantization scale, so raw components can be used directly for all three.
|
|
282
|
+
const normalCount = raw.length / 3;
|
|
283
|
+
const silhouetteNormalsFloat = new Float32Array(raw.length);
|
|
280
284
|
const scratchNormal = new Cartesian3();
|
|
281
285
|
|
|
282
|
-
for (let i = 0; i <
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
scratchNormal.
|
|
286
|
-
scratchNormal.y = 2 * ((vec3.y + 128) / 255) - 1;
|
|
287
|
-
scratchNormal.z = 2 * ((vec3.z + 128) / 255) - 1;
|
|
286
|
+
for (let i = 0; i < normalCount; i++) {
|
|
287
|
+
scratchNormal.x = raw[i * 3];
|
|
288
|
+
scratchNormal.y = raw[i * 3 + 1];
|
|
289
|
+
scratchNormal.z = raw[i * 3 + 2];
|
|
288
290
|
|
|
289
291
|
if (Cartesian3.magnitudeSquared(scratchNormal) > 0) {
|
|
290
292
|
Cartesian3.normalize(scratchNormal, scratchNormal);
|
|
@@ -609,7 +611,7 @@ function collectVertexColors(runtimePrimitive) {
|
|
|
609
611
|
* @param {number} edgeOtherPosLocation Shader attribute location for the other endpoint position
|
|
610
612
|
* @param {number} edgeOffsetLocation Shader attribute location for edge offset (-1 or +1)
|
|
611
613
|
* @param {VertexColorInfo} [vertexColorInfo] Packed per-vertex colors (optional)
|
|
612
|
-
* @param {Object} edgeVisibility Edge visibility extension object (may contain silhouetteNormals
|
|
614
|
+
* @param {Object} edgeVisibility Edge visibility extension object (may contain silhouetteNormals, a packed typed array of VEC3 components)
|
|
613
615
|
* @param {Float32Array} edgeFaceNormals Packed face normals (6 floats per edge)
|
|
614
616
|
* @param {Object} [cumDistAttribute] Cumulative distance attribute
|
|
615
617
|
* @param {number} [edgeCumDistLocation] Cumulative distance location
|
|
@@ -407,7 +407,7 @@ function createInstances(loader, components, frameState) {
|
|
|
407
407
|
const featureIdArray = new Float32Array(instancesLength);
|
|
408
408
|
|
|
409
409
|
const instancePositions = Cartesian3.unpackArray(translationTypedArray);
|
|
410
|
-
let instancePosition
|
|
410
|
+
let instancePosition;
|
|
411
411
|
|
|
412
412
|
const instanceNormalRight = new Cartesian3();
|
|
413
413
|
const instanceNormalUp = new Cartesian3();
|