@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.cjs +4 -4
- package/build/index.cjs.map +1 -1
- package/build/index.js +555 -569
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/src/DataLoader.ts +106 -49
- package/src/TypedArrayLoader.ts +25 -9
- package/src/index.ts +1 -0
- package/src/math.ts +1 -0
- package/src/typedArray.ts +29 -52
- package/src/typedArrayParsers.ts +77 -0
- package/types/DataLoader.d.ts +30 -60
- package/types/TypedArrayLoader.d.ts +10 -10
- package/types/index.d.ts +1 -0
- package/types/math.d.ts +1 -0
- package/types/typedArray.d.ts +2 -8
- package/types/typedArrayParsers.d.ts +11 -0
package/build/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { Loader as
|
5
|
-
import { E as et, G as
|
6
|
-
import { a as
|
7
|
-
var
|
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
|
-
}`,
|
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
|
-
}`,
|
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
|
-
}`,
|
50
|
-
function
|
51
|
-
if (!
|
52
|
-
if (
|
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
|
59
|
-
load(
|
60
|
-
const a = new
|
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
|
-
|
62
|
+
e,
|
63
63
|
(s) => {
|
64
|
-
|
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(
|
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
|
76
|
+
function Jn(t) {
|
77
77
|
}
|
78
|
-
var
|
79
|
-
function
|
80
|
-
var
|
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
|
-
|
82
|
+
t[b] = void 0;
|
83
83
|
var r = !0;
|
84
84
|
} catch {
|
85
85
|
}
|
86
|
-
var i =
|
87
|
-
return r && (
|
86
|
+
var i = Yt.call(t);
|
87
|
+
return r && (e ? t[b] = n : delete t[b]), i;
|
88
88
|
}
|
89
|
-
var
|
90
|
-
function
|
91
|
-
return
|
89
|
+
var Qt = Object.prototype, Jt = Qt.toString;
|
90
|
+
function kt(t) {
|
91
|
+
return Jt.call(t);
|
92
92
|
}
|
93
|
-
var
|
94
|
-
function q(
|
95
|
-
return
|
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(
|
98
|
-
return
|
97
|
+
function V(t) {
|
98
|
+
return t != null && typeof t == "object";
|
99
99
|
}
|
100
|
-
var
|
101
|
-
function W(
|
102
|
-
return typeof
|
100
|
+
var ne = "[object Symbol]";
|
101
|
+
function W(t) {
|
102
|
+
return typeof t == "symbol" || V(t) && q(t) == ne;
|
103
103
|
}
|
104
|
-
function
|
105
|
-
for (var n = -1, r =
|
106
|
-
i[n] = t
|
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
|
110
|
-
function
|
111
|
-
if (typeof
|
112
|
-
return
|
113
|
-
if (
|
114
|
-
return
|
115
|
-
if (W(
|
116
|
-
return at ? at.call(
|
117
|
-
var
|
118
|
-
return
|
119
|
-
}
|
120
|
-
function
|
121
|
-
var
|
122
|
-
return
|
123
|
-
}
|
124
|
-
function
|
125
|
-
return
|
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
|
128
|
-
function
|
129
|
-
if (!
|
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
|
132
|
-
return
|
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
|
136
|
-
return
|
135
|
+
var t = /[^.]+$/.exec(j && j.keys && j.keys.IE_PROTO || "");
|
136
|
+
return t ? "Symbol(src)_1." + t : "";
|
137
137
|
}();
|
138
|
-
function
|
139
|
-
return !!st && st in
|
138
|
+
function ue(t) {
|
139
|
+
return !!st && st in t;
|
140
140
|
}
|
141
|
-
var
|
142
|
-
function
|
143
|
-
if (
|
141
|
+
var de = Function.prototype, fe = de.toString;
|
142
|
+
function pe(t) {
|
143
|
+
if (t != null) {
|
144
144
|
try {
|
145
|
-
return
|
145
|
+
return fe.call(t);
|
146
146
|
} catch {
|
147
147
|
}
|
148
148
|
try {
|
149
|
-
return
|
149
|
+
return t + "";
|
150
150
|
} catch {
|
151
151
|
}
|
152
152
|
}
|
153
153
|
return "";
|
154
154
|
}
|
155
|
-
var
|
156
|
-
"^" +
|
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
|
159
|
-
if (!
|
158
|
+
function be(t) {
|
159
|
+
if (!E(t) || ue(t))
|
160
160
|
return !1;
|
161
|
-
var
|
162
|
-
return
|
161
|
+
var e = le(t) ? _e : ge;
|
162
|
+
return e.test(pe(t));
|
163
163
|
}
|
164
|
-
function
|
165
|
-
return
|
164
|
+
function Te(t, e) {
|
165
|
+
return t == null ? void 0 : t[e];
|
166
166
|
}
|
167
|
-
function X(
|
168
|
-
var n =
|
169
|
-
return
|
167
|
+
function X(t, e) {
|
168
|
+
var n = Te(t, e);
|
169
|
+
return be(n) ? n : void 0;
|
170
170
|
}
|
171
|
-
function
|
171
|
+
function Se(t, e, n) {
|
172
172
|
switch (n.length) {
|
173
173
|
case 0:
|
174
|
-
return
|
174
|
+
return t.call(e);
|
175
175
|
case 1:
|
176
|
-
return
|
176
|
+
return t.call(e, n[0]);
|
177
177
|
case 2:
|
178
|
-
return
|
178
|
+
return t.call(e, n[0], n[1]);
|
179
179
|
case 3:
|
180
|
-
return
|
180
|
+
return t.call(e, n[0], n[1], n[2]);
|
181
181
|
}
|
182
|
-
return
|
182
|
+
return t.apply(e, n);
|
183
183
|
}
|
184
|
-
var
|
185
|
-
function
|
186
|
-
var
|
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 =
|
188
|
+
var r = Oe(), i = Pe - (r - n);
|
189
189
|
if (n = r, i > 0) {
|
190
|
-
if (++
|
190
|
+
if (++e >= Ae)
|
191
191
|
return arguments[0];
|
192
192
|
} else
|
193
|
-
|
194
|
-
return
|
193
|
+
e = 0;
|
194
|
+
return t.apply(void 0, arguments);
|
195
195
|
};
|
196
196
|
}
|
197
|
-
function
|
197
|
+
function Me(t) {
|
198
198
|
return function() {
|
199
|
-
return
|
199
|
+
return t;
|
200
200
|
};
|
201
201
|
}
|
202
|
-
var
|
202
|
+
var C = function() {
|
203
203
|
try {
|
204
|
-
var
|
205
|
-
return
|
204
|
+
var t = X(Object, "defineProperty");
|
205
|
+
return t({}, "", {}), t;
|
206
206
|
} catch {
|
207
207
|
}
|
208
|
-
}(),
|
209
|
-
return
|
208
|
+
}(), ze = C ? function(t, e) {
|
209
|
+
return C(t, "toString", {
|
210
210
|
configurable: !0,
|
211
211
|
enumerable: !1,
|
212
|
-
value:
|
212
|
+
value: Me(e),
|
213
213
|
writable: !0
|
214
214
|
});
|
215
|
-
} :
|
216
|
-
function
|
217
|
-
var n = typeof
|
218
|
-
return
|
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
|
221
|
-
|
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
|
226
|
+
}) : t[e] = n;
|
227
227
|
}
|
228
|
-
function
|
229
|
-
return
|
228
|
+
function gt(t, e) {
|
229
|
+
return t === e || t !== t && e !== e;
|
230
230
|
}
|
231
|
-
var
|
232
|
-
function
|
233
|
-
var r = e
|
234
|
-
(!(
|
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
|
238
|
-
return
|
239
|
-
for (var r = arguments, i = -1, a = ot(r.length -
|
240
|
-
s[i] = r[
|
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(
|
242
|
+
for (var o = Array(e + 1); ++i < e; )
|
243
243
|
o[i] = r[i];
|
244
|
-
return o[
|
244
|
+
return o[e] = n(s), Se(t, this, o);
|
245
245
|
};
|
246
246
|
}
|
247
|
-
var
|
248
|
-
function
|
249
|
-
return typeof
|
247
|
+
var je = 9007199254740991;
|
248
|
+
function Ge(t) {
|
249
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= je;
|
250
250
|
}
|
251
|
-
var
|
252
|
-
function ct(
|
253
|
-
return V(
|
251
|
+
var Re = "[object Arguments]";
|
252
|
+
function ct(t) {
|
253
|
+
return V(t) && q(t) == Re;
|
254
254
|
}
|
255
|
-
var
|
255
|
+
var wt = Object.prototype, He = wt.hasOwnProperty, Be = wt.propertyIsEnumerable, mt = ct(/* @__PURE__ */ function() {
|
256
256
|
return arguments;
|
257
|
-
}()) ? ct : function(
|
258
|
-
return V(
|
259
|
-
},
|
260
|
-
function
|
261
|
-
if (
|
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
|
264
|
-
return n == "number" || n == "symbol" || n == "boolean" ||
|
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
|
267
|
-
function
|
268
|
-
this.__data__ =
|
266
|
+
var A = X(Object, "create");
|
267
|
+
function Xe() {
|
268
|
+
this.__data__ = A ? A(null) : {}, this.size = 0;
|
269
269
|
}
|
270
|
-
function
|
271
|
-
var
|
272
|
-
return this.size -=
|
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
|
275
|
-
function
|
276
|
-
var
|
277
|
-
if (
|
278
|
-
var n = t
|
279
|
-
return 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
|
281
|
+
return Qe.call(e, t) ? e[t] : void 0;
|
282
282
|
}
|
283
|
-
var
|
284
|
-
function
|
285
|
-
var
|
286
|
-
return
|
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
|
289
|
-
function
|
288
|
+
var nn = "__lodash_hash_undefined__";
|
289
|
+
function rn(t, e) {
|
290
290
|
var n = this.__data__;
|
291
|
-
return this.size += this.has(
|
291
|
+
return this.size += this.has(t) ? 0 : 1, n[t] = A && e === void 0 ? nn : e, this;
|
292
292
|
}
|
293
|
-
function
|
294
|
-
var
|
295
|
-
for (this.clear(); ++
|
296
|
-
var r = e
|
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
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
function
|
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
|
309
|
-
for (var n =
|
310
|
-
if (
|
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
|
315
|
-
function
|
316
|
-
var
|
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 =
|
320
|
-
return n == r ?
|
319
|
+
var r = e.length - 1;
|
320
|
+
return n == r ? e.pop() : on.call(e, n, 1), --this.size, !0;
|
321
321
|
}
|
322
|
-
function
|
323
|
-
var
|
324
|
-
return n < 0 ? void 0 :
|
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
|
327
|
-
return
|
326
|
+
function ln(t) {
|
327
|
+
return L(this.__data__, t) > -1;
|
328
328
|
}
|
329
|
-
function
|
330
|
-
var n = this.__data__, r =
|
331
|
-
return r < 0 ? (++this.size, n.push([
|
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
|
334
|
-
var
|
335
|
-
for (this.clear(); ++
|
336
|
-
var r = e
|
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
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
var
|
346
|
-
function
|
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
|
349
|
-
map: new (
|
350
|
-
string: new
|
348
|
+
hash: new w(),
|
349
|
+
map: new (dn || x)(),
|
350
|
+
string: new w()
|
351
351
|
};
|
352
352
|
}
|
353
|
-
function
|
354
|
-
var
|
355
|
-
return
|
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
|
358
|
-
var n =
|
359
|
-
return
|
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
|
362
|
-
var
|
363
|
-
return this.size -=
|
361
|
+
function yn(t) {
|
362
|
+
var e = F(this, t).delete(t);
|
363
|
+
return this.size -= e ? 1 : 0, e;
|
364
364
|
}
|
365
|
-
function
|
366
|
-
return
|
365
|
+
function gn(t) {
|
366
|
+
return F(this, t).get(t);
|
367
367
|
}
|
368
|
-
function
|
369
|
-
return
|
368
|
+
function wn(t) {
|
369
|
+
return F(this, t).has(t);
|
370
370
|
}
|
371
|
-
function
|
372
|
-
var n =
|
373
|
-
return n.set(
|
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
|
376
|
-
var
|
377
|
-
for (this.clear(); ++
|
378
|
-
var r = e
|
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
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
var
|
388
|
-
function Z(
|
389
|
-
if (typeof
|
390
|
-
throw new TypeError(
|
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 =
|
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 =
|
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 ||
|
399
|
-
}
|
400
|
-
Z.Cache =
|
401
|
-
var
|
402
|
-
function
|
403
|
-
var
|
404
|
-
return n.size ===
|
405
|
-
}), n =
|
406
|
-
return
|
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
|
409
|
-
var
|
410
|
-
return
|
411
|
-
|
412
|
-
}),
|
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
|
415
|
-
return
|
416
|
-
}
|
417
|
-
function N(
|
418
|
-
return
|
419
|
-
}
|
420
|
-
var
|
421
|
-
function Y(
|
422
|
-
if (typeof
|
423
|
-
return
|
424
|
-
var
|
425
|
-
return
|
426
|
-
}
|
427
|
-
function
|
428
|
-
|
429
|
-
for (var n = 0, r =
|
430
|
-
|
431
|
-
return n && n == r ?
|
432
|
-
}
|
433
|
-
function
|
434
|
-
for (var n = -1, r =
|
435
|
-
|
436
|
-
return
|
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 =
|
439
|
-
function
|
440
|
-
return
|
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
|
443
|
-
var a = -1, s =
|
444
|
-
for (n || (n =
|
445
|
-
var o =
|
446
|
-
n(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
|
451
|
-
var
|
452
|
-
return
|
450
|
+
function En(t) {
|
451
|
+
var e = t == null ? 0 : t.length;
|
452
|
+
return e ? zn(t) : [];
|
453
453
|
}
|
454
|
-
function
|
455
|
-
return
|
454
|
+
function Cn(t) {
|
455
|
+
return Ee($e(t, void 0, En), t + "");
|
456
456
|
}
|
457
|
-
function
|
458
|
-
return
|
457
|
+
function Dn(t, e) {
|
458
|
+
return t != null && e in Object(t);
|
459
459
|
}
|
460
|
-
function
|
461
|
-
|
462
|
-
for (var r = -1, i =
|
463
|
-
var s = Y(
|
464
|
-
if (!(a =
|
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
|
-
|
466
|
+
t = t[s];
|
467
467
|
}
|
468
|
-
return a || ++r != i ? a : (i =
|
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
|
471
|
-
return
|
470
|
+
function Fn(t, e) {
|
471
|
+
return t != null && Ln(t, e, Dn);
|
472
472
|
}
|
473
|
-
function
|
474
|
-
if (!
|
475
|
-
return
|
476
|
-
|
477
|
-
for (var i = -1, a =
|
478
|
-
var
|
479
|
-
if (
|
480
|
-
return
|
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
|
483
|
-
|
482
|
+
var d = o[c];
|
483
|
+
h = void 0, h === void 0 && (h = E(d) ? d : yt(e[i + 1]) ? [] : {});
|
484
484
|
}
|
485
|
-
|
485
|
+
Ue(o, c, h), o = o[c];
|
486
486
|
}
|
487
|
-
return
|
487
|
+
return t;
|
488
488
|
}
|
489
|
-
function
|
490
|
-
for (var r = -1, i =
|
491
|
-
var s =
|
492
|
-
n(o, s) &&
|
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
|
497
|
-
return
|
498
|
-
return
|
496
|
+
function $n(t, e) {
|
497
|
+
return Un(t, e, function(n, r) {
|
498
|
+
return Fn(t, r);
|
499
499
|
});
|
500
500
|
}
|
501
|
-
var
|
502
|
-
return
|
501
|
+
var jn = Cn(function(t, e) {
|
502
|
+
return t == null ? {} : $n(t, e);
|
503
503
|
});
|
504
|
-
function
|
505
|
-
var
|
504
|
+
function kn(t) {
|
505
|
+
var e;
|
506
506
|
return [
|
507
|
-
|
507
|
+
jn(t, ["attributes", "index", "boundingBox", "boundingSphere"]),
|
508
508
|
[
|
509
|
-
...Object.values(
|
509
|
+
...Object.values(t.attributes).map(
|
510
510
|
(n) => n.array.buffer
|
511
511
|
),
|
512
|
-
(
|
512
|
+
(e = t.index) == null ? void 0 : e.array.buffer
|
513
513
|
].filter((n) => n != null)
|
514
514
|
];
|
515
515
|
}
|
516
|
-
function
|
517
|
-
for (const [n, r] of Object.entries(
|
518
|
-
|
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 (
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
) : null,
|
531
|
-
const { min: n, max: r } =
|
532
|
-
|
533
|
-
new
|
534
|
-
new
|
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 (
|
538
|
-
const { center: n, radius: r } =
|
539
|
-
|
540
|
-
new
|
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
|
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
|
547
|
-
const i = new DataView(
|
548
|
-
for (let s = 0, o = 0; s < a.length; ++s, o +=
|
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
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
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
|
-
|
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(
|
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
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
}
|
584
|
-
|
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
|
-
|
591
|
-
|
592
|
-
super(...arguments);
|
593
|
-
c(this, "parseTypedArray", Fn);
|
594
|
-
}
|
582
|
+
function sr(t) {
|
583
|
+
return new (I(t))();
|
595
584
|
}
|
596
|
-
const
|
597
|
-
format:
|
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
|
592
|
+
class Bn extends H {
|
604
593
|
constructor() {
|
605
594
|
super(...arguments);
|
606
|
-
|
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
|
-
(
|
613
|
-
s.image.data =
|
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
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
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
|
-
|
632
|
-
|
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
|
-
|
643
|
-
|
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
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
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
|
665
|
-
function
|
666
|
-
return 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
|
669
|
-
return Math.min(Math.max(
|
642
|
+
function Or(t) {
|
643
|
+
return Math.min(Math.max(t, 0), 1);
|
670
644
|
}
|
671
|
-
function
|
672
|
-
const i = Math.abs(
|
673
|
-
return i <= r || i <= n * Math.max(Math.abs(
|
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,
|
676
|
-
class
|
677
|
-
constructor(
|
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
|
-
|
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
|
-
|
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
|
-
|
686
|
-
|
687
|
-
this.distance =
|
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(
|
693
|
-
this._distance = Math.max(
|
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(
|
699
|
-
this._pitch =
|
672
|
+
set pitch(e) {
|
673
|
+
this._pitch = qn(e, -Math.PI / 2 + G, Math.PI / 2 - G);
|
700
674
|
}
|
701
|
-
set(
|
702
|
-
return this.distance =
|
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
|
679
|
+
return new Tt(this.distance, this.heading, this.pitch, this.roll);
|
706
680
|
}
|
707
|
-
copy(
|
708
|
-
return this.distance =
|
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(
|
711
|
-
return
|
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(
|
687
|
+
decompose(e, n, r, i, a = et.WGS84) {
|
714
688
|
a.getEastNorthUpVectors(
|
715
|
-
|
716
|
-
O,
|
689
|
+
e,
|
717
690
|
M,
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
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
|
-
|
704
|
+
Wn.lookAt(n, e, f)
|
731
705
|
);
|
732
706
|
}
|
733
|
-
setFromCamera(
|
734
|
-
const r =
|
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
|
-
|
714
|
+
z,
|
715
|
+
f
|
742
716
|
), this.heading = Math.atan2(
|
743
|
-
|
744
|
-
|
745
|
-
), this.pitch = Math.asin(
|
746
|
-
const s =
|
747
|
-
return this.roll = 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;
|
748
722
|
}
|
749
723
|
}
|
750
|
-
const
|
751
|
-
constructor(
|
752
|
-
this.west =
|
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
|
756
|
-
return
|
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(
|
762
|
-
return this.west =
|
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
|
739
|
+
return new S(this.west, this.south, this.east, this.north);
|
766
740
|
}
|
767
|
-
copy(
|
768
|
-
return this.west =
|
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(
|
771
|
-
return
|
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(
|
747
|
+
at(e, n, r = new _()) {
|
774
748
|
return r.set(
|
775
|
-
this.west + (this.east - this.west) *
|
749
|
+
this.west + (this.east - this.west) * e,
|
776
750
|
this.north + (this.south - this.north) * n
|
777
751
|
);
|
778
752
|
}
|
779
|
-
fromArray(
|
780
|
-
return this.west =
|
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(
|
783
|
-
return
|
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
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
763
|
+
l(S, "MAX", /* @__PURE__ */ new S(
|
764
|
+
_.MIN_LONGITUDE,
|
765
|
+
_.MIN_LATITUDE,
|
766
|
+
_.MAX_LONGITUDE,
|
767
|
+
_.MAX_LATITUDE
|
794
768
|
));
|
795
|
-
let
|
796
|
-
function*
|
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,
|
800
|
-
[
|
801
|
-
[
|
802
|
-
[
|
803
|
-
[
|
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
|
807
|
-
for (const
|
808
|
-
yield
|
780
|
+
for (const v of d)
|
781
|
+
for (const $ of St(...v, r, i))
|
782
|
+
yield $;
|
809
783
|
else
|
810
|
-
for (const
|
811
|
-
yield (i ?? new
|
784
|
+
for (const v of d)
|
785
|
+
yield (i ?? new P()).set(...v);
|
812
786
|
}
|
813
|
-
class
|
814
|
-
constructor(
|
815
|
-
this.x =
|
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(
|
818
|
-
return this.x =
|
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
|
795
|
+
return new P(this.x, this.y, this.z);
|
822
796
|
}
|
823
|
-
copy(
|
824
|
-
return this.x =
|
797
|
+
copy(e) {
|
798
|
+
return this.x = e.x, this.y = e.y, this.z = e.z, this;
|
825
799
|
}
|
826
|
-
equals(
|
827
|
-
return
|
800
|
+
equals(e) {
|
801
|
+
return e.x === this.x && e.y === this.y && e.z === this.z;
|
828
802
|
}
|
829
|
-
getParent(
|
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
|
805
|
+
return e.set(Math.floor(r * s), Math.floor(i * s), a);
|
832
806
|
}
|
833
|
-
*traverseChildren(
|
807
|
+
*traverseChildren(e, n) {
|
834
808
|
const { x: r, y: i, z: a } = this;
|
835
|
-
for (const s of
|
809
|
+
for (const s of St(r, i, a, a + e, n))
|
836
810
|
yield s;
|
837
811
|
}
|
838
|
-
fromArray(
|
839
|
-
return this.x =
|
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(
|
842
|
-
return
|
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
|
850
|
-
constructor(
|
851
|
-
this.width =
|
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
|
828
|
+
return new At(this.width, this.height, this.rectangle.clone());
|
855
829
|
}
|
856
|
-
copy(
|
857
|
-
return this.width =
|
830
|
+
copy(e) {
|
831
|
+
return this.width = e.width, this.height = e.height, this.rectangle.copy(e.rectangle), this;
|
858
832
|
}
|
859
|
-
getSize(
|
860
|
-
return n.set(this.width <<
|
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(
|
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 =
|
839
|
+
let o = e.longitude;
|
866
840
|
this.rectangle.east < this.rectangle.west && (o += Math.PI * 2);
|
867
|
-
let
|
868
|
-
|
869
|
-
let
|
870
|
-
return
|
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(
|
874
|
-
const r = this.getSize(
|
875
|
-
return n.west =
|
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
|
852
|
+
const Mr = Rt, zr = Ht, Er = Bt;
|
879
853
|
export {
|
880
|
-
|
881
|
-
|
854
|
+
Vt as ArrayBufferLoader,
|
855
|
+
Bn as DataLoader,
|
882
856
|
et as Ellipsoid,
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
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
|