@cesium/engine 26.2.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 +656 -518
- package/Build/Workers/{chunk-FU4BGABC.js → chunk-2DKJSPYF.js} +14 -14
- package/Build/Workers/{chunk-NCL22ZUX.js → chunk-2PWVICP6.js} +1 -1
- package/Build/Workers/{chunk-ILME5BXA.js → chunk-2YY724ZX.js} +8 -8
- package/Build/Workers/{chunk-IJZJMIUY.js → chunk-4DMAXPKB.js} +11 -11
- package/Build/Workers/{chunk-IMBVP57H.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-UAZUP4I5.js → chunk-6BSNYZZG.js} +5 -5
- package/Build/Workers/{chunk-D6AY775A.js → chunk-6R6SGKYN.js} +6 -6
- package/Build/Workers/{chunk-3PSS3T43.js → chunk-6V2KDEHL.js} +4 -4
- package/Build/Workers/{chunk-GHXVQVUM.js → chunk-75BC2IHI.js} +7 -7
- package/Build/Workers/{chunk-SMTGMFBL.js → chunk-7SESBH2I.js} +4 -4
- package/Build/Workers/{chunk-NEFDMMLY.js → chunk-7WXBTNRV.js} +8 -8
- package/Build/Workers/{chunk-NXGQBQWE.js → chunk-A7SMPV6B.js} +12 -12
- package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-ATSXKJ3L.js} +7 -7
- package/Build/Workers/{chunk-AHWAZRBV.js → chunk-B4AVL7VI.js} +1 -1
- package/Build/Workers/{chunk-OZGPS7FB.js → chunk-B7Q2WF6Q.js} +4 -4
- package/Build/Workers/{chunk-2RGJPWQX.js → chunk-BNDSDQ7D.js} +9 -9
- package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-CKK6CUXK.js} +6 -6
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-COKOYTRS.js} +5 -5
- package/Build/Workers/{chunk-6FZDPMTO.js → chunk-CQ4TZXAT.js} +6 -6
- package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-DKSANM4A.js} +12 -12
- package/Build/Workers/{chunk-XCBZVTIV.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-NSKZ6SBK.js → chunk-F34TJJLA.js} +14 -14
- package/Build/Workers/{chunk-GXWQZBAI.js → chunk-GLHDTTTO.js} +2 -2
- package/Build/Workers/{chunk-SJYSIOEM.js → chunk-GS7RY2DH.js} +11 -11
- package/Build/Workers/{chunk-5YPQBFRD.js → chunk-HDD3RFLT.js} +3 -3
- package/Build/Workers/{chunk-36NI5E6W.js → chunk-HDPNFEPP.js} +18 -18
- package/Build/Workers/{chunk-DSGLDRTI.js → chunk-JBJ6BRIM.js} +4 -4
- package/Build/Workers/{chunk-DZUFEE4L.js → chunk-JKTWW7IO.js} +5 -5
- package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-JL4NWWQY.js} +5 -5
- package/Build/Workers/{chunk-I74ZH5LK.js → chunk-JMUUAW4X.js} +10 -10
- package/Build/Workers/{chunk-SXSP3JHS.js → chunk-KBGAHN5R.js} +1 -1
- package/Build/Workers/{chunk-GVA7XQI2.js → chunk-KEWK6VZL.js} +12 -12
- package/Build/Workers/{chunk-EOWDZN5S.js → chunk-L73K5UPP.js} +10 -10
- package/Build/Workers/{chunk-J73T2VOY.js → chunk-LL2SGJYH.js} +6 -6
- package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-LYJUL4XQ.js} +6 -6
- package/Build/Workers/{chunk-MAAHFYPC.js → chunk-M6W46OAP.js} +7 -7
- package/Build/Workers/{chunk-FX3VEAIU.js → chunk-MDDKCLMF.js} +16 -16
- package/Build/Workers/{chunk-M6QKXVAU.js → chunk-MUW4DJV7.js} +17 -17
- package/Build/Workers/{chunk-EZGQPOIG.js → chunk-N5YK44FS.js} +5 -5
- package/Build/Workers/{chunk-27FWRTJI.js → chunk-NZQUP52G.js} +9 -9
- package/Build/Workers/{chunk-A62YI6S6.js → chunk-PKZA44LH.js} +4 -4
- package/Build/Workers/{chunk-7MM3N2VE.js → chunk-Q2JS5LCB.js} +17 -17
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-QTAEVUED.js} +13 -13
- package/Build/Workers/{chunk-KP5QD7WU.js → chunk-SEJIXZZ4.js} +10 -10
- package/Build/Workers/{chunk-PRWUMCXF.js → chunk-SL2HCFYW.js} +10 -10
- package/Build/Workers/{chunk-NJVBJG63.js → chunk-SLHK3KAR.js} +5 -5
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-UZY5XRL2.js} +1 -1
- package/Build/Workers/{chunk-LDRQSYBN.js → chunk-VRECSMG3.js} +2 -2
- package/Build/Workers/{chunk-NLLCQBX3.js → chunk-X27HKF5E.js} +2 -2
- package/Build/Workers/{chunk-B3QHNA4A.js → chunk-XBY3354M.js} +6 -6
- package/Build/Workers/{chunk-CRCGE4J4.js → chunk-XRZCS3HE.js} +8 -8
- package/Build/Workers/{chunk-XLQZNQ4Z.js → chunk-XSIUYAT6.js} +2 -2
- package/Build/Workers/{chunk-SA2A2AN5.js → chunk-Z2DW5NM2.js} +4 -4
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +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/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/SnapService.js +63 -0
- package/Source/Core/VectorPipeline.js +139 -45
- package/Source/Core/VectorProvider.js +311 -71
- package/Source/Renderer/AutomaticUniforms.js +44 -2
- package/Source/Renderer/ShaderBuilder.js +1 -1
- package/Source/Renderer/UniformState.js +47 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- 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 +199 -29
- package/Source/Scene/Cesium3DTile.js +12 -0
- package/Source/Scene/Cesium3DTileset.js +61 -8
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +15 -3
- package/Source/Scene/Cesium3DTilesetCache.js +15 -0
- package/Source/Scene/ClippingPolygon.js +154 -100
- package/Source/Scene/ClippingPolygonCollection.js +352 -694
- package/Source/Scene/CreditDisplay.js +62 -0
- package/Source/Scene/GeoJsonPrimitive.js +114 -24
- package/Source/Scene/GlobeSurfaceShaderSet.js +33 -54
- package/Source/Scene/GlobeSurfaceTile.js +14 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +232 -25
- package/Source/Scene/GltfLoader.js +56 -6
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/MVTDataProvider.js +9 -0
- package/Source/Scene/Model/Model.js +242 -16
- package/Source/Scene/Model/Model3DTileContent.js +5 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +54 -19
- package/Source/Scene/Model/ModelRenderResources.js +2 -3
- package/Source/Scene/Model/ModelSceneGraph.js +10 -1
- package/Source/Scene/Model/ModelVectorLookupPipelineStage.js +205 -0
- package/Source/Scene/Model/PickingPipelineStage.js +4 -0
- package/Source/Scene/PostProcessStage.js +22 -3
- package/Source/Scene/Scene.js +56 -1
- package/Source/Scene/Snapping.js +57 -0
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +12 -1
- package/Source/Scene/VectorGltf3DTileContent.js +10 -2
- package/Source/Scene/WebMapServiceImageryProvider.js +5 -1
- package/Source/Scene/WebMapTileServiceImageryProvider.js +6 -1
- package/Source/Scene/renderBufferPolylineCollection.js +5 -1
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +14 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +14 -2
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -4
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.glsl +74 -0
- package/Source/Shaders/Builtin/Functions/eyeToCartographicDelta.js +76 -0
- package/Source/Shaders/GlobeFS.glsl +10 -9
- package/Source/Shaders/GlobeFS.js +11 -9
- package/Source/Shaders/GlobeVS.glsl +0 -32
- package/Source/Shaders/GlobeVS.js +0 -32
- 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 +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -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 +177 -50
- package/Source/Shaders/VectorCommon.js +251 -19
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/index.d.ts +556 -55
- package/index.js +20 -13
- package/package.json +6 -6
- package/Build/Workers/chunk-2EFYUSUY.js +0 -1483
- package/Build/Workers/chunk-2H5264K7.js +0 -1284
- package/Build/Workers/chunk-2H73KDBM.js +0 -511
- package/Build/Workers/chunk-2ZKH2QZB.js +0 -387
- package/Build/Workers/chunk-37SW7SYS.js +0 -778
- package/Build/Workers/chunk-3GHVJ3SO.js +0 -455
- package/Build/Workers/chunk-3LB4UVPU.js +0 -387
- package/Build/Workers/chunk-3PONLKEL.js +0 -778
- package/Build/Workers/chunk-3QR662HH.js +0 -3820
- package/Build/Workers/chunk-3SX2WYSO.js +0 -973
- package/Build/Workers/chunk-3UDN6LYX.js +0 -476
- package/Build/Workers/chunk-47MCBSXI.js +0 -9237
- package/Build/Workers/chunk-4E626OCE.js +0 -1067
- package/Build/Workers/chunk-4NW2MJKH.js +0 -455
- package/Build/Workers/chunk-52YK5BSN.js +0 -198
- package/Build/Workers/chunk-5RNAQZK6.js +0 -9234
- package/Build/Workers/chunk-6FHT43QR.js +0 -140
- package/Build/Workers/chunk-6HK6IXK2.js +0 -138
- package/Build/Workers/chunk-6R5X2GUA.js +0 -1284
- package/Build/Workers/chunk-6YR6JBMY.js +0 -163
- package/Build/Workers/chunk-7A2OGDHT.js +0 -305
- package/Build/Workers/chunk-7CGEQUM2.js +0 -305
- package/Build/Workers/chunk-7D2HZKH7.js +0 -455
- package/Build/Workers/chunk-7I325HV6.js +0 -1344
- package/Build/Workers/chunk-7KVKHY7O.js +0 -147
- package/Build/Workers/chunk-7TKLTCZW.js +0 -219
- package/Build/Workers/chunk-7UUKBDH6.js +0 -1054
- package/Build/Workers/chunk-7W6DUHAB.js +0 -693
- package/Build/Workers/chunk-7XM5JK5F.js +0 -162
- package/Build/Workers/chunk-7YG3ND3P.js +0 -454
- package/Build/Workers/chunk-A3O6EDBK.js +0 -73
- package/Build/Workers/chunk-A6X24AZI.js +0 -1992
- package/Build/Workers/chunk-A7TTWVTF.js +0 -2719
- package/Build/Workers/chunk-ACTVJHSP.js +0 -519
- package/Build/Workers/chunk-ADX3CBKD.js +0 -9234
- package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
- package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
- package/Build/Workers/chunk-ARZICEEP.js +0 -301
- package/Build/Workers/chunk-B4CQSLZJ.js +0 -305
- package/Build/Workers/chunk-BKPQFCXH.js +0 -511
- package/Build/Workers/chunk-BSPCI2LO.js +0 -959
- package/Build/Workers/chunk-BUJWSX5S.js +0 -301
- package/Build/Workers/chunk-C7JQVRLM.js +0 -497
- package/Build/Workers/chunk-C7QDUNI3.js +0 -138
- package/Build/Workers/chunk-CDJDJ5LK.js +0 -44
- package/Build/Workers/chunk-CEEZE3YZ.js +0 -476
- package/Build/Workers/chunk-CIV5DJOQ.js +0 -778
- package/Build/Workers/chunk-CLCTQVVL.js +0 -241
- package/Build/Workers/chunk-CQNFIAZU.js +0 -56
- package/Build/Workers/chunk-CUTRKXUQ.js +0 -288
- package/Build/Workers/chunk-DBD5WWG2.js +0 -959
- package/Build/Workers/chunk-DIGUUD6G.js +0 -171
- package/Build/Workers/chunk-DZBQUULR.js +0 -138
- package/Build/Workers/chunk-E2NKV5YT.js +0 -3820
- package/Build/Workers/chunk-E7NZJOK7.js +0 -3792
- package/Build/Workers/chunk-EB3Y5P3A.js +0 -368
- package/Build/Workers/chunk-EHTS2YPT.js +0 -2719
- package/Build/Workers/chunk-ELE6SC2C.js +0 -837
- package/Build/Workers/chunk-ENNFMWDW.js +0 -789
- package/Build/Workers/chunk-ERKUET22.js +0 -3201
- package/Build/Workers/chunk-F2IMBMZY.js +0 -241
- package/Build/Workers/chunk-F4CSNRZO.js +0 -219
- package/Build/Workers/chunk-FBP4DUQJ.js +0 -693
- package/Build/Workers/chunk-FDK4K5IA.js +0 -280
- package/Build/Workers/chunk-FGQFQHN5.js +0 -1054
- package/Build/Workers/chunk-FJWZMGOQ.js +0 -1992
- package/Build/Workers/chunk-FQ42MT7M.js +0 -58
- package/Build/Workers/chunk-GGNWQWSB.js +0 -301
- package/Build/Workers/chunk-GNKXEN4C.js +0 -682
- package/Build/Workers/chunk-GSWMAFTE.js +0 -9230
- package/Build/Workers/chunk-GXDHRC4J.js +0 -1344
- package/Build/Workers/chunk-GYSYP6PC.js +0 -1067
- package/Build/Workers/chunk-H2WCFXLP.js +0 -241
- package/Build/Workers/chunk-HHV3MCGV.js +0 -162
- package/Build/Workers/chunk-HLW2ZRVK.js +0 -368
- package/Build/Workers/chunk-HS6AD4P2.js +0 -398
- package/Build/Workers/chunk-HT6FASOT.js +0 -973
- package/Build/Workers/chunk-IDVHUDZT.js +0 -352
- package/Build/Workers/chunk-IGAZBTFZ.js +0 -3201
- package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
- package/Build/Workers/chunk-IUIFLOYO.js +0 -44
- package/Build/Workers/chunk-JALGQYDY.js +0 -288
- package/Build/Workers/chunk-JW6OZT4R.js +0 -288
- package/Build/Workers/chunk-JXYLJCTC.js +0 -124
- package/Build/Workers/chunk-K27QOAW6.js +0 -97
- package/Build/Workers/chunk-KMV25A63.js +0 -789
- package/Build/Workers/chunk-KZWFWJML.js +0 -2719
- package/Build/Workers/chunk-LCXRRALY.js +0 -387
- package/Build/Workers/chunk-LD64RPYV.js +0 -368
- package/Build/Workers/chunk-LGNDTZVX.js +0 -97
- package/Build/Workers/chunk-LNSQVXFH.js +0 -1800
- package/Build/Workers/chunk-M4JZ6TSZ.js +0 -959
- package/Build/Workers/chunk-MCJDRDJQ.js +0 -102
- package/Build/Workers/chunk-MEENMEAH.js +0 -198
- package/Build/Workers/chunk-NAWU5RF4.js +0 -162
- package/Build/Workers/chunk-NIWITKQK.js +0 -693
- package/Build/Workers/chunk-OA6MYL2C.js +0 -837
- package/Build/Workers/chunk-OBEU25PI.js +0 -1067
- package/Build/Workers/chunk-OHP4ELS7.js +0 -198
- package/Build/Workers/chunk-PCL3Y7H5.js +0 -82
- package/Build/Workers/chunk-PD4GK4EM.js +0 -57
- package/Build/Workers/chunk-PEDU33QG.js +0 -2342
- package/Build/Workers/chunk-PVTSNNVI.js +0 -288
- package/Build/Workers/chunk-QHPZH22L.js +0 -241
- package/Build/Workers/chunk-QIZDWZK6.js +0 -301
- package/Build/Workers/chunk-QV6DG2YX.js +0 -1483
- package/Build/Workers/chunk-QVLAFFJY.js +0 -56
- package/Build/Workers/chunk-R4FPNAZ2.js +0 -352
- package/Build/Workers/chunk-R4K7EHOU.js +0 -171
- package/Build/Workers/chunk-R7JGHDD6.js +0 -789
- package/Build/Workers/chunk-RASQEYD4.js +0 -1483
- package/Build/Workers/chunk-RG4F5R57.js +0 -454
- package/Build/Workers/chunk-RW6ITX7Q.js +0 -3820
- package/Build/Workers/chunk-RYSQVJR6.js +0 -398
- package/Build/Workers/chunk-S6RJU5NM.js +0 -1054
- package/Build/Workers/chunk-SDFHDNS4.js +0 -147
- package/Build/Workers/chunk-SF6K72D7.js +0 -124
- package/Build/Workers/chunk-SGRGNDOD.js +0 -682
- package/Build/Workers/chunk-SM2CDCYF.js +0 -198
- package/Build/Workers/chunk-SS5ABQGY.js +0 -102
- package/Build/Workers/chunk-T5QBPLE3.js +0 -414
- package/Build/Workers/chunk-TN35HP5B.js +0 -1067
- package/Build/Workers/chunk-TNWKJNUZ.js +0 -454
- package/Build/Workers/chunk-TOAF47AQ.js +0 -102
- package/Build/Workers/chunk-TQ4QCOXT.js +0 -2719
- package/Build/Workers/chunk-TSDSILQB.js +0 -124
- package/Build/Workers/chunk-TVZD72WJ.js +0 -778
- package/Build/Workers/chunk-U5LV3F3Z.js +0 -1054
- package/Build/Workers/chunk-UEY73NRN.js +0 -38
- package/Build/Workers/chunk-UF46SZEZ.js +0 -789
- package/Build/Workers/chunk-UNRTMCET.js +0 -398
- package/Build/Workers/chunk-UTB7U3O6.js +0 -1992
- package/Build/Workers/chunk-UVO6COT2.js +0 -352
- package/Build/Workers/chunk-V46YGZE6.js +0 -352
- package/Build/Workers/chunk-VAL7DYNR.js +0 -278
- package/Build/Workers/chunk-VDGOCROW.js +0 -57
- package/Build/Workers/chunk-VFWSSBPT.js +0 -511
- package/Build/Workers/chunk-VVYMXI3I.js +0 -1284
- package/Build/Workers/chunk-VXWHPYQM.js +0 -837
- package/Build/Workers/chunk-VXYUBRSB.js +0 -219
- package/Build/Workers/chunk-VZLDLEWI.js +0 -387
- package/Build/Workers/chunk-W5OCKMPJ.js +0 -101
- package/Build/Workers/chunk-WBSY7HDY.js +0 -837
- package/Build/Workers/chunk-WN3F4CVG.js +0 -3201
- package/Build/Workers/chunk-WPRUWXGV.js +0 -693
- package/Build/Workers/chunk-WTO2ERBP.js +0 -414
- package/Build/Workers/chunk-WVHMDVG4.js +0 -959
- package/Build/Workers/chunk-XGA23TAX.js +0 -73
- package/Build/Workers/chunk-XLXSDIP5.js +0 -973
- package/Build/Workers/chunk-XQ3SKCMM.js +0 -140
- package/Build/Workers/chunk-XQH66YJC.js +0 -147
- package/Build/Workers/chunk-XTA7BXJG.js +0 -682
- package/Build/Workers/chunk-XTIDAFRS.js +0 -476
- package/Build/Workers/chunk-XUEDWBUD.js +0 -682
- package/Build/Workers/chunk-XYFLRH3H.js +0 -124
- package/Build/Workers/chunk-Y7JRTRTO.js +0 -305
- package/Build/Workers/chunk-Y7QSMDCJ.js +0 -352
- package/Build/Workers/chunk-YCB5TYTR.js +0 -1483
- package/Build/Workers/chunk-YEYOSTJX.js +0 -219
- package/Build/Workers/chunk-YGFVAGYF.js +0 -630
- package/Build/Workers/chunk-YIIACKQO.js +0 -368
- package/Build/Workers/chunk-YJGSP6PE.js +0 -511
- package/Build/Workers/chunk-YKU2Q3A2.js +0 -1287
- package/Build/Workers/chunk-Z4LR5EHE.js +0 -454
- package/Build/Workers/chunk-Z66EVE2A.js +0 -44
- package/Build/Workers/chunk-ZHIHHHTB.js +0 -414
- package/Build/Workers/chunk-ZMBHFYOX.js +0 -1344
- package/Build/Workers/chunk-ZNWHFSLE.js +0 -171
- package/Build/Workers/chunk-ZQLZG4IN.js +0 -2342
- package/Build/Workers/chunk-ZRTSMUZ2.js +0 -414
- package/Build/Workers/chunk-ZSGUV73H.js +0 -2342
- package/Build/Workers/chunk-ZZUVT5BM.js +0 -476
- 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
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import BufferPolygonCollection from "../Scene/BufferPolygonCollection.js";
|
|
4
4
|
import BufferPolylineCollection from "../Scene/BufferPolylineCollection.js";
|
|
5
|
+
import DeveloperError from "./DeveloperError.js";
|
|
6
|
+
import HeightReference, {
|
|
7
|
+
isHeightReferenceClamp,
|
|
8
|
+
} from "../Scene/HeightReference.js";
|
|
9
|
+
import Cartesian2 from "./Cartesian2.js";
|
|
5
10
|
import Rectangle from "./Rectangle.js";
|
|
6
11
|
import defined from "./defined.js";
|
|
7
12
|
import VectorPipeline from "./VectorPipeline.js";
|
|
@@ -24,7 +29,7 @@ const scratchIntersectRectangle = new Rectangle();
|
|
|
24
29
|
*
|
|
25
30
|
* @callback PackCollectionData
|
|
26
31
|
* @param {*} collection
|
|
27
|
-
* @param {
|
|
32
|
+
* @param {Ellipsoid} ellipsoid
|
|
28
33
|
* @param {VectorCollectionData} [result]
|
|
29
34
|
* @returns {VectorCollectionData}
|
|
30
35
|
* @private
|
|
@@ -69,6 +74,10 @@ collectionPackers.set(BufferPolygonCollection, {
|
|
|
69
74
|
/**
|
|
70
75
|
* @typedef {object} VectorProviderConstructorOptions
|
|
71
76
|
* @property {TilingScheme} tilingScheme
|
|
77
|
+
* @property {boolean} [antialias=true] Whether to fade draped polyline edges over the pixel
|
|
78
|
+
* straddling them. Disabling this is faster but leaves the edges aliased.
|
|
79
|
+
* @property {number} [minimumTileScreenPixels=256] Lower bound on the screen size, in pixels, of
|
|
80
|
+
* a tile baked by this provider.
|
|
72
81
|
* @private
|
|
73
82
|
*/
|
|
74
83
|
|
|
@@ -82,10 +91,31 @@ class VectorProvider {
|
|
|
82
91
|
this._tilingScheme = options.tilingScheme;
|
|
83
92
|
|
|
84
93
|
/**
|
|
85
|
-
*
|
|
94
|
+
* Whether to fade draped polyline edges over the pixel straddling them.
|
|
95
|
+
* Disabling this is faster but leaves the edges aliased.
|
|
96
|
+
*
|
|
97
|
+
* @type {boolean}
|
|
98
|
+
* @default true
|
|
99
|
+
*/
|
|
100
|
+
this.antialias = options.antialias ?? true;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Lower bound on the screen size, in pixels, of a tile baked by this provider. Line widths are
|
|
104
|
+
* in screen pixels but baking has no camera, so this is what converts them to tile UV. The
|
|
105
|
+
* surface consuming the tiles is expected to derive it from its own refinement criterion.
|
|
106
|
+
*
|
|
107
|
+
* @type {number}
|
|
108
|
+
* @default 256
|
|
109
|
+
*/
|
|
110
|
+
this.minimumTileScreenPixels = options.minimumTileScreenPixels ?? 256.0;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Marked collections, mapped to the {@link HeightReference} they were marked
|
|
114
|
+
* with, which determines the surfaces they are draped onto.
|
|
115
|
+
* @type {Map<BufferPrimitiveCollection<BufferPrimitive>, HeightReference>}
|
|
86
116
|
* @private
|
|
87
117
|
*/
|
|
88
|
-
this.
|
|
118
|
+
this._heightReferenceByCollection = new Map();
|
|
89
119
|
|
|
90
120
|
/**
|
|
91
121
|
* Per-collection snapshot of projected positions and per-primitive
|
|
@@ -96,21 +126,14 @@ class VectorProvider {
|
|
|
96
126
|
this._collectionDataCache = new WeakMap();
|
|
97
127
|
|
|
98
128
|
/**
|
|
99
|
-
* Collections marked
|
|
129
|
+
* Collections marked this frame (only these are baked).
|
|
100
130
|
* @type {Set<BufferPrimitiveCollection<BufferPrimitive>>}
|
|
101
131
|
* @private
|
|
102
132
|
*/
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Collections added via markSelected (not add); only these are pruned.
|
|
107
|
-
* @type {Set<BufferPrimitiveCollection<BufferPrimitive>>}
|
|
108
|
-
* @private
|
|
109
|
-
*/
|
|
110
|
-
this._selectionDriven = new Set();
|
|
133
|
+
this._markedThisFrame = new Set();
|
|
111
134
|
|
|
112
135
|
/** @private */
|
|
113
|
-
this.
|
|
136
|
+
this._markedFrameNumber = -1;
|
|
114
137
|
|
|
115
138
|
/**
|
|
116
139
|
* Cartographic regions changed since the last
|
|
@@ -137,63 +160,99 @@ class VectorProvider {
|
|
|
137
160
|
}
|
|
138
161
|
|
|
139
162
|
/**
|
|
163
|
+
* Drops a collection immediately, rather than waiting for it to be pruned by
|
|
164
|
+
* the next {@link VectorProvider#update}. Call when a collection is destroyed,
|
|
165
|
+
* so that it is never draped after its buffers are released.
|
|
166
|
+
*
|
|
140
167
|
* @param {BufferPrimitiveCollection<BufferPrimitive>} collection
|
|
141
168
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
if (this._collections.size !== previousSize) {
|
|
169
|
+
remove(collection) {
|
|
170
|
+
this._markedThisFrame.delete(collection);
|
|
171
|
+
if (this._heightReferenceByCollection.delete(collection)) {
|
|
146
172
|
this._markCollectionRegionDirty(collection);
|
|
147
173
|
}
|
|
148
174
|
}
|
|
149
175
|
|
|
150
176
|
/**
|
|
177
|
+
* Whether a collection is currently being draped, that is, whether it has
|
|
178
|
+
* been marked and not yet pruned or removed.
|
|
179
|
+
*
|
|
151
180
|
* @param {BufferPrimitiveCollection<BufferPrimitive>} collection
|
|
181
|
+
* @returns {boolean}
|
|
152
182
|
*/
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
this._selectionDriven.delete(collection);
|
|
156
|
-
if (this._collections.delete(collection)) {
|
|
157
|
-
this._markCollectionRegionDirty(collection);
|
|
158
|
-
}
|
|
183
|
+
has(collection) {
|
|
184
|
+
return this._heightReferenceByCollection.has(collection);
|
|
159
185
|
}
|
|
160
186
|
|
|
161
187
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
188
|
+
* Whether draping is supported for the given collection's type. Callers must
|
|
189
|
+
* render unsupported collections themselves.
|
|
190
|
+
*
|
|
191
|
+
* @param {BufferPrimitiveCollection<BufferPrimitive>} collection
|
|
192
|
+
* @returns {boolean}
|
|
193
|
+
*/
|
|
194
|
+
static isSupported(collection) {
|
|
195
|
+
return collectionPackers.has(collection.constructor);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Marks a collection as draped for this frame; collections not marked are
|
|
200
|
+
* pruned next frame, keeping the draped set aligned with the rendered LOD.
|
|
165
201
|
*
|
|
166
202
|
* @param {BufferPrimitiveCollection<BufferPrimitive>} collection
|
|
167
203
|
* @param {number} frameNumber
|
|
204
|
+
* @param {HeightReference} heightReference The surfaces the collection is
|
|
205
|
+
* draped onto: {@link HeightReference.CLAMP_TO_TERRAIN} for the globe,
|
|
206
|
+
* {@link HeightReference.CLAMP_TO_3D_TILE} for 3D Tiles, or
|
|
207
|
+
* {@link HeightReference.CLAMP_TO_GROUND} for both.
|
|
168
208
|
*/
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
209
|
+
markForFrame(collection, frameNumber, heightReference) {
|
|
210
|
+
//>>includeStart('debug', pragmas.debug);
|
|
211
|
+
if (!VectorProvider.isSupported(collection)) {
|
|
212
|
+
throw new DeveloperError(
|
|
213
|
+
`Draping is not supported for ${collection.constructor.name}. Check VectorProvider.isSupported before marking a collection.`,
|
|
214
|
+
);
|
|
173
215
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
216
|
+
if (!isHeightReferenceClamp(heightReference)) {
|
|
217
|
+
throw new DeveloperError(
|
|
218
|
+
"heightReference must be CLAMP_TO_GROUND, CLAMP_TO_TERRAIN, or CLAMP_TO_3D_TILE.",
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
//>>includeEnd('debug');
|
|
222
|
+
|
|
223
|
+
this._beginFrame(frameNumber);
|
|
224
|
+
this._markedThisFrame.add(collection);
|
|
225
|
+
|
|
226
|
+
if (!this._heightReferenceByCollection.has(collection)) {
|
|
179
227
|
this._markCollectionRegionDirty(collection);
|
|
180
228
|
}
|
|
229
|
+
|
|
230
|
+
this._heightReferenceByCollection.set(collection, heightReference);
|
|
181
231
|
}
|
|
182
232
|
|
|
183
233
|
/**
|
|
184
|
-
* Prunes
|
|
234
|
+
* Prunes the previous frame's unmarked collections when a new frame begins.
|
|
235
|
+
* Called both from {@link VectorProvider#markForFrame} and once per frame
|
|
236
|
+
* from {@link VectorProvider#update}, so that a frame in which nothing is
|
|
237
|
+
* marked still prunes the collections left over from the frame before it.
|
|
238
|
+
*
|
|
239
|
+
* @param {number} frameNumber
|
|
185
240
|
* @private
|
|
186
241
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
242
|
+
_beginFrame(frameNumber) {
|
|
243
|
+
if (frameNumber === this._markedFrameNumber) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
for (const collection of this._heightReferenceByCollection.keys()) {
|
|
248
|
+
if (!this._markedThisFrame.has(collection)) {
|
|
249
|
+
this._heightReferenceByCollection.delete(collection);
|
|
250
|
+
this._markCollectionRegionDirty(collection);
|
|
194
251
|
}
|
|
195
252
|
}
|
|
196
|
-
this.
|
|
253
|
+
this._markedThisFrame.clear();
|
|
254
|
+
|
|
255
|
+
this._markedFrameNumber = frameNumber;
|
|
197
256
|
}
|
|
198
257
|
|
|
199
258
|
/**
|
|
@@ -216,18 +275,55 @@ class VectorProvider {
|
|
|
216
275
|
* @param {number} y
|
|
217
276
|
* @param {number} level
|
|
218
277
|
* @param {Context} context
|
|
278
|
+
* @param {HeightReference} targetHeightReference The kind of
|
|
279
|
+
* surface the data is baked for, either {@link HeightReference.CLAMP_TO_TERRAIN} or
|
|
280
|
+
* {@link HeightReference.CLAMP_TO_3D_TILE}. Only collections draped onto that surface are
|
|
281
|
+
* included.
|
|
219
282
|
* @returns {VectorTileData}
|
|
220
283
|
*/
|
|
221
|
-
requestTileData(x, y, level, context) {
|
|
284
|
+
requestTileData(x, y, level, context, targetHeightReference) {
|
|
285
|
+
const tileRectangle = this._tilingScheme.tileXYToRectangle(
|
|
286
|
+
x,
|
|
287
|
+
y,
|
|
288
|
+
level,
|
|
289
|
+
scratchTileRectangle,
|
|
290
|
+
);
|
|
291
|
+
return this.requestDataForRectangle(
|
|
292
|
+
tileRectangle,
|
|
293
|
+
context,
|
|
294
|
+
targetHeightReference,
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Bakes vector lookup data for an arbitrary cartographic rectangle, such as
|
|
300
|
+
* a 3D Tiles content's bounding region.
|
|
301
|
+
*
|
|
302
|
+
* @param {Rectangle} rectangle
|
|
303
|
+
* @param {Context} context
|
|
304
|
+
* @param {HeightReference} targetHeightReference The kind of
|
|
305
|
+
* surface the data is baked for, either {@link HeightReference.CLAMP_TO_TERRAIN} or
|
|
306
|
+
* {@link HeightReference.CLAMP_TO_3D_TILE}. Only collections draped onto that surface are
|
|
307
|
+
* included.
|
|
308
|
+
* @returns {VectorTileData}
|
|
309
|
+
*/
|
|
310
|
+
requestDataForRectangle(rectangle, context, targetHeightReference) {
|
|
222
311
|
const tilingScheme = this._tilingScheme;
|
|
223
|
-
const
|
|
312
|
+
const heightReferenceByCollection = this._heightReferenceByCollection;
|
|
224
313
|
|
|
225
314
|
/** @type {VectorTileData} */
|
|
226
|
-
const result = {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
315
|
+
const result = {
|
|
316
|
+
show: true,
|
|
317
|
+
hasPolylines: false,
|
|
318
|
+
hasPolygons: false,
|
|
319
|
+
rectangle: Rectangle.clone(rectangle),
|
|
320
|
+
collectionVersions: new Map(),
|
|
321
|
+
minimumTileScreenPixels: this.minimumTileScreenPixels,
|
|
322
|
+
metersPerUv: computeMetersPerUv(rectangle, tilingScheme.ellipsoid),
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
for (const [collection, heightReference] of heightReferenceByCollection) {
|
|
326
|
+
if (!targetsSurface(heightReference, targetHeightReference)) {
|
|
231
327
|
continue;
|
|
232
328
|
}
|
|
233
329
|
|
|
@@ -238,7 +334,7 @@ class VectorProvider {
|
|
|
238
334
|
);
|
|
239
335
|
|
|
240
336
|
const isIntersected = !!Rectangle.intersection(
|
|
241
|
-
|
|
337
|
+
rectangle,
|
|
242
338
|
collectionRectangle,
|
|
243
339
|
scratchIntersectRectangle,
|
|
244
340
|
);
|
|
@@ -247,22 +343,25 @@ class VectorProvider {
|
|
|
247
343
|
continue;
|
|
248
344
|
}
|
|
249
345
|
|
|
346
|
+
// Guaranteed by the VectorProvider.isSupported check in markForFrame.
|
|
347
|
+
const packer = /** @type {CollectionPacker} */ (
|
|
348
|
+
collectionPackers.get(collection.constructor)
|
|
349
|
+
);
|
|
350
|
+
|
|
250
351
|
const collectionData = this._getCollectionDataCached(
|
|
251
352
|
collection,
|
|
252
353
|
packer.packCollectionData,
|
|
253
354
|
);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
collectionData,
|
|
257
|
-
tileRectangle,
|
|
258
|
-
result,
|
|
259
|
-
);
|
|
355
|
+
result.collectionVersions.set(collection, collectionData.version);
|
|
356
|
+
packer.packTilePrimitives(collection, collectionData, rectangle, result);
|
|
260
357
|
}
|
|
261
358
|
|
|
262
359
|
const hasPolylines =
|
|
263
360
|
defined(result.polylineSegments) && result.polylineSegments.length > 0;
|
|
264
361
|
const hasPolygons =
|
|
265
362
|
defined(result.polygonRings) && result.polygonRings.length > 0;
|
|
363
|
+
result.hasPolylines = hasPolylines;
|
|
364
|
+
result.hasPolygons = hasPolygons;
|
|
266
365
|
|
|
267
366
|
if (!hasPolylines && !hasPolygons) {
|
|
268
367
|
result.show = false;
|
|
@@ -301,21 +400,118 @@ class VectorProvider {
|
|
|
301
400
|
* @param {number} y
|
|
302
401
|
* @param {number} level
|
|
303
402
|
* @param {Context} context
|
|
304
|
-
* @param {VectorTileData
|
|
305
|
-
* @
|
|
403
|
+
* @param {VectorTileData} currentData
|
|
404
|
+
* @param {HeightReference} targetHeightReference Either
|
|
405
|
+
* {@link HeightReference.CLAMP_TO_TERRAIN} or {@link HeightReference.CLAMP_TO_3D_TILE}.
|
|
406
|
+
* @returns {VectorTileData}
|
|
306
407
|
*/
|
|
307
|
-
updateTileData(x, y, level, context, currentData) {
|
|
408
|
+
updateTileData(x, y, level, context, currentData, targetHeightReference) {
|
|
308
409
|
const dirtyRectangles = this._dirtyRectangles;
|
|
309
410
|
const tilingScheme = this._tilingScheme;
|
|
310
411
|
if (!intersectRectangles(x, y, level, dirtyRectangles, tilingScheme)) {
|
|
311
412
|
return currentData;
|
|
312
413
|
}
|
|
313
414
|
|
|
314
|
-
|
|
315
|
-
|
|
415
|
+
this.releaseTileData(currentData);
|
|
416
|
+
|
|
417
|
+
return this.requestTileData(x, y, level, context, targetHeightReference);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Re-bakes vector data for an arbitrary rectangle when the collections it was
|
|
422
|
+
* baked from have changed. Unlike {@link VectorProvider#updateTileData}, this
|
|
423
|
+
* does not consult {@link VectorProvider#_dirtyRectangles} — they are cleared
|
|
424
|
+
* each frame by {@link VectorProvider#makeClean}, which consumers outside the
|
|
425
|
+
* terrain pass cannot rely on observing — so staleness is instead detected by
|
|
426
|
+
* comparing the collection versions recorded when the data was baked.
|
|
427
|
+
*
|
|
428
|
+
* @param {Rectangle} rectangle
|
|
429
|
+
* @param {Context} context
|
|
430
|
+
* @param {VectorTileData} currentData
|
|
431
|
+
* @param {HeightReference} targetHeightReference Either
|
|
432
|
+
* {@link HeightReference.CLAMP_TO_TERRAIN} or {@link HeightReference.CLAMP_TO_3D_TILE}.
|
|
433
|
+
* @returns {VectorTileData}
|
|
434
|
+
*/
|
|
435
|
+
updateDataForRectangle(
|
|
436
|
+
rectangle,
|
|
437
|
+
context,
|
|
438
|
+
currentData,
|
|
439
|
+
targetHeightReference,
|
|
440
|
+
) {
|
|
441
|
+
if (!this._isStale(currentData, rectangle, targetHeightReference)) {
|
|
442
|
+
return currentData;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
this.releaseTileData(currentData);
|
|
446
|
+
|
|
447
|
+
return this.requestDataForRectangle(
|
|
448
|
+
rectangle,
|
|
449
|
+
context,
|
|
450
|
+
targetHeightReference,
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Whether baked data no longer reflects the collections overlapping its
|
|
456
|
+
* rectangle. Stale when a collection it was baked from has changed, when a
|
|
457
|
+
* collection has left the rectangle or been pruned, or when a collection has
|
|
458
|
+
* moved into the rectangle since the bake.
|
|
459
|
+
*
|
|
460
|
+
* @param {VectorTileData} data
|
|
461
|
+
* @param {Rectangle} rectangle
|
|
462
|
+
* @param {HeightReference} targetHeightReference
|
|
463
|
+
* @returns {boolean}
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
466
|
+
_isStale(data, rectangle, targetHeightReference) {
|
|
467
|
+
// The rectangle itself can change, such as when a model moves.
|
|
468
|
+
if (!Rectangle.equals(data.rectangle, rectangle)) {
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const bakedVersions = data.collectionVersions;
|
|
473
|
+
const heightReferenceByCollection = this._heightReferenceByCollection;
|
|
474
|
+
let bakedVersionsVisited = 0;
|
|
475
|
+
|
|
476
|
+
for (const [collection, heightReference] of heightReferenceByCollection) {
|
|
477
|
+
if (!targetsSurface(heightReference, targetHeightReference)) {
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const collectionRectangle = Rectangle.fromBoundingSphere(
|
|
482
|
+
collection.boundingVolume,
|
|
483
|
+
this._tilingScheme.ellipsoid,
|
|
484
|
+
scratchCollectionRectangle,
|
|
485
|
+
);
|
|
486
|
+
const isIntersected = !!Rectangle.intersection(
|
|
487
|
+
rectangle,
|
|
488
|
+
collectionRectangle,
|
|
489
|
+
scratchIntersectRectangle,
|
|
490
|
+
);
|
|
491
|
+
const bakedVersion = bakedVersions.get(collection);
|
|
492
|
+
|
|
493
|
+
if (!isIntersected) {
|
|
494
|
+
// Left the rectangle since the bake.
|
|
495
|
+
if (defined(bakedVersion)) {
|
|
496
|
+
return true;
|
|
497
|
+
}
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Moved into the rectangle since the bake.
|
|
502
|
+
if (!defined(bakedVersion)) {
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
bakedVersionsVisited++;
|
|
507
|
+
|
|
508
|
+
if (collection._dirtyCount > 0 || bakedVersion !== collection._version) {
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
316
511
|
}
|
|
317
512
|
|
|
318
|
-
|
|
513
|
+
// A collection the data was baked from is no longer marked.
|
|
514
|
+
return bakedVersionsVisited !== bakedVersions.size;
|
|
319
515
|
}
|
|
320
516
|
|
|
321
517
|
/**
|
|
@@ -327,12 +523,20 @@ class VectorProvider {
|
|
|
327
523
|
}
|
|
328
524
|
|
|
329
525
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* frame, before
|
|
526
|
+
* Prunes the previous frame's unmarked collections and records dirty regions
|
|
527
|
+
* for collections whose content has changed since their last extraction, so
|
|
528
|
+
* overlapping tiles are re-baked. Call once per frame, before
|
|
529
|
+
* {@link VectorProvider#updateTileData}.
|
|
530
|
+
*
|
|
531
|
+
* @param {number} [frameNumber] The current frame number. When omitted, the
|
|
532
|
+
* marked set is left untouched and only dirty regions are recorded.
|
|
333
533
|
*/
|
|
334
|
-
update() {
|
|
335
|
-
|
|
534
|
+
update(frameNumber) {
|
|
535
|
+
if (defined(frameNumber)) {
|
|
536
|
+
this._beginFrame(frameNumber);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
for (const collection of this._heightReferenceByCollection.keys()) {
|
|
336
540
|
const cache = this._collectionDataCache.get(collection);
|
|
337
541
|
if (!defined(cache)) {
|
|
338
542
|
// Never extracted; new tiles bake on request.
|
|
@@ -371,13 +575,14 @@ class VectorProvider {
|
|
|
371
575
|
return cache;
|
|
372
576
|
}
|
|
373
577
|
|
|
374
|
-
const
|
|
578
|
+
const ellipsoid = this.ellipsoid;
|
|
579
|
+
const data = packCollectionData(collection, ellipsoid, cache);
|
|
375
580
|
|
|
376
581
|
// If dirty, the version increments +1 when marked clean below.
|
|
377
582
|
data.version = collection._version + (dirty ? 1 : 0);
|
|
378
583
|
data.rectangle = Rectangle.fromBoundingSphere(
|
|
379
584
|
collection.boundingVolume,
|
|
380
|
-
|
|
585
|
+
ellipsoid,
|
|
381
586
|
data.rectangle,
|
|
382
587
|
);
|
|
383
588
|
this._collectionDataCache.set(collection, data);
|
|
@@ -388,6 +593,41 @@ class VectorProvider {
|
|
|
388
593
|
}
|
|
389
594
|
}
|
|
390
595
|
|
|
596
|
+
/**
|
|
597
|
+
* Whether a collection draped with <code>collectionHeightReference</code> lands
|
|
598
|
+
* on a surface of kind <code>targetHeightReference</code>.
|
|
599
|
+
*
|
|
600
|
+
* @param {HeightReference} collectionHeightReference
|
|
601
|
+
* @param {HeightReference} targetHeightReference Either
|
|
602
|
+
* {@link HeightReference.CLAMP_TO_TERRAIN} or {@link HeightReference.CLAMP_TO_3D_TILE}.
|
|
603
|
+
* @returns {boolean}
|
|
604
|
+
* @private
|
|
605
|
+
*/
|
|
606
|
+
function targetsSurface(collectionHeightReference, targetHeightReference) {
|
|
607
|
+
return (
|
|
608
|
+
collectionHeightReference === HeightReference.CLAMP_TO_GROUND ||
|
|
609
|
+
collectionHeightReference === targetHeightReference
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Ground size, in meters, of a rectangle's UV domain. Evaluated at the center latitude, so the
|
|
615
|
+
* east-west scale drifts toward the northern and southern edges.
|
|
616
|
+
*
|
|
617
|
+
* @param {Rectangle} rectangle
|
|
618
|
+
* @param {Ellipsoid} ellipsoid
|
|
619
|
+
* @returns {Cartesian2}
|
|
620
|
+
* @private
|
|
621
|
+
*/
|
|
622
|
+
function computeMetersPerUv(rectangle, ellipsoid) {
|
|
623
|
+
const radius = ellipsoid.maximumRadius;
|
|
624
|
+
const centerLatitude = (rectangle.south + rectangle.north) * 0.5;
|
|
625
|
+
return new Cartesian2(
|
|
626
|
+
rectangle.width * radius * Math.cos(centerLatitude),
|
|
627
|
+
rectangle.height * radius,
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
|
|
391
631
|
/**
|
|
392
632
|
* @param {number} x
|
|
393
633
|
* @param {number} y
|
|
@@ -1008,6 +1008,27 @@ const AutomaticUniforms = {
|
|
|
1008
1008
|
},
|
|
1009
1009
|
}),
|
|
1010
1010
|
|
|
1011
|
+
/**
|
|
1012
|
+
* An automatic GLSL uniform containing the geodetic longitude (<code>x</code>),
|
|
1013
|
+
* latitude (<code>y</code>) in radians and height (<code>z</code>) in meters of the
|
|
1014
|
+
* eye (camera). The <code>z</code> component matches {@link czm_eyeHeight}.
|
|
1015
|
+
* This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
|
|
1016
|
+
*
|
|
1017
|
+
* @example
|
|
1018
|
+
* // GLSL declaration
|
|
1019
|
+
* uniform vec3 czm_eyeCartographic;
|
|
1020
|
+
*
|
|
1021
|
+
* // Example
|
|
1022
|
+
* float cameraLatitude = czm_eyeCartographic.y;
|
|
1023
|
+
*/
|
|
1024
|
+
czm_eyeCartographic: new AutomaticUniform({
|
|
1025
|
+
size: 1,
|
|
1026
|
+
datatype: WebGLConstants.FLOAT_VEC3,
|
|
1027
|
+
getValue: function (uniformState) {
|
|
1028
|
+
return uniformState.eyeCartographic;
|
|
1029
|
+
},
|
|
1030
|
+
}),
|
|
1031
|
+
|
|
1011
1032
|
/**
|
|
1012
1033
|
* An automatic GLSL uniform containing height (<code>x</code>) and height squared (<code>y</code>)
|
|
1013
1034
|
* in meters of the eye (camera) above the 2D world plane. This uniform is only valid
|
|
@@ -1050,10 +1071,31 @@ const AutomaticUniforms = {
|
|
|
1050
1071
|
},
|
|
1051
1072
|
}),
|
|
1052
1073
|
|
|
1074
|
+
/**
|
|
1075
|
+
* An automatic GLSL uniform containing a 3x3 rotation from eye coordinates to an
|
|
1076
|
+
* east-north-up coordinate system centered at the position on the ellipsoid below
|
|
1077
|
+
* the camera.
|
|
1078
|
+
* This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
|
|
1079
|
+
*
|
|
1080
|
+
* @example
|
|
1081
|
+
* // GLSL declaration
|
|
1082
|
+
* uniform mat3 czm_eyeToEnu;
|
|
1083
|
+
*
|
|
1084
|
+
* // Example
|
|
1085
|
+
* vec3 enu = czm_eyeToEnu * positionEC;
|
|
1086
|
+
*/
|
|
1087
|
+
czm_eyeToEnu: new AutomaticUniform({
|
|
1088
|
+
size: 1,
|
|
1089
|
+
datatype: WebGLConstants.FLOAT_MAT3,
|
|
1090
|
+
getValue: function (uniformState) {
|
|
1091
|
+
return uniformState.eyeToEnu;
|
|
1092
|
+
},
|
|
1093
|
+
}),
|
|
1094
|
+
|
|
1053
1095
|
/**
|
|
1054
1096
|
* An automatic GLSL uniform containing the transform from model coordinates
|
|
1055
1097
|
* to an east-north-up coordinate system centered at the position on the
|
|
1056
|
-
* ellipsoid
|
|
1098
|
+
* ellipsoid nearest to the camera.
|
|
1057
1099
|
* This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
|
|
1058
1100
|
*/
|
|
1059
1101
|
czm_modelToEnu: new AutomaticUniform({
|
|
@@ -1065,7 +1107,7 @@ const AutomaticUniforms = {
|
|
|
1065
1107
|
}),
|
|
1066
1108
|
|
|
1067
1109
|
/**
|
|
1068
|
-
* An automatic GLSL uniform containing the
|
|
1110
|
+
* An automatic GLSL uniform containing the inverse of
|
|
1069
1111
|
* {@link AutomaticUniforms.czm_modelToEnu}.
|
|
1070
1112
|
* This uniform is only valid when the {@link SceneMode} is <code>SCENE3D</code>.
|
|
1071
1113
|
*/
|
|
@@ -424,7 +424,7 @@ ShaderBuilder.prototype.addVertexLines = function (lines) {
|
|
|
424
424
|
/**
|
|
425
425
|
* Appends lines of GLSL code to the fragment shader
|
|
426
426
|
*
|
|
427
|
-
* @param {string[]} lines
|
|
427
|
+
* @param {string|string[]} lines One or more lines to add to the end of the fragment shader source
|
|
428
428
|
*
|
|
429
429
|
* @example
|
|
430
430
|
* shaderBuilder.addFragmentLines([
|