@hztxi/cesium-engine 25.0.3 → 25.0.4

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 (121) hide show
  1. package/Build/Workers/chunk-3B2TIEWW.js +73 -0
  2. package/Build/Workers/chunk-3HOOLJ6E.js +1483 -0
  3. package/Build/Workers/chunk-3MWOYCFC.js +511 -0
  4. package/Build/Workers/chunk-3Q52BERF.js +476 -0
  5. package/Build/Workers/chunk-4MHUA5ZK.js +163 -0
  6. package/Build/Workers/chunk-5BVKUNRB.js +368 -0
  7. package/Build/Workers/chunk-642GMGGP.js +162 -0
  8. package/Build/Workers/chunk-65LZTCWG.js +1344 -0
  9. package/Build/Workers/chunk-6PYOAYJD.js +1046 -0
  10. package/Build/Workers/chunk-AH6GJ5MT.js +754 -0
  11. package/Build/Workers/chunk-AM56LGEB.js +352 -0
  12. package/Build/Workers/chunk-CADDH6MK.js +140 -0
  13. package/Build/Workers/chunk-CEIY3YH2.js +57 -0
  14. package/Build/Workers/chunk-CJT3FTZK.js +58 -0
  15. package/Build/Workers/chunk-CV7K25H3.js +138 -0
  16. package/Build/Workers/chunk-DNEERCHO.js +171 -0
  17. package/Build/Workers/chunk-EHXAKTME.js +147 -0
  18. package/Build/Workers/chunk-FF6JKPLF.js +454 -0
  19. package/Build/Workers/chunk-FTRHXHI5.js +3794 -0
  20. package/Build/Workers/chunk-GH2D6MPO.js +497 -0
  21. package/Build/Workers/chunk-GHVEEVR7.js +778 -0
  22. package/Build/Workers/chunk-HUNCRVVV.js +1067 -0
  23. package/Build/Workers/chunk-IFSGYIDE.js +257 -0
  24. package/Build/Workers/chunk-ISRYZ3F4.js +414 -0
  25. package/Build/Workers/chunk-JBJ5PC2D.js +102 -0
  26. package/Build/Workers/chunk-JFPBQCDB.js +398 -0
  27. package/Build/Workers/chunk-JKPELBSI.js +682 -0
  28. package/Build/Workers/chunk-JLLWLD6O.js +973 -0
  29. package/Build/Workers/chunk-KCUS7QEU.js +387 -0
  30. package/Build/Workers/chunk-KFRKYG4B.js +288 -0
  31. package/Build/Workers/chunk-LERIK6IA.js +219 -0
  32. package/Build/Workers/chunk-LOVXQI64.js +2719 -0
  33. package/Build/Workers/chunk-MD7CEJO5.js +2342 -0
  34. package/Build/Workers/chunk-OKPQ3QBG.js +124 -0
  35. package/Build/Workers/chunk-PC7533X2.js +1800 -0
  36. package/Build/Workers/chunk-PCXE4XMI.js +82 -0
  37. package/Build/Workers/chunk-PXPUYOFJ.js +1287 -0
  38. package/Build/Workers/chunk-QX6AYJX2.js +455 -0
  39. package/Build/Workers/chunk-RSJUCJPN.js +241 -0
  40. package/Build/Workers/chunk-SPTT255E.js +301 -0
  41. package/Build/Workers/chunk-STXWAEVD.js +101 -0
  42. package/Build/Workers/chunk-SUG6ECWR.js +76 -0
  43. package/Build/Workers/chunk-TPT5IM72.js +280 -0
  44. package/Build/Workers/chunk-TTG2JNFN.js +198 -0
  45. package/Build/Workers/chunk-UDXUBVNR.js +1992 -0
  46. package/Build/Workers/chunk-UNXJWCXV.js +9230 -0
  47. package/Build/Workers/chunk-UTKCX3AS.js +352 -0
  48. package/Build/Workers/chunk-VL2WHGQI.js +305 -0
  49. package/Build/Workers/chunk-W37YFRTG.js +38 -0
  50. package/Build/Workers/chunk-W5AGSDWX.js +44 -0
  51. package/Build/Workers/chunk-WBQDTVCN.js +97 -0
  52. package/Build/Workers/chunk-WDSHSR57.js +837 -0
  53. package/Build/Workers/chunk-XPIDT6UT.js +1054 -0
  54. package/Build/Workers/chunk-XQETP7YD.js +3201 -0
  55. package/Build/Workers/chunk-Z3KHKVNA.js +56 -0
  56. package/Build/Workers/chunk-Z7XRKD6H.js +693 -0
  57. package/Build/Workers/chunk-ZQUSI7YK.js +630 -0
  58. package/Build/Workers/chunk-ZY4DTNR2.js +56 -0
  59. package/Build/Workers/combineGeometry.js +24 -24
  60. package/Build/Workers/createBoxGeometry.js +18 -18
  61. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  62. package/Build/Workers/createCircleGeometry.js +26 -26
  63. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  64. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  65. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  66. package/Build/Workers/createCorridorGeometry.js +29 -29
  67. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  68. package/Build/Workers/createCylinderGeometry.js +20 -20
  69. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  70. package/Build/Workers/createEllipseGeometry.js +26 -26
  71. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  73. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  74. package/Build/Workers/createFrustumGeometry.js +18 -18
  75. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  76. package/Build/Workers/createGeometry.js +24 -24
  77. package/Build/Workers/createGroundPolylineGeometry.js +23 -23
  78. package/Build/Workers/createPlaneGeometry.js +16 -16
  79. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  80. package/Build/Workers/createPolygonGeometry.js +32 -32
  81. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  82. package/Build/Workers/createPolylineGeometry.js +25 -25
  83. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  84. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  85. package/Build/Workers/createRectangleGeometry.js +27 -27
  86. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  87. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  88. package/Build/Workers/createSphereGeometry.js +19 -19
  89. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  90. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  91. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  92. package/Build/Workers/createVectorTileGeometries.js +24 -24
  93. package/Build/Workers/createVectorTilePoints.js +13 -13
  94. package/Build/Workers/createVectorTilePolygons.js +22 -22
  95. package/Build/Workers/createVectorTilePolylines.js +14 -14
  96. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
  97. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
  98. package/Build/Workers/createVerticesFromHeightmap.js +23 -23
  99. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
  100. package/Build/Workers/createWallGeometry.js +24 -24
  101. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  102. package/Build/Workers/decodeDraco.js +10 -10
  103. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  104. package/Build/Workers/decodeI3S.js +10 -10
  105. package/Build/Workers/gaussianSplatSorter.js +4 -4
  106. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  107. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  108. package/Build/Workers/transcodeKTX2.js +6 -6
  109. package/Build/Workers/transferTypedArrayTest.js +1 -1
  110. package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
  111. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
  112. package/Source/Scene/Globe.js +55 -0
  113. package/Source/Scene/GlobeSurfaceShaderSet.js +132 -1
  114. package/Source/Scene/GlobeSurfaceTileProvider.js +378 -2
  115. package/Source/Scene/ImageryLayer.js +244 -10
  116. package/Source/Scene/QuadtreePrimitive.js +256 -2
  117. package/Source/Shaders/GlobeFS.glsl +43 -0
  118. package/Source/Shaders/GlobeFS.js +43 -0
  119. package/Source/ThirdParty/zip-module.wasm +0 -0
  120. package/index.js +371 -371
  121. package/package.json +10 -10
@@ -0,0 +1,387 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.141.4
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
+ EllipseGeometryLibrary_default
28
+ } from "./chunk-VL2WHGQI.js";
29
+ import {
30
+ GeometryOffsetAttribute_default
31
+ } from "./chunk-W37YFRTG.js";
32
+ import {
33
+ IndexDatatype_default
34
+ } from "./chunk-CADDH6MK.js";
35
+ import {
36
+ GeometryAttributes_default
37
+ } from "./chunk-W5AGSDWX.js";
38
+ import {
39
+ GeometryAttribute_default,
40
+ Geometry_default,
41
+ PrimitiveType_default
42
+ } from "./chunk-SPTT255E.js";
43
+ import {
44
+ BoundingSphere_default
45
+ } from "./chunk-PXPUYOFJ.js";
46
+ import {
47
+ ComponentDatatype_default
48
+ } from "./chunk-IFSGYIDE.js";
49
+ import {
50
+ Ellipsoid_default
51
+ } from "./chunk-UDXUBVNR.js";
52
+ import {
53
+ Cartesian3_default,
54
+ Frozen_default
55
+ } from "./chunk-MD7CEJO5.js";
56
+ import {
57
+ Math_default
58
+ } from "./chunk-GH2D6MPO.js";
59
+ import {
60
+ DeveloperError_default
61
+ } from "./chunk-4MHUA5ZK.js";
62
+ import {
63
+ defined_default
64
+ } from "./chunk-PCXE4XMI.js";
65
+
66
+ // packages/engine/Source/Core/EllipseOutlineGeometry.js
67
+ var scratchCartesian1 = new Cartesian3_default();
68
+ var boundingSphereCenter = new Cartesian3_default();
69
+ function computeEllipse(options) {
70
+ const center = options.center;
71
+ boundingSphereCenter = Cartesian3_default.multiplyByScalar(
72
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
73
+ options.height,
74
+ boundingSphereCenter
75
+ );
76
+ boundingSphereCenter = Cartesian3_default.add(
77
+ center,
78
+ boundingSphereCenter,
79
+ boundingSphereCenter
80
+ );
81
+ const boundingSphere = new BoundingSphere_default(
82
+ boundingSphereCenter,
83
+ options.semiMajorAxis
84
+ );
85
+ const positions = EllipseGeometryLibrary_default.computeEllipsePositions(
86
+ options,
87
+ false,
88
+ true
89
+ ).outerPositions;
90
+ const attributes = new GeometryAttributes_default({
91
+ position: new GeometryAttribute_default({
92
+ componentDatatype: ComponentDatatype_default.DOUBLE,
93
+ componentsPerAttribute: 3,
94
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
95
+ positions,
96
+ options,
97
+ false
98
+ )
99
+ })
100
+ });
101
+ const length = positions.length / 3;
102
+ const indices = IndexDatatype_default.createTypedArray(length, length * 2);
103
+ let index = 0;
104
+ for (let i = 0; i < length; ++i) {
105
+ indices[index++] = i;
106
+ indices[index++] = (i + 1) % length;
107
+ }
108
+ return {
109
+ boundingSphere,
110
+ attributes,
111
+ indices
112
+ };
113
+ }
114
+ var topBoundingSphere = new BoundingSphere_default();
115
+ var bottomBoundingSphere = new BoundingSphere_default();
116
+ function computeExtrudedEllipse(options) {
117
+ const center = options.center;
118
+ const ellipsoid = options.ellipsoid;
119
+ const semiMajorAxis = options.semiMajorAxis;
120
+ let scaledNormal = Cartesian3_default.multiplyByScalar(
121
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),
122
+ options.height,
123
+ scratchCartesian1
124
+ );
125
+ topBoundingSphere.center = Cartesian3_default.add(
126
+ center,
127
+ scaledNormal,
128
+ topBoundingSphere.center
129
+ );
130
+ topBoundingSphere.radius = semiMajorAxis;
131
+ scaledNormal = Cartesian3_default.multiplyByScalar(
132
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
133
+ options.extrudedHeight,
134
+ scaledNormal
135
+ );
136
+ bottomBoundingSphere.center = Cartesian3_default.add(
137
+ center,
138
+ scaledNormal,
139
+ bottomBoundingSphere.center
140
+ );
141
+ bottomBoundingSphere.radius = semiMajorAxis;
142
+ let positions = EllipseGeometryLibrary_default.computeEllipsePositions(
143
+ options,
144
+ false,
145
+ true
146
+ ).outerPositions;
147
+ const attributes = new GeometryAttributes_default({
148
+ position: new GeometryAttribute_default({
149
+ componentDatatype: ComponentDatatype_default.DOUBLE,
150
+ componentsPerAttribute: 3,
151
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
152
+ positions,
153
+ options,
154
+ true
155
+ )
156
+ })
157
+ });
158
+ positions = attributes.position.values;
159
+ const boundingSphere = BoundingSphere_default.union(
160
+ topBoundingSphere,
161
+ bottomBoundingSphere
162
+ );
163
+ let length = positions.length / 3;
164
+ if (defined_default(options.offsetAttribute)) {
165
+ let applyOffset = new Uint8Array(length);
166
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
167
+ applyOffset = applyOffset.fill(1, 0, length / 2);
168
+ } else {
169
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
170
+ applyOffset = applyOffset.fill(offsetValue);
171
+ }
172
+ attributes.applyOffset = new GeometryAttribute_default({
173
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
174
+ componentsPerAttribute: 1,
175
+ values: applyOffset
176
+ });
177
+ }
178
+ let numberOfVerticalLines = options.numberOfVerticalLines ?? 16;
179
+ numberOfVerticalLines = Math_default.clamp(
180
+ numberOfVerticalLines,
181
+ 0,
182
+ length / 2
183
+ );
184
+ const indices = IndexDatatype_default.createTypedArray(
185
+ length,
186
+ length * 2 + numberOfVerticalLines * 2
187
+ );
188
+ length /= 2;
189
+ let index = 0;
190
+ let i;
191
+ for (i = 0; i < length; ++i) {
192
+ indices[index++] = i;
193
+ indices[index++] = (i + 1) % length;
194
+ indices[index++] = i + length;
195
+ indices[index++] = (i + 1) % length + length;
196
+ }
197
+ let numSide;
198
+ if (numberOfVerticalLines > 0) {
199
+ const numSideLines = Math.min(numberOfVerticalLines, length);
200
+ numSide = Math.round(length / numSideLines);
201
+ const maxI = Math.min(numSide * numberOfVerticalLines, length);
202
+ for (i = 0; i < maxI; i += numSide) {
203
+ indices[index++] = i;
204
+ indices[index++] = i + length;
205
+ }
206
+ }
207
+ return {
208
+ boundingSphere,
209
+ attributes,
210
+ indices
211
+ };
212
+ }
213
+ function EllipseOutlineGeometry(options) {
214
+ options = options ?? Frozen_default.EMPTY_OBJECT;
215
+ const center = options.center;
216
+ const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
217
+ const semiMajorAxis = options.semiMajorAxis;
218
+ const semiMinorAxis = options.semiMinorAxis;
219
+ const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
220
+ if (!defined_default(center)) {
221
+ throw new DeveloperError_default("center is required.");
222
+ }
223
+ if (!defined_default(semiMajorAxis)) {
224
+ throw new DeveloperError_default("semiMajorAxis is required.");
225
+ }
226
+ if (!defined_default(semiMinorAxis)) {
227
+ throw new DeveloperError_default("semiMinorAxis is required.");
228
+ }
229
+ if (semiMajorAxis < semiMinorAxis) {
230
+ throw new DeveloperError_default(
231
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
232
+ );
233
+ }
234
+ if (granularity <= 0) {
235
+ throw new DeveloperError_default("granularity must be greater than zero.");
236
+ }
237
+ const height = options.height ?? 0;
238
+ const extrudedHeight = options.extrudedHeight ?? height;
239
+ this._center = Cartesian3_default.clone(center);
240
+ this._semiMajorAxis = semiMajorAxis;
241
+ this._semiMinorAxis = semiMinorAxis;
242
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
243
+ this._rotation = options.rotation ?? 0;
244
+ this._height = Math.max(extrudedHeight, height);
245
+ this._granularity = granularity;
246
+ this._extrudedHeight = Math.min(extrudedHeight, height);
247
+ this._numberOfVerticalLines = Math.max(
248
+ options.numberOfVerticalLines ?? 16,
249
+ 0
250
+ );
251
+ this._offsetAttribute = options.offsetAttribute;
252
+ this._workerName = "createEllipseOutlineGeometry";
253
+ }
254
+ EllipseOutlineGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 8;
255
+ EllipseOutlineGeometry.pack = function(value, array, startingIndex) {
256
+ if (!defined_default(value)) {
257
+ throw new DeveloperError_default("value is required");
258
+ }
259
+ if (!defined_default(array)) {
260
+ throw new DeveloperError_default("array is required");
261
+ }
262
+ startingIndex = startingIndex ?? 0;
263
+ Cartesian3_default.pack(value._center, array, startingIndex);
264
+ startingIndex += Cartesian3_default.packedLength;
265
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
266
+ startingIndex += Ellipsoid_default.packedLength;
267
+ array[startingIndex++] = value._semiMajorAxis;
268
+ array[startingIndex++] = value._semiMinorAxis;
269
+ array[startingIndex++] = value._rotation;
270
+ array[startingIndex++] = value._height;
271
+ array[startingIndex++] = value._granularity;
272
+ array[startingIndex++] = value._extrudedHeight;
273
+ array[startingIndex++] = value._numberOfVerticalLines;
274
+ array[startingIndex] = value._offsetAttribute ?? -1;
275
+ return array;
276
+ };
277
+ var scratchCenter = new Cartesian3_default();
278
+ var scratchEllipsoid = new Ellipsoid_default();
279
+ var scratchOptions = {
280
+ center: scratchCenter,
281
+ ellipsoid: scratchEllipsoid,
282
+ semiMajorAxis: void 0,
283
+ semiMinorAxis: void 0,
284
+ rotation: void 0,
285
+ height: void 0,
286
+ granularity: void 0,
287
+ extrudedHeight: void 0,
288
+ numberOfVerticalLines: void 0,
289
+ offsetAttribute: void 0
290
+ };
291
+ EllipseOutlineGeometry.unpack = function(array, startingIndex, result) {
292
+ if (!defined_default(array)) {
293
+ throw new DeveloperError_default("array is required");
294
+ }
295
+ startingIndex = startingIndex ?? 0;
296
+ const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter);
297
+ startingIndex += Cartesian3_default.packedLength;
298
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
299
+ startingIndex += Ellipsoid_default.packedLength;
300
+ const semiMajorAxis = array[startingIndex++];
301
+ const semiMinorAxis = array[startingIndex++];
302
+ const rotation = array[startingIndex++];
303
+ const height = array[startingIndex++];
304
+ const granularity = array[startingIndex++];
305
+ const extrudedHeight = array[startingIndex++];
306
+ const numberOfVerticalLines = array[startingIndex++];
307
+ const offsetAttribute = array[startingIndex];
308
+ if (!defined_default(result)) {
309
+ scratchOptions.height = height;
310
+ scratchOptions.extrudedHeight = extrudedHeight;
311
+ scratchOptions.granularity = granularity;
312
+ scratchOptions.rotation = rotation;
313
+ scratchOptions.semiMajorAxis = semiMajorAxis;
314
+ scratchOptions.semiMinorAxis = semiMinorAxis;
315
+ scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
316
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
317
+ return new EllipseOutlineGeometry(scratchOptions);
318
+ }
319
+ result._center = Cartesian3_default.clone(center, result._center);
320
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
321
+ result._semiMajorAxis = semiMajorAxis;
322
+ result._semiMinorAxis = semiMinorAxis;
323
+ result._rotation = rotation;
324
+ result._height = height;
325
+ result._granularity = granularity;
326
+ result._extrudedHeight = extrudedHeight;
327
+ result._numberOfVerticalLines = numberOfVerticalLines;
328
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
329
+ return result;
330
+ };
331
+ EllipseOutlineGeometry.createGeometry = function(ellipseGeometry) {
332
+ if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
333
+ return;
334
+ }
335
+ const height = ellipseGeometry._height;
336
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
337
+ const extrude = !Math_default.equalsEpsilon(
338
+ height,
339
+ extrudedHeight,
340
+ 0,
341
+ Math_default.EPSILON2
342
+ );
343
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
344
+ ellipseGeometry._center,
345
+ ellipseGeometry._center
346
+ );
347
+ const options = {
348
+ center: ellipseGeometry._center,
349
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
350
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
351
+ ellipsoid: ellipseGeometry._ellipsoid,
352
+ rotation: ellipseGeometry._rotation,
353
+ height,
354
+ granularity: ellipseGeometry._granularity,
355
+ numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines
356
+ };
357
+ let geometry;
358
+ if (extrude) {
359
+ options.extrudedHeight = extrudedHeight;
360
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
361
+ geometry = computeExtrudedEllipse(options);
362
+ } else {
363
+ geometry = computeEllipse(options);
364
+ if (defined_default(ellipseGeometry._offsetAttribute)) {
365
+ const length = geometry.attributes.position.values.length;
366
+ const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
367
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
368
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
369
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
370
+ componentsPerAttribute: 1,
371
+ values: applyOffset
372
+ });
373
+ }
374
+ }
375
+ return new Geometry_default({
376
+ attributes: geometry.attributes,
377
+ indices: geometry.indices,
378
+ primitiveType: PrimitiveType_default.LINES,
379
+ boundingSphere: geometry.boundingSphere,
380
+ offsetAttribute: ellipseGeometry._offsetAttribute
381
+ });
382
+ };
383
+ var EllipseOutlineGeometry_default = EllipseOutlineGeometry;
384
+
385
+ export {
386
+ EllipseOutlineGeometry_default
387
+ };
@@ -0,0 +1,288 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.141.4
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
+ AxisAlignedBoundingBox_default
28
+ } from "./chunk-642GMGGP.js";
29
+ import {
30
+ IntersectionTests_default,
31
+ Ray_default
32
+ } from "./chunk-65LZTCWG.js";
33
+ import {
34
+ Plane_default
35
+ } from "./chunk-DNEERCHO.js";
36
+ import {
37
+ Transforms_default
38
+ } from "./chunk-UNXJWCXV.js";
39
+ import {
40
+ Cartesian4_default,
41
+ Matrix4_default
42
+ } from "./chunk-XQETP7YD.js";
43
+ import {
44
+ Cartesian2_default,
45
+ Ellipsoid_default
46
+ } from "./chunk-UDXUBVNR.js";
47
+ import {
48
+ Cartesian3_default
49
+ } from "./chunk-MD7CEJO5.js";
50
+ import {
51
+ Check_default,
52
+ DeveloperError_default
53
+ } from "./chunk-4MHUA5ZK.js";
54
+ import {
55
+ defined_default
56
+ } from "./chunk-PCXE4XMI.js";
57
+
58
+ // packages/engine/Source/Core/EllipsoidTangentPlane.js
59
+ var scratchCart4 = new Cartesian4_default();
60
+ function EllipsoidTangentPlane(origin, ellipsoid) {
61
+ Check_default.defined("origin", origin);
62
+ ellipsoid = ellipsoid ?? Ellipsoid_default.default;
63
+ origin = ellipsoid.scaleToGeodeticSurface(origin);
64
+ if (!defined_default(origin)) {
65
+ throw new DeveloperError_default(
66
+ "origin must not be at the center of the ellipsoid."
67
+ );
68
+ }
69
+ const eastNorthUp = Transforms_default.eastNorthUpToFixedFrame(origin, ellipsoid);
70
+ this._ellipsoid = ellipsoid;
71
+ this._origin = origin;
72
+ this._xAxis = Cartesian3_default.fromCartesian4(
73
+ Matrix4_default.getColumn(eastNorthUp, 0, scratchCart4)
74
+ );
75
+ this._yAxis = Cartesian3_default.fromCartesian4(
76
+ Matrix4_default.getColumn(eastNorthUp, 1, scratchCart4)
77
+ );
78
+ const normal = Cartesian3_default.fromCartesian4(
79
+ Matrix4_default.getColumn(eastNorthUp, 2, scratchCart4)
80
+ );
81
+ this._plane = Plane_default.fromPointNormal(origin, normal);
82
+ }
83
+ Object.defineProperties(EllipsoidTangentPlane.prototype, {
84
+ /**
85
+ * Gets the ellipsoid.
86
+ * @memberof EllipsoidTangentPlane.prototype
87
+ * @type {Ellipsoid}
88
+ */
89
+ ellipsoid: {
90
+ get: function() {
91
+ return this._ellipsoid;
92
+ }
93
+ },
94
+ /**
95
+ * Gets the origin.
96
+ * @memberof EllipsoidTangentPlane.prototype
97
+ * @type {Cartesian3}
98
+ */
99
+ origin: {
100
+ get: function() {
101
+ return this._origin;
102
+ }
103
+ },
104
+ /**
105
+ * Gets the plane which is tangent to the ellipsoid.
106
+ * @memberof EllipsoidTangentPlane.prototype
107
+ * @readonly
108
+ * @type {Plane}
109
+ */
110
+ plane: {
111
+ get: function() {
112
+ return this._plane;
113
+ }
114
+ },
115
+ /**
116
+ * Gets the local X-axis (east) of the tangent plane.
117
+ * @memberof EllipsoidTangentPlane.prototype
118
+ * @readonly
119
+ * @type {Cartesian3}
120
+ */
121
+ xAxis: {
122
+ get: function() {
123
+ return this._xAxis;
124
+ }
125
+ },
126
+ /**
127
+ * Gets the local Y-axis (north) of the tangent plane.
128
+ * @memberof EllipsoidTangentPlane.prototype
129
+ * @readonly
130
+ * @type {Cartesian3}
131
+ */
132
+ yAxis: {
133
+ get: function() {
134
+ return this._yAxis;
135
+ }
136
+ },
137
+ /**
138
+ * Gets the local Z-axis (up) of the tangent plane.
139
+ * @memberof EllipsoidTangentPlane.prototype
140
+ * @readonly
141
+ * @type {Cartesian3}
142
+ */
143
+ zAxis: {
144
+ get: function() {
145
+ return this._plane.normal;
146
+ }
147
+ }
148
+ });
149
+ var tmp = new AxisAlignedBoundingBox_default();
150
+ EllipsoidTangentPlane.fromPoints = function(cartesians, ellipsoid) {
151
+ Check_default.defined("cartesians", cartesians);
152
+ const box = AxisAlignedBoundingBox_default.fromPoints(cartesians, tmp);
153
+ return new EllipsoidTangentPlane(box.center, ellipsoid);
154
+ };
155
+ var scratchProjectPointOntoPlaneRay = new Ray_default();
156
+ var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
157
+ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function(cartesian, result) {
158
+ Check_default.defined("cartesian", cartesian);
159
+ const ray = scratchProjectPointOntoPlaneRay;
160
+ ray.origin = cartesian;
161
+ Cartesian3_default.normalize(cartesian, ray.direction);
162
+ let intersectionPoint = IntersectionTests_default.rayPlane(
163
+ ray,
164
+ this._plane,
165
+ scratchProjectPointOntoPlaneCartesian3
166
+ );
167
+ if (!defined_default(intersectionPoint)) {
168
+ Cartesian3_default.negate(ray.direction, ray.direction);
169
+ intersectionPoint = IntersectionTests_default.rayPlane(
170
+ ray,
171
+ this._plane,
172
+ scratchProjectPointOntoPlaneCartesian3
173
+ );
174
+ }
175
+ if (defined_default(intersectionPoint)) {
176
+ const v = Cartesian3_default.subtract(
177
+ intersectionPoint,
178
+ this._origin,
179
+ intersectionPoint
180
+ );
181
+ const x = Cartesian3_default.dot(this._xAxis, v);
182
+ const y = Cartesian3_default.dot(this._yAxis, v);
183
+ if (!defined_default(result)) {
184
+ return new Cartesian2_default(x, y);
185
+ }
186
+ result.x = x;
187
+ result.y = y;
188
+ return result;
189
+ }
190
+ return void 0;
191
+ };
192
+ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(cartesians, result) {
193
+ Check_default.defined("cartesians", cartesians);
194
+ if (!defined_default(result)) {
195
+ result = [];
196
+ }
197
+ let count = 0;
198
+ const length = cartesians.length;
199
+ for (let i = 0; i < length; i++) {
200
+ const p = this.projectPointOntoPlane(cartesians[i], result[count]);
201
+ if (defined_default(p)) {
202
+ result[count] = p;
203
+ count++;
204
+ }
205
+ }
206
+ result.length = count;
207
+ return result;
208
+ };
209
+ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function(cartesian, result) {
210
+ Check_default.defined("cartesian", cartesian);
211
+ if (!defined_default(result)) {
212
+ result = new Cartesian2_default();
213
+ }
214
+ const ray = scratchProjectPointOntoPlaneRay;
215
+ ray.origin = cartesian;
216
+ Cartesian3_default.clone(this._plane.normal, ray.direction);
217
+ let intersectionPoint = IntersectionTests_default.rayPlane(
218
+ ray,
219
+ this._plane,
220
+ scratchProjectPointOntoPlaneCartesian3
221
+ );
222
+ if (!defined_default(intersectionPoint)) {
223
+ Cartesian3_default.negate(ray.direction, ray.direction);
224
+ intersectionPoint = IntersectionTests_default.rayPlane(
225
+ ray,
226
+ this._plane,
227
+ scratchProjectPointOntoPlaneCartesian3
228
+ );
229
+ }
230
+ const v = Cartesian3_default.subtract(
231
+ intersectionPoint,
232
+ this._origin,
233
+ intersectionPoint
234
+ );
235
+ const x = Cartesian3_default.dot(this._xAxis, v);
236
+ const y = Cartesian3_default.dot(this._yAxis, v);
237
+ result.x = x;
238
+ result.y = y;
239
+ return result;
240
+ };
241
+ EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function(cartesians, result) {
242
+ Check_default.defined("cartesians", cartesians);
243
+ if (!defined_default(result)) {
244
+ result = [];
245
+ }
246
+ const length = cartesians.length;
247
+ result.length = length;
248
+ for (let i = 0; i < length; i++) {
249
+ result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
250
+ }
251
+ return result;
252
+ };
253
+ var projectPointsOntoEllipsoidScratch = new Cartesian3_default();
254
+ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function(cartesian, result) {
255
+ Check_default.defined("cartesian", cartesian);
256
+ if (!defined_default(result)) {
257
+ result = new Cartesian3_default();
258
+ }
259
+ const ellipsoid = this._ellipsoid;
260
+ const origin = this._origin;
261
+ const xAxis = this._xAxis;
262
+ const yAxis = this._yAxis;
263
+ const tmp2 = projectPointsOntoEllipsoidScratch;
264
+ Cartesian3_default.multiplyByScalar(xAxis, cartesian.x, tmp2);
265
+ result = Cartesian3_default.add(origin, tmp2, result);
266
+ Cartesian3_default.multiplyByScalar(yAxis, cartesian.y, tmp2);
267
+ Cartesian3_default.add(result, tmp2, result);
268
+ ellipsoid.scaleToGeocentricSurface(result, result);
269
+ return result;
270
+ };
271
+ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(cartesians, result) {
272
+ Check_default.defined("cartesians", cartesians);
273
+ const length = cartesians.length;
274
+ if (!defined_default(result)) {
275
+ result = new Array(length);
276
+ } else {
277
+ result.length = length;
278
+ }
279
+ for (let i = 0; i < length; ++i) {
280
+ result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
281
+ }
282
+ return result;
283
+ };
284
+ var EllipsoidTangentPlane_default = EllipsoidTangentPlane;
285
+
286
+ export {
287
+ EllipsoidTangentPlane_default
288
+ };