@cesium/engine 3.0.2 → 5.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/ThirdParty/Workers/pako_deflate.min.js +605 -0
- package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
- package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
- package/Build/Workers/chunk-2U6EBIRX.js +757 -0
- package/Build/Workers/chunk-2ZI7FZ3Q.js +58 -0
- package/Build/Workers/chunk-3TSHZWOZ.js +1860 -0
- package/Build/Workers/chunk-44B6FQSJ.js +684 -0
- package/Build/Workers/chunk-4AJR66C5.js +368 -0
- package/Build/Workers/chunk-4HN3N5SE.js +501 -0
- package/Build/Workers/chunk-4QGPYV3W.js +102 -0
- package/Build/Workers/chunk-4RKE4B3G.js +476 -0
- package/Build/Workers/chunk-5E3V7Y4R.js +196 -0
- package/Build/Workers/chunk-6EHT6GS3.js +163 -0
- package/Build/Workers/chunk-6I22NWKQ.js +171 -0
- package/Build/Workers/chunk-7N67FBLW.js +1054 -0
- package/Build/Workers/chunk-AQQGAFKX.js +124 -0
- package/Build/Workers/chunk-CROU4RHL.js +138 -0
- package/Build/Workers/chunk-CTJCECTX.js +258 -0
- package/Build/Workers/chunk-DWJZFZ67.js +781 -0
- package/Build/Workers/chunk-EHJQEARC.js +59 -0
- package/Build/Workers/chunk-EVLKHUAE.js +1477 -0
- package/Build/Workers/chunk-FOOYJER7.js +834 -0
- package/Build/Workers/chunk-GLCRFDOB.js +73 -0
- package/Build/Workers/chunk-GPO47TW4.js +39 -0
- package/Build/Workers/chunk-H5Q2JKIA.js +1075 -0
- package/Build/Workers/chunk-HIDSEUWS.js +2041 -0
- package/Build/Workers/chunk-HV67ARO7.js +302 -0
- package/Build/Workers/chunk-IC7G4BX2.js +421 -0
- package/Build/Workers/chunk-IQN2LMGD.js +55 -0
- package/Build/Workers/chunk-J2FHYK2Z.js +55 -0
- package/Build/Workers/chunk-K3VEWONC.js +289 -0
- package/Build/Workers/chunk-KZFXE35V.js +117 -0
- package/Build/Workers/chunk-MG2TXIO5.js +400 -0
- package/Build/Workers/chunk-MRCFDEKH.js +138 -0
- package/Build/Workers/chunk-MYDS6HBL.js +3273 -0
- package/Build/Workers/chunk-OCIX2CQ7.js +305 -0
- package/Build/Workers/chunk-P32XMW4I.js +2716 -0
- package/Build/Workers/chunk-PEVZYZBQ.js +157 -0
- package/Build/Workers/chunk-PMDLIBEQ.js +218 -0
- package/Build/Workers/chunk-QDUOGCCO.js +1009 -0
- package/Build/Workers/chunk-QUCJGBCK.js +430 -0
- package/Build/Workers/chunk-RCI7BSOM.js +452 -0
- package/Build/Workers/chunk-SVTSC7FX.js +390 -0
- package/Build/Workers/chunk-TXOGSFHZ.js +77 -0
- package/Build/Workers/chunk-TXYJOVQK.js +629 -0
- package/Build/Workers/chunk-UFIT5XDI.js +1258 -0
- package/Build/Workers/chunk-ULLMQNFQ.js +73 -0
- package/Build/Workers/chunk-UM7FIUQW.js +101 -0
- package/Build/Workers/{package.js → chunk-UMLTOPAE.js} +13 -2
- package/Build/Workers/chunk-V5S5N2IS.js +8644 -0
- package/Build/Workers/chunk-VN2IHJKM.js +513 -0
- package/Build/Workers/chunk-VWSD2XV5.js +669 -0
- package/Build/Workers/chunk-X2KIWBTW.js +100 -0
- package/Build/Workers/chunk-Y24CDOJC.js +353 -0
- package/Build/Workers/chunk-YLMDWSXO.js +44 -0
- package/Build/Workers/chunk-YNZ4DMR7.js +634 -0
- package/Build/Workers/chunk-Z2MP3UBE.js +236 -0
- package/Build/Workers/combineGeometry.js +65 -15
- package/Build/Workers/createBoxGeometry.js +55 -10
- package/Build/Workers/createBoxOutlineGeometry.js +231 -310
- package/Build/Workers/createCircleGeometry.js +185 -202
- package/Build/Workers/createCircleOutlineGeometry.js +141 -155
- package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
- package/Build/Workers/createCorridorGeometry.js +1163 -1307
- package/Build/Workers/createCorridorOutlineGeometry.js +534 -569
- package/Build/Workers/createCylinderGeometry.js +57 -10
- package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
- package/Build/Workers/createEllipseGeometry.js +68 -12
- package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
- package/Build/Workers/createEllipsoidGeometry.js +56 -10
- package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
- package/Build/Workers/createFrustumGeometry.js +55 -10
- package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
- package/Build/Workers/createGeometry.js +143 -48
- package/Build/Workers/createGroundPolylineGeometry.js +1484 -2012
- package/Build/Workers/createPlaneGeometry.js +216 -243
- package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
- package/Build/Workers/createPolygonGeometry.js +1437 -1314
- package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
- package/Build/Workers/createPolylineGeometry.js +471 -547
- package/Build/Workers/createPolylineVolumeGeometry.js +354 -384
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -295
- package/Build/Workers/createRectangleGeometry.js +1128 -1331
- package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
- package/Build/Workers/createSimplePolylineGeometry.js +381 -440
- package/Build/Workers/createSphereGeometry.js +112 -118
- package/Build/Workers/createSphereOutlineGeometry.js +112 -121
- package/Build/Workers/createTaskProcessorWorker.js +32 -127
- package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
- package/Build/Workers/createVectorTileGeometries.js +377 -436
- package/Build/Workers/createVectorTilePoints.js +110 -77
- package/Build/Workers/createVectorTilePolygons.js +369 -391
- package/Build/Workers/createVectorTilePolylines.js +252 -244
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
- package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
- package/Build/Workers/createWallGeometry.js +459 -593
- package/Build/Workers/createWallOutlineGeometry.js +324 -419
- package/Build/Workers/decodeDraco.js +327 -347
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
- package/Build/Workers/decodeI3S.js +765 -970
- package/Build/Workers/transcodeKTX2.js +3351 -1473
- package/Build/Workers/transferTypedArrayTest.js +3 -4
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
- package/LICENSE.md +0 -12
- package/Source/Core/CesiumTerrainProvider.js +1 -2
- package/Source/Core/Credit.js +7 -1
- package/Source/Core/FeatureDetection.js +9 -0
- package/Source/Core/GoogleMaps.js +1 -2
- package/Source/Core/Ion.js +1 -2
- package/Source/Core/KTX2Transcoder.js +7 -3
- package/Source/Core/PolygonGeometry.js +340 -27
- package/Source/Core/PolygonGeometryLibrary.js +302 -1
- package/Source/Core/Stereographic.js +247 -0
- package/Source/Core/TaskProcessor.js +185 -168
- package/Source/Core/Transforms.js +2 -2
- package/Source/Core/buildModuleUrl.js +6 -5
- package/Source/Core/sampleTerrain.js +43 -10
- package/Source/Core/sampleTerrainMostDetailed.js +27 -3
- package/Source/Scene/ArcGisMapService.js +1 -2
- package/Source/Scene/Billboard.js +7 -0
- package/Source/Scene/Cesium3DTilePass.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +38 -81
- package/Source/Scene/CreditDisplay.js +2 -2
- package/Source/Scene/DracoLoader.js +26 -3
- package/Source/Scene/I3SDataProvider.js +0 -27
- package/Source/Scene/I3SDecoder.js +127 -0
- package/Source/Scene/I3SNode.js +32 -110
- package/Source/Scene/Implicit3DTileContent.js +13 -0
- package/Source/Scene/ImplicitTileset.js +5 -0
- package/Source/Scene/LabelCollection.js +3 -1
- package/Source/Scene/Model/I3dmLoader.js +5 -1
- package/Source/Scene/Model/Model.js +20 -23
- package/Source/Scene/OpenStreetMapImageryProvider.js +4 -1
- package/Source/Scene/PostProcessStageLibrary.js +3 -3
- package/Source/Scene/PrimitiveCollection.js +39 -0
- package/Source/Scene/Scene.js +3 -0
- package/Source/Scene/SingleTileImageryProvider.js +4 -2
- package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
- package/Source/Widget/CesiumWidget.js +2 -1
- package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
- package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
- package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
- package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
- package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
- package/Source/Workers/transferTypedArrayTest.js +0 -6
- package/index.d.ts +69 -35
- package/index.js +189 -187
- package/package.json +2 -1
- package/Build/Workers/ArcType-2d9abbbc.js +0 -37
- package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
- package/Build/Workers/AxisAlignedBoundingBox-a03420b1.js +0 -258
- package/Build/Workers/BoundingRectangle-32fa8a4a.js +0 -369
- package/Build/Workers/BoxGeometry-cd550612.js +0 -884
- package/Build/Workers/Check-6ede7e26.js +0 -290
- package/Build/Workers/Color-571a6085.js +0 -2262
- package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
- package/Build/Workers/CoplanarPolygonGeometryLibrary-488b1a9f.js +0 -132
- package/Build/Workers/CorridorGeometryLibrary-fc4ff147.js +0 -498
- package/Build/Workers/CylinderGeometry-bc26926d.js +0 -467
- package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
- package/Build/Workers/EllipseGeometry-89533a10.js +0 -1304
- package/Build/Workers/EllipseGeometryLibrary-b0d7df17.js +0 -366
- package/Build/Workers/EllipseOutlineGeometry-63ff7a87.js +0 -443
- package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
- package/Build/Workers/EllipsoidGeometry-07e99d2d.js +0 -637
- package/Build/Workers/EllipsoidOutlineGeometry-ba5c7ee2.js +0 -454
- package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
- package/Build/Workers/EllipsoidTangentPlane-65d41b3e.js +0 -373
- package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
- package/Build/Workers/FrustumGeometry-4a7589ed.js +0 -2540
- package/Build/Workers/GeometryAttribute-a5b6275b.js +0 -619
- package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
- package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
- package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
- package/Build/Workers/GeometryPipeline-fa9e6ffc.js +0 -3690
- package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
- package/Build/Workers/IntersectionTests-feace3da.js +0 -1836
- package/Build/Workers/Math-0a2ac845.js +0 -1340
- package/Build/Workers/Matrix2-e1298525.js +0 -7086
- package/Build/Workers/Matrix3-41c58dde.js +0 -4283
- package/Build/Workers/OrientedBoundingBox-6b94d955.js +0 -1259
- package/Build/Workers/Plane-4c3d403b.js +0 -309
- package/Build/Workers/PolygonGeometryLibrary-4ffc457d.js +0 -1074
- package/Build/Workers/PolygonPipeline-d5e66350.js +0 -1344
- package/Build/Workers/PolylinePipeline-83410f0c.js +0 -573
- package/Build/Workers/PolylineVolumeGeometryLibrary-290e7aec.js +0 -781
- package/Build/Workers/PrimitivePipeline-6081d138.js +0 -966
- package/Build/Workers/RectangleGeometryLibrary-986710d8.js +0 -280
- package/Build/Workers/RuntimeError-ef395448.js +0 -68
- package/Build/Workers/TerrainEncoding-528e1d68.js +0 -1227
- package/Build/Workers/Transforms-b527bb09.js +0 -14714
- package/Build/Workers/VertexFormat-030f11ff.js +0 -312
- package/Build/Workers/WallGeometryLibrary-faf583f8.js +0 -211
- package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
- package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
- package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
- package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
- package/Build/Workers/combine-d9581036.js +0 -82
- package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
- package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
- package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
- package/Source/Workers/package.json +0 -1
- /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
- /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.110
|
|
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-UMLTOPAE.js";
|
|
29
|
+
import {
|
|
30
|
+
IndexDatatype_default
|
|
31
|
+
} from "./chunk-CROU4RHL.js";
|
|
32
|
+
import {
|
|
33
|
+
GeometryAttributes_default
|
|
34
|
+
} from "./chunk-YLMDWSXO.js";
|
|
35
|
+
import {
|
|
36
|
+
GeometryAttribute_default,
|
|
37
|
+
Geometry_default,
|
|
38
|
+
PrimitiveType_default
|
|
39
|
+
} from "./chunk-HV67ARO7.js";
|
|
40
|
+
import {
|
|
41
|
+
BoundingSphere_default
|
|
42
|
+
} from "./chunk-V5S5N2IS.js";
|
|
43
|
+
import {
|
|
44
|
+
ComponentDatatype_default
|
|
45
|
+
} from "./chunk-CTJCECTX.js";
|
|
46
|
+
import {
|
|
47
|
+
Cartesian3_default,
|
|
48
|
+
Ellipsoid_default
|
|
49
|
+
} from "./chunk-HIDSEUWS.js";
|
|
50
|
+
import {
|
|
51
|
+
Math_default
|
|
52
|
+
} from "./chunk-4HN3N5SE.js";
|
|
53
|
+
import {
|
|
54
|
+
defaultValue_default
|
|
55
|
+
} from "./chunk-GPO47TW4.js";
|
|
56
|
+
import {
|
|
57
|
+
DeveloperError_default
|
|
58
|
+
} from "./chunk-6EHT6GS3.js";
|
|
59
|
+
import {
|
|
60
|
+
defined_default
|
|
61
|
+
} from "./chunk-TXOGSFHZ.js";
|
|
62
|
+
|
|
63
|
+
// packages/engine/Source/Core/EllipsoidOutlineGeometry.js
|
|
64
|
+
var defaultRadii = new Cartesian3_default(1, 1, 1);
|
|
65
|
+
var cos = Math.cos;
|
|
66
|
+
var sin = Math.sin;
|
|
67
|
+
function EllipsoidOutlineGeometry(options) {
|
|
68
|
+
options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
|
|
69
|
+
const radii = defaultValue_default(options.radii, defaultRadii);
|
|
70
|
+
const innerRadii = defaultValue_default(options.innerRadii, radii);
|
|
71
|
+
const minimumClock = defaultValue_default(options.minimumClock, 0);
|
|
72
|
+
const maximumClock = defaultValue_default(options.maximumClock, Math_default.TWO_PI);
|
|
73
|
+
const minimumCone = defaultValue_default(options.minimumCone, 0);
|
|
74
|
+
const maximumCone = defaultValue_default(options.maximumCone, Math_default.PI);
|
|
75
|
+
const stackPartitions = Math.round(defaultValue_default(options.stackPartitions, 10));
|
|
76
|
+
const slicePartitions = Math.round(defaultValue_default(options.slicePartitions, 8));
|
|
77
|
+
const subdivisions = Math.round(defaultValue_default(options.subdivisions, 128));
|
|
78
|
+
if (stackPartitions < 1) {
|
|
79
|
+
throw new DeveloperError_default("options.stackPartitions cannot be less than 1");
|
|
80
|
+
}
|
|
81
|
+
if (slicePartitions < 0) {
|
|
82
|
+
throw new DeveloperError_default("options.slicePartitions cannot be less than 0");
|
|
83
|
+
}
|
|
84
|
+
if (subdivisions < 0) {
|
|
85
|
+
throw new DeveloperError_default(
|
|
86
|
+
"options.subdivisions must be greater than or equal to zero."
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
|
|
90
|
+
throw new DeveloperError_default(
|
|
91
|
+
"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
this._radii = Cartesian3_default.clone(radii);
|
|
95
|
+
this._innerRadii = Cartesian3_default.clone(innerRadii);
|
|
96
|
+
this._minimumClock = minimumClock;
|
|
97
|
+
this._maximumClock = maximumClock;
|
|
98
|
+
this._minimumCone = minimumCone;
|
|
99
|
+
this._maximumCone = maximumCone;
|
|
100
|
+
this._stackPartitions = stackPartitions;
|
|
101
|
+
this._slicePartitions = slicePartitions;
|
|
102
|
+
this._subdivisions = subdivisions;
|
|
103
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
104
|
+
this._workerName = "createEllipsoidOutlineGeometry";
|
|
105
|
+
}
|
|
106
|
+
EllipsoidOutlineGeometry.packedLength = 2 * Cartesian3_default.packedLength + 8;
|
|
107
|
+
EllipsoidOutlineGeometry.pack = function(value, array, startingIndex) {
|
|
108
|
+
if (!defined_default(value)) {
|
|
109
|
+
throw new DeveloperError_default("value is required");
|
|
110
|
+
}
|
|
111
|
+
if (!defined_default(array)) {
|
|
112
|
+
throw new DeveloperError_default("array is required");
|
|
113
|
+
}
|
|
114
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
115
|
+
Cartesian3_default.pack(value._radii, array, startingIndex);
|
|
116
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
117
|
+
Cartesian3_default.pack(value._innerRadii, array, startingIndex);
|
|
118
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
119
|
+
array[startingIndex++] = value._minimumClock;
|
|
120
|
+
array[startingIndex++] = value._maximumClock;
|
|
121
|
+
array[startingIndex++] = value._minimumCone;
|
|
122
|
+
array[startingIndex++] = value._maximumCone;
|
|
123
|
+
array[startingIndex++] = value._stackPartitions;
|
|
124
|
+
array[startingIndex++] = value._slicePartitions;
|
|
125
|
+
array[startingIndex++] = value._subdivisions;
|
|
126
|
+
array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
|
|
127
|
+
return array;
|
|
128
|
+
};
|
|
129
|
+
var scratchRadii = new Cartesian3_default();
|
|
130
|
+
var scratchInnerRadii = new Cartesian3_default();
|
|
131
|
+
var scratchOptions = {
|
|
132
|
+
radii: scratchRadii,
|
|
133
|
+
innerRadii: scratchInnerRadii,
|
|
134
|
+
minimumClock: void 0,
|
|
135
|
+
maximumClock: void 0,
|
|
136
|
+
minimumCone: void 0,
|
|
137
|
+
maximumCone: void 0,
|
|
138
|
+
stackPartitions: void 0,
|
|
139
|
+
slicePartitions: void 0,
|
|
140
|
+
subdivisions: void 0,
|
|
141
|
+
offsetAttribute: void 0
|
|
142
|
+
};
|
|
143
|
+
EllipsoidOutlineGeometry.unpack = function(array, startingIndex, result) {
|
|
144
|
+
if (!defined_default(array)) {
|
|
145
|
+
throw new DeveloperError_default("array is required");
|
|
146
|
+
}
|
|
147
|
+
startingIndex = defaultValue_default(startingIndex, 0);
|
|
148
|
+
const radii = Cartesian3_default.unpack(array, startingIndex, scratchRadii);
|
|
149
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
150
|
+
const innerRadii = Cartesian3_default.unpack(array, startingIndex, scratchInnerRadii);
|
|
151
|
+
startingIndex += Cartesian3_default.packedLength;
|
|
152
|
+
const minimumClock = array[startingIndex++];
|
|
153
|
+
const maximumClock = array[startingIndex++];
|
|
154
|
+
const minimumCone = array[startingIndex++];
|
|
155
|
+
const maximumCone = array[startingIndex++];
|
|
156
|
+
const stackPartitions = array[startingIndex++];
|
|
157
|
+
const slicePartitions = array[startingIndex++];
|
|
158
|
+
const subdivisions = array[startingIndex++];
|
|
159
|
+
const offsetAttribute = array[startingIndex];
|
|
160
|
+
if (!defined_default(result)) {
|
|
161
|
+
scratchOptions.minimumClock = minimumClock;
|
|
162
|
+
scratchOptions.maximumClock = maximumClock;
|
|
163
|
+
scratchOptions.minimumCone = minimumCone;
|
|
164
|
+
scratchOptions.maximumCone = maximumCone;
|
|
165
|
+
scratchOptions.stackPartitions = stackPartitions;
|
|
166
|
+
scratchOptions.slicePartitions = slicePartitions;
|
|
167
|
+
scratchOptions.subdivisions = subdivisions;
|
|
168
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
169
|
+
return new EllipsoidOutlineGeometry(scratchOptions);
|
|
170
|
+
}
|
|
171
|
+
result._radii = Cartesian3_default.clone(radii, result._radii);
|
|
172
|
+
result._innerRadii = Cartesian3_default.clone(innerRadii, result._innerRadii);
|
|
173
|
+
result._minimumClock = minimumClock;
|
|
174
|
+
result._maximumClock = maximumClock;
|
|
175
|
+
result._minimumCone = minimumCone;
|
|
176
|
+
result._maximumCone = maximumCone;
|
|
177
|
+
result._stackPartitions = stackPartitions;
|
|
178
|
+
result._slicePartitions = slicePartitions;
|
|
179
|
+
result._subdivisions = subdivisions;
|
|
180
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
181
|
+
return result;
|
|
182
|
+
};
|
|
183
|
+
EllipsoidOutlineGeometry.createGeometry = function(ellipsoidGeometry) {
|
|
184
|
+
const radii = ellipsoidGeometry._radii;
|
|
185
|
+
if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const innerRadii = ellipsoidGeometry._innerRadii;
|
|
189
|
+
if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const minimumClock = ellipsoidGeometry._minimumClock;
|
|
193
|
+
const maximumClock = ellipsoidGeometry._maximumClock;
|
|
194
|
+
const minimumCone = ellipsoidGeometry._minimumCone;
|
|
195
|
+
const maximumCone = ellipsoidGeometry._maximumCone;
|
|
196
|
+
const subdivisions = ellipsoidGeometry._subdivisions;
|
|
197
|
+
const ellipsoid = Ellipsoid_default.fromCartesian3(radii);
|
|
198
|
+
let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
|
|
199
|
+
let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
|
|
200
|
+
slicePartitions = Math.round(
|
|
201
|
+
slicePartitions * Math.abs(maximumClock - minimumClock) / Math_default.TWO_PI
|
|
202
|
+
);
|
|
203
|
+
stackPartitions = Math.round(
|
|
204
|
+
stackPartitions * Math.abs(maximumCone - minimumCone) / Math_default.PI
|
|
205
|
+
);
|
|
206
|
+
if (slicePartitions < 2) {
|
|
207
|
+
slicePartitions = 2;
|
|
208
|
+
}
|
|
209
|
+
if (stackPartitions < 2) {
|
|
210
|
+
stackPartitions = 2;
|
|
211
|
+
}
|
|
212
|
+
let extraIndices = 0;
|
|
213
|
+
let vertexMultiplier = 1;
|
|
214
|
+
const hasInnerSurface = innerRadii.x !== radii.x || innerRadii.y !== radii.y || innerRadii.z !== radii.z;
|
|
215
|
+
let isTopOpen = false;
|
|
216
|
+
let isBotOpen = false;
|
|
217
|
+
if (hasInnerSurface) {
|
|
218
|
+
vertexMultiplier = 2;
|
|
219
|
+
if (minimumCone > 0) {
|
|
220
|
+
isTopOpen = true;
|
|
221
|
+
extraIndices += slicePartitions;
|
|
222
|
+
}
|
|
223
|
+
if (maximumCone < Math.PI) {
|
|
224
|
+
isBotOpen = true;
|
|
225
|
+
extraIndices += slicePartitions;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const vertexCount = subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);
|
|
229
|
+
const positions = new Float64Array(vertexCount * 3);
|
|
230
|
+
const numIndices = 2 * (vertexCount + extraIndices - (slicePartitions + stackPartitions) * vertexMultiplier);
|
|
231
|
+
const indices = IndexDatatype_default.createTypedArray(vertexCount, numIndices);
|
|
232
|
+
let i;
|
|
233
|
+
let j;
|
|
234
|
+
let theta;
|
|
235
|
+
let phi;
|
|
236
|
+
let index = 0;
|
|
237
|
+
const sinPhi = new Array(stackPartitions);
|
|
238
|
+
const cosPhi = new Array(stackPartitions);
|
|
239
|
+
for (i = 0; i < stackPartitions; i++) {
|
|
240
|
+
phi = minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1);
|
|
241
|
+
sinPhi[i] = sin(phi);
|
|
242
|
+
cosPhi[i] = cos(phi);
|
|
243
|
+
}
|
|
244
|
+
const sinTheta = new Array(subdivisions);
|
|
245
|
+
const cosTheta = new Array(subdivisions);
|
|
246
|
+
for (i = 0; i < subdivisions; i++) {
|
|
247
|
+
theta = minimumClock + i * (maximumClock - minimumClock) / (subdivisions - 1);
|
|
248
|
+
sinTheta[i] = sin(theta);
|
|
249
|
+
cosTheta[i] = cos(theta);
|
|
250
|
+
}
|
|
251
|
+
for (i = 0; i < stackPartitions; i++) {
|
|
252
|
+
for (j = 0; j < subdivisions; j++) {
|
|
253
|
+
positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
|
|
254
|
+
positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
|
|
255
|
+
positions[index++] = radii.z * cosPhi[i];
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (hasInnerSurface) {
|
|
259
|
+
for (i = 0; i < stackPartitions; i++) {
|
|
260
|
+
for (j = 0; j < subdivisions; j++) {
|
|
261
|
+
positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
|
|
262
|
+
positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
|
|
263
|
+
positions[index++] = innerRadii.z * cosPhi[i];
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
sinPhi.length = subdivisions;
|
|
268
|
+
cosPhi.length = subdivisions;
|
|
269
|
+
for (i = 0; i < subdivisions; i++) {
|
|
270
|
+
phi = minimumCone + i * (maximumCone - minimumCone) / (subdivisions - 1);
|
|
271
|
+
sinPhi[i] = sin(phi);
|
|
272
|
+
cosPhi[i] = cos(phi);
|
|
273
|
+
}
|
|
274
|
+
sinTheta.length = slicePartitions;
|
|
275
|
+
cosTheta.length = slicePartitions;
|
|
276
|
+
for (i = 0; i < slicePartitions; i++) {
|
|
277
|
+
theta = minimumClock + i * (maximumClock - minimumClock) / (slicePartitions - 1);
|
|
278
|
+
sinTheta[i] = sin(theta);
|
|
279
|
+
cosTheta[i] = cos(theta);
|
|
280
|
+
}
|
|
281
|
+
for (i = 0; i < subdivisions; i++) {
|
|
282
|
+
for (j = 0; j < slicePartitions; j++) {
|
|
283
|
+
positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
|
|
284
|
+
positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
|
|
285
|
+
positions[index++] = radii.z * cosPhi[i];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (hasInnerSurface) {
|
|
289
|
+
for (i = 0; i < subdivisions; i++) {
|
|
290
|
+
for (j = 0; j < slicePartitions; j++) {
|
|
291
|
+
positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
|
|
292
|
+
positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
|
|
293
|
+
positions[index++] = innerRadii.z * cosPhi[i];
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
index = 0;
|
|
298
|
+
for (i = 0; i < stackPartitions * vertexMultiplier; i++) {
|
|
299
|
+
const topOffset = i * subdivisions;
|
|
300
|
+
for (j = 0; j < subdivisions - 1; j++) {
|
|
301
|
+
indices[index++] = topOffset + j;
|
|
302
|
+
indices[index++] = topOffset + j + 1;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
let offset = stackPartitions * subdivisions * vertexMultiplier;
|
|
306
|
+
for (i = 0; i < slicePartitions; i++) {
|
|
307
|
+
for (j = 0; j < subdivisions - 1; j++) {
|
|
308
|
+
indices[index++] = offset + i + j * slicePartitions;
|
|
309
|
+
indices[index++] = offset + i + (j + 1) * slicePartitions;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (hasInnerSurface) {
|
|
313
|
+
offset = stackPartitions * subdivisions * vertexMultiplier + slicePartitions * subdivisions;
|
|
314
|
+
for (i = 0; i < slicePartitions; i++) {
|
|
315
|
+
for (j = 0; j < subdivisions - 1; j++) {
|
|
316
|
+
indices[index++] = offset + i + j * slicePartitions;
|
|
317
|
+
indices[index++] = offset + i + (j + 1) * slicePartitions;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (hasInnerSurface) {
|
|
322
|
+
let outerOffset = stackPartitions * subdivisions * vertexMultiplier;
|
|
323
|
+
let innerOffset = outerOffset + subdivisions * slicePartitions;
|
|
324
|
+
if (isTopOpen) {
|
|
325
|
+
for (i = 0; i < slicePartitions; i++) {
|
|
326
|
+
indices[index++] = outerOffset + i;
|
|
327
|
+
indices[index++] = innerOffset + i;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if (isBotOpen) {
|
|
331
|
+
outerOffset += subdivisions * slicePartitions - slicePartitions;
|
|
332
|
+
innerOffset += subdivisions * slicePartitions - slicePartitions;
|
|
333
|
+
for (i = 0; i < slicePartitions; i++) {
|
|
334
|
+
indices[index++] = outerOffset + i;
|
|
335
|
+
indices[index++] = innerOffset + i;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const attributes = new GeometryAttributes_default({
|
|
340
|
+
position: new GeometryAttribute_default({
|
|
341
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
342
|
+
componentsPerAttribute: 3,
|
|
343
|
+
values: positions
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
if (defined_default(ellipsoidGeometry._offsetAttribute)) {
|
|
347
|
+
const length = positions.length;
|
|
348
|
+
const offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
349
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
350
|
+
attributes.applyOffset = new GeometryAttribute_default({
|
|
351
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
352
|
+
componentsPerAttribute: 1,
|
|
353
|
+
values: applyOffset
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
return new Geometry_default({
|
|
357
|
+
attributes,
|
|
358
|
+
indices,
|
|
359
|
+
primitiveType: PrimitiveType_default.LINES,
|
|
360
|
+
boundingSphere: BoundingSphere_default.fromEllipsoid(ellipsoid),
|
|
361
|
+
offsetAttribute: ellipsoidGeometry._offsetAttribute
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
var EllipsoidOutlineGeometry_default = EllipsoidOutlineGeometry;
|
|
365
|
+
|
|
366
|
+
export {
|
|
367
|
+
EllipsoidOutlineGeometry_default
|
|
368
|
+
};
|