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