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