@rtzh/engine 0.0.1 → 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 (115) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/Source/Scene/Model/CustomShader.js +2 -2
  3. package/index.js +504 -504
  4. package/package.json +1 -1
  5. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  6. package/Build/Workers/chunk-245NZYCR.js +0 -124
  7. package/Build/Workers/chunk-25BA4527.js +0 -837
  8. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  9. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  10. package/Build/Workers/chunk-55IROWAX.js +0 -139
  11. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  12. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  13. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  14. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  15. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  16. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  17. package/Build/Workers/chunk-6XJO625E.js +0 -497
  18. package/Build/Workers/chunk-75UGCVME.js +0 -102
  19. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  20. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  21. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  22. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  23. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  24. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  25. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  26. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  27. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  28. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  29. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  30. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  31. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  32. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  33. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  34. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  35. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  36. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  37. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  38. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  39. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  40. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  41. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  42. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  43. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  44. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  45. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  46. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  47. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  48. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  49. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  50. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  51. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  52. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  53. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  54. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  55. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  56. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  57. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  58. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  59. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  60. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  61. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  62. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  63. package/Build/Workers/combineGeometry.js +0 -66
  64. package/Build/Workers/createBoxGeometry.js +0 -58
  65. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  66. package/Build/Workers/createCircleGeometry.js +0 -201
  67. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  68. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  69. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  70. package/Build/Workers/createCorridorGeometry.js +0 -1258
  71. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  72. package/Build/Workers/createCylinderGeometry.js +0 -60
  73. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  74. package/Build/Workers/createEllipseGeometry.js +0 -72
  75. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  76. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  77. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  78. package/Build/Workers/createFrustumGeometry.js +0 -58
  79. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  80. package/Build/Workers/createGeometry.js +0 -173
  81. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  82. package/Build/Workers/createPlaneGeometry.js +0 -223
  83. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  84. package/Build/Workers/createPolygonGeometry.js +0 -1404
  85. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  86. package/Build/Workers/createPolylineGeometry.js +0 -491
  87. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  88. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  89. package/Build/Workers/createRectangleGeometry.js +0 -1264
  90. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  91. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  92. package/Build/Workers/createSphereGeometry.js +0 -116
  93. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  94. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  95. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  96. package/Build/Workers/createVectorTileGeometries.js +0 -387
  97. package/Build/Workers/createVectorTilePoints.js +0 -114
  98. package/Build/Workers/createVectorTilePolygons.js +0 -386
  99. package/Build/Workers/createVectorTilePolylines.js +0 -262
  100. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  101. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  102. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  103. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  104. package/Build/Workers/createWallGeometry.js +0 -487
  105. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  106. package/Build/Workers/decodeDraco.js +0 -369
  107. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  108. package/Build/Workers/decodeI3S.js +0 -1339
  109. package/Build/Workers/gaussianSplatSorter.js +0 -62
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  112. package/Build/Workers/transcodeKTX2.js +0 -3463
  113. package/Build/Workers/transferTypedArrayTest.js +0 -41
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,940 +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
- Intersect_default
28
- } from "./chunk-EKMWNF4U.js";
29
- import {
30
- Rectangle_default
31
- } from "./chunk-KQIZ7AFF.js";
32
- import {
33
- Matrix4_default
34
- } from "./chunk-POY6ZE32.js";
35
- import {
36
- Cartographic_default,
37
- Ellipsoid_default
38
- } from "./chunk-YPGJSFOO.js";
39
- import {
40
- Cartesian3_default,
41
- Matrix3_default
42
- } from "./chunk-QWV2DM66.js";
43
- import {
44
- Math_default
45
- } from "./chunk-6XJO625E.js";
46
- import {
47
- Check_default,
48
- DeveloperError_default
49
- } from "./chunk-KH2OWUUA.js";
50
- import {
51
- defined_default
52
- } from "./chunk-AVSQILVI.js";
53
-
54
- // packages/engine/Source/Core/GeographicProjection.js
55
- function GeographicProjection(ellipsoid) {
56
- this._ellipsoid = ellipsoid ?? Ellipsoid_default.default;
57
- this._semimajorAxis = this._ellipsoid.maximumRadius;
58
- this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
59
- }
60
- Object.defineProperties(GeographicProjection.prototype, {
61
- /**
62
- * Gets the {@link Ellipsoid}.
63
- *
64
- * @memberof GeographicProjection.prototype
65
- *
66
- * @type {Ellipsoid}
67
- * @readonly
68
- */
69
- ellipsoid: {
70
- get: function() {
71
- return this._ellipsoid;
72
- }
73
- }
74
- });
75
- GeographicProjection.prototype.project = function(cartographic, result) {
76
- const semimajorAxis = this._semimajorAxis;
77
- const x = cartographic.longitude * semimajorAxis;
78
- const y = cartographic.latitude * semimajorAxis;
79
- const z = cartographic.height;
80
- if (!defined_default(result)) {
81
- return new Cartesian3_default(x, y, z);
82
- }
83
- result.x = x;
84
- result.y = y;
85
- result.z = z;
86
- return result;
87
- };
88
- GeographicProjection.prototype.unproject = function(cartesian, result) {
89
- if (!defined_default(cartesian)) {
90
- throw new DeveloperError_default("cartesian is required");
91
- }
92
- const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
93
- const longitude = cartesian.x * oneOverEarthSemimajorAxis;
94
- const latitude = cartesian.y * oneOverEarthSemimajorAxis;
95
- const height = cartesian.z;
96
- if (!defined_default(result)) {
97
- return new Cartographic_default(longitude, latitude, height);
98
- }
99
- result.longitude = longitude;
100
- result.latitude = latitude;
101
- result.height = height;
102
- return result;
103
- };
104
- var GeographicProjection_default = GeographicProjection;
105
-
106
- // packages/engine/Source/Core/Interval.js
107
- function Interval(start, stop) {
108
- this.start = start ?? 0;
109
- this.stop = stop ?? 0;
110
- }
111
- var Interval_default = Interval;
112
-
113
- // packages/engine/Source/Core/BoundingSphere.js
114
- function BoundingSphere(center, radius) {
115
- this.center = Cartesian3_default.clone(center ?? Cartesian3_default.ZERO);
116
- this.radius = radius ?? 0;
117
- }
118
- var fromPointsXMin = new Cartesian3_default();
119
- var fromPointsYMin = new Cartesian3_default();
120
- var fromPointsZMin = new Cartesian3_default();
121
- var fromPointsXMax = new Cartesian3_default();
122
- var fromPointsYMax = new Cartesian3_default();
123
- var fromPointsZMax = new Cartesian3_default();
124
- var fromPointsCurrentPos = new Cartesian3_default();
125
- var fromPointsScratch = new Cartesian3_default();
126
- var fromPointsRitterCenter = new Cartesian3_default();
127
- var fromPointsMinBoxPt = new Cartesian3_default();
128
- var fromPointsMaxBoxPt = new Cartesian3_default();
129
- var fromPointsNaiveCenterScratch = new Cartesian3_default();
130
- var volumeConstant = 4 / 3 * Math_default.PI;
131
- BoundingSphere.fromPoints = function(positions, result) {
132
- if (!defined_default(result)) {
133
- result = new BoundingSphere();
134
- }
135
- if (!defined_default(positions) || positions.length === 0) {
136
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
137
- result.radius = 0;
138
- return result;
139
- }
140
- const currentPos = Cartesian3_default.clone(positions[0], fromPointsCurrentPos);
141
- const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
142
- const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
143
- const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
144
- const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
145
- const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
146
- const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
147
- const numPositions = positions.length;
148
- let i;
149
- for (i = 1; i < numPositions; i++) {
150
- Cartesian3_default.clone(positions[i], currentPos);
151
- const x = currentPos.x;
152
- const y = currentPos.y;
153
- const z = currentPos.z;
154
- if (x < xMin.x) {
155
- Cartesian3_default.clone(currentPos, xMin);
156
- }
157
- if (x > xMax.x) {
158
- Cartesian3_default.clone(currentPos, xMax);
159
- }
160
- if (y < yMin.y) {
161
- Cartesian3_default.clone(currentPos, yMin);
162
- }
163
- if (y > yMax.y) {
164
- Cartesian3_default.clone(currentPos, yMax);
165
- }
166
- if (z < zMin.z) {
167
- Cartesian3_default.clone(currentPos, zMin);
168
- }
169
- if (z > zMax.z) {
170
- Cartesian3_default.clone(currentPos, zMax);
171
- }
172
- }
173
- const xSpan = Cartesian3_default.magnitudeSquared(
174
- Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
175
- );
176
- const ySpan = Cartesian3_default.magnitudeSquared(
177
- Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
178
- );
179
- const zSpan = Cartesian3_default.magnitudeSquared(
180
- Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
181
- );
182
- let diameter1 = xMin;
183
- let diameter2 = xMax;
184
- let maxSpan = xSpan;
185
- if (ySpan > maxSpan) {
186
- maxSpan = ySpan;
187
- diameter1 = yMin;
188
- diameter2 = yMax;
189
- }
190
- if (zSpan > maxSpan) {
191
- maxSpan = zSpan;
192
- diameter1 = zMin;
193
- diameter2 = zMax;
194
- }
195
- const ritterCenter = fromPointsRitterCenter;
196
- ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
197
- ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
198
- ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
199
- let radiusSquared = Cartesian3_default.magnitudeSquared(
200
- Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
201
- );
202
- let ritterRadius = Math.sqrt(radiusSquared);
203
- const minBoxPt = fromPointsMinBoxPt;
204
- minBoxPt.x = xMin.x;
205
- minBoxPt.y = yMin.y;
206
- minBoxPt.z = zMin.z;
207
- const maxBoxPt = fromPointsMaxBoxPt;
208
- maxBoxPt.x = xMax.x;
209
- maxBoxPt.y = yMax.y;
210
- maxBoxPt.z = zMax.z;
211
- const naiveCenter = Cartesian3_default.midpoint(
212
- minBoxPt,
213
- maxBoxPt,
214
- fromPointsNaiveCenterScratch
215
- );
216
- let naiveRadius = 0;
217
- for (i = 0; i < numPositions; i++) {
218
- Cartesian3_default.clone(positions[i], currentPos);
219
- const r = Cartesian3_default.magnitude(
220
- Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
221
- );
222
- if (r > naiveRadius) {
223
- naiveRadius = r;
224
- }
225
- const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
226
- Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
227
- );
228
- if (oldCenterToPointSquared > radiusSquared) {
229
- const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
230
- ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
231
- radiusSquared = ritterRadius * ritterRadius;
232
- const oldToNew = oldCenterToPoint - ritterRadius;
233
- ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
234
- ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
235
- ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
236
- }
237
- }
238
- if (ritterRadius < naiveRadius) {
239
- Cartesian3_default.clone(ritterCenter, result.center);
240
- result.radius = ritterRadius;
241
- } else {
242
- Cartesian3_default.clone(naiveCenter, result.center);
243
- result.radius = naiveRadius;
244
- }
245
- return result;
246
- };
247
- var defaultProjection = new GeographicProjection_default();
248
- var fromRectangle2DLowerLeft = new Cartesian3_default();
249
- var fromRectangle2DUpperRight = new Cartesian3_default();
250
- var fromRectangle2DSouthwest = new Cartographic_default();
251
- var fromRectangle2DNortheast = new Cartographic_default();
252
- BoundingSphere.fromRectangle2D = function(rectangle, projection, result) {
253
- return BoundingSphere.fromRectangleWithHeights2D(
254
- rectangle,
255
- projection,
256
- 0,
257
- 0,
258
- result
259
- );
260
- };
261
- BoundingSphere.fromRectangleWithHeights2D = function(rectangle, projection, minimumHeight, maximumHeight, result) {
262
- if (!defined_default(result)) {
263
- result = new BoundingSphere();
264
- }
265
- if (!defined_default(rectangle)) {
266
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
267
- result.radius = 0;
268
- return result;
269
- }
270
- defaultProjection._ellipsoid = Ellipsoid_default.default;
271
- projection = projection ?? defaultProjection;
272
- Rectangle_default.southwest(rectangle, fromRectangle2DSouthwest);
273
- fromRectangle2DSouthwest.height = minimumHeight;
274
- Rectangle_default.northeast(rectangle, fromRectangle2DNortheast);
275
- fromRectangle2DNortheast.height = maximumHeight;
276
- const lowerLeft = projection.project(
277
- fromRectangle2DSouthwest,
278
- fromRectangle2DLowerLeft
279
- );
280
- const upperRight = projection.project(
281
- fromRectangle2DNortheast,
282
- fromRectangle2DUpperRight
283
- );
284
- const width = upperRight.x - lowerLeft.x;
285
- const height = upperRight.y - lowerLeft.y;
286
- const elevation = upperRight.z - lowerLeft.z;
287
- result.radius = Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;
288
- const center = result.center;
289
- center.x = lowerLeft.x + width * 0.5;
290
- center.y = lowerLeft.y + height * 0.5;
291
- center.z = lowerLeft.z + elevation * 0.5;
292
- return result;
293
- };
294
- var fromRectangle3DScratch = [];
295
- BoundingSphere.fromRectangle3D = function(rectangle, ellipsoid, surfaceHeight, result) {
296
- ellipsoid = ellipsoid ?? Ellipsoid_default.default;
297
- surfaceHeight = surfaceHeight ?? 0;
298
- if (!defined_default(result)) {
299
- result = new BoundingSphere();
300
- }
301
- if (!defined_default(rectangle)) {
302
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
303
- result.radius = 0;
304
- return result;
305
- }
306
- const positions = Rectangle_default.subsample(
307
- rectangle,
308
- ellipsoid,
309
- surfaceHeight,
310
- fromRectangle3DScratch
311
- );
312
- return BoundingSphere.fromPoints(positions, result);
313
- };
314
- BoundingSphere.fromVertices = function(positions, center, stride, result) {
315
- if (!defined_default(result)) {
316
- result = new BoundingSphere();
317
- }
318
- if (!defined_default(positions) || positions.length === 0) {
319
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
320
- result.radius = 0;
321
- return result;
322
- }
323
- center = center ?? Cartesian3_default.ZERO;
324
- stride = stride ?? 3;
325
- Check_default.typeOf.number.greaterThanOrEquals("stride", stride, 3);
326
- const currentPos = fromPointsCurrentPos;
327
- currentPos.x = positions[0] + center.x;
328
- currentPos.y = positions[1] + center.y;
329
- currentPos.z = positions[2] + center.z;
330
- const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
331
- const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
332
- const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
333
- const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
334
- const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
335
- const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
336
- const numElements = positions.length;
337
- let i;
338
- for (i = 0; i < numElements; i += stride) {
339
- const x = positions[i] + center.x;
340
- const y = positions[i + 1] + center.y;
341
- const z = positions[i + 2] + center.z;
342
- currentPos.x = x;
343
- currentPos.y = y;
344
- currentPos.z = z;
345
- if (x < xMin.x) {
346
- Cartesian3_default.clone(currentPos, xMin);
347
- }
348
- if (x > xMax.x) {
349
- Cartesian3_default.clone(currentPos, xMax);
350
- }
351
- if (y < yMin.y) {
352
- Cartesian3_default.clone(currentPos, yMin);
353
- }
354
- if (y > yMax.y) {
355
- Cartesian3_default.clone(currentPos, yMax);
356
- }
357
- if (z < zMin.z) {
358
- Cartesian3_default.clone(currentPos, zMin);
359
- }
360
- if (z > zMax.z) {
361
- Cartesian3_default.clone(currentPos, zMax);
362
- }
363
- }
364
- const xSpan = Cartesian3_default.magnitudeSquared(
365
- Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
366
- );
367
- const ySpan = Cartesian3_default.magnitudeSquared(
368
- Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
369
- );
370
- const zSpan = Cartesian3_default.magnitudeSquared(
371
- Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
372
- );
373
- let diameter1 = xMin;
374
- let diameter2 = xMax;
375
- let maxSpan = xSpan;
376
- if (ySpan > maxSpan) {
377
- maxSpan = ySpan;
378
- diameter1 = yMin;
379
- diameter2 = yMax;
380
- }
381
- if (zSpan > maxSpan) {
382
- maxSpan = zSpan;
383
- diameter1 = zMin;
384
- diameter2 = zMax;
385
- }
386
- const ritterCenter = fromPointsRitterCenter;
387
- ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
388
- ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
389
- ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
390
- let radiusSquared = Cartesian3_default.magnitudeSquared(
391
- Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
392
- );
393
- let ritterRadius = Math.sqrt(radiusSquared);
394
- const minBoxPt = fromPointsMinBoxPt;
395
- minBoxPt.x = xMin.x;
396
- minBoxPt.y = yMin.y;
397
- minBoxPt.z = zMin.z;
398
- const maxBoxPt = fromPointsMaxBoxPt;
399
- maxBoxPt.x = xMax.x;
400
- maxBoxPt.y = yMax.y;
401
- maxBoxPt.z = zMax.z;
402
- const naiveCenter = Cartesian3_default.midpoint(
403
- minBoxPt,
404
- maxBoxPt,
405
- fromPointsNaiveCenterScratch
406
- );
407
- let naiveRadius = 0;
408
- for (i = 0; i < numElements; i += stride) {
409
- currentPos.x = positions[i] + center.x;
410
- currentPos.y = positions[i + 1] + center.y;
411
- currentPos.z = positions[i + 2] + center.z;
412
- const r = Cartesian3_default.magnitude(
413
- Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
414
- );
415
- if (r > naiveRadius) {
416
- naiveRadius = r;
417
- }
418
- const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
419
- Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
420
- );
421
- if (oldCenterToPointSquared > radiusSquared) {
422
- const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
423
- ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
424
- radiusSquared = ritterRadius * ritterRadius;
425
- const oldToNew = oldCenterToPoint - ritterRadius;
426
- ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
427
- ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
428
- ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
429
- }
430
- }
431
- if (ritterRadius < naiveRadius) {
432
- Cartesian3_default.clone(ritterCenter, result.center);
433
- result.radius = ritterRadius;
434
- } else {
435
- Cartesian3_default.clone(naiveCenter, result.center);
436
- result.radius = naiveRadius;
437
- }
438
- return result;
439
- };
440
- BoundingSphere.fromEncodedCartesianVertices = function(positionsHigh, positionsLow, result) {
441
- if (!defined_default(result)) {
442
- result = new BoundingSphere();
443
- }
444
- if (!defined_default(positionsHigh) || !defined_default(positionsLow) || positionsHigh.length !== positionsLow.length || positionsHigh.length === 0) {
445
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
446
- result.radius = 0;
447
- return result;
448
- }
449
- const currentPos = fromPointsCurrentPos;
450
- currentPos.x = positionsHigh[0] + positionsLow[0];
451
- currentPos.y = positionsHigh[1] + positionsLow[1];
452
- currentPos.z = positionsHigh[2] + positionsLow[2];
453
- const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
454
- const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
455
- const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
456
- const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
457
- const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
458
- const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
459
- const numElements = positionsHigh.length;
460
- let i;
461
- for (i = 0; i < numElements; i += 3) {
462
- const x = positionsHigh[i] + positionsLow[i];
463
- const y = positionsHigh[i + 1] + positionsLow[i + 1];
464
- const z = positionsHigh[i + 2] + positionsLow[i + 2];
465
- currentPos.x = x;
466
- currentPos.y = y;
467
- currentPos.z = z;
468
- if (x < xMin.x) {
469
- Cartesian3_default.clone(currentPos, xMin);
470
- }
471
- if (x > xMax.x) {
472
- Cartesian3_default.clone(currentPos, xMax);
473
- }
474
- if (y < yMin.y) {
475
- Cartesian3_default.clone(currentPos, yMin);
476
- }
477
- if (y > yMax.y) {
478
- Cartesian3_default.clone(currentPos, yMax);
479
- }
480
- if (z < zMin.z) {
481
- Cartesian3_default.clone(currentPos, zMin);
482
- }
483
- if (z > zMax.z) {
484
- Cartesian3_default.clone(currentPos, zMax);
485
- }
486
- }
487
- const xSpan = Cartesian3_default.magnitudeSquared(
488
- Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
489
- );
490
- const ySpan = Cartesian3_default.magnitudeSquared(
491
- Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
492
- );
493
- const zSpan = Cartesian3_default.magnitudeSquared(
494
- Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
495
- );
496
- let diameter1 = xMin;
497
- let diameter2 = xMax;
498
- let maxSpan = xSpan;
499
- if (ySpan > maxSpan) {
500
- maxSpan = ySpan;
501
- diameter1 = yMin;
502
- diameter2 = yMax;
503
- }
504
- if (zSpan > maxSpan) {
505
- maxSpan = zSpan;
506
- diameter1 = zMin;
507
- diameter2 = zMax;
508
- }
509
- const ritterCenter = fromPointsRitterCenter;
510
- ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
511
- ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
512
- ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
513
- let radiusSquared = Cartesian3_default.magnitudeSquared(
514
- Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
515
- );
516
- let ritterRadius = Math.sqrt(radiusSquared);
517
- const minBoxPt = fromPointsMinBoxPt;
518
- minBoxPt.x = xMin.x;
519
- minBoxPt.y = yMin.y;
520
- minBoxPt.z = zMin.z;
521
- const maxBoxPt = fromPointsMaxBoxPt;
522
- maxBoxPt.x = xMax.x;
523
- maxBoxPt.y = yMax.y;
524
- maxBoxPt.z = zMax.z;
525
- const naiveCenter = Cartesian3_default.midpoint(
526
- minBoxPt,
527
- maxBoxPt,
528
- fromPointsNaiveCenterScratch
529
- );
530
- let naiveRadius = 0;
531
- for (i = 0; i < numElements; i += 3) {
532
- currentPos.x = positionsHigh[i] + positionsLow[i];
533
- currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];
534
- currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];
535
- const r = Cartesian3_default.magnitude(
536
- Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
537
- );
538
- if (r > naiveRadius) {
539
- naiveRadius = r;
540
- }
541
- const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
542
- Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
543
- );
544
- if (oldCenterToPointSquared > radiusSquared) {
545
- const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
546
- ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
547
- radiusSquared = ritterRadius * ritterRadius;
548
- const oldToNew = oldCenterToPoint - ritterRadius;
549
- ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
550
- ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
551
- ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
552
- }
553
- }
554
- if (ritterRadius < naiveRadius) {
555
- Cartesian3_default.clone(ritterCenter, result.center);
556
- result.radius = ritterRadius;
557
- } else {
558
- Cartesian3_default.clone(naiveCenter, result.center);
559
- result.radius = naiveRadius;
560
- }
561
- return result;
562
- };
563
- BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) {
564
- Check_default.typeOf.object("corner", corner);
565
- Check_default.typeOf.object("oppositeCorner", oppositeCorner);
566
- if (!defined_default(result)) {
567
- result = new BoundingSphere();
568
- }
569
- const center = Cartesian3_default.midpoint(corner, oppositeCorner, result.center);
570
- result.radius = Cartesian3_default.distance(center, oppositeCorner);
571
- return result;
572
- };
573
- BoundingSphere.fromEllipsoid = function(ellipsoid, result) {
574
- Check_default.typeOf.object("ellipsoid", ellipsoid);
575
- if (!defined_default(result)) {
576
- result = new BoundingSphere();
577
- }
578
- Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
579
- result.radius = ellipsoid.maximumRadius;
580
- return result;
581
- };
582
- var fromBoundingSpheresScratch = new Cartesian3_default();
583
- BoundingSphere.fromBoundingSpheres = function(boundingSpheres, result) {
584
- if (!defined_default(result)) {
585
- result = new BoundingSphere();
586
- }
587
- if (!defined_default(boundingSpheres) || boundingSpheres.length === 0) {
588
- result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
589
- result.radius = 0;
590
- return result;
591
- }
592
- const length = boundingSpheres.length;
593
- if (length === 1) {
594
- return BoundingSphere.clone(boundingSpheres[0], result);
595
- }
596
- if (length === 2) {
597
- return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);
598
- }
599
- const positions = [];
600
- let i;
601
- for (i = 0; i < length; i++) {
602
- positions.push(boundingSpheres[i].center);
603
- }
604
- result = BoundingSphere.fromPoints(positions, result);
605
- const center = result.center;
606
- let radius = result.radius;
607
- for (i = 0; i < length; i++) {
608
- const tmp = boundingSpheres[i];
609
- radius = Math.max(
610
- radius,
611
- Cartesian3_default.distance(center, tmp.center, fromBoundingSpheresScratch) + tmp.radius
612
- );
613
- }
614
- result.radius = radius;
615
- return result;
616
- };
617
- var fromOrientedBoundingBoxScratchU = new Cartesian3_default();
618
- var fromOrientedBoundingBoxScratchV = new Cartesian3_default();
619
- var fromOrientedBoundingBoxScratchW = new Cartesian3_default();
620
- BoundingSphere.fromOrientedBoundingBox = function(orientedBoundingBox, result) {
621
- Check_default.defined("orientedBoundingBox", orientedBoundingBox);
622
- if (!defined_default(result)) {
623
- result = new BoundingSphere();
624
- }
625
- const halfAxes = orientedBoundingBox.halfAxes;
626
- const u = Matrix3_default.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);
627
- const v = Matrix3_default.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);
628
- const w = Matrix3_default.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);
629
- Cartesian3_default.add(u, v, u);
630
- Cartesian3_default.add(u, w, u);
631
- result.center = Cartesian3_default.clone(orientedBoundingBox.center, result.center);
632
- result.radius = Cartesian3_default.magnitude(u);
633
- return result;
634
- };
635
- var scratchFromTransformationCenter = new Cartesian3_default();
636
- var scratchFromTransformationScale = new Cartesian3_default();
637
- BoundingSphere.fromTransformation = function(transformation, result) {
638
- Check_default.typeOf.object("transformation", transformation);
639
- if (!defined_default(result)) {
640
- result = new BoundingSphere();
641
- }
642
- const center = Matrix4_default.getTranslation(
643
- transformation,
644
- scratchFromTransformationCenter
645
- );
646
- const scale = Matrix4_default.getScale(
647
- transformation,
648
- scratchFromTransformationScale
649
- );
650
- const radius = 0.5 * Cartesian3_default.magnitude(scale);
651
- result.center = Cartesian3_default.clone(center, result.center);
652
- result.radius = radius;
653
- return result;
654
- };
655
- BoundingSphere.clone = function(sphere, result) {
656
- if (!defined_default(sphere)) {
657
- return void 0;
658
- }
659
- if (!defined_default(result)) {
660
- return new BoundingSphere(sphere.center, sphere.radius);
661
- }
662
- result.center = Cartesian3_default.clone(sphere.center, result.center);
663
- result.radius = sphere.radius;
664
- return result;
665
- };
666
- BoundingSphere.packedLength = 4;
667
- BoundingSphere.pack = function(value, array, startingIndex) {
668
- Check_default.typeOf.object("value", value);
669
- Check_default.defined("array", array);
670
- startingIndex = startingIndex ?? 0;
671
- const center = value.center;
672
- array[startingIndex++] = center.x;
673
- array[startingIndex++] = center.y;
674
- array[startingIndex++] = center.z;
675
- array[startingIndex] = value.radius;
676
- return array;
677
- };
678
- BoundingSphere.unpack = function(array, startingIndex, result) {
679
- Check_default.defined("array", array);
680
- startingIndex = startingIndex ?? 0;
681
- if (!defined_default(result)) {
682
- result = new BoundingSphere();
683
- }
684
- const center = result.center;
685
- center.x = array[startingIndex++];
686
- center.y = array[startingIndex++];
687
- center.z = array[startingIndex++];
688
- result.radius = array[startingIndex];
689
- return result;
690
- };
691
- var unionScratch = new Cartesian3_default();
692
- var unionScratchCenter = new Cartesian3_default();
693
- BoundingSphere.union = function(left, right, result) {
694
- Check_default.typeOf.object("left", left);
695
- Check_default.typeOf.object("right", right);
696
- if (!defined_default(result)) {
697
- result = new BoundingSphere();
698
- }
699
- const leftCenter = left.center;
700
- const leftRadius = left.radius;
701
- const rightCenter = right.center;
702
- const rightRadius = right.radius;
703
- const toRightCenter = Cartesian3_default.subtract(
704
- rightCenter,
705
- leftCenter,
706
- unionScratch
707
- );
708
- const centerSeparation = Cartesian3_default.magnitude(toRightCenter);
709
- if (leftRadius >= centerSeparation + rightRadius) {
710
- left.clone(result);
711
- return result;
712
- }
713
- if (rightRadius >= centerSeparation + leftRadius) {
714
- right.clone(result);
715
- return result;
716
- }
717
- const halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
718
- const center = Cartesian3_default.multiplyByScalar(
719
- toRightCenter,
720
- (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,
721
- unionScratchCenter
722
- );
723
- Cartesian3_default.add(center, leftCenter, center);
724
- Cartesian3_default.clone(center, result.center);
725
- result.radius = halfDistanceBetweenTangentPoints;
726
- return result;
727
- };
728
- var expandScratch = new Cartesian3_default();
729
- BoundingSphere.expand = function(sphere, point, result) {
730
- Check_default.typeOf.object("sphere", sphere);
731
- Check_default.typeOf.object("point", point);
732
- result = BoundingSphere.clone(sphere, result);
733
- const radius = Cartesian3_default.magnitude(
734
- Cartesian3_default.subtract(point, result.center, expandScratch)
735
- );
736
- if (radius > result.radius) {
737
- result.radius = radius;
738
- }
739
- return result;
740
- };
741
- BoundingSphere.intersectPlane = function(sphere, plane) {
742
- Check_default.typeOf.object("sphere", sphere);
743
- Check_default.typeOf.object("plane", plane);
744
- const center = sphere.center;
745
- const radius = sphere.radius;
746
- const normal = plane.normal;
747
- const distanceToPlane = Cartesian3_default.dot(normal, center) + plane.distance;
748
- if (distanceToPlane < -radius) {
749
- return Intersect_default.OUTSIDE;
750
- } else if (distanceToPlane < radius) {
751
- return Intersect_default.INTERSECTING;
752
- }
753
- return Intersect_default.INSIDE;
754
- };
755
- BoundingSphere.transform = function(sphere, transform, result) {
756
- Check_default.typeOf.object("sphere", sphere);
757
- Check_default.typeOf.object("transform", transform);
758
- if (!defined_default(result)) {
759
- result = new BoundingSphere();
760
- }
761
- result.center = Matrix4_default.multiplyByPoint(
762
- transform,
763
- sphere.center,
764
- result.center
765
- );
766
- result.radius = Matrix4_default.getMaximumScale(transform) * sphere.radius;
767
- return result;
768
- };
769
- var distanceSquaredToScratch = new Cartesian3_default();
770
- BoundingSphere.distanceSquaredTo = function(sphere, cartesian) {
771
- Check_default.typeOf.object("sphere", sphere);
772
- Check_default.typeOf.object("cartesian", cartesian);
773
- const diff = Cartesian3_default.subtract(
774
- sphere.center,
775
- cartesian,
776
- distanceSquaredToScratch
777
- );
778
- const distance = Cartesian3_default.magnitude(diff) - sphere.radius;
779
- if (distance <= 0) {
780
- return 0;
781
- }
782
- return distance * distance;
783
- };
784
- BoundingSphere.transformWithoutScale = function(sphere, transform, result) {
785
- Check_default.typeOf.object("sphere", sphere);
786
- Check_default.typeOf.object("transform", transform);
787
- if (!defined_default(result)) {
788
- result = new BoundingSphere();
789
- }
790
- result.center = Matrix4_default.multiplyByPoint(
791
- transform,
792
- sphere.center,
793
- result.center
794
- );
795
- result.radius = sphere.radius;
796
- return result;
797
- };
798
- var scratchCartesian3 = new Cartesian3_default();
799
- BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) {
800
- Check_default.typeOf.object("sphere", sphere);
801
- Check_default.typeOf.object("position", position);
802
- Check_default.typeOf.object("direction", direction);
803
- if (!defined_default(result)) {
804
- result = new Interval_default();
805
- }
806
- const toCenter = Cartesian3_default.subtract(
807
- sphere.center,
808
- position,
809
- scratchCartesian3
810
- );
811
- const mag = Cartesian3_default.dot(direction, toCenter);
812
- result.start = mag - sphere.radius;
813
- result.stop = mag + sphere.radius;
814
- return result;
815
- };
816
- var projectTo2DNormalScratch = new Cartesian3_default();
817
- var projectTo2DEastScratch = new Cartesian3_default();
818
- var projectTo2DNorthScratch = new Cartesian3_default();
819
- var projectTo2DWestScratch = new Cartesian3_default();
820
- var projectTo2DSouthScratch = new Cartesian3_default();
821
- var projectTo2DCartographicScratch = new Cartographic_default();
822
- var projectTo2DPositionsScratch = new Array(8);
823
- for (let n = 0; n < 8; ++n) {
824
- projectTo2DPositionsScratch[n] = new Cartesian3_default();
825
- }
826
- var projectTo2DProjection = new GeographicProjection_default();
827
- BoundingSphere.projectTo2D = function(sphere, projection, result) {
828
- Check_default.typeOf.object("sphere", sphere);
829
- projectTo2DProjection._ellipsoid = Ellipsoid_default.default;
830
- projection = projection ?? projectTo2DProjection;
831
- const ellipsoid = projection.ellipsoid;
832
- let center = sphere.center;
833
- const radius = sphere.radius;
834
- let normal;
835
- if (Cartesian3_default.equals(center, Cartesian3_default.ZERO)) {
836
- normal = Cartesian3_default.clone(Cartesian3_default.UNIT_X, projectTo2DNormalScratch);
837
- } else {
838
- normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);
839
- }
840
- const east = Cartesian3_default.cross(
841
- Cartesian3_default.UNIT_Z,
842
- normal,
843
- projectTo2DEastScratch
844
- );
845
- Cartesian3_default.normalize(east, east);
846
- const north = Cartesian3_default.cross(normal, east, projectTo2DNorthScratch);
847
- Cartesian3_default.normalize(north, north);
848
- Cartesian3_default.multiplyByScalar(normal, radius, normal);
849
- Cartesian3_default.multiplyByScalar(north, radius, north);
850
- Cartesian3_default.multiplyByScalar(east, radius, east);
851
- const south = Cartesian3_default.negate(north, projectTo2DSouthScratch);
852
- const west = Cartesian3_default.negate(east, projectTo2DWestScratch);
853
- const positions = projectTo2DPositionsScratch;
854
- let corner = positions[0];
855
- Cartesian3_default.add(normal, north, corner);
856
- Cartesian3_default.add(corner, east, corner);
857
- corner = positions[1];
858
- Cartesian3_default.add(normal, north, corner);
859
- Cartesian3_default.add(corner, west, corner);
860
- corner = positions[2];
861
- Cartesian3_default.add(normal, south, corner);
862
- Cartesian3_default.add(corner, west, corner);
863
- corner = positions[3];
864
- Cartesian3_default.add(normal, south, corner);
865
- Cartesian3_default.add(corner, east, corner);
866
- Cartesian3_default.negate(normal, normal);
867
- corner = positions[4];
868
- Cartesian3_default.add(normal, north, corner);
869
- Cartesian3_default.add(corner, east, corner);
870
- corner = positions[5];
871
- Cartesian3_default.add(normal, north, corner);
872
- Cartesian3_default.add(corner, west, corner);
873
- corner = positions[6];
874
- Cartesian3_default.add(normal, south, corner);
875
- Cartesian3_default.add(corner, west, corner);
876
- corner = positions[7];
877
- Cartesian3_default.add(normal, south, corner);
878
- Cartesian3_default.add(corner, east, corner);
879
- const length = positions.length;
880
- for (let i = 0; i < length; ++i) {
881
- const position = positions[i];
882
- Cartesian3_default.add(center, position, position);
883
- const cartographic = ellipsoid.cartesianToCartographic(
884
- position,
885
- projectTo2DCartographicScratch
886
- );
887
- projection.project(cartographic, position);
888
- }
889
- result = BoundingSphere.fromPoints(positions, result);
890
- center = result.center;
891
- const x = center.x;
892
- const y = center.y;
893
- const z = center.z;
894
- center.x = z;
895
- center.y = x;
896
- center.z = y;
897
- return result;
898
- };
899
- BoundingSphere.isOccluded = function(sphere, occluder) {
900
- Check_default.typeOf.object("sphere", sphere);
901
- Check_default.typeOf.object("occluder", occluder);
902
- return !occluder.isBoundingSphereVisible(sphere);
903
- };
904
- BoundingSphere.equals = function(left, right) {
905
- return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && left.radius === right.radius;
906
- };
907
- BoundingSphere.prototype.intersectPlane = function(plane) {
908
- return BoundingSphere.intersectPlane(this, plane);
909
- };
910
- BoundingSphere.prototype.distanceSquaredTo = function(cartesian) {
911
- return BoundingSphere.distanceSquaredTo(this, cartesian);
912
- };
913
- BoundingSphere.prototype.computePlaneDistances = function(position, direction, result) {
914
- return BoundingSphere.computePlaneDistances(
915
- this,
916
- position,
917
- direction,
918
- result
919
- );
920
- };
921
- BoundingSphere.prototype.isOccluded = function(occluder) {
922
- return BoundingSphere.isOccluded(this, occluder);
923
- };
924
- BoundingSphere.prototype.equals = function(right) {
925
- return BoundingSphere.equals(this, right);
926
- };
927
- BoundingSphere.prototype.clone = function(result) {
928
- return BoundingSphere.clone(this, result);
929
- };
930
- BoundingSphere.prototype.volume = function() {
931
- const radius = this.radius;
932
- return volumeConstant * radius * radius * radius;
933
- };
934
- var BoundingSphere_default = BoundingSphere;
935
-
936
- export {
937
- GeographicProjection_default,
938
- Interval_default,
939
- BoundingSphere_default
940
- };