@hztxi/cesium-engine 25.0.6 → 26.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/chunk-2GJAWJJT.js +1344 -0
- package/Build/Workers/chunk-2J2VS5RI.js +288 -0
- package/Build/Workers/chunk-2NCNUVAT.js +56 -0
- package/Build/Workers/chunk-2ZYRUVVU.js +301 -0
- package/Build/Workers/chunk-36IU7N4V.js +1284 -0
- package/Build/Workers/chunk-375SHKGW.js +44 -0
- package/Build/Workers/chunk-3BDLET5S.js +198 -0
- package/Build/Workers/chunk-3PRHI4KX.js +241 -0
- package/Build/Workers/chunk-3R6E2SH4.js +672 -0
- package/Build/Workers/chunk-3ZKKXEXL.js +415 -0
- package/Build/Workers/chunk-47KVKPTO.js +415 -0
- package/Build/Workers/chunk-4N227IPR.js +973 -0
- package/Build/Workers/chunk-4P6OAPBM.js +97 -0
- package/Build/Workers/chunk-4ZOLEPZK.js +519 -0
- package/Build/Workers/chunk-5EF3WWQG.js +352 -0
- package/Build/Workers/chunk-5FYUSABU.js +945 -0
- package/Build/Workers/chunk-5I76476T.js +288 -0
- package/Build/Workers/chunk-5PBZKBAP.js +511 -0
- package/Build/Workers/chunk-5RVAAW26.js +82 -0
- package/Build/Workers/chunk-5VWK76PO.js +511 -0
- package/Build/Workers/chunk-5WU37CUJ.js +630 -0
- package/Build/Workers/chunk-6EBDN5WS.js +97 -0
- package/Build/Workers/chunk-75HIWCEV.js +301 -0
- package/Build/Workers/chunk-77DBX23X.js +455 -0
- package/Build/Workers/chunk-7AMVPXZY.js +1992 -0
- package/Build/Workers/chunk-7BMDD6SM.js +124 -0
- package/Build/Workers/chunk-7GQOWCSN.js +959 -0
- package/Build/Workers/chunk-7J2ONMKC.js +198 -0
- package/Build/Workers/chunk-7MHUHXZZ.js +219 -0
- package/Build/Workers/chunk-7MQPHOAS.js +455 -0
- package/Build/Workers/chunk-7NJ5O7TP.js +387 -0
- package/Build/Workers/chunk-7OME2OKM.js +171 -0
- package/Build/Workers/chunk-7Y642MCO.js +352 -0
- package/Build/Workers/chunk-7ZFKBLUE.js +1054 -0
- package/Build/Workers/chunk-A2BROW3D.js +352 -0
- package/Build/Workers/chunk-A7LGY5XS.js +140 -0
- package/Build/Workers/chunk-AN2NVYL6.js +1483 -0
- package/Build/Workers/chunk-B4XOVZGA.js +476 -0
- package/Build/Workers/chunk-B7PT2VL5.js +630 -0
- package/Build/Workers/chunk-C6XQGBPV.js +476 -0
- package/Build/Workers/chunk-CAEC5DA2.js +57 -0
- package/Build/Workers/chunk-CBCOHH5O.js +837 -0
- package/Build/Workers/chunk-CDLPLYLV.js +1287 -0
- package/Build/Workers/chunk-CEKCKPFN.js +368 -0
- package/Build/Workers/chunk-CEMXKBQO.js +1800 -0
- package/Build/Workers/chunk-CHMDKP5L.js +2342 -0
- package/Build/Workers/chunk-CKW3STKA.js +1067 -0
- package/Build/Workers/chunk-CV5RICKT.js +1992 -0
- package/Build/Workers/chunk-CWGB3D4Z.js +257 -0
- package/Build/Workers/chunk-DBWSISJT.js +56 -0
- package/Build/Workers/chunk-DQEUGBGA.js +2719 -0
- package/Build/Workers/chunk-DSBSPPPJ.js +1344 -0
- package/Build/Workers/chunk-DSGLDRTI.js +278 -0
- package/Build/Workers/chunk-DUBE5G2H.js +497 -0
- package/Build/Workers/chunk-DXD7OPSP.js +1992 -0
- package/Build/Workers/chunk-DXECZBSA.js +368 -0
- package/Build/Workers/chunk-DZIRO6ZK.js +682 -0
- package/Build/Workers/chunk-E4CRPGX5.js +140 -0
- package/Build/Workers/chunk-E4IVMEBH.js +52 -0
- package/Build/Workers/chunk-E4PBNWWK.js +58 -0
- package/Build/Workers/chunk-E5MWOMVC.js +57 -0
- package/Build/Workers/chunk-ECN3VUMA.js +73 -0
- package/Build/Workers/chunk-ECSKVHUB.js +476 -0
- package/Build/Workers/chunk-EE3XBOQI.js +1483 -0
- package/Build/Workers/chunk-EHA2ZDPZ.js +415 -0
- package/Build/Workers/chunk-EKEKPAJF.js +454 -0
- package/Build/Workers/chunk-EL4B5CSQ.js +162 -0
- package/Build/Workers/chunk-EOHKUXPX.js +198 -0
- package/Build/Workers/chunk-ERENMHG2.js +754 -0
- package/Build/Workers/chunk-ESQGFRLZ.js +163 -0
- package/Build/Workers/chunk-FAYBQGKO.js +219 -0
- package/Build/Workers/chunk-FGCXPEZM.js +3201 -0
- package/Build/Workers/chunk-FHCRXPA6.js +44 -0
- package/Build/Workers/chunk-FQ42MT7M.js +58 -0
- package/Build/Workers/chunk-FQDYQG4P.js +1284 -0
- package/Build/Workers/chunk-FTCBY5HH.js +138 -0
- package/Build/Workers/chunk-FV4OWDV4.js +9230 -0
- package/Build/Workers/chunk-FYRNNQSL.js +280 -0
- package/Build/Workers/chunk-GI5RWJAY.js +101 -0
- package/Build/Workers/chunk-GNLMSDRO.js +945 -0
- package/Build/Workers/chunk-GVUJ6O3R.js +73 -0
- package/Build/Workers/chunk-HCGU7OCG.js +97 -0
- package/Build/Workers/chunk-HRIPVWSC.js +58 -0
- package/Build/Workers/chunk-IC3BR6SC.js +102 -0
- package/Build/Workers/chunk-IU3YAYPT.js +1344 -0
- package/Build/Workers/chunk-J7MZR7B2.js +1483 -0
- package/Build/Workers/chunk-JMF4ATAS.js +3794 -0
- package/Build/Workers/chunk-KEJKMITY.js +82 -0
- package/Build/Workers/chunk-KSIEJYNL.js +3822 -0
- package/Build/Workers/chunk-KT3GG7AW.js +754 -0
- package/Build/Workers/chunk-KW2QZDUS.js +147 -0
- package/Build/Workers/chunk-KYCEM22I.js +1800 -0
- package/Build/Workers/chunk-L6B5XPBL.js +73 -0
- package/Build/Workers/chunk-LGJXN2VP.js +352 -0
- package/Build/Workers/chunk-LJTQW46H.js +57 -0
- package/Build/Workers/chunk-LMQGYJME.js +672 -0
- package/Build/Workers/chunk-LOBYJQA4.js +76 -0
- package/Build/Workers/chunk-LOF32O7F.js +163 -0
- package/Build/Workers/chunk-LOTIJA7D.js +124 -0
- package/Build/Workers/chunk-LY2UG3HV.js +38 -0
- package/Build/Workers/chunk-M7Z3MPAX.js +973 -0
- package/Build/Workers/chunk-MHNLTQHO.js +3201 -0
- package/Build/Workers/chunk-ML7OMD72.js +2342 -0
- package/Build/Workers/chunk-NBTGXEMT.js +945 -0
- package/Build/Workers/chunk-NCPJBP24.js +140 -0
- package/Build/Workers/chunk-NFY5V6MR.js +102 -0
- package/Build/Workers/chunk-NQZC37F7.js +38 -0
- package/Build/Workers/chunk-O3X3D2Z3.js +352 -0
- package/Build/Workers/chunk-OBUIHPKF.js +352 -0
- package/Build/Workers/chunk-OYPSUED3.js +1067 -0
- package/Build/Workers/chunk-PAEWNYIV.js +138 -0
- package/Build/Workers/chunk-PANJ7YH6.js +102 -0
- package/Build/Workers/chunk-PCL3Y7H5.js +82 -0
- package/Build/Workers/chunk-PIIUGRQD.js +387 -0
- package/Build/Workers/chunk-POKD22OT.js +2719 -0
- package/Build/Workers/chunk-PQMA7MFS.js +9237 -0
- package/Build/Workers/chunk-PURIPUSY.js +682 -0
- package/Build/Workers/chunk-QIOOTLWN.js +56 -0
- package/Build/Workers/chunk-QQZPPXY4.js +3822 -0
- package/Build/Workers/chunk-QUPRALOD.js +101 -0
- package/Build/Workers/chunk-QXLQLGL2.js +1067 -0
- package/Build/Workers/chunk-RBEVHHXK.js +3201 -0
- package/Build/Workers/chunk-RC4YC3VU.js +278 -0
- package/Build/Workers/chunk-RGNNWVR6.js +171 -0
- package/Build/Workers/chunk-RHO5HV52.js +305 -0
- package/Build/Workers/chunk-SBBIEHYT.js +44 -0
- package/Build/Workers/chunk-SVCZUP5R.js +837 -0
- package/Build/Workers/chunk-SWVZTU6X.js +305 -0
- package/Build/Workers/chunk-T3EUPM5A.js +454 -0
- package/Build/Workers/chunk-TA6IU2XL.js +171 -0
- package/Build/Workers/chunk-TBHW5UME.js +973 -0
- package/Build/Workers/chunk-TLSGD5TR.js +280 -0
- package/Build/Workers/chunk-TOXDLWKZ.js +368 -0
- package/Build/Workers/chunk-TPOX6IOR.js +1054 -0
- package/Build/Workers/chunk-TZBM6TAB.js +124 -0
- package/Build/Workers/chunk-U2OY6MX6.js +398 -0
- package/Build/Workers/chunk-UCY4B5EV.js +288 -0
- package/Build/Workers/chunk-ULNBTI6R.js +138 -0
- package/Build/Workers/chunk-UMUS2AQQ.js +398 -0
- package/Build/Workers/chunk-UZ7GTP2L.js +162 -0
- package/Build/Workers/chunk-V52FEPCV.js +754 -0
- package/Build/Workers/chunk-VBEXZBG5.js +147 -0
- package/Build/Workers/chunk-VC76B6GM.js +959 -0
- package/Build/Workers/chunk-VCUOYHWC.js +519 -0
- package/Build/Workers/chunk-VJIL5H6K.js +2719 -0
- package/Build/Workers/chunk-VMF7KOGY.js +162 -0
- package/Build/Workers/chunk-W3C7OHXF.js +387 -0
- package/Build/Workers/chunk-W5OCKMPJ.js +101 -0
- package/Build/Workers/chunk-WB5GWYDP.js +455 -0
- package/Build/Workers/chunk-WN6MAL25.js +682 -0
- package/Build/Workers/chunk-WTR7KMQA.js +693 -0
- package/Build/Workers/chunk-WTTFMU3P.js +241 -0
- package/Build/Workers/chunk-WULONJZC.js +1800 -0
- package/Build/Workers/chunk-WZPMAVTV.js +511 -0
- package/Build/Workers/chunk-XHT5SVP4.js +52 -0
- package/Build/Workers/chunk-XITBARMZ.js +2342 -0
- package/Build/Workers/chunk-XLQZNQ4Z.js +163 -0
- package/Build/Workers/chunk-XZ6HDXKM.js +76 -0
- package/Build/Workers/chunk-Y7KVUJEB.js +219 -0
- package/Build/Workers/chunk-Y7NDFEQ3.js +398 -0
- package/Build/Workers/chunk-YBBQDYX2.js +301 -0
- package/Build/Workers/chunk-YHPYPVAB.js +837 -0
- package/Build/Workers/chunk-YNKK6BXY.js +454 -0
- package/Build/Workers/chunk-YRAJ74HR.js +305 -0
- package/Build/Workers/chunk-YULTZK5O.js +147 -0
- package/Build/Workers/chunk-YUNQYP3Z.js +9237 -0
- package/Build/Workers/chunk-Z6JV4DZG.js +1046 -0
- package/Build/Workers/chunk-Z7BONRW2.js +241 -0
- package/Build/Workers/chunk-ZK2R3DEJ.js +1054 -0
- package/Build/Workers/chunk-ZTK5EBUI.js +76 -0
- package/Build/Workers/chunk-ZZPDORJK.js +56 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +18 -18
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +39 -39
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createCorridorGeometry.js +36 -37
- package/Build/Workers/createCorridorOutlineGeometry.js +34 -35
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -20
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +20 -20
- package/Build/Workers/createGeometry.js +25 -24
- package/Build/Workers/createGroundPolylineGeometry.js +98 -34
- package/Build/Workers/createMvtTile.js +111 -19
- package/Build/Workers/createPlaneGeometry.js +18 -18
- package/Build/Workers/createPlaneOutlineGeometry.js +17 -17
- package/Build/Workers/createPolygonGeometry.js +36 -36
- package/Build/Workers/createPolygonOutlineGeometry.js +33 -33
- package/Build/Workers/createPolylineGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeGeometry.js +38 -36
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +32 -31
- package/Build/Workers/createRectangleGeometry.js +29 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -23
- package/Build/Workers/createSimplePolylineGeometry.js +26 -26
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +23 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- package/Build/Workers/createWallGeometry.js +26 -26
- package/Build/Workers/createWallOutlineGeometry.js +26 -26
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +993 -2334
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +1 -5
- package/Source/Core/BoundingRectangle.js +6 -8
- package/Source/Core/BoundingSphere.js +0 -3
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +3 -4
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/CoplanarPolygonGeometry.js +2 -2
- package/Source/Core/CorridorGeometry.js +2 -4
- package/Source/Core/CorridorOutlineGeometry.js +1 -3
- package/Source/Core/EarthOrientationParameters.js +2 -2
- package/Source/Core/EllipseGeometryLibrary.js +2 -2
- package/Source/Core/EllipsoidGeodesic.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +99 -4
- package/Source/Core/Heap.js +1 -1
- package/Source/Core/HermitePolynomialApproximation.js +215 -179
- package/Source/Core/InterpolationAlgorithm.js +58 -50
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/JulianDate.js +1 -1
- package/Source/Core/LagrangePolynomialApproximation.js +55 -52
- package/Source/Core/LinearApproximation.js +69 -66
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Math.js +59 -0
- package/Source/Core/Matrix2.js +3 -3
- package/Source/Core/Matrix3.js +3 -3
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/OrthographicFrustum.js +1 -1
- package/Source/Core/PerspectiveFrustum.js +1 -1
- package/Source/Core/PolygonGeometry.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylinePipeline.js +9 -2
- package/Source/Core/PolylineVolumeGeometryLibrary.js +1 -1
- package/Source/Core/Rectangle.js +7 -1
- package/Source/Core/RectangleOutlineGeometry.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/SimplePolylineGeometry.js +1 -1
- package/Source/Core/TerrainEncoding.js +2 -2
- package/Source/Core/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +180 -168
- package/Source/Core/TimeIntervalCollection.js +1 -3
- package/Source/Core/Tipsify.js +1 -1
- package/Source/Core/Transforms.js +5 -1
- package/Source/Core/VectorPipeline.js +1117 -0
- package/Source/Core/VectorProvider.js +429 -0
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/getTimestamp.js +4 -2
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CompositeEntityCollection.js +0 -1
- package/Source/DataSources/CzmlDataSource.js +14 -0
- package/Source/DataSources/DataSourceDisplay.js +1 -1
- package/Source/DataSources/GeoJsonDataSource.js +0 -1
- package/Source/DataSources/GeometryVisualizer.js +1 -1
- package/Source/DataSources/KmlDataSource.js +529 -557
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/DataSources/PolylineGeometryUpdater.js +125 -7
- package/Source/DataSources/PolylineVisualizer.js +1 -1
- package/Source/DataSources/StaticOutlineGeometryBatch.js +1 -1
- package/Source/Renderer/AutomaticUniforms.js +23 -0
- package/Source/Renderer/Context.js +9 -3
- package/Source/Renderer/DrawCommand.js +22 -0
- package/Source/Renderer/Framebuffer.js +4 -0
- package/Source/Renderer/Pass.js +11 -9
- package/Source/Renderer/Texture.js +12 -1
- package/Source/Renderer/UniformState.js +7 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapServerImageryProvider.js +0 -5
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +2 -1
- package/Source/Scene/BillboardCollection.js +15 -5
- package/Source/Scene/BillboardTexture.js +5 -3
- package/Source/Scene/BufferPointCollection.js +11 -1
- package/Source/Scene/BufferPolygonCollection.js +26 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +105 -32
- package/Source/Scene/Camera.js +137 -8
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/CameraFlightPath.js +17 -0
- package/Source/Scene/Cesium3DTile.js +102 -4
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileStyle.js +40 -0
- package/Source/Scene/Cesium3DTileset.js +213 -8
- package/Source/Scene/Cesium3DTilesetTraversal.js +14 -0
- package/Source/Scene/ClippingPlaneCollection.js +4 -4
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/ColumbusWorlds.js +190 -0
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/Controllers/Controller.js +63 -0
- package/Source/Scene/Controllers/ControllerHost.js +78 -0
- package/Source/Scene/Controllers/HybridScreenSpacePanCameraController.js +106 -0
- package/Source/Scene/Controllers/MouseButton.js +32 -0
- package/Source/Scene/Controllers/ScreenSpaceElevatorCameraController.js +295 -0
- package/Source/Scene/Controllers/ScreenSpaceInputBindings.js +154 -0
- package/Source/Scene/Controllers/ScreenSpaceMapCameraController.js +310 -0
- package/Source/Scene/Controllers/ScreenSpaceTiltOrbitCameraController.js +642 -0
- package/Source/Scene/Controllers/ScreenSpaceZoomCameraController.js +431 -0
- package/Source/Scene/Controllers/defaultPickWorldPosition.js +84 -0
- package/Source/Scene/DerivedCommand.js +98 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/EdgeFramebuffer.js +1 -5
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/FrameState.js +27 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/Globe.js +110 -22
- package/Source/Scene/GlobeDepth.js +243 -6
- package/Source/Scene/GlobeSurfaceShaderSet.js +637 -540
- package/Source/Scene/GlobeSurfaceTile.js +575 -398
- package/Source/Scene/GlobeSurfaceTileProvider.js +2289 -1842
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +146 -3
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/GltfSpzLoader.js +1 -1
- package/Source/Scene/GltfVertexBufferLoader.js +6 -3
- package/Source/Scene/GroundPolylinePrimitive.js +2 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SLayer.js +1 -1
- package/Source/Scene/I3SNode.js +2 -2
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +190 -6
- package/Source/Scene/Implicit3DTileContent.js +192 -216
- package/Source/Scene/ImplicitTileCoordinates.js +17 -0
- package/Source/Scene/IonImageryProvider.js +1 -5
- package/Source/Scene/Label.js +4 -4
- package/Source/Scene/LabelCollection.js +4 -1
- package/Source/Scene/MVTDataProvider.js +555 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/B3dmLoader.js +1 -2
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +82 -312
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/I3dmLoader.js +1 -1
- package/Source/Scene/Model/InstancingPipelineStage.js +4 -7
- package/Source/Scene/Model/MaterialPipelineStage.js +124 -1
- package/Source/Scene/Model/Model.js +45 -10
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +28 -1
- package/Source/Scene/Model/ModelDrawCommand.js +180 -8
- package/Source/Scene/Model/ModelDrawCommands.js +4 -0
- package/Source/Scene/Model/ModelSceneGraph.js +21 -0
- package/Source/Scene/Model/ModelUtility.js +5 -0
- package/Source/Scene/Model/PickingPipelineStage.js +29 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +24 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +645 -153
- package/Source/Scene/ModelComponents.js +112 -0
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/MvtLabelCandidates.js +295 -0
- package/Source/Scene/MvtLabelManager.js +1069 -0
- package/Source/Scene/Picking.js +19 -3
- package/Source/Scene/PlanarFillIdFramebuffer.js +172 -0
- package/Source/Scene/PntsParser.js +1 -1
- package/Source/Scene/Polyline.js +32 -5
- package/Source/Scene/PolylineCollection.js +39 -0
- package/Source/Scene/PostProcessStage.js +4 -2
- package/Source/Scene/Primitive.js +12 -13
- package/Source/Scene/PrimitivePipeline.js +158 -28
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCache.js +7 -4
- package/Source/Scene/ResourceCacheKey.js +21 -18
- package/Source/Scene/Scene.js +655 -6
- package/Source/Scene/SceneTransforms.js +18 -0
- package/Source/Scene/ScreenSpaceCameraController.js +12 -3
- package/Source/Scene/ShadowMap.js +9 -3
- package/Source/Scene/ShadowMapShader.js +50 -2
- package/Source/Scene/SnapFramebuffer.js +121 -0
- package/Source/Scene/Snapping.js +184 -0
- package/Source/Scene/TerrainFillMesh.js +3 -2
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +543 -0
- package/Source/Scene/Vector3DTileContent.js +207 -237
- package/Source/Scene/VectorGltf3DTileContent.js +185 -45
- package/Source/Scene/View.js +10 -8
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/VoxelTraversal.js +1 -1
- package/Source/Scene/buildVectorGltfFromMVT.js +1208 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/decodeMVT.js +877 -0
- package/Source/Scene/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +114 -64
- package/Source/Scene/renderBufferPolygonCollection.js +245 -53
- package/Source/Scene/renderBufferPolylineCollection.js +271 -145
- package/Source/Shaders/BillboardCollectionVS.glsl +23 -25
- package/Source/Shaders/BillboardCollectionVS.js +23 -25
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +13 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +22 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +23 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTilePlanarFillId.js +11 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/GlobeFS.glsl +10 -6
- package/Source/Shaders/GlobeFS.js +10 -6
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +1 -1
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +1 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/Source/Shaders/Model/MaterialStageFS.glsl +8 -2
- package/Source/Shaders/Model/MaterialStageFS.js +8 -2
- package/Source/Shaders/Model/ModelFS.glsl +105 -0
- package/Source/Shaders/Model/ModelFS.js +105 -0
- package/Source/Shaders/PolylineShadowVolumeFS.glsl +14 -0
- package/Source/Shaders/PolylineShadowVolumeFS.js +14 -0
- package/Source/Shaders/RestoreDepth.glsl +8 -0
- package/Source/Shaders/RestoreDepth.js +10 -0
- package/Source/Shaders/VectorCommon.glsl +178 -0
- package/Source/Shaders/VectorCommon.js +180 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.js +30 -0
- package/Source/Workers/createMvtTile.js +39 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.d.ts +535 -1393
- package/index.js +125 -93
- package/package.json +13 -13
|
@@ -0,0 +1,945 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.144.1
|
|
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
|
+
WebMercatorProjection_default
|
|
28
|
+
} from "./chunk-VBEXZBG5.js";
|
|
29
|
+
import {
|
|
30
|
+
GeometryPipeline_default
|
|
31
|
+
} from "./chunk-VJIL5H6K.js";
|
|
32
|
+
import {
|
|
33
|
+
IntersectionTests_default
|
|
34
|
+
} from "./chunk-DSBSPPPJ.js";
|
|
35
|
+
import {
|
|
36
|
+
IndexDatatype_default
|
|
37
|
+
} from "./chunk-A7LGY5XS.js";
|
|
38
|
+
import {
|
|
39
|
+
GeometryAttributes_default
|
|
40
|
+
} from "./chunk-FHCRXPA6.js";
|
|
41
|
+
import {
|
|
42
|
+
BoundingSphere_default,
|
|
43
|
+
GeographicProjection_default
|
|
44
|
+
} from "./chunk-36IU7N4V.js";
|
|
45
|
+
import {
|
|
46
|
+
GeometryAttribute_default,
|
|
47
|
+
Geometry_default
|
|
48
|
+
} from "./chunk-2ZYRUVVU.js";
|
|
49
|
+
import {
|
|
50
|
+
Rectangle_default
|
|
51
|
+
} from "./chunk-YUNQYP3Z.js";
|
|
52
|
+
import {
|
|
53
|
+
Cartesian4_default,
|
|
54
|
+
Matrix4_default
|
|
55
|
+
} from "./chunk-MHNLTQHO.js";
|
|
56
|
+
import {
|
|
57
|
+
ComponentDatatype_default
|
|
58
|
+
} from "./chunk-RC4YC3VU.js";
|
|
59
|
+
import {
|
|
60
|
+
Cartographic_default,
|
|
61
|
+
Ellipsoid_default
|
|
62
|
+
} from "./chunk-CV5RICKT.js";
|
|
63
|
+
import {
|
|
64
|
+
Cartesian3_default
|
|
65
|
+
} from "./chunk-XITBARMZ.js";
|
|
66
|
+
import {
|
|
67
|
+
Check_default,
|
|
68
|
+
DeveloperError_default
|
|
69
|
+
} from "./chunk-LOF32O7F.js";
|
|
70
|
+
import {
|
|
71
|
+
defined_default
|
|
72
|
+
} from "./chunk-5RVAAW26.js";
|
|
73
|
+
|
|
74
|
+
// packages/engine/Source/Core/OffsetGeometryInstanceAttribute.js
|
|
75
|
+
function OffsetGeometryInstanceAttribute(x, y, z) {
|
|
76
|
+
x = x ?? 0;
|
|
77
|
+
y = y ?? 0;
|
|
78
|
+
z = z ?? 0;
|
|
79
|
+
this.value = new Float32Array([x, y, z]);
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperties(OffsetGeometryInstanceAttribute.prototype, {
|
|
82
|
+
/**
|
|
83
|
+
* The datatype of each component in the attribute, e.g., individual elements in
|
|
84
|
+
* {@link OffsetGeometryInstanceAttribute#value}.
|
|
85
|
+
*
|
|
86
|
+
* @memberof OffsetGeometryInstanceAttribute.prototype
|
|
87
|
+
*
|
|
88
|
+
* @type {ComponentDatatype}
|
|
89
|
+
* @readonly
|
|
90
|
+
*
|
|
91
|
+
* @default {@link ComponentDatatype.FLOAT}
|
|
92
|
+
*/
|
|
93
|
+
componentDatatype: {
|
|
94
|
+
get: function() {
|
|
95
|
+
return ComponentDatatype_default.FLOAT;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.
|
|
100
|
+
*
|
|
101
|
+
* @memberof OffsetGeometryInstanceAttribute.prototype
|
|
102
|
+
*
|
|
103
|
+
* @type {number}
|
|
104
|
+
* @readonly
|
|
105
|
+
*
|
|
106
|
+
* @default 3
|
|
107
|
+
*/
|
|
108
|
+
componentsPerAttribute: {
|
|
109
|
+
get: function() {
|
|
110
|
+
return 3;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* When <code>true</code> and <code>componentDatatype</code> is an integer format,
|
|
115
|
+
* indicate that the components should be mapped to the range [0, 1] (unsigned)
|
|
116
|
+
* or [-1, 1] (signed) when they are accessed as floating-point for rendering.
|
|
117
|
+
*
|
|
118
|
+
* @memberof OffsetGeometryInstanceAttribute.prototype
|
|
119
|
+
*
|
|
120
|
+
* @type {boolean}
|
|
121
|
+
* @readonly
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
normalize: {
|
|
126
|
+
get: function() {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
OffsetGeometryInstanceAttribute.fromCartesian3 = function(offset) {
|
|
132
|
+
Check_default.defined("offset", offset);
|
|
133
|
+
return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);
|
|
134
|
+
};
|
|
135
|
+
OffsetGeometryInstanceAttribute.toValue = function(offset, result) {
|
|
136
|
+
Check_default.defined("offset", offset);
|
|
137
|
+
if (!defined_default(result)) {
|
|
138
|
+
result = new Float32Array([offset.x, offset.y, offset.z]);
|
|
139
|
+
}
|
|
140
|
+
result[0] = offset.x;
|
|
141
|
+
result[1] = offset.y;
|
|
142
|
+
result[2] = offset.z;
|
|
143
|
+
return result;
|
|
144
|
+
};
|
|
145
|
+
var OffsetGeometryInstanceAttribute_default = OffsetGeometryInstanceAttribute;
|
|
146
|
+
|
|
147
|
+
// packages/engine/Source/Scene/ColumbusWorlds.js
|
|
148
|
+
var ColumbusWorlds = {};
|
|
149
|
+
var worldWidthCartographic = new Cartographic_default();
|
|
150
|
+
var worldWidthCartesian = new Cartesian3_default();
|
|
151
|
+
var worldWidthCache = {
|
|
152
|
+
projection: void 0,
|
|
153
|
+
width: 0
|
|
154
|
+
};
|
|
155
|
+
ColumbusWorlds.getWorldWidth = function(projection) {
|
|
156
|
+
if (worldWidthCache.projection !== projection) {
|
|
157
|
+
const northeast = projection.project(
|
|
158
|
+
Rectangle_default.northeast(Rectangle_default.MAX_VALUE, worldWidthCartographic),
|
|
159
|
+
worldWidthCartesian
|
|
160
|
+
);
|
|
161
|
+
worldWidthCache.projection = projection;
|
|
162
|
+
worldWidthCache.width = Math.abs(northeast.x) * 2;
|
|
163
|
+
}
|
|
164
|
+
return worldWidthCache.width;
|
|
165
|
+
};
|
|
166
|
+
ColumbusWorlds.nearestWorldU = function(cameraU, u, projection) {
|
|
167
|
+
const worldWidth = ColumbusWorlds.getWorldWidth(projection);
|
|
168
|
+
return u + Math.round((cameraU - u) / worldWidth) * worldWidth;
|
|
169
|
+
};
|
|
170
|
+
var cameraOffsetDelta = new Cartesian3_default();
|
|
171
|
+
var cameraOffsetTranslation = new Matrix4_default();
|
|
172
|
+
ColumbusWorlds.applyCameraWorldOffset = function(camera, worldOffset) {
|
|
173
|
+
Cartesian3_default.fromElements(0, worldOffset, 0, cameraOffsetDelta);
|
|
174
|
+
Matrix4_default.fromTranslation(cameraOffsetDelta, cameraOffsetTranslation);
|
|
175
|
+
Matrix4_default.multiply(
|
|
176
|
+
camera._viewMatrix,
|
|
177
|
+
cameraOffsetTranslation,
|
|
178
|
+
camera._viewMatrix
|
|
179
|
+
);
|
|
180
|
+
Matrix4_default.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);
|
|
181
|
+
camera._positionWC.y -= worldOffset;
|
|
182
|
+
};
|
|
183
|
+
ColumbusWorlds.translateCullingVolume = function(cullingVolume, worldOffset, result) {
|
|
184
|
+
const planes = cullingVolume.planes;
|
|
185
|
+
const resultPlanes = result.planes;
|
|
186
|
+
for (let i = 0; i < planes.length; ++i) {
|
|
187
|
+
const plane = planes[i];
|
|
188
|
+
let resultPlane = resultPlanes[i];
|
|
189
|
+
if (!defined_default(resultPlane)) {
|
|
190
|
+
resultPlane = resultPlanes[i] = new Cartesian4_default();
|
|
191
|
+
}
|
|
192
|
+
resultPlane.x = plane.x;
|
|
193
|
+
resultPlane.y = plane.y;
|
|
194
|
+
resultPlane.z = plane.z;
|
|
195
|
+
resultPlane.w = plane.w + plane.y * worldOffset;
|
|
196
|
+
}
|
|
197
|
+
return result;
|
|
198
|
+
};
|
|
199
|
+
var worldStripSphere = new BoundingSphere_default();
|
|
200
|
+
ColumbusWorlds.getVisibleWorldIndices = function(cameraU, worldWidth, cullingVolume, maxExtraWorlds, result) {
|
|
201
|
+
result.length = 0;
|
|
202
|
+
if (!(worldWidth > 0) || !Number.isFinite(cameraU)) {
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
const sphere = worldStripSphere;
|
|
206
|
+
sphere.center.x = 0;
|
|
207
|
+
sphere.center.z = 0;
|
|
208
|
+
sphere.radius = worldWidth * 0.75;
|
|
209
|
+
const centerWorld = Math.round(cameraU / worldWidth);
|
|
210
|
+
for (let i = -maxExtraWorlds; i <= maxExtraWorlds; ++i) {
|
|
211
|
+
const worldIndex = centerWorld + i;
|
|
212
|
+
if (worldIndex === 0) {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
sphere.center.y = worldIndex * worldWidth;
|
|
216
|
+
if (cullingVolume.computeVisibility(sphere) === IntersectionTests_default.OUTSIDE) {
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
result.push(worldIndex);
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
};
|
|
223
|
+
var ColumbusWorlds_default = ColumbusWorlds;
|
|
224
|
+
|
|
225
|
+
// packages/engine/Source/Scene/PrimitivePipeline.js
|
|
226
|
+
function transformToWorldCoordinates(instances, primitiveModelMatrix, scene3DOnly) {
|
|
227
|
+
let toWorld = !scene3DOnly;
|
|
228
|
+
const length = instances.length;
|
|
229
|
+
let i;
|
|
230
|
+
if (!toWorld && length > 1) {
|
|
231
|
+
const modelMatrix = instances[0].modelMatrix;
|
|
232
|
+
for (i = 1; i < length; ++i) {
|
|
233
|
+
if (!Matrix4_default.equals(modelMatrix, instances[i].modelMatrix)) {
|
|
234
|
+
toWorld = true;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (toWorld) {
|
|
240
|
+
for (i = 0; i < length; ++i) {
|
|
241
|
+
if (defined_default(instances[i].geometry)) {
|
|
242
|
+
GeometryPipeline_default.transformToWorldCoordinates(instances[i]);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
Matrix4_default.multiplyTransformation(
|
|
247
|
+
primitiveModelMatrix,
|
|
248
|
+
instances[0].modelMatrix,
|
|
249
|
+
primitiveModelMatrix
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function addGeometryBatchId(geometry, batchId) {
|
|
254
|
+
const attributes = geometry.attributes;
|
|
255
|
+
const positionAttr = attributes.position;
|
|
256
|
+
const numberOfComponents = positionAttr.values.length / positionAttr.componentsPerAttribute;
|
|
257
|
+
attributes.batchId = new GeometryAttribute_default({
|
|
258
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
259
|
+
componentsPerAttribute: 1,
|
|
260
|
+
values: new Float32Array(numberOfComponents)
|
|
261
|
+
});
|
|
262
|
+
const values = attributes.batchId.values;
|
|
263
|
+
for (let j = 0; j < numberOfComponents; ++j) {
|
|
264
|
+
values[j] = batchId;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function addBatchIds(instances) {
|
|
268
|
+
const length = instances.length;
|
|
269
|
+
for (let i = 0; i < length; ++i) {
|
|
270
|
+
const instance = instances[i];
|
|
271
|
+
if (defined_default(instance.geometry)) {
|
|
272
|
+
addGeometryBatchId(instance.geometry, i);
|
|
273
|
+
} else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
|
|
274
|
+
addGeometryBatchId(instance.westHemisphereGeometry, i);
|
|
275
|
+
addGeometryBatchId(instance.eastHemisphereGeometry, i);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function liftPolyline2DToWorldCopy(geometry, projection) {
|
|
280
|
+
const attributes = geometry.attributes;
|
|
281
|
+
const position2D = attributes.position2D;
|
|
282
|
+
const prevPosition2D = attributes.prevPosition2D;
|
|
283
|
+
const nextPosition2D = attributes.nextPosition2D;
|
|
284
|
+
if (!defined_default(position2D) || !defined_default(prevPosition2D) || !defined_default(nextPosition2D)) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
const worldWidth = ColumbusWorlds_default.getWorldWidth(projection);
|
|
288
|
+
const halfWorldWidth = worldWidth * 0.5;
|
|
289
|
+
const positions = position2D.values;
|
|
290
|
+
const vertexCount = positions.length / 3;
|
|
291
|
+
const lifts = new Float64Array(vertexCount);
|
|
292
|
+
let lift = 0;
|
|
293
|
+
let lifted = false;
|
|
294
|
+
for (let i = 1; i < vertexCount; ++i) {
|
|
295
|
+
const du = positions[i * 3] - (positions[(i - 1) * 3] + lift);
|
|
296
|
+
if (du > halfWorldWidth) {
|
|
297
|
+
lift -= worldWidth;
|
|
298
|
+
lifted = true;
|
|
299
|
+
} else if (du < -halfWorldWidth) {
|
|
300
|
+
lift += worldWidth;
|
|
301
|
+
lifted = true;
|
|
302
|
+
}
|
|
303
|
+
lifts[i] = lift;
|
|
304
|
+
}
|
|
305
|
+
if (!lifted) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const prevPositions = prevPosition2D.values;
|
|
309
|
+
const nextPositions = nextPosition2D.values;
|
|
310
|
+
for (let i = 0; i < vertexCount; ++i) {
|
|
311
|
+
const vertexLift = lifts[i];
|
|
312
|
+
if (vertexLift !== 0) {
|
|
313
|
+
positions[i * 3] += vertexLift;
|
|
314
|
+
prevPositions[i * 3] += vertexLift;
|
|
315
|
+
nextPositions[i * 3] += vertexLift;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function liftGroundPolyline2DToWorldCopy(geometry, projection) {
|
|
320
|
+
const attributes = geometry.attributes;
|
|
321
|
+
const startHiLo2D = attributes.startHiLo2D;
|
|
322
|
+
const position2D = attributes.position2D;
|
|
323
|
+
if (!defined_default(startHiLo2D) || !defined_default(position2D)) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const worldWidth = ColumbusWorlds_default.getWorldWidth(projection);
|
|
327
|
+
const halfWorldWidth = worldWidth * 0.5;
|
|
328
|
+
if (!(halfWorldWidth > 0)) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const starts = startHiLo2D.values;
|
|
332
|
+
const positions = position2D.values;
|
|
333
|
+
const count = Math.min(starts.length / 4, positions.length / 3);
|
|
334
|
+
for (let i = 0; i < count; ++i) {
|
|
335
|
+
const startU = starts[i * 4] + starts[i * 4 + 2];
|
|
336
|
+
const u = positions[i * 3];
|
|
337
|
+
const delta = startU - u;
|
|
338
|
+
if (delta > halfWorldWidth || delta < -halfWorldWidth) {
|
|
339
|
+
positions[i * 3] = u + Math.round(delta / worldWidth) * worldWidth;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function geometryPipeline(parameters) {
|
|
344
|
+
const instances = parameters.instances;
|
|
345
|
+
const projection = parameters.projection;
|
|
346
|
+
const uintIndexSupport = parameters.elementIndexUintSupported;
|
|
347
|
+
const scene3DOnly = parameters.scene3DOnly;
|
|
348
|
+
const columbusRepeatWorlds = parameters.columbusRepeatWorlds === true;
|
|
349
|
+
const vertexCacheOptimize = parameters.vertexCacheOptimize;
|
|
350
|
+
const compressVertices = parameters.compressVertices;
|
|
351
|
+
const modelMatrix = parameters.modelMatrix;
|
|
352
|
+
let i;
|
|
353
|
+
let geometry;
|
|
354
|
+
let primitiveType;
|
|
355
|
+
let length = instances.length;
|
|
356
|
+
for (i = 0; i < length; ++i) {
|
|
357
|
+
if (defined_default(instances[i].geometry)) {
|
|
358
|
+
primitiveType = instances[i].geometry.primitiveType;
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
for (i = 1; i < length; ++i) {
|
|
363
|
+
if (defined_default(instances[i].geometry) && instances[i].geometry.primitiveType !== primitiveType) {
|
|
364
|
+
throw new DeveloperError_default(
|
|
365
|
+
"All instance geometries must have the same primitiveType."
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);
|
|
370
|
+
if (!scene3DOnly) {
|
|
371
|
+
for (i = 0; i < length; ++i) {
|
|
372
|
+
if (defined_default(instances[i].geometry)) {
|
|
373
|
+
GeometryPipeline_default.splitLongitude(instances[i]);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
addBatchIds(instances);
|
|
378
|
+
if (vertexCacheOptimize) {
|
|
379
|
+
for (i = 0; i < length; ++i) {
|
|
380
|
+
const instance = instances[i];
|
|
381
|
+
if (defined_default(instance.geometry)) {
|
|
382
|
+
GeometryPipeline_default.reorderForPostVertexCache(instance.geometry);
|
|
383
|
+
GeometryPipeline_default.reorderForPreVertexCache(instance.geometry);
|
|
384
|
+
} else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
|
|
385
|
+
GeometryPipeline_default.reorderForPostVertexCache(
|
|
386
|
+
instance.westHemisphereGeometry
|
|
387
|
+
);
|
|
388
|
+
GeometryPipeline_default.reorderForPreVertexCache(
|
|
389
|
+
instance.westHemisphereGeometry
|
|
390
|
+
);
|
|
391
|
+
GeometryPipeline_default.reorderForPostVertexCache(
|
|
392
|
+
instance.eastHemisphereGeometry
|
|
393
|
+
);
|
|
394
|
+
GeometryPipeline_default.reorderForPreVertexCache(
|
|
395
|
+
instance.eastHemisphereGeometry
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
let geometries = GeometryPipeline_default.combineInstances(instances);
|
|
401
|
+
length = geometries.length;
|
|
402
|
+
for (i = 0; i < length; ++i) {
|
|
403
|
+
geometry = geometries[i];
|
|
404
|
+
const attributes = geometry.attributes;
|
|
405
|
+
if (!scene3DOnly) {
|
|
406
|
+
const doubleAttributeNames = [];
|
|
407
|
+
for (const name in attributes) {
|
|
408
|
+
if (attributes.hasOwnProperty(name) && attributes[name].componentDatatype === ComponentDatatype_default.DOUBLE) {
|
|
409
|
+
doubleAttributeNames.push(name);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
for (let a = 0; a < doubleAttributeNames.length; ++a) {
|
|
413
|
+
const name = doubleAttributeNames[a];
|
|
414
|
+
GeometryPipeline_default.projectTo2D(
|
|
415
|
+
geometry,
|
|
416
|
+
name,
|
|
417
|
+
`${name}3D`,
|
|
418
|
+
`${name}2D`,
|
|
419
|
+
projection
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
if (columbusRepeatWorlds) {
|
|
423
|
+
liftPolyline2DToWorldCopy(geometry, projection);
|
|
424
|
+
liftGroundPolyline2DToWorldCopy(geometry, projection);
|
|
425
|
+
}
|
|
426
|
+
if (defined_default(geometry.boundingSphere) && defined_default(attributes.position2D)) {
|
|
427
|
+
geometry.boundingSphereCV = BoundingSphere_default.fromVertices(
|
|
428
|
+
attributes.position2D.values
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
for (let a = 0; a < doubleAttributeNames.length; ++a) {
|
|
432
|
+
const name3D = `${doubleAttributeNames[a]}3D`;
|
|
433
|
+
const name2D = `${doubleAttributeNames[a]}2D`;
|
|
434
|
+
GeometryPipeline_default.encodeAttribute(
|
|
435
|
+
geometry,
|
|
436
|
+
name3D,
|
|
437
|
+
`${name3D}High`,
|
|
438
|
+
`${name3D}Low`
|
|
439
|
+
);
|
|
440
|
+
GeometryPipeline_default.encodeAttribute(
|
|
441
|
+
geometry,
|
|
442
|
+
name2D,
|
|
443
|
+
`${name2D}High`,
|
|
444
|
+
`${name2D}Low`
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
} else {
|
|
448
|
+
for (const name in attributes) {
|
|
449
|
+
if (attributes.hasOwnProperty(name) && attributes[name].componentDatatype === ComponentDatatype_default.DOUBLE) {
|
|
450
|
+
GeometryPipeline_default.encodeAttribute(
|
|
451
|
+
geometry,
|
|
452
|
+
name,
|
|
453
|
+
`${name}3DHigh`,
|
|
454
|
+
`${name}3DLow`
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (compressVertices) {
|
|
460
|
+
GeometryPipeline_default.compressVertices(geometry);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (!uintIndexSupport) {
|
|
464
|
+
let splitGeometries = [];
|
|
465
|
+
length = geometries.length;
|
|
466
|
+
for (i = 0; i < length; ++i) {
|
|
467
|
+
geometry = geometries[i];
|
|
468
|
+
splitGeometries = splitGeometries.concat(
|
|
469
|
+
GeometryPipeline_default.fitToUnsignedShortIndices(geometry)
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
geometries = splitGeometries;
|
|
473
|
+
}
|
|
474
|
+
return geometries;
|
|
475
|
+
}
|
|
476
|
+
function createPickOffsets(instances, geometryName, geometries, pickOffsets) {
|
|
477
|
+
let offset;
|
|
478
|
+
let indexCount;
|
|
479
|
+
let geometryIndex;
|
|
480
|
+
const offsetIndex = pickOffsets.length - 1;
|
|
481
|
+
if (offsetIndex >= 0) {
|
|
482
|
+
const pickOffset = pickOffsets[offsetIndex];
|
|
483
|
+
offset = pickOffset.offset + pickOffset.count;
|
|
484
|
+
geometryIndex = pickOffset.index;
|
|
485
|
+
indexCount = geometries[geometryIndex].indices.length;
|
|
486
|
+
} else {
|
|
487
|
+
offset = 0;
|
|
488
|
+
geometryIndex = 0;
|
|
489
|
+
indexCount = geometries[geometryIndex].indices.length;
|
|
490
|
+
}
|
|
491
|
+
const length = instances.length;
|
|
492
|
+
for (let i = 0; i < length; ++i) {
|
|
493
|
+
const instance = instances[i];
|
|
494
|
+
const geometry = instance[geometryName];
|
|
495
|
+
if (!defined_default(geometry)) {
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
const count = geometry.indices.length;
|
|
499
|
+
if (offset + count > indexCount) {
|
|
500
|
+
offset = 0;
|
|
501
|
+
indexCount = geometries[++geometryIndex].indices.length;
|
|
502
|
+
}
|
|
503
|
+
pickOffsets.push({
|
|
504
|
+
index: geometryIndex,
|
|
505
|
+
offset,
|
|
506
|
+
count
|
|
507
|
+
});
|
|
508
|
+
offset += count;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function createInstancePickOffsets(instances, geometries) {
|
|
512
|
+
const pickOffsets = [];
|
|
513
|
+
createPickOffsets(instances, "geometry", geometries, pickOffsets);
|
|
514
|
+
createPickOffsets(
|
|
515
|
+
instances,
|
|
516
|
+
"westHemisphereGeometry",
|
|
517
|
+
geometries,
|
|
518
|
+
pickOffsets
|
|
519
|
+
);
|
|
520
|
+
createPickOffsets(
|
|
521
|
+
instances,
|
|
522
|
+
"eastHemisphereGeometry",
|
|
523
|
+
geometries,
|
|
524
|
+
pickOffsets
|
|
525
|
+
);
|
|
526
|
+
return pickOffsets;
|
|
527
|
+
}
|
|
528
|
+
var PrimitivePipeline = {};
|
|
529
|
+
PrimitivePipeline.combineGeometry = function(parameters) {
|
|
530
|
+
let geometries;
|
|
531
|
+
let attributeLocations;
|
|
532
|
+
const instances = parameters.instances;
|
|
533
|
+
const length = instances.length;
|
|
534
|
+
let pickOffsets;
|
|
535
|
+
let offsetInstanceExtend;
|
|
536
|
+
let hasOffset = false;
|
|
537
|
+
if (length > 0) {
|
|
538
|
+
geometries = geometryPipeline(parameters);
|
|
539
|
+
if (geometries.length > 0) {
|
|
540
|
+
attributeLocations = GeometryPipeline_default.createAttributeLocations(
|
|
541
|
+
geometries[0]
|
|
542
|
+
);
|
|
543
|
+
if (parameters.createPickOffsets) {
|
|
544
|
+
pickOffsets = createInstancePickOffsets(instances, geometries);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (defined_default(instances[0].attributes) && defined_default(instances[0].attributes.offset)) {
|
|
548
|
+
offsetInstanceExtend = new Array(length);
|
|
549
|
+
hasOffset = true;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const boundingSpheres = new Array(length);
|
|
553
|
+
const boundingSpheresCV = new Array(length);
|
|
554
|
+
for (let i = 0; i < length; ++i) {
|
|
555
|
+
const instance = instances[i];
|
|
556
|
+
const geometry = instance.geometry;
|
|
557
|
+
if (defined_default(geometry)) {
|
|
558
|
+
boundingSpheres[i] = geometry.boundingSphere;
|
|
559
|
+
boundingSpheresCV[i] = geometry.boundingSphereCV;
|
|
560
|
+
if (hasOffset) {
|
|
561
|
+
offsetInstanceExtend[i] = instance.geometry.offsetAttribute;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const eastHemisphereGeometry = instance.eastHemisphereGeometry;
|
|
565
|
+
const westHemisphereGeometry = instance.westHemisphereGeometry;
|
|
566
|
+
if (defined_default(eastHemisphereGeometry) && defined_default(westHemisphereGeometry)) {
|
|
567
|
+
if (defined_default(eastHemisphereGeometry.boundingSphere) && defined_default(westHemisphereGeometry.boundingSphere)) {
|
|
568
|
+
boundingSpheres[i] = BoundingSphere_default.union(
|
|
569
|
+
eastHemisphereGeometry.boundingSphere,
|
|
570
|
+
westHemisphereGeometry.boundingSphere
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
if (defined_default(eastHemisphereGeometry.boundingSphereCV) && defined_default(westHemisphereGeometry.boundingSphereCV)) {
|
|
574
|
+
boundingSpheresCV[i] = BoundingSphere_default.union(
|
|
575
|
+
eastHemisphereGeometry.boundingSphereCV,
|
|
576
|
+
westHemisphereGeometry.boundingSphereCV
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return {
|
|
582
|
+
geometries,
|
|
583
|
+
modelMatrix: parameters.modelMatrix,
|
|
584
|
+
attributeLocations,
|
|
585
|
+
pickOffsets,
|
|
586
|
+
offsetInstanceExtend,
|
|
587
|
+
boundingSpheres,
|
|
588
|
+
boundingSpheresCV
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
function transferGeometry(geometry, transferableObjects) {
|
|
592
|
+
const attributes = geometry.attributes;
|
|
593
|
+
for (const name in attributes) {
|
|
594
|
+
if (attributes.hasOwnProperty(name)) {
|
|
595
|
+
const attribute = attributes[name];
|
|
596
|
+
if (defined_default(attribute) && defined_default(attribute.values)) {
|
|
597
|
+
transferableObjects.push(attribute.values.buffer);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
if (defined_default(geometry.indices)) {
|
|
602
|
+
transferableObjects.push(geometry.indices.buffer);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function transferGeometries(geometries, transferableObjects) {
|
|
606
|
+
const length = geometries.length;
|
|
607
|
+
for (let i = 0; i < length; ++i) {
|
|
608
|
+
transferGeometry(geometries[i], transferableObjects);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
function countCreateGeometryResults(items) {
|
|
612
|
+
let count = 1;
|
|
613
|
+
const length = items.length;
|
|
614
|
+
for (let i = 0; i < length; i++) {
|
|
615
|
+
const geometry = items[i];
|
|
616
|
+
++count;
|
|
617
|
+
if (!defined_default(geometry)) {
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
const attributes = geometry.attributes;
|
|
621
|
+
count += 7 + 2 * BoundingSphere_default.packedLength + (defined_default(geometry.indices) ? geometry.indices.length : 0);
|
|
622
|
+
for (const property in attributes) {
|
|
623
|
+
if (attributes.hasOwnProperty(property) && defined_default(attributes[property])) {
|
|
624
|
+
const attribute = attributes[property];
|
|
625
|
+
count += 5 + attribute.values.length;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return count;
|
|
630
|
+
}
|
|
631
|
+
PrimitivePipeline.packCreateGeometryResults = function(items, transferableObjects) {
|
|
632
|
+
const packedData = new Float64Array(countCreateGeometryResults(items));
|
|
633
|
+
const stringTable = [];
|
|
634
|
+
const stringHash = {};
|
|
635
|
+
const length = items.length;
|
|
636
|
+
let count = 0;
|
|
637
|
+
packedData[count++] = length;
|
|
638
|
+
for (let i = 0; i < length; i++) {
|
|
639
|
+
const geometry = items[i];
|
|
640
|
+
const validGeometry = defined_default(geometry);
|
|
641
|
+
packedData[count++] = validGeometry ? 1 : 0;
|
|
642
|
+
if (!validGeometry) {
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
packedData[count++] = geometry.primitiveType;
|
|
646
|
+
packedData[count++] = geometry.geometryType;
|
|
647
|
+
packedData[count++] = geometry.offsetAttribute ?? -1;
|
|
648
|
+
const validBoundingSphere = defined_default(geometry.boundingSphere) ? 1 : 0;
|
|
649
|
+
packedData[count++] = validBoundingSphere;
|
|
650
|
+
if (validBoundingSphere) {
|
|
651
|
+
BoundingSphere_default.pack(geometry.boundingSphere, packedData, count);
|
|
652
|
+
}
|
|
653
|
+
count += BoundingSphere_default.packedLength;
|
|
654
|
+
const validBoundingSphereCV = defined_default(geometry.boundingSphereCV) ? 1 : 0;
|
|
655
|
+
packedData[count++] = validBoundingSphereCV;
|
|
656
|
+
if (validBoundingSphereCV) {
|
|
657
|
+
BoundingSphere_default.pack(geometry.boundingSphereCV, packedData, count);
|
|
658
|
+
}
|
|
659
|
+
count += BoundingSphere_default.packedLength;
|
|
660
|
+
const attributes = geometry.attributes;
|
|
661
|
+
const attributesToWrite = [];
|
|
662
|
+
for (const property in attributes) {
|
|
663
|
+
if (attributes.hasOwnProperty(property) && defined_default(attributes[property])) {
|
|
664
|
+
attributesToWrite.push(property);
|
|
665
|
+
if (!defined_default(stringHash[property])) {
|
|
666
|
+
stringHash[property] = stringTable.length;
|
|
667
|
+
stringTable.push(property);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
packedData[count++] = attributesToWrite.length;
|
|
672
|
+
for (let q = 0; q < attributesToWrite.length; q++) {
|
|
673
|
+
const name = attributesToWrite[q];
|
|
674
|
+
const attribute = attributes[name];
|
|
675
|
+
packedData[count++] = stringHash[name];
|
|
676
|
+
packedData[count++] = attribute.componentDatatype;
|
|
677
|
+
packedData[count++] = attribute.componentsPerAttribute;
|
|
678
|
+
packedData[count++] = attribute.normalize ? 1 : 0;
|
|
679
|
+
packedData[count++] = attribute.values.length;
|
|
680
|
+
packedData.set(attribute.values, count);
|
|
681
|
+
count += attribute.values.length;
|
|
682
|
+
}
|
|
683
|
+
const indicesLength = defined_default(geometry.indices) ? geometry.indices.length : 0;
|
|
684
|
+
packedData[count++] = indicesLength;
|
|
685
|
+
if (indicesLength > 0) {
|
|
686
|
+
packedData.set(geometry.indices, count);
|
|
687
|
+
count += indicesLength;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
transferableObjects.push(packedData.buffer);
|
|
691
|
+
return {
|
|
692
|
+
stringTable,
|
|
693
|
+
packedData
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
PrimitivePipeline.unpackCreateGeometryResults = function(createGeometryResult) {
|
|
697
|
+
const stringTable = createGeometryResult.stringTable;
|
|
698
|
+
const packedGeometry = createGeometryResult.packedData;
|
|
699
|
+
let i;
|
|
700
|
+
const result = new Array(packedGeometry[0]);
|
|
701
|
+
let resultIndex = 0;
|
|
702
|
+
let packedGeometryIndex = 1;
|
|
703
|
+
while (packedGeometryIndex < packedGeometry.length) {
|
|
704
|
+
const valid = packedGeometry[packedGeometryIndex++] === 1;
|
|
705
|
+
if (!valid) {
|
|
706
|
+
result[resultIndex++] = void 0;
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
const primitiveType = packedGeometry[packedGeometryIndex++];
|
|
710
|
+
const geometryType = packedGeometry[packedGeometryIndex++];
|
|
711
|
+
let offsetAttribute = packedGeometry[packedGeometryIndex++];
|
|
712
|
+
if (offsetAttribute === -1) {
|
|
713
|
+
offsetAttribute = void 0;
|
|
714
|
+
}
|
|
715
|
+
let boundingSphere;
|
|
716
|
+
let boundingSphereCV;
|
|
717
|
+
const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1;
|
|
718
|
+
if (validBoundingSphere) {
|
|
719
|
+
boundingSphere = BoundingSphere_default.unpack(
|
|
720
|
+
packedGeometry,
|
|
721
|
+
packedGeometryIndex
|
|
722
|
+
);
|
|
723
|
+
}
|
|
724
|
+
packedGeometryIndex += BoundingSphere_default.packedLength;
|
|
725
|
+
const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1;
|
|
726
|
+
if (validBoundingSphereCV) {
|
|
727
|
+
boundingSphereCV = BoundingSphere_default.unpack(
|
|
728
|
+
packedGeometry,
|
|
729
|
+
packedGeometryIndex
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
packedGeometryIndex += BoundingSphere_default.packedLength;
|
|
733
|
+
let length;
|
|
734
|
+
let values;
|
|
735
|
+
let componentsPerAttribute;
|
|
736
|
+
const attributes = new GeometryAttributes_default();
|
|
737
|
+
const numAttributes = packedGeometry[packedGeometryIndex++];
|
|
738
|
+
for (i = 0; i < numAttributes; i++) {
|
|
739
|
+
const name = stringTable[packedGeometry[packedGeometryIndex++]];
|
|
740
|
+
const componentDatatype = packedGeometry[packedGeometryIndex++];
|
|
741
|
+
componentsPerAttribute = packedGeometry[packedGeometryIndex++];
|
|
742
|
+
const normalize = packedGeometry[packedGeometryIndex++] !== 0;
|
|
743
|
+
length = packedGeometry[packedGeometryIndex++];
|
|
744
|
+
values = ComponentDatatype_default.createTypedArray(componentDatatype, length);
|
|
745
|
+
for (let valuesIndex = 0; valuesIndex < length; valuesIndex++) {
|
|
746
|
+
values[valuesIndex] = packedGeometry[packedGeometryIndex++];
|
|
747
|
+
}
|
|
748
|
+
attributes[name] = new GeometryAttribute_default({
|
|
749
|
+
componentDatatype,
|
|
750
|
+
componentsPerAttribute,
|
|
751
|
+
normalize,
|
|
752
|
+
values
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
let indices;
|
|
756
|
+
length = packedGeometry[packedGeometryIndex++];
|
|
757
|
+
if (length > 0) {
|
|
758
|
+
const numberOfVertices = values.length / componentsPerAttribute;
|
|
759
|
+
indices = IndexDatatype_default.createTypedArray(numberOfVertices, length);
|
|
760
|
+
for (i = 0; i < length; i++) {
|
|
761
|
+
indices[i] = packedGeometry[packedGeometryIndex++];
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
result[resultIndex++] = new Geometry_default({
|
|
765
|
+
primitiveType,
|
|
766
|
+
geometryType,
|
|
767
|
+
boundingSphere,
|
|
768
|
+
boundingSphereCV,
|
|
769
|
+
indices,
|
|
770
|
+
attributes,
|
|
771
|
+
offsetAttribute
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
return result;
|
|
775
|
+
};
|
|
776
|
+
function packInstancesForCombine(instances, transferableObjects) {
|
|
777
|
+
const length = instances.length;
|
|
778
|
+
const packedData = new Float64Array(1 + length * 19);
|
|
779
|
+
let count = 0;
|
|
780
|
+
packedData[count++] = length;
|
|
781
|
+
for (let i = 0; i < length; i++) {
|
|
782
|
+
const instance = instances[i];
|
|
783
|
+
Matrix4_default.pack(instance.modelMatrix, packedData, count);
|
|
784
|
+
count += Matrix4_default.packedLength;
|
|
785
|
+
if (defined_default(instance.attributes) && defined_default(instance.attributes.offset)) {
|
|
786
|
+
const values = instance.attributes.offset.value;
|
|
787
|
+
packedData[count] = values[0];
|
|
788
|
+
packedData[count + 1] = values[1];
|
|
789
|
+
packedData[count + 2] = values[2];
|
|
790
|
+
}
|
|
791
|
+
count += 3;
|
|
792
|
+
}
|
|
793
|
+
transferableObjects.push(packedData.buffer);
|
|
794
|
+
return packedData;
|
|
795
|
+
}
|
|
796
|
+
function unpackInstancesForCombine(data) {
|
|
797
|
+
const packedInstances = data;
|
|
798
|
+
const result = new Array(packedInstances[0]);
|
|
799
|
+
let count = 0;
|
|
800
|
+
let i = 1;
|
|
801
|
+
while (i < packedInstances.length) {
|
|
802
|
+
const modelMatrix = Matrix4_default.unpack(packedInstances, i);
|
|
803
|
+
let attributes;
|
|
804
|
+
i += Matrix4_default.packedLength;
|
|
805
|
+
if (defined_default(packedInstances[i])) {
|
|
806
|
+
attributes = {
|
|
807
|
+
offset: new OffsetGeometryInstanceAttribute_default(
|
|
808
|
+
packedInstances[i],
|
|
809
|
+
packedInstances[i + 1],
|
|
810
|
+
packedInstances[i + 2]
|
|
811
|
+
)
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
i += 3;
|
|
815
|
+
result[count++] = {
|
|
816
|
+
modelMatrix,
|
|
817
|
+
attributes
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
return result;
|
|
821
|
+
}
|
|
822
|
+
PrimitivePipeline.packCombineGeometryParameters = function(parameters, transferableObjects) {
|
|
823
|
+
const createGeometryResults = parameters.createGeometryResults;
|
|
824
|
+
const length = createGeometryResults.length;
|
|
825
|
+
for (let i = 0; i < length; i++) {
|
|
826
|
+
transferableObjects.push(createGeometryResults[i].packedData.buffer);
|
|
827
|
+
}
|
|
828
|
+
return {
|
|
829
|
+
createGeometryResults: parameters.createGeometryResults,
|
|
830
|
+
packedInstances: packInstancesForCombine(
|
|
831
|
+
parameters.instances,
|
|
832
|
+
transferableObjects
|
|
833
|
+
),
|
|
834
|
+
ellipsoid: parameters.ellipsoid,
|
|
835
|
+
isGeographic: parameters.projection instanceof GeographicProjection_default,
|
|
836
|
+
elementIndexUintSupported: parameters.elementIndexUintSupported,
|
|
837
|
+
scene3DOnly: parameters.scene3DOnly,
|
|
838
|
+
columbusRepeatWorlds: parameters.columbusRepeatWorlds === true,
|
|
839
|
+
vertexCacheOptimize: parameters.vertexCacheOptimize,
|
|
840
|
+
compressVertices: parameters.compressVertices,
|
|
841
|
+
modelMatrix: parameters.modelMatrix,
|
|
842
|
+
createPickOffsets: parameters.createPickOffsets
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
PrimitivePipeline.unpackCombineGeometryParameters = function(packedParameters) {
|
|
846
|
+
const instances = unpackInstancesForCombine(packedParameters.packedInstances);
|
|
847
|
+
const createGeometryResults = packedParameters.createGeometryResults;
|
|
848
|
+
const length = createGeometryResults.length;
|
|
849
|
+
let instanceIndex = 0;
|
|
850
|
+
for (let resultIndex = 0; resultIndex < length; resultIndex++) {
|
|
851
|
+
const geometries = PrimitivePipeline.unpackCreateGeometryResults(
|
|
852
|
+
createGeometryResults[resultIndex]
|
|
853
|
+
);
|
|
854
|
+
const geometriesLength = geometries.length;
|
|
855
|
+
for (let geometryIndex = 0; geometryIndex < geometriesLength; geometryIndex++) {
|
|
856
|
+
const geometry = geometries[geometryIndex];
|
|
857
|
+
const instance = instances[instanceIndex];
|
|
858
|
+
instance.geometry = geometry;
|
|
859
|
+
++instanceIndex;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
const ellipsoid = Ellipsoid_default.clone(packedParameters.ellipsoid);
|
|
863
|
+
const projection = packedParameters.isGeographic ? new GeographicProjection_default(ellipsoid) : new WebMercatorProjection_default(ellipsoid);
|
|
864
|
+
return {
|
|
865
|
+
instances,
|
|
866
|
+
ellipsoid,
|
|
867
|
+
projection,
|
|
868
|
+
elementIndexUintSupported: packedParameters.elementIndexUintSupported,
|
|
869
|
+
scene3DOnly: packedParameters.scene3DOnly,
|
|
870
|
+
columbusRepeatWorlds: packedParameters.columbusRepeatWorlds === true,
|
|
871
|
+
vertexCacheOptimize: packedParameters.vertexCacheOptimize,
|
|
872
|
+
compressVertices: packedParameters.compressVertices,
|
|
873
|
+
modelMatrix: Matrix4_default.clone(packedParameters.modelMatrix),
|
|
874
|
+
createPickOffsets: packedParameters.createPickOffsets
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
function packBoundingSpheres(boundingSpheres) {
|
|
878
|
+
const length = boundingSpheres.length;
|
|
879
|
+
const bufferLength = 1 + (BoundingSphere_default.packedLength + 1) * length;
|
|
880
|
+
const buffer = new Float32Array(bufferLength);
|
|
881
|
+
let bufferIndex = 0;
|
|
882
|
+
buffer[bufferIndex++] = length;
|
|
883
|
+
for (let i = 0; i < length; ++i) {
|
|
884
|
+
const bs = boundingSpheres[i];
|
|
885
|
+
if (!defined_default(bs)) {
|
|
886
|
+
buffer[bufferIndex++] = 0;
|
|
887
|
+
} else {
|
|
888
|
+
buffer[bufferIndex++] = 1;
|
|
889
|
+
BoundingSphere_default.pack(boundingSpheres[i], buffer, bufferIndex);
|
|
890
|
+
}
|
|
891
|
+
bufferIndex += BoundingSphere_default.packedLength;
|
|
892
|
+
}
|
|
893
|
+
return buffer;
|
|
894
|
+
}
|
|
895
|
+
function unpackBoundingSpheres(buffer) {
|
|
896
|
+
const result = new Array(buffer[0]);
|
|
897
|
+
let count = 0;
|
|
898
|
+
let i = 1;
|
|
899
|
+
while (i < buffer.length) {
|
|
900
|
+
if (buffer[i++] === 1) {
|
|
901
|
+
result[count] = BoundingSphere_default.unpack(buffer, i);
|
|
902
|
+
}
|
|
903
|
+
++count;
|
|
904
|
+
i += BoundingSphere_default.packedLength;
|
|
905
|
+
}
|
|
906
|
+
return result;
|
|
907
|
+
}
|
|
908
|
+
PrimitivePipeline.packCombineGeometryResults = function(results, transferableObjects) {
|
|
909
|
+
if (defined_default(results.geometries)) {
|
|
910
|
+
transferGeometries(results.geometries, transferableObjects);
|
|
911
|
+
}
|
|
912
|
+
const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);
|
|
913
|
+
const packedBoundingSpheresCV = packBoundingSpheres(
|
|
914
|
+
results.boundingSpheresCV
|
|
915
|
+
);
|
|
916
|
+
transferableObjects.push(
|
|
917
|
+
packedBoundingSpheres.buffer,
|
|
918
|
+
packedBoundingSpheresCV.buffer
|
|
919
|
+
);
|
|
920
|
+
return {
|
|
921
|
+
geometries: results.geometries,
|
|
922
|
+
attributeLocations: results.attributeLocations,
|
|
923
|
+
modelMatrix: results.modelMatrix,
|
|
924
|
+
pickOffsets: results.pickOffsets,
|
|
925
|
+
offsetInstanceExtend: results.offsetInstanceExtend,
|
|
926
|
+
boundingSpheres: packedBoundingSpheres,
|
|
927
|
+
boundingSpheresCV: packedBoundingSpheresCV
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
PrimitivePipeline.unpackCombineGeometryResults = function(packedResult) {
|
|
931
|
+
return {
|
|
932
|
+
geometries: packedResult.geometries,
|
|
933
|
+
attributeLocations: packedResult.attributeLocations,
|
|
934
|
+
modelMatrix: packedResult.modelMatrix,
|
|
935
|
+
pickOffsets: packedResult.pickOffsets,
|
|
936
|
+
offsetInstanceExtend: packedResult.offsetInstanceExtend,
|
|
937
|
+
boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),
|
|
938
|
+
boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV)
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
var PrimitivePipeline_default = PrimitivePipeline;
|
|
942
|
+
|
|
943
|
+
export {
|
|
944
|
+
PrimitivePipeline_default
|
|
945
|
+
};
|