@cesium/engine 9.2.0 → 10.1.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-GOQEANLM.js → chunk-2GEAGYUY.js} +13 -13
- package/Build/Workers/{chunk-WOYQB5HM.js → chunk-2J3JKXCP.js} +5 -5
- package/Build/Workers/{chunk-IXYFH7DV.js → chunk-3WUV74WM.js} +2 -2
- package/Build/Workers/{chunk-WHDEZSAL.js → chunk-4MSUJ4I7.js} +8 -8
- package/Build/Workers/chunk-4RMIRG6T.js +1800 -0
- package/Build/Workers/{chunk-CVCVMOQA.js → chunk-4VFBBNQ3.js} +1 -1
- package/Build/Workers/{chunk-ZHJDE6JN.js → chunk-4YSNMHZ4.js} +6 -6
- package/Build/Workers/{chunk-YGNQJ4YI.js → chunk-5BLJ5ZM6.js} +5 -5
- package/Build/Workers/{chunk-4RG6WOXH.js → chunk-5KWHSZYL.js} +11 -11
- package/Build/Workers/{chunk-BBBTT36L.js → chunk-5O6JWQ4E.js} +14 -14
- package/Build/Workers/{chunk-GX2BWBN2.js → chunk-65MZOUNU.js} +14 -14
- package/Build/Workers/{chunk-K5F23SZO.js → chunk-6D66DPRV.js} +7 -7
- package/Build/Workers/{chunk-2TRB253J.js → chunk-6OFDHMHR.js} +7 -7
- package/Build/Workers/{chunk-U6MTSO6A.js → chunk-76BYYG7N.js} +424 -449
- package/Build/Workers/{chunk-3PV5HQ2R.js → chunk-A5CODJ4M.js} +6 -6
- package/Build/Workers/{chunk-IF2OX6R4.js → chunk-AA4GZKOT.js} +1 -1
- package/Build/Workers/{chunk-OYP23VAL.js → chunk-ACRTCBN5.js} +11 -11
- package/Build/Workers/chunk-B75IEX2S.js +390 -0
- package/Build/Workers/{chunk-EODIOQ35.js → chunk-BAVI3ZS2.js} +1 -1
- package/Build/Workers/{chunk-CFBGPZU6.js → chunk-BBDZYSZB.js} +10 -10
- package/Build/Workers/{chunk-LZFFO4KB.js → chunk-BGE4QVG7.js} +12 -12
- package/Build/Workers/chunk-BY3E4ONI.js +456 -0
- package/Build/Workers/{chunk-RDR4KVPA.js → chunk-C3Z23UUJ.js} +18 -18
- package/Build/Workers/{chunk-I6CW7ZE5.js → chunk-C45MU4GZ.js} +10 -8
- package/Build/Workers/chunk-CF7P7K7E.js +684 -0
- package/Build/Workers/{chunk-KTZK2UDR.js → chunk-D2U4RI64.js} +7 -7
- package/Build/Workers/{chunk-QZIWFSRM.js → chunk-D4K27X2M.js} +4 -4
- package/Build/Workers/{chunk-UYKG3UFK.js → chunk-DKVHRNFY.js} +5 -5
- package/Build/Workers/{chunk-5OK5JFDP.js → chunk-EB7PNZTK.js} +5 -5
- package/Build/Workers/{chunk-7PFZ4Z7C.js → chunk-ELI4BUOT.js} +11 -9
- package/Build/Workers/chunk-F3NDOSTZ.js +963 -0
- package/Build/Workers/{chunk-3VDHTBY5.js → chunk-FDCLACT5.js} +10 -10
- package/Build/Workers/{chunk-BNT2SNWU.js → chunk-FEVVHITK.js} +4 -4
- package/Build/Workers/{chunk-7HLZRYGD.js → chunk-FOZWUH4T.js} +7 -7
- package/Build/Workers/chunk-FQPSOOPH.js +258 -0
- package/Build/Workers/{chunk-A5CSB5ZE.js → chunk-G5V4GPZE.js} +9 -9
- package/Build/Workers/{chunk-TDIGL45B.js → chunk-GNHZH7HP.js} +1 -1
- package/Build/Workers/{chunk-26NE4LRW.js → chunk-GPJR7MPQ.js} +11 -8
- package/Build/Workers/chunk-GWT64LKY.js +171 -0
- package/Build/Workers/{chunk-PUQR43HZ.js → chunk-HGEEOMSC.js} +6 -6
- package/Build/Workers/{chunk-SC3TBKST.js → chunk-I2RC4XVN.js} +4 -4
- package/Build/Workers/chunk-IUROUBPA.js +300 -0
- package/Build/Workers/{chunk-G7IAO7CW.js → chunk-J7MQUQJY.js} +7 -7
- package/Build/Workers/chunk-JNLWLSTP.js +476 -0
- package/Build/Workers/{chunk-TP4FFUAH.js → chunk-JYQNWIQQ.js} +2 -2
- package/Build/Workers/{chunk-RRUO4QEK.js → chunk-KUN2ZA5X.js} +4 -4
- package/Build/Workers/chunk-KV4EQHK4.js +1477 -0
- package/Build/Workers/chunk-LSSWVB2X.js +138 -0
- package/Build/Workers/{chunk-EJZVBTX4.js → chunk-LXQ5QAEJ.js} +6 -6
- package/Build/Workers/chunk-MBZH7YZ7.js +945 -0
- package/Build/Workers/{chunk-WP3LCUOE.js → chunk-MKXWJTFQ.js} +13 -13
- package/Build/Workers/{chunk-AROLUUGS.js → chunk-MMV6TO3P.js} +2 -2
- package/Build/Workers/{chunk-ETC45PHH.js → chunk-MSKXMXJI.js} +4 -4
- package/Build/Workers/chunk-N4QEHO3U.js +75 -0
- package/Build/Workers/chunk-NVOABL76.js +100 -0
- package/Build/Workers/chunk-OAPA2RTG.js +239 -0
- package/Build/Workers/{chunk-PHT53MCH.js → chunk-OE4MCOC7.js} +13 -13
- package/Build/Workers/chunk-OJF4RTJG.js +634 -0
- package/Build/Workers/{chunk-UICVDDCQ.js → chunk-OOK53QUQ.js} +1 -1
- package/Build/Workers/{chunk-W4OS542B.js → chunk-OOMCT7OL.js} +13 -13
- package/Build/Workers/{chunk-YGTWKLFY.js → chunk-OWGTMVDB.js} +19 -19
- package/Build/Workers/{chunk-GUFV24F4.js → chunk-OXALEQPI.js} +61 -17
- package/Build/Workers/chunk-OXSI7N4C.js +768 -0
- package/Build/Workers/{chunk-26XJDV3D.js → chunk-PNFHVBSF.js} +15 -15
- package/Build/Workers/chunk-POSRARY7.js +834 -0
- package/Build/Workers/{chunk-GX5LMUGZ.js → chunk-PYHLO636.js} +42 -13
- package/Build/Workers/chunk-Q55ECN3Y.js +37 -0
- package/Build/Workers/chunk-QD4KM3GO.js +138 -0
- package/Build/Workers/chunk-QMLTCCYG.js +55 -0
- package/Build/Workers/chunk-QX5XS4LC.js +101 -0
- package/Build/Workers/{chunk-UKJCFXVV.js → chunk-QYQIVZBU.js} +6 -6
- package/Build/Workers/chunk-R3TKLC6E.js +1075 -0
- package/Build/Workers/chunk-R4OIEIPE.js +500 -0
- package/Build/Workers/chunk-R4ZEWO4I.js +122 -0
- package/Build/Workers/chunk-R6B7UCQB.js +44 -0
- package/Build/Workers/chunk-RCK55EDX.js +691 -0
- package/Build/Workers/chunk-RHBWXX7C.js +629 -0
- package/Build/Workers/chunk-RZLZWKFN.js +305 -0
- package/Build/Workers/{chunk-DIVFF6DK.js → chunk-S3PI2KFM.js} +2 -2
- package/Build/Workers/chunk-SAPFXU5X.js +102 -0
- package/Build/Workers/chunk-T6LPN7RI.js +2857 -0
- package/Build/Workers/{chunk-U2LSTOMA.js → chunk-T77JILCU.js} +2 -2
- package/Build/Workers/chunk-TBBFDFCS.js +368 -0
- package/Build/Workers/chunk-TF776XCO.js +1258 -0
- package/Build/Workers/chunk-TGY6H6N6.js +163 -0
- package/Build/Workers/{chunk-RTIT7UDN.js → chunk-TO2PVHKI.js} +2 -2
- package/Build/Workers/chunk-UCIPJSZX.js +398 -0
- package/Build/Workers/chunk-UOEUCKKU.js +59 -0
- package/Build/Workers/chunk-VE7BFUIX.js +39 -0
- package/Build/Workers/chunk-VFBNELXB.js +353 -0
- package/Build/Workers/chunk-VRZ46QZ5.js +781 -0
- package/Build/Workers/chunk-VYWUFRRR.js +1052 -0
- package/Build/Workers/chunk-WVSELU6O.js +2716 -0
- package/Build/Workers/chunk-X23FRWHJ.js +117 -0
- package/Build/Workers/chunk-X2ZQ7RJR.js +287 -0
- package/Build/Workers/chunk-X43SJLQL.js +10364 -0
- package/Build/Workers/chunk-XLTOBCDI.js +220 -0
- package/Build/Workers/chunk-XQI7XZHX.js +196 -0
- package/Build/Workers/chunk-XUOJCLOH.js +511 -0
- package/Build/Workers/chunk-XZZNKIEV.js +157 -0
- package/Build/Workers/chunk-YLYBLJ3Y.js +73 -0
- package/Build/Workers/chunk-ZEE2EIFD.js +430 -0
- package/Build/Workers/chunk-ZIKGV7EL.js +58 -0
- package/Build/Workers/chunk-ZU334IDQ.js +421 -0
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +29 -25
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +32 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +27 -27
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +24 -24
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createPolylineGeometry.js +24 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +30 -30
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +26 -26
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +19 -19
- package/Build/Workers/createSimplePolylineGeometry.js +22 -22
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +21 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +23 -23
- package/Build/Workers/createWallOutlineGeometry.js +22 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +8 -11
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/ApproximateTerrainHeights.js +4 -4
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +12 -8
- package/Source/Core/BoundingRectangle.js +2 -0
- package/Source/Core/BoundingSphere.js +4 -2
- package/Source/Core/Cartesian3.js +13 -10
- package/Source/Core/Cartographic.js +11 -8
- package/Source/Core/CesiumTerrainProvider.js +3 -2
- package/Source/Core/CircleGeometry.js +6 -2
- package/Source/Core/CircleOutlineGeometry.js +1 -1
- package/Source/Core/CoplanarPolygonGeometry.js +3 -3
- package/Source/Core/CorridorGeometry.js +4 -4
- package/Source/Core/CorridorOutlineGeometry.js +2 -2
- package/Source/Core/Credit.js +3 -2
- package/Source/Core/CustomHeightmapTerrainProvider.js +17 -3
- package/Source/Core/EllipseGeometry.js +4 -4
- package/Source/Core/EllipseOutlineGeometry.js +2 -2
- package/Source/Core/Ellipsoid.js +34 -0
- package/Source/Core/EllipsoidGeodesic.js +2 -2
- package/Source/Core/EllipsoidRhumbLine.js +4 -4
- package/Source/Core/EllipsoidTangentPlane.js +3 -3
- package/Source/Core/EllipsoidTerrainProvider.js +3 -3
- package/Source/Core/GeographicProjection.js +4 -3
- package/Source/Core/GeographicTilingScheme.js +3 -3
- package/Source/Core/GeometryPipeline.js +2 -2
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/GoogleMaps.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +1 -1
- package/Source/Core/HeightmapTessellator.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/Occluder.js +3 -3
- package/Source/Core/OrientedBoundingBox.js +2 -2
- package/Source/Core/PolygonGeometry.js +4 -4
- package/Source/Core/PolygonGeometryLibrary.js +1 -1
- package/Source/Core/PolygonOutlineGeometry.js +3 -3
- package/Source/Core/PolygonPipeline.js +2 -2
- package/Source/Core/PolylineGeometry.js +2 -2
- package/Source/Core/PolylinePipeline.js +6 -6
- package/Source/Core/PolylineVolumeGeometry.js +2 -2
- package/Source/Core/PolylineVolumeOutlineGeometry.js +2 -2
- package/Source/Core/Rectangle.js +6 -6
- package/Source/Core/RectangleGeometry.js +6 -6
- package/Source/Core/RectangleGeometryLibrary.js +3 -0
- package/Source/Core/RectangleOutlineGeometry.js +2 -2
- package/Source/Core/Simon1994PlanetaryPositions.js +4 -2
- package/Source/Core/SimplePolylineGeometry.js +2 -2
- package/Source/Core/Stereographic.js +2 -2
- package/Source/Core/Transforms.js +154 -19
- package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
- package/Source/Core/WallGeometry.js +3 -3
- package/Source/Core/WallOutlineGeometry.js +3 -3
- package/Source/Core/WebMercatorTilingScheme.js +3 -3
- package/Source/Core/createWorldTerrainAsync.js +2 -0
- package/Source/DataSources/BillboardGraphics.js +16 -0
- package/Source/DataSources/BillboardVisualizer.js +7 -0
- package/Source/DataSources/BoxGeometryUpdater.js +2 -2
- package/Source/DataSources/CylinderGeometryUpdater.js +2 -2
- package/Source/DataSources/CzmlDataSource.js +8 -8
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -3
- package/Source/DataSources/EntityCluster.js +1 -1
- package/Source/DataSources/EntityView.js +2 -2
- package/Source/DataSources/KmlDataSource.js +4 -4
- package/Source/DataSources/ModelVisualizer.js +1 -2
- package/Source/DataSources/PathVisualizer.js +4 -4
- package/Source/DataSources/PointGraphics.js +17 -0
- package/Source/DataSources/PointVisualizer.js +12 -0
- package/Source/DataSources/PolygonGeometryUpdater.js +1 -1
- package/Source/DataSources/PolylineGeometryUpdater.js +3 -2
- package/Source/DataSources/PositionProperty.js +4 -7
- package/Source/DataSources/RectangleGeometryUpdater.js +1 -1
- package/Source/DataSources/ScaledPositionProperty.js +2 -2
- package/Source/DataSources/TerrainOffsetProperty.js +3 -7
- package/Source/DataSources/VelocityOrientationProperty.js +2 -2
- package/Source/DataSources/exportKml.js +2 -2
- package/Source/Renderer/AutomaticUniforms.js +1 -1
- package/Source/Renderer/UniformState.js +6 -12
- package/Source/Scene/ArcGisMapServerImageryProvider.js +2 -2
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +35 -6
- package/Source/Scene/BillboardCollection.js +49 -0
- package/Source/Scene/BingMapsImageryProvider.js +11 -2
- package/Source/Scene/Camera.js +16 -10
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/ClippingPolygon.js +2 -2
- package/Source/Scene/ClippingPolygonCollection.js +1 -1
- package/Source/Scene/CreditDisplay.js +94 -104
- package/Source/Scene/Globe.js +16 -13
- package/Source/Scene/GltfLoaderUtil.js +2 -4
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -1
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
- package/Source/Scene/GridImageryProvider.js +2 -2
- package/Source/Scene/ImageBasedLighting.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/MapboxImageryProvider.js +1 -1
- package/Source/Scene/MapboxStyleImageryProvider.js +1 -1
- package/Source/Scene/MetadataSemantic.js +4 -4
- package/Source/Scene/Model/InstancingPipelineStage.js +3 -3
- package/Source/Scene/Model/MaterialPipelineStage.js +49 -0
- package/Source/Scene/Model/Model.js +8 -5
- package/Source/Scene/Model/ModelSceneGraph.js +1 -1
- package/Source/Scene/Model/SceneMode2DPipelineStage.js +3 -3
- package/Source/Scene/Model/pickModel.js +2 -2
- package/Source/Scene/ModelComponents.js +9 -0
- package/Source/Scene/OctahedralProjectedCubeMap.js +5 -6
- package/Source/Scene/Picking.js +4 -13
- package/Source/Scene/PointPrimitive.js +33 -4
- package/Source/Scene/PointPrimitiveCollection.js +22 -9
- package/Source/Scene/Scene.js +39 -31
- package/Source/Scene/SceneTransforms.js +78 -20
- package/Source/Scene/SceneTransitioner.js +2 -2
- package/Source/Scene/ScreenSpaceCameraController.js +29 -19
- package/Source/Scene/SkyBox.js +26 -0
- package/Source/Scene/Sun.js +1 -1
- package/Source/Shaders/BillboardCollectionFS.glsl +4 -0
- package/Source/Shaders/BillboardCollectionFS.js +4 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +3 -1
- package/Source/Shaders/BillboardCollectionVS.js +3 -1
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +30 -13
- package/Source/Shaders/BrdfLutGeneratorFS.js +30 -13
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -2
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/{ellipsoidWgs84TextureCoordinates.js → ellipsoidTextureCoordinates.js} +3 -3
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +40 -39
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +40 -39
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +1 -1
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +1 -1
- package/Source/Shaders/Builtin/Structs/materialInput.js +1 -1
- package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +2 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.js +2 -0
- package/Source/Shaders/EllipsoidFS.glsl +1 -1
- package/Source/Shaders/EllipsoidFS.js +1 -1
- package/Source/Shaders/GlobeFS.glsl +2 -2
- package/Source/Shaders/GlobeFS.js +2 -2
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +23 -23
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +23 -23
- package/Source/Shaders/Model/LightingStageFS.glsl +6 -5
- package/Source/Shaders/Model/LightingStageFS.js +6 -5
- package/Source/Shaders/Model/MaterialStageFS.glsl +31 -26
- package/Source/Shaders/Model/MaterialStageFS.js +31 -26
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +4 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +4 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +9 -7
- package/Source/Shaders/PointPrimitiveCollectionVS.js +9 -7
- package/Source/Widget/CesiumWidget.css +0 -5
- package/Source/Widget/CesiumWidget.js +29 -28
- package/index.d.ts +254 -117
- package/index.js +45 -45
- package/package.json +4 -4
- package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +0 -10
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.120
|
|
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
|
+
GeometryOffsetAttribute_default
|
|
28
|
+
} from "./chunk-GNHZH7HP.js";
|
|
29
|
+
import {
|
|
30
|
+
VertexFormat_default
|
|
31
|
+
} from "./chunk-LSSWVB2X.js";
|
|
32
|
+
import {
|
|
33
|
+
IndexDatatype_default
|
|
34
|
+
} from "./chunk-EB7PNZTK.js";
|
|
35
|
+
import {
|
|
36
|
+
GeometryAttributes_default
|
|
37
|
+
} from "./chunk-JYQNWIQQ.js";
|
|
38
|
+
import {
|
|
39
|
+
GeometryAttribute_default,
|
|
40
|
+
Geometry_default,
|
|
41
|
+
PrimitiveType_default
|
|
42
|
+
} from "./chunk-IUROUBPA.js";
|
|
43
|
+
import {
|
|
44
|
+
BoundingSphere_default
|
|
45
|
+
} from "./chunk-ELI4BUOT.js";
|
|
46
|
+
import {
|
|
47
|
+
ComponentDatatype_default
|
|
48
|
+
} from "./chunk-FQPSOOPH.js";
|
|
49
|
+
import {
|
|
50
|
+
Cartesian2_default,
|
|
51
|
+
Cartesian3_default,
|
|
52
|
+
Ellipsoid_default
|
|
53
|
+
} from "./chunk-T6LPN7RI.js";
|
|
54
|
+
import {
|
|
55
|
+
Math_default
|
|
56
|
+
} from "./chunk-R4OIEIPE.js";
|
|
57
|
+
import {
|
|
58
|
+
defaultValue_default
|
|
59
|
+
} from "./chunk-BAVI3ZS2.js";
|
|
60
|
+
import {
|
|
61
|
+
DeveloperError_default
|
|
62
|
+
} from "./chunk-TGY6H6N6.js";
|
|
63
|
+
import {
|
|
64
|
+
defined_default
|
|
65
|
+
} from "./chunk-N4QEHO3U.js";
|
|
66
|
+
|
|
67
|
+
// packages/engine/Source/Core/EllipsoidGeometry.js
|
|
68
|
+
var scratchPosition = new Cartesian3_default();
|
|
69
|
+
var scratchNormal = new Cartesian3_default();
|
|
70
|
+
var scratchTangent = new Cartesian3_default();
|
|
71
|
+
var scratchBitangent = new Cartesian3_default();
|
|
72
|
+
var scratchNormalST = new Cartesian3_default();
|
|
73
|
+
var defaultRadii = new Cartesian3_default(1, 1, 1);
|
|
74
|
+
var cos = Math.cos;
|
|
75
|
+
var sin = Math.sin;
|
|
76
|
+
function EllipsoidGeometry(options) {
|
|
77
|
+
options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
|
|
78
|
+
const radii = defaultValue_default(options.radii, defaultRadii);
|
|
79
|
+
const innerRadii = defaultValue_default(options.innerRadii, radii);
|
|
80
|
+
const minimumClock = defaultValue_default(options.minimumClock, 0);
|
|
81
|
+
const maximumClock = defaultValue_default(options.maximumClock, Math_default.TWO_PI);
|
|
82
|
+
const minimumCone = defaultValue_default(options.minimumCone, 0);
|
|
83
|
+
const maximumCone = defaultValue_default(options.maximumCone, Math_default.PI);
|
|
84
|
+
const stackPartitions = Math.round(defaultValue_default(options.stackPartitions, 64));
|
|
85
|
+
const slicePartitions = Math.round(defaultValue_default(options.slicePartitions, 64));
|
|
86
|
+
const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
|
|
87
|
+
if (slicePartitions < 3) {
|
|
88
|
+
throw new DeveloperError_default(
|
|
89
|
+
"options.slicePartitions cannot be less than three."
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
if (stackPartitions < 3) {
|
|
93
|
+
throw new DeveloperError_default(
|
|
94
|
+
"options.stackPartitions cannot be less than three."
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
this._radii = Cartesian3_default.clone(radii);
|
|
98
|
+
this._innerRadii = Cartesian3_default.clone(innerRadii);
|
|
99
|
+
this._minimumClock = minimumClock;
|
|
100
|
+
this._maximumClock = maximumClock;
|
|
101
|
+
this._minimumCone = minimumCone;
|
|
102
|
+
this._maximumCone = maximumCone;
|
|
103
|
+
this._stackPartitions = stackPartitions;
|
|
104
|
+
this._slicePartitions = slicePartitions;
|
|
105
|
+
this._vertexFormat = VertexFormat_default.clone(vertexFormat);
|
|
106
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
107
|
+
this._workerName = "createEllipsoidGeometry";
|
|
108
|
+
}
|
|
109
|
+
EllipsoidGeometry.packedLength = 2 * Cartesian3_default.packedLength + VertexFormat_default.packedLength + 7;
|
|
110
|
+
EllipsoidGeometry.pack = function(value, array, startingIndex) {
|
|
111
|
+
if (!defined_default(value)) {
|
|
112
|
+
throw new DeveloperError_default("value is required");
|
|
113
|
+
}
|
|
114
|
+
if (!defined_default(array)) {
|
|
115
|
+
throw new DeveloperError_default("array is required");
|
|
116
|
+
}
|
|
117
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
118
|
+
Cartesian3_default.pack(value._radii, array, startingIndex);
|
|
119
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
120
|
+
Cartesian3_default.pack(value._innerRadii, array, startingIndex);
|
|
121
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
122
|
+
VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
|
|
123
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
124
|
+
array[startingIndex++] = value._minimumClock;
|
|
125
|
+
array[startingIndex++] = value._maximumClock;
|
|
126
|
+
array[startingIndex++] = value._minimumCone;
|
|
127
|
+
array[startingIndex++] = value._maximumCone;
|
|
128
|
+
array[startingIndex++] = value._stackPartitions;
|
|
129
|
+
array[startingIndex++] = value._slicePartitions;
|
|
130
|
+
array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
|
|
131
|
+
return array;
|
|
132
|
+
};
|
|
133
|
+
var scratchRadii = new Cartesian3_default();
|
|
134
|
+
var scratchInnerRadii = new Cartesian3_default();
|
|
135
|
+
var scratchVertexFormat = new VertexFormat_default();
|
|
136
|
+
var scratchOptions = {
|
|
137
|
+
radii: scratchRadii,
|
|
138
|
+
innerRadii: scratchInnerRadii,
|
|
139
|
+
vertexFormat: scratchVertexFormat,
|
|
140
|
+
minimumClock: void 0,
|
|
141
|
+
maximumClock: void 0,
|
|
142
|
+
minimumCone: void 0,
|
|
143
|
+
maximumCone: void 0,
|
|
144
|
+
stackPartitions: void 0,
|
|
145
|
+
slicePartitions: void 0,
|
|
146
|
+
offsetAttribute: void 0
|
|
147
|
+
};
|
|
148
|
+
EllipsoidGeometry.unpack = function(array, startingIndex, result) {
|
|
149
|
+
if (!defined_default(array)) {
|
|
150
|
+
throw new DeveloperError_default("array is required");
|
|
151
|
+
}
|
|
152
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
153
|
+
const radii = Cartesian3_default.unpack(array, startingIndex, scratchRadii);
|
|
154
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
155
|
+
const innerRadii = Cartesian3_default.unpack(array, startingIndex, scratchInnerRadii);
|
|
156
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
157
|
+
const vertexFormat = VertexFormat_default.unpack(
|
|
158
|
+
array,
|
|
159
|
+
startingIndex,
|
|
160
|
+
scratchVertexFormat
|
|
161
|
+
);
|
|
162
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
163
|
+
const minimumClock = array[startingIndex++];
|
|
164
|
+
const maximumClock = array[startingIndex++];
|
|
165
|
+
const minimumCone = array[startingIndex++];
|
|
166
|
+
const maximumCone = array[startingIndex++];
|
|
167
|
+
const stackPartitions = array[startingIndex++];
|
|
168
|
+
const slicePartitions = array[startingIndex++];
|
|
169
|
+
const offsetAttribute = array[startingIndex];
|
|
170
|
+
if (!defined_default(result)) {
|
|
171
|
+
scratchOptions.minimumClock = minimumClock;
|
|
172
|
+
scratchOptions.maximumClock = maximumClock;
|
|
173
|
+
scratchOptions.minimumCone = minimumCone;
|
|
174
|
+
scratchOptions.maximumCone = maximumCone;
|
|
175
|
+
scratchOptions.stackPartitions = stackPartitions;
|
|
176
|
+
scratchOptions.slicePartitions = slicePartitions;
|
|
177
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
178
|
+
return new EllipsoidGeometry(scratchOptions);
|
|
179
|
+
}
|
|
180
|
+
result._radii = Cartesian3_default.clone(radii, result._radii);
|
|
181
|
+
result._innerRadii = Cartesian3_default.clone(innerRadii, result._innerRadii);
|
|
182
|
+
result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
|
|
183
|
+
result._minimumClock = minimumClock;
|
|
184
|
+
result._maximumClock = maximumClock;
|
|
185
|
+
result._minimumCone = minimumCone;
|
|
186
|
+
result._maximumCone = maximumCone;
|
|
187
|
+
result._stackPartitions = stackPartitions;
|
|
188
|
+
result._slicePartitions = slicePartitions;
|
|
189
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
190
|
+
return result;
|
|
191
|
+
};
|
|
192
|
+
EllipsoidGeometry.createGeometry = function(ellipsoidGeometry) {
|
|
193
|
+
const radii = ellipsoidGeometry._radii;
|
|
194
|
+
if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const innerRadii = ellipsoidGeometry._innerRadii;
|
|
198
|
+
if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const minimumClock = ellipsoidGeometry._minimumClock;
|
|
202
|
+
const maximumClock = ellipsoidGeometry._maximumClock;
|
|
203
|
+
const minimumCone = ellipsoidGeometry._minimumCone;
|
|
204
|
+
const maximumCone = ellipsoidGeometry._maximumCone;
|
|
205
|
+
const vertexFormat = ellipsoidGeometry._vertexFormat;
|
|
206
|
+
let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
|
|
207
|
+
let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
|
|
208
|
+
slicePartitions = Math.round(
|
|
209
|
+
slicePartitions * Math.abs(maximumClock - minimumClock) / Math_default.TWO_PI
|
|
210
|
+
);
|
|
211
|
+
stackPartitions = Math.round(
|
|
212
|
+
stackPartitions * Math.abs(maximumCone - minimumCone) / Math_default.PI
|
|
213
|
+
);
|
|
214
|
+
if (slicePartitions < 2) {
|
|
215
|
+
slicePartitions = 2;
|
|
216
|
+
}
|
|
217
|
+
if (stackPartitions < 2) {
|
|
218
|
+
stackPartitions = 2;
|
|
219
|
+
}
|
|
220
|
+
let i;
|
|
221
|
+
let j;
|
|
222
|
+
let index = 0;
|
|
223
|
+
const phis = [minimumCone];
|
|
224
|
+
const thetas = [minimumClock];
|
|
225
|
+
for (i = 0; i < stackPartitions; i++) {
|
|
226
|
+
phis.push(
|
|
227
|
+
minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1)
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
phis.push(maximumCone);
|
|
231
|
+
for (j = 0; j < slicePartitions; j++) {
|
|
232
|
+
thetas.push(
|
|
233
|
+
minimumClock + j * (maximumClock - minimumClock) / (slicePartitions - 1)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
thetas.push(maximumClock);
|
|
237
|
+
const numPhis = phis.length;
|
|
238
|
+
const numThetas = thetas.length;
|
|
239
|
+
let extraIndices = 0;
|
|
240
|
+
let vertexMultiplier = 1;
|
|
241
|
+
const hasInnerSurface = innerRadii.x !== radii.x || innerRadii.y !== radii.y || innerRadii.z !== radii.z;
|
|
242
|
+
let isTopOpen = false;
|
|
243
|
+
let isBotOpen = false;
|
|
244
|
+
let isClockOpen = false;
|
|
245
|
+
if (hasInnerSurface) {
|
|
246
|
+
vertexMultiplier = 2;
|
|
247
|
+
if (minimumCone > 0) {
|
|
248
|
+
isTopOpen = true;
|
|
249
|
+
extraIndices += slicePartitions - 1;
|
|
250
|
+
}
|
|
251
|
+
if (maximumCone < Math.PI) {
|
|
252
|
+
isBotOpen = true;
|
|
253
|
+
extraIndices += slicePartitions - 1;
|
|
254
|
+
}
|
|
255
|
+
if ((maximumClock - minimumClock) % Math_default.TWO_PI) {
|
|
256
|
+
isClockOpen = true;
|
|
257
|
+
extraIndices += (stackPartitions - 1) * 2 + 1;
|
|
258
|
+
} else {
|
|
259
|
+
extraIndices += 1;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const vertexCount = numThetas * numPhis * vertexMultiplier;
|
|
263
|
+
const positions = new Float64Array(vertexCount * 3);
|
|
264
|
+
const isInner = new Array(vertexCount).fill(false);
|
|
265
|
+
const negateNormal = new Array(vertexCount).fill(false);
|
|
266
|
+
const indexCount = slicePartitions * stackPartitions * vertexMultiplier;
|
|
267
|
+
const numIndices = 6 * (indexCount + extraIndices + 1 - (slicePartitions + stackPartitions) * vertexMultiplier);
|
|
268
|
+
const indices = IndexDatatype_default.createTypedArray(indexCount, numIndices);
|
|
269
|
+
const normals = vertexFormat.normal ? new Float32Array(vertexCount * 3) : void 0;
|
|
270
|
+
const tangents = vertexFormat.tangent ? new Float32Array(vertexCount * 3) : void 0;
|
|
271
|
+
const bitangents = vertexFormat.bitangent ? new Float32Array(vertexCount * 3) : void 0;
|
|
272
|
+
const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : void 0;
|
|
273
|
+
const sinPhi = new Array(numPhis);
|
|
274
|
+
const cosPhi = new Array(numPhis);
|
|
275
|
+
for (i = 0; i < numPhis; i++) {
|
|
276
|
+
sinPhi[i] = sin(phis[i]);
|
|
277
|
+
cosPhi[i] = cos(phis[i]);
|
|
278
|
+
}
|
|
279
|
+
const sinTheta = new Array(numThetas);
|
|
280
|
+
const cosTheta = new Array(numThetas);
|
|
281
|
+
for (j = 0; j < numThetas; j++) {
|
|
282
|
+
cosTheta[j] = cos(thetas[j]);
|
|
283
|
+
sinTheta[j] = sin(thetas[j]);
|
|
284
|
+
}
|
|
285
|
+
for (i = 0; i < numPhis; i++) {
|
|
286
|
+
for (j = 0; j < numThetas; j++) {
|
|
287
|
+
positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
|
|
288
|
+
positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
|
|
289
|
+
positions[index++] = radii.z * cosPhi[i];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
let vertexIndex = vertexCount / 2;
|
|
293
|
+
if (hasInnerSurface) {
|
|
294
|
+
for (i = 0; i < numPhis; i++) {
|
|
295
|
+
for (j = 0; j < numThetas; j++) {
|
|
296
|
+
positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
|
|
297
|
+
positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
|
|
298
|
+
positions[index++] = innerRadii.z * cosPhi[i];
|
|
299
|
+
isInner[vertexIndex] = true;
|
|
300
|
+
if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {
|
|
301
|
+
negateNormal[vertexIndex] = true;
|
|
302
|
+
}
|
|
303
|
+
vertexIndex++;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
index = 0;
|
|
308
|
+
let topOffset;
|
|
309
|
+
let bottomOffset;
|
|
310
|
+
for (i = 1; i < numPhis - 2; i++) {
|
|
311
|
+
topOffset = i * numThetas;
|
|
312
|
+
bottomOffset = (i + 1) * numThetas;
|
|
313
|
+
for (j = 1; j < numThetas - 2; j++) {
|
|
314
|
+
indices[index++] = bottomOffset + j;
|
|
315
|
+
indices[index++] = bottomOffset + j + 1;
|
|
316
|
+
indices[index++] = topOffset + j + 1;
|
|
317
|
+
indices[index++] = bottomOffset + j;
|
|
318
|
+
indices[index++] = topOffset + j + 1;
|
|
319
|
+
indices[index++] = topOffset + j;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (hasInnerSurface) {
|
|
323
|
+
const offset = numPhis * numThetas;
|
|
324
|
+
for (i = 1; i < numPhis - 2; i++) {
|
|
325
|
+
topOffset = offset + i * numThetas;
|
|
326
|
+
bottomOffset = offset + (i + 1) * numThetas;
|
|
327
|
+
for (j = 1; j < numThetas - 2; j++) {
|
|
328
|
+
indices[index++] = bottomOffset + j;
|
|
329
|
+
indices[index++] = topOffset + j;
|
|
330
|
+
indices[index++] = topOffset + j + 1;
|
|
331
|
+
indices[index++] = bottomOffset + j;
|
|
332
|
+
indices[index++] = topOffset + j + 1;
|
|
333
|
+
indices[index++] = bottomOffset + j + 1;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
let outerOffset;
|
|
338
|
+
let innerOffset;
|
|
339
|
+
if (hasInnerSurface) {
|
|
340
|
+
if (isTopOpen) {
|
|
341
|
+
innerOffset = numPhis * numThetas;
|
|
342
|
+
for (i = 1; i < numThetas - 2; i++) {
|
|
343
|
+
indices[index++] = i;
|
|
344
|
+
indices[index++] = i + 1;
|
|
345
|
+
indices[index++] = innerOffset + i + 1;
|
|
346
|
+
indices[index++] = i;
|
|
347
|
+
indices[index++] = innerOffset + i + 1;
|
|
348
|
+
indices[index++] = innerOffset + i;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (isBotOpen) {
|
|
352
|
+
outerOffset = numPhis * numThetas - numThetas;
|
|
353
|
+
innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;
|
|
354
|
+
for (i = 1; i < numThetas - 2; i++) {
|
|
355
|
+
indices[index++] = outerOffset + i + 1;
|
|
356
|
+
indices[index++] = outerOffset + i;
|
|
357
|
+
indices[index++] = innerOffset + i;
|
|
358
|
+
indices[index++] = outerOffset + i + 1;
|
|
359
|
+
indices[index++] = innerOffset + i;
|
|
360
|
+
indices[index++] = innerOffset + i + 1;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (isClockOpen) {
|
|
365
|
+
for (i = 1; i < numPhis - 2; i++) {
|
|
366
|
+
innerOffset = numThetas * numPhis + numThetas * i;
|
|
367
|
+
outerOffset = numThetas * i;
|
|
368
|
+
indices[index++] = innerOffset;
|
|
369
|
+
indices[index++] = outerOffset + numThetas;
|
|
370
|
+
indices[index++] = outerOffset;
|
|
371
|
+
indices[index++] = innerOffset;
|
|
372
|
+
indices[index++] = innerOffset + numThetas;
|
|
373
|
+
indices[index++] = outerOffset + numThetas;
|
|
374
|
+
}
|
|
375
|
+
for (i = 1; i < numPhis - 2; i++) {
|
|
376
|
+
innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;
|
|
377
|
+
outerOffset = numThetas * (i + 1) - 1;
|
|
378
|
+
indices[index++] = outerOffset + numThetas;
|
|
379
|
+
indices[index++] = innerOffset;
|
|
380
|
+
indices[index++] = outerOffset;
|
|
381
|
+
indices[index++] = outerOffset + numThetas;
|
|
382
|
+
indices[index++] = innerOffset + numThetas;
|
|
383
|
+
indices[index++] = innerOffset;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
const attributes = new GeometryAttributes_default();
|
|
387
|
+
if (vertexFormat.position) {
|
|
388
|
+
attributes.position = new GeometryAttribute_default({
|
|
389
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
390
|
+
componentsPerAttribute: 3,
|
|
391
|
+
values: positions
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
let stIndex = 0;
|
|
395
|
+
let normalIndex = 0;
|
|
396
|
+
let tangentIndex = 0;
|
|
397
|
+
let bitangentIndex = 0;
|
|
398
|
+
const vertexCountHalf = vertexCount / 2;
|
|
399
|
+
let ellipsoid;
|
|
400
|
+
const ellipsoidOuter = Ellipsoid_default.fromCartesian3(radii);
|
|
401
|
+
const ellipsoidInner = Ellipsoid_default.fromCartesian3(innerRadii);
|
|
402
|
+
if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
|
|
403
|
+
for (i = 0; i < vertexCount; i++) {
|
|
404
|
+
ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;
|
|
405
|
+
const position = Cartesian3_default.fromArray(positions, i * 3, scratchPosition);
|
|
406
|
+
const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
|
|
407
|
+
if (negateNormal[i]) {
|
|
408
|
+
Cartesian3_default.negate(normal, normal);
|
|
409
|
+
}
|
|
410
|
+
if (vertexFormat.st) {
|
|
411
|
+
const normalST = Cartesian2_default.negate(normal, scratchNormalST);
|
|
412
|
+
st[stIndex++] = Math.atan2(normalST.y, normalST.x) / Math_default.TWO_PI + 0.5;
|
|
413
|
+
st[stIndex++] = Math.asin(normal.z) / Math.PI + 0.5;
|
|
414
|
+
}
|
|
415
|
+
if (vertexFormat.normal) {
|
|
416
|
+
normals[normalIndex++] = normal.x;
|
|
417
|
+
normals[normalIndex++] = normal.y;
|
|
418
|
+
normals[normalIndex++] = normal.z;
|
|
419
|
+
}
|
|
420
|
+
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
|
421
|
+
const tangent = scratchTangent;
|
|
422
|
+
let tangetOffset = 0;
|
|
423
|
+
let unit;
|
|
424
|
+
if (isInner[i]) {
|
|
425
|
+
tangetOffset = vertexCountHalf;
|
|
426
|
+
}
|
|
427
|
+
if (!isTopOpen && i >= tangetOffset && i < tangetOffset + numThetas * 2) {
|
|
428
|
+
unit = Cartesian3_default.UNIT_X;
|
|
429
|
+
} else {
|
|
430
|
+
unit = Cartesian3_default.UNIT_Z;
|
|
431
|
+
}
|
|
432
|
+
Cartesian3_default.cross(unit, normal, tangent);
|
|
433
|
+
Cartesian3_default.normalize(tangent, tangent);
|
|
434
|
+
if (vertexFormat.tangent) {
|
|
435
|
+
tangents[tangentIndex++] = tangent.x;
|
|
436
|
+
tangents[tangentIndex++] = tangent.y;
|
|
437
|
+
tangents[tangentIndex++] = tangent.z;
|
|
438
|
+
}
|
|
439
|
+
if (vertexFormat.bitangent) {
|
|
440
|
+
const bitangent = Cartesian3_default.cross(normal, tangent, scratchBitangent);
|
|
441
|
+
Cartesian3_default.normalize(bitangent, bitangent);
|
|
442
|
+
bitangents[bitangentIndex++] = bitangent.x;
|
|
443
|
+
bitangents[bitangentIndex++] = bitangent.y;
|
|
444
|
+
bitangents[bitangentIndex++] = bitangent.z;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (vertexFormat.st) {
|
|
449
|
+
attributes.st = new GeometryAttribute_default({
|
|
450
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
451
|
+
componentsPerAttribute: 2,
|
|
452
|
+
values: st
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
if (vertexFormat.normal) {
|
|
456
|
+
attributes.normal = new GeometryAttribute_default({
|
|
457
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
458
|
+
componentsPerAttribute: 3,
|
|
459
|
+
values: normals
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
if (vertexFormat.tangent) {
|
|
463
|
+
attributes.tangent = new GeometryAttribute_default({
|
|
464
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
465
|
+
componentsPerAttribute: 3,
|
|
466
|
+
values: tangents
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
if (vertexFormat.bitangent) {
|
|
470
|
+
attributes.bitangent = new GeometryAttribute_default({
|
|
471
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
472
|
+
componentsPerAttribute: 3,
|
|
473
|
+
values: bitangents
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (defined_default(ellipsoidGeometry._offsetAttribute)) {
|
|
478
|
+
const length = positions.length;
|
|
479
|
+
const offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
480
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
481
|
+
attributes.applyOffset = new GeometryAttribute_default({
|
|
482
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
483
|
+
componentsPerAttribute: 1,
|
|
484
|
+
values: applyOffset
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
return new Geometry_default({
|
|
488
|
+
attributes,
|
|
489
|
+
indices,
|
|
490
|
+
primitiveType: PrimitiveType_default.TRIANGLES,
|
|
491
|
+
boundingSphere: BoundingSphere_default.fromEllipsoid(ellipsoidOuter),
|
|
492
|
+
offsetAttribute: ellipsoidGeometry._offsetAttribute
|
|
493
|
+
});
|
|
494
|
+
};
|
|
495
|
+
var unitEllipsoidGeometry;
|
|
496
|
+
EllipsoidGeometry.getUnitEllipsoid = function() {
|
|
497
|
+
if (!defined_default(unitEllipsoidGeometry)) {
|
|
498
|
+
unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(
|
|
499
|
+
new EllipsoidGeometry({
|
|
500
|
+
radii: new Cartesian3_default(1, 1, 1),
|
|
501
|
+
vertexFormat: VertexFormat_default.POSITION_ONLY
|
|
502
|
+
})
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
return unitEllipsoidGeometry;
|
|
506
|
+
};
|
|
507
|
+
var EllipsoidGeometry_default = EllipsoidGeometry;
|
|
508
|
+
|
|
509
|
+
export {
|
|
510
|
+
EllipsoidGeometry_default
|
|
511
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.120
|
|
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-ELI4BUOT.js";
|
|
29
|
+
import {
|
|
30
|
+
Cartesian3_default
|
|
31
|
+
} from "./chunk-T6LPN7RI.js";
|
|
32
|
+
import {
|
|
33
|
+
defaultValue_default
|
|
34
|
+
} from "./chunk-BAVI3ZS2.js";
|
|
35
|
+
import {
|
|
36
|
+
Check_default
|
|
37
|
+
} from "./chunk-TGY6H6N6.js";
|
|
38
|
+
import {
|
|
39
|
+
defined_default
|
|
40
|
+
} from "./chunk-N4QEHO3U.js";
|
|
41
|
+
|
|
42
|
+
// packages/engine/Source/Core/AxisAlignedBoundingBox.js
|
|
43
|
+
function AxisAlignedBoundingBox(minimum, maximum, center) {
|
|
44
|
+
this.minimum = Cartesian3_default.clone(defaultValue_default(minimum, Cartesian3_default.ZERO));
|
|
45
|
+
this.maximum = Cartesian3_default.clone(defaultValue_default(maximum, Cartesian3_default.ZERO));
|
|
46
|
+
if (!defined_default(center)) {
|
|
47
|
+
center = Cartesian3_default.midpoint(this.minimum, this.maximum, new Cartesian3_default());
|
|
48
|
+
} else {
|
|
49
|
+
center = Cartesian3_default.clone(center);
|
|
50
|
+
}
|
|
51
|
+
this.center = center;
|
|
52
|
+
}
|
|
53
|
+
AxisAlignedBoundingBox.fromCorners = function(minimum, maximum, result) {
|
|
54
|
+
Check_default.defined("minimum", minimum);
|
|
55
|
+
Check_default.defined("maximum", maximum);
|
|
56
|
+
if (!defined_default(result)) {
|
|
57
|
+
result = new AxisAlignedBoundingBox();
|
|
58
|
+
}
|
|
59
|
+
result.minimum = Cartesian3_default.clone(minimum, result.minimum);
|
|
60
|
+
result.maximum = Cartesian3_default.clone(maximum, result.maximum);
|
|
61
|
+
result.center = Cartesian3_default.midpoint(minimum, maximum, result.center);
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
AxisAlignedBoundingBox.fromPoints = function(positions, result) {
|
|
65
|
+
if (!defined_default(result)) {
|
|
66
|
+
result = new AxisAlignedBoundingBox();
|
|
67
|
+
}
|
|
68
|
+
if (!defined_default(positions) || positions.length === 0) {
|
|
69
|
+
result.minimum = Cartesian3_default.clone(Cartesian3_default.ZERO, result.minimum);
|
|
70
|
+
result.maximum = Cartesian3_default.clone(Cartesian3_default.ZERO, result.maximum);
|
|
71
|
+
result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
let minimumX = positions[0].x;
|
|
75
|
+
let minimumY = positions[0].y;
|
|
76
|
+
let minimumZ = positions[0].z;
|
|
77
|
+
let maximumX = positions[0].x;
|
|
78
|
+
let maximumY = positions[0].y;
|
|
79
|
+
let maximumZ = positions[0].z;
|
|
80
|
+
const length = positions.length;
|
|
81
|
+
for (let i = 1; i < length; i++) {
|
|
82
|
+
const p = positions[i];
|
|
83
|
+
const x = p.x;
|
|
84
|
+
const y = p.y;
|
|
85
|
+
const z = p.z;
|
|
86
|
+
minimumX = Math.min(x, minimumX);
|
|
87
|
+
maximumX = Math.max(x, maximumX);
|
|
88
|
+
minimumY = Math.min(y, minimumY);
|
|
89
|
+
maximumY = Math.max(y, maximumY);
|
|
90
|
+
minimumZ = Math.min(z, minimumZ);
|
|
91
|
+
maximumZ = Math.max(z, maximumZ);
|
|
92
|
+
}
|
|
93
|
+
const minimum = result.minimum;
|
|
94
|
+
minimum.x = minimumX;
|
|
95
|
+
minimum.y = minimumY;
|
|
96
|
+
minimum.z = minimumZ;
|
|
97
|
+
const maximum = result.maximum;
|
|
98
|
+
maximum.x = maximumX;
|
|
99
|
+
maximum.y = maximumY;
|
|
100
|
+
maximum.z = maximumZ;
|
|
101
|
+
result.center = Cartesian3_default.midpoint(minimum, maximum, result.center);
|
|
102
|
+
return result;
|
|
103
|
+
};
|
|
104
|
+
AxisAlignedBoundingBox.clone = function(box, result) {
|
|
105
|
+
if (!defined_default(box)) {
|
|
106
|
+
return void 0;
|
|
107
|
+
}
|
|
108
|
+
if (!defined_default(result)) {
|
|
109
|
+
return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);
|
|
110
|
+
}
|
|
111
|
+
result.minimum = Cartesian3_default.clone(box.minimum, result.minimum);
|
|
112
|
+
result.maximum = Cartesian3_default.clone(box.maximum, result.maximum);
|
|
113
|
+
result.center = Cartesian3_default.clone(box.center, result.center);
|
|
114
|
+
return result;
|
|
115
|
+
};
|
|
116
|
+
AxisAlignedBoundingBox.equals = function(left, right) {
|
|
117
|
+
return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && Cartesian3_default.equals(left.minimum, right.minimum) && Cartesian3_default.equals(left.maximum, right.maximum);
|
|
118
|
+
};
|
|
119
|
+
var intersectScratch = new Cartesian3_default();
|
|
120
|
+
AxisAlignedBoundingBox.intersectPlane = function(box, plane) {
|
|
121
|
+
Check_default.defined("box", box);
|
|
122
|
+
Check_default.defined("plane", plane);
|
|
123
|
+
intersectScratch = Cartesian3_default.subtract(
|
|
124
|
+
box.maximum,
|
|
125
|
+
box.minimum,
|
|
126
|
+
intersectScratch
|
|
127
|
+
);
|
|
128
|
+
const h = Cartesian3_default.multiplyByScalar(
|
|
129
|
+
intersectScratch,
|
|
130
|
+
0.5,
|
|
131
|
+
intersectScratch
|
|
132
|
+
);
|
|
133
|
+
const normal = plane.normal;
|
|
134
|
+
const e = h.x * Math.abs(normal.x) + h.y * Math.abs(normal.y) + h.z * Math.abs(normal.z);
|
|
135
|
+
const s = Cartesian3_default.dot(box.center, normal) + plane.distance;
|
|
136
|
+
if (s - e > 0) {
|
|
137
|
+
return Intersect_default.INSIDE;
|
|
138
|
+
}
|
|
139
|
+
if (s + e < 0) {
|
|
140
|
+
return Intersect_default.OUTSIDE;
|
|
141
|
+
}
|
|
142
|
+
return Intersect_default.INTERSECTING;
|
|
143
|
+
};
|
|
144
|
+
AxisAlignedBoundingBox.prototype.clone = function(result) {
|
|
145
|
+
return AxisAlignedBoundingBox.clone(this, result);
|
|
146
|
+
};
|
|
147
|
+
AxisAlignedBoundingBox.prototype.intersectPlane = function(plane) {
|
|
148
|
+
return AxisAlignedBoundingBox.intersectPlane(this, plane);
|
|
149
|
+
};
|
|
150
|
+
AxisAlignedBoundingBox.prototype.equals = function(right) {
|
|
151
|
+
return AxisAlignedBoundingBox.equals(this, right);
|
|
152
|
+
};
|
|
153
|
+
var AxisAlignedBoundingBox_default = AxisAlignedBoundingBox;
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
AxisAlignedBoundingBox_default
|
|
157
|
+
};
|