@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,497 +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
- Check_default,
28
- DeveloperError_default
29
- } from "./chunk-KH2OWUUA.js";
30
- import {
31
- __commonJS,
32
- __toESM,
33
- defined_default
34
- } from "./chunk-AVSQILVI.js";
35
-
36
- // node_modules/mersenne-twister/src/mersenne-twister.js
37
- var require_mersenne_twister = __commonJS({
38
- "node_modules/mersenne-twister/src/mersenne-twister.js"(exports, module) {
39
- var MersenneTwister2 = function(seed) {
40
- if (seed == void 0) {
41
- seed = (/* @__PURE__ */ new Date()).getTime();
42
- }
43
- this.N = 624;
44
- this.M = 397;
45
- this.MATRIX_A = 2567483615;
46
- this.UPPER_MASK = 2147483648;
47
- this.LOWER_MASK = 2147483647;
48
- this.mt = new Array(this.N);
49
- this.mti = this.N + 1;
50
- if (seed.constructor == Array) {
51
- this.init_by_array(seed, seed.length);
52
- } else {
53
- this.init_seed(seed);
54
- }
55
- };
56
- MersenneTwister2.prototype.init_seed = function(s) {
57
- this.mt[0] = s >>> 0;
58
- for (this.mti = 1; this.mti < this.N; this.mti++) {
59
- var s = this.mt[this.mti - 1] ^ this.mt[this.mti - 1] >>> 30;
60
- this.mt[this.mti] = (((s & 4294901760) >>> 16) * 1812433253 << 16) + (s & 65535) * 1812433253 + this.mti;
61
- this.mt[this.mti] >>>= 0;
62
- }
63
- };
64
- MersenneTwister2.prototype.init_by_array = function(init_key, key_length) {
65
- var i, j, k;
66
- this.init_seed(19650218);
67
- i = 1;
68
- j = 0;
69
- k = this.N > key_length ? this.N : key_length;
70
- for (; k; k--) {
71
- var s = this.mt[i - 1] ^ this.mt[i - 1] >>> 30;
72
- this.mt[i] = (this.mt[i] ^ (((s & 4294901760) >>> 16) * 1664525 << 16) + (s & 65535) * 1664525) + init_key[j] + j;
73
- this.mt[i] >>>= 0;
74
- i++;
75
- j++;
76
- if (i >= this.N) {
77
- this.mt[0] = this.mt[this.N - 1];
78
- i = 1;
79
- }
80
- if (j >= key_length) j = 0;
81
- }
82
- for (k = this.N - 1; k; k--) {
83
- var s = this.mt[i - 1] ^ this.mt[i - 1] >>> 30;
84
- this.mt[i] = (this.mt[i] ^ (((s & 4294901760) >>> 16) * 1566083941 << 16) + (s & 65535) * 1566083941) - i;
85
- this.mt[i] >>>= 0;
86
- i++;
87
- if (i >= this.N) {
88
- this.mt[0] = this.mt[this.N - 1];
89
- i = 1;
90
- }
91
- }
92
- this.mt[0] = 2147483648;
93
- };
94
- MersenneTwister2.prototype.random_int = function() {
95
- var y;
96
- var mag01 = new Array(0, this.MATRIX_A);
97
- if (this.mti >= this.N) {
98
- var kk;
99
- if (this.mti == this.N + 1)
100
- this.init_seed(5489);
101
- for (kk = 0; kk < this.N - this.M; kk++) {
102
- y = this.mt[kk] & this.UPPER_MASK | this.mt[kk + 1] & this.LOWER_MASK;
103
- this.mt[kk] = this.mt[kk + this.M] ^ y >>> 1 ^ mag01[y & 1];
104
- }
105
- for (; kk < this.N - 1; kk++) {
106
- y = this.mt[kk] & this.UPPER_MASK | this.mt[kk + 1] & this.LOWER_MASK;
107
- this.mt[kk] = this.mt[kk + (this.M - this.N)] ^ y >>> 1 ^ mag01[y & 1];
108
- }
109
- y = this.mt[this.N - 1] & this.UPPER_MASK | this.mt[0] & this.LOWER_MASK;
110
- this.mt[this.N - 1] = this.mt[this.M - 1] ^ y >>> 1 ^ mag01[y & 1];
111
- this.mti = 0;
112
- }
113
- y = this.mt[this.mti++];
114
- y ^= y >>> 11;
115
- y ^= y << 7 & 2636928640;
116
- y ^= y << 15 & 4022730752;
117
- y ^= y >>> 18;
118
- return y >>> 0;
119
- };
120
- MersenneTwister2.prototype.random_int31 = function() {
121
- return this.random_int() >>> 1;
122
- };
123
- MersenneTwister2.prototype.random_incl = function() {
124
- return this.random_int() * (1 / 4294967295);
125
- };
126
- MersenneTwister2.prototype.random = function() {
127
- return this.random_int() * (1 / 4294967296);
128
- };
129
- MersenneTwister2.prototype.random_excl = function() {
130
- return (this.random_int() + 0.5) * (1 / 4294967296);
131
- };
132
- MersenneTwister2.prototype.random_long = function() {
133
- var a = this.random_int() >>> 5, b = this.random_int() >>> 6;
134
- return (a * 67108864 + b) * (1 / 9007199254740992);
135
- };
136
- module.exports = MersenneTwister2;
137
- }
138
- });
139
-
140
- // packages/engine/Source/Core/Math.js
141
- var import_mersenne_twister = __toESM(require_mersenne_twister(), 1);
142
- var CesiumMath = {};
143
- CesiumMath.EPSILON1 = 0.1;
144
- CesiumMath.EPSILON2 = 0.01;
145
- CesiumMath.EPSILON3 = 1e-3;
146
- CesiumMath.EPSILON4 = 1e-4;
147
- CesiumMath.EPSILON5 = 1e-5;
148
- CesiumMath.EPSILON6 = 1e-6;
149
- CesiumMath.EPSILON7 = 1e-7;
150
- CesiumMath.EPSILON8 = 1e-8;
151
- CesiumMath.EPSILON9 = 1e-9;
152
- CesiumMath.EPSILON10 = 1e-10;
153
- CesiumMath.EPSILON11 = 1e-11;
154
- CesiumMath.EPSILON12 = 1e-12;
155
- CesiumMath.EPSILON13 = 1e-13;
156
- CesiumMath.EPSILON14 = 1e-14;
157
- CesiumMath.EPSILON15 = 1e-15;
158
- CesiumMath.EPSILON16 = 1e-16;
159
- CesiumMath.EPSILON17 = 1e-17;
160
- CesiumMath.EPSILON18 = 1e-18;
161
- CesiumMath.EPSILON19 = 1e-19;
162
- CesiumMath.EPSILON20 = 1e-20;
163
- CesiumMath.EPSILON21 = 1e-21;
164
- CesiumMath.GRAVITATIONALPARAMETER = 3986004418e5;
165
- CesiumMath.SOLAR_RADIUS = 6955e5;
166
- CesiumMath.LUNAR_RADIUS = 1737400;
167
- CesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;
168
- CesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;
169
- CesiumMath.sign = Math.sign ?? function sign(value) {
170
- value = +value;
171
- if (value === 0 || value !== value) {
172
- return value;
173
- }
174
- return value > 0 ? 1 : -1;
175
- };
176
- CesiumMath.signNotZero = function(value) {
177
- return value < 0 ? -1 : 1;
178
- };
179
- CesiumMath.toSNorm = function(value, rangeMaximum) {
180
- rangeMaximum = rangeMaximum ?? 255;
181
- return Math.round(
182
- (CesiumMath.clamp(value, -1, 1) * 0.5 + 0.5) * rangeMaximum
183
- );
184
- };
185
- CesiumMath.fromSNorm = function(value, rangeMaximum) {
186
- rangeMaximum = rangeMaximum ?? 255;
187
- return CesiumMath.clamp(value, 0, rangeMaximum) / rangeMaximum * 2 - 1;
188
- };
189
- CesiumMath.normalize = function(value, rangeMinimum, rangeMaximum) {
190
- rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0);
191
- return rangeMaximum === 0 ? 0 : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0, 1);
192
- };
193
- CesiumMath.sinh = Math.sinh ?? function sinh(value) {
194
- return (Math.exp(value) - Math.exp(-value)) / 2;
195
- };
196
- CesiumMath.cosh = Math.cosh ?? function cosh(value) {
197
- return (Math.exp(value) + Math.exp(-value)) / 2;
198
- };
199
- CesiumMath.lerp = function(p, q, time) {
200
- return (1 - time) * p + time * q;
201
- };
202
- CesiumMath.PI = Math.PI;
203
- CesiumMath.ONE_OVER_PI = 1 / Math.PI;
204
- CesiumMath.PI_OVER_TWO = Math.PI / 2;
205
- CesiumMath.PI_OVER_THREE = Math.PI / 3;
206
- CesiumMath.PI_OVER_FOUR = Math.PI / 4;
207
- CesiumMath.PI_OVER_SIX = Math.PI / 6;
208
- CesiumMath.THREE_PI_OVER_TWO = 3 * Math.PI / 2;
209
- CesiumMath.TWO_PI = 2 * Math.PI;
210
- CesiumMath.ONE_OVER_TWO_PI = 1 / (2 * Math.PI);
211
- CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180;
212
- CesiumMath.DEGREES_PER_RADIAN = 180 / Math.PI;
213
- CesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600;
214
- CesiumMath.toRadians = function(degrees) {
215
- if (!defined_default(degrees)) {
216
- throw new DeveloperError_default("degrees is required.");
217
- }
218
- return degrees * CesiumMath.RADIANS_PER_DEGREE;
219
- };
220
- CesiumMath.toDegrees = function(radians) {
221
- if (!defined_default(radians)) {
222
- throw new DeveloperError_default("radians is required.");
223
- }
224
- return radians * CesiumMath.DEGREES_PER_RADIAN;
225
- };
226
- CesiumMath.convertLongitudeRange = function(angle) {
227
- if (!defined_default(angle)) {
228
- throw new DeveloperError_default("angle is required.");
229
- }
230
- const twoPi = CesiumMath.TWO_PI;
231
- const simplified = angle - Math.floor(angle / twoPi) * twoPi;
232
- if (simplified < -Math.PI) {
233
- return simplified + twoPi;
234
- }
235
- if (simplified >= Math.PI) {
236
- return simplified - twoPi;
237
- }
238
- return simplified;
239
- };
240
- CesiumMath.clampToLatitudeRange = function(angle) {
241
- if (!defined_default(angle)) {
242
- throw new DeveloperError_default("angle is required.");
243
- }
244
- return CesiumMath.clamp(
245
- angle,
246
- -1 * CesiumMath.PI_OVER_TWO,
247
- CesiumMath.PI_OVER_TWO
248
- );
249
- };
250
- CesiumMath.negativePiToPi = function(angle) {
251
- if (!defined_default(angle)) {
252
- throw new DeveloperError_default("angle is required.");
253
- }
254
- if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {
255
- return angle;
256
- }
257
- return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;
258
- };
259
- CesiumMath.zeroToTwoPi = function(angle) {
260
- if (!defined_default(angle)) {
261
- throw new DeveloperError_default("angle is required.");
262
- }
263
- if (angle >= 0 && angle <= CesiumMath.TWO_PI) {
264
- return angle;
265
- }
266
- const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);
267
- if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) {
268
- return CesiumMath.TWO_PI;
269
- }
270
- return mod;
271
- };
272
- CesiumMath.mod = function(m, n) {
273
- if (!defined_default(m)) {
274
- throw new DeveloperError_default("m is required.");
275
- }
276
- if (!defined_default(n)) {
277
- throw new DeveloperError_default("n is required.");
278
- }
279
- if (n === 0) {
280
- throw new DeveloperError_default("divisor cannot be 0.");
281
- }
282
- if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {
283
- return m;
284
- }
285
- return (m % n + n) % n;
286
- };
287
- CesiumMath.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
288
- if (!defined_default(left)) {
289
- throw new DeveloperError_default("left is required.");
290
- }
291
- if (!defined_default(right)) {
292
- throw new DeveloperError_default("right is required.");
293
- }
294
- relativeEpsilon = relativeEpsilon ?? 0;
295
- absoluteEpsilon = absoluteEpsilon ?? relativeEpsilon;
296
- const absDiff = Math.abs(left - right);
297
- return absDiff <= absoluteEpsilon || absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right));
298
- };
299
- CesiumMath.lessThan = function(left, right, absoluteEpsilon) {
300
- if (!defined_default(left)) {
301
- throw new DeveloperError_default("first is required.");
302
- }
303
- if (!defined_default(right)) {
304
- throw new DeveloperError_default("second is required.");
305
- }
306
- if (!defined_default(absoluteEpsilon)) {
307
- throw new DeveloperError_default("absoluteEpsilon is required.");
308
- }
309
- return left - right < -absoluteEpsilon;
310
- };
311
- CesiumMath.lessThanOrEquals = function(left, right, absoluteEpsilon) {
312
- if (!defined_default(left)) {
313
- throw new DeveloperError_default("first is required.");
314
- }
315
- if (!defined_default(right)) {
316
- throw new DeveloperError_default("second is required.");
317
- }
318
- if (!defined_default(absoluteEpsilon)) {
319
- throw new DeveloperError_default("absoluteEpsilon is required.");
320
- }
321
- return left - right < absoluteEpsilon;
322
- };
323
- CesiumMath.greaterThan = function(left, right, absoluteEpsilon) {
324
- if (!defined_default(left)) {
325
- throw new DeveloperError_default("first is required.");
326
- }
327
- if (!defined_default(right)) {
328
- throw new DeveloperError_default("second is required.");
329
- }
330
- if (!defined_default(absoluteEpsilon)) {
331
- throw new DeveloperError_default("absoluteEpsilon is required.");
332
- }
333
- return left - right > absoluteEpsilon;
334
- };
335
- CesiumMath.greaterThanOrEquals = function(left, right, absoluteEpsilon) {
336
- if (!defined_default(left)) {
337
- throw new DeveloperError_default("first is required.");
338
- }
339
- if (!defined_default(right)) {
340
- throw new DeveloperError_default("second is required.");
341
- }
342
- if (!defined_default(absoluteEpsilon)) {
343
- throw new DeveloperError_default("absoluteEpsilon is required.");
344
- }
345
- return left - right > -absoluteEpsilon;
346
- };
347
- var factorials = [1];
348
- CesiumMath.factorial = function(n) {
349
- if (typeof n !== "number" || n < 0) {
350
- throw new DeveloperError_default(
351
- "A number greater than or equal to 0 is required."
352
- );
353
- }
354
- const length = factorials.length;
355
- if (n >= length) {
356
- let sum = factorials[length - 1];
357
- for (let i = length; i <= n; i++) {
358
- const next = sum * i;
359
- factorials.push(next);
360
- sum = next;
361
- }
362
- }
363
- return factorials[n];
364
- };
365
- CesiumMath.incrementWrap = function(n, maximumValue, minimumValue) {
366
- minimumValue = minimumValue ?? 0;
367
- if (!defined_default(n)) {
368
- throw new DeveloperError_default("n is required.");
369
- }
370
- if (maximumValue <= minimumValue) {
371
- throw new DeveloperError_default("maximumValue must be greater than minimumValue.");
372
- }
373
- ++n;
374
- if (n > maximumValue) {
375
- n = minimumValue;
376
- }
377
- return n;
378
- };
379
- CesiumMath.isPowerOfTwo = function(n) {
380
- if (typeof n !== "number" || n < 0 || n > 4294967295) {
381
- throw new DeveloperError_default("A number between 0 and (2^32)-1 is required.");
382
- }
383
- return n !== 0 && (n & n - 1) === 0;
384
- };
385
- CesiumMath.nextPowerOfTwo = function(n) {
386
- if (typeof n !== "number" || n < 0 || n > 2147483648) {
387
- throw new DeveloperError_default("A number between 0 and 2^31 is required.");
388
- }
389
- --n;
390
- n |= n >> 1;
391
- n |= n >> 2;
392
- n |= n >> 4;
393
- n |= n >> 8;
394
- n |= n >> 16;
395
- ++n;
396
- return n;
397
- };
398
- CesiumMath.previousPowerOfTwo = function(n) {
399
- if (typeof n !== "number" || n < 0 || n > 4294967295) {
400
- throw new DeveloperError_default("A number between 0 and (2^32)-1 is required.");
401
- }
402
- n |= n >> 1;
403
- n |= n >> 2;
404
- n |= n >> 4;
405
- n |= n >> 8;
406
- n |= n >> 16;
407
- n |= n >> 32;
408
- n = (n >>> 0) - (n >>> 1);
409
- return n;
410
- };
411
- CesiumMath.clamp = function(value, min, max) {
412
- Check_default.typeOf.number("value", value);
413
- Check_default.typeOf.number("min", min);
414
- Check_default.typeOf.number("max", max);
415
- return value < min ? min : value > max ? max : value;
416
- };
417
- var randomNumberGenerator = new import_mersenne_twister.default();
418
- CesiumMath.setRandomNumberSeed = function(seed) {
419
- if (!defined_default(seed)) {
420
- throw new DeveloperError_default("seed is required.");
421
- }
422
- randomNumberGenerator = new import_mersenne_twister.default(seed);
423
- };
424
- CesiumMath.nextRandomNumber = function() {
425
- return randomNumberGenerator.random();
426
- };
427
- CesiumMath.randomBetween = function(min, max) {
428
- return CesiumMath.nextRandomNumber() * (max - min) + min;
429
- };
430
- CesiumMath.acosClamped = function(value) {
431
- if (!defined_default(value)) {
432
- throw new DeveloperError_default("value is required.");
433
- }
434
- return Math.acos(CesiumMath.clamp(value, -1, 1));
435
- };
436
- CesiumMath.asinClamped = function(value) {
437
- if (!defined_default(value)) {
438
- throw new DeveloperError_default("value is required.");
439
- }
440
- return Math.asin(CesiumMath.clamp(value, -1, 1));
441
- };
442
- CesiumMath.chordLength = function(angle, radius) {
443
- if (!defined_default(angle)) {
444
- throw new DeveloperError_default("angle is required.");
445
- }
446
- if (!defined_default(radius)) {
447
- throw new DeveloperError_default("radius is required.");
448
- }
449
- return 2 * radius * Math.sin(angle * 0.5);
450
- };
451
- CesiumMath.logBase = function(number, base) {
452
- if (!defined_default(number)) {
453
- throw new DeveloperError_default("number is required.");
454
- }
455
- if (!defined_default(base)) {
456
- throw new DeveloperError_default("base is required.");
457
- }
458
- return Math.log(number) / Math.log(base);
459
- };
460
- CesiumMath.cbrt = Math.cbrt ?? function cbrt(number) {
461
- const result = Math.pow(Math.abs(number), 1 / 3);
462
- return number < 0 ? -result : result;
463
- };
464
- CesiumMath.log2 = Math.log2 ?? function log2(number) {
465
- return Math.log(number) * Math.LOG2E;
466
- };
467
- CesiumMath.fog = function(distanceToCamera, density) {
468
- const scalar = distanceToCamera * density;
469
- return 1 - Math.exp(-(scalar * scalar));
470
- };
471
- CesiumMath.fastApproximateAtan = function(x) {
472
- Check_default.typeOf.number("x", x);
473
- return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);
474
- };
475
- CesiumMath.fastApproximateAtan2 = function(x, y) {
476
- Check_default.typeOf.number("x", x);
477
- Check_default.typeOf.number("y", y);
478
- let opposite;
479
- let t = Math.abs(x);
480
- opposite = Math.abs(y);
481
- const adjacent = Math.max(t, opposite);
482
- opposite = Math.min(t, opposite);
483
- const oppositeOverAdjacent = opposite / adjacent;
484
- if (isNaN(oppositeOverAdjacent)) {
485
- throw new DeveloperError_default("either x or y must be nonzero");
486
- }
487
- t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);
488
- t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;
489
- t = x < 0 ? CesiumMath.PI - t : t;
490
- t = y < 0 ? -t : t;
491
- return t;
492
- };
493
- var Math_default = CesiumMath;
494
-
495
- export {
496
- Math_default
497
- };
@@ -1,102 +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
- Cartesian3_default
28
- } from "./chunk-QWV2DM66.js";
29
- import {
30
- Check_default
31
- } from "./chunk-KH2OWUUA.js";
32
- import {
33
- defined_default
34
- } from "./chunk-AVSQILVI.js";
35
-
36
- // packages/engine/Source/Core/EncodedCartesian3.js
37
- function EncodedCartesian3() {
38
- this.high = Cartesian3_default.clone(Cartesian3_default.ZERO);
39
- this.low = Cartesian3_default.clone(Cartesian3_default.ZERO);
40
- }
41
- EncodedCartesian3.encode = function(value, result) {
42
- Check_default.typeOf.number("value", value);
43
- if (!defined_default(result)) {
44
- result = {
45
- high: 0,
46
- low: 0
47
- };
48
- }
49
- let doubleHigh;
50
- if (value >= 0) {
51
- doubleHigh = Math.floor(value / 65536) * 65536;
52
- result.high = doubleHigh;
53
- result.low = value - doubleHigh;
54
- } else {
55
- doubleHigh = Math.floor(-value / 65536) * 65536;
56
- result.high = -doubleHigh;
57
- result.low = value + doubleHigh;
58
- }
59
- return result;
60
- };
61
- var scratchEncode = {
62
- high: 0,
63
- low: 0
64
- };
65
- EncodedCartesian3.fromCartesian = function(cartesian, result) {
66
- Check_default.typeOf.object("cartesian", cartesian);
67
- if (!defined_default(result)) {
68
- result = new EncodedCartesian3();
69
- }
70
- const high = result.high;
71
- const low = result.low;
72
- EncodedCartesian3.encode(cartesian.x, scratchEncode);
73
- high.x = scratchEncode.high;
74
- low.x = scratchEncode.low;
75
- EncodedCartesian3.encode(cartesian.y, scratchEncode);
76
- high.y = scratchEncode.high;
77
- low.y = scratchEncode.low;
78
- EncodedCartesian3.encode(cartesian.z, scratchEncode);
79
- high.z = scratchEncode.high;
80
- low.z = scratchEncode.low;
81
- return result;
82
- };
83
- var encodedP = new EncodedCartesian3();
84
- EncodedCartesian3.writeElements = function(cartesian, cartesianArray, index) {
85
- Check_default.defined("cartesianArray", cartesianArray);
86
- Check_default.typeOf.number("index", index);
87
- Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
88
- EncodedCartesian3.fromCartesian(cartesian, encodedP);
89
- const high = encodedP.high;
90
- const low = encodedP.low;
91
- cartesianArray[index] = high.x;
92
- cartesianArray[index + 1] = high.y;
93
- cartesianArray[index + 2] = high.z;
94
- cartesianArray[index + 3] = low.x;
95
- cartesianArray[index + 4] = low.y;
96
- cartesianArray[index + 5] = low.z;
97
- };
98
- var EncodedCartesian3_default = EncodedCartesian3;
99
-
100
- export {
101
- EncodedCartesian3_default
102
- };