@pggis/pg-sdk 3.3.10 → 4.3.3
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/README.md +8 -8
- package/dist/index.js +1966 -4
- package/dist/pggis.min.css +1 -1
- package/dist/pggis.min.js +10980 -7539
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
- package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
- package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
- package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
- package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
- package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
- package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
- package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
- package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
- package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
- package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
- package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
- package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
- package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
- package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
- package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
- package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
- package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
- package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
- package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
- package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
- package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
- package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
- package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
- package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
- package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
- package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
- package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
- package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
- package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
- package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
- package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
- package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
- package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
- package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
- package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
- package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
- package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
- package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
- package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
- package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
- package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
- package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
- package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
- package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
- package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
- package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
- package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
- package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
- package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
- package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
- package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
- package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
- package/dist/resources/Workers/combineGeometry.js +2 -44
- package/dist/resources/Workers/createBoxGeometry.js +2 -34
- package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createCircleGeometry.js +2 -173
- package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
- package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
- package/dist/resources/Workers/createCylinderGeometry.js +2 -36
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
- package/dist/resources/Workers/createEllipseGeometry.js +2 -47
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
- package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
- package/dist/resources/Workers/createFrustumGeometry.js +2 -34
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createGeometry.js +2 -147
- package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
- package/dist/resources/Workers/createPlaneGeometry.js +2 -200
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
- package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
- package/dist/resources/Workers/createPolylineGeometry.js +2 -472
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
- package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
- package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
- package/dist/resources/Workers/createSphereGeometry.js +2 -94
- package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
- package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
- package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
- package/dist/resources/Workers/createVectorTilePoints.js +2 -88
- package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
- package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
- package/dist/resources/Workers/createWallGeometry.js +2 -466
- package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
- package/dist/resources/Workers/decodeDraco.js +2 -345
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
- package/dist/resources/Workers/decodeI3S.js +2 -1320
- package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
- package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/resources/Workers/transcodeKTX2.js +29 -3398
- package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
- package/package.json +9 -8
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
- package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
- package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
- package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
- package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
- package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
- package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
- package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
- package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
- package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
- package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
- package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
- package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
- package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
- package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
- package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
- package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
- package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
- package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
- package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
- package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
- package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
- package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
- package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
- package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
- package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
- package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
- package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
- package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
- package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
- package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
- package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
- package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
- package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
- package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
- package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
- package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
- package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
- package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
- package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
- package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
- package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
- package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
- package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
- package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
- package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
- package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
- package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
- package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
- package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
- package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.115
|
|
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-F3YA3Y2Z.js";
|
|
29
|
-
import {
|
|
30
|
-
VertexFormat_default
|
|
31
|
-
} from "./chunk-2FWRMUTY.js";
|
|
32
|
-
import {
|
|
33
|
-
IndexDatatype_default
|
|
34
|
-
} from "./chunk-LPR3YNP2.js";
|
|
35
|
-
import {
|
|
36
|
-
GeometryAttributes_default
|
|
37
|
-
} from "./chunk-4H7PY4U5.js";
|
|
38
|
-
import {
|
|
39
|
-
GeometryAttribute_default,
|
|
40
|
-
Geometry_default,
|
|
41
|
-
PrimitiveType_default
|
|
42
|
-
} from "./chunk-7TC63SJW.js";
|
|
43
|
-
import {
|
|
44
|
-
BoundingSphere_default
|
|
45
|
-
} from "./chunk-FJKNFAKQ.js";
|
|
46
|
-
import {
|
|
47
|
-
ComponentDatatype_default
|
|
48
|
-
} from "./chunk-PPH7OFP3.js";
|
|
49
|
-
import {
|
|
50
|
-
Cartesian2_default,
|
|
51
|
-
Cartesian3_default,
|
|
52
|
-
Ellipsoid_default
|
|
53
|
-
} from "./chunk-OGXZVPPM.js";
|
|
54
|
-
import {
|
|
55
|
-
Math_default
|
|
56
|
-
} from "./chunk-5QULIR53.js";
|
|
57
|
-
import {
|
|
58
|
-
defaultValue_default
|
|
59
|
-
} from "./chunk-BBWDMCVU.js";
|
|
60
|
-
import {
|
|
61
|
-
DeveloperError_default
|
|
62
|
-
} from "./chunk-XGI5BXZY.js";
|
|
63
|
-
import {
|
|
64
|
-
defined_default
|
|
65
|
-
} from "./chunk-YWTJ2B4B.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
|
-
};
|