@cesium/engine 26.2.0 → 26.3.1-wasm.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 +707 -600
- package/Build/Workers/chunk-2P3WKV6V.js +290 -0
- package/Build/Workers/{chunk-M6QKXVAU.js → chunk-2U5272QU.js} +17 -17
- package/Build/Workers/{chunk-NEFDMMLY.js → chunk-4KCOC6OZ.js} +8 -10
- package/Build/Workers/{chunk-SJYSIOEM.js → chunk-5FULJNWY.js} +11 -13
- package/Build/Workers/{chunk-NCL22ZUX.js → chunk-65ZF23AQ.js} +1 -1
- package/Build/Workers/{chunk-KP5QD7WU.js → chunk-6D5534B7.js} +10 -12
- package/Build/Workers/{chunk-FX3VEAIU.js → chunk-6GFMBHBD.js} +19 -19
- package/Build/Workers/{chunk-A62YI6S6.js → chunk-6VRGQF3D.js} +4 -4
- package/Build/Workers/{chunk-DSGLDRTI.js → chunk-6XUIECFB.js} +4 -6
- package/Build/Workers/{chunk-HDL4HOXZ.js → chunk-7KWUH6RK.js} +14 -14
- package/Build/Workers/{chunk-UAZUP4I5.js → chunk-7ZBJRQQT.js} +7 -7
- package/Build/Workers/{chunk-CRCGE4J4.js → chunk-AEHANE5A.js} +991 -5612
- package/Build/Workers/chunk-AUU74SIZ.js +2420 -0
- package/Build/Workers/{chunk-ARZICEEP.js → chunk-B6V5NMIE.js} +13 -11
- package/Build/Workers/{chunk-76FDC45O.js → chunk-BRQ52ASU.js} +15 -17
- package/Build/Workers/{chunk-SA2A2AN5.js → chunk-FVLSQBPH.js} +7 -14
- package/Build/Workers/{chunk-CUTRKXUQ.js → chunk-IFKM2GZR.js} +12 -12
- package/Build/Workers/{chunk-NSKZ6SBK.js → chunk-KF6OEWVT.js} +17 -17
- package/Build/Workers/{chunk-O3DKEX7Q.js → chunk-KOAXSU77.js} +5 -7
- package/Build/Workers/{chunk-2Z4ZLVOD.js → chunk-KRVYCMGN.js} +6 -6
- package/Build/Workers/{chunk-SXSP3JHS.js → chunk-LTZRLNQP.js} +1 -1
- package/Build/Workers/{chunk-6FZDPMTO.js → chunk-M7WEAGWT.js} +8 -8
- package/Build/Workers/{chunk-NXGQBQWE.js → chunk-MJTLGN63.js} +14 -14
- package/Build/Workers/{chunk-XCBZVTIV.js → chunk-MUNZ77KV.js} +1 -1
- package/Build/Workers/{chunk-NLLCQBX3.js → chunk-NC5BUJEF.js} +2 -2
- package/Build/Workers/chunk-NYKURYFR.js +2131 -0
- package/Build/Workers/{chunk-5LSOO2KD.js → chunk-NZAQG57U.js} +7 -7
- package/Build/Workers/{chunk-DZUFEE4L.js → chunk-O5GUOP2G.js} +5 -7
- package/Build/Workers/{chunk-D6AY775A.js → chunk-OQUOLQTN.js} +8 -10
- package/Build/Workers/{chunk-CDJDJ5LK.js → chunk-OUG5JB2K.js} +16 -14
- package/Build/Workers/{chunk-ACTVJHSP.js → chunk-P4SDLSGF.js} +13 -6
- package/Build/Workers/{chunk-MAAHFYPC.js → chunk-P6PC2OIM.js} +7 -7
- package/Build/Workers/{chunk-6YR6JBMY.js → chunk-PPRK3XQU.js} +31 -35
- package/Build/Workers/{chunk-IMBVP57H.js → chunk-QGTYLWOT.js} +2 -2
- package/Build/Workers/{chunk-FCP2QY4G.js → chunk-QHTLIQUH.js} +5 -7
- package/Build/Workers/{chunk-EZGQPOIG.js → chunk-ROHWZQZ5.js} +5 -5
- package/Build/Workers/{chunk-B3QHNA4A.js → chunk-SNUWISJO.js} +6 -8
- package/Build/Workers/{chunk-XDWCTQCZ.js → chunk-T67YY3KP.js} +4 -2
- package/Build/Workers/{chunk-IJZJMIUY.js → chunk-TF5473GK.js} +13 -13
- package/Build/Workers/{chunk-OZGPS7FB.js → chunk-THHFTMAL.js} +4 -6
- package/Build/Workers/{chunk-PRWUMCXF.js → chunk-UFCZ62WM.js} +15 -13
- package/Build/Workers/{chunk-27FWRTJI.js → chunk-UV2YC2Q5.js} +11 -11
- package/Build/Workers/{chunk-N7CCOFLX.js → chunk-V4ICCWYA.js} +1 -1
- package/Build/Workers/{chunk-GHXVQVUM.js → chunk-VC6XXI2Z.js} +9 -9
- package/Build/Workers/{chunk-I74ZH5LK.js → chunk-VXJ6P4UI.js} +10 -10
- package/Build/Workers/{chunk-KGXSYGBG.js → chunk-W2BKP7G7.js} +15 -17
- package/Build/Workers/{chunk-LDRQSYBN.js → chunk-WMVGNBSH.js} +2 -2
- package/Build/Workers/{chunk-SMTGMFBL.js → chunk-XFZMQZSZ.js} +4 -4
- package/Build/Workers/{chunk-7MM3N2VE.js → chunk-XJ532R6R.js} +20 -20
- package/Build/Workers/{chunk-NJVBJG63.js → chunk-YJNU4SM4.js} +5 -5
- package/Build/Workers/{chunk-DIGUUD6G.js → chunk-YJRDTEHQ.js} +8 -8
- package/Build/Workers/chunk-YUICDZKO.js +2660 -0
- package/Build/Workers/{chunk-O3XFXGPZ.js → chunk-Z3DEVGJV.js} +7 -7
- package/Build/Workers/{chunk-3PSS3T43.js → chunk-ZECGI7UZ.js} +4 -4
- package/Build/Workers/{chunk-QFSSCLLZ.js → chunk-ZFLPVPUJ.js} +6 -8
- package/Build/Workers/{chunk-2RGJPWQX.js → chunk-ZIM5H2DB.js} +11 -11
- package/Build/Workers/{chunk-GVA7XQI2.js → chunk-ZSQMGGSB.js} +14 -16
- package/Build/Workers/{chunk-FU4BGABC.js → chunk-ZWYRGMBK.js} +16 -18
- package/Build/Workers/{chunk-JKXV6PG5.js → chunk-ZY733NZA.js} +1 -1
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +20 -19
- package/Build/Workers/createCircleGeometry.js +28 -27
- package/Build/Workers/createCircleOutlineGeometry.js +21 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +34 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -32
- package/Build/Workers/createCorridorGeometry.js +31 -31
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -30
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +22 -21
- 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 +27 -26
- package/Build/Workers/createGroundPolylineGeometry.js +27 -26
- package/Build/Workers/createPlaneGeometry.js +18 -17
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +35 -35
- package/Build/Workers/createPolygonOutlineGeometry.js +34 -34
- package/Build/Workers/createPolylineGeometry.js +28 -29
- package/Build/Workers/createPolylineVolumeGeometry.js +34 -35
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +30 -31
- package/Build/Workers/createRectangleGeometry.js +30 -30
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -24
- package/Build/Workers/createSimplePolylineGeometry.js +26 -27
- 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 +17 -16
- 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 +17 -16
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +36 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +24 -24
- package/Build/Workers/createVerticesFromHeightmap.js +24 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +27 -28
- package/Build/Workers/createWallOutlineGeometry.js +26 -27
- package/Build/Workers/decodeDraco.js +16 -12
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +336 -337
- package/Build/Workers/decodeI3S.js +17 -12
- package/Build/Workers/{chunk-GXWQZBAI.js → decodeMeshopt.js} +23 -29
- package/Build/Workers/decodeSpz.js +1960 -0
- package/Build/Workers/gaussianSplatSorter.js +13 -6
- package/Build/Workers/gaussianSplatTextureGenerator.js +13 -6
- package/Build/Workers/incrementallyBuildTerrainPicker.js +9 -10
- package/Build/Workers/transcodeKTX2.js +26 -12
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -24
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cesium3DTilesTerrainData.js +11 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +33 -23
- 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/KTX2Transcoder.js +99 -5
- package/Source/Core/Resource.js +2 -0
- package/Source/Core/SnapService.js +63 -0
- package/Source/Core/TaskProcessor.js +249 -129
- package/Source/Core/TrustedServers.js +34 -1
- package/Source/Core/VectorPipeline.js +139 -45
- package/Source/Core/VectorProvider.js +311 -71
- package/Source/Core/WebAssemblyWorkerInitializer.js +125 -0
- package/Source/Core/fetchWebAssemblyBinary.js +52 -0
- 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/GaussianSplatPrimitive.js +153 -66
- 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/GltfBufferViewLoader.js +25 -13
- package/Source/Scene/GltfLoader.js +56 -6
- package/Source/Scene/GltfSpzLoader.js +5 -4
- 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/SpzDecoder.js +106 -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/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createTaskProcessorWorker.js +2 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +13 -1
- package/Source/Workers/decodeDraco.js +7 -3
- package/Source/Workers/decodeI3S.js +7 -3
- package/Source/Workers/decodeMeshopt.js +21 -0
- package/Source/Workers/decodeSpz.js +20 -0
- package/Source/Workers/gaussianSplatSorter.js +7 -3
- package/Source/Workers/gaussianSplatTextureGenerator.js +7 -3
- package/Source/Workers/transcodeKTX2.js +22 -5
- package/index.d.ts +649 -55
- package/index.js +23 -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-36NI5E6W.js +0 -3820
- 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-5YPQBFRD.js +0 -519
- 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-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-ADX3CBKD.js +0 -9234
- package/Build/Workers/chunk-AF7DTMJ7.js +0 -398
- package/Build/Workers/chunk-AHWAZRBV.js +0 -82
- package/Build/Workers/chunk-AJSFRY4U.js +0 -1344
- 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-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-DBD5WWG2.js +0 -959
- 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-EOWDZN5S.js +0 -288
- 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-ILME5BXA.js +0 -301
- package/Build/Workers/chunk-IOO7Z2AV.js +0 -57
- package/Build/Workers/chunk-IUIFLOYO.js +0 -44
- package/Build/Workers/chunk-J73T2VOY.js +0 -171
- 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-XLQZNQ4Z.js +0 -163
- 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
|
@@ -1,1054 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.143.0
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*
|
|
20
|
-
* Columbus View (Pat. Pend.)
|
|
21
|
-
*
|
|
22
|
-
* Portions licensed separately.
|
|
23
|
-
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import {
|
|
27
|
-
ArcType_default
|
|
28
|
-
} from "./chunk-QVLAFFJY.js";
|
|
29
|
-
import {
|
|
30
|
-
GeometryPipeline_default
|
|
31
|
-
} from "./chunk-FX3VEAIU.js";
|
|
32
|
-
import {
|
|
33
|
-
PolygonPipeline_default,
|
|
34
|
-
WindingOrder_default
|
|
35
|
-
} from "./chunk-M4JZ6TSZ.js";
|
|
36
|
-
import {
|
|
37
|
-
arrayRemoveDuplicates_default
|
|
38
|
-
} from "./chunk-K27QOAW6.js";
|
|
39
|
-
import {
|
|
40
|
-
EllipsoidRhumbLine_default
|
|
41
|
-
} from "./chunk-4NW2MJKH.js";
|
|
42
|
-
import {
|
|
43
|
-
IntersectionTests_default
|
|
44
|
-
} from "./chunk-AJSFRY4U.js";
|
|
45
|
-
import {
|
|
46
|
-
Plane_default
|
|
47
|
-
} from "./chunk-J73T2VOY.js";
|
|
48
|
-
import {
|
|
49
|
-
IndexDatatype_default
|
|
50
|
-
} from "./chunk-DZUFEE4L.js";
|
|
51
|
-
import {
|
|
52
|
-
GeometryAttributes_default
|
|
53
|
-
} from "./chunk-IMBVP57H.js";
|
|
54
|
-
import {
|
|
55
|
-
GeometryAttribute_default,
|
|
56
|
-
Geometry_default,
|
|
57
|
-
PrimitiveType_default
|
|
58
|
-
} from "./chunk-ARZICEEP.js";
|
|
59
|
-
import {
|
|
60
|
-
Quaternion_default
|
|
61
|
-
} from "./chunk-ADX3CBKD.js";
|
|
62
|
-
import {
|
|
63
|
-
ComponentDatatype_default
|
|
64
|
-
} from "./chunk-VAL7DYNR.js";
|
|
65
|
-
import {
|
|
66
|
-
Cartesian2_default,
|
|
67
|
-
Cartographic_default,
|
|
68
|
-
Ellipsoid_default
|
|
69
|
-
} from "./chunk-UTB7U3O6.js";
|
|
70
|
-
import {
|
|
71
|
-
Cartesian3_default,
|
|
72
|
-
Matrix3_default
|
|
73
|
-
} from "./chunk-ZQLZG4IN.js";
|
|
74
|
-
import {
|
|
75
|
-
Math_default
|
|
76
|
-
} from "./chunk-5YPQBFRD.js";
|
|
77
|
-
import {
|
|
78
|
-
defined_default
|
|
79
|
-
} from "./chunk-AHWAZRBV.js";
|
|
80
|
-
|
|
81
|
-
// packages/engine/Source/Core/PolygonHierarchy.js
|
|
82
|
-
function PolygonHierarchy(positions, holes) {
|
|
83
|
-
this.positions = defined_default(positions) ? positions : [];
|
|
84
|
-
this.holes = defined_default(holes) ? holes : [];
|
|
85
|
-
}
|
|
86
|
-
var PolygonHierarchy_default = PolygonHierarchy;
|
|
87
|
-
|
|
88
|
-
// packages/engine/Source/Core/Queue.js
|
|
89
|
-
function Queue() {
|
|
90
|
-
this._array = [];
|
|
91
|
-
this._offset = 0;
|
|
92
|
-
this._length = 0;
|
|
93
|
-
}
|
|
94
|
-
Object.defineProperties(Queue.prototype, {
|
|
95
|
-
/**
|
|
96
|
-
* The length of the queue.
|
|
97
|
-
*
|
|
98
|
-
* @memberof Queue.prototype
|
|
99
|
-
*
|
|
100
|
-
* @type {number}
|
|
101
|
-
* @readonly
|
|
102
|
-
*/
|
|
103
|
-
length: {
|
|
104
|
-
get: function() {
|
|
105
|
-
return this._length;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
Queue.prototype.enqueue = function(item) {
|
|
110
|
-
this._array.push(item);
|
|
111
|
-
this._length++;
|
|
112
|
-
};
|
|
113
|
-
Queue.prototype.dequeue = function() {
|
|
114
|
-
if (this._length === 0) {
|
|
115
|
-
return void 0;
|
|
116
|
-
}
|
|
117
|
-
const array = this._array;
|
|
118
|
-
let offset = this._offset;
|
|
119
|
-
const item = array[offset];
|
|
120
|
-
array[offset] = void 0;
|
|
121
|
-
offset++;
|
|
122
|
-
if (offset > 10 && offset * 2 > array.length) {
|
|
123
|
-
this._array = array.slice(offset);
|
|
124
|
-
offset = 0;
|
|
125
|
-
}
|
|
126
|
-
this._offset = offset;
|
|
127
|
-
this._length--;
|
|
128
|
-
return item;
|
|
129
|
-
};
|
|
130
|
-
Queue.prototype.peek = function() {
|
|
131
|
-
if (this._length === 0) {
|
|
132
|
-
return void 0;
|
|
133
|
-
}
|
|
134
|
-
return this._array[this._offset];
|
|
135
|
-
};
|
|
136
|
-
Queue.prototype.contains = function(item) {
|
|
137
|
-
return this._array.indexOf(item) !== -1;
|
|
138
|
-
};
|
|
139
|
-
Queue.prototype.clear = function() {
|
|
140
|
-
this._array.length = this._offset = this._length = 0;
|
|
141
|
-
};
|
|
142
|
-
Queue.prototype.sort = function(compareFunction) {
|
|
143
|
-
if (this._offset > 0) {
|
|
144
|
-
this._array = this._array.slice(this._offset);
|
|
145
|
-
this._offset = 0;
|
|
146
|
-
}
|
|
147
|
-
this._array.sort(compareFunction);
|
|
148
|
-
};
|
|
149
|
-
var Queue_default = Queue;
|
|
150
|
-
|
|
151
|
-
// packages/engine/Source/Core/PolygonGeometryLibrary.js
|
|
152
|
-
var PolygonGeometryLibrary = {};
|
|
153
|
-
PolygonGeometryLibrary.computeHierarchyPackedLength = function(polygonHierarchy, CartesianX) {
|
|
154
|
-
let numComponents = 0;
|
|
155
|
-
const stack = [polygonHierarchy];
|
|
156
|
-
while (stack.length > 0) {
|
|
157
|
-
const hierarchy = stack.pop();
|
|
158
|
-
if (!defined_default(hierarchy)) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
numComponents += 2;
|
|
162
|
-
const positions = hierarchy.positions;
|
|
163
|
-
const holes = hierarchy.holes;
|
|
164
|
-
if (defined_default(positions) && positions.length > 0) {
|
|
165
|
-
numComponents += positions.length * CartesianX.packedLength;
|
|
166
|
-
}
|
|
167
|
-
if (defined_default(holes)) {
|
|
168
|
-
const length = holes.length;
|
|
169
|
-
for (let i = 0; i < length; ++i) {
|
|
170
|
-
stack.push(holes[i]);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return numComponents;
|
|
175
|
-
};
|
|
176
|
-
PolygonGeometryLibrary.packPolygonHierarchy = function(polygonHierarchy, array, startingIndex, CartesianX) {
|
|
177
|
-
const stack = [polygonHierarchy];
|
|
178
|
-
while (stack.length > 0) {
|
|
179
|
-
const hierarchy = stack.pop();
|
|
180
|
-
if (!defined_default(hierarchy)) {
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const positions = hierarchy.positions;
|
|
184
|
-
const holes = hierarchy.holes;
|
|
185
|
-
array[startingIndex++] = defined_default(positions) ? positions.length : 0;
|
|
186
|
-
array[startingIndex++] = defined_default(holes) ? holes.length : 0;
|
|
187
|
-
if (defined_default(positions)) {
|
|
188
|
-
const positionsLength = positions.length;
|
|
189
|
-
for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
|
|
190
|
-
CartesianX.pack(positions[i], array, startingIndex);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (defined_default(holes)) {
|
|
194
|
-
const holesLength = holes.length;
|
|
195
|
-
for (let j = 0; j < holesLength; ++j) {
|
|
196
|
-
stack.push(holes[j]);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return startingIndex;
|
|
201
|
-
};
|
|
202
|
-
PolygonGeometryLibrary.unpackPolygonHierarchy = function(array, startingIndex, CartesianX) {
|
|
203
|
-
const positionsLength = array[startingIndex++];
|
|
204
|
-
const holesLength = array[startingIndex++];
|
|
205
|
-
const positions = new Array(positionsLength);
|
|
206
|
-
const holes = holesLength > 0 ? new Array(holesLength) : void 0;
|
|
207
|
-
for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
|
|
208
|
-
positions[i] = CartesianX.unpack(array, startingIndex);
|
|
209
|
-
}
|
|
210
|
-
for (let j = 0; j < holesLength; ++j) {
|
|
211
|
-
holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(
|
|
212
|
-
array,
|
|
213
|
-
startingIndex,
|
|
214
|
-
CartesianX
|
|
215
|
-
);
|
|
216
|
-
startingIndex = holes[j].startingIndex;
|
|
217
|
-
delete holes[j].startingIndex;
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
positions,
|
|
221
|
-
holes,
|
|
222
|
-
startingIndex
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
var distance2DScratch = new Cartesian2_default();
|
|
226
|
-
function getPointAtDistance2D(p0, p1, distance, length) {
|
|
227
|
-
Cartesian2_default.subtract(p1, p0, distance2DScratch);
|
|
228
|
-
Cartesian2_default.multiplyByScalar(
|
|
229
|
-
distance2DScratch,
|
|
230
|
-
distance / length,
|
|
231
|
-
distance2DScratch
|
|
232
|
-
);
|
|
233
|
-
Cartesian2_default.add(p0, distance2DScratch, distance2DScratch);
|
|
234
|
-
return [distance2DScratch.x, distance2DScratch.y];
|
|
235
|
-
}
|
|
236
|
-
var distanceScratch = new Cartesian3_default();
|
|
237
|
-
function getPointAtDistance(p0, p1, distance, length) {
|
|
238
|
-
Cartesian3_default.subtract(p1, p0, distanceScratch);
|
|
239
|
-
Cartesian3_default.multiplyByScalar(
|
|
240
|
-
distanceScratch,
|
|
241
|
-
distance / length,
|
|
242
|
-
distanceScratch
|
|
243
|
-
);
|
|
244
|
-
Cartesian3_default.add(p0, distanceScratch, distanceScratch);
|
|
245
|
-
return [distanceScratch.x, distanceScratch.y, distanceScratch.z];
|
|
246
|
-
}
|
|
247
|
-
PolygonGeometryLibrary.subdivideLineCount = function(p0, p1, minDistance) {
|
|
248
|
-
const distance = Cartesian3_default.distance(p0, p1);
|
|
249
|
-
const n = distance / minDistance;
|
|
250
|
-
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
251
|
-
return Math.pow(2, countDivide);
|
|
252
|
-
};
|
|
253
|
-
var scratchCartographic0 = new Cartographic_default();
|
|
254
|
-
var scratchCartographic1 = new Cartographic_default();
|
|
255
|
-
var scratchCartographic2 = new Cartographic_default();
|
|
256
|
-
var scratchCartesian0 = new Cartesian3_default();
|
|
257
|
-
var scratchRhumbLine = new EllipsoidRhumbLine_default();
|
|
258
|
-
PolygonGeometryLibrary.subdivideRhumbLineCount = function(ellipsoid, p0, p1, minDistance) {
|
|
259
|
-
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
260
|
-
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
261
|
-
const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
|
|
262
|
-
const n = rhumb.surfaceDistance / minDistance;
|
|
263
|
-
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
264
|
-
return Math.pow(2, countDivide);
|
|
265
|
-
};
|
|
266
|
-
PolygonGeometryLibrary.subdivideTexcoordLine = function(t0, t1, p0, p1, minDistance, result) {
|
|
267
|
-
const subdivisions = PolygonGeometryLibrary.subdivideLineCount(
|
|
268
|
-
p0,
|
|
269
|
-
p1,
|
|
270
|
-
minDistance
|
|
271
|
-
);
|
|
272
|
-
const length2D = Cartesian2_default.distance(t0, t1);
|
|
273
|
-
const distanceBetweenCoords = length2D / subdivisions;
|
|
274
|
-
const texcoords = result;
|
|
275
|
-
texcoords.length = subdivisions * 2;
|
|
276
|
-
let index = 0;
|
|
277
|
-
for (let i = 0; i < subdivisions; i++) {
|
|
278
|
-
const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
|
|
279
|
-
texcoords[index++] = t[0];
|
|
280
|
-
texcoords[index++] = t[1];
|
|
281
|
-
}
|
|
282
|
-
return texcoords;
|
|
283
|
-
};
|
|
284
|
-
PolygonGeometryLibrary.subdivideLine = function(p0, p1, minDistance, result) {
|
|
285
|
-
const numVertices = PolygonGeometryLibrary.subdivideLineCount(
|
|
286
|
-
p0,
|
|
287
|
-
p1,
|
|
288
|
-
minDistance
|
|
289
|
-
);
|
|
290
|
-
const length = Cartesian3_default.distance(p0, p1);
|
|
291
|
-
const distanceBetweenVertices = length / numVertices;
|
|
292
|
-
if (!defined_default(result)) {
|
|
293
|
-
result = [];
|
|
294
|
-
}
|
|
295
|
-
const positions = result;
|
|
296
|
-
positions.length = numVertices * 3;
|
|
297
|
-
let index = 0;
|
|
298
|
-
for (let i = 0; i < numVertices; i++) {
|
|
299
|
-
const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);
|
|
300
|
-
positions[index++] = p[0];
|
|
301
|
-
positions[index++] = p[1];
|
|
302
|
-
positions[index++] = p[2];
|
|
303
|
-
}
|
|
304
|
-
return positions;
|
|
305
|
-
};
|
|
306
|
-
PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function(t0, t1, ellipsoid, p0, p1, minDistance, result) {
|
|
307
|
-
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
308
|
-
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
309
|
-
scratchRhumbLine.setEndPoints(c0, c1);
|
|
310
|
-
const n = scratchRhumbLine.surfaceDistance / minDistance;
|
|
311
|
-
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
312
|
-
const subdivisions = Math.pow(2, countDivide);
|
|
313
|
-
const length2D = Cartesian2_default.distance(t0, t1);
|
|
314
|
-
const distanceBetweenCoords = length2D / subdivisions;
|
|
315
|
-
const texcoords = result;
|
|
316
|
-
texcoords.length = subdivisions * 2;
|
|
317
|
-
let index = 0;
|
|
318
|
-
for (let i = 0; i < subdivisions; i++) {
|
|
319
|
-
const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
|
|
320
|
-
texcoords[index++] = t[0];
|
|
321
|
-
texcoords[index++] = t[1];
|
|
322
|
-
}
|
|
323
|
-
return texcoords;
|
|
324
|
-
};
|
|
325
|
-
PolygonGeometryLibrary.subdivideRhumbLine = function(ellipsoid, p0, p1, minDistance, result) {
|
|
326
|
-
const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
|
|
327
|
-
const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
|
|
328
|
-
const rhumb = new EllipsoidRhumbLine_default(c0, c1, ellipsoid);
|
|
329
|
-
if (!defined_default(result)) {
|
|
330
|
-
result = [];
|
|
331
|
-
}
|
|
332
|
-
if (rhumb.surfaceDistance <= minDistance) {
|
|
333
|
-
result.length = 3;
|
|
334
|
-
result[0] = p0.x;
|
|
335
|
-
result[1] = p0.y;
|
|
336
|
-
result[2] = p0.z;
|
|
337
|
-
return result;
|
|
338
|
-
}
|
|
339
|
-
const n = rhumb.surfaceDistance / minDistance;
|
|
340
|
-
const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
|
|
341
|
-
const numVertices = Math.pow(2, countDivide);
|
|
342
|
-
const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;
|
|
343
|
-
const positions = result;
|
|
344
|
-
positions.length = numVertices * 3;
|
|
345
|
-
let index = 0;
|
|
346
|
-
for (let i = 0; i < numVertices; i++) {
|
|
347
|
-
const c = rhumb.interpolateUsingSurfaceDistance(
|
|
348
|
-
i * distanceBetweenVertices,
|
|
349
|
-
scratchCartographic2
|
|
350
|
-
);
|
|
351
|
-
const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);
|
|
352
|
-
positions[index++] = p.x;
|
|
353
|
-
positions[index++] = p.y;
|
|
354
|
-
positions[index++] = p.z;
|
|
355
|
-
}
|
|
356
|
-
return positions;
|
|
357
|
-
};
|
|
358
|
-
var scaleToGeodeticHeightN1 = new Cartesian3_default();
|
|
359
|
-
var scaleToGeodeticHeightN2 = new Cartesian3_default();
|
|
360
|
-
var scaleToGeodeticHeightP1 = new Cartesian3_default();
|
|
361
|
-
var scaleToGeodeticHeightP2 = new Cartesian3_default();
|
|
362
|
-
PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function(geometry, maxHeight, minHeight, ellipsoid, perPositionHeight) {
|
|
363
|
-
ellipsoid = ellipsoid ?? Ellipsoid_default.default;
|
|
364
|
-
const n1 = scaleToGeodeticHeightN1;
|
|
365
|
-
let n2 = scaleToGeodeticHeightN2;
|
|
366
|
-
const p = scaleToGeodeticHeightP1;
|
|
367
|
-
let p2 = scaleToGeodeticHeightP2;
|
|
368
|
-
if (defined_default(geometry) && defined_default(geometry.attributes) && defined_default(geometry.attributes.position)) {
|
|
369
|
-
const positions = geometry.attributes.position.values;
|
|
370
|
-
const length = positions.length / 2;
|
|
371
|
-
for (let i = 0; i < length; i += 3) {
|
|
372
|
-
Cartesian3_default.fromArray(positions, i, p);
|
|
373
|
-
ellipsoid.geodeticSurfaceNormal(p, n1);
|
|
374
|
-
p2 = ellipsoid.scaleToGeodeticSurface(p, p2);
|
|
375
|
-
n2 = Cartesian3_default.multiplyByScalar(n1, minHeight, n2);
|
|
376
|
-
n2 = Cartesian3_default.add(p2, n2, n2);
|
|
377
|
-
positions[i + length] = n2.x;
|
|
378
|
-
positions[i + 1 + length] = n2.y;
|
|
379
|
-
positions[i + 2 + length] = n2.z;
|
|
380
|
-
if (perPositionHeight) {
|
|
381
|
-
p2 = Cartesian3_default.clone(p, p2);
|
|
382
|
-
}
|
|
383
|
-
n2 = Cartesian3_default.multiplyByScalar(n1, maxHeight, n2);
|
|
384
|
-
n2 = Cartesian3_default.add(p2, n2, n2);
|
|
385
|
-
positions[i] = n2.x;
|
|
386
|
-
positions[i + 1] = n2.y;
|
|
387
|
-
positions[i + 2] = n2.z;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
return geometry;
|
|
391
|
-
};
|
|
392
|
-
PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function(polygonHierarchy, scaleToEllipsoidSurface, ellipsoid) {
|
|
393
|
-
const polygons = [];
|
|
394
|
-
const queue = new Queue_default();
|
|
395
|
-
queue.enqueue(polygonHierarchy);
|
|
396
|
-
let i;
|
|
397
|
-
let j;
|
|
398
|
-
let length;
|
|
399
|
-
while (queue.length !== 0) {
|
|
400
|
-
const outerNode = queue.dequeue();
|
|
401
|
-
let outerRing = outerNode.positions;
|
|
402
|
-
if (scaleToEllipsoidSurface) {
|
|
403
|
-
length = outerRing.length;
|
|
404
|
-
for (i = 0; i < length; i++) {
|
|
405
|
-
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
outerRing = arrayRemoveDuplicates_default(
|
|
409
|
-
outerRing,
|
|
410
|
-
Cartesian3_default.equalsEpsilon,
|
|
411
|
-
true
|
|
412
|
-
);
|
|
413
|
-
if (outerRing.length < 3) {
|
|
414
|
-
continue;
|
|
415
|
-
}
|
|
416
|
-
const numChildren = outerNode.holes ? outerNode.holes.length : 0;
|
|
417
|
-
for (i = 0; i < numChildren; i++) {
|
|
418
|
-
const hole = outerNode.holes[i];
|
|
419
|
-
let holePositions = hole.positions;
|
|
420
|
-
if (scaleToEllipsoidSurface) {
|
|
421
|
-
length = holePositions.length;
|
|
422
|
-
for (j = 0; j < length; ++j) {
|
|
423
|
-
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
holePositions = arrayRemoveDuplicates_default(
|
|
427
|
-
holePositions,
|
|
428
|
-
Cartesian3_default.equalsEpsilon,
|
|
429
|
-
true
|
|
430
|
-
);
|
|
431
|
-
if (holePositions.length < 3) {
|
|
432
|
-
continue;
|
|
433
|
-
}
|
|
434
|
-
polygons.push(holePositions);
|
|
435
|
-
let numGrandchildren = 0;
|
|
436
|
-
if (defined_default(hole.holes)) {
|
|
437
|
-
numGrandchildren = hole.holes.length;
|
|
438
|
-
}
|
|
439
|
-
for (j = 0; j < numGrandchildren; j++) {
|
|
440
|
-
queue.enqueue(hole.holes[j]);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
polygons.push(outerRing);
|
|
444
|
-
}
|
|
445
|
-
return polygons;
|
|
446
|
-
};
|
|
447
|
-
var scratchRhumbIntersection = new Cartographic_default();
|
|
448
|
-
function computeEquatorIntersectionRhumb(start, end, ellipsoid) {
|
|
449
|
-
const c0 = ellipsoid.cartesianToCartographic(start, scratchCartographic0);
|
|
450
|
-
const c1 = ellipsoid.cartesianToCartographic(end, scratchCartographic1);
|
|
451
|
-
if (Math.sign(c0.latitude) === Math.sign(c1.latitude)) {
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
scratchRhumbLine.setEndPoints(c0, c1);
|
|
455
|
-
const intersection = scratchRhumbLine.findIntersectionWithLatitude(
|
|
456
|
-
0,
|
|
457
|
-
scratchRhumbIntersection
|
|
458
|
-
);
|
|
459
|
-
if (!defined_default(intersection)) {
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
let minLongitude = Math.min(c0.longitude, c1.longitude);
|
|
463
|
-
let maxLongitude = Math.max(c0.longitude, c1.longitude);
|
|
464
|
-
if (Math.abs(maxLongitude - minLongitude) > Math_default.PI) {
|
|
465
|
-
const swap = minLongitude;
|
|
466
|
-
minLongitude = maxLongitude;
|
|
467
|
-
maxLongitude = swap;
|
|
468
|
-
}
|
|
469
|
-
if (intersection.longitude < minLongitude || intersection.longitude > maxLongitude) {
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
return ellipsoid.cartographicToCartesian(intersection);
|
|
473
|
-
}
|
|
474
|
-
function computeEquatorIntersection(start, end, ellipsoid, arcType) {
|
|
475
|
-
if (arcType === ArcType_default.RHUMB) {
|
|
476
|
-
return computeEquatorIntersectionRhumb(start, end, ellipsoid);
|
|
477
|
-
}
|
|
478
|
-
const intersection = IntersectionTests_default.lineSegmentPlane(
|
|
479
|
-
start,
|
|
480
|
-
end,
|
|
481
|
-
Plane_default.ORIGIN_XY_PLANE
|
|
482
|
-
);
|
|
483
|
-
if (!defined_default(intersection)) {
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
return ellipsoid.scaleToGeodeticSurface(intersection, intersection);
|
|
487
|
-
}
|
|
488
|
-
var scratchCartographic = new Cartographic_default();
|
|
489
|
-
function computeEdgesOnPlane(positions, ellipsoid, arcType) {
|
|
490
|
-
const edgesOnPlane = [];
|
|
491
|
-
let startPoint, endPoint, type, next, intersection, i = 0;
|
|
492
|
-
while (i < positions.length) {
|
|
493
|
-
startPoint = positions[i];
|
|
494
|
-
endPoint = positions[(i + 1) % positions.length];
|
|
495
|
-
type = Math_default.sign(startPoint.z);
|
|
496
|
-
next = Math_default.sign(endPoint.z);
|
|
497
|
-
const getLongitude = (position) => {
|
|
498
|
-
const cartographic = ellipsoid.cartesianToCartographic(
|
|
499
|
-
position,
|
|
500
|
-
scratchCartographic
|
|
501
|
-
);
|
|
502
|
-
return cartographic.longitude;
|
|
503
|
-
};
|
|
504
|
-
if (type === 0) {
|
|
505
|
-
edgesOnPlane.push({
|
|
506
|
-
position: i,
|
|
507
|
-
type,
|
|
508
|
-
visited: false,
|
|
509
|
-
next,
|
|
510
|
-
theta: getLongitude(startPoint)
|
|
511
|
-
});
|
|
512
|
-
} else if (next !== 0) {
|
|
513
|
-
intersection = computeEquatorIntersection(
|
|
514
|
-
startPoint,
|
|
515
|
-
endPoint,
|
|
516
|
-
ellipsoid,
|
|
517
|
-
arcType
|
|
518
|
-
);
|
|
519
|
-
++i;
|
|
520
|
-
if (!defined_default(intersection)) {
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
positions.splice(i, 0, intersection);
|
|
524
|
-
edgesOnPlane.push({
|
|
525
|
-
position: i,
|
|
526
|
-
type,
|
|
527
|
-
visited: false,
|
|
528
|
-
next,
|
|
529
|
-
theta: getLongitude(intersection)
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
++i;
|
|
533
|
-
}
|
|
534
|
-
return edgesOnPlane;
|
|
535
|
-
}
|
|
536
|
-
function wirePolygon(polygons, polygonIndex, positions, edgesOnPlane, toDelete, startIndex, abovePlane) {
|
|
537
|
-
const polygon = [];
|
|
538
|
-
let i = startIndex;
|
|
539
|
-
const getMatchingEdge = (i2) => (edge) => edge.position === i2;
|
|
540
|
-
const polygonsToWire = [];
|
|
541
|
-
do {
|
|
542
|
-
const position = positions[i];
|
|
543
|
-
polygon.push(position);
|
|
544
|
-
const edgeIndex = edgesOnPlane.findIndex(getMatchingEdge(i));
|
|
545
|
-
const edge = edgesOnPlane[edgeIndex];
|
|
546
|
-
if (!defined_default(edge)) {
|
|
547
|
-
++i;
|
|
548
|
-
continue;
|
|
549
|
-
}
|
|
550
|
-
const { visited: hasBeenVisited, type, next } = edge;
|
|
551
|
-
edge.visited = true;
|
|
552
|
-
if (type === 0) {
|
|
553
|
-
if (next === 0) {
|
|
554
|
-
const previousEdge = edgesOnPlane[edgeIndex - (abovePlane ? 1 : -1)];
|
|
555
|
-
if (previousEdge?.position === i + 1) {
|
|
556
|
-
previousEdge.visited = true;
|
|
557
|
-
} else {
|
|
558
|
-
++i;
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
if (!hasBeenVisited && abovePlane && next > 0 || startIndex === i && !abovePlane && next < 0) {
|
|
563
|
-
++i;
|
|
564
|
-
continue;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
const followEdge = abovePlane ? type >= 0 : type <= 0;
|
|
568
|
-
if (!followEdge) {
|
|
569
|
-
++i;
|
|
570
|
-
continue;
|
|
571
|
-
}
|
|
572
|
-
if (!hasBeenVisited) {
|
|
573
|
-
polygonsToWire.push(i);
|
|
574
|
-
}
|
|
575
|
-
const nextEdgeIndex = edgeIndex + (abovePlane ? 1 : -1);
|
|
576
|
-
const nextEdge = edgesOnPlane[nextEdgeIndex];
|
|
577
|
-
if (!defined_default(nextEdge)) {
|
|
578
|
-
++i;
|
|
579
|
-
continue;
|
|
580
|
-
}
|
|
581
|
-
i = nextEdge.position;
|
|
582
|
-
} while (i < positions.length && i >= 0 && i !== startIndex && polygon.length < positions.length);
|
|
583
|
-
polygons.splice(polygonIndex, toDelete, polygon);
|
|
584
|
-
for (const index of polygonsToWire) {
|
|
585
|
-
polygonIndex = wirePolygon(
|
|
586
|
-
polygons,
|
|
587
|
-
polygonIndex + 1,
|
|
588
|
-
positions,
|
|
589
|
-
edgesOnPlane,
|
|
590
|
-
0,
|
|
591
|
-
index,
|
|
592
|
-
!abovePlane
|
|
593
|
-
);
|
|
594
|
-
}
|
|
595
|
-
return polygonIndex;
|
|
596
|
-
}
|
|
597
|
-
PolygonGeometryLibrary.splitPolygonsOnEquator = function(outerRings, ellipsoid, arcType, result) {
|
|
598
|
-
if (!defined_default(result)) {
|
|
599
|
-
result = [];
|
|
600
|
-
}
|
|
601
|
-
result.splice(0, 0, ...outerRings);
|
|
602
|
-
result.length = outerRings.length;
|
|
603
|
-
let currentPolygon = 0;
|
|
604
|
-
while (currentPolygon < result.length) {
|
|
605
|
-
const outerRing = result[currentPolygon];
|
|
606
|
-
const positions = outerRing.slice();
|
|
607
|
-
if (outerRing.length < 3) {
|
|
608
|
-
result[currentPolygon] = positions;
|
|
609
|
-
++currentPolygon;
|
|
610
|
-
continue;
|
|
611
|
-
}
|
|
612
|
-
const edgesOnPlane = computeEdgesOnPlane(positions, ellipsoid, arcType);
|
|
613
|
-
if (positions.length === outerRing.length || edgesOnPlane.length <= 1) {
|
|
614
|
-
result[currentPolygon] = positions;
|
|
615
|
-
++currentPolygon;
|
|
616
|
-
continue;
|
|
617
|
-
}
|
|
618
|
-
edgesOnPlane.sort((a, b) => {
|
|
619
|
-
return a.theta - b.theta;
|
|
620
|
-
});
|
|
621
|
-
const north = positions[0].z >= 0;
|
|
622
|
-
currentPolygon = wirePolygon(
|
|
623
|
-
result,
|
|
624
|
-
currentPolygon,
|
|
625
|
-
positions,
|
|
626
|
-
edgesOnPlane,
|
|
627
|
-
1,
|
|
628
|
-
0,
|
|
629
|
-
north
|
|
630
|
-
);
|
|
631
|
-
}
|
|
632
|
-
return result;
|
|
633
|
-
};
|
|
634
|
-
PolygonGeometryLibrary.polygonsFromHierarchy = function(polygonHierarchy, keepDuplicates, projectPointsTo2D, scaleToEllipsoidSurface, ellipsoid, splitPolygons) {
|
|
635
|
-
const hierarchy = [];
|
|
636
|
-
const polygons = [];
|
|
637
|
-
const queue = new Queue_default();
|
|
638
|
-
queue.enqueue(polygonHierarchy);
|
|
639
|
-
let split = defined_default(splitPolygons);
|
|
640
|
-
while (queue.length !== 0) {
|
|
641
|
-
const outerNode = queue.dequeue();
|
|
642
|
-
let outerRing = outerNode.positions;
|
|
643
|
-
const holes = outerNode.holes;
|
|
644
|
-
let i;
|
|
645
|
-
let length;
|
|
646
|
-
if (scaleToEllipsoidSurface) {
|
|
647
|
-
length = outerRing.length;
|
|
648
|
-
for (i = 0; i < length; i++) {
|
|
649
|
-
ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
if (!keepDuplicates) {
|
|
653
|
-
outerRing = arrayRemoveDuplicates_default(
|
|
654
|
-
outerRing,
|
|
655
|
-
Cartesian3_default.equalsEpsilon,
|
|
656
|
-
true
|
|
657
|
-
);
|
|
658
|
-
}
|
|
659
|
-
if (outerRing.length < 3) {
|
|
660
|
-
continue;
|
|
661
|
-
}
|
|
662
|
-
let positions2D = projectPointsTo2D(outerRing);
|
|
663
|
-
if (!defined_default(positions2D)) {
|
|
664
|
-
continue;
|
|
665
|
-
}
|
|
666
|
-
const holeIndices = [];
|
|
667
|
-
let originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
|
|
668
|
-
if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
|
|
669
|
-
positions2D.reverse();
|
|
670
|
-
outerRing = outerRing.slice().reverse();
|
|
671
|
-
}
|
|
672
|
-
if (split) {
|
|
673
|
-
split = false;
|
|
674
|
-
let polygons2 = [outerRing];
|
|
675
|
-
polygons2 = splitPolygons(polygons2, polygons2);
|
|
676
|
-
if (polygons2.length > 1) {
|
|
677
|
-
for (const positions2 of polygons2) {
|
|
678
|
-
queue.enqueue(new PolygonHierarchy_default(positions2, holes));
|
|
679
|
-
}
|
|
680
|
-
continue;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
let positions = outerRing.slice();
|
|
684
|
-
const numChildren = defined_default(holes) ? holes.length : 0;
|
|
685
|
-
const polygonHoles = [];
|
|
686
|
-
let j;
|
|
687
|
-
for (i = 0; i < numChildren; i++) {
|
|
688
|
-
const hole = holes[i];
|
|
689
|
-
let holePositions = hole.positions;
|
|
690
|
-
if (scaleToEllipsoidSurface) {
|
|
691
|
-
length = holePositions.length;
|
|
692
|
-
for (j = 0; j < length; ++j) {
|
|
693
|
-
ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
if (!keepDuplicates) {
|
|
697
|
-
holePositions = arrayRemoveDuplicates_default(
|
|
698
|
-
holePositions,
|
|
699
|
-
Cartesian3_default.equalsEpsilon,
|
|
700
|
-
true
|
|
701
|
-
);
|
|
702
|
-
}
|
|
703
|
-
if (holePositions.length < 3) {
|
|
704
|
-
continue;
|
|
705
|
-
}
|
|
706
|
-
const holePositions2D = projectPointsTo2D(holePositions);
|
|
707
|
-
if (!defined_default(holePositions2D)) {
|
|
708
|
-
continue;
|
|
709
|
-
}
|
|
710
|
-
originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(holePositions2D);
|
|
711
|
-
if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
|
|
712
|
-
holePositions2D.reverse();
|
|
713
|
-
holePositions = holePositions.slice().reverse();
|
|
714
|
-
}
|
|
715
|
-
polygonHoles.push(holePositions);
|
|
716
|
-
holeIndices.push(positions.length);
|
|
717
|
-
positions = positions.concat(holePositions);
|
|
718
|
-
positions2D = positions2D.concat(holePositions2D);
|
|
719
|
-
let numGrandchildren = 0;
|
|
720
|
-
if (defined_default(hole.holes)) {
|
|
721
|
-
numGrandchildren = hole.holes.length;
|
|
722
|
-
}
|
|
723
|
-
for (j = 0; j < numGrandchildren; j++) {
|
|
724
|
-
queue.enqueue(hole.holes[j]);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
hierarchy.push({
|
|
728
|
-
outerRing,
|
|
729
|
-
holes: polygonHoles
|
|
730
|
-
});
|
|
731
|
-
polygons.push({
|
|
732
|
-
positions,
|
|
733
|
-
positions2D,
|
|
734
|
-
holes: holeIndices
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
return {
|
|
738
|
-
hierarchy,
|
|
739
|
-
polygons
|
|
740
|
-
};
|
|
741
|
-
};
|
|
742
|
-
var computeBoundingRectangleCartesian2 = new Cartesian2_default();
|
|
743
|
-
var computeBoundingRectangleCartesian3 = new Cartesian3_default();
|
|
744
|
-
var computeBoundingRectangleQuaternion = new Quaternion_default();
|
|
745
|
-
var computeBoundingRectangleMatrix3 = new Matrix3_default();
|
|
746
|
-
PolygonGeometryLibrary.computeBoundingRectangle = function(planeNormal, projectPointTo2D, positions, angle, result) {
|
|
747
|
-
const rotation = Quaternion_default.fromAxisAngle(
|
|
748
|
-
planeNormal,
|
|
749
|
-
angle,
|
|
750
|
-
computeBoundingRectangleQuaternion
|
|
751
|
-
);
|
|
752
|
-
const textureMatrix = Matrix3_default.fromQuaternion(
|
|
753
|
-
rotation,
|
|
754
|
-
computeBoundingRectangleMatrix3
|
|
755
|
-
);
|
|
756
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
757
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
758
|
-
let minY = Number.POSITIVE_INFINITY;
|
|
759
|
-
let maxY = Number.NEGATIVE_INFINITY;
|
|
760
|
-
const length = positions.length;
|
|
761
|
-
for (let i = 0; i < length; ++i) {
|
|
762
|
-
const p = Cartesian3_default.clone(
|
|
763
|
-
positions[i],
|
|
764
|
-
computeBoundingRectangleCartesian3
|
|
765
|
-
);
|
|
766
|
-
Matrix3_default.multiplyByVector(textureMatrix, p, p);
|
|
767
|
-
const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);
|
|
768
|
-
if (defined_default(st)) {
|
|
769
|
-
minX = Math.min(minX, st.x);
|
|
770
|
-
maxX = Math.max(maxX, st.x);
|
|
771
|
-
minY = Math.min(minY, st.y);
|
|
772
|
-
maxY = Math.max(maxY, st.y);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
result.x = minX;
|
|
776
|
-
result.y = minY;
|
|
777
|
-
result.width = maxX - minX;
|
|
778
|
-
result.height = maxY - minY;
|
|
779
|
-
return result;
|
|
780
|
-
};
|
|
781
|
-
PolygonGeometryLibrary.createGeometryFromPositions = function(ellipsoid, polygon, textureCoordinates, granularity, perPositionHeight, vertexFormat, arcType) {
|
|
782
|
-
let indices = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
|
|
783
|
-
if (indices.length < 3) {
|
|
784
|
-
indices = [0, 1, 2];
|
|
785
|
-
}
|
|
786
|
-
const positions = polygon.positions;
|
|
787
|
-
const hasTexcoords = defined_default(textureCoordinates);
|
|
788
|
-
const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
|
|
789
|
-
if (perPositionHeight) {
|
|
790
|
-
const length = positions.length;
|
|
791
|
-
const flattenedPositions = new Array(length * 3);
|
|
792
|
-
let index = 0;
|
|
793
|
-
for (let i = 0; i < length; i++) {
|
|
794
|
-
const p = positions[i];
|
|
795
|
-
flattenedPositions[index++] = p.x;
|
|
796
|
-
flattenedPositions[index++] = p.y;
|
|
797
|
-
flattenedPositions[index++] = p.z;
|
|
798
|
-
}
|
|
799
|
-
const geometryOptions = {
|
|
800
|
-
attributes: {
|
|
801
|
-
position: new GeometryAttribute_default({
|
|
802
|
-
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
803
|
-
componentsPerAttribute: 3,
|
|
804
|
-
values: flattenedPositions
|
|
805
|
-
})
|
|
806
|
-
},
|
|
807
|
-
indices,
|
|
808
|
-
primitiveType: PrimitiveType_default.TRIANGLES
|
|
809
|
-
};
|
|
810
|
-
if (hasTexcoords) {
|
|
811
|
-
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
812
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
813
|
-
componentsPerAttribute: 2,
|
|
814
|
-
values: Cartesian2_default.packArray(texcoords)
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
const geometry = new Geometry_default(geometryOptions);
|
|
818
|
-
if (vertexFormat.normal) {
|
|
819
|
-
return GeometryPipeline_default.computeNormal(geometry);
|
|
820
|
-
}
|
|
821
|
-
return geometry;
|
|
822
|
-
}
|
|
823
|
-
if (arcType === ArcType_default.GEODESIC) {
|
|
824
|
-
return PolygonPipeline_default.computeSubdivision(
|
|
825
|
-
ellipsoid,
|
|
826
|
-
positions,
|
|
827
|
-
indices,
|
|
828
|
-
texcoords,
|
|
829
|
-
granularity
|
|
830
|
-
);
|
|
831
|
-
} else if (arcType === ArcType_default.RHUMB) {
|
|
832
|
-
return PolygonPipeline_default.computeRhumbLineSubdivision(
|
|
833
|
-
ellipsoid,
|
|
834
|
-
positions,
|
|
835
|
-
indices,
|
|
836
|
-
texcoords,
|
|
837
|
-
granularity
|
|
838
|
-
);
|
|
839
|
-
}
|
|
840
|
-
};
|
|
841
|
-
var computeWallTexcoordsSubdivided = [];
|
|
842
|
-
var computeWallIndicesSubdivided = [];
|
|
843
|
-
var p1Scratch = new Cartesian3_default();
|
|
844
|
-
var p2Scratch = new Cartesian3_default();
|
|
845
|
-
PolygonGeometryLibrary.computeWallGeometry = function(positions, textureCoordinates, ellipsoid, granularity, perPositionHeight, arcType) {
|
|
846
|
-
let edgePositions;
|
|
847
|
-
let topEdgeLength;
|
|
848
|
-
let i;
|
|
849
|
-
let p1;
|
|
850
|
-
let p2;
|
|
851
|
-
let t1;
|
|
852
|
-
let t2;
|
|
853
|
-
let edgeTexcoords;
|
|
854
|
-
let topEdgeTexcoordLength;
|
|
855
|
-
let length = positions.length;
|
|
856
|
-
let index = 0;
|
|
857
|
-
let textureIndex = 0;
|
|
858
|
-
const hasTexcoords = defined_default(textureCoordinates);
|
|
859
|
-
const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
|
|
860
|
-
if (!perPositionHeight) {
|
|
861
|
-
const minDistance = Math_default.chordLength(
|
|
862
|
-
granularity,
|
|
863
|
-
ellipsoid.maximumRadius
|
|
864
|
-
);
|
|
865
|
-
let numVertices = 0;
|
|
866
|
-
if (arcType === ArcType_default.GEODESIC) {
|
|
867
|
-
for (i = 0; i < length; i++) {
|
|
868
|
-
numVertices += PolygonGeometryLibrary.subdivideLineCount(
|
|
869
|
-
positions[i],
|
|
870
|
-
positions[(i + 1) % length],
|
|
871
|
-
minDistance
|
|
872
|
-
);
|
|
873
|
-
}
|
|
874
|
-
} else if (arcType === ArcType_default.RHUMB) {
|
|
875
|
-
for (i = 0; i < length; i++) {
|
|
876
|
-
numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(
|
|
877
|
-
ellipsoid,
|
|
878
|
-
positions[i],
|
|
879
|
-
positions[(i + 1) % length],
|
|
880
|
-
minDistance
|
|
881
|
-
);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
topEdgeLength = (numVertices + length) * 3;
|
|
885
|
-
edgePositions = new Array(topEdgeLength * 2);
|
|
886
|
-
if (hasTexcoords) {
|
|
887
|
-
topEdgeTexcoordLength = (numVertices + length) * 2;
|
|
888
|
-
edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
|
|
889
|
-
}
|
|
890
|
-
for (i = 0; i < length; i++) {
|
|
891
|
-
p1 = positions[i];
|
|
892
|
-
p2 = positions[(i + 1) % length];
|
|
893
|
-
let tempPositions;
|
|
894
|
-
let tempTexcoords;
|
|
895
|
-
if (hasTexcoords) {
|
|
896
|
-
t1 = texcoords[i];
|
|
897
|
-
t2 = texcoords[(i + 1) % length];
|
|
898
|
-
}
|
|
899
|
-
if (arcType === ArcType_default.GEODESIC) {
|
|
900
|
-
tempPositions = PolygonGeometryLibrary.subdivideLine(
|
|
901
|
-
p1,
|
|
902
|
-
p2,
|
|
903
|
-
minDistance,
|
|
904
|
-
computeWallIndicesSubdivided
|
|
905
|
-
);
|
|
906
|
-
if (hasTexcoords) {
|
|
907
|
-
tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(
|
|
908
|
-
t1,
|
|
909
|
-
t2,
|
|
910
|
-
p1,
|
|
911
|
-
p2,
|
|
912
|
-
minDistance,
|
|
913
|
-
computeWallTexcoordsSubdivided
|
|
914
|
-
);
|
|
915
|
-
}
|
|
916
|
-
} else if (arcType === ArcType_default.RHUMB) {
|
|
917
|
-
tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(
|
|
918
|
-
ellipsoid,
|
|
919
|
-
p1,
|
|
920
|
-
p2,
|
|
921
|
-
minDistance,
|
|
922
|
-
computeWallIndicesSubdivided
|
|
923
|
-
);
|
|
924
|
-
if (hasTexcoords) {
|
|
925
|
-
tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(
|
|
926
|
-
t1,
|
|
927
|
-
t2,
|
|
928
|
-
ellipsoid,
|
|
929
|
-
p1,
|
|
930
|
-
p2,
|
|
931
|
-
minDistance,
|
|
932
|
-
computeWallTexcoordsSubdivided
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
const tempPositionsLength = tempPositions.length;
|
|
937
|
-
for (let j = 0; j < tempPositionsLength; ++j, ++index) {
|
|
938
|
-
edgePositions[index] = tempPositions[j];
|
|
939
|
-
edgePositions[index + topEdgeLength] = tempPositions[j];
|
|
940
|
-
}
|
|
941
|
-
edgePositions[index] = p2.x;
|
|
942
|
-
edgePositions[index + topEdgeLength] = p2.x;
|
|
943
|
-
++index;
|
|
944
|
-
edgePositions[index] = p2.y;
|
|
945
|
-
edgePositions[index + topEdgeLength] = p2.y;
|
|
946
|
-
++index;
|
|
947
|
-
edgePositions[index] = p2.z;
|
|
948
|
-
edgePositions[index + topEdgeLength] = p2.z;
|
|
949
|
-
++index;
|
|
950
|
-
if (hasTexcoords) {
|
|
951
|
-
const tempTexcoordsLength = tempTexcoords.length;
|
|
952
|
-
for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {
|
|
953
|
-
edgeTexcoords[textureIndex] = tempTexcoords[k];
|
|
954
|
-
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = tempTexcoords[k];
|
|
955
|
-
}
|
|
956
|
-
edgeTexcoords[textureIndex] = t2.x;
|
|
957
|
-
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
|
|
958
|
-
++textureIndex;
|
|
959
|
-
edgeTexcoords[textureIndex] = t2.y;
|
|
960
|
-
edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
|
|
961
|
-
++textureIndex;
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
} else {
|
|
965
|
-
topEdgeLength = length * 3 * 2;
|
|
966
|
-
edgePositions = new Array(topEdgeLength * 2);
|
|
967
|
-
if (hasTexcoords) {
|
|
968
|
-
topEdgeTexcoordLength = length * 2 * 2;
|
|
969
|
-
edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
|
|
970
|
-
}
|
|
971
|
-
for (i = 0; i < length; i++) {
|
|
972
|
-
p1 = positions[i];
|
|
973
|
-
p2 = positions[(i + 1) % length];
|
|
974
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;
|
|
975
|
-
++index;
|
|
976
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;
|
|
977
|
-
++index;
|
|
978
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;
|
|
979
|
-
++index;
|
|
980
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;
|
|
981
|
-
++index;
|
|
982
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;
|
|
983
|
-
++index;
|
|
984
|
-
edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;
|
|
985
|
-
++index;
|
|
986
|
-
if (hasTexcoords) {
|
|
987
|
-
t1 = texcoords[i];
|
|
988
|
-
t2 = texcoords[(i + 1) % length];
|
|
989
|
-
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.x;
|
|
990
|
-
++textureIndex;
|
|
991
|
-
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.y;
|
|
992
|
-
++textureIndex;
|
|
993
|
-
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
|
|
994
|
-
++textureIndex;
|
|
995
|
-
edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
|
|
996
|
-
++textureIndex;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
length = edgePositions.length;
|
|
1001
|
-
const indices = IndexDatatype_default.createTypedArray(
|
|
1002
|
-
length / 3,
|
|
1003
|
-
length - positions.length * 6
|
|
1004
|
-
);
|
|
1005
|
-
let edgeIndex = 0;
|
|
1006
|
-
length /= 6;
|
|
1007
|
-
for (i = 0; i < length; i++) {
|
|
1008
|
-
const UL = i;
|
|
1009
|
-
const UR = UL + 1;
|
|
1010
|
-
const LL = UL + length;
|
|
1011
|
-
const LR = LL + 1;
|
|
1012
|
-
p1 = Cartesian3_default.fromArray(edgePositions, UL * 3, p1Scratch);
|
|
1013
|
-
p2 = Cartesian3_default.fromArray(edgePositions, UR * 3, p2Scratch);
|
|
1014
|
-
if (Cartesian3_default.equalsEpsilon(
|
|
1015
|
-
p1,
|
|
1016
|
-
p2,
|
|
1017
|
-
Math_default.EPSILON10,
|
|
1018
|
-
Math_default.EPSILON10
|
|
1019
|
-
)) {
|
|
1020
|
-
continue;
|
|
1021
|
-
}
|
|
1022
|
-
indices[edgeIndex++] = UL;
|
|
1023
|
-
indices[edgeIndex++] = LL;
|
|
1024
|
-
indices[edgeIndex++] = UR;
|
|
1025
|
-
indices[edgeIndex++] = UR;
|
|
1026
|
-
indices[edgeIndex++] = LL;
|
|
1027
|
-
indices[edgeIndex++] = LR;
|
|
1028
|
-
}
|
|
1029
|
-
const geometryOptions = {
|
|
1030
|
-
attributes: new GeometryAttributes_default({
|
|
1031
|
-
position: new GeometryAttribute_default({
|
|
1032
|
-
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
1033
|
-
componentsPerAttribute: 3,
|
|
1034
|
-
values: edgePositions
|
|
1035
|
-
})
|
|
1036
|
-
}),
|
|
1037
|
-
indices,
|
|
1038
|
-
primitiveType: PrimitiveType_default.TRIANGLES
|
|
1039
|
-
};
|
|
1040
|
-
if (hasTexcoords) {
|
|
1041
|
-
geometryOptions.attributes.st = new GeometryAttribute_default({
|
|
1042
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
1043
|
-
componentsPerAttribute: 2,
|
|
1044
|
-
values: edgeTexcoords
|
|
1045
|
-
});
|
|
1046
|
-
}
|
|
1047
|
-
const geometry = new Geometry_default(geometryOptions);
|
|
1048
|
-
return geometry;
|
|
1049
|
-
};
|
|
1050
|
-
var PolygonGeometryLibrary_default = PolygonGeometryLibrary;
|
|
1051
|
-
|
|
1052
|
-
export {
|
|
1053
|
-
PolygonGeometryLibrary_default
|
|
1054
|
-
};
|