@takram/three-geospatial 0.0.1-alpha.5 → 0.0.1-alpha.6

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.
package/build/index.js CHANGED
@@ -1,654 +1,188 @@
1
- var Pt = Object.defineProperty;
2
- var Ot = (t, e, n) => e in t ? Pt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var l = (t, e, n) => Ot(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { Loader as H, FileLoader as It, BufferAttribute as J, Box3 as Mt, Vector3 as p, Sphere as zt, BufferGeometry as Et, UnsignedByteType as Ct, ByteType as Dt, FloatType as Lt, Data3DTexture as Ft, DataTexture as Nt, RGBAFormat as Ut, ClampToEdgeWrapping as k, LinearFilter as tt, MathUtils as u, Matrix4 as $t, Quaternion as jt, Ray as Gt, Vector2 as ut } from "three";
5
- import { E as et, G as _ } from "./shared.js";
6
- import { a as Lr } from "./shared.js";
7
- var Rt = `float reverseLogDepth(const float depth, const float near, const float far) {
8
- #ifdef USE_LOGDEPTHBUF
9
- float d = pow(2.0, depth * log2(far + 1.0)) - 1.0;
10
- float a = far / (far - near);
11
- float b = far * near / (near - far);
12
- return a + b / d;
13
- #else
14
- return depth;
15
- #endif
16
- }
17
-
18
- float linearizeDepth(const float depth, const float near, const float far) {
19
- float ndc = depth * 2.0 - 1.0;
20
- return 2.0 * near * far / (far + near - ndc * (far - near));
21
- }`, Ht = `vec2 signNotZero(vec2 v) {
22
- return vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0);
23
- }
24
-
25
- vec2 packNormalToVec2(vec3 v) {
26
- vec2 p = v.xy * (1.0 / (abs(v.x) + abs(v.y) + abs(v.z)));
27
- return v.z <= 0.0
28
- ? (1.0 - abs(p.yx)) * signNotZero(p)
29
- : p;
30
- }
31
-
32
- vec3 unpackVec2ToNormal(vec2 e) {
33
- vec3 v = vec3(e.xy, 1.0 - abs(e.x) - abs(e.y));
34
- if (v.z < 0.0) {
35
- v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy);
36
- }
37
- return normalize(v);
38
- }`, Bt = `vec3 screenToView(
39
- const vec2 uv,
40
- const float depth,
41
- const float viewZ,
42
- const mat4 projectionMatrix,
43
- const mat4 inverseProjectionMatrix
44
- ) {
45
- vec4 clip = vec4(vec3(uv, depth) * 2.0 - 1.0, 1.0);
46
- float clipW = projectionMatrix[2][3] * viewZ + projectionMatrix[3][3];
47
- clip *= clipW;
48
- return (inverseProjectionMatrix * clip).xyz;
49
- }`, qt = process.env.NODE_ENV === "production", nt = "Invariant failed";
50
- function dt(t, e) {
51
- if (!t) {
52
- if (qt)
53
- throw new Error(nt);
54
- var n = nt;
55
- throw new Error(n);
56
- }
57
- }
58
- class Vt extends H {
59
- load(e, n, r, i) {
60
- const a = new It(this.manager);
61
- a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
62
- e,
63
- (s) => {
64
- dt(s instanceof ArrayBuffer);
1
+ var k = Object.defineProperty;
2
+ var Q = (s, t, e) => t in s ? k(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var l = (s, t, e) => Q(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { Loader as b, FileLoader as Y, BufferAttribute as F, Box3 as $, Vector3 as p, Sphere as J, BufferGeometry as K, UnsignedByteType as Z, ByteType as tt, FloatType as et, Data3DTexture as st, DataTexture as nt, RGBAFormat as it, ClampToEdgeWrapping as v, LinearFilter as _, MathUtils as d, Matrix4 as rt, Quaternion as ot, Ray as at, Vector2 as C } from "three";
5
+ import { E as B, G as w } from "./shared.js";
6
+ import { a as ce } from "./shared.js";
7
+ var ht = process.env.NODE_ENV === "production", N = "Invariant failed";
8
+ function R(s, t) {
9
+ if (!s) {
10
+ if (ht)
11
+ throw new Error(N);
12
+ var e = N;
13
+ throw new Error(e);
14
+ }
15
+ }
16
+ class ct extends b {
17
+ load(t, e, n, i) {
18
+ const r = new Y(this.manager);
19
+ r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setPath(this.path), r.setWithCredentials(this.withCredentials), r.load(
20
+ t,
21
+ (o) => {
22
+ R(o instanceof ArrayBuffer);
65
23
  try {
66
- n(s);
67
- } catch (o) {
68
- i != null ? i(o) : console.error(o), this.manager.itemError(e);
24
+ e(o);
25
+ } catch (a) {
26
+ i != null ? i(a) : console.error(a), this.manager.itemError(t);
69
27
  }
70
28
  },
71
- r,
29
+ n,
72
30
  i
73
31
  );
74
32
  }
75
33
  }
76
- function Jn(t) {
77
- }
78
- var Wt = typeof global == "object" && global && global.Object === Object && global, Xt = typeof self == "object" && self && self.Object === Object && self, B = Wt || Xt || Function("return this")(), y = B.Symbol, ft = Object.prototype, Zt = ft.hasOwnProperty, Yt = ft.toString, b = y ? y.toStringTag : void 0;
79
- function Kt(t) {
80
- var e = Zt.call(t, b), n = t[b];
81
- try {
82
- t[b] = void 0;
83
- var r = !0;
84
- } catch {
85
- }
86
- var i = Yt.call(t);
87
- return r && (e ? t[b] = n : delete t[b]), i;
88
- }
89
- var Qt = Object.prototype, Jt = Qt.toString;
90
- function kt(t) {
91
- return Jt.call(t);
92
- }
93
- var te = "[object Null]", ee = "[object Undefined]", rt = y ? y.toStringTag : void 0;
94
- function q(t) {
95
- return t == null ? t === void 0 ? ee : te : rt && rt in Object(t) ? Kt(t) : kt(t);
96
- }
97
- function V(t) {
98
- return t != null && typeof t == "object";
99
- }
100
- var ne = "[object Symbol]";
101
- function W(t) {
102
- return typeof t == "symbol" || V(t) && q(t) == ne;
103
- }
104
- function re(t, e) {
105
- for (var n = -1, r = t == null ? 0 : t.length, i = Array(r); ++n < r; )
106
- i[n] = e(t[n], n, t);
107
- return i;
108
- }
109
- var O = Array.isArray, ie = 1 / 0, it = y ? y.prototype : void 0, at = it ? it.toString : void 0;
110
- function pt(t) {
111
- if (typeof t == "string")
112
- return t;
113
- if (O(t))
114
- return re(t, pt) + "";
115
- if (W(t))
116
- return at ? at.call(t) : "";
117
- var e = t + "";
118
- return e == "0" && 1 / t == -ie ? "-0" : e;
119
- }
120
- function E(t) {
121
- var e = typeof t;
122
- return t != null && (e == "object" || e == "function");
123
- }
124
- function ae(t) {
125
- return t;
126
- }
127
- var se = "[object AsyncFunction]", oe = "[object Function]", ce = "[object GeneratorFunction]", he = "[object Proxy]";
128
- function le(t) {
129
- if (!E(t))
130
- return !1;
131
- var e = q(t);
132
- return e == oe || e == ce || e == se || e == he;
133
- }
134
- var j = B["__core-js_shared__"], st = function() {
135
- var t = /[^.]+$/.exec(j && j.keys && j.keys.IE_PROTO || "");
136
- return t ? "Symbol(src)_1." + t : "";
137
- }();
138
- function ue(t) {
139
- return !!st && st in t;
140
- }
141
- var de = Function.prototype, fe = de.toString;
142
- function pe(t) {
143
- if (t != null) {
144
- try {
145
- return fe.call(t);
146
- } catch {
147
- }
148
- try {
149
- return t + "";
150
- } catch {
151
- }
152
- }
153
- return "";
154
- }
155
- var ye = /[\\^$.*+?()[\]{}|]/g, ge = /^\[object .+?Constructor\]$/, we = Function.prototype, me = Object.prototype, ve = we.toString, xe = me.hasOwnProperty, _e = RegExp(
156
- "^" + ve.call(xe).replace(ye, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
157
- );
158
- function be(t) {
159
- if (!E(t) || ue(t))
160
- return !1;
161
- var e = le(t) ? _e : ge;
162
- return e.test(pe(t));
163
- }
164
- function Te(t, e) {
165
- return t == null ? void 0 : t[e];
166
- }
167
- function X(t, e) {
168
- var n = Te(t, e);
169
- return be(n) ? n : void 0;
170
- }
171
- function Se(t, e, n) {
172
- switch (n.length) {
173
- case 0:
174
- return t.call(e);
175
- case 1:
176
- return t.call(e, n[0]);
177
- case 2:
178
- return t.call(e, n[0], n[1]);
179
- case 3:
180
- return t.call(e, n[0], n[1], n[2]);
181
- }
182
- return t.apply(e, n);
183
- }
184
- var Ae = 800, Pe = 16, Oe = Date.now;
185
- function Ie(t) {
186
- var e = 0, n = 0;
187
- return function() {
188
- var r = Oe(), i = Pe - (r - n);
189
- if (n = r, i > 0) {
190
- if (++e >= Ae)
191
- return arguments[0];
192
- } else
193
- e = 0;
194
- return t.apply(void 0, arguments);
195
- };
196
- }
197
- function Me(t) {
198
- return function() {
199
- return t;
200
- };
201
- }
202
- var C = function() {
203
- try {
204
- var t = X(Object, "defineProperty");
205
- return t({}, "", {}), t;
206
- } catch {
207
- }
208
- }(), ze = C ? function(t, e) {
209
- return C(t, "toString", {
210
- configurable: !0,
211
- enumerable: !1,
212
- value: Me(e),
213
- writable: !0
214
- });
215
- } : ae, Ee = Ie(ze), Ce = 9007199254740991, De = /^(?:0|[1-9]\d*)$/;
216
- function yt(t, e) {
217
- var n = typeof t;
218
- return e = e ?? Ce, !!e && (n == "number" || n != "symbol" && De.test(t)) && t > -1 && t % 1 == 0 && t < e;
219
- }
220
- function Le(t, e, n) {
221
- e == "__proto__" && C ? C(t, e, {
222
- configurable: !0,
223
- enumerable: !0,
224
- value: n,
225
- writable: !0
226
- }) : t[e] = n;
227
- }
228
- function gt(t, e) {
229
- return t === e || t !== t && e !== e;
230
- }
231
- var Fe = Object.prototype, Ne = Fe.hasOwnProperty;
232
- function Ue(t, e, n) {
233
- var r = t[e];
234
- (!(Ne.call(t, e) && gt(r, n)) || n === void 0 && !(e in t)) && Le(t, e, n);
235
- }
236
- var ot = Math.max;
237
- function $e(t, e, n) {
238
- return e = ot(e === void 0 ? t.length - 1 : e, 0), function() {
239
- for (var r = arguments, i = -1, a = ot(r.length - e, 0), s = Array(a); ++i < a; )
240
- s[i] = r[e + i];
241
- i = -1;
242
- for (var o = Array(e + 1); ++i < e; )
243
- o[i] = r[i];
244
- return o[e] = n(s), Se(t, this, o);
245
- };
246
- }
247
- var je = 9007199254740991;
248
- function Ge(t) {
249
- return typeof t == "number" && t > -1 && t % 1 == 0 && t <= je;
250
- }
251
- var Re = "[object Arguments]";
252
- function ct(t) {
253
- return V(t) && q(t) == Re;
254
- }
255
- var wt = Object.prototype, He = wt.hasOwnProperty, Be = wt.propertyIsEnumerable, mt = ct(/* @__PURE__ */ function() {
256
- return arguments;
257
- }()) ? ct : function(t) {
258
- return V(t) && He.call(t, "callee") && !Be.call(t, "callee");
259
- }, qe = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ve = /^\w*$/;
260
- function We(t, e) {
261
- if (O(t))
262
- return !1;
263
- var n = typeof t;
264
- return n == "number" || n == "symbol" || n == "boolean" || t == null || W(t) ? !0 : Ve.test(t) || !qe.test(t) || e != null && t in Object(e);
265
- }
266
- var A = X(Object, "create");
267
- function Xe() {
268
- this.__data__ = A ? A(null) : {}, this.size = 0;
269
- }
270
- function Ze(t) {
271
- var e = this.has(t) && delete this.__data__[t];
272
- return this.size -= e ? 1 : 0, e;
273
- }
274
- var Ye = "__lodash_hash_undefined__", Ke = Object.prototype, Qe = Ke.hasOwnProperty;
275
- function Je(t) {
276
- var e = this.__data__;
277
- if (A) {
278
- var n = e[t];
279
- return n === Ye ? void 0 : n;
280
- }
281
- return Qe.call(e, t) ? e[t] : void 0;
282
- }
283
- var ke = Object.prototype, tn = ke.hasOwnProperty;
284
- function en(t) {
285
- var e = this.__data__;
286
- return A ? e[t] !== void 0 : tn.call(e, t);
287
- }
288
- var nn = "__lodash_hash_undefined__";
289
- function rn(t, e) {
290
- var n = this.__data__;
291
- return this.size += this.has(t) ? 0 : 1, n[t] = A && e === void 0 ? nn : e, this;
292
- }
293
- function w(t) {
294
- var e = -1, n = t == null ? 0 : t.length;
295
- for (this.clear(); ++e < n; ) {
296
- var r = t[e];
297
- this.set(r[0], r[1]);
298
- }
299
- }
300
- w.prototype.clear = Xe;
301
- w.prototype.delete = Ze;
302
- w.prototype.get = Je;
303
- w.prototype.has = en;
304
- w.prototype.set = rn;
305
- function an() {
306
- this.__data__ = [], this.size = 0;
307
- }
308
- function L(t, e) {
309
- for (var n = t.length; n--; )
310
- if (gt(t[n][0], e))
311
- return n;
312
- return -1;
313
- }
314
- var sn = Array.prototype, on = sn.splice;
315
- function cn(t) {
316
- var e = this.__data__, n = L(e, t);
317
- if (n < 0)
318
- return !1;
319
- var r = e.length - 1;
320
- return n == r ? e.pop() : on.call(e, n, 1), --this.size, !0;
321
- }
322
- function hn(t) {
323
- var e = this.__data__, n = L(e, t);
324
- return n < 0 ? void 0 : e[n][1];
325
- }
326
- function ln(t) {
327
- return L(this.__data__, t) > -1;
328
- }
329
- function un(t, e) {
330
- var n = this.__data__, r = L(n, t);
331
- return r < 0 ? (++this.size, n.push([t, e])) : n[r][1] = e, this;
332
- }
333
- function x(t) {
334
- var e = -1, n = t == null ? 0 : t.length;
335
- for (this.clear(); ++e < n; ) {
336
- var r = t[e];
337
- this.set(r[0], r[1]);
338
- }
339
- }
340
- x.prototype.clear = an;
341
- x.prototype.delete = cn;
342
- x.prototype.get = hn;
343
- x.prototype.has = ln;
344
- x.prototype.set = un;
345
- var dn = X(B, "Map");
346
- function fn() {
347
- this.size = 0, this.__data__ = {
348
- hash: new w(),
349
- map: new (dn || x)(),
350
- string: new w()
351
- };
34
+ function It(s) {
352
35
  }
353
- function pn(t) {
354
- var e = typeof t;
355
- return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
356
- }
357
- function F(t, e) {
358
- var n = t.__data__;
359
- return pn(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
360
- }
361
- function yn(t) {
362
- var e = F(this, t).delete(t);
363
- return this.size -= e ? 1 : 0, e;
364
- }
365
- function gn(t) {
366
- return F(this, t).get(t);
367
- }
368
- function wn(t) {
369
- return F(this, t).has(t);
370
- }
371
- function mn(t, e) {
372
- var n = F(this, t), r = n.size;
373
- return n.set(t, e), this.size += n.size == r ? 0 : 1, this;
374
- }
375
- function m(t) {
376
- var e = -1, n = t == null ? 0 : t.length;
377
- for (this.clear(); ++e < n; ) {
378
- var r = t[e];
379
- this.set(r[0], r[1]);
380
- }
381
- }
382
- m.prototype.clear = fn;
383
- m.prototype.delete = yn;
384
- m.prototype.get = gn;
385
- m.prototype.has = wn;
386
- m.prototype.set = mn;
387
- var vn = "Expected a function";
388
- function Z(t, e) {
389
- if (typeof t != "function" || e != null && typeof e != "function")
390
- throw new TypeError(vn);
391
- var n = function() {
392
- var r = arguments, i = e ? e.apply(this, r) : r[0], a = n.cache;
393
- if (a.has(i))
394
- return a.get(i);
395
- var s = t.apply(this, r);
396
- return n.cache = a.set(i, s) || a, s;
397
- };
398
- return n.cache = new (Z.Cache || m)(), n;
399
- }
400
- Z.Cache = m;
401
- var xn = 500;
402
- function _n(t) {
403
- var e = Z(t, function(r) {
404
- return n.size === xn && n.clear(), r;
405
- }), n = e.cache;
406
- return e;
407
- }
408
- var bn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Tn = /\\(\\)?/g, Sn = _n(function(t) {
409
- var e = [];
410
- return t.charCodeAt(0) === 46 && e.push(""), t.replace(bn, function(n, r, i, a) {
411
- e.push(i ? a.replace(Tn, "$1") : r || n);
412
- }), e;
413
- });
414
- function An(t) {
415
- return t == null ? "" : pt(t);
416
- }
417
- function N(t, e) {
418
- return O(t) ? t : We(t, e) ? [t] : Sn(An(t));
419
- }
420
- var Pn = 1 / 0;
421
- function Y(t) {
422
- if (typeof t == "string" || W(t))
423
- return t;
424
- var e = t + "";
425
- return e == "0" && 1 / t == -Pn ? "-0" : e;
426
- }
427
- function On(t, e) {
428
- e = N(e, t);
429
- for (var n = 0, r = e.length; t != null && n < r; )
430
- t = t[Y(e[n++])];
431
- return n && n == r ? t : void 0;
432
- }
433
- function In(t, e) {
434
- for (var n = -1, r = e.length, i = t.length; ++n < r; )
435
- t[i + n] = e[n];
436
- return t;
437
- }
438
- var ht = y ? y.isConcatSpreadable : void 0;
439
- function Mn(t) {
440
- return O(t) || mt(t) || !!(ht && t && t[ht]);
441
- }
442
- function zn(t, e, n, r, i) {
443
- var a = -1, s = t.length;
444
- for (n || (n = Mn), i || (i = []); ++a < s; ) {
445
- var o = t[a];
446
- n(o) ? In(i, o) : i[i.length] = o;
447
- }
448
- return i;
449
- }
450
- function En(t) {
451
- var e = t == null ? 0 : t.length;
452
- return e ? zn(t) : [];
453
- }
454
- function Cn(t) {
455
- return Ee($e(t, void 0, En), t + "");
456
- }
457
- function Dn(t, e) {
458
- return t != null && e in Object(t);
459
- }
460
- function Ln(t, e, n) {
461
- e = N(e, t);
462
- for (var r = -1, i = e.length, a = !1; ++r < i; ) {
463
- var s = Y(e[r]);
464
- if (!(a = t != null && n(t, s)))
465
- break;
466
- t = t[s];
467
- }
468
- return a || ++r != i ? a : (i = t == null ? 0 : t.length, !!i && Ge(i) && yt(s, i) && (O(t) || mt(t)));
469
- }
470
- function Fn(t, e) {
471
- return t != null && Ln(t, e, Dn);
472
- }
473
- function Nn(t, e, n, r) {
474
- if (!E(t))
475
- return t;
476
- e = N(e, t);
477
- for (var i = -1, a = e.length, s = a - 1, o = t; o != null && ++i < a; ) {
478
- var c = Y(e[i]), h = n;
479
- if (c === "__proto__" || c === "constructor" || c === "prototype")
480
- return t;
481
- if (i != s) {
482
- var d = o[c];
483
- h = void 0, h === void 0 && (h = E(d) ? d : yt(e[i + 1]) ? [] : {});
484
- }
485
- Ue(o, c, h), o = o[c];
486
- }
487
- return t;
488
- }
489
- function Un(t, e, n) {
490
- for (var r = -1, i = e.length, a = {}; ++r < i; ) {
491
- var s = e[r], o = On(t, s);
492
- n(o, s) && Nn(a, N(s, t), o);
493
- }
494
- return a;
495
- }
496
- function $n(t, e) {
497
- return Un(t, e, function(n, r) {
498
- return Fn(t, r);
499
- });
500
- }
501
- var jn = Cn(function(t, e) {
502
- return t == null ? {} : $n(t, e);
503
- });
504
- function kn(t) {
505
- var e;
36
+ function Dt(s) {
37
+ var r;
38
+ const { attributes: t, index: e, boundingBox: n, boundingSphere: i } = s;
506
39
  return [
507
- jn(t, ["attributes", "index", "boundingBox", "boundingSphere"]),
40
+ { attributes: t, index: e, boundingBox: n, boundingSphere: i },
508
41
  [
509
- ...Object.values(t.attributes).map(
510
- (n) => n.array.buffer
42
+ ...Object.values(s.attributes).map(
43
+ (o) => o.array.buffer
511
44
  ),
512
- (e = t.index) == null ? void 0 : e.array.buffer
513
- ].filter((n) => n != null)
45
+ (r = s.index) == null ? void 0 : r.array.buffer
46
+ ].filter((o) => o != null)
514
47
  ];
515
48
  }
516
- function tr(t, e = new Et()) {
517
- for (const [n, r] of Object.entries(t.attributes))
518
- e.setAttribute(
519
- n,
520
- new J(
521
- r.array,
522
- r.itemSize,
523
- r.normalized
49
+ function zt(s, t = new K()) {
50
+ for (const [e, n] of Object.entries(s.attributes))
51
+ t.setAttribute(
52
+ e,
53
+ new F(
54
+ n.array,
55
+ n.itemSize,
56
+ n.normalized
524
57
  )
525
58
  );
526
- if (e.index = t.index != null ? new J(
527
- t.index.array,
528
- t.index.itemSize,
529
- t.index.normalized
530
- ) : null, t.boundingBox != null) {
531
- const { min: n, max: r } = t.boundingBox;
532
- e.boundingBox = new Mt(
533
- new p(n.x, n.y, n.z),
534
- new p(r.x, r.y, r.z)
59
+ if (t.index = s.index != null ? new F(
60
+ s.index.array,
61
+ s.index.itemSize,
62
+ s.index.normalized
63
+ ) : null, s.boundingBox != null) {
64
+ const { min: e, max: n } = s.boundingBox;
65
+ t.boundingBox = new $(
66
+ new p(e.x, e.y, e.z),
67
+ new p(n.x, n.y, n.z)
535
68
  );
536
69
  }
537
- if (t.boundingSphere != null) {
538
- const { center: n, radius: r } = t.boundingSphere;
539
- e.boundingSphere = new zt(
540
- new p(n.x, n.y, n.z),
541
- r
70
+ if (s.boundingSphere != null) {
71
+ const { center: e, radius: n } = s.boundingSphere;
72
+ t.boundingSphere = new J(
73
+ new p(e.x, e.y, e.z),
74
+ n
542
75
  );
543
76
  }
544
- return e;
545
- }
546
- function Gn(t) {
547
- const e = t instanceof Int8Array ? "int8" : t instanceof Uint8Array || t instanceof Uint8ClampedArray ? "uint8" : t instanceof Int16Array ? "int16" : t instanceof Uint16Array ? "uint16" : t instanceof Int32Array ? "int32" : t instanceof Uint32Array ? "uint32" : t instanceof Float32Array ? "float32" : t instanceof Float64Array ? "float64" : null;
548
- return dt(e != null), e;
549
- }
550
- function g(t, e, n, r = !0) {
551
- const i = new DataView(t), a = new e(i.byteLength / e.BYTES_PER_ELEMENT);
552
- for (let s = 0, o = 0; s < a.length; ++s, o += e.BYTES_PER_ELEMENT)
553
- a[s] = i[n](o, r);
554
- return a;
77
+ return t;
555
78
  }
556
- const er = (t, e) => g(t, Uint8Array, "getUint8", e), nr = (t, e) => g(t, Int8Array, "getInt8", e), vt = (t, e) => g(t, Uint16Array, "getUint16", e), xt = (t, e) => g(t, Int16Array, "getInt16", e), rr = (t, e) => g(t, Int32Array, "getInt32", e), ir = (t, e) => g(t, Uint32Array, "getUint32", e), K = (t, e) => g(t, Float32Array, "getFloat32", e), ar = (t, e) => g(t, Float64Array, "getFloat64", e);
557
- class Rn extends H {
558
- load(e, n, r, i) {
559
- const a = new Vt(this.manager);
560
- a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
561
- e,
562
- (s) => {
79
+ const bt = 128, Ut = 128, Pt = 64;
80
+ function lt(s) {
81
+ const t = s instanceof Int8Array ? "int8" : s instanceof Uint8Array || s instanceof Uint8ClampedArray ? "uint8" : s instanceof Int16Array ? "int16" : s instanceof Uint16Array ? "uint16" : s instanceof Int32Array ? "int32" : s instanceof Uint32Array ? "uint32" : s instanceof Float32Array ? "float32" : s instanceof Float64Array ? "float64" : null;
82
+ return R(t != null), t;
83
+ }
84
+ function y(s, t, e, n = !0) {
85
+ const i = new DataView(s), r = new t(i.byteLength / t.BYTES_PER_ELEMENT);
86
+ for (let o = 0, a = 0; o < r.length; ++o, a += t.BYTES_PER_ELEMENT)
87
+ r[o] = i[e](a, n);
88
+ return r;
89
+ }
90
+ const Ft = (s, t) => y(s, Uint8Array, "getUint8", t), vt = (s, t) => y(s, Int8Array, "getInt8", t), G = (s, t) => y(s, Uint16Array, "getUint16", t), q = (s, t) => y(s, Int16Array, "getInt16", t), _t = (s, t) => y(s, Int32Array, "getInt32", t), Bt = (s, t) => y(s, Uint32Array, "getUint32", t), U = (s, t) => y(s, Float32Array, "getFloat32", t), Nt = (s, t) => y(s, Float64Array, "getFloat64", t);
91
+ class dt extends b {
92
+ load(t, e, n, i) {
93
+ const r = new ct(this.manager);
94
+ r.setRequestHeader(this.requestHeader), r.setPath(this.path), r.setWithCredentials(this.withCredentials), r.load(
95
+ t,
96
+ (o) => {
563
97
  try {
564
- n(this.parseTypedArray(s));
565
- } catch (o) {
566
- i != null ? i(o) : console.error(o), this.manager.itemError(e);
98
+ e(this.parseTypedArray(o));
99
+ } catch (a) {
100
+ i != null ? i(a) : console.error(a), this.manager.itemError(t);
567
101
  }
568
102
  },
569
- r,
103
+ n,
570
104
  i
571
105
  );
572
106
  }
573
107
  }
574
- function I(t) {
575
- return class extends Rn {
108
+ function A(s) {
109
+ return class extends dt {
576
110
  constructor() {
577
111
  super(...arguments);
578
- l(this, "parseTypedArray", t);
112
+ l(this, "parseTypedArray", s);
579
113
  }
580
114
  };
581
115
  }
582
- function sr(t) {
583
- return new (I(t))();
116
+ function Ot(s) {
117
+ return new (A(s))();
584
118
  }
585
- const or = /* @__PURE__ */ I(xt), cr = /* @__PURE__ */ I(vt), hr = /* @__PURE__ */ I(K), Hn = {
586
- format: Ut,
587
- wrapS: k,
588
- wrapT: k,
589
- minFilter: tt,
590
- magFilter: tt
119
+ const Ct = /* @__PURE__ */ A(q), Rt = /* @__PURE__ */ A(G), Gt = /* @__PURE__ */ A(U), ut = {
120
+ format: it,
121
+ wrapS: v,
122
+ wrapT: v,
123
+ minFilter: _,
124
+ magFilter: _
591
125
  };
592
- class Bn extends H {
126
+ class pt extends b {
593
127
  constructor() {
594
128
  super(...arguments);
595
129
  l(this, "parameters", {});
596
130
  }
597
- load(n, r, i, a) {
598
- const s = new this.Texture(), o = new this.TypedArrayLoader(this.manager);
599
- o.setRequestHeader(this.requestHeader), o.setPath(this.path), o.setWithCredentials(this.withCredentials), o.load(
600
- n,
601
- (c) => {
602
- s.image.data = c;
603
- const { width: h, height: d, depth: v, ...$ } = this.parameters;
604
- h != null && (s.image.width = h), d != null && (s.image.height = d), "depth" in s.image && v != null && (s.image.depth = v);
605
- const Q = Gn(c);
606
- s.type = Q === "uint8" ? Ct : Q === "int8" ? Dt : Lt, Object.assign(s, $), s.needsUpdate = !0, r(s);
131
+ load(e, n, i, r) {
132
+ const o = new this.Texture(), a = new this.TypedArrayLoader(this.manager);
133
+ a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
134
+ e,
135
+ (h) => {
136
+ o.image.data = h;
137
+ const { width: c, height: f, depth: g, ...I } = this.parameters;
138
+ c != null && (o.image.width = c), f != null && (o.image.height = f), "depth" in o.image && g != null && (o.image.depth = g);
139
+ const P = lt(h);
140
+ o.type = P === "uint8" ? Z : P === "int8" ? tt : et, Object.assign(o, I), o.needsUpdate = !0, n(o);
607
141
  },
608
142
  i,
609
- a
143
+ r
610
144
  );
611
145
  }
612
146
  }
613
- function _t(t, e, n) {
614
- return class extends Bn {
147
+ function H(s, t, e) {
148
+ return class extends pt {
615
149
  constructor() {
616
150
  super(...arguments);
617
- l(this, "Texture", t);
618
- l(this, "TypedArrayLoader", I(e));
151
+ l(this, "Texture", s);
152
+ l(this, "TypedArrayLoader", A(t));
619
153
  l(this, "parameters", {
620
- ...Hn,
621
- ...n
154
+ ...ut,
155
+ ...e
622
156
  });
623
157
  }
624
158
  };
625
159
  }
626
- function bt(t, e) {
627
- return _t(Ft, t, e);
160
+ function X(s, t) {
161
+ return H(st, s, t);
628
162
  }
629
- function U(t, e) {
630
- return _t(Nt, t, e);
163
+ function E(s, t) {
164
+ return H(nt, s, t);
631
165
  }
632
- function lr(t, e) {
633
- return new (bt(t, e))();
166
+ function qt(s, t) {
167
+ return new (X(s, t))();
634
168
  }
635
- function ur(t, e) {
636
- return new (U(t, e))();
169
+ function Ht(s, t) {
170
+ return new (E(s, t))();
637
171
  }
638
- const dr = /* @__PURE__ */ U(xt), fr = /* @__PURE__ */ U(vt), pr = /* @__PURE__ */ U(K), yr = /* @__PURE__ */ bt(K), qn = u.clamp, gr = u.euclideanModulo, wr = u.inverseLerp, mr = u.lerp, vr = u.degToRad, xr = u.radToDeg, _r = u.isPowerOfTwo, br = u.ceilPowerOfTwo, Tr = u.floorPowerOfTwo, Sr = u.normalize, Ar = u.mapLinear;
639
- function Pr(t, e, n) {
640
- return n <= t ? 0 : n >= e ? 1 : (n = (n - t) / (e - t), n * n * (3 - 2 * n));
172
+ const Xt = /* @__PURE__ */ E(q), Wt = /* @__PURE__ */ E(G), Vt = /* @__PURE__ */ E(U), jt = /* @__PURE__ */ X(U), yt = d.clamp, kt = d.euclideanModulo, Qt = d.inverseLerp, Yt = d.lerp, $t = d.degToRad, Jt = d.radToDeg, Kt = d.isPowerOfTwo, Zt = d.ceilPowerOfTwo, te = d.floorPowerOfTwo, ee = d.normalize, se = d.mapLinear;
173
+ function ne(s, t, e) {
174
+ return e <= s ? 0 : e >= t ? 1 : (e = (e - s) / (t - s), e * e * (3 - 2 * e));
641
175
  }
642
- function Or(t) {
643
- return Math.min(Math.max(t, 0), 1);
176
+ function ie(s) {
177
+ return Math.min(Math.max(s, 0), 1);
644
178
  }
645
- function Ir(t, e, n, r = n) {
646
- const i = Math.abs(t - e);
647
- return i <= r || i <= n * Math.max(Math.abs(t), Math.abs(e));
179
+ function re(s, t, e, n = e) {
180
+ const i = Math.abs(s - t);
181
+ return i <= n || i <= e * Math.max(Math.abs(s), Math.abs(t));
648
182
  }
649
- const G = 1e-6, M = /* @__PURE__ */ new p(), z = /* @__PURE__ */ new p(), f = /* @__PURE__ */ new p(), T = /* @__PURE__ */ new p(), R = /* @__PURE__ */ new p(), Vn = /* @__PURE__ */ new p(), Wn = /* @__PURE__ */ new $t(), Xn = /* @__PURE__ */ new jt(), Zn = /* @__PURE__ */ new Gt();
650
- class Tt {
651
- constructor(e = 0, n = 0, r = 0, i = 0) {
183
+ const D = 1e-6, L = /* @__PURE__ */ new p(), S = /* @__PURE__ */ new p(), u = /* @__PURE__ */ new p(), m = /* @__PURE__ */ new p(), z = /* @__PURE__ */ new p(), ft = /* @__PURE__ */ new p(), gt = /* @__PURE__ */ new rt(), wt = /* @__PURE__ */ new ot(), mt = /* @__PURE__ */ new at();
184
+ class W {
185
+ constructor(t = 0, e = 0, n = 0, i = 0) {
652
186
  // Distance from the target.
653
187
  l(this, "_distance");
654
188
  // Radians from the local east direction relative from true north, measured
@@ -658,250 +192,273 @@ class Tt {
658
192
  // up (90 degrees is straight up, -90 is straight down).
659
193
  l(this, "_pitch");
660
194
  l(this, "roll");
661
- this.distance = e, this.heading = n, this.pitch = r, this.roll = i;
195
+ this.distance = t, this.heading = e, this.pitch = n, this.roll = i;
662
196
  }
663
197
  get distance() {
664
198
  return this._distance;
665
199
  }
666
- set distance(e) {
667
- this._distance = Math.max(e, G);
200
+ set distance(t) {
201
+ this._distance = Math.max(t, D);
668
202
  }
669
203
  get pitch() {
670
204
  return this._pitch;
671
205
  }
672
- set pitch(e) {
673
- this._pitch = qn(e, -Math.PI / 2 + G, Math.PI / 2 - G);
206
+ set pitch(t) {
207
+ this._pitch = yt(t, -Math.PI / 2 + D, Math.PI / 2 - D);
674
208
  }
675
- set(e, n, r, i) {
676
- return this.distance = e, this.heading = n, this.pitch = r, i != null && (this.roll = i), this;
209
+ set(t, e, n, i) {
210
+ return this.distance = t, this.heading = e, this.pitch = n, i != null && (this.roll = i), this;
677
211
  }
678
212
  clone() {
679
- return new Tt(this.distance, this.heading, this.pitch, this.roll);
680
- }
681
- copy(e) {
682
- return this.distance = e.distance, this.heading = e.heading, this.pitch = e.pitch, this.roll = e.roll, this;
683
- }
684
- equals(e) {
685
- return e.distance === this.distance && e.heading === this.heading && e.pitch === this.pitch && e.roll === this.roll;
686
- }
687
- decompose(e, n, r, i, a = et.WGS84) {
688
- a.getEastNorthUpVectors(
689
- e,
690
- M,
691
- z,
692
- f
693
- ), i == null || i.copy(f);
694
- const s = T.copy(M).multiplyScalar(Math.cos(this.heading)).add(
695
- R.copy(z).multiplyScalar(Math.sin(this.heading))
696
- ).multiplyScalar(Math.cos(this.pitch)).add(R.copy(f).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);
697
- if (n.copy(e).sub(s), this.roll !== 0) {
698
- const o = T.copy(e).sub(n).normalize();
699
- f.applyQuaternion(
700
- Xn.setFromAxisAngle(o, this.roll)
213
+ return new W(this.distance, this.heading, this.pitch, this.roll);
214
+ }
215
+ copy(t) {
216
+ return this.distance = t.distance, this.heading = t.heading, this.pitch = t.pitch, this.roll = t.roll, this;
217
+ }
218
+ equals(t) {
219
+ return t.distance === this.distance && t.heading === this.heading && t.pitch === this.pitch && t.roll === this.roll;
220
+ }
221
+ decompose(t, e, n, i, r = B.WGS84) {
222
+ r.getEastNorthUpVectors(
223
+ t,
224
+ L,
225
+ S,
226
+ u
227
+ ), i == null || i.copy(u);
228
+ const o = m.copy(L).multiplyScalar(Math.cos(this.heading)).add(
229
+ z.copy(S).multiplyScalar(Math.sin(this.heading))
230
+ ).multiplyScalar(Math.cos(this.pitch)).add(z.copy(u).multiplyScalar(Math.sin(this.pitch))).normalize().multiplyScalar(this.distance);
231
+ if (e.copy(t).sub(o), this.roll !== 0) {
232
+ const a = m.copy(t).sub(e).normalize();
233
+ u.applyQuaternion(
234
+ wt.setFromAxisAngle(a, this.roll)
701
235
  );
702
236
  }
703
- r.setFromRotationMatrix(
704
- Wn.lookAt(n, e, f)
237
+ n.setFromRotationMatrix(
238
+ gt.lookAt(e, t, u)
705
239
  );
706
240
  }
707
- setFromCamera(e, n = et.WGS84) {
708
- const r = T.setFromMatrixPosition(e.matrixWorld), i = R.set(0, 0, 0.5).unproject(e).sub(r).normalize(), a = n.getIntersection(Zn.set(r, i));
709
- if (a == null)
241
+ setFromCamera(t, e = B.WGS84) {
242
+ const n = m.setFromMatrixPosition(t.matrixWorld), i = z.set(0, 0, 0.5).unproject(t).sub(n).normalize(), r = e.getIntersection(mt.set(n, i));
243
+ if (r == null)
710
244
  return;
711
- this.distance = r.distanceTo(a), n.getEastNorthUpVectors(
712
- a,
713
- M,
714
- z,
715
- f
245
+ this.distance = n.distanceTo(r), e.getEastNorthUpVectors(
246
+ r,
247
+ L,
248
+ S,
249
+ u
716
250
  ), this.heading = Math.atan2(
717
- z.dot(i),
718
- M.dot(i)
719
- ), this.pitch = Math.asin(f.dot(i));
720
- const s = T.copy(e.up).applyQuaternion(e.quaternion), o = Vn.copy(i).multiplyScalar(-s.dot(i)).add(s).normalize(), c = T.copy(i).multiplyScalar(-f.dot(i)).add(f).normalize(), h = c.dot(o), d = i.dot(c.cross(o));
721
- return this.roll = Math.atan2(d, h), this;
251
+ S.dot(i),
252
+ L.dot(i)
253
+ ), this.pitch = Math.asin(u.dot(i));
254
+ const o = m.copy(t.up).applyQuaternion(t.quaternion), a = ft.copy(i).multiplyScalar(-o.dot(i)).add(o).normalize(), h = m.copy(i).multiplyScalar(-u.dot(i)).add(u).normalize(), c = h.dot(a), f = i.dot(h.cross(a));
255
+ return this.roll = Math.atan2(f, c), this;
722
256
  }
723
257
  }
724
- const S = class S {
725
- constructor(e = 0, n = 0, r = 0, i = 0) {
726
- this.west = e, this.south = n, this.east = r, this.north = i;
258
+ const x = class x {
259
+ constructor(t = 0, e = 0, n = 0, i = 0) {
260
+ this.west = t, this.south = e, this.east = n, this.north = i;
727
261
  }
728
262
  get width() {
729
- let e = this.east;
730
- return e < this.west && (e += Math.PI * 2), e - this.west;
263
+ let t = this.east;
264
+ return t < this.west && (t += Math.PI * 2), t - this.west;
731
265
  }
732
266
  get height() {
733
267
  return this.north - this.south;
734
268
  }
735
- set(e, n, r, i) {
736
- return this.west = e, this.south = n, this.east = r, this.north = i, this;
269
+ set(t, e, n, i) {
270
+ return this.west = t, this.south = e, this.east = n, this.north = i, this;
737
271
  }
738
272
  clone() {
739
- return new S(this.west, this.south, this.east, this.north);
273
+ return new x(this.west, this.south, this.east, this.north);
740
274
  }
741
- copy(e) {
742
- return this.west = e.west, this.south = e.south, this.east = e.east, this.north = e.north, this;
275
+ copy(t) {
276
+ return this.west = t.west, this.south = t.south, this.east = t.east, this.north = t.north, this;
743
277
  }
744
- equals(e) {
745
- return e.west === this.west && e.south === this.south && e.east === this.east && e.north === this.north;
278
+ equals(t) {
279
+ return t.west === this.west && t.south === this.south && t.east === this.east && t.north === this.north;
746
280
  }
747
- at(e, n, r = new _()) {
748
- return r.set(
749
- this.west + (this.east - this.west) * e,
750
- this.north + (this.south - this.north) * n
281
+ at(t, e, n = new w()) {
282
+ return n.set(
283
+ this.west + (this.east - this.west) * t,
284
+ this.north + (this.south - this.north) * e
751
285
  );
752
286
  }
753
- fromArray(e, n = 0) {
754
- return this.west = e[n], this.south = e[n + 1], this.east = e[n + 2], this.north = e[n + 3], this;
287
+ fromArray(t, e = 0) {
288
+ return this.west = t[e], this.south = t[e + 1], this.east = t[e + 2], this.north = t[e + 3], this;
755
289
  }
756
- toArray(e = [], n = 0) {
757
- return e[n] = this.west, e[n + 1] = this.south, e[n + 2] = this.east, e[n + 3] = this.north, e;
290
+ toArray(t = [], e = 0) {
291
+ return t[e] = this.west, t[e + 1] = this.south, t[e + 2] = this.east, t[e + 3] = this.north, t;
758
292
  }
759
293
  *[Symbol.iterator]() {
760
294
  yield this.west, yield this.south, yield this.east, yield this.north;
761
295
  }
762
296
  };
763
- l(S, "MAX", /* @__PURE__ */ new S(
764
- _.MIN_LONGITUDE,
765
- _.MIN_LATITUDE,
766
- _.MAX_LONGITUDE,
767
- _.MAX_LATITUDE
297
+ l(x, "MAX", /* @__PURE__ */ new x(
298
+ w.MIN_LONGITUDE,
299
+ w.MIN_LATITUDE,
300
+ w.MAX_LONGITUDE,
301
+ w.MAX_LATITUDE
768
302
  ));
769
- let D = S;
770
- function* St(t, e, n, r, i) {
771
- if (n >= r)
303
+ let M = x;
304
+ const xt = /^[ \t]*#include +"([\w\d./]+)"/gm;
305
+ function Tt(s, t) {
306
+ return s.replace(xt, (e, n) => {
307
+ const r = n.split("/").reduce(
308
+ (o, a) => typeof o != "string" && o != null ? o[a] : void 0,
309
+ t
310
+ );
311
+ if (typeof r != "string")
312
+ throw new Error(`Could not find include for ${n}.`);
313
+ return Tt(r, t);
314
+ });
315
+ }
316
+ function* V(s, t, e, n, i) {
317
+ if (e >= n)
772
318
  return;
773
- const a = 2 ** n, s = n + 1, o = 2 ** s, c = Math.floor(t / a * o), h = Math.floor(e / a * o), d = [
774
- [c, h, s],
775
- [c + 1, h, s],
776
- [c, h + 1, s],
777
- [c + 1, h + 1, s]
319
+ const r = 2 ** e, o = e + 1, a = 2 ** o, h = Math.floor(s / r * a), c = Math.floor(t / r * a), f = [
320
+ [h, c, o],
321
+ [h + 1, c, o],
322
+ [h, c + 1, o],
323
+ [h + 1, c + 1, o]
778
324
  ];
779
- if (s < r)
780
- for (const v of d)
781
- for (const $ of St(...v, r, i))
782
- yield $;
325
+ if (o < n)
326
+ for (const g of f)
327
+ for (const I of V(...g, n, i))
328
+ yield I;
783
329
  else
784
- for (const v of d)
785
- yield (i ?? new P()).set(...v);
330
+ for (const g of f)
331
+ yield (i ?? new T()).set(...g);
786
332
  }
787
- class P {
788
- constructor(e = 0, n = 0, r = 0) {
789
- this.x = e, this.y = n, this.z = r;
333
+ class T {
334
+ constructor(t = 0, e = 0, n = 0) {
335
+ this.x = t, this.y = e, this.z = n;
790
336
  }
791
- set(e, n, r) {
792
- return this.x = e, this.y = n, r != null && (this.z = r), this;
337
+ set(t, e, n) {
338
+ return this.x = t, this.y = e, n != null && (this.z = n), this;
793
339
  }
794
340
  clone() {
795
- return new P(this.x, this.y, this.z);
341
+ return new T(this.x, this.y, this.z);
796
342
  }
797
- copy(e) {
798
- return this.x = e.x, this.y = e.y, this.z = e.z, this;
343
+ copy(t) {
344
+ return this.x = t.x, this.y = t.y, this.z = t.z, this;
799
345
  }
800
- equals(e) {
801
- return e.x === this.x && e.y === this.y && e.z === this.z;
346
+ equals(t) {
347
+ return t.x === this.x && t.y === this.y && t.z === this.z;
802
348
  }
803
- getParent(e = new P()) {
804
- const n = 2 ** this.z, r = this.x / n, i = this.y / n, a = this.z - 1, s = 2 ** a;
805
- return e.set(Math.floor(r * s), Math.floor(i * s), a);
349
+ getParent(t = new T()) {
350
+ const e = 2 ** this.z, n = this.x / e, i = this.y / e, r = this.z - 1, o = 2 ** r;
351
+ return t.set(Math.floor(n * o), Math.floor(i * o), r);
806
352
  }
807
- *traverseChildren(e, n) {
808
- const { x: r, y: i, z: a } = this;
809
- for (const s of St(r, i, a, a + e, n))
810
- yield s;
353
+ *traverseChildren(t, e) {
354
+ const { x: n, y: i, z: r } = this;
355
+ for (const o of V(n, i, r, r + t, e))
356
+ yield o;
811
357
  }
812
- fromArray(e, n = 0) {
813
- return this.x = e[n], this.y = e[n + 1], this.z = e[n + 2], this;
358
+ fromArray(t, e = 0) {
359
+ return this.x = t[e], this.y = t[e + 1], this.z = t[e + 2], this;
814
360
  }
815
- toArray(e = [], n = 0) {
816
- return e[n] = this.x, e[n + 1] = this.y, e[n + 2] = this.z, e;
361
+ toArray(t = [], e = 0) {
362
+ return t[e] = this.x, t[e + 1] = this.y, t[e + 2] = this.z, t;
817
363
  }
818
364
  *[Symbol.iterator]() {
819
365
  yield this.x, yield this.y, yield this.z;
820
366
  }
821
367
  }
822
- const lt = /* @__PURE__ */ new ut();
823
- class At {
824
- constructor(e = 2, n = 1, r = D.MAX) {
825
- this.width = e, this.height = n, this.rectangle = r;
368
+ const O = /* @__PURE__ */ new C();
369
+ class j {
370
+ constructor(t = 2, e = 1, n = M.MAX) {
371
+ this.width = t, this.height = e, this.rectangle = n;
826
372
  }
827
373
  clone() {
828
- return new At(this.width, this.height, this.rectangle.clone());
374
+ return new j(this.width, this.height, this.rectangle.clone());
829
375
  }
830
- copy(e) {
831
- return this.width = e.width, this.height = e.height, this.rectangle.copy(e.rectangle), this;
376
+ copy(t) {
377
+ return this.width = t.width, this.height = t.height, this.rectangle.copy(t.rectangle), this;
832
378
  }
833
- getSize(e, n = new ut()) {
834
- return n.set(this.width << e, this.height << e);
379
+ getSize(t, e = new C()) {
380
+ return e.set(this.width << t, this.height << t);
835
381
  }
836
382
  // Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L210
837
- getTile(e, n, r = new P()) {
838
- const i = this.getSize(n, lt), a = this.rectangle.width / i.x, s = this.rectangle.height / i.y;
839
- let o = e.longitude;
840
- this.rectangle.east < this.rectangle.west && (o += Math.PI * 2);
841
- let c = Math.floor((o - this.rectangle.west) / a);
842
- c >= i.x && (c = i.x - 1);
843
- let h = Math.floor((e.latitude - this.rectangle.south) / s);
844
- return h >= i.y && (h = i.y - 1), r.x = c, r.y = h, r.z = n, r;
383
+ getTile(t, e, n = new T()) {
384
+ const i = this.getSize(e, O), r = this.rectangle.width / i.x, o = this.rectangle.height / i.y;
385
+ let a = t.longitude;
386
+ this.rectangle.east < this.rectangle.west && (a += Math.PI * 2);
387
+ let h = Math.floor((a - this.rectangle.west) / r);
388
+ h >= i.x && (h = i.x - 1);
389
+ let c = Math.floor((t.latitude - this.rectangle.south) / o);
390
+ return c >= i.y && (c = i.y - 1), n.x = h, n.y = c, n.z = e, n;
845
391
  }
846
392
  // Reference: https://github.com/CesiumGS/cesium/blob/1.122/packages/engine/Source/Core/GeographicTilingScheme.js#L169
847
- getRectangle(e, n = new D()) {
848
- const r = this.getSize(e.z, lt), i = this.rectangle.width / r.x, a = this.rectangle.height / r.y;
849
- return n.west = e.x * i + this.rectangle.west, n.east = (e.x + 1) * i + this.rectangle.west, n.north = this.rectangle.north - (r.y - e.y - 1) * a, n.south = this.rectangle.north - (r.y - e.y) * a, n;
393
+ getRectangle(t, e = new M()) {
394
+ const n = this.getSize(t.z, O), i = this.rectangle.width / n.x, r = this.rectangle.height / n.y;
395
+ return e.west = t.x * i + this.rectangle.west, e.east = (t.x + 1) * i + this.rectangle.west, e.north = this.rectangle.north - (n.y - t.y - 1) * r, e.south = this.rectangle.north - (n.y - t.y) * r, e;
850
396
  }
851
397
  }
852
- const Mr = Rt, zr = Ht, Er = Bt;
398
+ const At = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
399
+ function Lt(s, t, e, n) {
400
+ let i = "";
401
+ for (let r = parseInt(t); r < parseInt(e); ++r)
402
+ i += n.replace(/\[\s*i\s*\]/g, "[" + r + "]").replace(/UNROLLED_LOOP_INDEX/g, `${r}`);
403
+ return i;
404
+ }
405
+ function oe(s) {
406
+ return s.replace(At, Lt);
407
+ }
853
408
  export {
854
- Vt as ArrayBufferLoader,
855
- Bn as DataLoader,
856
- et as Ellipsoid,
857
- Lr as EllipsoidGeometry,
858
- hr as Float32ArrayLoader,
859
- pr as Float32Data2DLoader,
860
- yr as Float32Data3DLoader,
861
- _ as Geodetic,
862
- or as Int16ArrayLoader,
863
- dr as Int16Data2DLoader,
864
- Tt as PointOfView,
865
- D as Rectangle,
866
- P as TileCoordinate,
867
- At as TilingScheme,
868
- Rn as TypedArrayLoader,
869
- cr as Uint16ArrayLoader,
870
- fr as Uint16Data2DLoader,
871
- Jn as assertType,
872
- br as ceilPowerOfTwo,
873
- qn as clamp,
874
- Ir as closeTo,
875
- lr as createData3DTextureLoader,
876
- bt as createData3DTextureLoaderClass,
877
- ur as createDataTextureLoader,
878
- U as createDataTextureLoaderClass,
879
- sr as createTypedArrayLoader,
880
- I as createTypedArrayLoaderClass,
881
- xr as degrees,
882
- Mr as depthShader,
883
- gr as euclideanModulo,
884
- Tr as floorPowerOfTwo,
885
- tr as fromBufferGeometryLike,
886
- Gn as getTypedArrayElementType,
887
- wr as inverseLerp,
888
- _r as isPowerOfTwo,
889
- mr as lerp,
890
- Sr as normalize,
891
- zr as packingShader,
892
- K as parseFloat32Array,
893
- ar as parseFloat64Array,
894
- xt as parseInt16Array,
895
- rr as parseInt32Array,
896
- nr as parseInt8Array,
897
- vt as parseUint16Array,
898
- ir as parseUint32Array,
899
- er as parseUint8Array,
900
- vr as radians,
901
- Ar as remap,
902
- Or as saturate,
903
- Pr as smoothstep,
904
- kn as toBufferGeometryLike,
905
- Er as transformShader
409
+ ct as ArrayBufferLoader,
410
+ pt as DataLoader,
411
+ B as Ellipsoid,
412
+ ce as EllipsoidGeometry,
413
+ Gt as Float32ArrayLoader,
414
+ Vt as Float32Data2DLoader,
415
+ jt as Float32Data3DLoader,
416
+ w as Geodetic,
417
+ Ct as Int16ArrayLoader,
418
+ Xt as Int16Data2DLoader,
419
+ W as PointOfView,
420
+ M as Rectangle,
421
+ Pt as STBN_TEXTURE_DEPTH,
422
+ Ut as STBN_TEXTURE_HEIGHT,
423
+ bt as STBN_TEXTURE_WIDTH,
424
+ T as TileCoordinate,
425
+ j as TilingScheme,
426
+ dt as TypedArrayLoader,
427
+ Rt as Uint16ArrayLoader,
428
+ Wt as Uint16Data2DLoader,
429
+ It as assertType,
430
+ Zt as ceilPowerOfTwo,
431
+ yt as clamp,
432
+ re as closeTo,
433
+ qt as createData3DTextureLoader,
434
+ X as createData3DTextureLoaderClass,
435
+ Ht as createDataTextureLoader,
436
+ E as createDataTextureLoaderClass,
437
+ Ot as createTypedArrayLoader,
438
+ A as createTypedArrayLoaderClass,
439
+ Jt as degrees,
440
+ kt as euclideanModulo,
441
+ te as floorPowerOfTwo,
442
+ zt as fromBufferGeometryLike,
443
+ lt as getTypedArrayElementType,
444
+ Qt as inverseLerp,
445
+ Kt as isPowerOfTwo,
446
+ Yt as lerp,
447
+ ee as normalize,
448
+ U as parseFloat32Array,
449
+ Nt as parseFloat64Array,
450
+ q as parseInt16Array,
451
+ _t as parseInt32Array,
452
+ vt as parseInt8Array,
453
+ G as parseUint16Array,
454
+ Bt as parseUint32Array,
455
+ Ft as parseUint8Array,
456
+ $t as radians,
457
+ se as remap,
458
+ Tt as resolveIncludes,
459
+ ie as saturate,
460
+ ne as smoothstep,
461
+ Dt as toBufferGeometryLike,
462
+ oe as unrollLoops
906
463
  };
907
464
  //# sourceMappingURL=index.js.map