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