@cesium/engine 23.0.1 → 25.0.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/Workers/{chunk-ZEMJQKHD.js → chunk-35H3UBIO.js} +13 -12
- package/Build/Workers/{chunk-PQTSXJBJ.js → chunk-3LSD7OOA.js} +16 -16
- package/Build/Workers/{chunk-PUO7BYDY.js → chunk-3RFFPH4M.js} +1 -1
- package/Build/Workers/{chunk-PBECJOWF.js → chunk-3TKLDHV3.js} +2 -2
- package/Build/Workers/{chunk-TMCTZ5E3.js → chunk-3VDDRF2E.js} +14 -14
- package/Build/Workers/{chunk-FKU77FNM.js → chunk-3XY3MVPG.js} +4 -4
- package/Build/Workers/{chunk-2OBWHTIC.js → chunk-4GF4MVPY.js} +7 -7
- package/Build/Workers/{chunk-JUKGMJX7.js → chunk-4MTRQFJP.js} +3 -2
- package/Build/Workers/{chunk-66OWUDO7.js → chunk-4QQXGTCE.js} +8 -8
- package/Build/Workers/{chunk-ALTCIHRH.js → chunk-4XXHJI6Y.js} +17 -17
- package/Build/Workers/{chunk-K7UTK4OM.js → chunk-5T6QQAJW.js} +3 -2
- package/Build/Workers/{chunk-IJ3SUMK3.js → chunk-6SDGQI27.js} +3 -2
- package/Build/Workers/{chunk-FXSRA5UG.js → chunk-77RL3MBD.js} +6 -5
- package/Build/Workers/{chunk-G6MJ3ZW3.js → chunk-7LSFAEWF.js} +12 -11
- package/Build/Workers/{chunk-C6HHBKT5.js → chunk-A7A433MD.js} +5 -5
- package/Build/Workers/{chunk-PGZ3B6CB.js → chunk-A7ZBMVFS.js} +14 -14
- package/Build/Workers/{chunk-OZYB3AOR.js → chunk-ACFFCHHZ.js} +11 -11
- package/Build/Workers/{chunk-DNMASBMH.js → chunk-AEAVLYPS.js} +2 -2
- package/Build/Workers/{chunk-VPWYHFQA.js → chunk-AWFZHD2B.js} +4 -4
- package/Build/Workers/{chunk-TFPG3ZKW.js → chunk-BTX2NL3P.js} +59 -46
- package/Build/Workers/{chunk-TNXOPEIG.js → chunk-BVAIWR7O.js} +12 -12
- package/Build/Workers/chunk-CKQP3DSS.js +973 -0
- package/Build/Workers/{chunk-N6HRZLS6.js → chunk-CZ23Y3RM.js} +2 -2
- package/Build/Workers/{chunk-EIC3VAOZ.js → chunk-DFEI5MAV.js} +7 -7
- package/Build/Workers/{chunk-BTP3634E.js → chunk-DH26SNAB.js} +4 -1
- package/Build/Workers/{chunk-TXYQNXNW.js → chunk-DYT5NR6P.js} +3 -3
- package/Build/Workers/{chunk-O67UP5YO.js → chunk-EZARA5FJ.js} +13 -13
- package/Build/Workers/{chunk-YSJRB2UZ.js → chunk-FIBS5S7R.js} +2 -2
- package/Build/Workers/{chunk-2M7DKGLW.js → chunk-FVLVVOBQ.js} +10 -10
- package/Build/Workers/{chunk-B2VA6IEL.js → chunk-GL7DNVUS.js} +5 -5
- package/Build/Workers/{chunk-77DJBHMI.js → chunk-GPIGURCG.js} +59 -32
- package/Build/Workers/{chunk-QPXGGVHC.js → chunk-H2A4USJR.js} +10 -10
- package/Build/Workers/chunk-HSVQATK2.js +147 -0
- package/Build/Workers/{chunk-HXEPZWJN.js → chunk-HVMG6AG4.js} +11 -10
- package/Build/Workers/{chunk-H3TVRJLY.js → chunk-I3A6DXYZ.js} +4 -4
- package/Build/Workers/{chunk-UEWYSOFD.js → chunk-ITD2IN7N.js} +2 -2
- package/Build/Workers/{chunk-CYOPNGPX.js → chunk-J3OFS2RD.js} +12 -12
- package/Build/Workers/{chunk-RZX6LOG6.js → chunk-J647NNZW.js} +6 -6
- package/Build/Workers/{chunk-GLCPE2BJ.js → chunk-J7KQEKPK.js} +13 -13
- package/Build/Workers/{chunk-XPMXRJDD.js → chunk-K6NFIRFB.js} +5 -5
- package/Build/Workers/{chunk-CID5SY7L.js → chunk-LH5SF3XV.js} +7 -6
- package/Build/Workers/{chunk-UOQB7XQI.js → chunk-ND3NTTOF.js} +713 -435
- package/Build/Workers/chunk-QO2CGXMP.js +2342 -0
- package/Build/Workers/chunk-QSDY4NS7.js +1287 -0
- package/Build/Workers/chunk-QXNQQYPV.js +3201 -0
- package/Build/Workers/{chunk-CJ7ZDY77.js → chunk-ST2UWDUU.js} +5 -5
- package/Build/Workers/{chunk-YDR5LX5Z.js → chunk-TA777BGS.js} +3 -2
- package/Build/Workers/{chunk-U4SWB6TI.js → chunk-TAI4HLII.js} +4 -4
- package/Build/Workers/{chunk-VX774SWE.js → chunk-URUCCIPS.js} +6 -6
- package/Build/Workers/{chunk-MNSNOONX.js → chunk-VQKLRBIK.js} +7 -7
- package/Build/Workers/{chunk-CVAAIRNP.js → chunk-WC57YYBN.js} +2 -2
- package/Build/Workers/{chunk-QNABVTTP.js → chunk-WN6P5UDH.js} +12 -12
- package/Build/Workers/{chunk-CNLXMOPM.js → chunk-WNN5D4W3.js} +12 -11
- package/Build/Workers/{chunk-4JJQRZYL.js → chunk-WTQGE7Q6.js} +17 -17
- package/Build/Workers/{chunk-FCJQO4NC.js → chunk-WUBKZFF6.js} +2213 -1349
- package/Build/Workers/{chunk-3UQ2YMPP.js → chunk-ZAPOS52G.js} +12 -10
- package/Build/Workers/{chunk-LHFC4R7Z.js → chunk-ZCCIIBZT.js} +6 -6
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +175 -118
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +24 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +25 -25
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +12 -12
- 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 +12 -9
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/ArcType.js +6 -1
- package/Source/Core/ArticulationStageType.js +5 -1
- package/Source/Core/AssociativeArray.js +100 -94
- package/Source/Core/BoundingSphere.js +1296 -1300
- package/Source/Core/Cartesian2.js +7 -5
- package/Source/Core/Cartesian3.js +9 -8
- package/Source/Core/Cartesian4.js +8 -6
- package/Source/Core/Cartographic.js +257 -249
- package/Source/Core/ClockRange.js +6 -1
- package/Source/Core/ClockStep.js +6 -1
- package/Source/Core/Color.js +846 -835
- package/Source/Core/ComponentDatatype.js +4 -1
- package/Source/Core/CornerType.js +6 -1
- package/Source/Core/Credit.js +121 -124
- package/Source/Core/DeveloperError.js +2 -1
- package/Source/Core/Ellipsoid.js +637 -660
- package/Source/Core/ExtrapolationType.js +6 -1
- package/Source/Core/GeocodeType.js +6 -1
- package/Source/Core/GeographicProjection.js +74 -74
- package/Source/Core/GeographicTilingScheme.js +179 -198
- package/Source/Core/GeometryOffsetAttribute.js +7 -1
- package/Source/Core/GeometryType.js +7 -1
- package/Source/Core/HeightmapEncoding.js +6 -1
- package/Source/Core/ITwinPlatform.js +1 -0
- package/Source/Core/Iau2006XysData.js +24 -13
- package/Source/Core/IndexDatatype.js +3 -1
- package/Source/Core/InterpolationType.js +5 -1
- package/Source/Core/Intersect.js +6 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonGeocodeProviderType.js +5 -1
- package/Source/Core/JulianDate.js +850 -848
- package/Source/Core/KeyboardEventModifier.js +6 -1
- package/Source/Core/MapProjection.js +39 -44
- package/Source/Core/Matrix2.js +906 -893
- package/Source/Core/Matrix3.js +1643 -1575
- package/Source/Core/Matrix4.js +2903 -2872
- package/Source/Core/PixelFormat.js +3 -1
- package/Source/Core/PrimitiveType.js +11 -1
- package/Source/Core/Ray.js +62 -60
- package/Source/Core/Rectangle.js +913 -904
- package/Source/Core/ReferenceFrame.js +6 -1
- package/Source/Core/RequestScheduler.js +8 -3
- package/Source/Core/RequestState.js +6 -1
- package/Source/Core/RequestType.js +6 -1
- package/Source/Core/S2Cell.js +2 -2
- package/Source/Core/ScreenSpaceEventType.js +6 -1
- package/Source/Core/TerrainMesh.js +10 -1
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/TerrainQuantization.js +6 -1
- package/Source/Core/TilingScheme.js +100 -98
- package/Source/Core/TimeConstants.js +6 -1
- package/Source/Core/TimeStandard.js +6 -1
- package/Source/Core/TrackingReferenceFrame.js +6 -1
- package/Source/Core/Visibility.js +6 -1
- package/Source/Core/VulkanConstants.js +6 -1
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/WebGLConstants.js +6 -1
- package/Source/Core/WebMercatorProjection.js +108 -109
- package/Source/Core/WebMercatorTilingScheme.js +246 -242
- package/Source/Core/WindingOrder.js +3 -1
- package/Source/Core/assert.js +27 -0
- package/Source/Core/globalTypes.js +4 -0
- package/Source/DataSources/CzmlDataSource.js +9 -0
- package/Source/DataSources/PathGraphics.js +13 -0
- package/Source/DataSources/PathVisualizer.js +330 -18
- package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +4 -1
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +4 -1
- package/Source/DataSources/StripeOrientation.js +6 -1
- package/Source/Renderer/BufferUsage.js +20 -9
- package/Source/Renderer/Context.js +2 -29
- package/Source/Renderer/DrawCommand.js +435 -403
- package/Source/Renderer/MipmapHint.js +5 -1
- package/Source/Renderer/Pass.js +7 -1
- package/Source/Renderer/PickId.js +44 -0
- package/Source/Renderer/PixelDatatype.js +3 -1
- package/Source/Renderer/RenderState.js +2 -2
- package/Source/Renderer/RenderbufferFormat.js +5 -1
- package/Source/Renderer/ShaderDestination.js +4 -1
- package/Source/Renderer/TextureMagnificationFilter.js +3 -1
- package/Source/Renderer/TextureMinificationFilter.js +3 -1
- package/Source/Renderer/TextureWrap.js +5 -1
- package/Source/Renderer/VertexArray.js +80 -0
- package/Source/Scene/AlphaMode.js +5 -1
- package/Source/Scene/ArcGisBaseMapType.js +6 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/AttributeType.js +3 -1
- package/Source/Scene/Axis.js +3 -1
- package/Source/Scene/BillboardCollection.js +65 -364
- package/Source/Scene/BingMapsStyle.js +6 -1
- package/Source/Scene/BlendEquation.js +6 -1
- package/Source/Scene/BlendFunction.js +6 -1
- package/Source/Scene/BlendOption.js +6 -1
- package/Source/Scene/BlendingState.js +6 -1
- package/Source/Scene/BufferLoader.js +0 -2
- package/Source/Scene/BufferPoint.js +148 -0
- package/Source/Scene/BufferPointCollection.js +138 -0
- package/Source/Scene/BufferPointMaterial.js +95 -0
- package/Source/Scene/BufferPolygon.js +516 -0
- package/Source/Scene/BufferPolygonCollection.js +370 -0
- package/Source/Scene/BufferPolygonMaterial.js +41 -0
- package/Source/Scene/BufferPolyline.js +185 -0
- package/Source/Scene/BufferPolylineCollection.js +138 -0
- package/Source/Scene/BufferPolylineMaterial.js +93 -0
- package/Source/Scene/BufferPrimitive.js +347 -0
- package/Source/Scene/BufferPrimitiveCollection.js +818 -0
- package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
- package/Source/Scene/CameraEventType.js +6 -1
- package/Source/Scene/Cesium3DTileColorBlendMode.js +6 -1
- package/Source/Scene/Cesium3DTileContent.js +5 -1
- package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
- package/Source/Scene/Cesium3DTileContentState.js +6 -1
- package/Source/Scene/Cesium3DTileContentType.js +3 -1
- package/Source/Scene/Cesium3DTileFeature.js +289 -306
- package/Source/Scene/Cesium3DTileOptimizationHint.js +6 -1
- package/Source/Scene/Cesium3DTilePass.js +5 -1
- package/Source/Scene/Cesium3DTilePointFeature.js +433 -511
- package/Source/Scene/Cesium3DTileRefine.js +6 -1
- package/Source/Scene/Cesium3DTileStyle.js +22 -0
- package/Source/Scene/Cesium3DTileVectorFeature.js +586 -0
- package/Source/Scene/Cesium3DTileset.js +2 -1
- package/Source/Scene/ClassificationType.js +3 -1
- package/Source/Scene/ClippingPolygonCollection.js +270 -101
- package/Source/Scene/CloudType.js +3 -1
- package/Source/Scene/ColorBlendMode.js +4 -1
- package/Source/Scene/CubeMapPanorama.js +4 -4
- package/Source/Scene/CullFace.js +6 -1
- package/Source/Scene/DepthFunction.js +6 -1
- package/Source/Scene/DynamicAtmosphereLightingType.js +3 -1
- package/Source/Scene/EquirectangularPanorama.js +1 -0
- package/Source/Scene/ExpressionNodeType.js +6 -1
- package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
- package/Source/Scene/GaussianSplatPrimitive.js +413 -70
- package/Source/Scene/GetFeatureInfoFormat.js +3 -3
- package/Source/Scene/GltfBufferViewLoader.js +0 -2
- package/Source/Scene/GltfDracoLoader.js +0 -2
- package/Source/Scene/GltfImageLoader.js +0 -3
- package/Source/Scene/GltfIndexBufferLoader.js +0 -4
- package/Source/Scene/GltfJsonLoader.js +0 -2
- package/Source/Scene/GltfLoader.js +215 -39
- package/Source/Scene/GltfLoaderUtil.js +14 -0
- package/Source/Scene/GltfSpzLoader.js +109 -2
- package/Source/Scene/GltfStructuralMetadataLoader.js +0 -2
- package/Source/Scene/GltfTextureLoader.js +0 -2
- package/Source/Scene/GltfVertexBufferLoader.js +0 -4
- package/Source/Scene/HeightReference.js +5 -1
- package/Source/Scene/HorizontalOrigin.js +6 -1
- package/Source/Scene/ITwinData.js +1 -0
- package/Source/Scene/ImageryProvider.js +1 -1
- package/Source/Scene/ImageryState.js +6 -1
- package/Source/Scene/ImplicitSubdivisionScheme.js +3 -1
- package/Source/Scene/InstanceAttributeSemantic.js +3 -1
- package/Source/Scene/IonWorldImageryStyle.js +6 -1
- package/Source/Scene/JobType.js +6 -1
- package/Source/Scene/Label.js +32 -0
- package/Source/Scene/LabelCollection.js +14 -13
- package/Source/Scene/LabelStyle.js +6 -1
- package/Source/Scene/MapMode2D.js +6 -1
- package/Source/Scene/Material.js +2 -0
- package/Source/Scene/Megatexture.js +1 -0
- package/Source/Scene/MetadataClassProperty.js +24 -10
- package/Source/Scene/MetadataComponentType.js +118 -24
- package/Source/Scene/MetadataSchemaLoader.js +0 -2
- package/Source/Scene/MetadataSemantic.js +6 -2
- package/Source/Scene/MetadataType.js +3 -1
- package/Source/Scene/Model/B3dmLoader.js +0 -3
- package/Source/Scene/Model/CustomShaderMode.js +3 -1
- package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +5 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +735 -264
- package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +5 -1
- package/Source/Scene/Model/Extensions/Gpm/StorageType.js +5 -1
- package/Source/Scene/Model/GeoJsonLoader.js +0 -2
- package/Source/Scene/Model/I3dmLoader.js +0 -3
- package/Source/Scene/Model/InstancingPipelineStage.js +1 -1
- package/Source/Scene/Model/LightingModel.js +5 -1
- package/Source/Scene/Model/MaterialPipelineStage.js +331 -3
- package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +6 -0
- package/Source/Scene/Model/ModelReader.js +475 -4
- package/Source/Scene/Model/ModelRuntimePrimitive.js +2 -1
- package/Source/Scene/Model/ModelType.js +3 -1
- package/Source/Scene/Model/ModelUtility.js +3 -1
- package/Source/Scene/Model/PntsLoader.js +4 -3
- package/Source/Scene/Model/StyleCommandsNeeded.js +3 -1
- package/Source/Scene/Model/UniformType.js +5 -1
- package/Source/Scene/Model/VaryingType.js +5 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +375 -0
- package/Source/Scene/Model/pickModel.js +94 -299
- package/Source/Scene/ModelAnimationLoop.js +6 -1
- package/Source/Scene/ModelAnimationState.js +6 -1
- package/Source/Scene/ModelComponents.js +1639 -1542
- package/Source/Scene/PickedMetadataInfo.js +1 -0
- package/Source/Scene/PrimitiveState.js +7 -1
- package/Source/Scene/QuadtreeOccluders.js +20 -15
- package/Source/Scene/QuadtreeTile.js +547 -541
- package/Source/Scene/QuadtreeTileLoadState.js +6 -1
- package/Source/Scene/QuadtreeTileProvider.js +159 -175
- package/Source/Scene/ResourceLoader.js +0 -1
- package/Source/Scene/ResourceLoaderState.js +7 -1
- package/Source/Scene/SceneMode.js +4 -1
- package/Source/Scene/ScreenSpaceCameraController.js +13 -0
- package/Source/Scene/ShadowMode.js +3 -1
- package/Source/Scene/SkyBox.js +17 -8
- package/Source/Scene/SplitDirection.js +6 -1
- package/Source/Scene/StencilFunction.js +6 -1
- package/Source/Scene/StencilOperation.js +6 -1
- package/Source/Scene/TerrainState.js +7 -1
- package/Source/Scene/TileBoundingRegion.js +1 -1
- package/Source/Scene/TileBoundingS2Cell.js +1 -1
- package/Source/Scene/TileBoundingSphere.js +1 -1
- package/Source/Scene/TileState.js +7 -1
- package/Source/Scene/Tonemapper.js +5 -1
- package/Source/Scene/TweenCollection.js +7 -0
- package/Source/Scene/VectorGltf3DTileContent.js +403 -0
- package/Source/Scene/VertexAttributeSemantic.js +17 -1
- package/Source/Scene/VerticalOrigin.js +6 -1
- package/Source/Scene/VoxelBoxShape.js +12 -6
- package/Source/Scene/VoxelContent.js +2 -0
- package/Source/Scene/VoxelCylinderShape.js +39 -38
- package/Source/Scene/VoxelEllipsoidShape.js +46 -96
- package/Source/Scene/VoxelMetadataOrder.js +6 -1
- package/Source/Scene/VoxelProvider.js +1 -0
- package/Source/Scene/VoxelShapeType.js +3 -1
- package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
- package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
- package/Source/Scene/parseStructuralMetadata.js +97 -37
- package/Source/Scene/renderBufferPointCollection.js +285 -0
- package/Source/Scene/renderBufferPolygonCollection.js +339 -0
- package/Source/Scene/renderBufferPolylineCollection.js +478 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
- package/Source/Shaders/BillboardCollectionFS.js +2 -77
- package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
- package/Source/Shaders/BillboardCollectionVS.js +2 -60
- package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
- package/Source/Shaders/BufferPointMaterialFS.js +29 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
- package/Source/Shaders/BufferPointMaterialVS.js +50 -0
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
- package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
- package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
- package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
- package/Source/Shaders/Model/ConstantLodStageFS.glsl +60 -0
- package/Source/Shaders/Model/ConstantLodStageFS.js +62 -0
- package/Source/Shaders/Model/ConstantLodStageVS.glsl +12 -0
- package/Source/Shaders/Model/ConstantLodStageVS.js +13 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +46 -20
- package/Source/Shaders/Model/MaterialStageFS.js +46 -20
- package/Source/Shaders/Model/ModelFS.glsl +15 -0
- package/Source/Shaders/Model/ModelFS.js +15 -0
- package/Source/Shaders/Model/ModelVS.glsl +8 -0
- package/Source/Shaders/Model/ModelVS.js +8 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
- package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
- package/Source/Shaders/Voxels/VoxelFS.js +1 -1
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +0 -1
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +0 -1
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +7 -9
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +7 -9
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +7 -17
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +7 -17
- package/Source/Widget/CesiumWidget.js +11 -4
- package/Source/Workers/decodeDraco.js +3 -0
- package/Source/Workers/decodeI3S.js +5 -2
- package/index.d.ts +1332 -402
- package/index.js +111 -81
- package/package.json +3 -3
- package/Build/Workers/chunk-54O3AGOA.js +0 -642
- package/Build/Workers/chunk-6U5QMZU3.js +0 -940
- package/Build/Workers/chunk-HNDE73JK.js +0 -1829
- package/Build/Workers/chunk-PAFMAR7A.js +0 -2357
- package/Build/Workers/chunk-S53HSRT6.js +0 -114
|
@@ -1,940 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.139.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
|
-
Intersect_default
|
|
28
|
-
} from "./chunk-JUKGMJX7.js";
|
|
29
|
-
import {
|
|
30
|
-
Rectangle_default
|
|
31
|
-
} from "./chunk-FCJQO4NC.js";
|
|
32
|
-
import {
|
|
33
|
-
Matrix4_default
|
|
34
|
-
} from "./chunk-PAFMAR7A.js";
|
|
35
|
-
import {
|
|
36
|
-
Cartographic_default,
|
|
37
|
-
Ellipsoid_default
|
|
38
|
-
} from "./chunk-UOQB7XQI.js";
|
|
39
|
-
import {
|
|
40
|
-
Cartesian3_default,
|
|
41
|
-
Matrix3_default
|
|
42
|
-
} from "./chunk-HNDE73JK.js";
|
|
43
|
-
import {
|
|
44
|
-
Math_default
|
|
45
|
-
} from "./chunk-TXYQNXNW.js";
|
|
46
|
-
import {
|
|
47
|
-
Check_default,
|
|
48
|
-
DeveloperError_default
|
|
49
|
-
} from "./chunk-N6HRZLS6.js";
|
|
50
|
-
import {
|
|
51
|
-
defined_default
|
|
52
|
-
} from "./chunk-BTP3634E.js";
|
|
53
|
-
|
|
54
|
-
// packages/engine/Source/Core/GeographicProjection.js
|
|
55
|
-
function GeographicProjection(ellipsoid) {
|
|
56
|
-
this._ellipsoid = ellipsoid ?? Ellipsoid_default.default;
|
|
57
|
-
this._semimajorAxis = this._ellipsoid.maximumRadius;
|
|
58
|
-
this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
|
|
59
|
-
}
|
|
60
|
-
Object.defineProperties(GeographicProjection.prototype, {
|
|
61
|
-
/**
|
|
62
|
-
* Gets the {@link Ellipsoid}.
|
|
63
|
-
*
|
|
64
|
-
* @memberof GeographicProjection.prototype
|
|
65
|
-
*
|
|
66
|
-
* @type {Ellipsoid}
|
|
67
|
-
* @readonly
|
|
68
|
-
*/
|
|
69
|
-
ellipsoid: {
|
|
70
|
-
get: function() {
|
|
71
|
-
return this._ellipsoid;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
GeographicProjection.prototype.project = function(cartographic, result) {
|
|
76
|
-
const semimajorAxis = this._semimajorAxis;
|
|
77
|
-
const x = cartographic.longitude * semimajorAxis;
|
|
78
|
-
const y = cartographic.latitude * semimajorAxis;
|
|
79
|
-
const z = cartographic.height;
|
|
80
|
-
if (!defined_default(result)) {
|
|
81
|
-
return new Cartesian3_default(x, y, z);
|
|
82
|
-
}
|
|
83
|
-
result.x = x;
|
|
84
|
-
result.y = y;
|
|
85
|
-
result.z = z;
|
|
86
|
-
return result;
|
|
87
|
-
};
|
|
88
|
-
GeographicProjection.prototype.unproject = function(cartesian, result) {
|
|
89
|
-
if (!defined_default(cartesian)) {
|
|
90
|
-
throw new DeveloperError_default("cartesian is required");
|
|
91
|
-
}
|
|
92
|
-
const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
|
|
93
|
-
const longitude = cartesian.x * oneOverEarthSemimajorAxis;
|
|
94
|
-
const latitude = cartesian.y * oneOverEarthSemimajorAxis;
|
|
95
|
-
const height = cartesian.z;
|
|
96
|
-
if (!defined_default(result)) {
|
|
97
|
-
return new Cartographic_default(longitude, latitude, height);
|
|
98
|
-
}
|
|
99
|
-
result.longitude = longitude;
|
|
100
|
-
result.latitude = latitude;
|
|
101
|
-
result.height = height;
|
|
102
|
-
return result;
|
|
103
|
-
};
|
|
104
|
-
var GeographicProjection_default = GeographicProjection;
|
|
105
|
-
|
|
106
|
-
// packages/engine/Source/Core/Interval.js
|
|
107
|
-
function Interval(start, stop) {
|
|
108
|
-
this.start = start ?? 0;
|
|
109
|
-
this.stop = stop ?? 0;
|
|
110
|
-
}
|
|
111
|
-
var Interval_default = Interval;
|
|
112
|
-
|
|
113
|
-
// packages/engine/Source/Core/BoundingSphere.js
|
|
114
|
-
function BoundingSphere(center, radius) {
|
|
115
|
-
this.center = Cartesian3_default.clone(center ?? Cartesian3_default.ZERO);
|
|
116
|
-
this.radius = radius ?? 0;
|
|
117
|
-
}
|
|
118
|
-
var fromPointsXMin = new Cartesian3_default();
|
|
119
|
-
var fromPointsYMin = new Cartesian3_default();
|
|
120
|
-
var fromPointsZMin = new Cartesian3_default();
|
|
121
|
-
var fromPointsXMax = new Cartesian3_default();
|
|
122
|
-
var fromPointsYMax = new Cartesian3_default();
|
|
123
|
-
var fromPointsZMax = new Cartesian3_default();
|
|
124
|
-
var fromPointsCurrentPos = new Cartesian3_default();
|
|
125
|
-
var fromPointsScratch = new Cartesian3_default();
|
|
126
|
-
var fromPointsRitterCenter = new Cartesian3_default();
|
|
127
|
-
var fromPointsMinBoxPt = new Cartesian3_default();
|
|
128
|
-
var fromPointsMaxBoxPt = new Cartesian3_default();
|
|
129
|
-
var fromPointsNaiveCenterScratch = new Cartesian3_default();
|
|
130
|
-
var volumeConstant = 4 / 3 * Math_default.PI;
|
|
131
|
-
BoundingSphere.fromPoints = function(positions, result) {
|
|
132
|
-
if (!defined_default(result)) {
|
|
133
|
-
result = new BoundingSphere();
|
|
134
|
-
}
|
|
135
|
-
if (!defined_default(positions) || positions.length === 0) {
|
|
136
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
137
|
-
result.radius = 0;
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
const currentPos = Cartesian3_default.clone(positions[0], fromPointsCurrentPos);
|
|
141
|
-
const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
|
|
142
|
-
const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
|
|
143
|
-
const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
|
|
144
|
-
const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
|
|
145
|
-
const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
|
|
146
|
-
const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
|
|
147
|
-
const numPositions = positions.length;
|
|
148
|
-
let i;
|
|
149
|
-
for (i = 1; i < numPositions; i++) {
|
|
150
|
-
Cartesian3_default.clone(positions[i], currentPos);
|
|
151
|
-
const x = currentPos.x;
|
|
152
|
-
const y = currentPos.y;
|
|
153
|
-
const z = currentPos.z;
|
|
154
|
-
if (x < xMin.x) {
|
|
155
|
-
Cartesian3_default.clone(currentPos, xMin);
|
|
156
|
-
}
|
|
157
|
-
if (x > xMax.x) {
|
|
158
|
-
Cartesian3_default.clone(currentPos, xMax);
|
|
159
|
-
}
|
|
160
|
-
if (y < yMin.y) {
|
|
161
|
-
Cartesian3_default.clone(currentPos, yMin);
|
|
162
|
-
}
|
|
163
|
-
if (y > yMax.y) {
|
|
164
|
-
Cartesian3_default.clone(currentPos, yMax);
|
|
165
|
-
}
|
|
166
|
-
if (z < zMin.z) {
|
|
167
|
-
Cartesian3_default.clone(currentPos, zMin);
|
|
168
|
-
}
|
|
169
|
-
if (z > zMax.z) {
|
|
170
|
-
Cartesian3_default.clone(currentPos, zMax);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
const xSpan = Cartesian3_default.magnitudeSquared(
|
|
174
|
-
Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
|
|
175
|
-
);
|
|
176
|
-
const ySpan = Cartesian3_default.magnitudeSquared(
|
|
177
|
-
Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
|
|
178
|
-
);
|
|
179
|
-
const zSpan = Cartesian3_default.magnitudeSquared(
|
|
180
|
-
Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
|
|
181
|
-
);
|
|
182
|
-
let diameter1 = xMin;
|
|
183
|
-
let diameter2 = xMax;
|
|
184
|
-
let maxSpan = xSpan;
|
|
185
|
-
if (ySpan > maxSpan) {
|
|
186
|
-
maxSpan = ySpan;
|
|
187
|
-
diameter1 = yMin;
|
|
188
|
-
diameter2 = yMax;
|
|
189
|
-
}
|
|
190
|
-
if (zSpan > maxSpan) {
|
|
191
|
-
maxSpan = zSpan;
|
|
192
|
-
diameter1 = zMin;
|
|
193
|
-
diameter2 = zMax;
|
|
194
|
-
}
|
|
195
|
-
const ritterCenter = fromPointsRitterCenter;
|
|
196
|
-
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
|
|
197
|
-
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
|
|
198
|
-
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
|
|
199
|
-
let radiusSquared = Cartesian3_default.magnitudeSquared(
|
|
200
|
-
Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
|
|
201
|
-
);
|
|
202
|
-
let ritterRadius = Math.sqrt(radiusSquared);
|
|
203
|
-
const minBoxPt = fromPointsMinBoxPt;
|
|
204
|
-
minBoxPt.x = xMin.x;
|
|
205
|
-
minBoxPt.y = yMin.y;
|
|
206
|
-
minBoxPt.z = zMin.z;
|
|
207
|
-
const maxBoxPt = fromPointsMaxBoxPt;
|
|
208
|
-
maxBoxPt.x = xMax.x;
|
|
209
|
-
maxBoxPt.y = yMax.y;
|
|
210
|
-
maxBoxPt.z = zMax.z;
|
|
211
|
-
const naiveCenter = Cartesian3_default.midpoint(
|
|
212
|
-
minBoxPt,
|
|
213
|
-
maxBoxPt,
|
|
214
|
-
fromPointsNaiveCenterScratch
|
|
215
|
-
);
|
|
216
|
-
let naiveRadius = 0;
|
|
217
|
-
for (i = 0; i < numPositions; i++) {
|
|
218
|
-
Cartesian3_default.clone(positions[i], currentPos);
|
|
219
|
-
const r = Cartesian3_default.magnitude(
|
|
220
|
-
Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
|
|
221
|
-
);
|
|
222
|
-
if (r > naiveRadius) {
|
|
223
|
-
naiveRadius = r;
|
|
224
|
-
}
|
|
225
|
-
const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
|
|
226
|
-
Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
|
|
227
|
-
);
|
|
228
|
-
if (oldCenterToPointSquared > radiusSquared) {
|
|
229
|
-
const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
|
|
230
|
-
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
|
|
231
|
-
radiusSquared = ritterRadius * ritterRadius;
|
|
232
|
-
const oldToNew = oldCenterToPoint - ritterRadius;
|
|
233
|
-
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
|
|
234
|
-
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
|
|
235
|
-
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (ritterRadius < naiveRadius) {
|
|
239
|
-
Cartesian3_default.clone(ritterCenter, result.center);
|
|
240
|
-
result.radius = ritterRadius;
|
|
241
|
-
} else {
|
|
242
|
-
Cartesian3_default.clone(naiveCenter, result.center);
|
|
243
|
-
result.radius = naiveRadius;
|
|
244
|
-
}
|
|
245
|
-
return result;
|
|
246
|
-
};
|
|
247
|
-
var defaultProjection = new GeographicProjection_default();
|
|
248
|
-
var fromRectangle2DLowerLeft = new Cartesian3_default();
|
|
249
|
-
var fromRectangle2DUpperRight = new Cartesian3_default();
|
|
250
|
-
var fromRectangle2DSouthwest = new Cartographic_default();
|
|
251
|
-
var fromRectangle2DNortheast = new Cartographic_default();
|
|
252
|
-
BoundingSphere.fromRectangle2D = function(rectangle, projection, result) {
|
|
253
|
-
return BoundingSphere.fromRectangleWithHeights2D(
|
|
254
|
-
rectangle,
|
|
255
|
-
projection,
|
|
256
|
-
0,
|
|
257
|
-
0,
|
|
258
|
-
result
|
|
259
|
-
);
|
|
260
|
-
};
|
|
261
|
-
BoundingSphere.fromRectangleWithHeights2D = function(rectangle, projection, minimumHeight, maximumHeight, result) {
|
|
262
|
-
if (!defined_default(result)) {
|
|
263
|
-
result = new BoundingSphere();
|
|
264
|
-
}
|
|
265
|
-
if (!defined_default(rectangle)) {
|
|
266
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
267
|
-
result.radius = 0;
|
|
268
|
-
return result;
|
|
269
|
-
}
|
|
270
|
-
defaultProjection._ellipsoid = Ellipsoid_default.default;
|
|
271
|
-
projection = projection ?? defaultProjection;
|
|
272
|
-
Rectangle_default.southwest(rectangle, fromRectangle2DSouthwest);
|
|
273
|
-
fromRectangle2DSouthwest.height = minimumHeight;
|
|
274
|
-
Rectangle_default.northeast(rectangle, fromRectangle2DNortheast);
|
|
275
|
-
fromRectangle2DNortheast.height = maximumHeight;
|
|
276
|
-
const lowerLeft = projection.project(
|
|
277
|
-
fromRectangle2DSouthwest,
|
|
278
|
-
fromRectangle2DLowerLeft
|
|
279
|
-
);
|
|
280
|
-
const upperRight = projection.project(
|
|
281
|
-
fromRectangle2DNortheast,
|
|
282
|
-
fromRectangle2DUpperRight
|
|
283
|
-
);
|
|
284
|
-
const width = upperRight.x - lowerLeft.x;
|
|
285
|
-
const height = upperRight.y - lowerLeft.y;
|
|
286
|
-
const elevation = upperRight.z - lowerLeft.z;
|
|
287
|
-
result.radius = Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;
|
|
288
|
-
const center = result.center;
|
|
289
|
-
center.x = lowerLeft.x + width * 0.5;
|
|
290
|
-
center.y = lowerLeft.y + height * 0.5;
|
|
291
|
-
center.z = lowerLeft.z + elevation * 0.5;
|
|
292
|
-
return result;
|
|
293
|
-
};
|
|
294
|
-
var fromRectangle3DScratch = [];
|
|
295
|
-
BoundingSphere.fromRectangle3D = function(rectangle, ellipsoid, surfaceHeight, result) {
|
|
296
|
-
ellipsoid = ellipsoid ?? Ellipsoid_default.default;
|
|
297
|
-
surfaceHeight = surfaceHeight ?? 0;
|
|
298
|
-
if (!defined_default(result)) {
|
|
299
|
-
result = new BoundingSphere();
|
|
300
|
-
}
|
|
301
|
-
if (!defined_default(rectangle)) {
|
|
302
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
303
|
-
result.radius = 0;
|
|
304
|
-
return result;
|
|
305
|
-
}
|
|
306
|
-
const positions = Rectangle_default.subsample(
|
|
307
|
-
rectangle,
|
|
308
|
-
ellipsoid,
|
|
309
|
-
surfaceHeight,
|
|
310
|
-
fromRectangle3DScratch
|
|
311
|
-
);
|
|
312
|
-
return BoundingSphere.fromPoints(positions, result);
|
|
313
|
-
};
|
|
314
|
-
BoundingSphere.fromVertices = function(positions, center, stride, result) {
|
|
315
|
-
if (!defined_default(result)) {
|
|
316
|
-
result = new BoundingSphere();
|
|
317
|
-
}
|
|
318
|
-
if (!defined_default(positions) || positions.length === 0) {
|
|
319
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
320
|
-
result.radius = 0;
|
|
321
|
-
return result;
|
|
322
|
-
}
|
|
323
|
-
center = center ?? Cartesian3_default.ZERO;
|
|
324
|
-
stride = stride ?? 3;
|
|
325
|
-
Check_default.typeOf.number.greaterThanOrEquals("stride", stride, 3);
|
|
326
|
-
const currentPos = fromPointsCurrentPos;
|
|
327
|
-
currentPos.x = positions[0] + center.x;
|
|
328
|
-
currentPos.y = positions[1] + center.y;
|
|
329
|
-
currentPos.z = positions[2] + center.z;
|
|
330
|
-
const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
|
|
331
|
-
const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
|
|
332
|
-
const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
|
|
333
|
-
const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
|
|
334
|
-
const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
|
|
335
|
-
const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
|
|
336
|
-
const numElements = positions.length;
|
|
337
|
-
let i;
|
|
338
|
-
for (i = 0; i < numElements; i += stride) {
|
|
339
|
-
const x = positions[i] + center.x;
|
|
340
|
-
const y = positions[i + 1] + center.y;
|
|
341
|
-
const z = positions[i + 2] + center.z;
|
|
342
|
-
currentPos.x = x;
|
|
343
|
-
currentPos.y = y;
|
|
344
|
-
currentPos.z = z;
|
|
345
|
-
if (x < xMin.x) {
|
|
346
|
-
Cartesian3_default.clone(currentPos, xMin);
|
|
347
|
-
}
|
|
348
|
-
if (x > xMax.x) {
|
|
349
|
-
Cartesian3_default.clone(currentPos, xMax);
|
|
350
|
-
}
|
|
351
|
-
if (y < yMin.y) {
|
|
352
|
-
Cartesian3_default.clone(currentPos, yMin);
|
|
353
|
-
}
|
|
354
|
-
if (y > yMax.y) {
|
|
355
|
-
Cartesian3_default.clone(currentPos, yMax);
|
|
356
|
-
}
|
|
357
|
-
if (z < zMin.z) {
|
|
358
|
-
Cartesian3_default.clone(currentPos, zMin);
|
|
359
|
-
}
|
|
360
|
-
if (z > zMax.z) {
|
|
361
|
-
Cartesian3_default.clone(currentPos, zMax);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
const xSpan = Cartesian3_default.magnitudeSquared(
|
|
365
|
-
Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
|
|
366
|
-
);
|
|
367
|
-
const ySpan = Cartesian3_default.magnitudeSquared(
|
|
368
|
-
Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
|
|
369
|
-
);
|
|
370
|
-
const zSpan = Cartesian3_default.magnitudeSquared(
|
|
371
|
-
Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
|
|
372
|
-
);
|
|
373
|
-
let diameter1 = xMin;
|
|
374
|
-
let diameter2 = xMax;
|
|
375
|
-
let maxSpan = xSpan;
|
|
376
|
-
if (ySpan > maxSpan) {
|
|
377
|
-
maxSpan = ySpan;
|
|
378
|
-
diameter1 = yMin;
|
|
379
|
-
diameter2 = yMax;
|
|
380
|
-
}
|
|
381
|
-
if (zSpan > maxSpan) {
|
|
382
|
-
maxSpan = zSpan;
|
|
383
|
-
diameter1 = zMin;
|
|
384
|
-
diameter2 = zMax;
|
|
385
|
-
}
|
|
386
|
-
const ritterCenter = fromPointsRitterCenter;
|
|
387
|
-
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
|
|
388
|
-
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
|
|
389
|
-
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
|
|
390
|
-
let radiusSquared = Cartesian3_default.magnitudeSquared(
|
|
391
|
-
Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
|
|
392
|
-
);
|
|
393
|
-
let ritterRadius = Math.sqrt(radiusSquared);
|
|
394
|
-
const minBoxPt = fromPointsMinBoxPt;
|
|
395
|
-
minBoxPt.x = xMin.x;
|
|
396
|
-
minBoxPt.y = yMin.y;
|
|
397
|
-
minBoxPt.z = zMin.z;
|
|
398
|
-
const maxBoxPt = fromPointsMaxBoxPt;
|
|
399
|
-
maxBoxPt.x = xMax.x;
|
|
400
|
-
maxBoxPt.y = yMax.y;
|
|
401
|
-
maxBoxPt.z = zMax.z;
|
|
402
|
-
const naiveCenter = Cartesian3_default.midpoint(
|
|
403
|
-
minBoxPt,
|
|
404
|
-
maxBoxPt,
|
|
405
|
-
fromPointsNaiveCenterScratch
|
|
406
|
-
);
|
|
407
|
-
let naiveRadius = 0;
|
|
408
|
-
for (i = 0; i < numElements; i += stride) {
|
|
409
|
-
currentPos.x = positions[i] + center.x;
|
|
410
|
-
currentPos.y = positions[i + 1] + center.y;
|
|
411
|
-
currentPos.z = positions[i + 2] + center.z;
|
|
412
|
-
const r = Cartesian3_default.magnitude(
|
|
413
|
-
Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
|
|
414
|
-
);
|
|
415
|
-
if (r > naiveRadius) {
|
|
416
|
-
naiveRadius = r;
|
|
417
|
-
}
|
|
418
|
-
const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
|
|
419
|
-
Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
|
|
420
|
-
);
|
|
421
|
-
if (oldCenterToPointSquared > radiusSquared) {
|
|
422
|
-
const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
|
|
423
|
-
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
|
|
424
|
-
radiusSquared = ritterRadius * ritterRadius;
|
|
425
|
-
const oldToNew = oldCenterToPoint - ritterRadius;
|
|
426
|
-
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
|
|
427
|
-
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
|
|
428
|
-
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (ritterRadius < naiveRadius) {
|
|
432
|
-
Cartesian3_default.clone(ritterCenter, result.center);
|
|
433
|
-
result.radius = ritterRadius;
|
|
434
|
-
} else {
|
|
435
|
-
Cartesian3_default.clone(naiveCenter, result.center);
|
|
436
|
-
result.radius = naiveRadius;
|
|
437
|
-
}
|
|
438
|
-
return result;
|
|
439
|
-
};
|
|
440
|
-
BoundingSphere.fromEncodedCartesianVertices = function(positionsHigh, positionsLow, result) {
|
|
441
|
-
if (!defined_default(result)) {
|
|
442
|
-
result = new BoundingSphere();
|
|
443
|
-
}
|
|
444
|
-
if (!defined_default(positionsHigh) || !defined_default(positionsLow) || positionsHigh.length !== positionsLow.length || positionsHigh.length === 0) {
|
|
445
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
446
|
-
result.radius = 0;
|
|
447
|
-
return result;
|
|
448
|
-
}
|
|
449
|
-
const currentPos = fromPointsCurrentPos;
|
|
450
|
-
currentPos.x = positionsHigh[0] + positionsLow[0];
|
|
451
|
-
currentPos.y = positionsHigh[1] + positionsLow[1];
|
|
452
|
-
currentPos.z = positionsHigh[2] + positionsLow[2];
|
|
453
|
-
const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
|
|
454
|
-
const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
|
|
455
|
-
const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
|
|
456
|
-
const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
|
|
457
|
-
const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
|
|
458
|
-
const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
|
|
459
|
-
const numElements = positionsHigh.length;
|
|
460
|
-
let i;
|
|
461
|
-
for (i = 0; i < numElements; i += 3) {
|
|
462
|
-
const x = positionsHigh[i] + positionsLow[i];
|
|
463
|
-
const y = positionsHigh[i + 1] + positionsLow[i + 1];
|
|
464
|
-
const z = positionsHigh[i + 2] + positionsLow[i + 2];
|
|
465
|
-
currentPos.x = x;
|
|
466
|
-
currentPos.y = y;
|
|
467
|
-
currentPos.z = z;
|
|
468
|
-
if (x < xMin.x) {
|
|
469
|
-
Cartesian3_default.clone(currentPos, xMin);
|
|
470
|
-
}
|
|
471
|
-
if (x > xMax.x) {
|
|
472
|
-
Cartesian3_default.clone(currentPos, xMax);
|
|
473
|
-
}
|
|
474
|
-
if (y < yMin.y) {
|
|
475
|
-
Cartesian3_default.clone(currentPos, yMin);
|
|
476
|
-
}
|
|
477
|
-
if (y > yMax.y) {
|
|
478
|
-
Cartesian3_default.clone(currentPos, yMax);
|
|
479
|
-
}
|
|
480
|
-
if (z < zMin.z) {
|
|
481
|
-
Cartesian3_default.clone(currentPos, zMin);
|
|
482
|
-
}
|
|
483
|
-
if (z > zMax.z) {
|
|
484
|
-
Cartesian3_default.clone(currentPos, zMax);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
const xSpan = Cartesian3_default.magnitudeSquared(
|
|
488
|
-
Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
|
|
489
|
-
);
|
|
490
|
-
const ySpan = Cartesian3_default.magnitudeSquared(
|
|
491
|
-
Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
|
|
492
|
-
);
|
|
493
|
-
const zSpan = Cartesian3_default.magnitudeSquared(
|
|
494
|
-
Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
|
|
495
|
-
);
|
|
496
|
-
let diameter1 = xMin;
|
|
497
|
-
let diameter2 = xMax;
|
|
498
|
-
let maxSpan = xSpan;
|
|
499
|
-
if (ySpan > maxSpan) {
|
|
500
|
-
maxSpan = ySpan;
|
|
501
|
-
diameter1 = yMin;
|
|
502
|
-
diameter2 = yMax;
|
|
503
|
-
}
|
|
504
|
-
if (zSpan > maxSpan) {
|
|
505
|
-
maxSpan = zSpan;
|
|
506
|
-
diameter1 = zMin;
|
|
507
|
-
diameter2 = zMax;
|
|
508
|
-
}
|
|
509
|
-
const ritterCenter = fromPointsRitterCenter;
|
|
510
|
-
ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
|
|
511
|
-
ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
|
|
512
|
-
ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
|
|
513
|
-
let radiusSquared = Cartesian3_default.magnitudeSquared(
|
|
514
|
-
Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
|
|
515
|
-
);
|
|
516
|
-
let ritterRadius = Math.sqrt(radiusSquared);
|
|
517
|
-
const minBoxPt = fromPointsMinBoxPt;
|
|
518
|
-
minBoxPt.x = xMin.x;
|
|
519
|
-
minBoxPt.y = yMin.y;
|
|
520
|
-
minBoxPt.z = zMin.z;
|
|
521
|
-
const maxBoxPt = fromPointsMaxBoxPt;
|
|
522
|
-
maxBoxPt.x = xMax.x;
|
|
523
|
-
maxBoxPt.y = yMax.y;
|
|
524
|
-
maxBoxPt.z = zMax.z;
|
|
525
|
-
const naiveCenter = Cartesian3_default.midpoint(
|
|
526
|
-
minBoxPt,
|
|
527
|
-
maxBoxPt,
|
|
528
|
-
fromPointsNaiveCenterScratch
|
|
529
|
-
);
|
|
530
|
-
let naiveRadius = 0;
|
|
531
|
-
for (i = 0; i < numElements; i += 3) {
|
|
532
|
-
currentPos.x = positionsHigh[i] + positionsLow[i];
|
|
533
|
-
currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];
|
|
534
|
-
currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];
|
|
535
|
-
const r = Cartesian3_default.magnitude(
|
|
536
|
-
Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
|
|
537
|
-
);
|
|
538
|
-
if (r > naiveRadius) {
|
|
539
|
-
naiveRadius = r;
|
|
540
|
-
}
|
|
541
|
-
const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
|
|
542
|
-
Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
|
|
543
|
-
);
|
|
544
|
-
if (oldCenterToPointSquared > radiusSquared) {
|
|
545
|
-
const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
|
|
546
|
-
ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
|
|
547
|
-
radiusSquared = ritterRadius * ritterRadius;
|
|
548
|
-
const oldToNew = oldCenterToPoint - ritterRadius;
|
|
549
|
-
ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
|
|
550
|
-
ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
|
|
551
|
-
ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
if (ritterRadius < naiveRadius) {
|
|
555
|
-
Cartesian3_default.clone(ritterCenter, result.center);
|
|
556
|
-
result.radius = ritterRadius;
|
|
557
|
-
} else {
|
|
558
|
-
Cartesian3_default.clone(naiveCenter, result.center);
|
|
559
|
-
result.radius = naiveRadius;
|
|
560
|
-
}
|
|
561
|
-
return result;
|
|
562
|
-
};
|
|
563
|
-
BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) {
|
|
564
|
-
Check_default.typeOf.object("corner", corner);
|
|
565
|
-
Check_default.typeOf.object("oppositeCorner", oppositeCorner);
|
|
566
|
-
if (!defined_default(result)) {
|
|
567
|
-
result = new BoundingSphere();
|
|
568
|
-
}
|
|
569
|
-
const center = Cartesian3_default.midpoint(corner, oppositeCorner, result.center);
|
|
570
|
-
result.radius = Cartesian3_default.distance(center, oppositeCorner);
|
|
571
|
-
return result;
|
|
572
|
-
};
|
|
573
|
-
BoundingSphere.fromEllipsoid = function(ellipsoid, result) {
|
|
574
|
-
Check_default.typeOf.object("ellipsoid", ellipsoid);
|
|
575
|
-
if (!defined_default(result)) {
|
|
576
|
-
result = new BoundingSphere();
|
|
577
|
-
}
|
|
578
|
-
Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
579
|
-
result.radius = ellipsoid.maximumRadius;
|
|
580
|
-
return result;
|
|
581
|
-
};
|
|
582
|
-
var fromBoundingSpheresScratch = new Cartesian3_default();
|
|
583
|
-
BoundingSphere.fromBoundingSpheres = function(boundingSpheres, result) {
|
|
584
|
-
if (!defined_default(result)) {
|
|
585
|
-
result = new BoundingSphere();
|
|
586
|
-
}
|
|
587
|
-
if (!defined_default(boundingSpheres) || boundingSpheres.length === 0) {
|
|
588
|
-
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
589
|
-
result.radius = 0;
|
|
590
|
-
return result;
|
|
591
|
-
}
|
|
592
|
-
const length = boundingSpheres.length;
|
|
593
|
-
if (length === 1) {
|
|
594
|
-
return BoundingSphere.clone(boundingSpheres[0], result);
|
|
595
|
-
}
|
|
596
|
-
if (length === 2) {
|
|
597
|
-
return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);
|
|
598
|
-
}
|
|
599
|
-
const positions = [];
|
|
600
|
-
let i;
|
|
601
|
-
for (i = 0; i < length; i++) {
|
|
602
|
-
positions.push(boundingSpheres[i].center);
|
|
603
|
-
}
|
|
604
|
-
result = BoundingSphere.fromPoints(positions, result);
|
|
605
|
-
const center = result.center;
|
|
606
|
-
let radius = result.radius;
|
|
607
|
-
for (i = 0; i < length; i++) {
|
|
608
|
-
const tmp = boundingSpheres[i];
|
|
609
|
-
radius = Math.max(
|
|
610
|
-
radius,
|
|
611
|
-
Cartesian3_default.distance(center, tmp.center, fromBoundingSpheresScratch) + tmp.radius
|
|
612
|
-
);
|
|
613
|
-
}
|
|
614
|
-
result.radius = radius;
|
|
615
|
-
return result;
|
|
616
|
-
};
|
|
617
|
-
var fromOrientedBoundingBoxScratchU = new Cartesian3_default();
|
|
618
|
-
var fromOrientedBoundingBoxScratchV = new Cartesian3_default();
|
|
619
|
-
var fromOrientedBoundingBoxScratchW = new Cartesian3_default();
|
|
620
|
-
BoundingSphere.fromOrientedBoundingBox = function(orientedBoundingBox, result) {
|
|
621
|
-
Check_default.defined("orientedBoundingBox", orientedBoundingBox);
|
|
622
|
-
if (!defined_default(result)) {
|
|
623
|
-
result = new BoundingSphere();
|
|
624
|
-
}
|
|
625
|
-
const halfAxes = orientedBoundingBox.halfAxes;
|
|
626
|
-
const u = Matrix3_default.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);
|
|
627
|
-
const v = Matrix3_default.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);
|
|
628
|
-
const w = Matrix3_default.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);
|
|
629
|
-
Cartesian3_default.add(u, v, u);
|
|
630
|
-
Cartesian3_default.add(u, w, u);
|
|
631
|
-
result.center = Cartesian3_default.clone(orientedBoundingBox.center, result.center);
|
|
632
|
-
result.radius = Cartesian3_default.magnitude(u);
|
|
633
|
-
return result;
|
|
634
|
-
};
|
|
635
|
-
var scratchFromTransformationCenter = new Cartesian3_default();
|
|
636
|
-
var scratchFromTransformationScale = new Cartesian3_default();
|
|
637
|
-
BoundingSphere.fromTransformation = function(transformation, result) {
|
|
638
|
-
Check_default.typeOf.object("transformation", transformation);
|
|
639
|
-
if (!defined_default(result)) {
|
|
640
|
-
result = new BoundingSphere();
|
|
641
|
-
}
|
|
642
|
-
const center = Matrix4_default.getTranslation(
|
|
643
|
-
transformation,
|
|
644
|
-
scratchFromTransformationCenter
|
|
645
|
-
);
|
|
646
|
-
const scale = Matrix4_default.getScale(
|
|
647
|
-
transformation,
|
|
648
|
-
scratchFromTransformationScale
|
|
649
|
-
);
|
|
650
|
-
const radius = 0.5 * Cartesian3_default.magnitude(scale);
|
|
651
|
-
result.center = Cartesian3_default.clone(center, result.center);
|
|
652
|
-
result.radius = radius;
|
|
653
|
-
return result;
|
|
654
|
-
};
|
|
655
|
-
BoundingSphere.clone = function(sphere, result) {
|
|
656
|
-
if (!defined_default(sphere)) {
|
|
657
|
-
return void 0;
|
|
658
|
-
}
|
|
659
|
-
if (!defined_default(result)) {
|
|
660
|
-
return new BoundingSphere(sphere.center, sphere.radius);
|
|
661
|
-
}
|
|
662
|
-
result.center = Cartesian3_default.clone(sphere.center, result.center);
|
|
663
|
-
result.radius = sphere.radius;
|
|
664
|
-
return result;
|
|
665
|
-
};
|
|
666
|
-
BoundingSphere.packedLength = 4;
|
|
667
|
-
BoundingSphere.pack = function(value, array, startingIndex) {
|
|
668
|
-
Check_default.typeOf.object("value", value);
|
|
669
|
-
Check_default.defined("array", array);
|
|
670
|
-
startingIndex = startingIndex ?? 0;
|
|
671
|
-
const center = value.center;
|
|
672
|
-
array[startingIndex++] = center.x;
|
|
673
|
-
array[startingIndex++] = center.y;
|
|
674
|
-
array[startingIndex++] = center.z;
|
|
675
|
-
array[startingIndex] = value.radius;
|
|
676
|
-
return array;
|
|
677
|
-
};
|
|
678
|
-
BoundingSphere.unpack = function(array, startingIndex, result) {
|
|
679
|
-
Check_default.defined("array", array);
|
|
680
|
-
startingIndex = startingIndex ?? 0;
|
|
681
|
-
if (!defined_default(result)) {
|
|
682
|
-
result = new BoundingSphere();
|
|
683
|
-
}
|
|
684
|
-
const center = result.center;
|
|
685
|
-
center.x = array[startingIndex++];
|
|
686
|
-
center.y = array[startingIndex++];
|
|
687
|
-
center.z = array[startingIndex++];
|
|
688
|
-
result.radius = array[startingIndex];
|
|
689
|
-
return result;
|
|
690
|
-
};
|
|
691
|
-
var unionScratch = new Cartesian3_default();
|
|
692
|
-
var unionScratchCenter = new Cartesian3_default();
|
|
693
|
-
BoundingSphere.union = function(left, right, result) {
|
|
694
|
-
Check_default.typeOf.object("left", left);
|
|
695
|
-
Check_default.typeOf.object("right", right);
|
|
696
|
-
if (!defined_default(result)) {
|
|
697
|
-
result = new BoundingSphere();
|
|
698
|
-
}
|
|
699
|
-
const leftCenter = left.center;
|
|
700
|
-
const leftRadius = left.radius;
|
|
701
|
-
const rightCenter = right.center;
|
|
702
|
-
const rightRadius = right.radius;
|
|
703
|
-
const toRightCenter = Cartesian3_default.subtract(
|
|
704
|
-
rightCenter,
|
|
705
|
-
leftCenter,
|
|
706
|
-
unionScratch
|
|
707
|
-
);
|
|
708
|
-
const centerSeparation = Cartesian3_default.magnitude(toRightCenter);
|
|
709
|
-
if (leftRadius >= centerSeparation + rightRadius) {
|
|
710
|
-
left.clone(result);
|
|
711
|
-
return result;
|
|
712
|
-
}
|
|
713
|
-
if (rightRadius >= centerSeparation + leftRadius) {
|
|
714
|
-
right.clone(result);
|
|
715
|
-
return result;
|
|
716
|
-
}
|
|
717
|
-
const halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
|
|
718
|
-
const center = Cartesian3_default.multiplyByScalar(
|
|
719
|
-
toRightCenter,
|
|
720
|
-
(-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,
|
|
721
|
-
unionScratchCenter
|
|
722
|
-
);
|
|
723
|
-
Cartesian3_default.add(center, leftCenter, center);
|
|
724
|
-
Cartesian3_default.clone(center, result.center);
|
|
725
|
-
result.radius = halfDistanceBetweenTangentPoints;
|
|
726
|
-
return result;
|
|
727
|
-
};
|
|
728
|
-
var expandScratch = new Cartesian3_default();
|
|
729
|
-
BoundingSphere.expand = function(sphere, point, result) {
|
|
730
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
731
|
-
Check_default.typeOf.object("point", point);
|
|
732
|
-
result = BoundingSphere.clone(sphere, result);
|
|
733
|
-
const radius = Cartesian3_default.magnitude(
|
|
734
|
-
Cartesian3_default.subtract(point, result.center, expandScratch)
|
|
735
|
-
);
|
|
736
|
-
if (radius > result.radius) {
|
|
737
|
-
result.radius = radius;
|
|
738
|
-
}
|
|
739
|
-
return result;
|
|
740
|
-
};
|
|
741
|
-
BoundingSphere.intersectPlane = function(sphere, plane) {
|
|
742
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
743
|
-
Check_default.typeOf.object("plane", plane);
|
|
744
|
-
const center = sphere.center;
|
|
745
|
-
const radius = sphere.radius;
|
|
746
|
-
const normal = plane.normal;
|
|
747
|
-
const distanceToPlane = Cartesian3_default.dot(normal, center) + plane.distance;
|
|
748
|
-
if (distanceToPlane < -radius) {
|
|
749
|
-
return Intersect_default.OUTSIDE;
|
|
750
|
-
} else if (distanceToPlane < radius) {
|
|
751
|
-
return Intersect_default.INTERSECTING;
|
|
752
|
-
}
|
|
753
|
-
return Intersect_default.INSIDE;
|
|
754
|
-
};
|
|
755
|
-
BoundingSphere.transform = function(sphere, transform, result) {
|
|
756
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
757
|
-
Check_default.typeOf.object("transform", transform);
|
|
758
|
-
if (!defined_default(result)) {
|
|
759
|
-
result = new BoundingSphere();
|
|
760
|
-
}
|
|
761
|
-
result.center = Matrix4_default.multiplyByPoint(
|
|
762
|
-
transform,
|
|
763
|
-
sphere.center,
|
|
764
|
-
result.center
|
|
765
|
-
);
|
|
766
|
-
result.radius = Matrix4_default.getMaximumScale(transform) * sphere.radius;
|
|
767
|
-
return result;
|
|
768
|
-
};
|
|
769
|
-
var distanceSquaredToScratch = new Cartesian3_default();
|
|
770
|
-
BoundingSphere.distanceSquaredTo = function(sphere, cartesian) {
|
|
771
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
772
|
-
Check_default.typeOf.object("cartesian", cartesian);
|
|
773
|
-
const diff = Cartesian3_default.subtract(
|
|
774
|
-
sphere.center,
|
|
775
|
-
cartesian,
|
|
776
|
-
distanceSquaredToScratch
|
|
777
|
-
);
|
|
778
|
-
const distance = Cartesian3_default.magnitude(diff) - sphere.radius;
|
|
779
|
-
if (distance <= 0) {
|
|
780
|
-
return 0;
|
|
781
|
-
}
|
|
782
|
-
return distance * distance;
|
|
783
|
-
};
|
|
784
|
-
BoundingSphere.transformWithoutScale = function(sphere, transform, result) {
|
|
785
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
786
|
-
Check_default.typeOf.object("transform", transform);
|
|
787
|
-
if (!defined_default(result)) {
|
|
788
|
-
result = new BoundingSphere();
|
|
789
|
-
}
|
|
790
|
-
result.center = Matrix4_default.multiplyByPoint(
|
|
791
|
-
transform,
|
|
792
|
-
sphere.center,
|
|
793
|
-
result.center
|
|
794
|
-
);
|
|
795
|
-
result.radius = sphere.radius;
|
|
796
|
-
return result;
|
|
797
|
-
};
|
|
798
|
-
var scratchCartesian3 = new Cartesian3_default();
|
|
799
|
-
BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) {
|
|
800
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
801
|
-
Check_default.typeOf.object("position", position);
|
|
802
|
-
Check_default.typeOf.object("direction", direction);
|
|
803
|
-
if (!defined_default(result)) {
|
|
804
|
-
result = new Interval_default();
|
|
805
|
-
}
|
|
806
|
-
const toCenter = Cartesian3_default.subtract(
|
|
807
|
-
sphere.center,
|
|
808
|
-
position,
|
|
809
|
-
scratchCartesian3
|
|
810
|
-
);
|
|
811
|
-
const mag = Cartesian3_default.dot(direction, toCenter);
|
|
812
|
-
result.start = mag - sphere.radius;
|
|
813
|
-
result.stop = mag + sphere.radius;
|
|
814
|
-
return result;
|
|
815
|
-
};
|
|
816
|
-
var projectTo2DNormalScratch = new Cartesian3_default();
|
|
817
|
-
var projectTo2DEastScratch = new Cartesian3_default();
|
|
818
|
-
var projectTo2DNorthScratch = new Cartesian3_default();
|
|
819
|
-
var projectTo2DWestScratch = new Cartesian3_default();
|
|
820
|
-
var projectTo2DSouthScratch = new Cartesian3_default();
|
|
821
|
-
var projectTo2DCartographicScratch = new Cartographic_default();
|
|
822
|
-
var projectTo2DPositionsScratch = new Array(8);
|
|
823
|
-
for (let n = 0; n < 8; ++n) {
|
|
824
|
-
projectTo2DPositionsScratch[n] = new Cartesian3_default();
|
|
825
|
-
}
|
|
826
|
-
var projectTo2DProjection = new GeographicProjection_default();
|
|
827
|
-
BoundingSphere.projectTo2D = function(sphere, projection, result) {
|
|
828
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
829
|
-
projectTo2DProjection._ellipsoid = Ellipsoid_default.default;
|
|
830
|
-
projection = projection ?? projectTo2DProjection;
|
|
831
|
-
const ellipsoid = projection.ellipsoid;
|
|
832
|
-
let center = sphere.center;
|
|
833
|
-
const radius = sphere.radius;
|
|
834
|
-
let normal;
|
|
835
|
-
if (Cartesian3_default.equals(center, Cartesian3_default.ZERO)) {
|
|
836
|
-
normal = Cartesian3_default.clone(Cartesian3_default.UNIT_X, projectTo2DNormalScratch);
|
|
837
|
-
} else {
|
|
838
|
-
normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);
|
|
839
|
-
}
|
|
840
|
-
const east = Cartesian3_default.cross(
|
|
841
|
-
Cartesian3_default.UNIT_Z,
|
|
842
|
-
normal,
|
|
843
|
-
projectTo2DEastScratch
|
|
844
|
-
);
|
|
845
|
-
Cartesian3_default.normalize(east, east);
|
|
846
|
-
const north = Cartesian3_default.cross(normal, east, projectTo2DNorthScratch);
|
|
847
|
-
Cartesian3_default.normalize(north, north);
|
|
848
|
-
Cartesian3_default.multiplyByScalar(normal, radius, normal);
|
|
849
|
-
Cartesian3_default.multiplyByScalar(north, radius, north);
|
|
850
|
-
Cartesian3_default.multiplyByScalar(east, radius, east);
|
|
851
|
-
const south = Cartesian3_default.negate(north, projectTo2DSouthScratch);
|
|
852
|
-
const west = Cartesian3_default.negate(east, projectTo2DWestScratch);
|
|
853
|
-
const positions = projectTo2DPositionsScratch;
|
|
854
|
-
let corner = positions[0];
|
|
855
|
-
Cartesian3_default.add(normal, north, corner);
|
|
856
|
-
Cartesian3_default.add(corner, east, corner);
|
|
857
|
-
corner = positions[1];
|
|
858
|
-
Cartesian3_default.add(normal, north, corner);
|
|
859
|
-
Cartesian3_default.add(corner, west, corner);
|
|
860
|
-
corner = positions[2];
|
|
861
|
-
Cartesian3_default.add(normal, south, corner);
|
|
862
|
-
Cartesian3_default.add(corner, west, corner);
|
|
863
|
-
corner = positions[3];
|
|
864
|
-
Cartesian3_default.add(normal, south, corner);
|
|
865
|
-
Cartesian3_default.add(corner, east, corner);
|
|
866
|
-
Cartesian3_default.negate(normal, normal);
|
|
867
|
-
corner = positions[4];
|
|
868
|
-
Cartesian3_default.add(normal, north, corner);
|
|
869
|
-
Cartesian3_default.add(corner, east, corner);
|
|
870
|
-
corner = positions[5];
|
|
871
|
-
Cartesian3_default.add(normal, north, corner);
|
|
872
|
-
Cartesian3_default.add(corner, west, corner);
|
|
873
|
-
corner = positions[6];
|
|
874
|
-
Cartesian3_default.add(normal, south, corner);
|
|
875
|
-
Cartesian3_default.add(corner, west, corner);
|
|
876
|
-
corner = positions[7];
|
|
877
|
-
Cartesian3_default.add(normal, south, corner);
|
|
878
|
-
Cartesian3_default.add(corner, east, corner);
|
|
879
|
-
const length = positions.length;
|
|
880
|
-
for (let i = 0; i < length; ++i) {
|
|
881
|
-
const position = positions[i];
|
|
882
|
-
Cartesian3_default.add(center, position, position);
|
|
883
|
-
const cartographic = ellipsoid.cartesianToCartographic(
|
|
884
|
-
position,
|
|
885
|
-
projectTo2DCartographicScratch
|
|
886
|
-
);
|
|
887
|
-
projection.project(cartographic, position);
|
|
888
|
-
}
|
|
889
|
-
result = BoundingSphere.fromPoints(positions, result);
|
|
890
|
-
center = result.center;
|
|
891
|
-
const x = center.x;
|
|
892
|
-
const y = center.y;
|
|
893
|
-
const z = center.z;
|
|
894
|
-
center.x = z;
|
|
895
|
-
center.y = x;
|
|
896
|
-
center.z = y;
|
|
897
|
-
return result;
|
|
898
|
-
};
|
|
899
|
-
BoundingSphere.isOccluded = function(sphere, occluder) {
|
|
900
|
-
Check_default.typeOf.object("sphere", sphere);
|
|
901
|
-
Check_default.typeOf.object("occluder", occluder);
|
|
902
|
-
return !occluder.isBoundingSphereVisible(sphere);
|
|
903
|
-
};
|
|
904
|
-
BoundingSphere.equals = function(left, right) {
|
|
905
|
-
return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && left.radius === right.radius;
|
|
906
|
-
};
|
|
907
|
-
BoundingSphere.prototype.intersectPlane = function(plane) {
|
|
908
|
-
return BoundingSphere.intersectPlane(this, plane);
|
|
909
|
-
};
|
|
910
|
-
BoundingSphere.prototype.distanceSquaredTo = function(cartesian) {
|
|
911
|
-
return BoundingSphere.distanceSquaredTo(this, cartesian);
|
|
912
|
-
};
|
|
913
|
-
BoundingSphere.prototype.computePlaneDistances = function(position, direction, result) {
|
|
914
|
-
return BoundingSphere.computePlaneDistances(
|
|
915
|
-
this,
|
|
916
|
-
position,
|
|
917
|
-
direction,
|
|
918
|
-
result
|
|
919
|
-
);
|
|
920
|
-
};
|
|
921
|
-
BoundingSphere.prototype.isOccluded = function(occluder) {
|
|
922
|
-
return BoundingSphere.isOccluded(this, occluder);
|
|
923
|
-
};
|
|
924
|
-
BoundingSphere.prototype.equals = function(right) {
|
|
925
|
-
return BoundingSphere.equals(this, right);
|
|
926
|
-
};
|
|
927
|
-
BoundingSphere.prototype.clone = function(result) {
|
|
928
|
-
return BoundingSphere.clone(this, result);
|
|
929
|
-
};
|
|
930
|
-
BoundingSphere.prototype.volume = function() {
|
|
931
|
-
const radius = this.radius;
|
|
932
|
-
return volumeConstant * radius * radius * radius;
|
|
933
|
-
};
|
|
934
|
-
var BoundingSphere_default = BoundingSphere;
|
|
935
|
-
|
|
936
|
-
export {
|
|
937
|
-
GeographicProjection_default,
|
|
938
|
-
Interval_default,
|
|
939
|
-
BoundingSphere_default
|
|
940
|
-
};
|