world.ts 0.6.12 → 0.6.14
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 +29 -30
- package/dist/index.js.map +1 -1
- package/dist/layers/container.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -743,7 +743,7 @@ const vr = (e, n = {}) => {
|
|
|
743
743
|
[0, 3, 2]
|
|
744
744
|
].flat()
|
|
745
745
|
);
|
|
746
|
-
const a =
|
|
746
|
+
const a = oe(
|
|
747
747
|
() => n.url?.() ?? "",
|
|
748
748
|
(l) => {
|
|
749
749
|
const y = Ye({
|
|
@@ -820,20 +820,19 @@ const vr = (e, n = {}) => {
|
|
|
820
820
|
children: e,
|
|
821
821
|
dispose: () => e.forEach((t) => t.dispose())
|
|
822
822
|
}), hr = (e) => {
|
|
823
|
-
const { keys: n, create: t } = e, r = /* @__PURE__ */ new Map()
|
|
823
|
+
const { keys: n, create: t } = e, r = /* @__PURE__ */ new Map(), o = () => [...r.values()].forEach((i) => i.dispose()), s = oe(n, (i) => {
|
|
824
|
+
[...r.keys()].filter((c) => !i.includes(c)).forEach((c) => {
|
|
825
|
+
r.get(c)?.dispose(), r.delete(c);
|
|
826
|
+
}), i.forEach((c) => {
|
|
827
|
+
const a = r.get(c) ?? t(c);
|
|
828
|
+
r.set(c, a);
|
|
829
|
+
});
|
|
830
|
+
});
|
|
824
831
|
return {
|
|
825
832
|
get children() {
|
|
826
|
-
return [...r.values()];
|
|
827
|
-
},
|
|
828
|
-
render: () => {
|
|
829
|
-
[...r.keys()].filter((i) => !n().includes(i)).forEach((i) => {
|
|
830
|
-
r.get(i)?.dispose(), r.delete(i);
|
|
831
|
-
}), n().forEach((i) => {
|
|
832
|
-
const c = r.get(i) ?? t(i);
|
|
833
|
-
r.set(i, c);
|
|
834
|
-
});
|
|
833
|
+
return s(), [...r.values()];
|
|
835
834
|
},
|
|
836
|
-
dispose:
|
|
835
|
+
dispose: o
|
|
837
836
|
};
|
|
838
837
|
}, pr = (e) => ({
|
|
839
838
|
render: e,
|
|
@@ -959,7 +958,7 @@ const _r = (e, n = {}) => {
|
|
|
959
958
|
dashSize: A,
|
|
960
959
|
dashOffset: P
|
|
961
960
|
});
|
|
962
|
-
}, h =
|
|
961
|
+
}, h = oe(
|
|
963
962
|
() => n.points?.() ?? [],
|
|
964
963
|
(p) => {
|
|
965
964
|
const M = p.flatMap((g) => {
|
|
@@ -1030,7 +1029,7 @@ const _r = (e, n = {}) => {
|
|
|
1030
1029
|
});
|
|
1031
1030
|
o.set(M), s.set(U), i.set(x), c.set(m);
|
|
1032
1031
|
}
|
|
1033
|
-
), T =
|
|
1032
|
+
), T = oe(
|
|
1034
1033
|
() => n.dashPattern?.(),
|
|
1035
1034
|
(p) => {
|
|
1036
1035
|
p = p ?? [[1, 1, 1, 1]], f.use(), t.texImage2D(
|
|
@@ -1188,7 +1187,7 @@ const Tr = (e, n = {}) => {
|
|
|
1188
1187
|
index: d,
|
|
1189
1188
|
texture: o
|
|
1190
1189
|
});
|
|
1191
|
-
}, h =
|
|
1190
|
+
}, h = oe(
|
|
1192
1191
|
() => n.mesh?.(),
|
|
1193
1192
|
(M) => {
|
|
1194
1193
|
const {
|
|
@@ -1203,7 +1202,7 @@ const Tr = (e, n = {}) => {
|
|
|
1203
1202
|
g.length === 0 ? U.flatMap(() => [0, 0]) : g.flatMap((d) => [...d])
|
|
1204
1203
|
), r = x.length * 3;
|
|
1205
1204
|
}
|
|
1206
|
-
), T = "data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==", l =
|
|
1205
|
+
), T = "data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==", l = oe(
|
|
1207
1206
|
() => n.textureUrl?.(),
|
|
1208
1207
|
(M = T) => {
|
|
1209
1208
|
const U = Ye({
|
|
@@ -1286,7 +1285,7 @@ function xt(e, n, t, r, o) {
|
|
|
1286
1285
|
s = ot(i / r | 0, e[i], e[i + 1], s);
|
|
1287
1286
|
return s && ue(s, s.next) && (Ee(s), s = s.next), s;
|
|
1288
1287
|
}
|
|
1289
|
-
function
|
|
1288
|
+
function se(e, n) {
|
|
1290
1289
|
if (!e)
|
|
1291
1290
|
return e;
|
|
1292
1291
|
n || (n = e);
|
|
@@ -1313,7 +1312,7 @@ function he(e, n, t, r, o, s, i) {
|
|
|
1313
1312
|
continue;
|
|
1314
1313
|
}
|
|
1315
1314
|
if (e = u, e === c) {
|
|
1316
|
-
i ? i === 1 ? (e = An(
|
|
1315
|
+
i ? i === 1 ? (e = An(se(e), n), he(e, n, t, r, o, s, 2)) : i === 2 && Pn(e, n, t, r, o, s) : he(se(e), n, t, r, o, s, 1);
|
|
1317
1316
|
break;
|
|
1318
1317
|
}
|
|
1319
1318
|
}
|
|
@@ -1360,7 +1359,7 @@ function An(e, n) {
|
|
|
1360
1359
|
const r = t.prev, o = t.next.next;
|
|
1361
1360
|
!ue(r, o) && pt(r, t, t.next, o) && pe(r, o) && pe(o, r) && (n.push(r.i, t.i, o.i), Ee(t), Ee(t.next), t = e = o), t = t.next;
|
|
1362
1361
|
} while (t !== e);
|
|
1363
|
-
return
|
|
1362
|
+
return se(t);
|
|
1364
1363
|
}
|
|
1365
1364
|
function Pn(e, n, t, r, o, s) {
|
|
1366
1365
|
let i = e;
|
|
@@ -1369,7 +1368,7 @@ function Pn(e, n, t, r, o, s) {
|
|
|
1369
1368
|
for (; c !== i.prev; ) {
|
|
1370
1369
|
if (i.i !== c.i && Xn(i, c)) {
|
|
1371
1370
|
let a = Et(i, c);
|
|
1372
|
-
i =
|
|
1371
|
+
i = se(i, i.next), a = se(a, a.next), he(i, n, t, r, o, s, 0), he(a, n, t, r, o, s, 0);
|
|
1373
1372
|
return;
|
|
1374
1373
|
}
|
|
1375
1374
|
c = c.next;
|
|
@@ -1401,7 +1400,7 @@ function bn(e, n) {
|
|
|
1401
1400
|
if (!t)
|
|
1402
1401
|
return n;
|
|
1403
1402
|
const r = Et(t, e);
|
|
1404
|
-
return
|
|
1403
|
+
return se(r, r.next), se(t, t.next);
|
|
1405
1404
|
}
|
|
1406
1405
|
function In(e, n) {
|
|
1407
1406
|
let t = n;
|
|
@@ -1624,7 +1623,7 @@ const yr = (e, n = {}) => {
|
|
|
1624
1623
|
color: U,
|
|
1625
1624
|
index: M
|
|
1626
1625
|
});
|
|
1627
|
-
}, u =
|
|
1626
|
+
}, u = oe(
|
|
1628
1627
|
() => n.points?.() ?? [],
|
|
1629
1628
|
(h) => {
|
|
1630
1629
|
const { vertices: T, indices: l } = jn(
|
|
@@ -1861,7 +1860,7 @@ const Se = (e) => {
|
|
|
1861
1860
|
delete: (o) => n.delete(t(o)),
|
|
1862
1861
|
clear: () => n.clear()
|
|
1863
1862
|
};
|
|
1864
|
-
}, kn = 15,
|
|
1863
|
+
}, kn = 15, ie = 256, $n = ({
|
|
1865
1864
|
gl: e,
|
|
1866
1865
|
terrainCache: n
|
|
1867
1866
|
}) => {
|
|
@@ -1877,8 +1876,8 @@ const Se = (e) => {
|
|
|
1877
1876
|
const { texture: h, downsample: T } = v, l = 2 ** T, y = [Math.floor(a / l), Math.floor(u / l), f - T], p = t.get(y);
|
|
1878
1877
|
if (p)
|
|
1879
1878
|
return { buffer: p, downsample: T };
|
|
1880
|
-
const M = new Uint8Array(4 *
|
|
1881
|
-
return e.bindFramebuffer(e.FRAMEBUFFER, o), h.attach(), e.readPixels(0, 0,
|
|
1879
|
+
const M = new Uint8Array(4 * ie * ie);
|
|
1880
|
+
return e.bindFramebuffer(e.FRAMEBUFFER, o), h.attach(), e.readPixels(0, 0, ie, ie, e.RGBA, e.UNSIGNED_BYTE, M), e.bindFramebuffer(e.FRAMEBUFFER, null), t.set(y, M), { buffer: M, downsample: T };
|
|
1882
1881
|
};
|
|
1883
1882
|
return { get: ([a = 0, u = 0], f = kn) => {
|
|
1884
1883
|
const v = 2 ** f, h = D([a, u, 0]).map((E) => E * v), [T = 0, l = 0] = h.map((E) => Math.floor(E % v));
|
|
@@ -1888,7 +1887,7 @@ const Se = (e) => {
|
|
|
1888
1887
|
return 0;
|
|
1889
1888
|
const { buffer: U, downsample: x } = M, m = 2 ** x;
|
|
1890
1889
|
[y, p] = [(T % m + y) / m, (l % m + p) / m];
|
|
1891
|
-
const g = 4 *
|
|
1890
|
+
const g = 4 * ie * Math.floor(p * ie) + 4 * Math.floor(y * ie), [d = 0, w = 0, _ = 0] = U.slice(g, g + 4);
|
|
1892
1891
|
return (d * 65536 + w * 256 + _) / 10 - 1e4;
|
|
1893
1892
|
}, dispose: () => {
|
|
1894
1893
|
e.deleteFramebuffer(o);
|
|
@@ -2034,7 +2033,7 @@ const V = 34, Kn = 22, qn = ae(0, V).flatMap(
|
|
|
2034
2033
|
"EXT_texture_filter_anisotropic"
|
|
2035
2034
|
), i = s ? t.getParameter(
|
|
2036
2035
|
s.MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
|
2037
|
-
) : void 0, c =
|
|
2036
|
+
) : void 0, c = oe(
|
|
2038
2037
|
() => n.imageryUrl?.() ?? "",
|
|
2039
2038
|
(R) => {
|
|
2040
2039
|
r?.dispose(), r = it({
|
|
@@ -2188,7 +2187,7 @@ const V = 34, Kn = 22, qn = ae(0, V).flatMap(
|
|
|
2188
2187
|
}
|
|
2189
2188
|
return s;
|
|
2190
2189
|
};
|
|
2191
|
-
},
|
|
2190
|
+
}, oe = (e, n) => {
|
|
2192
2191
|
let t;
|
|
2193
2192
|
return () => {
|
|
2194
2193
|
const r = e();
|
|
@@ -2218,7 +2217,7 @@ const V = 34, Kn = 22, qn = ae(0, V).flatMap(
|
|
|
2218
2217
|
onDragEnd: c,
|
|
2219
2218
|
onMouseMove: a
|
|
2220
2219
|
};
|
|
2221
|
-
}, Re = 8, Me =
|
|
2220
|
+
}, Re = 8, Me = 1e-3;
|
|
2222
2221
|
let H = performance.now();
|
|
2223
2222
|
const _t = () => {
|
|
2224
2223
|
requestAnimationFrame(_t), H = performance.now();
|
|
@@ -2504,7 +2503,7 @@ const Lr = ({ gl: e }, n) => {
|
|
|
2504
2503
|
};
|
|
2505
2504
|
}, ze = (e, n = []) => e.reduce((t, r) => (ze(r.children ?? [], t), t.push(r), t), n);
|
|
2506
2505
|
export {
|
|
2507
|
-
|
|
2506
|
+
oe as cache,
|
|
2508
2507
|
Mr as cacheAll,
|
|
2509
2508
|
Q as circumference,
|
|
2510
2509
|
vr as createBillboardLayer,
|