world.ts 0.3.3 → 0.3.4
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/dist/index.js +396 -384
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const At = (e, t) => {
|
|
2
2
|
let n;
|
|
3
3
|
return (...i) => {
|
|
4
4
|
clearTimeout(n), n = setTimeout(() => e(i), t);
|
|
5
5
|
};
|
|
6
|
-
}, ie = (e, t) => Array.from({ length: t - e }, (n, i) => i + e),
|
|
6
|
+
}, ie = (e, t) => Array.from({ length: t - e }, (n, i) => i + e), bt = ({
|
|
7
7
|
gl: e,
|
|
8
8
|
vertexSource: t,
|
|
9
9
|
fragmentSource: n
|
|
@@ -22,56 +22,56 @@ const Rt = (e, t) => {
|
|
|
22
22
|
);
|
|
23
23
|
if (e.attachShader(i, r), e.attachShader(i, s), e.linkProgram(i), !e.getProgramParameter(i, e.LINK_STATUS))
|
|
24
24
|
throw console.error("Link failure", e.getProgramInfoLog(i)), new Error("Link failure");
|
|
25
|
-
const o = () => e.useProgram(i), c = (
|
|
26
|
-
const R = e.getUniformLocation(i,
|
|
27
|
-
return { set: (
|
|
28
|
-
R &&
|
|
25
|
+
const o = () => e.useProgram(i), c = (x, _) => {
|
|
26
|
+
const R = e.getUniformLocation(i, x);
|
|
27
|
+
return { set: (S) => {
|
|
28
|
+
R && _(R, S);
|
|
29
29
|
} };
|
|
30
|
-
}, a = (
|
|
31
|
-
|
|
32
|
-
(
|
|
33
|
-
), h = (
|
|
34
|
-
|
|
35
|
-
(
|
|
36
|
-
), u = (
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
), d = (
|
|
40
|
-
|
|
41
|
-
(
|
|
42
|
-
), m = (
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
(
|
|
48
|
-
), w = (
|
|
49
|
-
|
|
50
|
-
(
|
|
51
|
-
),
|
|
52
|
-
name:
|
|
53
|
-
buffer:
|
|
30
|
+
}, a = (x) => c(x, (_, R) => e.uniform1f(_, R)), f = (x) => c(x, (_, R) => e.uniform1i(_, R)), l = (x) => c(
|
|
31
|
+
x,
|
|
32
|
+
(_, [R = 0, b = 0]) => e.uniform2f(_, R, b)
|
|
33
|
+
), h = (x) => c(
|
|
34
|
+
x,
|
|
35
|
+
(_, [R = 0, b = 0]) => e.uniform2i(_, R, b)
|
|
36
|
+
), u = (x) => c(
|
|
37
|
+
x,
|
|
38
|
+
(_, [R = 0, b = 0, S = 0]) => e.uniform3f(_, R, b, S)
|
|
39
|
+
), d = (x) => c(
|
|
40
|
+
x,
|
|
41
|
+
(_, [R = 0, b = 0, S = 0]) => e.uniform3i(_, R, b, S)
|
|
42
|
+
), m = (x) => c(
|
|
43
|
+
x,
|
|
44
|
+
(_, [R = 0, b = 0, S = 0, P = 0]) => e.uniform4f(_, R, b, S, P)
|
|
45
|
+
), y = (x) => c(
|
|
46
|
+
x,
|
|
47
|
+
(_, [R = 0, b = 0, S = 0, P = 0]) => e.uniform4i(_, R, b, S, P)
|
|
48
|
+
), w = (x) => c(
|
|
49
|
+
x,
|
|
50
|
+
(_, R) => e.uniformMatrix4fv(_, !1, R)
|
|
51
|
+
), E = ({
|
|
52
|
+
name: x,
|
|
53
|
+
buffer: _,
|
|
54
54
|
size: R,
|
|
55
|
-
type:
|
|
56
|
-
stride:
|
|
55
|
+
type: b,
|
|
56
|
+
stride: S,
|
|
57
57
|
offset: P
|
|
58
58
|
}) => {
|
|
59
|
-
const U = e.getAttribLocation(i,
|
|
59
|
+
const U = e.getAttribLocation(i, x);
|
|
60
60
|
if (U === -1)
|
|
61
|
-
throw new Error(`Missing attribute: ${
|
|
61
|
+
throw new Error(`Missing attribute: ${x}`);
|
|
62
62
|
return { use: () => {
|
|
63
|
-
|
|
63
|
+
_.use(), e.enableVertexAttribArray(U), ["u16", "i32"].includes(b) ? e.vertexAttribIPointer(
|
|
64
64
|
U,
|
|
65
65
|
R,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
b === "u16" ? e.UNSIGNED_SHORT : e.INT,
|
|
67
|
+
S || 0,
|
|
68
68
|
P || 0
|
|
69
69
|
) : e.vertexAttribPointer(
|
|
70
70
|
U,
|
|
71
71
|
R,
|
|
72
72
|
e.FLOAT,
|
|
73
73
|
!1,
|
|
74
|
-
|
|
74
|
+
S || 0,
|
|
75
75
|
P || 0
|
|
76
76
|
);
|
|
77
77
|
} };
|
|
@@ -85,12 +85,12 @@ const Rt = (e, t) => {
|
|
|
85
85
|
uniform3f: u,
|
|
86
86
|
uniform3i: d,
|
|
87
87
|
uniform4f: m,
|
|
88
|
-
uniform4i:
|
|
88
|
+
uniform4i: y,
|
|
89
89
|
uniformMatrix4f: w,
|
|
90
|
-
attribute1f: (
|
|
91
|
-
attribute2f: (
|
|
92
|
-
attribute3f: (
|
|
93
|
-
attribute3i: (
|
|
90
|
+
attribute1f: (x, _, R = {}) => E({ name: x, buffer: _, size: 1, type: "f32", ...R }),
|
|
91
|
+
attribute2f: (x, _, R = {}) => E({ name: x, buffer: _, size: 2, type: "f32", ...R }),
|
|
92
|
+
attribute3f: (x, _, R = {}) => E({ name: x, buffer: _, size: 3, type: "f32", ...R }),
|
|
93
|
+
attribute3i: (x, _, R = {}) => E({ name: x, buffer: _, size: 3, type: "i32", ...R }),
|
|
94
94
|
dispose: () => {
|
|
95
95
|
e.deleteProgram(i), e.deleteShader(r), e.deleteShader(s);
|
|
96
96
|
}
|
|
@@ -111,7 +111,7 @@ const Rt = (e, t) => {
|
|
|
111
111
|
const o = r + s, c = t.get(o);
|
|
112
112
|
if (c)
|
|
113
113
|
return c;
|
|
114
|
-
const a =
|
|
114
|
+
const a = bt({ gl: e, vertexSource: r, fragmentSource: s });
|
|
115
115
|
return t.set(o, a), a;
|
|
116
116
|
},
|
|
117
117
|
dispose: () => [...t.values()].forEach((r) => r.dispose())
|
|
@@ -124,7 +124,7 @@ const Rt = (e, t) => {
|
|
|
124
124
|
return { gl: t, programs: n, dispose: i };
|
|
125
125
|
};
|
|
126
126
|
var St = 1e-6, Y = typeof Float32Array < "u" ? Float32Array : Array;
|
|
127
|
-
function
|
|
127
|
+
function Ut(e) {
|
|
128
128
|
Y = e;
|
|
129
129
|
}
|
|
130
130
|
Math.hypot || (Math.hypot = function() {
|
|
@@ -132,7 +132,7 @@ Math.hypot || (Math.hypot = function() {
|
|
|
132
132
|
e += arguments[t] * arguments[t];
|
|
133
133
|
return Math.sqrt(e);
|
|
134
134
|
});
|
|
135
|
-
function
|
|
135
|
+
function Pt() {
|
|
136
136
|
var e = new Y(9);
|
|
137
137
|
return Y != Float32Array && (e[1] = 0, e[2] = 0, e[3] = 0, e[5] = 0, e[6] = 0, e[7] = 0), e[0] = 1, e[4] = 1, e[8] = 1, e;
|
|
138
138
|
}
|
|
@@ -143,44 +143,44 @@ function xe() {
|
|
|
143
143
|
function rt(e) {
|
|
144
144
|
return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
var n = t[0], i = t[1], r = t[2], s = t[3], o = t[4], c = t[5], a = t[6], f = t[7], l = t[8], h = t[9], u = t[10], d = t[11], m = t[12],
|
|
148
|
-
return
|
|
149
|
-
}
|
|
150
|
-
function zt(e, t, n) {
|
|
151
|
-
var i = t[0], r = t[1], s = t[2], o = t[3], c = t[4], a = t[5], f = t[6], l = t[7], h = t[8], u = t[9], d = t[10], m = t[11], _ = t[12], w = t[13], x = t[14], A = t[15], v = n[0], T = n[1], p = n[2], g = n[3];
|
|
152
|
-
return e[0] = v * i + T * c + p * h + g * _, e[1] = v * r + T * a + p * u + g * w, e[2] = v * s + T * f + p * d + g * x, e[3] = v * o + T * l + p * m + g * A, v = n[4], T = n[5], p = n[6], g = n[7], e[4] = v * i + T * c + p * h + g * _, e[5] = v * r + T * a + p * u + g * w, e[6] = v * s + T * f + p * d + g * x, e[7] = v * o + T * l + p * m + g * A, v = n[8], T = n[9], p = n[10], g = n[11], e[8] = v * i + T * c + p * h + g * _, e[9] = v * r + T * a + p * u + g * w, e[10] = v * s + T * f + p * d + g * x, e[11] = v * o + T * l + p * m + g * A, v = n[12], T = n[13], p = n[14], g = n[15], e[12] = v * i + T * c + p * h + g * _, e[13] = v * r + T * a + p * u + g * w, e[14] = v * s + T * f + p * d + g * x, e[15] = v * o + T * l + p * m + g * A, e;
|
|
146
|
+
function zt(e, t) {
|
|
147
|
+
var n = t[0], i = t[1], r = t[2], s = t[3], o = t[4], c = t[5], a = t[6], f = t[7], l = t[8], h = t[9], u = t[10], d = t[11], m = t[12], y = t[13], w = t[14], E = t[15], A = n * c - i * o, v = n * a - r * o, T = n * f - s * o, p = i * a - r * c, g = i * f - s * c, x = r * f - s * a, _ = l * y - h * m, R = l * w - u * m, b = l * E - d * m, S = h * w - u * y, P = h * E - d * y, U = u * E - d * w, M = A * U - v * P + T * S + p * b - g * R + x * _;
|
|
148
|
+
return M ? (M = 1 / M, e[0] = (c * U - a * P + f * S) * M, e[1] = (r * P - i * U - s * S) * M, e[2] = (y * x - w * g + E * p) * M, e[3] = (u * g - h * x - d * p) * M, e[4] = (a * b - o * U - f * R) * M, e[5] = (n * U - r * b + s * R) * M, e[6] = (w * T - m * x - E * v) * M, e[7] = (l * x - u * T + d * v) * M, e[8] = (o * P - c * b + f * _) * M, e[9] = (i * b - n * P - s * _) * M, e[10] = (m * g - y * T + E * A) * M, e[11] = (h * T - l * g - d * A) * M, e[12] = (c * R - o * S - a * _) * M, e[13] = (n * S - i * R + r * _) * M, e[14] = (y * v - m * p - w * A) * M, e[15] = (l * p - h * v + u * A) * M, e) : null;
|
|
153
149
|
}
|
|
154
150
|
function Lt(e, t, n) {
|
|
151
|
+
var i = t[0], r = t[1], s = t[2], o = t[3], c = t[4], a = t[5], f = t[6], l = t[7], h = t[8], u = t[9], d = t[10], m = t[11], y = t[12], w = t[13], E = t[14], A = t[15], v = n[0], T = n[1], p = n[2], g = n[3];
|
|
152
|
+
return e[0] = v * i + T * c + p * h + g * y, e[1] = v * r + T * a + p * u + g * w, e[2] = v * s + T * f + p * d + g * E, e[3] = v * o + T * l + p * m + g * A, v = n[4], T = n[5], p = n[6], g = n[7], e[4] = v * i + T * c + p * h + g * y, e[5] = v * r + T * a + p * u + g * w, e[6] = v * s + T * f + p * d + g * E, e[7] = v * o + T * l + p * m + g * A, v = n[8], T = n[9], p = n[10], g = n[11], e[8] = v * i + T * c + p * h + g * y, e[9] = v * r + T * a + p * u + g * w, e[10] = v * s + T * f + p * d + g * E, e[11] = v * o + T * l + p * m + g * A, v = n[12], T = n[13], p = n[14], g = n[15], e[12] = v * i + T * c + p * h + g * y, e[13] = v * r + T * a + p * u + g * w, e[14] = v * s + T * f + p * d + g * E, e[15] = v * o + T * l + p * m + g * A, e;
|
|
153
|
+
}
|
|
154
|
+
function Nt(e, t, n) {
|
|
155
155
|
var i = n[0], r = n[1], s = n[2];
|
|
156
156
|
return e[0] = t[0] * i, e[1] = t[1] * i, e[2] = t[2] * i, e[3] = t[3] * i, e[4] = t[4] * r, e[5] = t[5] * r, e[6] = t[6] * r, e[7] = t[7] * r, e[8] = t[8] * s, e[9] = t[9] * s, e[10] = t[10] * s, e[11] = t[11] * s, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Dt(e, t, n) {
|
|
159
159
|
var i = Math.sin(n), r = Math.cos(n), s = t[4], o = t[5], c = t[6], a = t[7], f = t[8], l = t[9], h = t[10], u = t[11];
|
|
160
160
|
return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = s * r + f * i, e[5] = o * r + l * i, e[6] = c * r + h * i, e[7] = a * r + u * i, e[8] = f * r - s * i, e[9] = l * r - o * i, e[10] = h * r - c * i, e[11] = u * r - a * i, e;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function It(e, t, n) {
|
|
163
163
|
var i = Math.sin(n), r = Math.cos(n), s = t[0], o = t[1], c = t[2], a = t[3], f = t[8], l = t[9], h = t[10], u = t[11];
|
|
164
164
|
return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = s * r - f * i, e[1] = o * r - l * i, e[2] = c * r - h * i, e[3] = a * r - u * i, e[8] = s * i + f * r, e[9] = o * i + l * r, e[10] = c * i + h * r, e[11] = a * i + u * r, e;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Ot(e, t, n) {
|
|
167
167
|
var i = Math.sin(n), r = Math.cos(n), s = t[0], o = t[1], c = t[2], a = t[3], f = t[4], l = t[5], h = t[6], u = t[7];
|
|
168
168
|
return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = s * r + f * i, e[1] = o * r + l * i, e[2] = c * r + h * i, e[3] = a * r + u * i, e[4] = f * r - s * i, e[5] = l * r - o * i, e[6] = h * r - c * i, e[7] = u * r - a * i, e;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var n = t[0], i = t[1], r = t[2], s = t[3], o = n + n, c = i + i, a = r + r, f = n * o, l = i * o, h = i * c, u = r * o, d = r * c, m = r * a,
|
|
172
|
-
return e[0] = 1 - h - m, e[1] = l +
|
|
170
|
+
function Ct(e, t) {
|
|
171
|
+
var n = t[0], i = t[1], r = t[2], s = t[3], o = n + n, c = i + i, a = r + r, f = n * o, l = i * o, h = i * c, u = r * o, d = r * c, m = r * a, y = s * o, w = s * c, E = s * a;
|
|
172
|
+
return e[0] = 1 - h - m, e[1] = l + E, e[2] = u - w, e[3] = 0, e[4] = l - E, e[5] = 1 - f - m, e[6] = d + y, e[7] = 0, e[8] = u + w, e[9] = d - y, e[10] = 1 - f - h, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Xt(e, t, n, i, r) {
|
|
175
175
|
var s = 1 / Math.tan(t / 2), o;
|
|
176
176
|
return e[0] = s / n, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = s, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[11] = -1, e[12] = 0, e[13] = 0, e[15] = 0, r != null && r !== 1 / 0 ? (o = 1 / (i - r), e[10] = (r + i) * o, e[14] = 2 * r * i * o) : (e[10] = -1, e[14] = -2 * i), e;
|
|
177
177
|
}
|
|
178
|
-
var
|
|
178
|
+
var Wt = Xt;
|
|
179
179
|
function z() {
|
|
180
180
|
var e = new Y(3);
|
|
181
181
|
return Y != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0), e;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function jt(e) {
|
|
184
184
|
var t = e[0], n = e[1], i = e[2];
|
|
185
185
|
return Math.hypot(t, n, i);
|
|
186
186
|
}
|
|
@@ -188,7 +188,7 @@ function st(e, t, n) {
|
|
|
188
188
|
var i = new Y(3);
|
|
189
189
|
return i[0] = e, i[1] = t, i[2] = n, i;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Bt(e, t) {
|
|
192
192
|
return e[0] = t[0], e[1] = t[1], e[2] = t[2], e;
|
|
193
193
|
}
|
|
194
194
|
function we(e, t, n, i) {
|
|
@@ -197,7 +197,7 @@ function we(e, t, n, i) {
|
|
|
197
197
|
function ne(e, t, n) {
|
|
198
198
|
return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Zt(e, t, n) {
|
|
201
201
|
return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e;
|
|
202
202
|
}
|
|
203
203
|
function le(e, t, n) {
|
|
@@ -207,22 +207,22 @@ function Te(e, t) {
|
|
|
207
207
|
var n = t[0] - e[0], i = t[1] - e[1], r = t[2] - e[2];
|
|
208
208
|
return Math.hypot(n, i, r);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Vt(e, t) {
|
|
211
211
|
var n = t[0], i = t[1], r = t[2], s = n * n + i * i + r * r;
|
|
212
212
|
return s > 0 && (s = 1 / Math.sqrt(s)), e[0] = t[0] * s, e[1] = t[1] * s, e[2] = t[2] * s, e;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Yt(e, t) {
|
|
215
215
|
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
|
|
216
216
|
}
|
|
217
217
|
function Ve(e, t, n) {
|
|
218
218
|
var i = t[0], r = t[1], s = t[2], o = n[0], c = n[1], a = n[2];
|
|
219
219
|
return e[0] = r * a - s * c, e[1] = s * o - i * a, e[2] = i * c - r * o, e;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function $t(e, t, n, i) {
|
|
222
222
|
var r = t[0], s = t[1], o = t[2];
|
|
223
223
|
return e[0] = r + i * (n[0] - r), e[1] = s + i * (n[1] - s), e[2] = o + i * (n[2] - o), e;
|
|
224
224
|
}
|
|
225
|
-
var re =
|
|
225
|
+
var re = Zt, kt = jt;
|
|
226
226
|
(function() {
|
|
227
227
|
var e = z();
|
|
228
228
|
return function(t, n, i, r, s, o) {
|
|
@@ -236,37 +236,37 @@ function ee() {
|
|
|
236
236
|
var e = new Y(4);
|
|
237
237
|
return Y != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 0), e;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Ht(e, t) {
|
|
240
240
|
return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
|
|
241
241
|
}
|
|
242
242
|
function ot(e, t, n, i, r) {
|
|
243
243
|
return e[0] = t, e[1] = n, e[2] = i, e[3] = r, e;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Gt(e, t, n) {
|
|
246
246
|
return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e[2] = t[2] + n[2], e[3] = t[3] + n[3], e;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Ft(e, t, n) {
|
|
249
249
|
return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e[3] = t[3] - n[3], e;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Kt(e, t, n) {
|
|
252
252
|
return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Qt(e, t) {
|
|
255
255
|
var n = t[0] - e[0], i = t[1] - e[1], r = t[2] - e[2], s = t[3] - e[3];
|
|
256
256
|
return Math.hypot(n, i, r, s);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function qt(e, t) {
|
|
259
259
|
var n = t[0], i = t[1], r = t[2], s = t[3], o = n * n + i * i + r * r + s * s;
|
|
260
260
|
return o > 0 && (o = 1 / Math.sqrt(o)), e[0] = n * o, e[1] = i * o, e[2] = r * o, e[3] = s * o, e;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Jt(e, t) {
|
|
263
263
|
return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
|
|
264
264
|
}
|
|
265
265
|
function at(e, t, n) {
|
|
266
266
|
var i = t[0], r = t[1], s = t[2], o = t[3];
|
|
267
267
|
return e[0] = n[0] * i + n[4] * r + n[8] * s + n[12] * o, e[1] = n[1] * i + n[5] * r + n[9] * s + n[13] * o, e[2] = n[2] * i + n[6] * r + n[10] * s + n[14] * o, e[3] = n[3] * i + n[7] * r + n[11] * s + n[15] * o, e;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var en = Ft;
|
|
270
270
|
(function() {
|
|
271
271
|
var e = ee();
|
|
272
272
|
return function(t, n, i, r, s, o) {
|
|
@@ -280,20 +280,20 @@ function He() {
|
|
|
280
280
|
var e = new Y(4);
|
|
281
281
|
return Y != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0), e[3] = 1, e;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function tn(e, t, n) {
|
|
284
284
|
n = n * 0.5;
|
|
285
285
|
var i = Math.sin(n);
|
|
286
286
|
return e[0] = i * t[0], e[1] = i * t[1], e[2] = i * t[2], e[3] = Math.cos(n), e;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
var n =
|
|
288
|
+
function nn(e, t) {
|
|
289
|
+
var n = sn(e, t);
|
|
290
290
|
return Math.acos(2 * n * n - 1);
|
|
291
291
|
}
|
|
292
292
|
function Ne(e, t, n, i) {
|
|
293
|
-
var r = t[0], s = t[1], o = t[2], c = t[3], a = n[0], f = n[1], l = n[2], h = n[3], u, d, m,
|
|
294
|
-
return d = r * a + s * f + o * l + c * h, d < 0 && (d = -d, a = -a, f = -f, l = -l, h = -h), 1 - d > St ? (u = Math.acos(d), m = Math.sin(u),
|
|
293
|
+
var r = t[0], s = t[1], o = t[2], c = t[3], a = n[0], f = n[1], l = n[2], h = n[3], u, d, m, y, w;
|
|
294
|
+
return d = r * a + s * f + o * l + c * h, d < 0 && (d = -d, a = -a, f = -f, l = -l, h = -h), 1 - d > St ? (u = Math.acos(d), m = Math.sin(u), y = Math.sin((1 - i) * u) / m, w = Math.sin(i * u) / m) : (y = 1 - i, w = i), e[0] = y * r + w * a, e[1] = y * s + w * f, e[2] = y * o + w * l, e[3] = y * c + w * h, e;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function rn(e, t) {
|
|
297
297
|
var n = t[0] + t[4] + t[8], i;
|
|
298
298
|
if (n > 0)
|
|
299
299
|
i = Math.sqrt(n + 1), e[3] = 0.5 * i, i = 0.5 / i, e[0] = (t[5] - t[7]) * i, e[1] = (t[6] - t[2]) * i, e[2] = (t[1] - t[3]) * i;
|
|
@@ -305,12 +305,12 @@ function nn(e, t) {
|
|
|
305
305
|
}
|
|
306
306
|
return e;
|
|
307
307
|
}
|
|
308
|
-
var
|
|
308
|
+
var sn = Jt, ut = qt;
|
|
309
309
|
(function() {
|
|
310
310
|
var e = z(), t = st(1, 0, 0), n = st(0, 1, 0);
|
|
311
311
|
return function(i, r, s) {
|
|
312
|
-
var o =
|
|
313
|
-
return o < -0.999999 ? (Ve(e, t, r),
|
|
312
|
+
var o = Yt(r, s);
|
|
313
|
+
return o < -0.999999 ? (Ve(e, t, r), kt(e) < 1e-6 && Ve(e, n, r), Vt(e, e), tn(i, e, Math.PI), i) : o > 0.999999 ? (i[0] = 0, i[1] = 0, i[2] = 0, i[3] = 1, i) : (Ve(e, r, s), i[0] = e[0], i[1] = e[1], i[2] = e[2], i[3] = 1 + o, ut(i, i));
|
|
314
314
|
};
|
|
315
315
|
})();
|
|
316
316
|
(function() {
|
|
@@ -320,39 +320,39 @@ var rn = qt, ut = Qt;
|
|
|
320
320
|
};
|
|
321
321
|
})();
|
|
322
322
|
(function() {
|
|
323
|
-
var e =
|
|
323
|
+
var e = Pt();
|
|
324
324
|
return function(t, n, i, r) {
|
|
325
|
-
return e[0] = i[0], e[3] = i[1], e[6] = i[2], e[1] = r[0], e[4] = r[1], e[7] = r[2], e[2] = -n[0], e[5] = -n[1], e[8] = -n[2], ut(t,
|
|
325
|
+
return e[0] = i[0], e[3] = i[1], e[6] = i[2], e[1] = r[0], e[4] = r[1], e[7] = r[2], e[2] = -n[0], e[5] = -n[1], e[8] = -n[2], ut(t, rn(t, e));
|
|
326
326
|
};
|
|
327
327
|
})();
|
|
328
328
|
function de() {
|
|
329
329
|
var e = new Y(2);
|
|
330
330
|
return Y != Float32Array && (e[0] = 0, e[1] = 0), e;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function on(e, t) {
|
|
333
333
|
return e[0] = t[0], e[1] = t[1], e;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function an(e, t, n) {
|
|
336
336
|
return e[0] = t, e[1] = n, e;
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function cn(e, t, n) {
|
|
339
339
|
return e[0] = t[0] + n[0], e[1] = t[1] + n[1], e;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function fn(e, t, n) {
|
|
342
342
|
return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function ln(e, t, n) {
|
|
345
345
|
return e[0] = t[0] * n, e[1] = t[1] * n, e;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function un(e, t) {
|
|
348
348
|
var n = t[0] - e[0], i = t[1] - e[1];
|
|
349
349
|
return Math.hypot(n, i);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function hn(e, t) {
|
|
352
352
|
var n = t[0] - e[0], i = t[1] - e[1];
|
|
353
353
|
return n * n + i * i;
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var dn = fn;
|
|
356
356
|
(function() {
|
|
357
357
|
var e = de();
|
|
358
358
|
return function(t, n, i, r, s, o) {
|
|
@@ -362,7 +362,7 @@ var hn = cn;
|
|
|
362
362
|
return t;
|
|
363
363
|
};
|
|
364
364
|
})();
|
|
365
|
-
const H = 40075017, De = (e) => e / 180 * Math.PI,
|
|
365
|
+
const H = 40075017, De = (e) => e / 180 * Math.PI, mn = (e) => e * 180 / Math.PI, vn = (e, t, n) => {
|
|
366
366
|
const i = Math.sqrt(t * t - 4 * e * n);
|
|
367
367
|
return [(-t - i) / (2 * e), (-t + i) / (2 * e)];
|
|
368
368
|
}, L = ([e = 0, t = 0, n = 0], i = z()) => we(
|
|
@@ -373,18 +373,18 @@ const H = 40075017, De = (e) => e / 180 * Math.PI, dn = (e) => e * 180 / Math.PI
|
|
|
373
373
|
), se = ([e = 0, t = 0, n = 0], i = z()) => we(
|
|
374
374
|
i,
|
|
375
375
|
(e - 0.5) * 360,
|
|
376
|
-
|
|
376
|
+
mn(Math.atan(Math.sinh(-(t - 0.5) * (2 * Math.PI)))),
|
|
377
377
|
n * H
|
|
378
|
-
),
|
|
378
|
+
), ht = ([e = 0, t = 0, n = 0], i = z()) => {
|
|
379
379
|
const r = 2 ** -n;
|
|
380
380
|
return we(i, e * r, t * r, 0);
|
|
381
|
-
},
|
|
381
|
+
}, Se = ([e = 0, t = 0, n = 0]) => {
|
|
382
382
|
const i = Math.cos(t * 0.5), r = Math.sin(t * 0.5), s = Math.cos(e * 0.5), o = Math.sin(e * 0.5), c = Math.cos(n * 0.5), a = Math.sin(n * 0.5), f = c * s * i + a * o * r, l = a * s * i - c * o * r, h = c * o * i + a * s * r, u = c * s * r - a * o * i;
|
|
383
383
|
return [l, h, u, f];
|
|
384
384
|
}, pn = ([e = 0, t = 0, n = 0, i = 0]) => {
|
|
385
385
|
const r = Math.atan2(2 * (i * e + t * n), 1 - 2 * (e * e + t * t)), s = Math.asin(Math.min(1, 2 * (i * t - n * e))), o = Math.atan2(2 * (i * n + e * t), 1 - 2 * (t * t + n * n));
|
|
386
386
|
return [s, o, r];
|
|
387
|
-
},
|
|
387
|
+
}, dt = {
|
|
388
388
|
target: [0, 0, 0],
|
|
389
389
|
offset: [0, 0],
|
|
390
390
|
distance: H,
|
|
@@ -392,33 +392,33 @@ const H = 40075017, De = (e) => e / 180 * Math.PI, dn = (e) => e * 180 / Math.PI
|
|
|
392
392
|
fieldOfView: 45
|
|
393
393
|
}, xn = xe(), En = ee(), J = (e, t) => {
|
|
394
394
|
const { target: n, offset: i, distance: r, orientation: s, fieldOfView: o } = {
|
|
395
|
-
...
|
|
395
|
+
...dt,
|
|
396
396
|
...e
|
|
397
|
-
}, [c = 0, a = 0] = t, [f = 0, l = 0] = i, [h = 0, u = 0, d = 0] = s, m = Math.tan(De(45) / 2) / Math.tan(De(o) / 2),
|
|
398
|
-
rt(A),
|
|
397
|
+
}, [c = 0, a = 0] = t, [f = 0, l = 0] = i, [h = 0, u = 0, d = 0] = s, m = Math.tan(De(45) / 2) / Math.tan(De(o) / 2), y = r / H * m, w = y / 100, E = y * 1e6, A = xe();
|
|
398
|
+
rt(A), Wt(A, De(o), c / a, w, E), Nt(A, A, [1, -1, 1]);
|
|
399
399
|
const v = xe();
|
|
400
|
-
rt(v),
|
|
401
|
-
const T =
|
|
400
|
+
rt(v), Dt(v, v, h), It(v, v, u), Ot(v, v, d);
|
|
401
|
+
const T = Lt(xn, A, v), p = zt(xe(), T), g = (O) => {
|
|
402
402
|
const W = [c * O, a * O], k = [f * O, l * O];
|
|
403
403
|
return J({ ...e, offset: k }, W);
|
|
404
|
-
},
|
|
404
|
+
}, x = ([O = 0, W = 0], k = ee()) => {
|
|
405
405
|
const K = 2 * O / c - 1, ve = -(2 * W / a - 1);
|
|
406
406
|
return ot(k, K, ve, 0, 1);
|
|
407
|
-
},
|
|
407
|
+
}, _ = ([O = 0, W = 0, , k = 0], K = de()) => an(K, (1 + O / k) * c * 0.5, (1 - W / k) * a * 0.5), R = (O, W = z()) => {
|
|
408
408
|
const [k = 0, K = 0, ve = 0, pe = 0] = at(En, O, p);
|
|
409
409
|
return we(W, k / pe, K / pe, ve / pe);
|
|
410
|
-
},
|
|
411
|
-
(I - U) * (I - U) + (j -
|
|
412
|
-
U * (I - U) +
|
|
413
|
-
U * U +
|
|
410
|
+
}, b = ([O = 0, W = 0, k = 0], K = ee()) => at(K, ot(K, O, W, k, 1), T), [S = 0, P = 0] = x([f + c / 2, l + a / 2]), [U = 0, M = 0, N = 0] = R([S, P, -1, 1]), [I = 0, j = 0, X = 0] = R([S, P, 1.00001, 1]), [C = 0] = vn(
|
|
411
|
+
(I - U) * (I - U) + (j - M) * (j - M) + (X - N) * (X - N),
|
|
412
|
+
U * (I - U) + M * (j - M) + N * (X - N),
|
|
413
|
+
U * U + M * M + N * N - r * r / H / H * m * m
|
|
414
414
|
);
|
|
415
415
|
if (isNaN(C))
|
|
416
416
|
throw new Error("Unexpected");
|
|
417
417
|
const G = [
|
|
418
418
|
U + C * (I - U),
|
|
419
|
-
|
|
419
|
+
M + C * (j - M),
|
|
420
420
|
N + C * (X - N)
|
|
421
|
-
], Z = re(z(), L(n), G), $ = (O, W = z()) => ne(W, O, Z),
|
|
421
|
+
], Z = re(z(), L(n), G), $ = (O, W = z()) => ne(W, O, Z), Me = (O, W = z()) => re(W, O, Z);
|
|
422
422
|
return {
|
|
423
423
|
camera: Z,
|
|
424
424
|
screen: t,
|
|
@@ -426,16 +426,16 @@ const H = 40075017, De = (e) => e / 180 * Math.PI, dn = (e) => e * 180 / Math.PI
|
|
|
426
426
|
modelView: v,
|
|
427
427
|
fieldScale: m,
|
|
428
428
|
scale: g,
|
|
429
|
-
screenToClip:
|
|
430
|
-
clipToScreen:
|
|
429
|
+
screenToClip: x,
|
|
430
|
+
clipToScreen: _,
|
|
431
431
|
clipToLocal: R,
|
|
432
|
-
localToClip:
|
|
432
|
+
localToClip: b,
|
|
433
433
|
localToWorld: $,
|
|
434
|
-
worldToLocal:
|
|
435
|
-
project: (O) =>
|
|
434
|
+
worldToLocal: Me,
|
|
435
|
+
project: (O) => _(b(Me(L(O)))),
|
|
436
436
|
unproject: (O, { targetZ: W = 0 } = {}) => {
|
|
437
|
-
const k =
|
|
438
|
-
return
|
|
437
|
+
const k = x(O), [K = 0, ve = 0, , pe = 0] = k, gt = [K, ve, -1, pe], et = se($(R(k))), tt = se($(R(gt))), [, , Ze = 0] = et, [, , nt = 0] = tt, Rt = Ze === nt ? 0 : (W - Ze) / (nt - Ze);
|
|
438
|
+
return $t(z(), et, tt, Rt);
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
441
|
}, _n = 100, Ti = (e, t, n) => {
|
|
@@ -447,71 +447,71 @@ const H = 40075017, De = (e) => e / 180 * Math.PI, dn = (e) => e * 180 / Math.PI
|
|
|
447
447
|
} = n;
|
|
448
448
|
let c = !1, a = !1;
|
|
449
449
|
const { view: f } = n, l = ([p = 0, g = 0]) => {
|
|
450
|
-
const [
|
|
450
|
+
const [x, _] = [
|
|
451
451
|
e.width / devicePixelRatio,
|
|
452
452
|
e.height / devicePixelRatio
|
|
453
|
-
], { camera: R, fieldScale:
|
|
453
|
+
], { camera: R, fieldScale: b } = J(f(), [x, _]), { position: S, layer: P } = t.pick([p, g]);
|
|
454
454
|
if (!P)
|
|
455
455
|
return;
|
|
456
|
-
const U = Te(L(
|
|
456
|
+
const U = Te(L(S), R) * H / b, M = [p - x / 2, g - _ / 2];
|
|
457
457
|
o({
|
|
458
|
-
offset:
|
|
459
|
-
target:
|
|
458
|
+
offset: M,
|
|
459
|
+
target: S,
|
|
460
460
|
distance: U
|
|
461
461
|
});
|
|
462
462
|
}, h = (p, g) => {
|
|
463
463
|
if (!r())
|
|
464
464
|
return;
|
|
465
465
|
a || (l([p, g]), a = !0);
|
|
466
|
-
const [
|
|
466
|
+
const [x, _] = [
|
|
467
467
|
e.width / devicePixelRatio,
|
|
468
468
|
e.height / devicePixelRatio
|
|
469
469
|
];
|
|
470
470
|
o({
|
|
471
|
-
offset: [p -
|
|
471
|
+
offset: [p - x / 2, g - _ / 2]
|
|
472
472
|
});
|
|
473
|
-
}, u = (p, g,
|
|
473
|
+
}, u = (p, g, x, _) => {
|
|
474
474
|
if (!s())
|
|
475
475
|
return;
|
|
476
476
|
r() && !a && (l([p, g]), a = !0);
|
|
477
|
-
const [R,
|
|
477
|
+
const [R, b] = [
|
|
478
478
|
e.width / devicePixelRatio,
|
|
479
479
|
e.height / devicePixelRatio
|
|
480
|
-
], { orientation: [
|
|
480
|
+
], { orientation: [S = 0, P = 0, U = 0] = [] } = f(), M = [
|
|
481
481
|
Math.min(
|
|
482
482
|
Math.PI / 2 - 0.1,
|
|
483
|
-
Math.max(0.1,
|
|
483
|
+
Math.max(0.1, S - _ / b * Math.PI)
|
|
484
484
|
),
|
|
485
485
|
P,
|
|
486
|
-
U -
|
|
486
|
+
U - x / R * Math.PI
|
|
487
487
|
];
|
|
488
488
|
o({
|
|
489
|
-
orientation:
|
|
489
|
+
orientation: M
|
|
490
490
|
});
|
|
491
491
|
}, d = (p) => {
|
|
492
492
|
p.preventDefault(), a = !1;
|
|
493
|
-
}, m = ({ buttons: p, movementX: g, movementY:
|
|
494
|
-
!i() || !p || (p === 1 && r() ? h(
|
|
495
|
-
},
|
|
493
|
+
}, m = ({ buttons: p, movementX: g, movementY: x, x: _, y: R }) => {
|
|
494
|
+
!i() || !p || (p === 1 && r() ? h(_, R) : p === 2 && s() && u(_, R, g, x));
|
|
495
|
+
}, y = (p) => {
|
|
496
496
|
p.preventDefault();
|
|
497
497
|
const g = p.touches.item(0);
|
|
498
498
|
if (!g)
|
|
499
499
|
return;
|
|
500
|
-
const { clientX:
|
|
501
|
-
h(
|
|
502
|
-
}, w =
|
|
500
|
+
const { clientX: x, clientY: _ } = g;
|
|
501
|
+
h(x, _);
|
|
502
|
+
}, w = At(() => c = !1, 100), E = ({ x: p, y: g, deltaY: x }) => {
|
|
503
503
|
if (!i())
|
|
504
504
|
return;
|
|
505
505
|
c || (r() && l([p, g]), c = !0);
|
|
506
|
-
let { distance:
|
|
507
|
-
|
|
508
|
-
Math.max(
|
|
506
|
+
let { distance: _ } = { ...dt, ...f() };
|
|
507
|
+
_ = Math.min(
|
|
508
|
+
Math.max(_ * Math.exp(x * 1e-3), _n),
|
|
509
509
|
H
|
|
510
|
-
), o({ distance:
|
|
510
|
+
), o({ distance: _ }), w();
|
|
511
511
|
}, A = (p) => p.preventDefault(), v = (p) => p.preventDefault();
|
|
512
|
-
return e.addEventListener("mousedown", d), e.addEventListener("mousemove", m), e.addEventListener("touchstart", d, { passive: !1 }), e.addEventListener("touchmove",
|
|
512
|
+
return e.addEventListener("mousedown", d), e.addEventListener("mousemove", m), e.addEventListener("touchstart", d, { passive: !1 }), e.addEventListener("touchmove", y, { passive: !1 }), e.addEventListener("gesturestart", A), e.addEventListener("wheel", E, { passive: !0 }), e.addEventListener("contextmenu", v), {
|
|
513
513
|
dispose: () => {
|
|
514
|
-
e.removeEventListener("mousedown", d), e.removeEventListener("mousemove", m), e.removeEventListener("touchstart", d), e.removeEventListener("touchmove",
|
|
514
|
+
e.removeEventListener("mousedown", d), e.removeEventListener("mousemove", m), e.removeEventListener("touchstart", d), e.removeEventListener("touchmove", y), e.removeEventListener("gesturestart", A), e.removeEventListener("wheel", E), e.removeEventListener("contextmenu", v);
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
517
|
}, V = ({
|
|
@@ -574,7 +574,7 @@ vec2 pack_index(in int index) {
|
|
|
574
574
|
void main(void) {
|
|
575
575
|
result = vec4(pack_depth(gl_FragCoord.z), pack_index(index));
|
|
576
576
|
}`;
|
|
577
|
-
const
|
|
577
|
+
const mt = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2FkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGFzeW5jIG49Pntjb25zdFtpLHRdPW4uZGF0YTtpZihpIT09ImxvYWQiKXJldHVybjtjb25zdCBvPW5ldyBBYm9ydENvbnRyb2xsZXIse3NpZ25hbDpjfT1vLHI9ZT0+e2NvbnN0W2Esc109ZS5kYXRhO2E9PT0iY2FuY2VsIiYmcz09PXQmJm8uYWJvcnQoKX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIscik7dHJ5e2NvbnN0IGU9YXdhaXQgZmV0Y2godCx7bW9kZToiY29ycyIsc2lnbmFsOmN9KTtpZighZS5vayl7cG9zdE1lc3NhZ2Uoe3VybDp0LGltYWdlOnZvaWQgMH0pO3JldHVybn1jb25zdCBhPWF3YWl0IGUuYmxvYigpLHM9YXdhaXQgY3JlYXRlSW1hZ2VCaXRtYXAoYSk7cG9zdE1lc3NhZ2Uoe3VybDp0LGltYWdlOnN9KX1jYXRjaChlKXtpZighKGUgaW5zdGFuY2VvZiBFcnJvciYmZS5tZXNzYWdlPT09IlRoZSB1c2VyIGFib3J0ZWQgYSByZXF1ZXN0LiIpKXRocm93IGV9ZmluYWxseXtyZW1vdmVFdmVudExpc3RlbmVyKCJtZXNzYWdlIixyKX19KX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPWltYWdlLWxvYWQtd29ya2VyLUJfWjJxRGl1LmpzLm1hcAo=", yn = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), ct = typeof window < "u" && window.Blob && new Blob([yn(mt)], { type: "text/javascript;charset=utf-8" });
|
|
578
578
|
function wn(e) {
|
|
579
579
|
let t;
|
|
580
580
|
try {
|
|
@@ -588,7 +588,7 @@ function wn(e) {
|
|
|
588
588
|
}), n;
|
|
589
589
|
} catch {
|
|
590
590
|
return new Worker(
|
|
591
|
-
"data:text/javascript;base64," +
|
|
591
|
+
"data:text/javascript;base64," + mt,
|
|
592
592
|
{
|
|
593
593
|
name: e?.name
|
|
594
594
|
}
|
|
@@ -616,7 +616,7 @@ const Ue = wn(), Tn = ({
|
|
|
616
616
|
},
|
|
617
617
|
cancel: s
|
|
618
618
|
};
|
|
619
|
-
},
|
|
619
|
+
}, vt = (e) => {
|
|
620
620
|
const t = e.createTexture();
|
|
621
621
|
if (!t)
|
|
622
622
|
throw new Error("Texture creation failed");
|
|
@@ -630,12 +630,12 @@ const Ue = wn(), Tn = ({
|
|
|
630
630
|
0
|
|
631
631
|
);
|
|
632
632
|
}, dispose: () => e.deleteTexture(t) };
|
|
633
|
-
},
|
|
633
|
+
}, pt = ({
|
|
634
634
|
gl: e,
|
|
635
635
|
url: t,
|
|
636
636
|
onLoad: n
|
|
637
637
|
}) => {
|
|
638
|
-
const i =
|
|
638
|
+
const i = vt(e), r = Tn({
|
|
639
639
|
url: t,
|
|
640
640
|
onLoad: (a) => {
|
|
641
641
|
a && (i.use(), e.texImage2D(
|
|
@@ -733,11 +733,11 @@ const gi = (e, t = {}) => {
|
|
|
733
733
|
const a = me(
|
|
734
734
|
() => t.url?.() ?? "",
|
|
735
735
|
(m) => {
|
|
736
|
-
const
|
|
736
|
+
const y = pt({
|
|
737
737
|
gl: n,
|
|
738
738
|
url: m,
|
|
739
|
-
onLoad: ({ width: w, height:
|
|
740
|
-
r = [w,
|
|
739
|
+
onLoad: ({ width: w, height: E }) => {
|
|
740
|
+
r = [w, E], n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), i?.dispose(), i = y;
|
|
741
741
|
}
|
|
742
742
|
});
|
|
743
743
|
}
|
|
@@ -746,25 +746,25 @@ const gi = (e, t = {}) => {
|
|
|
746
746
|
uvBuffer: o,
|
|
747
747
|
indexBuffer: c
|
|
748
748
|
}), h = ({
|
|
749
|
-
viewport: { projection: m, modelView:
|
|
749
|
+
viewport: { projection: m, modelView: y, camera: w, screen: E },
|
|
750
750
|
depth: A = !1,
|
|
751
751
|
index: v = 0
|
|
752
752
|
}) => {
|
|
753
|
-
const T = t.position?.() ?? [0, 0, 0], p = t.color?.() ?? [1, 1, 1, 1], g = t.size?.() ?? 100,
|
|
753
|
+
const T = t.position?.() ?? [0, 0, 0], p = t.color?.() ?? [1, 1, 1, 1], g = t.size?.() ?? 100, x = t.minSizePixels?.() ?? 0, _ = t.maxSizePixels?.() ?? Number.MAX_VALUE;
|
|
754
754
|
if (a(), !i || ge(n, A, t))
|
|
755
755
|
return;
|
|
756
756
|
(A ? l : f).execute({
|
|
757
757
|
projection: m,
|
|
758
|
-
modelView:
|
|
758
|
+
modelView: y,
|
|
759
759
|
camera: Q(w),
|
|
760
|
-
screen:
|
|
760
|
+
screen: E,
|
|
761
761
|
image: i,
|
|
762
762
|
imageSize: r,
|
|
763
763
|
position: Q(L(T)),
|
|
764
764
|
color: p,
|
|
765
765
|
size: g,
|
|
766
|
-
minSizePixels:
|
|
767
|
-
maxSizePixels:
|
|
766
|
+
minSizePixels: x,
|
|
767
|
+
maxSizePixels: _,
|
|
768
768
|
index: v
|
|
769
769
|
});
|
|
770
770
|
}, u = () => {
|
|
@@ -788,14 +788,14 @@ const gi = (e, t = {}) => {
|
|
|
788
788
|
stride: 2 * Float32Array.BYTES_PER_ELEMENT
|
|
789
789
|
}), h = f.attribute2f("uv", i, {
|
|
790
790
|
stride: 2 * Float32Array.BYTES_PER_ELEMENT
|
|
791
|
-
}), u = f.uniformMatrix4f("projection"), d = f.uniformMatrix4f("model_view"), m = f.uniform3i("camera"),
|
|
791
|
+
}), u = f.uniformMatrix4f("projection"), d = f.uniformMatrix4f("model_view"), m = f.uniform3i("camera"), y = f.uniform2f("screen"), w = f.uniform1i("image"), E = f.uniform2f("image_size"), A = f.uniform3i("position"), v = f.uniform4f("color"), T = f.uniform1i("index"), p = f.uniform1f("size"), g = f.uniform1f("min_size_pixels"), x = f.uniform1f("max_size_pixels");
|
|
792
792
|
return { execute: ({
|
|
793
793
|
projection: R,
|
|
794
|
-
modelView:
|
|
795
|
-
camera:
|
|
794
|
+
modelView: b,
|
|
795
|
+
camera: S,
|
|
796
796
|
screen: P,
|
|
797
797
|
image: U,
|
|
798
|
-
imageSize:
|
|
798
|
+
imageSize: M,
|
|
799
799
|
position: N,
|
|
800
800
|
color: I,
|
|
801
801
|
size: j,
|
|
@@ -803,7 +803,7 @@ const gi = (e, t = {}) => {
|
|
|
803
803
|
maxSizePixels: C,
|
|
804
804
|
index: G
|
|
805
805
|
}) => {
|
|
806
|
-
f.use(), l.use(), h.use(), u.set(R), d.set(
|
|
806
|
+
f.use(), l.use(), h.use(), u.set(R), d.set(b), m.set(S), y.set(P), E.set(M), A.set(N), v.set(I), p.set(j), g.set(X), x.set(C), T.set(G), e.activeTexture(e.TEXTURE0), w.set(0), U.use(), r.use(), e.drawElements(e.TRIANGLES, 6, e.UNSIGNED_SHORT, 0);
|
|
807
807
|
} };
|
|
808
808
|
}, o = s(), c = s(!0);
|
|
809
809
|
return { renderProgram: o, depthProgram: c };
|
|
@@ -826,13 +826,13 @@ const gi = (e, t = {}) => {
|
|
|
826
826
|
},
|
|
827
827
|
dispose: () => Object.values(i).forEach((o) => o.dispose())
|
|
828
828
|
};
|
|
829
|
-
},
|
|
829
|
+
}, bi = (e) => ({
|
|
830
830
|
render: e,
|
|
831
831
|
dispose: () => {
|
|
832
832
|
}
|
|
833
|
-
}),
|
|
833
|
+
}), Mi = () => ({ dispose: () => {
|
|
834
834
|
} });
|
|
835
|
-
var
|
|
835
|
+
var bn = `#version 300 es
|
|
836
836
|
|
|
837
837
|
precision highp float;
|
|
838
838
|
|
|
@@ -849,7 +849,7 @@ void main() {
|
|
|
849
849
|
result = color_out * texture(
|
|
850
850
|
dash,
|
|
851
851
|
vec2(fract((distance_out / dash_size) - dash_offset), 0.0));;
|
|
852
|
-
}`,
|
|
852
|
+
}`, Mn = `#version 300 es
|
|
853
853
|
|
|
854
854
|
precision highp float;
|
|
855
855
|
|
|
@@ -916,60 +916,60 @@ void main(void) {
|
|
|
916
916
|
color_out = color;
|
|
917
917
|
distance_out = distance;
|
|
918
918
|
}`;
|
|
919
|
-
const
|
|
919
|
+
const Si = (e, t = {}) => {
|
|
920
920
|
const { gl: n } = e;
|
|
921
921
|
let i = 0;
|
|
922
|
-
const r = V({ gl: n, type: "i32", target: "array" }), s = V({ gl: n, type: "u16", target: "element" }), o = V({ gl: n, type: "f32", target: "array" }), c = V({ gl: n, type: "f32", target: "array" }), { renderProgram: a, depthProgram: f } =
|
|
922
|
+
const r = V({ gl: n, type: "i32", target: "array" }), s = V({ gl: n, type: "u16", target: "element" }), o = V({ gl: n, type: "f32", target: "array" }), c = V({ gl: n, type: "f32", target: "array" }), { renderProgram: a, depthProgram: f } = Sn(e, {
|
|
923
923
|
positionBuffer: r,
|
|
924
924
|
indexBuffer: s,
|
|
925
925
|
cornerBuffer: o,
|
|
926
926
|
distanceBuffer: c
|
|
927
|
-
}), l =
|
|
927
|
+
}), l = vt(n);
|
|
928
928
|
l.use(), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.REPEAT);
|
|
929
929
|
const h = ({
|
|
930
|
-
viewport: { projection: w, modelView:
|
|
930
|
+
viewport: { projection: w, modelView: E, camera: A, screen: v },
|
|
931
931
|
depth: T = !1,
|
|
932
932
|
index: p = 0
|
|
933
933
|
}) => {
|
|
934
934
|
u(), d();
|
|
935
|
-
const g = t.color?.() ?? [1, 1, 1, 1],
|
|
935
|
+
const g = t.color?.() ?? [1, 1, 1, 1], x = t.width?.() ?? 1, _ = t.minWidthPixels?.() ?? 0, R = t.maxWidthPixels?.() ?? Number.MAX_VALUE, b = t.depthWidthPixels?.(), S = t.dashSize?.() ?? 1e3, P = t.dashOffset?.() ?? 0;
|
|
936
936
|
if (ge(n, T, t))
|
|
937
937
|
return;
|
|
938
938
|
(T ? f : a).execute({
|
|
939
939
|
projection: w,
|
|
940
|
-
modelView:
|
|
940
|
+
modelView: E,
|
|
941
941
|
camera: Q(A),
|
|
942
942
|
screen: v,
|
|
943
943
|
count: i,
|
|
944
944
|
color: g,
|
|
945
|
-
width:
|
|
946
|
-
minWidthPixels: T &&
|
|
947
|
-
maxWidthPixels: T &&
|
|
945
|
+
width: x,
|
|
946
|
+
minWidthPixels: T && b !== void 0 ? Math.max(_, b) : _,
|
|
947
|
+
maxWidthPixels: T && b !== void 0 ? Math.max(R, b) : R,
|
|
948
948
|
index: p,
|
|
949
949
|
dash: l,
|
|
950
|
-
dashSize:
|
|
950
|
+
dashSize: S,
|
|
951
951
|
dashOffset: P
|
|
952
952
|
});
|
|
953
953
|
}, u = me(
|
|
954
954
|
() => t.points?.() ?? [],
|
|
955
955
|
(w) => {
|
|
956
|
-
const
|
|
957
|
-
const [g] = p, [
|
|
958
|
-
return !g || !
|
|
956
|
+
const E = w.flatMap((p) => {
|
|
957
|
+
const [g] = p, [x] = p.slice(-1);
|
|
958
|
+
return !g || !x ? [] : [g, ...p, x].map((_) => Q(L(_))).flatMap((_) => [..._, ..._, ..._, ..._]);
|
|
959
959
|
}), { indexData: A } = w.reduce(
|
|
960
|
-
({ indexData: p, count: g },
|
|
961
|
-
if (
|
|
960
|
+
({ indexData: p, count: g }, x) => {
|
|
961
|
+
if (x.length === 0)
|
|
962
962
|
return { indexData: p, count: g };
|
|
963
|
-
const
|
|
964
|
-
const [
|
|
965
|
-
(
|
|
963
|
+
const _ = ie(0, (x.length - 1) * 2).flatMap((R) => {
|
|
964
|
+
const [b = 0, S = 0, P = 0, U = 0] = ie(0, 4).map(
|
|
965
|
+
(M) => M + R * 2 + g
|
|
966
966
|
);
|
|
967
967
|
return [
|
|
968
|
-
[
|
|
969
|
-
[
|
|
968
|
+
[b, S, U],
|
|
969
|
+
[b, U, P]
|
|
970
970
|
].flat();
|
|
971
971
|
});
|
|
972
|
-
return g += (
|
|
972
|
+
return g += (x.length + 2) * 4, p = p.concat(_), { indexData: p, count: g };
|
|
973
973
|
},
|
|
974
974
|
{ indexData: [], count: 0 }
|
|
975
975
|
);
|
|
@@ -984,15 +984,15 @@ const bi = (e, t = {}) => {
|
|
|
984
984
|
].flat()
|
|
985
985
|
)
|
|
986
986
|
), T = w.flatMap((p) => {
|
|
987
|
-
const
|
|
988
|
-
(
|
|
987
|
+
const x = p.map(
|
|
988
|
+
(b, S) => Te(L(b), L(p[S - 1] ?? b)) * H
|
|
989
989
|
).reduce(
|
|
990
|
-
({ current:
|
|
990
|
+
({ current: b, result: S }, P) => (b += P, S.push(b), { current: b, result: S }),
|
|
991
991
|
{ current: 0, result: [] }
|
|
992
|
-
).result, [
|
|
993
|
-
return
|
|
992
|
+
).result, [_] = x, [R] = x.slice(-1);
|
|
993
|
+
return _ === void 0 || R === void 0 ? [] : [_, ...x, R].flatMap((b) => [b, b, b, b]);
|
|
994
994
|
});
|
|
995
|
-
r.set(
|
|
995
|
+
r.set(E), s.set(A), o.set(v), c.set(T);
|
|
996
996
|
}
|
|
997
997
|
), d = me(
|
|
998
998
|
() => t.dashPattern?.(),
|
|
@@ -1006,18 +1006,18 @@ const bi = (e, t = {}) => {
|
|
|
1006
1006
|
0,
|
|
1007
1007
|
n.RGBA,
|
|
1008
1008
|
n.UNSIGNED_BYTE,
|
|
1009
|
-
new Uint8Array(w.flatMap((
|
|
1009
|
+
new Uint8Array(w.flatMap((E) => [...E.map((A) => A * 255)]))
|
|
1010
1010
|
);
|
|
1011
1011
|
}
|
|
1012
1012
|
), m = () => {
|
|
1013
1013
|
r.dispose(), s.dispose(), o.dispose(), c.dispose();
|
|
1014
|
-
},
|
|
1014
|
+
}, y = Ae(t);
|
|
1015
1015
|
return {
|
|
1016
1016
|
render: h,
|
|
1017
1017
|
dispose: m,
|
|
1018
|
-
...
|
|
1018
|
+
...y
|
|
1019
1019
|
};
|
|
1020
|
-
},
|
|
1020
|
+
}, Sn = ({ gl: e, programs: t }, {
|
|
1021
1021
|
positionBuffer: n,
|
|
1022
1022
|
indexBuffer: i,
|
|
1023
1023
|
cornerBuffer: r,
|
|
@@ -1025,22 +1025,22 @@ const bi = (e, t = {}) => {
|
|
|
1025
1025
|
}) => {
|
|
1026
1026
|
const o = (f = !1) => {
|
|
1027
1027
|
const l = t.get({
|
|
1028
|
-
vertexSource:
|
|
1029
|
-
fragmentSource: f ? Re :
|
|
1028
|
+
vertexSource: Mn,
|
|
1029
|
+
fragmentSource: f ? Re : bn
|
|
1030
1030
|
}), h = Float32Array.BYTES_PER_ELEMENT, u = Int32Array.BYTES_PER_ELEMENT, d = l.attribute3i("previous", n, {
|
|
1031
1031
|
stride: u * 3
|
|
1032
1032
|
}), m = l.attribute3i("current", n, {
|
|
1033
1033
|
stride: u * 3,
|
|
1034
1034
|
offset: u * 3 * 4
|
|
1035
|
-
}),
|
|
1035
|
+
}), y = l.attribute3i("next", n, {
|
|
1036
1036
|
stride: u * 3,
|
|
1037
1037
|
offset: u * 3 * 4 * 2
|
|
1038
1038
|
}), w = l.attribute2f("corner", r, {
|
|
1039
1039
|
stride: h * 2
|
|
1040
|
-
}),
|
|
1040
|
+
}), E = l.attribute1f("distance", s, {
|
|
1041
1041
|
stride: h,
|
|
1042
1042
|
offset: h * 1 * 4
|
|
1043
|
-
}), A = l.uniformMatrix4f("projection"), v = l.uniformMatrix4f("model_view"), T = l.uniform3i("camera"), p = l.uniform2f("screen"), g = l.uniform4f("color"),
|
|
1043
|
+
}), A = l.uniformMatrix4f("projection"), v = l.uniformMatrix4f("model_view"), T = l.uniform3i("camera"), p = l.uniform2f("screen"), g = l.uniform4f("color"), x = l.uniform1f("width"), _ = l.uniform1f("max_width_pixels"), R = l.uniform1f("min_width_pixels"), b = l.uniform1i("index"), S = l.uniform1i("dash"), P = l.uniform1f("dash_size"), U = l.uniform1f("dash_offset");
|
|
1044
1044
|
return { execute: ({
|
|
1045
1045
|
projection: N,
|
|
1046
1046
|
modelView: I,
|
|
@@ -1050,13 +1050,13 @@ const bi = (e, t = {}) => {
|
|
|
1050
1050
|
color: G,
|
|
1051
1051
|
width: Z,
|
|
1052
1052
|
minWidthPixels: $,
|
|
1053
|
-
maxWidthPixels:
|
|
1053
|
+
maxWidthPixels: Me,
|
|
1054
1054
|
index: qe,
|
|
1055
1055
|
dash: Je,
|
|
1056
1056
|
dashSize: O,
|
|
1057
1057
|
dashOffset: W
|
|
1058
1058
|
}) => {
|
|
1059
|
-
C !== 0 && (l.use(), d.use(), m.use(),
|
|
1059
|
+
C !== 0 && (l.use(), d.use(), m.use(), y.use(), w.use(), E.use(), A.set(N), v.set(I), T.set(j), p.set(X), g.set(G), x.set(Z), R.set($), _.set(Me), b.set(qe), P.set(O), U.set(W), e.activeTexture(e.TEXTURE0), S.set(0), Je.use(), i.use(), e.drawElements(e.TRIANGLES, C, e.UNSIGNED_SHORT, 0));
|
|
1060
1060
|
} };
|
|
1061
1061
|
}, c = o(), a = o(!0);
|
|
1062
1062
|
return { renderProgram: c, depthProgram: a };
|
|
@@ -1119,35 +1119,35 @@ const Ui = (e, t = {}) => {
|
|
|
1119
1119
|
indexBuffer: s,
|
|
1120
1120
|
normalBuffer: o
|
|
1121
1121
|
}), f = ({
|
|
1122
|
-
viewport: { projection: d, modelView: m, camera:
|
|
1123
|
-
depth:
|
|
1122
|
+
viewport: { projection: d, modelView: m, camera: y, screen: w },
|
|
1123
|
+
depth: E = !1,
|
|
1124
1124
|
index: A = 0
|
|
1125
1125
|
}) => {
|
|
1126
|
-
const v = t.position?.() ?? [0, 0, 0], T = t.orientation?.() ?? [0, 0, 0, 1], p = t.color?.() ?? [1, 1, 1, 1], g = t.diffuse?.() ?? [0, 0, 0, 0],
|
|
1127
|
-
if (l(), ge(n,
|
|
1126
|
+
const v = t.position?.() ?? [0, 0, 0], T = t.orientation?.() ?? [0, 0, 0, 1], p = t.color?.() ?? [1, 1, 1, 1], g = t.diffuse?.() ?? [0, 0, 0, 0], x = t.size?.() ?? 1, _ = t.minSizePixels?.() ?? 0, R = t.maxSizePixels?.() ?? Number.MAX_VALUE;
|
|
1127
|
+
if (l(), ge(n, E, t))
|
|
1128
1128
|
return;
|
|
1129
|
-
(
|
|
1129
|
+
(E ? a : c).execute({
|
|
1130
1130
|
projection: d,
|
|
1131
1131
|
modelView: m,
|
|
1132
|
-
camera: Q(
|
|
1132
|
+
camera: Q(y),
|
|
1133
1133
|
screen: w,
|
|
1134
1134
|
count: i,
|
|
1135
1135
|
position: Q(L(v)),
|
|
1136
|
-
orientation:
|
|
1136
|
+
orientation: Ct(xe(), T),
|
|
1137
1137
|
color: p,
|
|
1138
1138
|
diffuse: g,
|
|
1139
|
-
size:
|
|
1140
|
-
minSizePixels:
|
|
1139
|
+
size: x,
|
|
1140
|
+
minSizePixels: _,
|
|
1141
1141
|
maxSizePixels: R,
|
|
1142
1142
|
index: A
|
|
1143
1143
|
});
|
|
1144
1144
|
}, l = me(
|
|
1145
1145
|
() => t.mesh?.(),
|
|
1146
1146
|
(d) => {
|
|
1147
|
-
const { vertices: m = [], indices:
|
|
1148
|
-
r.set(m.flatMap((
|
|
1149
|
-
w.length === 0 ? m.flatMap(() => [0, 0, 0]) : w.flatMap((
|
|
1150
|
-
), i =
|
|
1147
|
+
const { vertices: m = [], indices: y = [], normals: w = [] } = d ?? {};
|
|
1148
|
+
r.set(m.flatMap((E) => [...E])), s.set(y.flatMap((E) => [...E])), o.set(
|
|
1149
|
+
w.length === 0 ? m.flatMap(() => [0, 0, 0]) : w.flatMap((E) => [...E])
|
|
1150
|
+
), i = y.length * 3;
|
|
1151
1151
|
}
|
|
1152
1152
|
), h = () => {
|
|
1153
1153
|
r.dispose(), s.dispose(), o.dispose();
|
|
@@ -1166,14 +1166,14 @@ const Ui = (e, t = {}) => {
|
|
|
1166
1166
|
const f = t.get({
|
|
1167
1167
|
vertexSource: Pn,
|
|
1168
1168
|
fragmentSource: a ? Re : Un
|
|
1169
|
-
}), l = f.attribute3f("vertex", n), h = f.attribute3f("normal", r), u = f.uniformMatrix4f("projection"), d = f.uniformMatrix4f("model_view"), m = f.uniform3i("camera"),
|
|
1169
|
+
}), l = f.attribute3f("vertex", n), h = f.attribute3f("normal", r), u = f.uniformMatrix4f("projection"), d = f.uniformMatrix4f("model_view"), m = f.uniform3i("camera"), y = f.uniform3i("position"), w = f.uniformMatrix4f("orientation"), E = f.uniform2f("screen"), A = f.uniform4f("color"), v = f.uniform4f("diffuse"), T = f.uniform1f("size"), p = f.uniform1f("min_size_pixels"), g = f.uniform1f("max_size_pixels"), x = f.uniform1i("index");
|
|
1170
1170
|
return { execute: ({
|
|
1171
1171
|
projection: R,
|
|
1172
|
-
modelView:
|
|
1173
|
-
camera:
|
|
1172
|
+
modelView: b,
|
|
1173
|
+
camera: S,
|
|
1174
1174
|
screen: P,
|
|
1175
1175
|
count: U,
|
|
1176
|
-
position:
|
|
1176
|
+
position: M,
|
|
1177
1177
|
orientation: N,
|
|
1178
1178
|
color: I,
|
|
1179
1179
|
diffuse: j,
|
|
@@ -1182,12 +1182,12 @@ const Ui = (e, t = {}) => {
|
|
|
1182
1182
|
maxSizePixels: G,
|
|
1183
1183
|
index: Z
|
|
1184
1184
|
}) => {
|
|
1185
|
-
f.use(), l.use(), h.use(), u.set(R), d.set(
|
|
1185
|
+
f.use(), l.use(), h.use(), u.set(R), d.set(b), m.set(S), E.set(P), y.set(M), w.set(N), A.set(I), v.set(j), T.set(X), p.set(C), g.set(G), x.set(Z), i.use(), e.drawElements(e.TRIANGLES, U, e.UNSIGNED_SHORT, 0);
|
|
1186
1186
|
} };
|
|
1187
1187
|
}, o = s(), c = s(!0);
|
|
1188
1188
|
return { renderProgram: o, depthProgram: c };
|
|
1189
1189
|
};
|
|
1190
|
-
var
|
|
1190
|
+
var xt = function(e, t, n, i, r) {
|
|
1191
1191
|
let s, o = null;
|
|
1192
1192
|
if (r === kn(e, t, n, i) > 0)
|
|
1193
1193
|
for (s = t; s < n; s += i)
|
|
@@ -1260,7 +1260,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1260
1260
|
let i = e;
|
|
1261
1261
|
do {
|
|
1262
1262
|
const r = i.prev, s = i.next.next;
|
|
1263
|
-
!je(r, s) &&
|
|
1263
|
+
!je(r, s) && Et(r, i, i.next, s) && _e(r, s) && _e(s, r) && (t.push(r.i / n), t.push(i.i / n), t.push(s.i / n), ye(i), ye(i.next), i = e = s), i = i.next;
|
|
1264
1264
|
} while (i !== e);
|
|
1265
1265
|
return i;
|
|
1266
1266
|
}, In = function(e, t, n, i, r, s) {
|
|
@@ -1269,7 +1269,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1269
1269
|
let c = o.next.next;
|
|
1270
1270
|
for (; c !== o.prev; ) {
|
|
1271
1271
|
if (o.i !== c.i && Vn(o, c)) {
|
|
1272
|
-
let a =
|
|
1272
|
+
let a = _t(o, c);
|
|
1273
1273
|
o = oe(o, o.next), a = oe(a, a.next), Ee(o, t, n, i, r, s, 0), Ee(a, t, n, i, r, s, 0);
|
|
1274
1274
|
return;
|
|
1275
1275
|
}
|
|
@@ -1281,7 +1281,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1281
1281
|
const r = [];
|
|
1282
1282
|
let s, o, c, a, f;
|
|
1283
1283
|
for (s = 0, o = t.length; s < o; s++)
|
|
1284
|
-
c = t[s] * i, a = s < o - 1 ? t[s + 1] * i : e.length, f =
|
|
1284
|
+
c = t[s] * i, a = s < o - 1 ? t[s + 1] * i : e.length, f = xt(e, c, a, i, !1), f === f.next && (f.steiner = !0), r.push(Zn(f));
|
|
1285
1285
|
for (r.sort(Cn), s = 0; s < r.length; s++)
|
|
1286
1286
|
n = Xn(r[s], n), n = oe(n, n.next);
|
|
1287
1287
|
return n;
|
|
@@ -1292,7 +1292,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1292
1292
|
if (n === null)
|
|
1293
1293
|
return t;
|
|
1294
1294
|
{
|
|
1295
|
-
const i =
|
|
1295
|
+
const i = _t(n, e), r = oe(n, n.next);
|
|
1296
1296
|
return oe(i, i.next), t === n ? r : t;
|
|
1297
1297
|
}
|
|
1298
1298
|
}, Wn = function(e, t) {
|
|
@@ -1360,7 +1360,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1360
1360
|
return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y);
|
|
1361
1361
|
}, je = function(e, t) {
|
|
1362
1362
|
return e.x === t.x && e.y === t.y;
|
|
1363
|
-
},
|
|
1363
|
+
}, Et = function(e, t, n, i) {
|
|
1364
1364
|
const r = Pe(D(e, t, n)), s = Pe(D(e, t, i)), o = Pe(D(n, i, e)), c = Pe(D(n, i, t));
|
|
1365
1365
|
return !!(r !== s && o !== c || r === 0 && ze(e, n, t) || s === 0 && ze(e, i, t) || o === 0 && ze(n, e, i) || c === 0 && ze(n, t, i));
|
|
1366
1366
|
}, Pe = function(e) {
|
|
@@ -1370,7 +1370,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1370
1370
|
}, Yn = function(e, t) {
|
|
1371
1371
|
let n = e;
|
|
1372
1372
|
do {
|
|
1373
|
-
if (n.i !== e.i && n.next?.i !== e.i && n.i !== t.i && n.next?.i !== t.i &&
|
|
1373
|
+
if (n.i !== e.i && n.next?.i !== e.i && n.i !== t.i && n.next?.i !== t.i && Et(n, n.next, e, t))
|
|
1374
1374
|
return !0;
|
|
1375
1375
|
n = n.next;
|
|
1376
1376
|
} while (n !== e);
|
|
@@ -1384,7 +1384,7 @@ var pt = function(e, t, n, i, r) {
|
|
|
1384
1384
|
r.y > i != r.next.y > i && r.next.y !== r.y && n < (r.next.x - r.x) * (i - r.y) / (r.next.y - r.y) + r.x && (s = !s), r = r.next;
|
|
1385
1385
|
while (r !== e);
|
|
1386
1386
|
return s;
|
|
1387
|
-
},
|
|
1387
|
+
}, _t = function(e, t) {
|
|
1388
1388
|
const n = new Ce(e.i, e.x, e.y), i = new Ce(t.i, t.x, t.y), r = e.next, s = t.prev;
|
|
1389
1389
|
return e.next = t, t.prev = e, n.next = r, r.prev = n, i.next = n, n.prev = i, s.next = i, i.prev = s, i;
|
|
1390
1390
|
}, ye = function(e) {
|
|
@@ -1411,7 +1411,7 @@ class Ce {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
function Hn(e, t = [], n = 2) {
|
|
1413
1413
|
const i = t.length > 0, r = i ? t[0] * n : e.length;
|
|
1414
|
-
let s =
|
|
1414
|
+
let s = xt(e, 0, r, n, !0);
|
|
1415
1415
|
const o = [];
|
|
1416
1416
|
if (s === null || s.next === s.prev)
|
|
1417
1417
|
return o;
|
|
@@ -1554,9 +1554,9 @@ const Pi = (e, t = {}) => {
|
|
|
1554
1554
|
positionBuffer: r,
|
|
1555
1555
|
indexBuffer: s
|
|
1556
1556
|
}), a = ({
|
|
1557
|
-
viewport: { projection: u, modelView: d, camera: m, screen:
|
|
1557
|
+
viewport: { projection: u, modelView: d, camera: m, screen: y },
|
|
1558
1558
|
depth: w = !1,
|
|
1559
|
-
index:
|
|
1559
|
+
index: E = 0
|
|
1560
1560
|
}) => {
|
|
1561
1561
|
const A = t.color?.() ?? [1, 1, 1, 1];
|
|
1562
1562
|
if (f(), ge(n, w, t))
|
|
@@ -1565,15 +1565,15 @@ const Pi = (e, t = {}) => {
|
|
|
1565
1565
|
projection: u,
|
|
1566
1566
|
modelView: d,
|
|
1567
1567
|
camera: Q(m),
|
|
1568
|
-
screen:
|
|
1568
|
+
screen: y,
|
|
1569
1569
|
count: i,
|
|
1570
1570
|
color: A,
|
|
1571
|
-
index:
|
|
1571
|
+
index: E
|
|
1572
1572
|
});
|
|
1573
1573
|
}, f = me(
|
|
1574
1574
|
() => t.points?.() ?? [],
|
|
1575
1575
|
(u) => {
|
|
1576
|
-
const { vertices: d, indices: m } = u.length > 0 ? Gn(u.map((
|
|
1576
|
+
const { vertices: d, indices: m } = u.length > 0 ? Gn(u.map((y) => y.map((w) => [...Q(L(w))]))) : { vertices: [], indices: [] };
|
|
1577
1577
|
r.set(d), s.set(m), i = m.length;
|
|
1578
1578
|
}
|
|
1579
1579
|
), l = () => {
|
|
@@ -1594,17 +1594,17 @@ const Pi = (e, t = {}) => {
|
|
|
1594
1594
|
fragmentSource: c ? Re : qn
|
|
1595
1595
|
}), f = a.attribute3i("position", n, {
|
|
1596
1596
|
stride: 3 * Int32Array.BYTES_PER_ELEMENT
|
|
1597
|
-
}), l = a.uniformMatrix4f("projection"), h = a.uniformMatrix4f("model_view"), u = a.uniform3i("camera"), d = a.uniform2f("screen"), m = a.uniform4f("color"),
|
|
1597
|
+
}), l = a.uniformMatrix4f("projection"), h = a.uniformMatrix4f("model_view"), u = a.uniform3i("camera"), d = a.uniform2f("screen"), m = a.uniform4f("color"), y = a.uniform1i("index");
|
|
1598
1598
|
return { execute: ({
|
|
1599
|
-
projection:
|
|
1599
|
+
projection: E,
|
|
1600
1600
|
modelView: A,
|
|
1601
1601
|
camera: v,
|
|
1602
1602
|
screen: T,
|
|
1603
1603
|
count: p,
|
|
1604
1604
|
color: g,
|
|
1605
|
-
index:
|
|
1605
|
+
index: x
|
|
1606
1606
|
}) => {
|
|
1607
|
-
p !== 0 && (a.use(), f.use(), l.set(
|
|
1607
|
+
p !== 0 && (a.use(), f.use(), l.set(E), h.set(A), u.set(v), d.set(T), m.set(g), y.set(x), i.use(), e.drawElements(e.TRIANGLES, p, e.UNSIGNED_SHORT, 0));
|
|
1608
1608
|
} };
|
|
1609
1609
|
}, s = r(), o = r(!0);
|
|
1610
1610
|
return { renderProgram: s, depthProgram: o };
|
|
@@ -1620,7 +1620,7 @@ const Pi = (e, t = {}) => {
|
|
|
1620
1620
|
return { texture: a, downsample: s };
|
|
1621
1621
|
}
|
|
1622
1622
|
}
|
|
1623
|
-
}), fe = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date,
|
|
1623
|
+
}), fe = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, yt = /* @__PURE__ */ new Set(), Ke = typeof process == "object" && process ? process : {}, wt = (e, t, n, i) => {
|
|
1624
1624
|
typeof Ke.emitWarning == "function" ? Ke.emitWarning(e, t, n, i) : console.error(`[${n}] ${t}: ${e}`);
|
|
1625
1625
|
};
|
|
1626
1626
|
let Xe = globalThis.AbortController, ft = globalThis.AbortSignal;
|
|
@@ -1649,10 +1649,10 @@ if (typeof Xe > "u") {
|
|
|
1649
1649
|
};
|
|
1650
1650
|
let e = Ke.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1651
1651
|
const t = () => {
|
|
1652
|
-
e && (e = !1,
|
|
1652
|
+
e && (e = !1, wt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
|
-
const ti = (e) => !
|
|
1655
|
+
const ti = (e) => !yt.has(e), q = (e) => e && e === Math.floor(e) && e > 0 && isFinite(e), Tt = (e) => q(e) ? e <= Math.pow(2, 8) ? Uint8Array : e <= Math.pow(2, 16) ? Uint16Array : e <= Math.pow(2, 32) ? Uint32Array : e <= Number.MAX_SAFE_INTEGER ? Ie : null : null;
|
|
1656
1656
|
class Ie extends Array {
|
|
1657
1657
|
constructor(t) {
|
|
1658
1658
|
super(t), this.fill(0);
|
|
@@ -1664,7 +1664,7 @@ class he {
|
|
|
1664
1664
|
// private constructor
|
|
1665
1665
|
static #c = !1;
|
|
1666
1666
|
static create(t) {
|
|
1667
|
-
const n =
|
|
1667
|
+
const n = Tt(t);
|
|
1668
1668
|
if (!n)
|
|
1669
1669
|
return [];
|
|
1670
1670
|
he.#c = !0;
|
|
@@ -1800,7 +1800,7 @@ class Qe {
|
|
|
1800
1800
|
// methods
|
|
1801
1801
|
isBackgroundFetch: (n) => t.#t(n),
|
|
1802
1802
|
backgroundFetch: (n, i, r, s) => t.#L(n, i, r, s),
|
|
1803
|
-
moveToTail: (n) => t.#
|
|
1803
|
+
moveToTail: (n) => t.#S(n),
|
|
1804
1804
|
indexes: (n) => t.#T(n),
|
|
1805
1805
|
rindexes: (n) => t.#g(n),
|
|
1806
1806
|
isStale: (n) => t.#m(n)
|
|
@@ -1850,13 +1850,13 @@ class Qe {
|
|
|
1850
1850
|
return this.#p;
|
|
1851
1851
|
}
|
|
1852
1852
|
constructor(t) {
|
|
1853
|
-
const { max: n = 0, ttl: i, ttlResolution: r = 1, ttlAutopurge: s, updateAgeOnGet: o, updateAgeOnHas: c, allowStale: a, dispose: f, disposeAfter: l, noDisposeOnSet: h, noUpdateTTL: u, maxSize: d = 0, maxEntrySize: m = 0, sizeCalculation:
|
|
1853
|
+
const { max: n = 0, ttl: i, ttlResolution: r = 1, ttlAutopurge: s, updateAgeOnGet: o, updateAgeOnHas: c, allowStale: a, dispose: f, disposeAfter: l, noDisposeOnSet: h, noUpdateTTL: u, maxSize: d = 0, maxEntrySize: m = 0, sizeCalculation: y, fetchMethod: w, noDeleteOnFetchRejection: E, noDeleteOnStaleGet: A, allowStaleOnFetchRejection: v, allowStaleOnFetchAbort: T, ignoreFetchAbort: p } = t;
|
|
1854
1854
|
if (n !== 0 && !q(n))
|
|
1855
1855
|
throw new TypeError("max option must be a nonnegative integer");
|
|
1856
|
-
const g = n ?
|
|
1856
|
+
const g = n ? Tt(n) : Array;
|
|
1857
1857
|
if (!g)
|
|
1858
1858
|
throw new Error("invalid max value: " + n);
|
|
1859
|
-
if (this.#c = n, this.#u = d, this.maxEntrySize = m || this.#u, this.sizeCalculation =
|
|
1859
|
+
if (this.#c = n, this.#u = d, this.maxEntrySize = m || this.#u, this.sizeCalculation = y, this.sizeCalculation) {
|
|
1860
1860
|
if (!this.#u && !this.maxEntrySize)
|
|
1861
1861
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1862
1862
|
if (typeof this.sizeCalculation != "function")
|
|
@@ -1864,7 +1864,7 @@ class Qe {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
if (w !== void 0 && typeof w != "function")
|
|
1866
1866
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
1867
|
-
if (this.#U = w, this.#A = !!w, this.#i = /* @__PURE__ */ new Map(), this.#n = new Array(n).fill(void 0), this.#e = new Array(n).fill(void 0), this.#f = new g(n), this.#h = new g(n), this.#a = 0, this.#s = 0, this.#E = he.create(n), this.#r = 0, this.#x = 0, typeof f == "function" && (this.#v = f), typeof l == "function" ? (this.#p = l, this.#o = []) : (this.#p = void 0, this.#o = void 0), this.#w = !!this.#v, this.#l = !!this.#p, this.noDisposeOnSet = !!h, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!
|
|
1867
|
+
if (this.#U = w, this.#A = !!w, this.#i = /* @__PURE__ */ new Map(), this.#n = new Array(n).fill(void 0), this.#e = new Array(n).fill(void 0), this.#f = new g(n), this.#h = new g(n), this.#a = 0, this.#s = 0, this.#E = he.create(n), this.#r = 0, this.#x = 0, typeof f == "function" && (this.#v = f), typeof l == "function" ? (this.#p = l, this.#o = []) : (this.#p = void 0, this.#o = void 0), this.#w = !!this.#v, this.#l = !!this.#p, this.noDisposeOnSet = !!h, this.noUpdateTTL = !!u, this.noDeleteOnFetchRejection = !!E, this.allowStaleOnFetchRejection = !!v, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!p, this.maxEntrySize !== 0) {
|
|
1868
1868
|
if (this.#u !== 0 && !q(this.#u))
|
|
1869
1869
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
1870
1870
|
if (!q(this.maxEntrySize))
|
|
@@ -1879,8 +1879,8 @@ class Qe {
|
|
|
1879
1879
|
if (this.#c === 0 && this.ttl === 0 && this.#u === 0)
|
|
1880
1880
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1881
1881
|
if (!this.ttlAutopurge && !this.#c && !this.#u) {
|
|
1882
|
-
const
|
|
1883
|
-
ti(
|
|
1882
|
+
const x = "LRU_CACHE_UNBOUNDED";
|
|
1883
|
+
ti(x) && (yt.add(x), wt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", x, Qe));
|
|
1884
1884
|
}
|
|
1885
1885
|
}
|
|
1886
1886
|
/**
|
|
@@ -1898,7 +1898,7 @@ class Qe {
|
|
|
1898
1898
|
}, o + 1);
|
|
1899
1899
|
a.unref && a.unref();
|
|
1900
1900
|
}
|
|
1901
|
-
}, this.#
|
|
1901
|
+
}, this.#b = (s) => {
|
|
1902
1902
|
n[s] = t[s] !== 0 ? fe.now() : 0;
|
|
1903
1903
|
}, this.#R = (s, o) => {
|
|
1904
1904
|
if (t[o]) {
|
|
@@ -1935,7 +1935,7 @@ class Qe {
|
|
|
1935
1935
|
};
|
|
1936
1936
|
}
|
|
1937
1937
|
// conditionally set private methods related to TTL
|
|
1938
|
-
#
|
|
1938
|
+
#b = () => {
|
|
1939
1939
|
};
|
|
1940
1940
|
#R = () => {
|
|
1941
1941
|
};
|
|
@@ -1945,7 +1945,7 @@ class Qe {
|
|
|
1945
1945
|
#m = () => !1;
|
|
1946
1946
|
#X() {
|
|
1947
1947
|
const t = new Ie(this.#c);
|
|
1948
|
-
this.#x = 0, this.#_ = t, this.#
|
|
1948
|
+
this.#x = 0, this.#_ = t, this.#M = (n) => {
|
|
1949
1949
|
this.#x -= t[n], t[n] = 0;
|
|
1950
1950
|
}, this.#I = (n, i, r, s) => {
|
|
1951
1951
|
if (this.#t(i))
|
|
@@ -1968,7 +1968,7 @@ class Qe {
|
|
|
1968
1968
|
this.#x += t[n], r && (r.entrySize = i, r.totalCalculatedSize = this.#x);
|
|
1969
1969
|
};
|
|
1970
1970
|
}
|
|
1971
|
-
#
|
|
1971
|
+
#M = (t) => {
|
|
1972
1972
|
};
|
|
1973
1973
|
#P = (t, n, i) => {
|
|
1974
1974
|
};
|
|
@@ -2179,7 +2179,7 @@ class Qe {
|
|
|
2179
2179
|
if (h === void 0)
|
|
2180
2180
|
h = this.#r === 0 ? this.#s : this.#E.length !== 0 ? this.#E.pop() : this.#r === this.#c ? this.#z(!1) : this.#r, this.#n[h] = t, this.#e[h] = n, this.#i.set(t, h), this.#f[this.#s] = h, this.#h[h] = this.#s, this.#s = h, this.#r++, this.#P(h, l, a), a && (a.set = "add"), f = !1;
|
|
2181
2181
|
else {
|
|
2182
|
-
this.#
|
|
2182
|
+
this.#S(h);
|
|
2183
2183
|
const u = this.#e[h];
|
|
2184
2184
|
if (n !== u) {
|
|
2185
2185
|
if (this.#A && this.#t(u)) {
|
|
@@ -2188,7 +2188,7 @@ class Qe {
|
|
|
2188
2188
|
d !== void 0 && !o && (this.#w && this.#v?.(d, t, "set"), this.#l && this.#o?.push([d, t, "set"]));
|
|
2189
2189
|
} else
|
|
2190
2190
|
o || (this.#w && this.#v?.(u, t, "set"), this.#l && this.#o?.push([u, t, "set"]));
|
|
2191
|
-
if (this.#
|
|
2191
|
+
if (this.#M(h), this.#P(h, l, a), this.#e[h] = n, a) {
|
|
2192
2192
|
a.set = "replace";
|
|
2193
2193
|
const d = u && this.#t(u) ? u.__staleWhileFetching : u;
|
|
2194
2194
|
d !== void 0 && (a.oldValue = d);
|
|
@@ -2229,7 +2229,7 @@ class Qe {
|
|
|
2229
2229
|
}
|
|
2230
2230
|
#z(t) {
|
|
2231
2231
|
const n = this.#a, i = this.#n[n], r = this.#e[n];
|
|
2232
|
-
return this.#A && this.#t(r) ? r.__abortController.abort(new Error("evicted")) : (this.#w || this.#l) && (this.#w && this.#v?.(r, i, "evict"), this.#l && this.#o?.push([r, i, "evict"])), this.#
|
|
2232
|
+
return this.#A && this.#t(r) ? r.__abortController.abort(new Error("evicted")) : (this.#w || this.#l) && (this.#w && this.#v?.(r, i, "evict"), this.#l && this.#o?.push([r, i, "evict"])), this.#M(n), t && (this.#n[n] = void 0, this.#e[n] = void 0, this.#E.push(n)), this.#r === 1 ? (this.#a = this.#s = 0, this.#E.length = 0) : this.#a = this.#f[n], this.#i.delete(i), this.#r--, n;
|
|
2233
2233
|
}
|
|
2234
2234
|
/**
|
|
2235
2235
|
* Check if a key is in the cache, without updating the recency of use.
|
|
@@ -2248,7 +2248,7 @@ class Qe {
|
|
|
2248
2248
|
if (this.#m(s))
|
|
2249
2249
|
r && (r.has = "stale", this.#R(r, s));
|
|
2250
2250
|
else
|
|
2251
|
-
return i && this.#
|
|
2251
|
+
return i && this.#b(s), r && (r.has = "hit", this.#R(r, s)), !0;
|
|
2252
2252
|
} else
|
|
2253
2253
|
r && (r.has = "miss");
|
|
2254
2254
|
return !1;
|
|
@@ -2279,22 +2279,22 @@ class Qe {
|
|
|
2279
2279
|
signal: o.signal,
|
|
2280
2280
|
options: i,
|
|
2281
2281
|
context: r
|
|
2282
|
-
}, f = (
|
|
2283
|
-
const { aborted:
|
|
2284
|
-
if (i.status && (
|
|
2282
|
+
}, f = (y, w = !1) => {
|
|
2283
|
+
const { aborted: E } = o.signal, A = i.ignoreFetchAbort && y !== void 0;
|
|
2284
|
+
if (i.status && (E && !w ? (i.status.fetchAborted = !0, i.status.fetchError = o.signal.reason, A && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), E && !A && !w)
|
|
2285
2285
|
return h(o.signal.reason);
|
|
2286
2286
|
const v = d;
|
|
2287
|
-
return this.#e[n] === d && (
|
|
2288
|
-
}, l = (
|
|
2289
|
-
const { aborted: w } = o.signal,
|
|
2290
|
-
if (this.#e[n] === d && (!v || T.__staleWhileFetching === void 0 ? this.delete(t) :
|
|
2287
|
+
return this.#e[n] === d && (y === void 0 ? v.__staleWhileFetching ? this.#e[n] = v.__staleWhileFetching : this.delete(t) : (i.status && (i.status.fetchUpdated = !0), this.set(t, y, a.options))), y;
|
|
2288
|
+
}, l = (y) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = y), h(y)), h = (y) => {
|
|
2289
|
+
const { aborted: w } = o.signal, E = w && i.allowStaleOnFetchAbort, A = E || i.allowStaleOnFetchRejection, v = A || i.noDeleteOnFetchRejection, T = d;
|
|
2290
|
+
if (this.#e[n] === d && (!v || T.__staleWhileFetching === void 0 ? this.delete(t) : E || (this.#e[n] = T.__staleWhileFetching)), A)
|
|
2291
2291
|
return i.status && T.__staleWhileFetching !== void 0 && (i.status.returnedStale = !0), T.__staleWhileFetching;
|
|
2292
2292
|
if (T.__returned === T)
|
|
2293
|
-
throw
|
|
2294
|
-
}, u = (
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2297
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
2293
|
+
throw y;
|
|
2294
|
+
}, u = (y, w) => {
|
|
2295
|
+
const E = this.#U?.(t, s, a);
|
|
2296
|
+
E && E instanceof Promise && E.then((A) => y(A === void 0 ? void 0 : A), w), o.signal.addEventListener("abort", () => {
|
|
2297
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (y(void 0), i.allowStaleOnFetchAbort && (y = (A) => f(A, !0)));
|
|
2298
2298
|
});
|
|
2299
2299
|
};
|
|
2300
2300
|
i.status && (i.status.fetchDispatched = !0);
|
|
@@ -2328,17 +2328,17 @@ class Qe {
|
|
|
2328
2328
|
allowStaleOnFetchRejection: u = this.allowStaleOnFetchRejection,
|
|
2329
2329
|
ignoreFetchAbort: d = this.ignoreFetchAbort,
|
|
2330
2330
|
allowStaleOnFetchAbort: m = this.allowStaleOnFetchAbort,
|
|
2331
|
-
context:
|
|
2331
|
+
context: y,
|
|
2332
2332
|
forceRefresh: w = !1,
|
|
2333
|
-
status:
|
|
2333
|
+
status: E,
|
|
2334
2334
|
signal: A
|
|
2335
2335
|
} = n;
|
|
2336
2336
|
if (!this.#A)
|
|
2337
|
-
return
|
|
2337
|
+
return E && (E.fetch = "get"), this.get(t, {
|
|
2338
2338
|
allowStale: i,
|
|
2339
2339
|
updateAgeOnGet: r,
|
|
2340
2340
|
noDeleteOnStaleGet: s,
|
|
2341
|
-
status:
|
|
2341
|
+
status: E
|
|
2342
2342
|
});
|
|
2343
2343
|
const v = {
|
|
2344
2344
|
allowStale: i,
|
|
@@ -2353,25 +2353,25 @@ class Qe {
|
|
|
2353
2353
|
allowStaleOnFetchRejection: u,
|
|
2354
2354
|
allowStaleOnFetchAbort: m,
|
|
2355
2355
|
ignoreFetchAbort: d,
|
|
2356
|
-
status:
|
|
2356
|
+
status: E,
|
|
2357
2357
|
signal: A
|
|
2358
2358
|
};
|
|
2359
2359
|
let T = this.#i.get(t);
|
|
2360
2360
|
if (T === void 0) {
|
|
2361
|
-
|
|
2362
|
-
const p = this.#L(t, T, v,
|
|
2361
|
+
E && (E.fetch = "miss");
|
|
2362
|
+
const p = this.#L(t, T, v, y);
|
|
2363
2363
|
return p.__returned = p;
|
|
2364
2364
|
} else {
|
|
2365
2365
|
const p = this.#e[T];
|
|
2366
2366
|
if (this.#t(p)) {
|
|
2367
|
-
const
|
|
2368
|
-
return
|
|
2367
|
+
const b = i && p.__staleWhileFetching !== void 0;
|
|
2368
|
+
return E && (E.fetch = "inflight", b && (E.returnedStale = !0)), b ? p.__staleWhileFetching : p.__returned = p;
|
|
2369
2369
|
}
|
|
2370
2370
|
const g = this.#m(T);
|
|
2371
2371
|
if (!w && !g)
|
|
2372
|
-
return
|
|
2373
|
-
const
|
|
2374
|
-
return
|
|
2372
|
+
return E && (E.fetch = "hit"), this.#S(T), r && this.#b(T), E && this.#R(E, T), p;
|
|
2373
|
+
const x = this.#L(t, T, v, y), R = x.__staleWhileFetching !== void 0 && i;
|
|
2374
|
+
return E && (E.fetch = g ? "stale" : "refresh", R && g && (E.returnedStale = !0)), R ? x.__staleWhileFetching : x.__returned = x;
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
/**
|
|
@@ -2384,14 +2384,14 @@ class Qe {
|
|
|
2384
2384
|
const { allowStale: i = this.allowStale, updateAgeOnGet: r = this.updateAgeOnGet, noDeleteOnStaleGet: s = this.noDeleteOnStaleGet, status: o } = n, c = this.#i.get(t);
|
|
2385
2385
|
if (c !== void 0) {
|
|
2386
2386
|
const a = this.#e[c], f = this.#t(a);
|
|
2387
|
-
return o && this.#R(o, c), this.#m(c) ? (o && (o.get = "stale"), f ? (o && i && a.__staleWhileFetching !== void 0 && (o.returnedStale = !0), i ? a.__staleWhileFetching : void 0) : (s || this.delete(t), o && i && (o.returnedStale = !0), i ? a : void 0)) : (o && (o.get = "hit"), f ? a.__staleWhileFetching : (this.#
|
|
2387
|
+
return o && this.#R(o, c), this.#m(c) ? (o && (o.get = "stale"), f ? (o && i && a.__staleWhileFetching !== void 0 && (o.returnedStale = !0), i ? a.__staleWhileFetching : void 0) : (s || this.delete(t), o && i && (o.returnedStale = !0), i ? a : void 0)) : (o && (o.get = "hit"), f ? a.__staleWhileFetching : (this.#S(c), r && this.#b(c), a));
|
|
2388
2388
|
} else
|
|
2389
2389
|
o && (o.get = "miss");
|
|
2390
2390
|
}
|
|
2391
2391
|
#C(t, n) {
|
|
2392
2392
|
this.#h[n] = t, this.#f[t] = n;
|
|
2393
2393
|
}
|
|
2394
|
-
#
|
|
2394
|
+
#S(t) {
|
|
2395
2395
|
t !== this.#s && (t === this.#a ? this.#a = this.#f[t] : this.#C(this.#h[t], this.#f[t]), this.#C(this.#s, t), this.#s = t);
|
|
2396
2396
|
}
|
|
2397
2397
|
/**
|
|
@@ -2406,7 +2406,7 @@ class Qe {
|
|
|
2406
2406
|
if (n = !0, this.#r === 1)
|
|
2407
2407
|
this.clear();
|
|
2408
2408
|
else {
|
|
2409
|
-
this.#
|
|
2409
|
+
this.#M(i);
|
|
2410
2410
|
const r = this.#e[i];
|
|
2411
2411
|
if (this.#t(r) ? r.__abortController.abort(new Error("deleted")) : (this.#w || this.#l) && (this.#w && this.#v?.(r, t, "delete"), this.#l && this.#o?.push([r, t, "delete"])), this.#i.delete(t), this.#n[i] = void 0, this.#e[i] = void 0, i === this.#s)
|
|
2412
2412
|
this.#s = this.#h[i];
|
|
@@ -2481,22 +2481,22 @@ const We = (e) => {
|
|
|
2481
2481
|
const h = i.get([a, f, l]);
|
|
2482
2482
|
if (!h)
|
|
2483
2483
|
return;
|
|
2484
|
-
const { texture: u, downsample: d } = h, m = 2 ** d,
|
|
2484
|
+
const { texture: u, downsample: d } = h, m = 2 ** d, y = [Math.floor(a / m), Math.floor(f / m), l - d], w = n.get(y);
|
|
2485
2485
|
if (w)
|
|
2486
2486
|
return { buffer: w, downsample: d };
|
|
2487
|
-
const
|
|
2488
|
-
return e.bindFramebuffer(e.FRAMEBUFFER, r), u.attach(), e.readPixels(0, 0, te, te, e.RGBA, e.UNSIGNED_BYTE,
|
|
2487
|
+
const E = new Uint8Array(4 * te * te);
|
|
2488
|
+
return e.bindFramebuffer(e.FRAMEBUFFER, r), u.attach(), e.readPixels(0, 0, te, te, e.RGBA, e.UNSIGNED_BYTE, E), e.bindFramebuffer(e.FRAMEBUFFER, null), n.set(y, E), { buffer: E, downsample: d };
|
|
2489
2489
|
};
|
|
2490
2490
|
return { get: ([a = 0, f = 0], l = ni) => {
|
|
2491
|
-
const h = 2 ** l, u = L([a, f, 0]).map((
|
|
2492
|
-
let [
|
|
2493
|
-
const
|
|
2494
|
-
if (!
|
|
2491
|
+
const h = 2 ** l, u = L([a, f, 0]).map((b) => b * h), [d = 0, m = 0] = u.map((b) => Math.floor(b % h));
|
|
2492
|
+
let [y = 0, w = 0] = u.map((b) => b % 1);
|
|
2493
|
+
const E = s([d, m, l]);
|
|
2494
|
+
if (!E)
|
|
2495
2495
|
return 0;
|
|
2496
|
-
const { buffer: A, downsample: v } =
|
|
2497
|
-
[
|
|
2498
|
-
const p = 4 * te * Math.floor(w * te) + 4 * Math.floor(
|
|
2499
|
-
return (g * 65536 +
|
|
2496
|
+
const { buffer: A, downsample: v } = E, T = 2 ** v;
|
|
2497
|
+
[y, w] = [(d % T + y) / T, (m % T + w) / T];
|
|
2498
|
+
const p = 4 * te * Math.floor(w * te) + 4 * Math.floor(y * te), [g = 0, x = 0, _ = 0] = A.slice(p, p + 4);
|
|
2499
|
+
return (g * 65536 + x * 256 + _) / 10 - 1e4;
|
|
2500
2500
|
}, dispose: () => {
|
|
2501
2501
|
e.deleteFramebuffer(r);
|
|
2502
2502
|
} };
|
|
@@ -2535,7 +2535,19 @@ const lt = ({
|
|
|
2535
2535
|
return r.delete(a), f;
|
|
2536
2536
|
r.set(a, !0);
|
|
2537
2537
|
} else {
|
|
2538
|
-
const [l
|
|
2538
|
+
const [l = 0, h = 0, u = 0] = a;
|
|
2539
|
+
let d = t.replace("{x}", `${l}`).replace("{y}", `${h}`).replace("{z}", `${u}`);
|
|
2540
|
+
if (d.includes("{bbox}")) {
|
|
2541
|
+
const [y = 0, w = 0, E = 0] = a, A = 2 ** E - w - 1, [[v, T] = [], [p, g] = []] = [
|
|
2542
|
+
[0, 0],
|
|
2543
|
+
[1, 1]
|
|
2544
|
+
].map(([x = 0, _ = 0]) => [y + x, A + _, E]).map((x) => ht(x, x)).map(([x = 0, _ = 0]) => [
|
|
2545
|
+
(x - 0.5) * 2 * Math.PI * 6378137,
|
|
2546
|
+
(_ - 0.5) * 2 * Math.PI * 6378137
|
|
2547
|
+
]);
|
|
2548
|
+
d = d.replace("{bbox}", [v, T, p, g].join(","));
|
|
2549
|
+
}
|
|
2550
|
+
const m = pt({
|
|
2539
2551
|
gl: e,
|
|
2540
2552
|
url: d,
|
|
2541
2553
|
onLoad: () => {
|
|
@@ -2562,7 +2574,7 @@ const lt = ({
|
|
|
2562
2574
|
const s = t.get(r);
|
|
2563
2575
|
if (s)
|
|
2564
2576
|
return s;
|
|
2565
|
-
const [o = 0, c = 0, a = 0] = r, f = n.map(([l = 0, h = 0]) => [o + l, c + h, a]).map((l) =>
|
|
2577
|
+
const [o = 0, c = 0, a = 0] = r, f = n.map(([l = 0, h = 0]) => [o + l, c + h, a]).map((l) => ht(l, l)).map((l) => se(l, l)).map((l) => {
|
|
2566
2578
|
const [h = 0, u = 0] = l, d = Math.max(a - 5, 0);
|
|
2567
2579
|
return L(
|
|
2568
2580
|
we(l, h, u, e.get([h, u], d)),
|
|
@@ -2628,19 +2640,19 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2628
2640
|
let i, r;
|
|
2629
2641
|
const s = me(
|
|
2630
2642
|
() => t.imageryUrl?.() ?? "",
|
|
2631
|
-
(
|
|
2643
|
+
(x) => {
|
|
2632
2644
|
i?.dispose(), i = lt({
|
|
2633
2645
|
gl: n,
|
|
2634
|
-
urlPattern:
|
|
2646
|
+
urlPattern: x,
|
|
2635
2647
|
onLoad: () => {
|
|
2636
|
-
const
|
|
2637
|
-
if (
|
|
2648
|
+
const _ = n.getExtension("EXT_texture_filter_anisotropic");
|
|
2649
|
+
if (_) {
|
|
2638
2650
|
const R = n.getParameter(
|
|
2639
|
-
|
|
2651
|
+
_.MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
|
2640
2652
|
);
|
|
2641
2653
|
n.texParameterf(
|
|
2642
2654
|
n.TEXTURE_2D,
|
|
2643
|
-
|
|
2655
|
+
_.TEXTURE_MAX_ANISOTROPY_EXT,
|
|
2644
2656
|
R
|
|
2645
2657
|
);
|
|
2646
2658
|
}
|
|
@@ -2659,54 +2671,54 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2659
2671
|
n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.NEAREST), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.NEAREST), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE);
|
|
2660
2672
|
}
|
|
2661
2673
|
}), a = Fe(c, 3), f = ii({ gl: n, terrainCache: c }), l = si(f), h = V({ gl: n, type: "f32", target: "array" });
|
|
2662
|
-
h.set(fi.flatMap(([
|
|
2674
|
+
h.set(fi.flatMap(([x = 0, _ = 0, R = 0]) => [x, _, R]));
|
|
2663
2675
|
const u = V({ gl: n, type: "u16", target: "element" });
|
|
2664
2676
|
u.set(ci);
|
|
2665
2677
|
const { renderProgram: d, depthProgram: m } = li(e, {
|
|
2666
2678
|
uvwBuffer: h,
|
|
2667
2679
|
indexBuffer: u
|
|
2668
|
-
}),
|
|
2669
|
-
const { camera:
|
|
2670
|
-
const [
|
|
2671
|
-
let X = ui(
|
|
2680
|
+
}), y = [0, 1, 2, 3], w = y.map(z), E = y.map(ee), A = y.map(de), v = (x) => {
|
|
2681
|
+
const { camera: _, worldToLocal: R, localToClip: b, clipToScreen: S } = x, P = (U) => {
|
|
2682
|
+
const [M = 0, N = 0, I = 0] = U, j = l.get(U);
|
|
2683
|
+
let X = ui(_, j);
|
|
2672
2684
|
if (!X) {
|
|
2673
|
-
const C = j.map((Z, $) => R(Z, w[$])).map((Z, $) =>
|
|
2685
|
+
const C = j.map((Z, $) => R(Z, w[$])).map((Z, $) => b(Z, E[$]));
|
|
2674
2686
|
if (hi(C))
|
|
2675
2687
|
return [];
|
|
2676
|
-
X = di(C.map((Z, $) =>
|
|
2688
|
+
X = di(C.map((Z, $) => S(Z, A[$]))) > 512 / devicePixelRatio;
|
|
2677
2689
|
}
|
|
2678
2690
|
return X && I < ai ? [
|
|
2679
|
-
[2 *
|
|
2680
|
-
[2 *
|
|
2681
|
-
[2 *
|
|
2682
|
-
[2 *
|
|
2691
|
+
[2 * M, 2 * N, I + 1],
|
|
2692
|
+
[2 * M + 1, 2 * N, I + 1],
|
|
2693
|
+
[2 * M, 2 * N + 1, I + 1],
|
|
2694
|
+
[2 * M + 1, 2 * N + 1, I + 1]
|
|
2683
2695
|
].flatMap((G) => P(G)) : [U];
|
|
2684
2696
|
};
|
|
2685
2697
|
return P([0, 0, 0]);
|
|
2686
2698
|
}, T = ({
|
|
2687
|
-
viewport:
|
|
2688
|
-
depth:
|
|
2699
|
+
viewport: x,
|
|
2700
|
+
depth: _ = !1,
|
|
2689
2701
|
index: R = 0
|
|
2690
2702
|
}) => {
|
|
2691
|
-
const
|
|
2692
|
-
if (s(), ge(n,
|
|
2703
|
+
const b = t.color?.() ?? [1, 1, 1, 1];
|
|
2704
|
+
if (s(), ge(n, _, t))
|
|
2693
2705
|
return;
|
|
2694
|
-
const
|
|
2706
|
+
const S = _ ? m : d, { projection: P, modelView: U, camera: M } = x, N = v(x);
|
|
2695
2707
|
for (const I of N) {
|
|
2696
|
-
const j =
|
|
2697
|
-
if (!
|
|
2708
|
+
const j = _ ? void 0 : r?.get(I), X = a.get(I);
|
|
2709
|
+
if (!_ && !j || !X)
|
|
2698
2710
|
continue;
|
|
2699
2711
|
const { texture: C, downsample: G } = X, { texture: Z = C, downsample: $ = 0 } = j ?? {};
|
|
2700
|
-
|
|
2712
|
+
S.execute({
|
|
2701
2713
|
projection: P,
|
|
2702
2714
|
modelView: U,
|
|
2703
|
-
camera: Q(
|
|
2715
|
+
camera: Q(M),
|
|
2704
2716
|
xyz: I,
|
|
2705
2717
|
imagery: Z,
|
|
2706
2718
|
terrain: C,
|
|
2707
2719
|
downsampleImagery: $,
|
|
2708
2720
|
downsampleTerrain: G,
|
|
2709
|
-
color:
|
|
2721
|
+
color: b,
|
|
2710
2722
|
index: R
|
|
2711
2723
|
});
|
|
2712
2724
|
}
|
|
@@ -2723,20 +2735,20 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2723
2735
|
const a = t.get({
|
|
2724
2736
|
vertexSource: oi,
|
|
2725
2737
|
fragmentSource: c ? Re : ri
|
|
2726
|
-
}), f = a.attribute3f("uvw", n), l = a.uniformMatrix4f("projection"), h = a.uniformMatrix4f("model_view"), u = a.uniform1i("imagery"), d = a.uniform1i("terrain"), m = a.uniform1i("downsample_imagery"),
|
|
2738
|
+
}), f = a.attribute3f("uvw", n), l = a.uniformMatrix4f("projection"), h = a.uniformMatrix4f("model_view"), u = a.uniform1i("imagery"), d = a.uniform1i("terrain"), m = a.uniform1i("downsample_imagery"), y = a.uniform1i("downsample_terrain"), w = a.uniform4f("color"), E = a.uniform3i("xyz"), A = a.uniform3i("camera"), v = a.uniform1i("index");
|
|
2727
2739
|
return { execute: ({
|
|
2728
2740
|
projection: p,
|
|
2729
2741
|
modelView: g,
|
|
2730
|
-
camera:
|
|
2731
|
-
xyz:
|
|
2742
|
+
camera: x,
|
|
2743
|
+
xyz: _,
|
|
2732
2744
|
imagery: R,
|
|
2733
|
-
terrain:
|
|
2734
|
-
downsampleImagery:
|
|
2745
|
+
terrain: b,
|
|
2746
|
+
downsampleImagery: S,
|
|
2735
2747
|
downsampleTerrain: P,
|
|
2736
2748
|
color: U,
|
|
2737
|
-
index:
|
|
2749
|
+
index: M
|
|
2738
2750
|
}) => {
|
|
2739
|
-
a.use(), f.use(), l.set(p), h.set(g),
|
|
2751
|
+
a.use(), f.use(), l.set(p), h.set(g), E.set(_), A.set(x), m.set(S), y.set(P), w.set(U), v.set(M), e.activeTexture(e.TEXTURE0), u.set(0), R.use(), e.activeTexture(e.TEXTURE1), d.set(1), b.use(), i.use(), e.drawElements(e.TRIANGLES, B * B * 2 * 3, e.UNSIGNED_SHORT, 0);
|
|
2740
2752
|
} };
|
|
2741
2753
|
}, s = r(), o = r(!0);
|
|
2742
2754
|
return { renderProgram: s, depthProgram: o };
|
|
@@ -2753,7 +2765,7 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2753
2765
|
return o > n && o < i && c > r && c < s && a > 0 && a < i - n;
|
|
2754
2766
|
}, hi = (e) => e.every(([t = 0, , , n = 0]) => t > n) || e.every(([t = 0, , , n = 0]) => t < -n) || e.every(([, t = 0, , n = 0]) => t > n) || e.every(([, t = 0, , n = 0]) => t < -n) || e.every(([, , t = 0, n = 0]) => t > n) || e.every(([, , t = 0, n = 0]) => t < -n) || e.every(([, , , t = 0]) => t < 0), di = (e) => Math.sqrt(
|
|
2755
2767
|
e.map(
|
|
2756
|
-
(t, n) =>
|
|
2768
|
+
(t, n) => hn(
|
|
2757
2769
|
e[n] ?? [0, 0],
|
|
2758
2770
|
e[(n + 1) % e.length] ?? [0, 0]
|
|
2759
2771
|
)
|
|
@@ -2796,7 +2808,7 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2796
2808
|
onDragStart: o,
|
|
2797
2809
|
onDragEnd: c
|
|
2798
2810
|
};
|
|
2799
|
-
}, Be = 10,
|
|
2811
|
+
}, Be = 10, be = 1e-3, ae = (e) => (t) => {
|
|
2800
2812
|
let n, i;
|
|
2801
2813
|
return () => {
|
|
2802
2814
|
const r = performance.now(), s = (r - (i ?? r)) / 1e3;
|
|
@@ -2805,31 +2817,31 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2805
2817
|
return n = n ?? o, n = e({ time: s, current: n, target: o }), n;
|
|
2806
2818
|
};
|
|
2807
2819
|
}, vi = ae(
|
|
2808
|
-
({ time: e, current: t, target: n }) => (Math.abs(n - t) <
|
|
2820
|
+
({ time: e, current: t, target: n }) => (Math.abs(n - t) < be ? t = n : t = t + (n - t) * (1 - Math.exp(-Be * e)), t)
|
|
2809
2821
|
), pi = ae(
|
|
2810
|
-
({ time: e, current: t, target: n }) => (
|
|
2822
|
+
({ time: e, current: t, target: n }) => (un(t, n) < be ? on(t, n) : t = cn(
|
|
2811
2823
|
de(),
|
|
2812
2824
|
t,
|
|
2813
|
-
|
|
2825
|
+
ln(
|
|
2814
2826
|
de(),
|
|
2815
|
-
|
|
2827
|
+
dn(de(), n, t),
|
|
2816
2828
|
1 - Math.exp(-Be * e)
|
|
2817
2829
|
)
|
|
2818
2830
|
), t)
|
|
2819
2831
|
), Ii = ae(
|
|
2820
|
-
({ time: e, current: t, target: n }) => (
|
|
2832
|
+
({ time: e, current: t, target: n }) => (Qt(t, n) < be ? Ht(t, n) : t = Gt(
|
|
2821
2833
|
ee(),
|
|
2822
2834
|
t,
|
|
2823
|
-
|
|
2835
|
+
Kt(
|
|
2824
2836
|
ee(),
|
|
2825
|
-
|
|
2837
|
+
en(ee(), n, t),
|
|
2826
2838
|
1 - Math.exp(-Be * e)
|
|
2827
2839
|
)
|
|
2828
2840
|
), t)
|
|
2829
2841
|
), Oi = ae(
|
|
2830
2842
|
({ time: e, current: t, target: n }) => {
|
|
2831
2843
|
const i = Te(L(t), L(n));
|
|
2832
|
-
return i * H <
|
|
2844
|
+
return i * H < be || i > 1e5 / H ? Bt(t, n) : t = se(
|
|
2833
2845
|
ne(
|
|
2834
2846
|
z(),
|
|
2835
2847
|
L(t),
|
|
@@ -2884,11 +2896,11 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2884
2896
|
({ time: e, current: t, target: n }) => (t = pn(
|
|
2885
2897
|
Ne(
|
|
2886
2898
|
He(),
|
|
2887
|
-
|
|
2888
|
-
|
|
2899
|
+
Se(t),
|
|
2900
|
+
Se(n),
|
|
2889
2901
|
Math.PI * e
|
|
2890
2902
|
)
|
|
2891
|
-
),
|
|
2903
|
+
), nn(Se(t), Se(n)) < be && (n = t), t)
|
|
2892
2904
|
), Ei = 10, Xi = (e) => {
|
|
2893
2905
|
const t = xi(() => e().orientation), n = pi(() => e().offset), i = vi(() => e().fieldOfView);
|
|
2894
2906
|
return ae(({ time: s, current: o, target: c }) => {
|
|
@@ -2960,8 +2972,8 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2960
2972
|
resize: o,
|
|
2961
2973
|
read: ([l = 0, h = 0]) => {
|
|
2962
2974
|
r(), e.readPixels(l, s - h, 1, 1, e.RGBA, e.UNSIGNED_BYTE, c), e.bindFramebuffer(e.FRAMEBUFFER, null);
|
|
2963
|
-
const [u = 0, d = 0, m = 0,
|
|
2964
|
-
return [
|
|
2975
|
+
const [u = 0, d = 0, m = 0, y = 0] = c, E = 2 * ((u * 256 + d) / (256 * 256 - 1)) - 1, A = m * 256 + y;
|
|
2976
|
+
return [E, A];
|
|
2965
2977
|
},
|
|
2966
2978
|
dispose: () => {
|
|
2967
2979
|
e.deleteTexture(t), e.deleteFramebuffer(i), e.deleteRenderbuffer(n);
|
|
@@ -2976,45 +2988,45 @@ const B = 34, ai = 22, ci = ie(0, B).flatMap(
|
|
|
2976
2988
|
let s = !1, o, c;
|
|
2977
2989
|
const a = () => {
|
|
2978
2990
|
s = !0;
|
|
2979
|
-
}, f = ({ x: m, y
|
|
2991
|
+
}, f = ({ x: m, y, movementX: w, movementY: E }) => {
|
|
2980
2992
|
if (o) {
|
|
2981
2993
|
if (o.onDrag) {
|
|
2982
|
-
const { point: A, position: v, layer: T } = i([m,
|
|
2994
|
+
const { point: A, position: v, layer: T } = i([m, y], { terrain: !0 });
|
|
2983
2995
|
o.onDrag({ point: A, position: v, layer: T });
|
|
2984
2996
|
}
|
|
2985
2997
|
if (o.onDragFlat) {
|
|
2986
|
-
const v = J(t(), n()).unproject([m,
|
|
2987
|
-
o.onDragFlat({ point: [m,
|
|
2998
|
+
const v = J(t(), n()).unproject([m, y], { targetZ: c });
|
|
2999
|
+
o.onDragFlat({ point: [m, y], position: v, layer: void 0 });
|
|
2988
3000
|
}
|
|
2989
3001
|
return;
|
|
2990
3002
|
}
|
|
2991
|
-
if (s && (Math.abs(w) > 1 || Math.abs(
|
|
3003
|
+
if (s && (Math.abs(w) > 1 || Math.abs(E) > 1)) {
|
|
2992
3004
|
s = !1;
|
|
2993
|
-
const { point: A, position: v, layer: T } = i([m,
|
|
3005
|
+
const { point: A, position: v, layer: T } = i([m, y]);
|
|
2994
3006
|
(T?.onDrag || T?.onDragFlat) && (o = T, o.onDragStart?.({ point: A, position: v, layer: T }), [, , c] = v);
|
|
2995
3007
|
}
|
|
2996
3008
|
}, l = (m) => {
|
|
2997
3009
|
if (s && h(m), s = !1, o) {
|
|
2998
|
-
const { x:
|
|
2999
|
-
o.onDragEnd?.({ point:
|
|
3010
|
+
const { x: y, y: w } = m, { point: E, position: A, layer: v } = i([y, w]);
|
|
3011
|
+
o.onDragEnd?.({ point: E, position: A, layer: v });
|
|
3000
3012
|
}
|
|
3001
3013
|
o = void 0;
|
|
3002
|
-
}, h = ({ x: m, y
|
|
3003
|
-
const { point:
|
|
3014
|
+
}, h = ({ x: m, y, button: w }) => {
|
|
3015
|
+
const { point: E, position: A, layer: v } = i([m, y]);
|
|
3004
3016
|
(w === 2 ? v?.onRightClick : v?.onClick)?.({
|
|
3005
|
-
point:
|
|
3017
|
+
point: E,
|
|
3006
3018
|
position: A,
|
|
3007
3019
|
layer: v
|
|
3008
3020
|
});
|
|
3009
|
-
}, u = ({ x: m, y
|
|
3010
|
-
const { point: w, position:
|
|
3011
|
-
A?.onDoubleClick?.({ point: w, position:
|
|
3021
|
+
}, u = ({ x: m, y }) => {
|
|
3022
|
+
const { point: w, position: E, layer: A } = i([m, y]);
|
|
3023
|
+
A?.onDoubleClick?.({ point: w, position: E, layer: A });
|
|
3012
3024
|
};
|
|
3013
3025
|
return r?.addEventListener("mousedown", a), r?.addEventListener("mousemove", f), r?.addEventListener("dblclick", u), window.addEventListener("mouseup", l), { dispose: () => {
|
|
3014
3026
|
r?.removeEventListener("mousedown", a), r?.removeEventListener("mousemove", f), r?.removeEventListener("dblclick", u), window.removeEventListener("mouseup", l);
|
|
3015
3027
|
} };
|
|
3016
3028
|
};
|
|
3017
|
-
|
|
3029
|
+
Ut(Array);
|
|
3018
3030
|
const Wi = ({ gl: e }, t) => {
|
|
3019
3031
|
const { view: n, layers: i } = t;
|
|
3020
3032
|
let r = !0, s = [0, 0];
|
|
@@ -3044,30 +3056,30 @@ const Wi = ({ gl: e }, t) => {
|
|
|
3044
3056
|
r && (h(), requestAnimationFrame(d));
|
|
3045
3057
|
};
|
|
3046
3058
|
requestAnimationFrame(d);
|
|
3047
|
-
const m = (v) => J(n(), s).project(v),
|
|
3048
|
-
const { screenToClip: p, clipToLocal: g, localToWorld:
|
|
3059
|
+
const m = (v) => J(n(), s).project(v), y = (v) => J(n(), s).unproject(v), w = (v, { terrain: T } = {}) => {
|
|
3060
|
+
const { screenToClip: p, clipToLocal: g, localToWorld: x } = J(
|
|
3049
3061
|
n(),
|
|
3050
3062
|
s
|
|
3051
3063
|
);
|
|
3052
3064
|
o.use();
|
|
3053
|
-
const [
|
|
3054
|
-
u(
|
|
3055
|
-
const [R = 0,
|
|
3065
|
+
const [_] = T ? i() : [];
|
|
3066
|
+
u(_);
|
|
3067
|
+
const [R = 0, b = 0] = v, [S, P] = o.read([
|
|
3056
3068
|
R * devicePixelRatio,
|
|
3057
|
-
|
|
3058
|
-
]), [U = 0,
|
|
3069
|
+
b * devicePixelRatio
|
|
3070
|
+
]), [U = 0, M = 0] = p(v), N = se(x(g([U, M, S, 1]))), I = P === 0 ? void 0 : _ ?? Oe(i())[P - 1];
|
|
3059
3071
|
return { point: v, position: N, layer: I };
|
|
3060
|
-
},
|
|
3072
|
+
}, E = yi(e, {
|
|
3061
3073
|
view: n,
|
|
3062
3074
|
screen: () => s,
|
|
3063
3075
|
pick: w
|
|
3064
3076
|
});
|
|
3065
3077
|
return {
|
|
3066
3078
|
project: m,
|
|
3067
|
-
unproject:
|
|
3079
|
+
unproject: y,
|
|
3068
3080
|
pick: w,
|
|
3069
3081
|
dispose: () => {
|
|
3070
|
-
r = !1,
|
|
3082
|
+
r = !1, E.dispose(), o.dispose(), c instanceof HTMLCanvasElement && f.unobserve(c);
|
|
3071
3083
|
}
|
|
3072
3084
|
};
|
|
3073
3085
|
}, Oe = (e) => e.flatMap((t) => [...Oe(t.children ?? []), t]);
|
|
@@ -3079,8 +3091,8 @@ export {
|
|
|
3079
3091
|
Ri as createContainer,
|
|
3080
3092
|
wi as createContext,
|
|
3081
3093
|
Ai as createDynamicContainer,
|
|
3082
|
-
|
|
3083
|
-
|
|
3094
|
+
Mi as createEmptyLayer,
|
|
3095
|
+
Si as createLineLayer,
|
|
3084
3096
|
Ti as createMouseControl,
|
|
3085
3097
|
Ae as createMouseEvents,
|
|
3086
3098
|
vi as createNumberTransition,
|
|
@@ -3089,24 +3101,24 @@ export {
|
|
|
3089
3101
|
Pi as createPolygonLayer,
|
|
3090
3102
|
Oi as createPositionTransition,
|
|
3091
3103
|
Ci as createPositionVelocityTransition,
|
|
3092
|
-
|
|
3104
|
+
bi as createRenderLayer,
|
|
3093
3105
|
Ni as createTerrainLayer,
|
|
3094
3106
|
ae as createTransition,
|
|
3095
3107
|
pi as createVec2Transition,
|
|
3096
3108
|
Ii as createVec4Transition,
|
|
3097
3109
|
Xi as createViewTransition,
|
|
3098
3110
|
Wi as createWorld,
|
|
3099
|
-
|
|
3111
|
+
At as debounce,
|
|
3100
3112
|
Di as defaultLayerOptions,
|
|
3101
|
-
|
|
3102
|
-
|
|
3113
|
+
dt as defaultView,
|
|
3114
|
+
mn as degrees,
|
|
3103
3115
|
se as geodetic,
|
|
3104
3116
|
L as mercator,
|
|
3105
|
-
|
|
3117
|
+
vn as quadratic,
|
|
3106
3118
|
De as radians,
|
|
3107
3119
|
ie as range,
|
|
3108
|
-
|
|
3120
|
+
ht as tileToMercator,
|
|
3109
3121
|
pn as toOrientation,
|
|
3110
|
-
|
|
3122
|
+
Se as toQuaternion
|
|
3111
3123
|
};
|
|
3112
3124
|
//# sourceMappingURL=index.js.map
|