@rtzh/engine 0.0.2 → 0.0.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.
Files changed (113) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/package.json +1 -1
  3. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  4. package/Build/Workers/chunk-245NZYCR.js +0 -124
  5. package/Build/Workers/chunk-25BA4527.js +0 -837
  6. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  7. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  8. package/Build/Workers/chunk-55IROWAX.js +0 -139
  9. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  10. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  11. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  12. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  13. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  14. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  15. package/Build/Workers/chunk-6XJO625E.js +0 -497
  16. package/Build/Workers/chunk-75UGCVME.js +0 -102
  17. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  18. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  19. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  20. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  21. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  22. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  23. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  24. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  25. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  26. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  27. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  28. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  29. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  30. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  31. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  32. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  33. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  34. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  35. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  36. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  37. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  38. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  39. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  40. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  41. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  42. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  43. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  44. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  45. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  46. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  47. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  48. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  49. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  50. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  51. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  52. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  53. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  54. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  55. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  56. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  57. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  58. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  59. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  60. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  61. package/Build/Workers/combineGeometry.js +0 -66
  62. package/Build/Workers/createBoxGeometry.js +0 -58
  63. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  64. package/Build/Workers/createCircleGeometry.js +0 -201
  65. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  66. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  67. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  68. package/Build/Workers/createCorridorGeometry.js +0 -1258
  69. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  70. package/Build/Workers/createCylinderGeometry.js +0 -60
  71. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  72. package/Build/Workers/createEllipseGeometry.js +0 -72
  73. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  74. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  75. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  76. package/Build/Workers/createFrustumGeometry.js +0 -58
  77. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  78. package/Build/Workers/createGeometry.js +0 -173
  79. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  80. package/Build/Workers/createPlaneGeometry.js +0 -223
  81. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  82. package/Build/Workers/createPolygonGeometry.js +0 -1404
  83. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  84. package/Build/Workers/createPolylineGeometry.js +0 -491
  85. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  86. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  87. package/Build/Workers/createRectangleGeometry.js +0 -1264
  88. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  89. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  90. package/Build/Workers/createSphereGeometry.js +0 -116
  91. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  92. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  93. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  94. package/Build/Workers/createVectorTileGeometries.js +0 -387
  95. package/Build/Workers/createVectorTilePoints.js +0 -114
  96. package/Build/Workers/createVectorTilePolygons.js +0 -386
  97. package/Build/Workers/createVectorTilePolylines.js +0 -262
  98. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  100. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  102. package/Build/Workers/createWallGeometry.js +0 -487
  103. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  104. package/Build/Workers/decodeDraco.js +0 -369
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  106. package/Build/Workers/decodeI3S.js +0 -1339
  107. package/Build/Workers/gaussianSplatSorter.js +0 -62
  108. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  109. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  110. package/Build/Workers/transcodeKTX2.js +0 -3463
  111. package/Build/Workers/transferTypedArrayTest.js +0 -41
  112. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  113. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,511 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
5
- *
6
- * Copyright 2011-2022 Cesium Contributors
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- *
20
- * Columbus View (Pat. Pend.)
21
- *
22
- * Portions licensed separately.
23
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
- */
25
-
26
- import {
27
- GeometryOffsetAttribute_default
28
- } from "./chunk-6H33B6OL.js";
29
- import {
30
- VertexFormat_default
31
- } from "./chunk-I76SRIKN.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-55IROWAX.js";
35
- import {
36
- GeometryAttributes_default
37
- } from "./chunk-BOV6T7FO.js";
38
- import {
39
- GeometryAttribute_default,
40
- Geometry_default,
41
- PrimitiveType_default
42
- } from "./chunk-XOVHLPKW.js";
43
- import {
44
- BoundingSphere_default
45
- } from "./chunk-OAOREOSO.js";
46
- import {
47
- ComponentDatatype_default
48
- } from "./chunk-AL22JVIA.js";
49
- import {
50
- Cartesian2_default,
51
- Ellipsoid_default
52
- } from "./chunk-YPGJSFOO.js";
53
- import {
54
- Cartesian3_default,
55
- Frozen_default
56
- } from "./chunk-QWV2DM66.js";
57
- import {
58
- Math_default
59
- } from "./chunk-6XJO625E.js";
60
- import {
61
- DeveloperError_default
62
- } from "./chunk-KH2OWUUA.js";
63
- import {
64
- defined_default
65
- } from "./chunk-AVSQILVI.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 = options ?? Frozen_default.EMPTY_OBJECT;
78
- const radii = options.radii ?? defaultRadii;
79
- const innerRadii = options.innerRadii ?? radii;
80
- const minimumClock = options.minimumClock ?? 0;
81
- const maximumClock = options.maximumClock ?? Math_default.TWO_PI;
82
- const minimumCone = options.minimumCone ?? 0;
83
- const maximumCone = options.maximumCone ?? Math_default.PI;
84
- const stackPartitions = Math.round(options.stackPartitions ?? 64);
85
- const slicePartitions = Math.round(options.slicePartitions ?? 64);
86
- const vertexFormat = 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 = 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] = 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 = 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
- };
@@ -1,57 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
5
- *
6
- * Copyright 2011-2022 Cesium Contributors
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- *
20
- * Columbus View (Pat. Pend.)
21
- *
22
- * Portions licensed separately.
23
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
- */
25
-
26
- import {
27
- Matrix4_default
28
- } from "./chunk-POY6ZE32.js";
29
- import {
30
- Frozen_default
31
- } from "./chunk-QWV2DM66.js";
32
- import {
33
- DeveloperError_default
34
- } from "./chunk-KH2OWUUA.js";
35
- import {
36
- defined_default
37
- } from "./chunk-AVSQILVI.js";
38
-
39
- // packages/engine/Source/Core/GeometryInstance.js
40
- function GeometryInstance(options) {
41
- options = options ?? Frozen_default.EMPTY_OBJECT;
42
- if (!defined_default(options.geometry)) {
43
- throw new DeveloperError_default("options.geometry is required.");
44
- }
45
- this.geometry = options.geometry;
46
- this.modelMatrix = Matrix4_default.clone(options.modelMatrix ?? Matrix4_default.IDENTITY);
47
- this.id = options.id;
48
- this.pickPrimitive = options.pickPrimitive;
49
- this.attributes = options.attributes ?? {};
50
- this.westHemisphereGeometry = void 0;
51
- this.eastHemisphereGeometry = void 0;
52
- }
53
- var GeometryInstance_default = GeometryInstance;
54
-
55
- export {
56
- GeometryInstance_default
57
- };
@@ -1,114 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 0.0.1
5
- *
6
- * Copyright 2011-2022 Cesium Contributors
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- *
20
- * Columbus View (Pat. Pend.)
21
- *
22
- * Portions licensed separately.
23
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
- */
25
-
26
- import {
27
- Cartographic_default,
28
- Ellipsoid_default
29
- } from "./chunk-YPGJSFOO.js";
30
- import {
31
- Cartesian3_default
32
- } from "./chunk-QWV2DM66.js";
33
- import {
34
- Math_default
35
- } from "./chunk-6XJO625E.js";
36
- import {
37
- DeveloperError_default
38
- } from "./chunk-KH2OWUUA.js";
39
- import {
40
- defined_default
41
- } from "./chunk-AVSQILVI.js";
42
-
43
- // packages/engine/Source/Core/WebMercatorProjection.js
44
- function WebMercatorProjection(ellipsoid) {
45
- this._ellipsoid = ellipsoid ?? Ellipsoid_default.WGS84;
46
- this._semimajorAxis = this._ellipsoid.maximumRadius;
47
- this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
48
- }
49
- Object.defineProperties(WebMercatorProjection.prototype, {
50
- /**
51
- * Gets the {@link Ellipsoid}.
52
- *
53
- * @memberof WebMercatorProjection.prototype
54
- *
55
- * @type {Ellipsoid}
56
- * @readonly
57
- */
58
- ellipsoid: {
59
- get: function() {
60
- return this._ellipsoid;
61
- }
62
- }
63
- });
64
- WebMercatorProjection.mercatorAngleToGeodeticLatitude = function(mercatorAngle) {
65
- return Math_default.PI_OVER_TWO - 2 * Math.atan(Math.exp(-mercatorAngle));
66
- };
67
- WebMercatorProjection.geodeticLatitudeToMercatorAngle = function(latitude) {
68
- if (latitude > WebMercatorProjection.MaximumLatitude) {
69
- latitude = WebMercatorProjection.MaximumLatitude;
70
- } else if (latitude < -WebMercatorProjection.MaximumLatitude) {
71
- latitude = -WebMercatorProjection.MaximumLatitude;
72
- }
73
- const sinLatitude = Math.sin(latitude);
74
- return 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));
75
- };
76
- WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI);
77
- WebMercatorProjection.prototype.project = function(cartographic, result) {
78
- const semimajorAxis = this._semimajorAxis;
79
- const x = cartographic.longitude * semimajorAxis;
80
- const y = WebMercatorProjection.geodeticLatitudeToMercatorAngle(
81
- cartographic.latitude
82
- ) * semimajorAxis;
83
- const z = cartographic.height;
84
- if (!defined_default(result)) {
85
- return new Cartesian3_default(x, y, z);
86
- }
87
- result.x = x;
88
- result.y = y;
89
- result.z = z;
90
- return result;
91
- };
92
- WebMercatorProjection.prototype.unproject = function(cartesian, result) {
93
- if (!defined_default(cartesian)) {
94
- throw new DeveloperError_default("cartesian is required");
95
- }
96
- const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
97
- const longitude = cartesian.x * oneOverEarthSemimajorAxis;
98
- const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(
99
- cartesian.y * oneOverEarthSemimajorAxis
100
- );
101
- const height = cartesian.z;
102
- if (!defined_default(result)) {
103
- return new Cartographic_default(longitude, latitude, height);
104
- }
105
- result.longitude = longitude;
106
- result.latitude = latitude;
107
- result.height = height;
108
- return result;
109
- };
110
- var WebMercatorProjection_default = WebMercatorProjection;
111
-
112
- export {
113
- WebMercatorProjection_default
114
- };