@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,563 +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
- CorridorGeometryLibrary_default
28
- } from "./chunk-TO7TWUET.js";
29
- import {
30
- CornerType_default
31
- } from "./chunk-KFMCOG26.js";
32
- import "./chunk-Q2DXNFYW.js";
33
- import "./chunk-AIW5F22O.js";
34
- import {
35
- GeometryOffsetAttribute_default
36
- } from "./chunk-6H33B6OL.js";
37
- import "./chunk-WAS3IHIQ.js";
38
- import "./chunk-K4IMD7KH.js";
39
- import {
40
- PolygonPipeline_default
41
- } from "./chunk-WO5ZNC7S.js";
42
- import {
43
- arrayRemoveDuplicates_default
44
- } from "./chunk-HAY6YE7M.js";
45
- import "./chunk-FVYRV2T6.js";
46
- import "./chunk-66YGZWBI.js";
47
- import "./chunk-J4MIJCN5.js";
48
- import {
49
- IndexDatatype_default
50
- } from "./chunk-55IROWAX.js";
51
- import {
52
- GeometryAttributes_default
53
- } from "./chunk-BOV6T7FO.js";
54
- import {
55
- GeometryAttribute_default,
56
- Geometry_default,
57
- PrimitiveType_default
58
- } from "./chunk-XOVHLPKW.js";
59
- import {
60
- BoundingSphere_default
61
- } from "./chunk-OAOREOSO.js";
62
- import "./chunk-EKMWNF4U.js";
63
- import "./chunk-KQIZ7AFF.js";
64
- import "./chunk-POY6ZE32.js";
65
- import {
66
- ComponentDatatype_default
67
- } from "./chunk-AL22JVIA.js";
68
- import "./chunk-5VZISKJF.js";
69
- import "./chunk-UYT2PBMV.js";
70
- import {
71
- Ellipsoid_default
72
- } from "./chunk-YPGJSFOO.js";
73
- import {
74
- Cartesian3_default,
75
- Frozen_default
76
- } from "./chunk-QWV2DM66.js";
77
- import {
78
- Math_default
79
- } from "./chunk-6XJO625E.js";
80
- import {
81
- Check_default
82
- } from "./chunk-KH2OWUUA.js";
83
- import {
84
- defined_default
85
- } from "./chunk-AVSQILVI.js";
86
-
87
- // packages/engine/Source/Core/CorridorOutlineGeometry.js
88
- var cartesian1 = new Cartesian3_default();
89
- var cartesian2 = new Cartesian3_default();
90
- var cartesian3 = new Cartesian3_default();
91
- function scaleToSurface(positions, ellipsoid) {
92
- for (let i = 0; i < positions.length; i++) {
93
- positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
94
- }
95
- return positions;
96
- }
97
- function combine(computedPositions, cornerType) {
98
- const wallIndices = [];
99
- const positions = computedPositions.positions;
100
- const corners = computedPositions.corners;
101
- const endPositions = computedPositions.endPositions;
102
- const attributes = new GeometryAttributes_default();
103
- let corner;
104
- let leftCount = 0;
105
- let rightCount = 0;
106
- let i;
107
- let indicesLength = 0;
108
- let length;
109
- for (i = 0; i < positions.length; i += 2) {
110
- length = positions[i].length - 3;
111
- leftCount += length;
112
- indicesLength += length / 3 * 4;
113
- rightCount += positions[i + 1].length - 3;
114
- }
115
- leftCount += 3;
116
- rightCount += 3;
117
- for (i = 0; i < corners.length; i++) {
118
- corner = corners[i];
119
- const leftSide = corners[i].leftPositions;
120
- if (defined_default(leftSide)) {
121
- length = leftSide.length;
122
- leftCount += length;
123
- indicesLength += length / 3 * 2;
124
- } else {
125
- length = corners[i].rightPositions.length;
126
- rightCount += length;
127
- indicesLength += length / 3 * 2;
128
- }
129
- }
130
- const addEndPositions = defined_default(endPositions);
131
- let endPositionLength;
132
- if (addEndPositions) {
133
- endPositionLength = endPositions[0].length - 3;
134
- leftCount += endPositionLength;
135
- rightCount += endPositionLength;
136
- endPositionLength /= 3;
137
- indicesLength += endPositionLength * 4;
138
- }
139
- const size = leftCount + rightCount;
140
- const finalPositions = new Float64Array(size);
141
- let front = 0;
142
- let back = size - 1;
143
- let UL, LL, UR, LR;
144
- let rightPos, leftPos;
145
- const halfLength = endPositionLength / 2;
146
- const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength + 4);
147
- let index = 0;
148
- indices[index++] = front / 3;
149
- indices[index++] = (back - 2) / 3;
150
- if (addEndPositions) {
151
- wallIndices.push(front / 3);
152
- leftPos = cartesian1;
153
- rightPos = cartesian2;
154
- const firstEndPositions = endPositions[0];
155
- for (i = 0; i < halfLength; i++) {
156
- leftPos = Cartesian3_default.fromArray(
157
- firstEndPositions,
158
- (halfLength - 1 - i) * 3,
159
- leftPos
160
- );
161
- rightPos = Cartesian3_default.fromArray(
162
- firstEndPositions,
163
- (halfLength + i) * 3,
164
- rightPos
165
- );
166
- CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
167
- CorridorGeometryLibrary_default.addAttribute(
168
- finalPositions,
169
- leftPos,
170
- void 0,
171
- back
172
- );
173
- LL = front / 3;
174
- LR = LL + 1;
175
- UL = (back - 2) / 3;
176
- UR = UL - 1;
177
- indices[index++] = UL;
178
- indices[index++] = UR;
179
- indices[index++] = LL;
180
- indices[index++] = LR;
181
- front += 3;
182
- back -= 3;
183
- }
184
- }
185
- let posIndex = 0;
186
- let rightEdge = positions[posIndex++];
187
- let leftEdge = positions[posIndex++];
188
- finalPositions.set(rightEdge, front);
189
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
190
- length = leftEdge.length - 3;
191
- wallIndices.push(front / 3, (back - 2) / 3);
192
- for (i = 0; i < length; i += 3) {
193
- LL = front / 3;
194
- LR = LL + 1;
195
- UL = (back - 2) / 3;
196
- UR = UL - 1;
197
- indices[index++] = UL;
198
- indices[index++] = UR;
199
- indices[index++] = LL;
200
- indices[index++] = LR;
201
- front += 3;
202
- back -= 3;
203
- }
204
- for (i = 0; i < corners.length; i++) {
205
- let j;
206
- corner = corners[i];
207
- const l = corner.leftPositions;
208
- const r = corner.rightPositions;
209
- let start;
210
- let outsidePoint = cartesian3;
211
- if (defined_default(l)) {
212
- back -= 3;
213
- start = UR;
214
- wallIndices.push(LR);
215
- for (j = 0; j < l.length / 3; j++) {
216
- outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
217
- indices[index++] = start - j - 1;
218
- indices[index++] = start - j;
219
- CorridorGeometryLibrary_default.addAttribute(
220
- finalPositions,
221
- outsidePoint,
222
- void 0,
223
- back
224
- );
225
- back -= 3;
226
- }
227
- wallIndices.push(start - Math.floor(l.length / 6));
228
- if (cornerType === CornerType_default.BEVELED) {
229
- wallIndices.push((back - 2) / 3 + 1);
230
- }
231
- front += 3;
232
- } else {
233
- front += 3;
234
- start = LR;
235
- wallIndices.push(UR);
236
- for (j = 0; j < r.length / 3; j++) {
237
- outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
238
- indices[index++] = start + j;
239
- indices[index++] = start + j + 1;
240
- CorridorGeometryLibrary_default.addAttribute(
241
- finalPositions,
242
- outsidePoint,
243
- front
244
- );
245
- front += 3;
246
- }
247
- wallIndices.push(start + Math.floor(r.length / 6));
248
- if (cornerType === CornerType_default.BEVELED) {
249
- wallIndices.push(front / 3 - 1);
250
- }
251
- back -= 3;
252
- }
253
- rightEdge = positions[posIndex++];
254
- leftEdge = positions[posIndex++];
255
- rightEdge.splice(0, 3);
256
- leftEdge.splice(leftEdge.length - 3, 3);
257
- finalPositions.set(rightEdge, front);
258
- finalPositions.set(leftEdge, back - leftEdge.length + 1);
259
- length = leftEdge.length - 3;
260
- for (j = 0; j < leftEdge.length; j += 3) {
261
- LR = front / 3;
262
- LL = LR - 1;
263
- UR = (back - 2) / 3;
264
- UL = UR + 1;
265
- indices[index++] = UL;
266
- indices[index++] = UR;
267
- indices[index++] = LL;
268
- indices[index++] = LR;
269
- front += 3;
270
- back -= 3;
271
- }
272
- front -= 3;
273
- back += 3;
274
- wallIndices.push(front / 3, (back - 2) / 3);
275
- }
276
- if (addEndPositions) {
277
- front += 3;
278
- back -= 3;
279
- leftPos = cartesian1;
280
- rightPos = cartesian2;
281
- const lastEndPositions = endPositions[1];
282
- for (i = 0; i < halfLength; i++) {
283
- leftPos = Cartesian3_default.fromArray(
284
- lastEndPositions,
285
- (endPositionLength - i - 1) * 3,
286
- leftPos
287
- );
288
- rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
289
- CorridorGeometryLibrary_default.addAttribute(
290
- finalPositions,
291
- leftPos,
292
- void 0,
293
- back
294
- );
295
- CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
296
- LR = front / 3;
297
- LL = LR - 1;
298
- UR = (back - 2) / 3;
299
- UL = UR + 1;
300
- indices[index++] = UL;
301
- indices[index++] = UR;
302
- indices[index++] = LL;
303
- indices[index++] = LR;
304
- front += 3;
305
- back -= 3;
306
- }
307
- wallIndices.push(front / 3);
308
- } else {
309
- wallIndices.push(front / 3, (back - 2) / 3);
310
- }
311
- indices[index++] = front / 3;
312
- indices[index++] = (back - 2) / 3;
313
- attributes.position = new GeometryAttribute_default({
314
- componentDatatype: ComponentDatatype_default.DOUBLE,
315
- componentsPerAttribute: 3,
316
- values: finalPositions
317
- });
318
- return {
319
- attributes,
320
- indices,
321
- wallIndices
322
- };
323
- }
324
- function computePositionsExtruded(params) {
325
- const ellipsoid = params.ellipsoid;
326
- const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
327
- const attr = combine(computedPositions, params.cornerType);
328
- const wallIndices = attr.wallIndices;
329
- const height = params.height;
330
- const extrudedHeight = params.extrudedHeight;
331
- const attributes = attr.attributes;
332
- const indices = attr.indices;
333
- let positions = attributes.position.values;
334
- let length = positions.length;
335
- let extrudedPositions = new Float64Array(length);
336
- extrudedPositions.set(positions);
337
- const newPositions = new Float64Array(length * 2);
338
- positions = PolygonPipeline_default.scaleToGeodeticHeight(
339
- positions,
340
- height,
341
- ellipsoid
342
- );
343
- extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
344
- extrudedPositions,
345
- extrudedHeight,
346
- ellipsoid
347
- );
348
- newPositions.set(positions);
349
- newPositions.set(extrudedPositions, length);
350
- attributes.position.values = newPositions;
351
- length /= 3;
352
- if (defined_default(params.offsetAttribute)) {
353
- let applyOffset = new Uint8Array(length * 2);
354
- if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
355
- applyOffset = applyOffset.fill(1, 0, length);
356
- } else {
357
- const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
358
- applyOffset = applyOffset.fill(applyOffsetValue);
359
- }
360
- attributes.applyOffset = new GeometryAttribute_default({
361
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
362
- componentsPerAttribute: 1,
363
- values: applyOffset
364
- });
365
- }
366
- let i;
367
- const iLength = indices.length;
368
- const newIndices = IndexDatatype_default.createTypedArray(
369
- newPositions.length / 3,
370
- (iLength + wallIndices.length) * 2
371
- );
372
- newIndices.set(indices);
373
- let index = iLength;
374
- for (i = 0; i < iLength; i += 2) {
375
- const v0 = indices[i];
376
- const v1 = indices[i + 1];
377
- newIndices[index++] = v0 + length;
378
- newIndices[index++] = v1 + length;
379
- }
380
- let UL, LL;
381
- for (i = 0; i < wallIndices.length; i++) {
382
- UL = wallIndices[i];
383
- LL = UL + length;
384
- newIndices[index++] = UL;
385
- newIndices[index++] = LL;
386
- }
387
- return {
388
- attributes,
389
- indices: newIndices
390
- };
391
- }
392
- function CorridorOutlineGeometry(options) {
393
- options = options ?? Frozen_default.EMPTY_OBJECT;
394
- const positions = options.positions;
395
- const width = options.width;
396
- Check_default.typeOf.object("options.positions", positions);
397
- Check_default.typeOf.number("options.width", width);
398
- const height = options.height ?? 0;
399
- const extrudedHeight = options.extrudedHeight ?? height;
400
- this._positions = positions;
401
- this._ellipsoid = Ellipsoid_default.clone(options.ellipsoid ?? Ellipsoid_default.default);
402
- this._width = width;
403
- this._height = Math.max(height, extrudedHeight);
404
- this._extrudedHeight = Math.min(height, extrudedHeight);
405
- this._cornerType = options.cornerType ?? CornerType_default.ROUNDED;
406
- this._granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
407
- this._offsetAttribute = options.offsetAttribute;
408
- this._workerName = "createCorridorOutlineGeometry";
409
- this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 6;
410
- }
411
- CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
412
- Check_default.typeOf.object("value", value);
413
- Check_default.typeOf.object("array", array);
414
- startingIndex = startingIndex ?? 0;
415
- const positions = value._positions;
416
- const length = positions.length;
417
- array[startingIndex++] = length;
418
- for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
419
- Cartesian3_default.pack(positions[i], array, startingIndex);
420
- }
421
- Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
422
- startingIndex += Ellipsoid_default.packedLength;
423
- array[startingIndex++] = value._width;
424
- array[startingIndex++] = value._height;
425
- array[startingIndex++] = value._extrudedHeight;
426
- array[startingIndex++] = value._cornerType;
427
- array[startingIndex++] = value._granularity;
428
- array[startingIndex] = value._offsetAttribute ?? -1;
429
- return array;
430
- };
431
- var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
432
- var scratchOptions = {
433
- positions: void 0,
434
- ellipsoid: scratchEllipsoid,
435
- width: void 0,
436
- height: void 0,
437
- extrudedHeight: void 0,
438
- cornerType: void 0,
439
- granularity: void 0,
440
- offsetAttribute: void 0
441
- };
442
- CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
443
- Check_default.typeOf.object("array", array);
444
- startingIndex = startingIndex ?? 0;
445
- const length = array[startingIndex++];
446
- const positions = new Array(length);
447
- for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
448
- positions[i] = Cartesian3_default.unpack(array, startingIndex);
449
- }
450
- const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
451
- startingIndex += Ellipsoid_default.packedLength;
452
- const width = array[startingIndex++];
453
- const height = array[startingIndex++];
454
- const extrudedHeight = array[startingIndex++];
455
- const cornerType = array[startingIndex++];
456
- const granularity = array[startingIndex++];
457
- const offsetAttribute = array[startingIndex];
458
- if (!defined_default(result)) {
459
- scratchOptions.positions = positions;
460
- scratchOptions.width = width;
461
- scratchOptions.height = height;
462
- scratchOptions.extrudedHeight = extrudedHeight;
463
- scratchOptions.cornerType = cornerType;
464
- scratchOptions.granularity = granularity;
465
- scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
466
- return new CorridorOutlineGeometry(scratchOptions);
467
- }
468
- result._positions = positions;
469
- result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
470
- result._width = width;
471
- result._height = height;
472
- result._extrudedHeight = extrudedHeight;
473
- result._cornerType = cornerType;
474
- result._granularity = granularity;
475
- result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
476
- return result;
477
- };
478
- CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
479
- let positions = corridorOutlineGeometry._positions;
480
- const width = corridorOutlineGeometry._width;
481
- const ellipsoid = corridorOutlineGeometry._ellipsoid;
482
- positions = scaleToSurface(positions, ellipsoid);
483
- const cleanPositions = arrayRemoveDuplicates_default(
484
- positions,
485
- Cartesian3_default.equalsEpsilon
486
- );
487
- if (cleanPositions.length < 2 || width <= 0) {
488
- return;
489
- }
490
- const height = corridorOutlineGeometry._height;
491
- const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
492
- const extrude = !Math_default.equalsEpsilon(
493
- height,
494
- extrudedHeight,
495
- 0,
496
- Math_default.EPSILON2
497
- );
498
- const params = {
499
- ellipsoid,
500
- positions: cleanPositions,
501
- width,
502
- cornerType: corridorOutlineGeometry._cornerType,
503
- granularity: corridorOutlineGeometry._granularity,
504
- saveAttributes: false
505
- };
506
- let attr;
507
- if (extrude) {
508
- params.height = height;
509
- params.extrudedHeight = extrudedHeight;
510
- params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
511
- attr = computePositionsExtruded(params);
512
- } else {
513
- const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
514
- attr = combine(computedPositions, params.cornerType);
515
- attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
516
- attr.attributes.position.values,
517
- height,
518
- ellipsoid
519
- );
520
- if (defined_default(corridorOutlineGeometry._offsetAttribute)) {
521
- const length = attr.attributes.position.values.length;
522
- const offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
523
- const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
524
- attr.attributes.applyOffset = new GeometryAttribute_default({
525
- componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
526
- componentsPerAttribute: 1,
527
- values: applyOffset
528
- });
529
- }
530
- }
531
- const attributes = attr.attributes;
532
- const boundingSphere = BoundingSphere_default.fromVertices(
533
- attributes.position.values,
534
- void 0,
535
- 3
536
- );
537
- return new Geometry_default({
538
- attributes,
539
- indices: attr.indices,
540
- primitiveType: PrimitiveType_default.LINES,
541
- boundingSphere,
542
- offsetAttribute: corridorOutlineGeometry._offsetAttribute
543
- });
544
- };
545
- var CorridorOutlineGeometry_default = CorridorOutlineGeometry;
546
-
547
- // packages/engine/Source/Workers/createCorridorOutlineGeometry.js
548
- function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
549
- if (defined_default(offset)) {
550
- corridorOutlineGeometry = CorridorOutlineGeometry_default.unpack(
551
- corridorOutlineGeometry,
552
- offset
553
- );
554
- }
555
- corridorOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
556
- corridorOutlineGeometry._ellipsoid
557
- );
558
- return CorridorOutlineGeometry_default.createGeometry(corridorOutlineGeometry);
559
- }
560
- var createCorridorOutlineGeometry_default = createCorridorOutlineGeometry;
561
- export {
562
- createCorridorOutlineGeometry_default as default
563
- };
@@ -1,60 +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
- CylinderGeometry_default
28
- } from "./chunk-KVE5EAPO.js";
29
- import "./chunk-TWF4XRZ6.js";
30
- import "./chunk-6H33B6OL.js";
31
- import "./chunk-I76SRIKN.js";
32
- import "./chunk-55IROWAX.js";
33
- import "./chunk-BOV6T7FO.js";
34
- import "./chunk-XOVHLPKW.js";
35
- import "./chunk-OAOREOSO.js";
36
- import "./chunk-EKMWNF4U.js";
37
- import "./chunk-KQIZ7AFF.js";
38
- import "./chunk-POY6ZE32.js";
39
- import "./chunk-AL22JVIA.js";
40
- import "./chunk-5VZISKJF.js";
41
- import "./chunk-UYT2PBMV.js";
42
- import "./chunk-YPGJSFOO.js";
43
- import "./chunk-QWV2DM66.js";
44
- import "./chunk-6XJO625E.js";
45
- import "./chunk-KH2OWUUA.js";
46
- import {
47
- defined_default
48
- } from "./chunk-AVSQILVI.js";
49
-
50
- // packages/engine/Source/Workers/createCylinderGeometry.js
51
- function createCylinderGeometry(cylinderGeometry, offset) {
52
- if (defined_default(offset)) {
53
- cylinderGeometry = CylinderGeometry_default.unpack(cylinderGeometry, offset);
54
- }
55
- return CylinderGeometry_default.createGeometry(cylinderGeometry);
56
- }
57
- var createCylinderGeometry_default = createCylinderGeometry;
58
- export {
59
- createCylinderGeometry_default as default
60
- };