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

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