softbox 4.3.2 → 4.4.1
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/README.md +19 -2
- package/dist/{ThreePathTracingService-H2v63TOd.cjs → ThreePathTracingService-CVTgPYSp.cjs} +1 -1
- package/dist/{ThreePathTracingService-r9mlCyVS.js → ThreePathTracingService-DTWmDzs1.js} +1 -1
- package/dist/{index-QkQEREfW.cjs → index-BiSXFVUP.cjs} +5 -5
- package/dist/{index-BdrQXlCy.js → index-uh2exMyt.js} +1015 -983
- package/dist/index.d.cts +104 -0
- package/dist/index.d.ts +104 -0
- package/dist/simple-viewer.cjs +1 -1
- package/dist/simple-viewer.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as Te, jsxs as
|
|
2
|
-
import { useMemo as Dt,
|
|
1
|
+
import { jsx as Te, jsxs as jn } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as Dt, useState as An, useEffect as rt, useRef as Ve, useCallback as Rt, createContext as Wa, useContext as Za, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
|
|
3
3
|
import * as w from "three";
|
|
4
|
-
import { Box3 as _t, Matrix4 as ut, BufferAttribute as
|
|
4
|
+
import { Box3 as _t, Matrix4 as ut, BufferAttribute as Vn, Vector3 as $, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Wn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as qn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as vn, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Gn, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Ue, TOUCH as Ye, Spherical as Gs, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as Pn, DataUtils as Et, RedFormat as fs, FloatType as Zn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } from "three";
|
|
5
5
|
class Z extends Error {
|
|
6
6
|
constructor(e, t, n) {
|
|
7
7
|
super(e), this.code = t, this.context = n, this.name = "ThreeViewerError", this.timestamp = /* @__PURE__ */ new Date(), Error.captureStackTrace && Error.captureStackTrace(this, Z);
|
|
@@ -161,7 +161,7 @@ class Rc {
|
|
|
161
161
|
* aborts before touching a disposed renderer/scene.
|
|
162
162
|
*/
|
|
163
163
|
async configureEnvironment(e, t, n, s, r, o) {
|
|
164
|
-
var d, h, f, p,
|
|
164
|
+
var d, h, f, p, y, S;
|
|
165
165
|
const a = await t.initialize({ renderer: s, autoDispose: !0 });
|
|
166
166
|
if (o())
|
|
167
167
|
return;
|
|
@@ -176,18 +176,18 @@ class Rc {
|
|
|
176
176
|
if (o())
|
|
177
177
|
return;
|
|
178
178
|
_.ok ? t.applyToScene(e, _.value, c) : console.warn("Failed to load environment map:", _.error);
|
|
179
|
-
} else if ((
|
|
179
|
+
} else if ((y = r.helpers) != null && y.studioEnvironment) {
|
|
180
180
|
const _ = t.createStudioEnvironment();
|
|
181
181
|
if (_.ok) {
|
|
182
182
|
if (t.applyToScene(e, _.value, {
|
|
183
183
|
...c,
|
|
184
184
|
setBackground: !1
|
|
185
|
-
}), (
|
|
186
|
-
const
|
|
185
|
+
}), (S = r.helpers) != null && S.darkStudioMode && n) {
|
|
186
|
+
const x = n.createGradientBackground(e, {
|
|
187
187
|
topColor: Cr,
|
|
188
188
|
bottomColor: Cr
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
x.ok || console.warn("Failed to set dark studio background:", x.error);
|
|
191
191
|
}
|
|
192
192
|
} else
|
|
193
193
|
console.warn("Failed to create studio environment:", _.error);
|
|
@@ -1014,11 +1014,11 @@ class kc {
|
|
|
1014
1014
|
}, u = `video-capture:${Do()}`;
|
|
1015
1015
|
return this.deps.renderLoopManager.requireContinuous(u), this.deps.reviveRenderLoop(), this.deps.renderLoopManager.requestRender(), new Promise((h) => {
|
|
1016
1016
|
const f = [];
|
|
1017
|
-
let p = null,
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1017
|
+
let p = null, y = !1;
|
|
1018
|
+
const S = (x) => {
|
|
1019
|
+
y || (y = !0, this.pendingSettlers.delete(_), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((E) => E.stop()), h(x));
|
|
1020
1020
|
}, _ = () => {
|
|
1021
|
-
|
|
1021
|
+
S(
|
|
1022
1022
|
k.err(
|
|
1023
1023
|
new Z("Viewer was disposed during video capture", Y.INVALID_STATE)
|
|
1024
1024
|
)
|
|
@@ -1028,12 +1028,12 @@ class kc {
|
|
|
1028
1028
|
} catch {
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
|
-
this.pendingSettlers.add(_), r.ondataavailable = (
|
|
1032
|
-
|
|
1031
|
+
this.pendingSettlers.add(_), r.ondataavailable = (x) => {
|
|
1032
|
+
x.data.size > 0 && f.push(x.data);
|
|
1033
1033
|
}, r.onstop = () => {
|
|
1034
|
-
|
|
1034
|
+
S(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
|
|
1035
1035
|
}, r.onerror = () => {
|
|
1036
|
-
|
|
1036
|
+
S(
|
|
1037
1037
|
k.err(
|
|
1038
1038
|
new Z("Video recording failed", Y.OPERATION_FAILED)
|
|
1039
1039
|
)
|
|
@@ -1104,16 +1104,16 @@ class kc {
|
|
|
1104
1104
|
e.width ?? (e.height !== void 0 ? e.height * h : u * a)
|
|
1105
1105
|
), p = Math.round(
|
|
1106
1106
|
e.height ?? (e.width !== void 0 ? e.width / h : d * a)
|
|
1107
|
-
),
|
|
1108
|
-
if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f >
|
|
1107
|
+
), y = t.capabilities.maxTextureSize;
|
|
1108
|
+
if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > y || p > y)
|
|
1109
1109
|
return k.err(
|
|
1110
1110
|
new Z(
|
|
1111
|
-
`Requested still size ${f}x${p} is outside 1..${
|
|
1111
|
+
`Requested still size ${f}x${p} is outside 1..${y}`,
|
|
1112
1112
|
Y.INVALID_PARAMETER
|
|
1113
1113
|
)
|
|
1114
1114
|
);
|
|
1115
1115
|
t.setPixelRatio(1), t.setSize(f, p), Mi(s, f / p);
|
|
1116
|
-
const
|
|
1116
|
+
const S = t.render(n, s), _ = S.ok ? this.readCanvasPng() : k.err(S.error);
|
|
1117
1117
|
return t.setSize(u, d), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), _;
|
|
1118
1118
|
}
|
|
1119
1119
|
readCanvasPng() {
|
|
@@ -1319,7 +1319,7 @@ class Fc {
|
|
|
1319
1319
|
* helpers — take effect at construction time and require a rebuild.
|
|
1320
1320
|
*/
|
|
1321
1321
|
updateOptions(e) {
|
|
1322
|
-
var h, f, p,
|
|
1322
|
+
var h, f, p, y, S, _, x, E, b;
|
|
1323
1323
|
if (this.disposed)
|
|
1324
1324
|
return;
|
|
1325
1325
|
const t = (h = this.options.animations) == null ? void 0 : h.autoplay, n = (f = this.options.controls) == null ? void 0 : f.autoRotate;
|
|
@@ -1328,16 +1328,16 @@ class Fc {
|
|
|
1328
1328
|
e.backgroundColor !== void 0 && this.applyBackgroundColor(e.backgroundColor);
|
|
1329
1329
|
const r = (p = e.renderer) == null ? void 0 : p.toneMappingExposure;
|
|
1330
1330
|
r !== void 0 && (this.renderer.setToneMappingExposure(r), s = !0);
|
|
1331
|
-
const o = (
|
|
1331
|
+
const o = (y = e.environment) == null ? void 0 : y.environmentIntensity;
|
|
1332
1332
|
o !== void 0 && (this.scene.setEnvironmentIntensity(o), s = !0);
|
|
1333
|
-
const a = (
|
|
1333
|
+
const a = (S = e.controls) == null ? void 0 : S.autoRotate;
|
|
1334
1334
|
a !== void 0 && a !== n && (this.controls.autoRotate = a, a ? (this.renderLoopManager.requireContinuous("turntable"), this.capture.notifyTurntableEnabled()) : this.renderLoopManager.releaseContinuous("turntable"), s = !0);
|
|
1335
1335
|
const c = (_ = e.controls) == null ? void 0 : _.autoRotateSpeed;
|
|
1336
1336
|
c !== void 0 && (this.controls.autoRotateSpeed = c, s = !0);
|
|
1337
|
-
const u = (
|
|
1337
|
+
const u = (x = e.animations) == null ? void 0 : x.autoplay;
|
|
1338
1338
|
u !== void 0 && u !== t && (u ? this.modelManager.getCurrentModel() && this.autoplayFromOptions(u) : this.pauseAnimations(), s = !0);
|
|
1339
1339
|
const d = (E = e.animations) == null ? void 0 : E.speed;
|
|
1340
|
-
d !== void 0 && ((
|
|
1340
|
+
d !== void 0 && ((b = this.animationService) == null || b.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
|
|
1341
1341
|
}
|
|
1342
1342
|
applyBackgroundColor(e) {
|
|
1343
1343
|
var n;
|
|
@@ -1573,7 +1573,7 @@ class Zt {
|
|
|
1573
1573
|
return new Zt(new w.Vector3(e, t, n));
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
|
-
const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, De = qe / 4, sr = 65535,
|
|
1576
|
+
const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, De = qe / 4, sr = 65535, Hd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
|
|
1577
1577
|
strategy: No,
|
|
1578
1578
|
maxDepth: 40,
|
|
1579
1579
|
maxLeafSize: 10,
|
|
@@ -1612,7 +1612,7 @@ function ms(i, e, t) {
|
|
|
1612
1612
|
o < t[n] && (t[n] = o), a > t[n + 3] && (t[n + 3] = a);
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function Ln(i) {
|
|
1616
1616
|
const e = i[3] - i[0], t = i[4] - i[1], n = i[5] - i[2];
|
|
1617
1617
|
return 2 * (e * t + t * n + n * e);
|
|
1618
1618
|
}
|
|
@@ -1635,21 +1635,21 @@ function Be(i, e) {
|
|
|
1635
1635
|
function rr(i, e) {
|
|
1636
1636
|
return e[i + 7];
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function Gd(i) {
|
|
1639
1639
|
return i;
|
|
1640
1640
|
}
|
|
1641
1641
|
function ii(i, e, t, n, s) {
|
|
1642
|
-
let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0,
|
|
1643
|
-
const
|
|
1644
|
-
for (let E = (e -
|
|
1642
|
+
let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, y = -1 / 0, S = -1 / 0, _ = -1 / 0;
|
|
1643
|
+
const x = i.offset || 0;
|
|
1644
|
+
for (let E = (e - x) * 6, b = (e + t - x) * 6; E < b; E += 6) {
|
|
1645
1645
|
const T = i[E + 0], A = i[E + 1], P = T - A, I = T + A;
|
|
1646
|
-
P < r && (r = P), I > c && (c = I), T < h && (h = T), T >
|
|
1646
|
+
P < r && (r = P), I > c && (c = I), T < h && (h = T), T > y && (y = T);
|
|
1647
1647
|
const M = i[E + 2], O = i[E + 3], C = M - O, N = M + O;
|
|
1648
|
-
C < o && (o = C), N > u && (u = N), M < f && (f = M), M >
|
|
1648
|
+
C < o && (o = C), N > u && (u = N), M < f && (f = M), M > S && (S = M);
|
|
1649
1649
|
const D = i[E + 4], H = i[E + 5], j = D - H, q = D + H;
|
|
1650
1650
|
j < a && (a = j), q > d && (d = q), D < p && (p = D), D > _ && (_ = D);
|
|
1651
1651
|
}
|
|
1652
|
-
n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] =
|
|
1652
|
+
n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = _;
|
|
1653
1653
|
}
|
|
1654
1654
|
const Ct = 32, Uc = (i, e) => i.candidate - e.candidate, Bt = /* @__PURE__ */ new Array(Ct).fill().map(() => ({
|
|
1655
1655
|
count: 0,
|
|
@@ -1665,17 +1665,17 @@ function Hc(i, e, t, n, s, r) {
|
|
|
1665
1665
|
else if (r === zc)
|
|
1666
1666
|
o = Or(i), o !== -1 && (a = Gc(t, n, s, o));
|
|
1667
1667
|
else if (r === Bc) {
|
|
1668
|
-
const c =
|
|
1668
|
+
const c = Ln(i);
|
|
1669
1669
|
let u = si * s;
|
|
1670
1670
|
const d = t.offset || 0, h = (n - d) * 6, f = (n + s - d) * 6;
|
|
1671
1671
|
for (let p = 0; p < 3; p++) {
|
|
1672
|
-
const
|
|
1672
|
+
const y = e[p], x = (e[p + 3] - y) / Ct;
|
|
1673
1673
|
if (s < Ct / 4) {
|
|
1674
1674
|
const E = [...Bt];
|
|
1675
1675
|
E.length = s;
|
|
1676
|
-
let
|
|
1677
|
-
for (let A = h; A < f; A += 6,
|
|
1678
|
-
const P = E[
|
|
1676
|
+
let b = 0;
|
|
1677
|
+
for (let A = h; A < f; A += 6, b++) {
|
|
1678
|
+
const P = E[b];
|
|
1679
1679
|
P.candidate = t[A + 2 * p], P.count = 0;
|
|
1680
1680
|
const {
|
|
1681
1681
|
bounds: I,
|
|
@@ -1703,22 +1703,22 @@ function Hc(i, e, t, n, s, r) {
|
|
|
1703
1703
|
for (let A = 0; A < T; A++) {
|
|
1704
1704
|
const P = E[A], I = P.count, M = s - P.count, O = P.leftCacheBounds, C = P.rightCacheBounds;
|
|
1705
1705
|
let N = 0;
|
|
1706
|
-
I !== 0 && (N =
|
|
1706
|
+
I !== 0 && (N = Ln(O) / c);
|
|
1707
1707
|
let D = 0;
|
|
1708
|
-
M !== 0 && (D =
|
|
1708
|
+
M !== 0 && (D = Ln(C) / c);
|
|
1709
1709
|
const H = Lr + si * (N * I + D * M);
|
|
1710
1710
|
H < u && (o = p, u = H, a = P.candidate);
|
|
1711
1711
|
}
|
|
1712
1712
|
} else {
|
|
1713
1713
|
for (let T = 0; T < Ct; T++) {
|
|
1714
1714
|
const A = Bt[T];
|
|
1715
|
-
A.count = 0, A.candidate =
|
|
1715
|
+
A.count = 0, A.candidate = y + x + T * x;
|
|
1716
1716
|
const P = A.bounds;
|
|
1717
1717
|
for (let I = 0; I < 3; I++)
|
|
1718
1718
|
P[I] = 1 / 0, P[I + 3] = -1 / 0;
|
|
1719
1719
|
}
|
|
1720
1720
|
for (let T = h; T < f; T += 6) {
|
|
1721
|
-
let I = ~~((t[T + 2 * p] -
|
|
1721
|
+
let I = ~~((t[T + 2 * p] - y) / x);
|
|
1722
1722
|
I >= Ct && (I = Ct - 1);
|
|
1723
1723
|
const M = Bt[I];
|
|
1724
1724
|
M.count++, ms(T, t, M.bounds);
|
|
@@ -1729,15 +1729,15 @@ function Hc(i, e, t, n, s, r) {
|
|
|
1729
1729
|
const A = Bt[T], P = Bt[T + 1];
|
|
1730
1730
|
Nr(A.bounds, P.rightCacheBounds, A.rightCacheBounds);
|
|
1731
1731
|
}
|
|
1732
|
-
let
|
|
1732
|
+
let b = 0;
|
|
1733
1733
|
for (let T = 0; T < Ct - 1; T++) {
|
|
1734
1734
|
const A = Bt[T], P = A.count, I = A.bounds, O = Bt[T + 1].rightCacheBounds;
|
|
1735
|
-
P !== 0 && (
|
|
1735
|
+
P !== 0 && (b === 0 ? Dr(I, gs) : Nr(I, gs, gs)), b += P;
|
|
1736
1736
|
let C = 0, N = 0;
|
|
1737
|
-
|
|
1738
|
-
const D = s -
|
|
1739
|
-
D !== 0 && (N =
|
|
1740
|
-
const H = Lr + si * (C *
|
|
1737
|
+
b !== 0 && (C = Ln(gs) / c);
|
|
1738
|
+
const D = s - b;
|
|
1739
|
+
D !== 0 && (N = Ln(O) / c);
|
|
1740
|
+
const H = Lr + si * (C * b + N * D);
|
|
1741
1741
|
H < u && (o = p, u = H, a = A.candidate);
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
@@ -1772,8 +1772,8 @@ function jc(i, e, t, n, s, r) {
|
|
|
1772
1772
|
i[o * e + h] = i[a * e + h], i[a * e + h] = f;
|
|
1773
1773
|
}
|
|
1774
1774
|
for (let h = 0; h < 6; h++) {
|
|
1775
|
-
const f = o - d, p = a - d,
|
|
1776
|
-
t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] =
|
|
1775
|
+
const f = o - d, p = a - d, y = t[f * 6 + h];
|
|
1776
|
+
t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] = y;
|
|
1777
1777
|
}
|
|
1778
1778
|
o++, a--;
|
|
1779
1779
|
} else
|
|
@@ -1811,27 +1811,27 @@ function Zc(i, e, t, n, s, r) {
|
|
|
1811
1811
|
strategy: u,
|
|
1812
1812
|
onProgress: d
|
|
1813
1813
|
} = s, h = i.primitiveBuffer, f = i.primitiveBufferStride, p = new Float32Array(6);
|
|
1814
|
-
let
|
|
1815
|
-
const
|
|
1816
|
-
return ii(e, t, n,
|
|
1814
|
+
let y = !1;
|
|
1815
|
+
const S = new ri();
|
|
1816
|
+
return ii(e, t, n, S.boundingData, p), x(S, t, n, p), S;
|
|
1817
1817
|
function _(E) {
|
|
1818
1818
|
d && d((E - r.offset) / r.count);
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1821
|
-
if (!
|
|
1822
|
-
return _(
|
|
1823
|
-
const I = Hc(E.boundingData, A, e,
|
|
1820
|
+
function x(E, b, T, A = null, P = 0) {
|
|
1821
|
+
if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), T <= c || P >= o)
|
|
1822
|
+
return _(b + T), E.offset = b, E.count = T, E;
|
|
1823
|
+
const I = Hc(E.boundingData, A, e, b, T, u);
|
|
1824
1824
|
if (I.axis === -1)
|
|
1825
|
-
return _(
|
|
1826
|
-
const M = jc(h, f, e,
|
|
1827
|
-
if (M ===
|
|
1828
|
-
_(
|
|
1825
|
+
return _(b + T), E.offset = b, E.count = T, E;
|
|
1826
|
+
const M = jc(h, f, e, b, T, I);
|
|
1827
|
+
if (M === b || M === b + T)
|
|
1828
|
+
_(b + T), E.offset = b, E.count = T;
|
|
1829
1829
|
else {
|
|
1830
1830
|
E.splitAxis = I.axis;
|
|
1831
|
-
const O = new ri(), C =
|
|
1832
|
-
E.left = O, ii(e, C, N, O.boundingData, p),
|
|
1831
|
+
const O = new ri(), C = b, N = M - b;
|
|
1832
|
+
E.left = O, ii(e, C, N, O.boundingData, p), x(O, C, N, p, P + 1);
|
|
1833
1833
|
const D = new ri(), H = M, j = T - N;
|
|
1834
|
-
E.right = D, ii(e, H, j, D.boundingData, p),
|
|
1834
|
+
E.right = D, ii(e, H, j, D.boundingData, p), x(D, H, j, p, P + 1);
|
|
1835
1835
|
}
|
|
1836
1836
|
return E;
|
|
1837
1837
|
}
|
|
@@ -1901,21 +1901,21 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
1901
1901
|
return $e(D, j) + Qe(q, H);
|
|
1902
1902
|
};
|
|
1903
1903
|
const f = ze(i), p = Be(i, u);
|
|
1904
|
-
let
|
|
1905
|
-
if (s && (E = Wt,
|
|
1906
|
-
|
|
1904
|
+
let y = f, S = p, _, x, E, b;
|
|
1905
|
+
if (s && (E = Wt, b = _n, Ae(y, a, E), Ae(S, a, b), _ = s(E), x = s(b), x < _)) {
|
|
1906
|
+
y = p, S = f;
|
|
1907
1907
|
const D = _;
|
|
1908
|
-
_ =
|
|
1908
|
+
_ = x, x = D, E = b;
|
|
1909
1909
|
}
|
|
1910
|
-
E || (E = Wt, Ae(
|
|
1911
|
-
const T = Ne(
|
|
1910
|
+
E || (E = Wt, Ae(y, a, E));
|
|
1911
|
+
const T = Ne(y * 2, c), A = t(E, T, _, o + 1, r + y / De);
|
|
1912
1912
|
let P;
|
|
1913
1913
|
if (A === Pr) {
|
|
1914
|
-
const D = C(
|
|
1915
|
-
P = n(D, j, !0, o + 1, r +
|
|
1914
|
+
const D = C(y), j = N(y) - D;
|
|
1915
|
+
P = n(D, j, !0, o + 1, r + y / De, E);
|
|
1916
1916
|
} else
|
|
1917
1917
|
P = A && Li(
|
|
1918
|
-
|
|
1918
|
+
y,
|
|
1919
1919
|
e,
|
|
1920
1920
|
t,
|
|
1921
1921
|
n,
|
|
@@ -1924,15 +1924,15 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
1924
1924
|
o + 1
|
|
1925
1925
|
);
|
|
1926
1926
|
if (P) return !0;
|
|
1927
|
-
|
|
1928
|
-
const I = Ne(
|
|
1927
|
+
b = _n, Ae(S, a, b);
|
|
1928
|
+
const I = Ne(S * 2, c), M = t(b, I, x, o + 1, r + S / De);
|
|
1929
1929
|
let O;
|
|
1930
1930
|
if (M === Pr) {
|
|
1931
|
-
const D = C(
|
|
1932
|
-
O = n(D, j, !0, o + 1, r +
|
|
1931
|
+
const D = C(S), j = N(S) - D;
|
|
1932
|
+
O = n(D, j, !0, o + 1, r + S / De, b);
|
|
1933
1933
|
} else
|
|
1934
1934
|
O = M && Li(
|
|
1935
|
-
|
|
1935
|
+
S,
|
|
1936
1936
|
e,
|
|
1937
1937
|
t,
|
|
1938
1938
|
n,
|
|
@@ -1943,7 +1943,7 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
1943
1943
|
return !!O;
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
|
-
const
|
|
1946
|
+
const Kn = /* @__PURE__ */ new be.constructor(), Vs = /* @__PURE__ */ new be.constructor(), Gt = /* @__PURE__ */ new or(() => new _t()), ln = /* @__PURE__ */ new _t(), hn = /* @__PURE__ */ new _t(), oi = /* @__PURE__ */ new _t(), ai = /* @__PURE__ */ new _t();
|
|
1947
1947
|
let ci = !1;
|
|
1948
1948
|
function qc(i, e, t, n) {
|
|
1949
1949
|
if (ci)
|
|
@@ -1953,10 +1953,10 @@ function qc(i, e, t, n) {
|
|
|
1953
1953
|
let o, a = 0, c = 0;
|
|
1954
1954
|
const u = new ut().copy(t).invert();
|
|
1955
1955
|
for (let d = 0, h = s.length; d < h; d++) {
|
|
1956
|
-
|
|
1956
|
+
Kn.setBuffer(s[d]), c = 0;
|
|
1957
1957
|
const f = Gt.getPrimitive();
|
|
1958
|
-
Ae(0,
|
|
1959
|
-
for (let p = 0,
|
|
1958
|
+
Ae(0, Kn.float32Array, f), f.applyMatrix4(u);
|
|
1959
|
+
for (let p = 0, y = r.length; p < y && (Vs.setBuffer(r[p]), o = gt(
|
|
1960
1960
|
0,
|
|
1961
1961
|
0,
|
|
1962
1962
|
t,
|
|
@@ -1969,30 +1969,30 @@ function qc(i, e, t, n) {
|
|
|
1969
1969
|
f
|
|
1970
1970
|
), Vs.clearBuffer(), c += r[p].byteLength / qe, !o); p++)
|
|
1971
1971
|
;
|
|
1972
|
-
if (Gt.releasePrimitive(f),
|
|
1972
|
+
if (Gt.releasePrimitive(f), Kn.clearBuffer(), a += s[d].byteLength / qe, o)
|
|
1973
1973
|
break;
|
|
1974
1974
|
}
|
|
1975
1975
|
return ci = !1, o;
|
|
1976
1976
|
}
|
|
1977
1977
|
function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
1978
1978
|
let h, f;
|
|
1979
|
-
d ? (h = Vs, f =
|
|
1980
|
-
const p = h.float32Array,
|
|
1979
|
+
d ? (h = Vs, f = Kn) : (h = Kn, f = Vs);
|
|
1980
|
+
const p = h.float32Array, y = h.uint32Array, S = h.uint16Array, _ = f.float32Array, x = f.uint32Array, E = f.uint16Array, b = i * 2, T = e * 2, A = Ne(b, S), P = Ne(T, E);
|
|
1981
1981
|
let I = !1;
|
|
1982
1982
|
if (P && A)
|
|
1983
1983
|
d ? I = s(
|
|
1984
|
-
$e(e,
|
|
1984
|
+
$e(e, x),
|
|
1985
1985
|
Qe(e * 2, E),
|
|
1986
|
-
$e(i,
|
|
1987
|
-
Qe(i * 2,
|
|
1986
|
+
$e(i, y),
|
|
1987
|
+
Qe(i * 2, S),
|
|
1988
1988
|
c,
|
|
1989
1989
|
o + e / De,
|
|
1990
1990
|
a,
|
|
1991
1991
|
r + i / De
|
|
1992
1992
|
) : I = s(
|
|
1993
|
-
$e(i,
|
|
1994
|
-
Qe(i * 2,
|
|
1995
|
-
$e(e,
|
|
1993
|
+
$e(i, y),
|
|
1994
|
+
Qe(i * 2, S),
|
|
1995
|
+
$e(e, x),
|
|
1996
1996
|
Qe(e * 2, E),
|
|
1997
1997
|
a,
|
|
1998
1998
|
r + i / De,
|
|
@@ -2002,7 +2002,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2002
2002
|
else if (P) {
|
|
2003
2003
|
const M = Gt.getPrimitive();
|
|
2004
2004
|
Ae(e, _, M), M.applyMatrix4(t);
|
|
2005
|
-
const O = ze(i), C = Be(i,
|
|
2005
|
+
const O = ze(i), C = Be(i, y);
|
|
2006
2006
|
Ae(O, p, ln), Ae(C, p, hn);
|
|
2007
2007
|
const N = M.intersectsBox(ln), D = M.intersectsBox(hn);
|
|
2008
2008
|
I = N && gt(
|
|
@@ -2031,7 +2031,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2031
2031
|
!d
|
|
2032
2032
|
), Gt.releasePrimitive(M);
|
|
2033
2033
|
} else {
|
|
2034
|
-
const M = ze(e), O = Be(e,
|
|
2034
|
+
const M = ze(e), O = Be(e, x);
|
|
2035
2035
|
Ae(M, _, oi), Ae(O, _, ai);
|
|
2036
2036
|
const C = u.intersectsBox(oi), N = u.intersectsBox(ai);
|
|
2037
2037
|
if (C && N)
|
|
@@ -2078,7 +2078,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2078
2078
|
else {
|
|
2079
2079
|
const D = Gt.getPrimitive();
|
|
2080
2080
|
D.copy(oi).applyMatrix4(t);
|
|
2081
|
-
const H = ze(i), j = Be(i,
|
|
2081
|
+
const H = ze(i), j = Be(i, y);
|
|
2082
2082
|
Ae(H, p, ln), Ae(j, p, hn);
|
|
2083
2083
|
const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
|
|
2084
2084
|
I = q && gt(
|
|
@@ -2125,7 +2125,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2125
2125
|
else {
|
|
2126
2126
|
const D = Gt.getPrimitive();
|
|
2127
2127
|
D.copy(ai).applyMatrix4(t);
|
|
2128
|
-
const H = ze(i), j = Be(i,
|
|
2128
|
+
const H = ze(i), j = Be(i, y);
|
|
2129
2129
|
Ae(H, p, ln), Ae(j, p, hn);
|
|
2130
2130
|
const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
|
|
2131
2131
|
I = q && gt(
|
|
@@ -2182,8 +2182,8 @@ class $c {
|
|
|
2182
2182
|
let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0;
|
|
2183
2183
|
for (let h = e, f = e + t; h < f; h++) {
|
|
2184
2184
|
this.writePrimitiveBounds(h, un, 0);
|
|
2185
|
-
const [p,
|
|
2186
|
-
p < r && (r = p), _ > c && (c = _),
|
|
2185
|
+
const [p, y, S, _, x, E] = un;
|
|
2186
|
+
p < r && (r = p), _ > c && (c = _), y < o && (o = y), x > u && (u = x), S < a && (a = S), E > d && (d = E);
|
|
2187
2187
|
}
|
|
2188
2188
|
return n[s + 0] = r, n[s + 1] = o, n[s + 2] = a, n[s + 3] = c, n[s + 4] = u, n[s + 5] = d, n;
|
|
2189
2189
|
}
|
|
@@ -2191,8 +2191,8 @@ class $c {
|
|
|
2191
2191
|
const s = n.offset || 0;
|
|
2192
2192
|
for (let r = e, o = e + t; r < o; r++) {
|
|
2193
2193
|
this.writePrimitiveBounds(r, un, 0);
|
|
2194
|
-
const [a, c, u, d, h, f] = un, p = (a + d) / 2,
|
|
2195
|
-
n[
|
|
2194
|
+
const [a, c, u, d, h, f] = un, p = (a + d) / 2, y = (c + h) / 2, S = (u + f) / 2, _ = (d - a) / 2, x = (h - c) / 2, E = (f - u) / 2, b = (r - s) * 6;
|
|
2195
|
+
n[b + 0] = p, n[b + 1] = _ + (Math.abs(p) + _) * zs, n[b + 2] = y, n[b + 3] = x + (Math.abs(y) + x) * zs, n[b + 4] = S, n[b + 5] = E + (Math.abs(S) + E) * zs;
|
|
2196
2196
|
}
|
|
2197
2197
|
return n;
|
|
2198
2198
|
}
|
|
@@ -2252,13 +2252,13 @@ class $c {
|
|
|
2252
2252
|
for (let u = c - 1; u >= 0; u--) {
|
|
2253
2253
|
const d = u * De, h = d * 2;
|
|
2254
2254
|
if (Ne(h, o)) {
|
|
2255
|
-
const p = $e(d, r),
|
|
2256
|
-
this.writePrimitiveRangeBounds(p,
|
|
2255
|
+
const p = $e(d, r), y = Qe(h, o);
|
|
2256
|
+
this.writePrimitiveRangeBounds(p, y, un, 0), a.set(un, d);
|
|
2257
2257
|
} else {
|
|
2258
|
-
const p = ze(d),
|
|
2259
|
-
for (let
|
|
2260
|
-
const _ = a[p +
|
|
2261
|
-
a[d +
|
|
2258
|
+
const p = ze(d), y = Be(d, r);
|
|
2259
|
+
for (let S = 0; S < 3; S++) {
|
|
2260
|
+
const _ = a[p + S], x = a[p + S + 3], E = a[y + S], b = a[y + S + 3];
|
|
2261
|
+
a[d + S] = _ < E ? _ : E, a[d + S + 3] = x > b ? x : b;
|
|
2262
2262
|
}
|
|
2263
2263
|
}
|
|
2264
2264
|
}
|
|
@@ -2300,8 +2300,8 @@ class $c {
|
|
|
2300
2300
|
} = e;
|
|
2301
2301
|
if (s && r) {
|
|
2302
2302
|
const h = s;
|
|
2303
|
-
s = (f, p,
|
|
2304
|
-
} else s || (r ? s = (h, f, p,
|
|
2303
|
+
s = (f, p, y, S, _) => h(f, p, y, S, _) ? !0 : a(f, p, this, r, y, S, o);
|
|
2304
|
+
} else s || (r ? s = (h, f, p, y) => a(h, f, this, r, p, y, o) : s = (h, f, p) => p);
|
|
2305
2305
|
let c = !1, u = 0;
|
|
2306
2306
|
const d = this._roots;
|
|
2307
2307
|
for (let h = 0, f = d.length; h < f; h++) {
|
|
@@ -2343,7 +2343,7 @@ function Jc(i, e = ArrayBuffer) {
|
|
|
2343
2343
|
function el(i, e) {
|
|
2344
2344
|
if (!i.index) {
|
|
2345
2345
|
const t = i.attributes.position.count, n = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Jc(t, n);
|
|
2346
|
-
i.setIndex(new
|
|
2346
|
+
i.setIndex(new Vn(s, 1));
|
|
2347
2347
|
for (let r = 0; r < t; r++)
|
|
2348
2348
|
s[r] = r;
|
|
2349
2349
|
}
|
|
@@ -2367,8 +2367,8 @@ function Fr(i, e, t) {
|
|
|
2367
2367
|
return [n];
|
|
2368
2368
|
const r = [], o = n.offset, a = n.offset + n.count, c = ar(i) / t, u = [];
|
|
2369
2369
|
for (const f of s) {
|
|
2370
|
-
const { offset: p, count:
|
|
2371
|
-
|
|
2370
|
+
const { offset: p, count: y } = f, S = p, _ = isFinite(y) ? y : c - p, x = p + _;
|
|
2371
|
+
S < a && x > o && (u.push({ pos: Math.max(o, S), isStart: !0 }), u.push({ pos: Math.min(a, x), isStart: !1 }));
|
|
2372
2372
|
}
|
|
2373
2373
|
u.sort((f, p) => f.pos !== p.pos ? f.pos - p.pos : f.type === "end" ? -1 : 1);
|
|
2374
2374
|
let d = 0, h = null;
|
|
@@ -2487,9 +2487,9 @@ const rl = /* @__PURE__ */ (function() {
|
|
|
2487
2487
|
return function(s, r, o) {
|
|
2488
2488
|
const a = s.start, c = i, u = r.start, d = e;
|
|
2489
2489
|
t.subVectors(a, u), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
|
|
2490
|
-
const h = t.dot(d), f = d.dot(c), p = d.dot(d),
|
|
2491
|
-
let
|
|
2492
|
-
_ !== 0 ?
|
|
2490
|
+
const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c), _ = c.dot(c) * p - f * f;
|
|
2491
|
+
let x, E;
|
|
2492
|
+
_ !== 0 ? x = (h * f - y * p) / _ : x = 0, E = (h + x * f) / p, o.x = x, o.y = E;
|
|
2493
2493
|
};
|
|
2494
2494
|
})(), cr = /* @__PURE__ */ (function() {
|
|
2495
2495
|
const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
|
|
@@ -2525,15 +2525,15 @@ const rl = /* @__PURE__ */ (function() {
|
|
|
2525
2525
|
return function(r, o) {
|
|
2526
2526
|
const { radius: a, center: c } = r, { a: u, b: d, c: h } = o;
|
|
2527
2527
|
if (n.start = u, n.end = d, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a || (n.start = u, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a) || (n.start = d, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a)) return !0;
|
|
2528
|
-
const
|
|
2529
|
-
if (Math.abs(
|
|
2530
|
-
const
|
|
2531
|
-
if (o.containsPoint(
|
|
2528
|
+
const S = o.getPlane(t);
|
|
2529
|
+
if (Math.abs(S.distanceToPoint(c)) <= a) {
|
|
2530
|
+
const x = S.projectPoint(c, e);
|
|
2531
|
+
if (o.containsPoint(x)) return !0;
|
|
2532
2532
|
}
|
|
2533
2533
|
return !1;
|
|
2534
2534
|
};
|
|
2535
2535
|
})(), al = ["x", "y", "z"], Pt = 1e-15, zr = Pt * Pt;
|
|
2536
|
-
function
|
|
2536
|
+
function at(i) {
|
|
2537
2537
|
return Math.abs(i) < Pt;
|
|
2538
2538
|
}
|
|
2539
2539
|
class Tt extends En {
|
|
@@ -2555,10 +2555,10 @@ class Tt extends En {
|
|
|
2555
2555
|
u.subVectors(e, t), d.setFromPoints(u, s);
|
|
2556
2556
|
const h = r[2], f = o[2];
|
|
2557
2557
|
h.subVectors(t, n), f.setFromPoints(h, s);
|
|
2558
|
-
const p = r[3],
|
|
2559
|
-
p.subVectors(n, e),
|
|
2560
|
-
const
|
|
2561
|
-
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1,
|
|
2558
|
+
const p = r[3], y = o[3];
|
|
2559
|
+
p.subVectors(n, e), y.setFromPoints(p, s);
|
|
2560
|
+
const S = u.length(), _ = h.length(), x = p.length();
|
|
2561
|
+
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, S < Pt ? _ < Pt || x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : _ < Pt ? x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : x < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
|
|
2562
2562
|
}
|
|
2563
2563
|
}
|
|
2564
2564
|
Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
@@ -2575,73 +2575,73 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
|
2575
2575
|
})();
|
|
2576
2576
|
Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
2577
2577
|
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new kt(), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $(), r = /* @__PURE__ */ new $(), o = /* @__PURE__ */ new $(), a = /* @__PURE__ */ new Nt(), c = /* @__PURE__ */ new Nt(), u = /* @__PURE__ */ new $(), d = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
|
|
2578
|
-
function f(
|
|
2578
|
+
function f(b, T, A, P) {
|
|
2579
2579
|
const I = n;
|
|
2580
|
-
!
|
|
2581
|
-
const M =
|
|
2580
|
+
!b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? I.copy(b.plane.normal) : I.copy(T.plane.normal);
|
|
2581
|
+
const M = b.satBounds, O = b.satAxes;
|
|
2582
2582
|
for (let D = 1; D < 4; D++) {
|
|
2583
2583
|
const H = M[D], j = O[D];
|
|
2584
|
-
if (e.setFromPoints(j, T.points), H.isSeparated(e) || (o.copy(I).cross(j), e.setFromPoints(o,
|
|
2584
|
+
if (e.setFromPoints(j, T.points), H.isSeparated(e) || (o.copy(I).cross(j), e.setFromPoints(o, b.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
|
|
2585
2585
|
}
|
|
2586
2586
|
const C = T.satBounds, N = T.satAxes;
|
|
2587
2587
|
for (let D = 1; D < 4; D++) {
|
|
2588
2588
|
const H = C[D], j = N[D];
|
|
2589
|
-
if (e.setFromPoints(j,
|
|
2589
|
+
if (e.setFromPoints(j, b.points), H.isSeparated(e) || (o.crossVectors(I, j), e.setFromPoints(o, b.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
|
|
2590
2590
|
}
|
|
2591
2591
|
return A && (P || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), A.start.set(0, 0, 0), A.end.set(0, 0, 0)), !0;
|
|
2592
2592
|
}
|
|
2593
|
-
function p(
|
|
2593
|
+
function p(b, T, A, P, I, M, O, C, N, D, H) {
|
|
2594
2594
|
let j = O / (O - C);
|
|
2595
|
-
D.x = P + (I - P) * j, H.start.subVectors(T,
|
|
2595
|
+
D.x = P + (I - P) * j, H.start.subVectors(T, b).multiplyScalar(j).add(b), j = O / (O - N), D.y = P + (M - P) * j, H.end.subVectors(A, b).multiplyScalar(j).add(b);
|
|
2596
2596
|
}
|
|
2597
|
-
function
|
|
2597
|
+
function y(b, T, A, P, I, M, O, C, N, D, H) {
|
|
2598
2598
|
if (I > 0)
|
|
2599
|
-
p(
|
|
2599
|
+
p(b.c, b.a, b.b, P, T, A, N, O, C, D, H);
|
|
2600
2600
|
else if (M > 0)
|
|
2601
|
-
p(
|
|
2601
|
+
p(b.b, b.a, b.c, A, T, P, C, O, N, D, H);
|
|
2602
2602
|
else if (C * N > 0 || O != 0)
|
|
2603
|
-
p(
|
|
2603
|
+
p(b.a, b.b, b.c, T, A, P, O, C, N, D, H);
|
|
2604
2604
|
else if (C != 0)
|
|
2605
|
-
p(
|
|
2605
|
+
p(b.b, b.a, b.c, A, T, P, C, O, N, D, H);
|
|
2606
2606
|
else if (N != 0)
|
|
2607
|
-
p(
|
|
2607
|
+
p(b.c, b.a, b.b, P, T, A, N, O, C, D, H);
|
|
2608
2608
|
else
|
|
2609
2609
|
return !0;
|
|
2610
2610
|
return !1;
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2613
|
-
const I = T.degenerateSegment, M =
|
|
2614
|
-
return
|
|
2612
|
+
function S(b, T, A, P) {
|
|
2613
|
+
const I = T.degenerateSegment, M = b.plane.distanceToPoint(I.start), O = b.plane.distanceToPoint(I.end);
|
|
2614
|
+
return at(M) ? at(O) ? f(b, T, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), b.containsPoint(I.start)) : at(O) ? (A && (A.start.copy(I.end), A.end.copy(I.end)), b.containsPoint(I.end)) : b.plane.intersectLine(I, n) != null ? (A && (A.start.copy(n), A.end.copy(n)), b.containsPoint(n)) : !1;
|
|
2615
2615
|
}
|
|
2616
|
-
function _(
|
|
2616
|
+
function _(b, T, A) {
|
|
2617
2617
|
const P = T.a;
|
|
2618
|
-
return
|
|
2618
|
+
return at(b.plane.distanceToPoint(P)) && b.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
|
|
2619
2619
|
}
|
|
2620
|
-
function b
|
|
2621
|
-
const P =
|
|
2620
|
+
function x(b, T, A) {
|
|
2621
|
+
const P = b.degenerateSegment, I = T.a;
|
|
2622
2622
|
return P.closestPointToPoint(I, !0, n), I.distanceToSquared(n) < zr ? (A && (A.start.copy(I), A.end.copy(I)), !0) : !1;
|
|
2623
2623
|
}
|
|
2624
|
-
function E(
|
|
2625
|
-
if (
|
|
2624
|
+
function E(b, T, A, P) {
|
|
2625
|
+
if (b.isDegenerateIntoSegment)
|
|
2626
2626
|
if (T.isDegenerateIntoSegment) {
|
|
2627
|
-
const I =
|
|
2627
|
+
const I = b.degenerateSegment, M = T.degenerateSegment, O = s, C = r;
|
|
2628
2628
|
I.delta(O), M.delta(C);
|
|
2629
2629
|
const N = n.subVectors(M.start, I.start), D = O.x * C.y - O.y * C.x;
|
|
2630
|
-
if (
|
|
2630
|
+
if (at(D))
|
|
2631
2631
|
return !1;
|
|
2632
2632
|
const H = (N.x * C.y - N.y * C.x) / D, j = -(O.x * N.y - O.y * N.x) / D;
|
|
2633
2633
|
if (H < 0 || H > 1 || j < 0 || j > 1)
|
|
2634
2634
|
return !1;
|
|
2635
2635
|
const q = I.start.z + O.z * H, ie = M.start.z + C.z * j;
|
|
2636
|
-
return
|
|
2637
|
-
} else return T.isDegenerateIntoPoint ? b
|
|
2636
|
+
return at(q - ie) ? (A && (A.start.copy(I.start).addScaledVector(O, H), A.end.copy(I.start).addScaledVector(O, H)), !0) : !1;
|
|
2637
|
+
} else return T.isDegenerateIntoPoint ? x(b, T, A) : S(T, b, A, P);
|
|
2638
2638
|
else {
|
|
2639
|
-
if (
|
|
2640
|
-
return T.isDegenerateIntoPoint ? T.a.distanceToSquared(
|
|
2639
|
+
if (b.isDegenerateIntoPoint)
|
|
2640
|
+
return T.isDegenerateIntoPoint ? T.a.distanceToSquared(b.a) < zr ? (A && (A.start.copy(b.a), A.end.copy(b.a)), !0) : !1 : T.isDegenerateIntoSegment ? x(T, b, A) : _(T, b, A);
|
|
2641
2641
|
if (T.isDegenerateIntoPoint)
|
|
2642
|
-
return _(
|
|
2642
|
+
return _(b, T, A);
|
|
2643
2643
|
if (T.isDegenerateIntoSegment)
|
|
2644
|
-
return
|
|
2644
|
+
return S(b, T, A, P);
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
2647
|
return function(T, A = null, P = !1) {
|
|
@@ -2651,12 +2651,12 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2651
2651
|
return I;
|
|
2652
2652
|
const M = this.plane, O = T.plane;
|
|
2653
2653
|
let C = O.distanceToPoint(this.a), N = O.distanceToPoint(this.b), D = O.distanceToPoint(this.c);
|
|
2654
|
-
|
|
2654
|
+
at(C) && (C = 0), at(N) && (N = 0), at(D) && (D = 0);
|
|
2655
2655
|
const H = C * N, j = C * D;
|
|
2656
2656
|
if (H > 0 && j > 0)
|
|
2657
2657
|
return !1;
|
|
2658
2658
|
let q = M.distanceToPoint(T.a), ie = M.distanceToPoint(T.b), ke = M.distanceToPoint(T.c);
|
|
2659
|
-
|
|
2659
|
+
at(q) && (q = 0), at(ie) && (ie = 0), at(ke) && (ke = 0);
|
|
2660
2660
|
const dt = q * ie, Me = q * ke;
|
|
2661
2661
|
if (dt > 0 && Me > 0)
|
|
2662
2662
|
return !1;
|
|
@@ -2665,10 +2665,10 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2665
2665
|
let We = 0, ve = Math.abs(He.x);
|
|
2666
2666
|
const ge = Math.abs(He.y);
|
|
2667
2667
|
ge > ve && (ve = ge, We = 1), Math.abs(He.z) > ve && (We = 2);
|
|
2668
|
-
const Ze = al[We], Ft = this.a[Ze], me = this.b[Ze], ft = this.c[Ze], pt = T.a[Ze],
|
|
2669
|
-
if (
|
|
2668
|
+
const Ze = al[We], Ft = this.a[Ze], me = this.b[Ze], ft = this.c[Ze], pt = T.a[Ze], Rn = T.b[Ze], rn = T.c[Ze];
|
|
2669
|
+
if (y(this, Ft, me, ft, H, j, C, N, D, d, a))
|
|
2670
2670
|
return f(this, T, A, P);
|
|
2671
|
-
if (
|
|
2671
|
+
if (y(T, pt, Rn, rn, dt, Me, q, ie, ke, h, c))
|
|
2672
2672
|
return f(this, T, A, P);
|
|
2673
2673
|
if (d.y < d.x) {
|
|
2674
2674
|
const It = d.y;
|
|
@@ -2696,19 +2696,19 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
|
2696
2696
|
let d = 1 / 0;
|
|
2697
2697
|
for (let h = 0; h < 3; h++) {
|
|
2698
2698
|
let f;
|
|
2699
|
-
const p = t[h],
|
|
2700
|
-
this.closestPointToPoint(
|
|
2701
|
-
const
|
|
2702
|
-
o.closestPointToPoint(
|
|
2699
|
+
const p = t[h], y = o[p];
|
|
2700
|
+
this.closestPointToPoint(y, i), f = y.distanceToSquared(i), f < d && (d = f, a && a.copy(i), c && c.copy(y));
|
|
2701
|
+
const S = this[p];
|
|
2702
|
+
o.closestPointToPoint(S, i), f = S.distanceToSquared(i), f < d && (d = f, a && a.copy(S), c && c.copy(i));
|
|
2703
2703
|
}
|
|
2704
2704
|
for (let h = 0; h < 3; h++) {
|
|
2705
2705
|
const f = t[h], p = t[(h + 1) % 3];
|
|
2706
2706
|
n.set(this[f], this[p]);
|
|
2707
|
-
for (let
|
|
2708
|
-
const
|
|
2709
|
-
s.set(o[
|
|
2710
|
-
const
|
|
2711
|
-
|
|
2707
|
+
for (let y = 0; y < 3; y++) {
|
|
2708
|
+
const S = t[y], _ = t[(y + 1) % 3];
|
|
2709
|
+
s.set(o[S], o[_]), cr(n, s, i, e);
|
|
2710
|
+
const x = i.distanceToSquared(e);
|
|
2711
|
+
x < d && (d = x, a && a.copy(i), c && c.copy(e));
|
|
2712
2712
|
}
|
|
2713
2713
|
}
|
|
2714
2714
|
return Math.sqrt(d);
|
|
@@ -2769,19 +2769,19 @@ Je.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2769
2769
|
const a = this.satBounds, c = this.satAxes;
|
|
2770
2770
|
e[0] = o.a, e[1] = o.b, e[2] = o.c;
|
|
2771
2771
|
for (let f = 0; f < 3; f++) {
|
|
2772
|
-
const p = a[f],
|
|
2773
|
-
if (t.setFromPoints(
|
|
2772
|
+
const p = a[f], y = c[f];
|
|
2773
|
+
if (t.setFromPoints(y, e), p.isSeparated(t)) return !1;
|
|
2774
2774
|
}
|
|
2775
2775
|
const u = o.satBounds, d = o.satAxes, h = this.points;
|
|
2776
2776
|
for (let f = 0; f < 3; f++) {
|
|
2777
|
-
const p = u[f],
|
|
2778
|
-
if (t.setFromPoints(
|
|
2777
|
+
const p = u[f], y = d[f];
|
|
2778
|
+
if (t.setFromPoints(y, h), p.isSeparated(t)) return !1;
|
|
2779
2779
|
}
|
|
2780
2780
|
for (let f = 0; f < 3; f++) {
|
|
2781
2781
|
const p = c[f];
|
|
2782
|
-
for (let
|
|
2783
|
-
const
|
|
2784
|
-
if (s.crossVectors(p,
|
|
2782
|
+
for (let y = 0; y < 4; y++) {
|
|
2783
|
+
const S = d[y];
|
|
2784
|
+
if (s.crossVectors(p, S), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
2787
|
return !0;
|
|
@@ -2804,42 +2804,42 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
2804
2804
|
if (this.needsUpdate && this.update(), this.intersectsBox(o))
|
|
2805
2805
|
return (c || u) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), u && u.copy(s)), 0;
|
|
2806
2806
|
const d = a * a, h = o.min, f = o.max, p = this.points;
|
|
2807
|
-
let
|
|
2807
|
+
let y = 1 / 0;
|
|
2808
2808
|
for (let _ = 0; _ < 8; _++) {
|
|
2809
|
-
const
|
|
2810
|
-
s.copy(
|
|
2811
|
-
const E =
|
|
2812
|
-
if (E <
|
|
2809
|
+
const x = p[_];
|
|
2810
|
+
s.copy(x).clamp(h, f);
|
|
2811
|
+
const E = x.distanceToSquared(s);
|
|
2812
|
+
if (E < y && (y = E, c && c.copy(x), u && u.copy(s), E < d))
|
|
2813
2813
|
return Math.sqrt(E);
|
|
2814
2814
|
}
|
|
2815
|
-
let
|
|
2815
|
+
let S = 0;
|
|
2816
2816
|
for (let _ = 0; _ < 3; _++)
|
|
2817
|
-
for (let
|
|
2817
|
+
for (let x = 0; x <= 1; x++)
|
|
2818
2818
|
for (let E = 0; E <= 1; E++) {
|
|
2819
|
-
const
|
|
2820
|
-
e[
|
|
2821
|
-
const C = i[_], N = i[
|
|
2822
|
-
j[C] = h[C], j[N] =
|
|
2819
|
+
const b = (_ + 1) % 3, T = (_ + 2) % 3, A = x << b | E << T, P = 1 << _ | x << b | E << T, I = p[A], M = p[P];
|
|
2820
|
+
e[S].set(I, M);
|
|
2821
|
+
const C = i[_], N = i[b], D = i[T], H = t[S], j = H.start, q = H.end;
|
|
2822
|
+
j[C] = h[C], j[N] = x ? h[N] : f[N], j[D] = E ? h[D] : f[N], q[C] = f[C], q[N] = x ? h[N] : f[N], q[D] = E ? h[D] : f[N], S++;
|
|
2823
2823
|
}
|
|
2824
2824
|
for (let _ = 0; _ <= 1; _++)
|
|
2825
|
-
for (let
|
|
2825
|
+
for (let x = 0; x <= 1; x++)
|
|
2826
2826
|
for (let E = 0; E <= 1; E++) {
|
|
2827
|
-
s.x = _ ? f.x : h.x, s.y =
|
|
2828
|
-
const
|
|
2829
|
-
if (
|
|
2830
|
-
return Math.sqrt(
|
|
2827
|
+
s.x = _ ? f.x : h.x, s.y = x ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
|
|
2828
|
+
const b = s.distanceToSquared(n);
|
|
2829
|
+
if (b < y && (y = b, c && c.copy(n), u && u.copy(s), b < d))
|
|
2830
|
+
return Math.sqrt(b);
|
|
2831
2831
|
}
|
|
2832
2832
|
for (let _ = 0; _ < 12; _++) {
|
|
2833
|
-
const
|
|
2833
|
+
const x = e[_];
|
|
2834
2834
|
for (let E = 0; E < 12; E++) {
|
|
2835
|
-
const
|
|
2836
|
-
cr(
|
|
2835
|
+
const b = t[E];
|
|
2836
|
+
cr(x, b, n, s);
|
|
2837
2837
|
const T = n.distanceToSquared(s);
|
|
2838
|
-
if (T <
|
|
2838
|
+
if (T < y && (y = T, c && c.copy(n), u && u.copy(s), T < d))
|
|
2839
2839
|
return Math.sqrt(T);
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
|
-
return Math.sqrt(
|
|
2842
|
+
return Math.sqrt(y);
|
|
2843
2843
|
};
|
|
2844
2844
|
})();
|
|
2845
2845
|
class cl extends or {
|
|
@@ -2847,25 +2847,25 @@ class cl extends or {
|
|
|
2847
2847
|
super(() => new Tt());
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
|
-
const
|
|
2850
|
+
const ht = /* @__PURE__ */ new cl(), On = /* @__PURE__ */ new $(), li = /* @__PURE__ */ new $();
|
|
2851
2851
|
function ll(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
2852
2852
|
const r = n * n, o = s * s;
|
|
2853
2853
|
let a = 1 / 0, c = null;
|
|
2854
2854
|
if (i.shapecast(
|
|
2855
2855
|
{
|
|
2856
|
-
boundsTraverseOrder: (d) => (
|
|
2856
|
+
boundsTraverseOrder: (d) => (On.copy(e).clamp(d.min, d.max), On.distanceToSquared(e)),
|
|
2857
2857
|
intersectsBounds: (d, h, f) => f < a && f < o,
|
|
2858
2858
|
intersectsTriangle: (d, h) => {
|
|
2859
|
-
d.closestPointToPoint(e,
|
|
2860
|
-
const f = e.distanceToSquared(
|
|
2861
|
-
return f < a && (li.copy(
|
|
2859
|
+
d.closestPointToPoint(e, On);
|
|
2860
|
+
const f = e.distanceToSquared(On);
|
|
2861
|
+
return f < a && (li.copy(On), a = f, c = h), f < r;
|
|
2862
2862
|
}
|
|
2863
2863
|
}
|
|
2864
2864
|
), a === 1 / 0) return null;
|
|
2865
2865
|
const u = Math.sqrt(a);
|
|
2866
2866
|
return t.point ? t.point.copy(li) : t.point = li.clone(), t.distance = u, t.faceIndex = c, t;
|
|
2867
2867
|
}
|
|
2868
|
-
const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new $(), $t = /* @__PURE__ */ new $(), Qt = /* @__PURE__ */ new $(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new $(), Ur = /* @__PURE__ */ new $(), Hr = /* @__PURE__ */ new $(),
|
|
2868
|
+
const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new $(), $t = /* @__PURE__ */ new $(), Qt = /* @__PURE__ */ new $(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new $(), Ur = /* @__PURE__ */ new $(), Hr = /* @__PURE__ */ new $(), Dn = /* @__PURE__ */ new $();
|
|
2869
2869
|
function ul(i, e, t, n, s, r, o, a) {
|
|
2870
2870
|
let c;
|
|
2871
2871
|
if (r === wo ? c = i.intersectTriangle(n, t, e, !0, s) : c = i.intersectTriangle(e, t, n, r !== Eo, s), c === null) return null;
|
|
@@ -2877,21 +2877,21 @@ function ul(i, e, t, n, s, r, o, a) {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
function Gr(i, e, t, n, s, r, o, a, c, u, d) {
|
|
2879
2879
|
qt.fromBufferAttribute(e, r), $t.fromBufferAttribute(e, o), Qt.fromBufferAttribute(e, a);
|
|
2880
|
-
const h = ul(i, qt, $t, Qt,
|
|
2880
|
+
const h = ul(i, qt, $t, Qt, Dn, c, u, d);
|
|
2881
2881
|
if (h) {
|
|
2882
2882
|
if (n) {
|
|
2883
2883
|
Es.fromBufferAttribute(n, r), Ts.fromBufferAttribute(n, o), _s.fromBufferAttribute(n, a), h.uv = new pe();
|
|
2884
|
-
const p = En.getInterpolation(
|
|
2884
|
+
const p = En.getInterpolation(Dn, qt, $t, Qt, Es, Ts, _s, h.uv);
|
|
2885
2885
|
ws || (h.uv = p);
|
|
2886
2886
|
}
|
|
2887
2887
|
if (s) {
|
|
2888
2888
|
Es.fromBufferAttribute(s, r), Ts.fromBufferAttribute(s, o), _s.fromBufferAttribute(s, a), h.uv1 = new pe();
|
|
2889
|
-
const p = En.getInterpolation(
|
|
2889
|
+
const p = En.getInterpolation(Dn, qt, $t, Qt, Es, Ts, _s, h.uv1);
|
|
2890
2890
|
ws || (h.uv1 = p), hl && (h.uv2 = h.uv1);
|
|
2891
2891
|
}
|
|
2892
2892
|
if (t) {
|
|
2893
2893
|
Br.fromBufferAttribute(t, r), Ur.fromBufferAttribute(t, o), Hr.fromBufferAttribute(t, a), h.normal = new $();
|
|
2894
|
-
const p = En.getInterpolation(
|
|
2894
|
+
const p = En.getInterpolation(Dn, qt, $t, Qt, Br, Ur, Hr, h.normal);
|
|
2895
2895
|
h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1), ws || (h.normal = p);
|
|
2896
2896
|
}
|
|
2897
2897
|
const f = {
|
|
@@ -2903,7 +2903,7 @@ function Gr(i, e, t, n, s, r, o, a, c, u, d) {
|
|
|
2903
2903
|
};
|
|
2904
2904
|
if (En.getNormal(qt, $t, Qt, f.normal), h.face = f, h.faceIndex = r, ws) {
|
|
2905
2905
|
const p = new $();
|
|
2906
|
-
En.getBarycoord(
|
|
2906
|
+
En.getBarycoord(Dn, qt, $t, Qt, p), h.barycoord = p;
|
|
2907
2907
|
}
|
|
2908
2908
|
}
|
|
2909
2909
|
return h;
|
|
@@ -2916,13 +2916,13 @@ function qs(i, e, t, n, s, r, o) {
|
|
|
2916
2916
|
let c = a + 0, u = a + 1, d = a + 2;
|
|
2917
2917
|
const { index: h, groups: f } = i;
|
|
2918
2918
|
i.index && (c = h.getX(c), u = h.getX(u), d = h.getX(d));
|
|
2919
|
-
const { position: p, normal:
|
|
2919
|
+
const { position: p, normal: y, uv: S, uv1: _ } = i.attributes;
|
|
2920
2920
|
if (Array.isArray(e)) {
|
|
2921
|
-
const
|
|
2922
|
-
for (let E = 0,
|
|
2921
|
+
const x = n * 3;
|
|
2922
|
+
for (let E = 0, b = f.length; E < b; E++) {
|
|
2923
2923
|
const { start: T, count: A, materialIndex: P } = f[E];
|
|
2924
|
-
if (
|
|
2925
|
-
const I = jr(e[P]), M = Gr(t, p,
|
|
2924
|
+
if (x >= T && x < T + A) {
|
|
2925
|
+
const I = jr(e[P]), M = Gr(t, p, y, S, _, c, u, d, I, r, o);
|
|
2926
2926
|
if (M)
|
|
2927
2927
|
if (M.faceIndex = n, M.face.materialIndex = P, s)
|
|
2928
2928
|
s.push(M);
|
|
@@ -2931,7 +2931,7 @@ function qs(i, e, t, n, s, r, o) {
|
|
|
2931
2931
|
}
|
|
2932
2932
|
}
|
|
2933
2933
|
} else {
|
|
2934
|
-
const
|
|
2934
|
+
const x = jr(e), E = Gr(t, p, y, S, _, c, u, d, x, r, o);
|
|
2935
2935
|
if (E)
|
|
2936
2936
|
if (E.faceIndex = n, E.face.materialIndex = 0, s)
|
|
2937
2937
|
s.push(E);
|
|
@@ -2975,36 +2975,36 @@ function ml(i, e = null) {
|
|
|
2975
2975
|
const d = i._roots;
|
|
2976
2976
|
for (let f = 0, p = d.length; f < p; f++)
|
|
2977
2977
|
r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
|
|
2978
|
-
function h(f, p,
|
|
2979
|
-
const
|
|
2980
|
-
if (Ne(
|
|
2981
|
-
const _ = $e(f, o),
|
|
2982
|
-
let E = 1 / 0,
|
|
2983
|
-
for (let M = 3 * _, O = 3 * (_ +
|
|
2978
|
+
function h(f, p, y = !1) {
|
|
2979
|
+
const S = f * 2;
|
|
2980
|
+
if (Ne(S, a)) {
|
|
2981
|
+
const _ = $e(f, o), x = Qe(S, a);
|
|
2982
|
+
let E = 1 / 0, b = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
|
|
2983
|
+
for (let M = 3 * _, O = 3 * (_ + x); M < O; M++) {
|
|
2984
2984
|
let C = n[M];
|
|
2985
2985
|
const N = s.getX(C), D = s.getY(C), H = s.getZ(C);
|
|
2986
|
-
N < E && (E = N), N > A && (A = N), D <
|
|
2986
|
+
N < E && (E = N), N > A && (A = N), D < b && (b = D), D > P && (P = D), H < T && (T = H), H > I && (I = H);
|
|
2987
2987
|
}
|
|
2988
|
-
return c[f + 0] !== E || c[f + 1] !==
|
|
2988
|
+
return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
|
|
2989
2989
|
} else {
|
|
2990
|
-
const _ = ze(f),
|
|
2991
|
-
let E =
|
|
2990
|
+
const _ = ze(f), x = Be(f, o);
|
|
2991
|
+
let E = y, b = !1, T = !1;
|
|
2992
2992
|
if (e) {
|
|
2993
2993
|
if (!E) {
|
|
2994
|
-
const C = _ / De + p / qe, N =
|
|
2995
|
-
|
|
2994
|
+
const C = _ / De + p / qe, N = x / De + p / qe;
|
|
2995
|
+
b = e.has(C), T = e.has(N), E = !b && !T;
|
|
2996
2996
|
}
|
|
2997
2997
|
} else
|
|
2998
|
-
|
|
2999
|
-
const A = E ||
|
|
2998
|
+
b = !0, T = !0;
|
|
2999
|
+
const A = E || b, P = E || T;
|
|
3000
3000
|
let I = !1;
|
|
3001
3001
|
A && (I = h(_, p, E));
|
|
3002
3002
|
let M = !1;
|
|
3003
|
-
P && (M = h(
|
|
3003
|
+
P && (M = h(x, p, E));
|
|
3004
3004
|
const O = I || M;
|
|
3005
3005
|
if (O)
|
|
3006
3006
|
for (let C = 0; C < 3; C++) {
|
|
3007
|
-
const N = _ + C, D =
|
|
3007
|
+
const N = _ + C, D = x + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
|
|
3008
3008
|
c[f + C] = H < q ? H : q, c[f + C + 3] = j > ie ? j : ie;
|
|
3009
3009
|
}
|
|
3010
3010
|
return O;
|
|
@@ -3013,9 +3013,9 @@ function ml(i, e = null) {
|
|
|
3013
3013
|
}
|
|
3014
3014
|
function Kt(i, e, t, n, s) {
|
|
3015
3015
|
let r, o, a, c, u, d;
|
|
3016
|
-
const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z,
|
|
3017
|
-
let
|
|
3018
|
-
return h >= 0 ? (r = (
|
|
3016
|
+
const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, S = t.origin.y, _ = t.origin.z;
|
|
3017
|
+
let x = e[i], E = e[i + 3], b = e[i + 1], T = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
|
|
3018
|
+
return h >= 0 ? (r = (x - y) * h, o = (E - y) * h) : (r = (E - y) * h, o = (x - y) * h), f >= 0 ? (a = (b - S) * f, c = (T - S) * f) : (a = (T - S) * f, c = (b - S) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (A - _) * p, d = (P - _) * p) : (u = (P - _) * p, d = (A - _) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
|
|
3019
3019
|
}
|
|
3020
3020
|
function gl(i, e, t, n, s, r, o, a) {
|
|
3021
3021
|
const { geometry: c, _indirectBuffer: u } = i;
|
|
@@ -3070,13 +3070,13 @@ function Di(i, e, t, n, s, r) {
|
|
|
3070
3070
|
const h = $e(i, c), f = Qe(u, a);
|
|
3071
3071
|
return fl(e, t, n, h, f, s, r);
|
|
3072
3072
|
} else {
|
|
3073
|
-
const h = rr(i, c), f = Tl[h],
|
|
3074
|
-
let
|
|
3075
|
-
|
|
3076
|
-
const E = Kt(
|
|
3073
|
+
const h = rr(i, c), f = Tl[h], y = n.direction[f] >= 0;
|
|
3074
|
+
let S, _;
|
|
3075
|
+
y ? (S = ze(i), _ = Be(i, c)) : (S = Be(i, c), _ = ze(i));
|
|
3076
|
+
const E = Kt(S, o, n, s, r) ? Di(S, e, t, n, s, r) : null;
|
|
3077
3077
|
if (E) {
|
|
3078
3078
|
const A = E.point[f];
|
|
3079
|
-
if (
|
|
3079
|
+
if (y ? A <= o[_ + h] : (
|
|
3080
3080
|
// min bounding data
|
|
3081
3081
|
A >= o[_ + h + 3]
|
|
3082
3082
|
))
|
|
@@ -3086,7 +3086,7 @@ function Di(i, e, t, n, s, r) {
|
|
|
3086
3086
|
return E && T ? E.distance <= T.distance ? E : T : E || T || null;
|
|
3087
3087
|
}
|
|
3088
3088
|
}
|
|
3089
|
-
const Ss = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(),
|
|
3089
|
+
const Ss = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(), Nn = /* @__PURE__ */ new ut(), Vr = /* @__PURE__ */ new Je(), bs = /* @__PURE__ */ new Je();
|
|
3090
3090
|
function Sl(i, e, t, n) {
|
|
3091
3091
|
be.setBuffer(i._roots[e]);
|
|
3092
3092
|
const s = Ni(0, i, t, n);
|
|
@@ -3096,24 +3096,24 @@ function Ni(i, e, t, n, s = null) {
|
|
|
3096
3096
|
const { float32Array: r, uint16Array: o, uint32Array: a } = be;
|
|
3097
3097
|
let c = i * 2;
|
|
3098
3098
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), Vr.set(t.boundingBox.min, t.boundingBox.max, n), s = Vr), Ne(c, o)) {
|
|
3099
|
-
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index,
|
|
3100
|
-
if (
|
|
3101
|
-
return Ae(i, r, bs), bs.matrix.copy(
|
|
3099
|
+
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), _ = Qe(c, o);
|
|
3100
|
+
if (Nn.copy(n).invert(), t.boundsTree)
|
|
3101
|
+
return Ae(i, r, bs), bs.matrix.copy(Nn), bs.needsUpdate = !0, t.boundsTree.shapecast({
|
|
3102
3102
|
intersectsBounds: (E) => bs.intersectsBox(E),
|
|
3103
3103
|
intersectsTriangle: (E) => {
|
|
3104
3104
|
E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
|
|
3105
|
-
for (let
|
|
3106
|
-
if (Ce(fn,
|
|
3105
|
+
for (let b = S * 3, T = (_ + S) * 3; b < T; b += 3)
|
|
3106
|
+
if (Ce(fn, b, h, f), fn.needsUpdate = !0, E.intersectsTriangle(fn))
|
|
3107
3107
|
return !0;
|
|
3108
3108
|
return !1;
|
|
3109
3109
|
}
|
|
3110
3110
|
});
|
|
3111
3111
|
{
|
|
3112
|
-
const
|
|
3113
|
-
for (let E =
|
|
3114
|
-
Ce(dn, E, h, f), dn.a.applyMatrix4(
|
|
3115
|
-
for (let T = 0, A =
|
|
3116
|
-
if (Ce(fn, T, p,
|
|
3112
|
+
const x = Ys(t);
|
|
3113
|
+
for (let E = S * 3, b = (_ + S) * 3; E < b; E += 3) {
|
|
3114
|
+
Ce(dn, E, h, f), dn.a.applyMatrix4(Nn), dn.b.applyMatrix4(Nn), dn.c.applyMatrix4(Nn), dn.needsUpdate = !0;
|
|
3115
|
+
for (let T = 0, A = x * 3; T < A; T += 3)
|
|
3116
|
+
if (Ce(fn, T, p, y), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
|
|
3117
3117
|
return !0;
|
|
3118
3118
|
}
|
|
3119
3119
|
}
|
|
@@ -3122,29 +3122,29 @@ function Ni(i, e, t, n, s = null) {
|
|
|
3122
3122
|
return Ae(d, r, Ss), !!(s.intersectsBox(Ss) && Ni(d, e, t, n, s) || (Ae(h, r, Ss), s.intersectsBox(Ss) && Ni(h, e, t, n, s)));
|
|
3123
3123
|
}
|
|
3124
3124
|
}
|
|
3125
|
-
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(),
|
|
3125
|
+
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new $(), xl = /* @__PURE__ */ new $(), Al = /* @__PURE__ */ new $(), vl = /* @__PURE__ */ new $();
|
|
3126
3126
|
function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3127
3127
|
e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
|
|
3128
|
-
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f =
|
|
3129
|
-
let
|
|
3130
|
-
s && (_ = Al,
|
|
3131
|
-
let E = 1 / 0,
|
|
3132
|
-
return xs.copy(t).invert(),
|
|
3128
|
+
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
|
|
3129
|
+
let y = bl, S = xl, _ = null, x = null;
|
|
3130
|
+
s && (_ = Al, x = vl);
|
|
3131
|
+
let E = 1 / 0, b = null, T = null;
|
|
3132
|
+
return xs.copy(t).invert(), kn.matrix.copy(xs), i.shapecast(
|
|
3133
3133
|
{
|
|
3134
3134
|
boundsTraverseOrder: (A) => hi.distanceToBox(A),
|
|
3135
|
-
intersectsBounds: (A, P, I) => I < E && I < o ? (P && (
|
|
3135
|
+
intersectsBounds: (A, P, I) => I < E && I < o ? (P && (kn.min.copy(A.min), kn.max.copy(A.max), kn.needsUpdate = !0), !0) : !1,
|
|
3136
3136
|
intersectsRange: (A, P) => {
|
|
3137
3137
|
if (e.boundsTree)
|
|
3138
3138
|
return e.boundsTree.shapecast({
|
|
3139
|
-
boundsTraverseOrder: (M) =>
|
|
3139
|
+
boundsTraverseOrder: (M) => kn.distanceToBox(M),
|
|
3140
3140
|
intersectsBounds: (M, O, C) => C < E && C < o,
|
|
3141
3141
|
intersectsRange: (M, O) => {
|
|
3142
3142
|
for (let C = M, N = M + O; C < N; C++) {
|
|
3143
3143
|
Ce(p, 3 * C, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
|
|
3144
3144
|
for (let D = A, H = A + P; D < H; D++) {
|
|
3145
3145
|
Ce(f, 3 * D, u, c), f.needsUpdate = !0;
|
|
3146
|
-
const j = f.distanceToTriangle(p,
|
|
3147
|
-
if (j < E && (
|
|
3146
|
+
const j = f.distanceToTriangle(p, y, _);
|
|
3147
|
+
if (j < E && (S.copy(y), x && x.copy(_), E = j, b = D, T = C), j < r)
|
|
3148
3148
|
return !0;
|
|
3149
3149
|
}
|
|
3150
3150
|
}
|
|
@@ -3156,15 +3156,15 @@ function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3156
3156
|
Ce(p, 3 * M, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
|
|
3157
3157
|
for (let C = A, N = A + P; C < N; C++) {
|
|
3158
3158
|
Ce(f, 3 * C, u, c), f.needsUpdate = !0;
|
|
3159
|
-
const D = f.distanceToTriangle(p,
|
|
3160
|
-
if (D < E && (
|
|
3159
|
+
const D = f.distanceToTriangle(p, y, _);
|
|
3160
|
+
if (D < E && (S.copy(y), x && x.copy(_), E = D, b = C, T = M), D < r)
|
|
3161
3161
|
return !0;
|
|
3162
3162
|
}
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
),
|
|
3167
|
+
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(xs), S.applyMatrix4(xs), s.distance = S.sub(s.point).length(), s.faceIndex = T), n);
|
|
3168
3168
|
}
|
|
3169
3169
|
function Ml(i, e = null) {
|
|
3170
3170
|
e && Array.isArray(e) && (e = new Set(e));
|
|
@@ -3173,40 +3173,40 @@ function Ml(i, e = null) {
|
|
|
3173
3173
|
const d = i._roots;
|
|
3174
3174
|
for (let f = 0, p = d.length; f < p; f++)
|
|
3175
3175
|
r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
|
|
3176
|
-
function h(f, p,
|
|
3177
|
-
const
|
|
3178
|
-
if (Ne(
|
|
3179
|
-
const _ = $e(f, o),
|
|
3180
|
-
let E = 1 / 0,
|
|
3181
|
-
for (let M = _, O = _ +
|
|
3176
|
+
function h(f, p, y = !1) {
|
|
3177
|
+
const S = f * 2;
|
|
3178
|
+
if (Ne(S, a)) {
|
|
3179
|
+
const _ = $e(f, o), x = Qe(S, a);
|
|
3180
|
+
let E = 1 / 0, b = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
|
|
3181
|
+
for (let M = _, O = _ + x; M < O; M++) {
|
|
3182
3182
|
const C = 3 * i.resolveTriangleIndex(M);
|
|
3183
3183
|
for (let N = 0; N < 3; N++) {
|
|
3184
3184
|
let D = C + N;
|
|
3185
3185
|
D = n ? n[D] : D;
|
|
3186
3186
|
const H = s.getX(D), j = s.getY(D), q = s.getZ(D);
|
|
3187
|
-
H < E && (E = H), H > A && (A = H), j <
|
|
3187
|
+
H < E && (E = H), H > A && (A = H), j < b && (b = j), j > P && (P = j), q < T && (T = q), q > I && (I = q);
|
|
3188
3188
|
}
|
|
3189
3189
|
}
|
|
3190
|
-
return c[f + 0] !== E || c[f + 1] !==
|
|
3190
|
+
return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
|
|
3191
3191
|
} else {
|
|
3192
|
-
const _ = ze(f),
|
|
3193
|
-
let E =
|
|
3192
|
+
const _ = ze(f), x = Be(f, o);
|
|
3193
|
+
let E = y, b = !1, T = !1;
|
|
3194
3194
|
if (e) {
|
|
3195
3195
|
if (!E) {
|
|
3196
|
-
const C = _ / De + p / qe, N =
|
|
3197
|
-
|
|
3196
|
+
const C = _ / De + p / qe, N = x / De + p / qe;
|
|
3197
|
+
b = e.has(C), T = e.has(N), E = !b && !T;
|
|
3198
3198
|
}
|
|
3199
3199
|
} else
|
|
3200
|
-
|
|
3201
|
-
const A = E ||
|
|
3200
|
+
b = !0, T = !0;
|
|
3201
|
+
const A = E || b, P = E || T;
|
|
3202
3202
|
let I = !1;
|
|
3203
3203
|
A && (I = h(_, p, E));
|
|
3204
3204
|
let M = !1;
|
|
3205
|
-
P && (M = h(
|
|
3205
|
+
P && (M = h(x, p, E));
|
|
3206
3206
|
const O = I || M;
|
|
3207
3207
|
if (O)
|
|
3208
3208
|
for (let C = 0; C < 3; C++) {
|
|
3209
|
-
const N = _ + C, D =
|
|
3209
|
+
const N = _ + C, D = x + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
|
|
3210
3210
|
c[f + C] = H < q ? H : q, c[f + C + 3] = j > ie ? j : ie;
|
|
3211
3211
|
}
|
|
3212
3212
|
return O;
|
|
@@ -3241,13 +3241,13 @@ function Fi(i, e, t, n, s, r) {
|
|
|
3241
3241
|
const h = $e(i, c), f = Qe(u, a);
|
|
3242
3242
|
return yl(e, t, n, h, f, s, r);
|
|
3243
3243
|
} else {
|
|
3244
|
-
const h = rr(i, c), f = Cl[h],
|
|
3245
|
-
let
|
|
3246
|
-
|
|
3247
|
-
const E = Kt(
|
|
3244
|
+
const h = rr(i, c), f = Cl[h], y = n.direction[f] >= 0;
|
|
3245
|
+
let S, _;
|
|
3246
|
+
y ? (S = ze(i), _ = Be(i, c)) : (S = Be(i, c), _ = ze(i));
|
|
3247
|
+
const E = Kt(S, o, n, s, r) ? Fi(S, e, t, n, s, r) : null;
|
|
3248
3248
|
if (E) {
|
|
3249
3249
|
const A = E.point[f];
|
|
3250
|
-
if (
|
|
3250
|
+
if (y ? A <= o[_ + h] : (
|
|
3251
3251
|
// min bounding data
|
|
3252
3252
|
A >= o[_ + h + 3]
|
|
3253
3253
|
))
|
|
@@ -3257,7 +3257,7 @@ function Fi(i, e, t, n, s, r) {
|
|
|
3257
3257
|
return E && T ? E.distance <= T.distance ? E : T : E || T || null;
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
|
-
const As = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(),
|
|
3260
|
+
const As = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), Fn = /* @__PURE__ */ new ut(), Wr = /* @__PURE__ */ new Je(), vs = /* @__PURE__ */ new Je();
|
|
3261
3261
|
function Ll(i, e, t, n) {
|
|
3262
3262
|
be.setBuffer(i._roots[e]);
|
|
3263
3263
|
const s = zi(0, i, t, n);
|
|
@@ -3267,25 +3267,25 @@ function zi(i, e, t, n, s = null) {
|
|
|
3267
3267
|
const { float32Array: r, uint16Array: o, uint32Array: a } = be;
|
|
3268
3268
|
let c = i * 2;
|
|
3269
3269
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), Wr.set(t.boundingBox.min, t.boundingBox.max, n), s = Wr), Ne(c, o)) {
|
|
3270
|
-
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index,
|
|
3271
|
-
if (
|
|
3272
|
-
return Ae(i, r, vs), vs.matrix.copy(
|
|
3270
|
+
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), _ = Qe(c, o);
|
|
3271
|
+
if (Fn.copy(n).invert(), t.boundsTree)
|
|
3272
|
+
return Ae(i, r, vs), vs.matrix.copy(Fn), vs.needsUpdate = !0, t.boundsTree.shapecast({
|
|
3273
3273
|
intersectsBounds: (E) => vs.intersectsBox(E),
|
|
3274
3274
|
intersectsTriangle: (E) => {
|
|
3275
3275
|
E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
|
|
3276
|
-
for (let
|
|
3277
|
-
if (Ce(mn, 3 * e.resolveTriangleIndex(
|
|
3276
|
+
for (let b = S, T = _ + S; b < T; b++)
|
|
3277
|
+
if (Ce(mn, 3 * e.resolveTriangleIndex(b), h, f), mn.needsUpdate = !0, E.intersectsTriangle(mn))
|
|
3278
3278
|
return !0;
|
|
3279
3279
|
return !1;
|
|
3280
3280
|
}
|
|
3281
3281
|
});
|
|
3282
3282
|
{
|
|
3283
|
-
const
|
|
3284
|
-
for (let E =
|
|
3283
|
+
const x = Ys(t);
|
|
3284
|
+
for (let E = S, b = _ + S; E < b; E++) {
|
|
3285
3285
|
const T = e.resolveTriangleIndex(E);
|
|
3286
|
-
Ce(pn, 3 * T, h, f), pn.a.applyMatrix4(
|
|
3287
|
-
for (let A = 0, P =
|
|
3288
|
-
if (Ce(mn, A, p,
|
|
3286
|
+
Ce(pn, 3 * T, h, f), pn.a.applyMatrix4(Fn), pn.b.applyMatrix4(Fn), pn.c.applyMatrix4(Fn), pn.needsUpdate = !0;
|
|
3287
|
+
for (let A = 0, P = x * 3; A < P; A += 3)
|
|
3288
|
+
if (Ce(mn, A, p, y), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
|
|
3289
3289
|
return !0;
|
|
3290
3290
|
}
|
|
3291
3291
|
}
|
|
@@ -3294,22 +3294,22 @@ function zi(i, e, t, n, s = null) {
|
|
|
3294
3294
|
return Ae(d, r, As), !!(s.intersectsBox(As) && zi(d, e, t, n, s) || (Ae(h, r, As), s.intersectsBox(As) && zi(h, e, t, n, s)));
|
|
3295
3295
|
}
|
|
3296
3296
|
}
|
|
3297
|
-
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(),
|
|
3297
|
+
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), zn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new $(), Dl = /* @__PURE__ */ new $(), Nl = /* @__PURE__ */ new $(), kl = /* @__PURE__ */ new $();
|
|
3298
3298
|
function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3299
3299
|
e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
|
|
3300
|
-
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f =
|
|
3301
|
-
let
|
|
3302
|
-
s && (_ = Nl,
|
|
3303
|
-
let E = 1 / 0,
|
|
3304
|
-
return Rs.copy(t).invert(),
|
|
3300
|
+
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
|
|
3301
|
+
let y = Ol, S = Dl, _ = null, x = null;
|
|
3302
|
+
s && (_ = Nl, x = kl);
|
|
3303
|
+
let E = 1 / 0, b = null, T = null;
|
|
3304
|
+
return Rs.copy(t).invert(), zn.matrix.copy(Rs), i.shapecast(
|
|
3305
3305
|
{
|
|
3306
3306
|
boundsTraverseOrder: (A) => ui.distanceToBox(A),
|
|
3307
|
-
intersectsBounds: (A, P, I) => I < E && I < o ? (P && (
|
|
3307
|
+
intersectsBounds: (A, P, I) => I < E && I < o ? (P && (zn.min.copy(A.min), zn.max.copy(A.max), zn.needsUpdate = !0), !0) : !1,
|
|
3308
3308
|
intersectsRange: (A, P) => {
|
|
3309
3309
|
if (e.boundsTree) {
|
|
3310
3310
|
const I = e.boundsTree;
|
|
3311
3311
|
return I.shapecast({
|
|
3312
|
-
boundsTraverseOrder: (M) =>
|
|
3312
|
+
boundsTraverseOrder: (M) => zn.distanceToBox(M),
|
|
3313
3313
|
intersectsBounds: (M, O, C) => C < E && C < o,
|
|
3314
3314
|
intersectsRange: (M, O) => {
|
|
3315
3315
|
for (let C = M, N = M + O; C < N; C++) {
|
|
@@ -3318,8 +3318,8 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3318
3318
|
for (let H = A, j = A + P; H < j; H++) {
|
|
3319
3319
|
const q = i.resolveTriangleIndex(H);
|
|
3320
3320
|
Ce(f, 3 * q, u, c), f.needsUpdate = !0;
|
|
3321
|
-
const ie = f.distanceToTriangle(p,
|
|
3322
|
-
if (ie < E && (
|
|
3321
|
+
const ie = f.distanceToTriangle(p, y, _);
|
|
3322
|
+
if (ie < E && (S.copy(y), x && x.copy(_), E = ie, b = H, T = C), ie < r)
|
|
3323
3323
|
return !0;
|
|
3324
3324
|
}
|
|
3325
3325
|
}
|
|
@@ -3332,15 +3332,15 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3332
3332
|
for (let C = A, N = A + P; C < N; C++) {
|
|
3333
3333
|
const D = i.resolveTriangleIndex(C);
|
|
3334
3334
|
Ce(f, 3 * D, u, c), f.needsUpdate = !0;
|
|
3335
|
-
const H = f.distanceToTriangle(p,
|
|
3336
|
-
if (H < E && (
|
|
3335
|
+
const H = f.distanceToTriangle(p, y, _);
|
|
3336
|
+
if (H < E && (S.copy(y), x && x.copy(_), E = H, b = C, T = M), H < r)
|
|
3337
3337
|
return !0;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
3341
|
}
|
|
3342
3342
|
}
|
|
3343
|
-
),
|
|
3343
|
+
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(Rs), S.applyMatrix4(Rs), s.distance = S.sub(s.point).length(), s.faceIndex = T), n);
|
|
3344
3344
|
}
|
|
3345
3345
|
function Zr(i, e, t) {
|
|
3346
3346
|
return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
|
|
@@ -3403,7 +3403,7 @@ class Ws extends il {
|
|
|
3403
3403
|
if (a._roots = r, a._indirectBuffer = o || null, n.setIndex) {
|
|
3404
3404
|
const u = t.getIndex();
|
|
3405
3405
|
if (u === null) {
|
|
3406
|
-
const d = new
|
|
3406
|
+
const d = new Vn(e.index, 1, !1);
|
|
3407
3407
|
t.setIndex(d);
|
|
3408
3408
|
} else u.array !== s && (u.array.set(s), u.needsUpdate = !0);
|
|
3409
3409
|
}
|
|
@@ -3411,9 +3411,9 @@ class Ws extends il {
|
|
|
3411
3411
|
function c(u) {
|
|
3412
3412
|
for (let d = 0; d < u.length; d++) {
|
|
3413
3413
|
const h = u[d], f = new Uint32Array(h), p = new Uint16Array(h);
|
|
3414
|
-
for (let
|
|
3415
|
-
const _ = De *
|
|
3416
|
-
Ne(
|
|
3414
|
+
for (let y = 0, S = h.byteLength / qe; y < S; y++) {
|
|
3415
|
+
const _ = De * y, x = 2 * _;
|
|
3416
|
+
Ne(x, p) || (f[_ + 6] = f[_ + 6] / De - y);
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
@@ -3457,11 +3457,11 @@ class Ws extends il {
|
|
|
3457
3457
|
let d = u + 0, h = u + 1, f = u + 2;
|
|
3458
3458
|
a && (d = a[d], h = a[h], f = a[f]);
|
|
3459
3459
|
for (let p = 0; p < 3; p++) {
|
|
3460
|
-
const
|
|
3461
|
-
let
|
|
3462
|
-
|
|
3463
|
-
let E =
|
|
3464
|
-
|
|
3460
|
+
const y = o[di[p]](d), S = o[di[p]](h), _ = o[di[p]](f);
|
|
3461
|
+
let x = y;
|
|
3462
|
+
S < x && (x = S), _ < x && (x = _);
|
|
3463
|
+
let E = y;
|
|
3464
|
+
S > E && (E = S), _ > E && (E = _), t[n + p] = x, t[n + p + 3] = E;
|
|
3465
3465
|
}
|
|
3466
3466
|
return t;
|
|
3467
3467
|
}
|
|
@@ -3477,13 +3477,13 @@ class Ws extends il {
|
|
|
3477
3477
|
let h = 3;
|
|
3478
3478
|
o.isInterleavedBufferAttribute && (h = o.data.stride);
|
|
3479
3479
|
const f = ["getX", "getY", "getZ"], p = n.offset;
|
|
3480
|
-
for (let
|
|
3481
|
-
const
|
|
3482
|
-
let
|
|
3483
|
-
a && (
|
|
3480
|
+
for (let y = e, S = e + t; y < S; y++) {
|
|
3481
|
+
const x = (r ? r[y] : y) * 3, E = (y - p) * 6;
|
|
3482
|
+
let b = x + 0, T = x + 1, A = x + 2;
|
|
3483
|
+
a && (b = a[b], T = a[T], A = a[A]), c || (b = b * h + d, T = T * h + d, A = A * h + d);
|
|
3484
3484
|
for (let P = 0; P < 3; P++) {
|
|
3485
3485
|
let I, M, O;
|
|
3486
|
-
c ? (I = o[f[P]](
|
|
3486
|
+
c ? (I = o[f[P]](b), M = o[f[P]](T), O = o[f[P]](A)) : (I = u[b + P], M = u[T + P], O = u[A + P]);
|
|
3487
3487
|
let C = I;
|
|
3488
3488
|
M < C && (C = M), O < C && (C = O);
|
|
3489
3489
|
let N = I;
|
|
@@ -3612,7 +3612,7 @@ class Ws extends il {
|
|
|
3612
3612
|
* @returns {boolean}
|
|
3613
3613
|
*/
|
|
3614
3614
|
shapecast(e) {
|
|
3615
|
-
const t =
|
|
3615
|
+
const t = ht.getPrimitive(), n = super.shapecast(
|
|
3616
3616
|
{
|
|
3617
3617
|
...e,
|
|
3618
3618
|
intersectsPrimitive: e.intersectsTriangle,
|
|
@@ -3622,7 +3622,7 @@ class Ws extends il {
|
|
|
3622
3622
|
iterate: this.indirect ? wl : pl
|
|
3623
3623
|
}
|
|
3624
3624
|
);
|
|
3625
|
-
return
|
|
3625
|
+
return ht.releasePrimitive(t), n;
|
|
3626
3626
|
}
|
|
3627
3627
|
/**
|
|
3628
3628
|
* A generalized cast function that traverses two BVH structures simultaneously to perform
|
|
@@ -3645,36 +3645,36 @@ class Ws extends il {
|
|
|
3645
3645
|
intersectsRanges: s,
|
|
3646
3646
|
intersectsTriangles: r
|
|
3647
3647
|
} = n;
|
|
3648
|
-
const o =
|
|
3649
|
-
const
|
|
3650
|
-
Ce(o,
|
|
3651
|
-
} : (
|
|
3652
|
-
Ce(o,
|
|
3653
|
-
}, d =
|
|
3654
|
-
const
|
|
3655
|
-
Ce(d,
|
|
3656
|
-
} : (
|
|
3657
|
-
Ce(d,
|
|
3648
|
+
const o = ht.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, u = this.indirect ? (y) => {
|
|
3649
|
+
const S = this.resolveTriangleIndex(y);
|
|
3650
|
+
Ce(o, S * 3, a, c);
|
|
3651
|
+
} : (y) => {
|
|
3652
|
+
Ce(o, y * 3, a, c);
|
|
3653
|
+
}, d = ht.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (y) => {
|
|
3654
|
+
const S = e.resolveTriangleIndex(y);
|
|
3655
|
+
Ce(d, S * 3, h, f);
|
|
3656
|
+
} : (y) => {
|
|
3657
|
+
Ce(d, y * 3, h, f);
|
|
3658
3658
|
};
|
|
3659
3659
|
if (r) {
|
|
3660
3660
|
if (!(e instanceof Ws))
|
|
3661
3661
|
throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
|
|
3662
|
-
const
|
|
3663
|
-
for (let I =
|
|
3662
|
+
const y = (S, _, x, E, b, T, A, P) => {
|
|
3663
|
+
for (let I = x, M = x + E; I < M; I++) {
|
|
3664
3664
|
p(I), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
|
|
3665
|
-
for (let O =
|
|
3666
|
-
if (u(O), o.needsUpdate = !0, r(o, d, O, I,
|
|
3665
|
+
for (let O = S, C = S + _; O < C; O++)
|
|
3666
|
+
if (u(O), o.needsUpdate = !0, r(o, d, O, I, b, T, A, P))
|
|
3667
3667
|
return !0;
|
|
3668
3668
|
}
|
|
3669
3669
|
return !1;
|
|
3670
3670
|
};
|
|
3671
3671
|
if (s) {
|
|
3672
|
-
const
|
|
3673
|
-
s = function(_,
|
|
3674
|
-
return
|
|
3672
|
+
const S = s;
|
|
3673
|
+
s = function(_, x, E, b, T, A, P, I) {
|
|
3674
|
+
return S(_, x, E, b, T, A, P, I) ? !0 : y(_, x, E, b, T, A, P, I);
|
|
3675
3675
|
};
|
|
3676
3676
|
} else
|
|
3677
|
-
s =
|
|
3677
|
+
s = y;
|
|
3678
3678
|
}
|
|
3679
3679
|
return super.bvhcast(e, t, { intersectsRanges: s });
|
|
3680
3680
|
}
|
|
@@ -4470,10 +4470,10 @@ class Vl extends $a {
|
|
|
4470
4470
|
if (this.resourcePath !== "")
|
|
4471
4471
|
o = this.resourcePath;
|
|
4472
4472
|
else if (this.path !== "") {
|
|
4473
|
-
const u =
|
|
4474
|
-
o =
|
|
4473
|
+
const u = Wn.extractUrlBase(e);
|
|
4474
|
+
o = Wn.resolveURL(u, this.path);
|
|
4475
4475
|
} else
|
|
4476
|
-
o =
|
|
4476
|
+
o = Wn.extractUrlBase(e);
|
|
4477
4477
|
this.manager.itemStart(e);
|
|
4478
4478
|
const a = function(u) {
|
|
4479
4479
|
s ? s(u) : console.error(u), r.manager.itemError(e), r.manager.itemEnd(e);
|
|
@@ -4715,7 +4715,7 @@ class Kl {
|
|
|
4715
4715
|
this.name = ce.KHR_MATERIALS_UNLIT;
|
|
4716
4716
|
}
|
|
4717
4717
|
getMaterialType() {
|
|
4718
|
-
return
|
|
4718
|
+
return Gn;
|
|
4719
4719
|
}
|
|
4720
4720
|
extendParams(e, t, n) {
|
|
4721
4721
|
const s = [];
|
|
@@ -4975,33 +4975,33 @@ class ch {
|
|
|
4975
4975
|
return null;
|
|
4976
4976
|
const s = t.meshes[n.mesh];
|
|
4977
4977
|
for (const u of s.primitives)
|
|
4978
|
-
if (u.mode !==
|
|
4978
|
+
if (u.mode !== ct.TRIANGLES && u.mode !== ct.TRIANGLE_STRIP && u.mode !== ct.TRIANGLE_FAN && u.mode !== void 0)
|
|
4979
4979
|
return null;
|
|
4980
4980
|
const o = n.extensions[this.name].attributes, a = [], c = {};
|
|
4981
4981
|
for (const u in o)
|
|
4982
4982
|
a.push(this.parser.getDependency("accessor", o[u]).then((d) => (c[u] = d, c[u])));
|
|
4983
4983
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
|
|
4984
4984
|
const d = u.pop(), h = d.isGroup ? d.children : [d], f = u[0].count, p = [];
|
|
4985
|
-
for (const
|
|
4986
|
-
const
|
|
4985
|
+
for (const y of h) {
|
|
4986
|
+
const S = new ut(), _ = new $(), x = new vn(), E = new $(1, 1, 1), b = new Ao(y.geometry, y.material, f);
|
|
4987
4987
|
for (let T = 0; T < f; T++)
|
|
4988
|
-
c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, T), c.ROTATION &&
|
|
4988
|
+
c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, T), c.ROTATION && x.fromBufferAttribute(c.ROTATION, T), c.SCALE && E.fromBufferAttribute(c.SCALE, T), b.setMatrixAt(T, S.compose(_, x, E));
|
|
4989
4989
|
for (const T in c)
|
|
4990
4990
|
if (T === "_COLOR_0") {
|
|
4991
4991
|
const A = c[T];
|
|
4992
|
-
|
|
4993
|
-
} else T !== "TRANSLATION" && T !== "ROTATION" && T !== "SCALE" &&
|
|
4994
|
-
er.prototype.copy.call(
|
|
4992
|
+
b.instanceColor = new ec(A.array, A.itemSize, A.normalized);
|
|
4993
|
+
} else T !== "TRANSLATION" && T !== "ROTATION" && T !== "SCALE" && y.geometry.setAttribute(T, c[T]);
|
|
4994
|
+
er.prototype.copy.call(b, y), this.parser.assignFinalMaterial(b), p.push(b);
|
|
4995
4995
|
}
|
|
4996
4996
|
return d.isGroup ? (d.clear(), d.add(...p), d) : p[0];
|
|
4997
4997
|
}));
|
|
4998
4998
|
}
|
|
4999
4999
|
}
|
|
5000
|
-
const Go = "glTF",
|
|
5000
|
+
const Go = "glTF", Bn = 12, eo = { JSON: 1313821514, BIN: 5130562 };
|
|
5001
5001
|
class lh {
|
|
5002
5002
|
constructor(e) {
|
|
5003
5003
|
this.name = ce.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
5004
|
-
const t = new DataView(e, 0,
|
|
5004
|
+
const t = new DataView(e, 0, Bn), n = new TextDecoder();
|
|
5005
5005
|
if (this.header = {
|
|
5006
5006
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
5007
5007
|
version: t.getUint32(4, !0),
|
|
@@ -5010,17 +5010,17 @@ class lh {
|
|
|
5010
5010
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
5011
5011
|
if (this.header.version < 2)
|
|
5012
5012
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
5013
|
-
const s = this.header.length -
|
|
5013
|
+
const s = this.header.length - Bn, r = new DataView(e, Bn);
|
|
5014
5014
|
let o = 0;
|
|
5015
5015
|
for (; o < s; ) {
|
|
5016
5016
|
const a = r.getUint32(o, !0);
|
|
5017
5017
|
o += 4;
|
|
5018
5018
|
const c = r.getUint32(o, !0);
|
|
5019
5019
|
if (o += 4, c === eo.JSON) {
|
|
5020
|
-
const u = new Uint8Array(e,
|
|
5020
|
+
const u = new Uint8Array(e, Bn + o, a);
|
|
5021
5021
|
this.content = n.decode(u);
|
|
5022
5022
|
} else if (c === eo.BIN) {
|
|
5023
|
-
const u =
|
|
5023
|
+
const u = Bn + o;
|
|
5024
5024
|
this.body = e.slice(u, u + a);
|
|
5025
5025
|
}
|
|
5026
5026
|
o += a;
|
|
@@ -5051,9 +5051,9 @@ class hh {
|
|
|
5051
5051
|
return t.getDependency("bufferView", r).then(function(d) {
|
|
5052
5052
|
return new Promise(function(h, f) {
|
|
5053
5053
|
s.decodeDracoFile(d, function(p) {
|
|
5054
|
-
for (const
|
|
5055
|
-
const
|
|
5056
|
-
_ !== void 0 && (
|
|
5054
|
+
for (const y in p.attributes) {
|
|
5055
|
+
const S = p.attributes[y], _ = c[y];
|
|
5056
|
+
_ !== void 0 && (S.normalized = _);
|
|
5057
5057
|
}
|
|
5058
5058
|
h(p);
|
|
5059
5059
|
}, a, u, je, f);
|
|
@@ -5085,22 +5085,22 @@ class jo extends _c {
|
|
|
5085
5085
|
return t;
|
|
5086
5086
|
}
|
|
5087
5087
|
interpolate_(e, t, n, s) {
|
|
5088
|
-
const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h,
|
|
5088
|
+
const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h, y = e * u, S = y - u, _ = -2 * p + 3 * f, x = p - f, E = 1 - _, b = x - f + h;
|
|
5089
5089
|
for (let T = 0; T !== a; T++) {
|
|
5090
|
-
const A = o[
|
|
5091
|
-
r[T] = E * A +
|
|
5090
|
+
const A = o[S + T + a], P = o[S + T + c] * d, I = o[y + T + a], M = o[y + T] * d;
|
|
5091
|
+
r[T] = E * A + b * P + _ * I + x * M;
|
|
5092
5092
|
}
|
|
5093
5093
|
return r;
|
|
5094
5094
|
}
|
|
5095
5095
|
}
|
|
5096
|
-
const fh = new
|
|
5096
|
+
const fh = new vn();
|
|
5097
5097
|
class ph extends jo {
|
|
5098
5098
|
interpolate_(e, t, n, s) {
|
|
5099
5099
|
const r = super.interpolate_(e, t, n, s);
|
|
5100
5100
|
return fh.fromArray(r).normalize().toArray(r), r;
|
|
5101
5101
|
}
|
|
5102
5102
|
}
|
|
5103
|
-
const
|
|
5103
|
+
const ct = {
|
|
5104
5104
|
POINTS: 0,
|
|
5105
5105
|
LINES: 1,
|
|
5106
5106
|
LINE_LOOP: 2,
|
|
@@ -5479,7 +5479,7 @@ class Sh {
|
|
|
5479
5479
|
return Promise.resolve(this.extensions[ce.KHR_BINARY_GLTF].body);
|
|
5480
5480
|
const s = this.options;
|
|
5481
5481
|
return new Promise(function(r, o) {
|
|
5482
|
-
n.load(
|
|
5482
|
+
n.load(Wn.resolveURL(t.uri, s.path), r, void 0, function() {
|
|
5483
5483
|
o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
5484
5484
|
});
|
|
5485
5485
|
});
|
|
@@ -5509,26 +5509,26 @@ class Sh {
|
|
|
5509
5509
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
5510
5510
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
5511
5511
|
const o = fi[s.type], a = bn[s.componentType], c = s.normalized === !0, u = new a(s.count * o);
|
|
5512
|
-
return Promise.resolve(new
|
|
5512
|
+
return Promise.resolve(new Vn(u, o, c));
|
|
5513
5513
|
}
|
|
5514
5514
|
const r = [];
|
|
5515
5515
|
return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(o) {
|
|
5516
|
-
const a = o[0], c = fi[s.type], u = bn[s.componentType], d = u.BYTES_PER_ELEMENT, h = d * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0,
|
|
5517
|
-
let
|
|
5516
|
+
const a = o[0], c = fi[s.type], u = bn[s.componentType], d = u.BYTES_PER_ELEMENT, h = d * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, y = s.normalized === !0;
|
|
5517
|
+
let S, _;
|
|
5518
5518
|
if (p && p !== h) {
|
|
5519
|
-
const
|
|
5520
|
-
let
|
|
5521
|
-
|
|
5519
|
+
const x = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
|
|
5520
|
+
let b = t.cache.get(E);
|
|
5521
|
+
b || (S = new u(a, x * p, s.count * p / d), b = new sc(S, p / d), t.cache.add(E, b)), _ = new ic(b, c, f % p / d, y);
|
|
5522
5522
|
} else
|
|
5523
|
-
a === null ?
|
|
5523
|
+
a === null ? S = new u(s.count * c) : S = new u(a, f, s.count * c), _ = new Vn(S, c, y);
|
|
5524
5524
|
if (s.sparse !== void 0) {
|
|
5525
|
-
const
|
|
5526
|
-
a !== null && (_ = new
|
|
5525
|
+
const x = fi.SCALAR, E = bn[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, T = s.sparse.values.byteOffset || 0, A = new E(o[1], b, s.sparse.count * x), P = new u(o[2], T, s.sparse.count * c);
|
|
5526
|
+
a !== null && (_ = new Vn(_.array.slice(), _.itemSize, _.normalized)), _.normalized = !1;
|
|
5527
5527
|
for (let I = 0, M = A.length; I < M; I++) {
|
|
5528
5528
|
const O = A[I];
|
|
5529
5529
|
if (_.setX(O, P[I * c]), c >= 2 && _.setY(O, P[I * c + 1]), c >= 3 && _.setZ(O, P[I * c + 2]), c >= 4 && _.setW(O, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
5530
5530
|
}
|
|
5531
|
-
_.normalized =
|
|
5531
|
+
_.normalized = y;
|
|
5532
5532
|
}
|
|
5533
5533
|
return _;
|
|
5534
5534
|
});
|
|
@@ -5578,11 +5578,11 @@ class Sh {
|
|
|
5578
5578
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
5579
5579
|
const d = Promise.resolve(c).then(function(h) {
|
|
5580
5580
|
return new Promise(function(f, p) {
|
|
5581
|
-
let
|
|
5582
|
-
t.isImageBitmapLoader === !0 && (
|
|
5583
|
-
const _ = new xr(
|
|
5581
|
+
let y = f;
|
|
5582
|
+
t.isImageBitmapLoader === !0 && (y = function(S) {
|
|
5583
|
+
const _ = new xr(S);
|
|
5584
5584
|
_.needsUpdate = !0, f(_);
|
|
5585
|
-
}), t.load(
|
|
5585
|
+
}), t.load(Wn.resolveURL(h, r.path), y, void 0, p);
|
|
5586
5586
|
});
|
|
5587
5587
|
}).then(function(h) {
|
|
5588
5588
|
return u === !0 && a.revokeObjectURL(c), vt(h, o), h.userData.mimeType = o.mimeType || Th(o.uri), h;
|
|
@@ -5677,15 +5677,15 @@ class Sh {
|
|
|
5677
5677
|
}
|
|
5678
5678
|
r.doubleSided === !0 && (a.side = Eo);
|
|
5679
5679
|
const d = r.alphaMode || pi.OPAQUE;
|
|
5680
|
-
if (d === pi.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === pi.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !==
|
|
5680
|
+
if (d === pi.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === pi.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Gn && (u.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new pe(1, 1), r.normalTexture.scale !== void 0)) {
|
|
5681
5681
|
const h = r.normalTexture.scale;
|
|
5682
5682
|
a.normalScale.set(h, h);
|
|
5683
5683
|
}
|
|
5684
|
-
if (r.occlusionTexture !== void 0 && o !==
|
|
5684
|
+
if (r.occlusionTexture !== void 0 && o !== Gn && (u.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Gn) {
|
|
5685
5685
|
const h = r.emissiveFactor;
|
|
5686
5686
|
a.emissive = new tn().setRGB(h[0], h[1], h[2], je);
|
|
5687
5687
|
}
|
|
5688
|
-
return r.emissiveTexture !== void 0 && o !==
|
|
5688
|
+
return r.emissiveTexture !== void 0 && o !== Gn && u.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, qn)), Promise.all(u).then(function() {
|
|
5689
5689
|
const h = new o(a);
|
|
5690
5690
|
return r.name && (h.name = r.name), vt(h, r), t.associations.set(h, { materials: e }), r.extensions && Jt(s, h, r), h;
|
|
5691
5691
|
});
|
|
@@ -5744,25 +5744,25 @@ class Sh {
|
|
|
5744
5744
|
}
|
|
5745
5745
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
5746
5746
|
const u = c.slice(0, c.length - 1), d = c[c.length - 1], h = [];
|
|
5747
|
-
for (let p = 0,
|
|
5748
|
-
const
|
|
5749
|
-
let
|
|
5747
|
+
for (let p = 0, y = d.length; p < y; p++) {
|
|
5748
|
+
const S = d[p], _ = o[p];
|
|
5749
|
+
let x;
|
|
5750
5750
|
const E = u[p];
|
|
5751
|
-
if (_.mode ===
|
|
5752
|
-
|
|
5753
|
-
else if (_.mode ===
|
|
5754
|
-
|
|
5755
|
-
else if (_.mode ===
|
|
5756
|
-
|
|
5757
|
-
else if (_.mode ===
|
|
5758
|
-
|
|
5759
|
-
else if (_.mode ===
|
|
5760
|
-
|
|
5751
|
+
if (_.mode === ct.TRIANGLES || _.mode === ct.TRIANGLE_STRIP || _.mode === ct.TRIANGLE_FAN || _.mode === void 0)
|
|
5752
|
+
x = r.isSkinnedMesh === !0 ? new pc(S, E) : new wt(S, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), _.mode === ct.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : _.mode === ct.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
|
|
5753
|
+
else if (_.mode === ct.LINES)
|
|
5754
|
+
x = new qi(S, E);
|
|
5755
|
+
else if (_.mode === ct.LINE_STRIP)
|
|
5756
|
+
x = new Qi(S, E);
|
|
5757
|
+
else if (_.mode === ct.LINE_LOOP)
|
|
5758
|
+
x = new $i(S, E);
|
|
5759
|
+
else if (_.mode === ct.POINTS)
|
|
5760
|
+
x = new Ji(S, E);
|
|
5761
5761
|
else
|
|
5762
5762
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + _.mode);
|
|
5763
|
-
Object.keys(
|
|
5763
|
+
Object.keys(x.geometry.morphAttributes).length > 0 && wh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), _.extensions && Jt(s, x, _), t.assignFinalMaterial(x), h.push(x);
|
|
5764
5764
|
}
|
|
5765
|
-
for (let p = 0,
|
|
5765
|
+
for (let p = 0, y = h.length; p < y; p++)
|
|
5766
5766
|
t.associations.set(h[p], {
|
|
5767
5767
|
meshes: e,
|
|
5768
5768
|
primitives: p
|
|
@@ -5771,7 +5771,7 @@ class Sh {
|
|
|
5771
5771
|
return r.extensions && Jt(s, h[0], r), h[0];
|
|
5772
5772
|
const f = new ti();
|
|
5773
5773
|
r.extensions && Jt(s, f, r), t.associations.set(f, { meshes: e });
|
|
5774
|
-
for (let p = 0,
|
|
5774
|
+
for (let p = 0, y = h.length; p < y; p++)
|
|
5775
5775
|
f.add(h[p]);
|
|
5776
5776
|
return f;
|
|
5777
5777
|
});
|
|
@@ -5827,8 +5827,8 @@ class Sh {
|
|
|
5827
5827
|
loadAnimation(e) {
|
|
5828
5828
|
const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], u = [], d = [];
|
|
5829
5829
|
for (let h = 0, f = s.channels.length; h < f; h++) {
|
|
5830
|
-
const p = s.channels[h],
|
|
5831
|
-
|
|
5830
|
+
const p = s.channels[h], y = s.samplers[p.sampler], S = p.target, _ = S.node, x = s.parameters !== void 0 ? s.parameters[y.input] : y.input, E = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
|
|
5831
|
+
S.node !== void 0 && (o.push(this.getDependency("node", _)), a.push(this.getDependency("accessor", x)), c.push(this.getDependency("accessor", E)), u.push(y), d.push(S));
|
|
5832
5832
|
}
|
|
5833
5833
|
return Promise.all([
|
|
5834
5834
|
Promise.all(o),
|
|
@@ -5837,17 +5837,17 @@ class Sh {
|
|
|
5837
5837
|
Promise.all(u),
|
|
5838
5838
|
Promise.all(d)
|
|
5839
5839
|
]).then(function(h) {
|
|
5840
|
-
const f = h[0], p = h[1],
|
|
5841
|
-
for (let
|
|
5842
|
-
const A = f[
|
|
5840
|
+
const f = h[0], p = h[1], y = h[2], S = h[3], _ = h[4], x = [];
|
|
5841
|
+
for (let b = 0, T = f.length; b < T; b++) {
|
|
5842
|
+
const A = f[b], P = p[b], I = y[b], M = S[b], O = _[b];
|
|
5843
5843
|
if (A === void 0) continue;
|
|
5844
5844
|
A.updateMatrix && A.updateMatrix();
|
|
5845
5845
|
const C = n._createAnimationTracks(A, P, I, M, O);
|
|
5846
5846
|
if (C)
|
|
5847
5847
|
for (let N = 0; N < C.length; N++)
|
|
5848
|
-
|
|
5848
|
+
x.push(C[N]);
|
|
5849
5849
|
}
|
|
5850
|
-
const E = new wc(r, void 0,
|
|
5850
|
+
const E = new wc(r, void 0, x);
|
|
5851
5851
|
return vt(E, s), E;
|
|
5852
5852
|
});
|
|
5853
5853
|
}
|
|
@@ -5883,11 +5883,11 @@ class Sh {
|
|
|
5883
5883
|
f !== null && d.traverse(function(p) {
|
|
5884
5884
|
p.isSkinnedMesh && p.bind(f, _h);
|
|
5885
5885
|
});
|
|
5886
|
-
for (let p = 0,
|
|
5886
|
+
for (let p = 0, y = h.length; p < y; p++)
|
|
5887
5887
|
d.add(h[p]);
|
|
5888
5888
|
if (d.userData.pivot !== void 0 && h.length > 0) {
|
|
5889
|
-
const p = d.userData.pivot,
|
|
5890
|
-
d.pivot = new $().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2],
|
|
5889
|
+
const p = d.userData.pivot, y = h[0];
|
|
5890
|
+
d.pivot = new $().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2], y.position.set(0, 0, 0), delete d.userData.pivot;
|
|
5891
5891
|
}
|
|
5892
5892
|
return d;
|
|
5893
5893
|
});
|
|
@@ -5988,14 +5988,14 @@ class Sh {
|
|
|
5988
5988
|
break;
|
|
5989
5989
|
}
|
|
5990
5990
|
const h = s.interpolation !== void 0 ? mh[s.interpolation] : Mo, f = this._getArrayFromAccessor(n);
|
|
5991
|
-
for (let p = 0,
|
|
5992
|
-
const
|
|
5991
|
+
for (let p = 0, y = c.length; p < y; p++) {
|
|
5992
|
+
const S = new d(
|
|
5993
5993
|
c[p] + "." + Ut[r.path],
|
|
5994
5994
|
t.array,
|
|
5995
5995
|
f,
|
|
5996
5996
|
h
|
|
5997
5997
|
);
|
|
5998
|
-
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
5998
|
+
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(S), o.push(S);
|
|
5999
5999
|
}
|
|
6000
6000
|
return o;
|
|
6001
6001
|
}
|
|
@@ -6040,11 +6040,11 @@ function bh(i, e, t) {
|
|
|
6040
6040
|
for (let u = 0, d = r.length; u < d; u++) {
|
|
6041
6041
|
const h = r[u];
|
|
6042
6042
|
if (h.POSITION !== void 0) {
|
|
6043
|
-
const f = t.json.accessors[h.POSITION], p = f.min,
|
|
6044
|
-
if (p !== void 0 &&
|
|
6045
|
-
if (c.setX(Math.max(Math.abs(p[0]), Math.abs(
|
|
6046
|
-
const
|
|
6047
|
-
c.multiplyScalar(
|
|
6043
|
+
const f = t.json.accessors[h.POSITION], p = f.min, y = f.max;
|
|
6044
|
+
if (p !== void 0 && y !== void 0) {
|
|
6045
|
+
if (c.setX(Math.max(Math.abs(p[0]), Math.abs(y[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(y[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(y[2]))), f.normalized) {
|
|
6046
|
+
const S = Hi(bn[f.componentType]);
|
|
6047
|
+
c.multiplyScalar(S);
|
|
6048
6048
|
}
|
|
6049
6049
|
a.max(c);
|
|
6050
6050
|
} else
|
|
@@ -6225,7 +6225,7 @@ class Zo extends Io {
|
|
|
6225
6225
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
6226
6226
|
*/
|
|
6227
6227
|
constructor(e, t = null) {
|
|
6228
|
-
super(e, t), this.state = we.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new
|
|
6228
|
+
super(e, t), this.state = we.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new vn(), this._lastTargetPosition = new $(), this._quat = new vn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ch.bind(this), this._onPointerDown = Ih.bind(this), this._onPointerUp = Ph.bind(this), this._onContextMenu = zh.bind(this), this._onMouseWheel = Dh.bind(this), this._onKeyDown = Nh.bind(this), this._onTouchStart = kh.bind(this), this._onTouchMove = Fh.bind(this), this._onMouseDown = Lh.bind(this), this._onMouseMove = Oh.bind(this), this._interceptControlDown = Bh.bind(this), this._interceptControlUp = Uh.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
6229
6229
|
}
|
|
6230
6230
|
/**
|
|
6231
6231
|
* Defines the visual representation of the cursor.
|
|
@@ -6969,7 +6969,9 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
|
|
|
6969
6969
|
const a = new w.Scene(), c = t.parent;
|
|
6970
6970
|
a.add(t);
|
|
6971
6971
|
const u = this.disableColorWrite(t), d = this.createBakeLight(n);
|
|
6972
|
-
a.add(d), a.add(d.target)
|
|
6972
|
+
a.add(d), a.add(d.target), d.target.position.copy(
|
|
6973
|
+
n.target.parent ? n.target.getWorldPosition(new w.Vector3()) : n.target.position
|
|
6974
|
+
);
|
|
6973
6975
|
const h = new w.ShadowMaterial({
|
|
6974
6976
|
transparent: !0,
|
|
6975
6977
|
// Set to 1/passCount once the count is known; 0 keeps the probe pass
|
|
@@ -6982,15 +6984,15 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
|
|
|
6982
6984
|
f.rotation.x = -Math.PI / 2, f.position.set(s.center.x, 0, s.center.z), f.receiveShadow = !0, a.add(f);
|
|
6983
6985
|
const p = this.createBakeCamera(s);
|
|
6984
6986
|
a.add(p);
|
|
6985
|
-
const
|
|
6987
|
+
const y = e.getRenderTarget(), S = e.autoClear, _ = e.getClearColor(new w.Color()), x = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
|
|
6986
6988
|
try {
|
|
6987
6989
|
e.shadowMap.autoUpdate = !0, e.setRenderTarget(r), e.setClearColor(0, 0), e.clear(!0, !1, !1), e.autoClear = !1;
|
|
6988
|
-
const
|
|
6989
|
-
h.opacity = 1 /
|
|
6990
|
-
for (const T of this.sampleLightPositions(n,
|
|
6990
|
+
const b = this.explicitPasses ?? this.measureAffordablePasses(e, a, p, n, d, r);
|
|
6991
|
+
h.opacity = 1 / b;
|
|
6992
|
+
for (const T of this.sampleLightPositions(n, b))
|
|
6991
6993
|
d.position.copy(T), e.render(a, p);
|
|
6992
6994
|
} finally {
|
|
6993
|
-
e.autoClear =
|
|
6995
|
+
e.autoClear = S, e.setClearColor(_, x), e.setRenderTarget(y), e.shadowMap.autoUpdate = E, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
|
|
6994
6996
|
}
|
|
6995
6997
|
}
|
|
6996
6998
|
/**
|
|
@@ -7062,27 +7064,27 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
|
|
|
7062
7064
|
sampleLightPositions(e, t) {
|
|
7063
7065
|
const n = e.position.clone(), s = e.target.parent ? e.target.getWorldPosition(new w.Vector3()) : e.target.position.clone(), r = s.clone().sub(n), o = r.length(), a = r.normalize(), c = new w.Vector3().crossVectors(a, new w.Vector3(0, 1, 0));
|
|
7064
7066
|
c.lengthSq() < 1e-6 && c.set(1, 0, 0), c.normalize();
|
|
7065
|
-
const u = new w.Vector3().crossVectors(a, c), d = Math.round(t * xe.AMBIENT_RATIO), h = t - d, f = w.MathUtils.degToRad(xe.LIGHT_APERTURE_DEGREES), p = Math.tan(f / 2) * o,
|
|
7066
|
-
for (let
|
|
7067
|
-
const E = p * Math.sqrt((
|
|
7068
|
-
|
|
7069
|
-
n.clone().addScaledVector(c, E * Math.cos(
|
|
7067
|
+
const u = new w.Vector3().crossVectors(a, c), d = Math.round(t * xe.AMBIENT_RATIO), h = t - d, f = w.MathUtils.degToRad(xe.LIGHT_APERTURE_DEGREES), p = Math.tan(f / 2) * o, y = [];
|
|
7068
|
+
for (let x = 0; x < h; x++) {
|
|
7069
|
+
const E = p * Math.sqrt((x + 0.5) / h), b = x * ao;
|
|
7070
|
+
y.push(
|
|
7071
|
+
n.clone().addScaledVector(c, E * Math.cos(b)).addScaledVector(u, E * Math.sin(b))
|
|
7070
7072
|
);
|
|
7071
7073
|
}
|
|
7072
|
-
const
|
|
7074
|
+
const S = Math.sin(
|
|
7073
7075
|
w.MathUtils.degToRad(xe.AMBIENT_MIN_ELEVATION_DEGREES)
|
|
7074
7076
|
), _ = 0.98;
|
|
7075
|
-
for (let
|
|
7076
|
-
const E = Math.sqrt((
|
|
7077
|
-
|
|
7077
|
+
for (let x = 0; x < d; x++) {
|
|
7078
|
+
const E = Math.sqrt((x + 0.5) / d), b = S + (_ - S) * E, T = Math.sqrt(1 - b * b), A = x * ao;
|
|
7079
|
+
y.push(
|
|
7078
7080
|
new w.Vector3(
|
|
7079
7081
|
T * Math.cos(A),
|
|
7080
|
-
|
|
7082
|
+
b,
|
|
7081
7083
|
T * Math.sin(A)
|
|
7082
7084
|
).multiplyScalar(o).add(s)
|
|
7083
7085
|
);
|
|
7084
7086
|
}
|
|
7085
|
-
return
|
|
7087
|
+
return y;
|
|
7086
7088
|
}
|
|
7087
7089
|
installBakedMesh(e, t, n, s) {
|
|
7088
7090
|
this.evictBakedMesh(e);
|
|
@@ -7126,7 +7128,7 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
|
|
|
7126
7128
|
};
|
|
7127
7129
|
xe.AMBIENT_RATIO = 0.45, xe.LIGHT_APERTURE_DEGREES = 9, xe.AMBIENT_MIN_ELEVATION_DEGREES = 55, xe.ACCUMULATION_TEXTURE_SIZE = 1024, xe.BAKE_SHADOW_MAP_SIZE = 1024, xe.SHADOW_STRENGTH = 0.85, xe.BAKE_BUDGET_MS = 100, xe.MIN_PASSES = 24, xe.MAX_PASSES = 96;
|
|
7128
7130
|
let Vi = xe;
|
|
7129
|
-
const
|
|
7131
|
+
const Yn = class Yn {
|
|
7130
7132
|
// 10% gap between tiles
|
|
7131
7133
|
/**
|
|
7132
7134
|
* Get tile height based on tile size
|
|
@@ -7179,8 +7181,8 @@ const Xn = class Xn {
|
|
|
7179
7181
|
return -this.getBevelSize(e);
|
|
7180
7182
|
}
|
|
7181
7183
|
};
|
|
7182
|
-
|
|
7183
|
-
let sn =
|
|
7184
|
+
Yn.HEIGHT_RATIO = 0.075, Yn.BEVEL_RATIO = 0.04, Yn.GAP_FACTOR = 1.05;
|
|
7185
|
+
let sn = Yn;
|
|
7184
7186
|
var Ot = /* @__PURE__ */ ((i) => (i.SQUARE_WIRE = "square_wire", i.HEXAGONAL_WIRE = "hexagonal_wire", i.HEXAGONAL_GLASS = "hexagonal_glass", i.STONE_TILES = "stone_tiles", i.CUSTOM = "custom", i))(Ot || {});
|
|
7185
7187
|
class Vh {
|
|
7186
7188
|
constructor() {
|
|
@@ -7210,13 +7212,13 @@ class Wh {
|
|
|
7210
7212
|
}), c = s * Math.sqrt(3), u = s * 2;
|
|
7211
7213
|
for (let h = -n; h <= n; h++) {
|
|
7212
7214
|
const f = Math.max(-n, -h - n), p = Math.min(n, -h + n);
|
|
7213
|
-
for (let
|
|
7214
|
-
const
|
|
7215
|
+
for (let y = f; y <= p; y++) {
|
|
7216
|
+
const S = c * (h + y / 2), _ = u * 0.75 * y, x = [], E = Math.PI * 2 / 6;
|
|
7215
7217
|
for (let A = 0; A <= 6; A++) {
|
|
7216
|
-
const P = A * E + Math.PI / 6, I =
|
|
7217
|
-
|
|
7218
|
+
const P = A * E + Math.PI / 6, I = S + s * Math.cos(P), M = _ + s * Math.sin(P);
|
|
7219
|
+
x.push(new w.Vector3(I, 0, M));
|
|
7218
7220
|
}
|
|
7219
|
-
const
|
|
7221
|
+
const b = new w.BufferGeometry().setFromPoints(x), T = new w.Line(b, a);
|
|
7220
7222
|
t.add(T);
|
|
7221
7223
|
}
|
|
7222
7224
|
}
|
|
@@ -7289,8 +7291,8 @@ function Kh(i, e) {
|
|
|
7289
7291
|
e.forEach((h, f) => {
|
|
7290
7292
|
const p = f * n.length;
|
|
7291
7293
|
o.set(n, p);
|
|
7292
|
-
for (let
|
|
7293
|
-
o[
|
|
7294
|
+
for (let y = p; y < p + n.length; y += 3)
|
|
7295
|
+
o[y] += h.x, o[y + 1] += h.y, o[y + 2] += h.z;
|
|
7294
7296
|
a.set(s, f * s.length), c && r && c.set(r, f * r.length);
|
|
7295
7297
|
});
|
|
7296
7298
|
const u = new w.BufferGeometry();
|
|
@@ -7301,12 +7303,12 @@ class Xh {
|
|
|
7301
7303
|
this.name = "Hexagonal Glass Grid";
|
|
7302
7304
|
}
|
|
7303
7305
|
createGrid(e) {
|
|
7304
|
-
var
|
|
7305
|
-
const t = new w.Group(), n = ((
|
|
7306
|
+
var y, S, _, x, E, b, T;
|
|
7307
|
+
const t = new w.Group(), n = ((y = e.styleOptions) == null ? void 0 : y.hexRadius) ?? Math.floor(e.divisions / 2), s = ((S = e.styleOptions) == null ? void 0 : S.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height, u = new Zh(new w.Vector3(0, 0, 0), s, r, {
|
|
7306
7308
|
metalness: (_ = e.styleOptions) == null ? void 0 : _.metalness,
|
|
7307
|
-
roughness: (
|
|
7309
|
+
roughness: (x = e.styleOptions) == null ? void 0 : x.roughness,
|
|
7308
7310
|
transmission: (E = e.styleOptions) == null ? void 0 : E.transmission,
|
|
7309
|
-
thickness: (
|
|
7311
|
+
thickness: (b = e.styleOptions) == null ? void 0 : b.thickness,
|
|
7310
7312
|
ior: (T = e.styleOptions) == null ? void 0 : T.ior
|
|
7311
7313
|
}), d = u.createGeometry(), h = sn.getYPosition(s), f = [];
|
|
7312
7314
|
for (let A = -n; A <= n; A++) {
|
|
@@ -7335,11 +7337,11 @@ class Yh {
|
|
|
7335
7337
|
this.name = "Stone Tile Grid", this.textureLoader = new w.TextureLoader();
|
|
7336
7338
|
}
|
|
7337
7339
|
createGrid(e) {
|
|
7338
|
-
var p,
|
|
7339
|
-
const t = new w.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, u = ((
|
|
7340
|
-
for (let
|
|
7340
|
+
var p, y, S, _;
|
|
7341
|
+
const t = new w.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, u = ((y = e.styleOptions) == null ? void 0 : y.bevelSize) || c * 0.2, d = ((S = e.styleOptions) == null ? void 0 : S.randomHeight) || !1, h = ((_ = e.styleOptions) == null ? void 0 : _.randomRotation) || !1, f = this.createStoneMaterial(e);
|
|
7342
|
+
for (let x = 0; x < s; x++)
|
|
7341
7343
|
for (let E = 0; E < s; E++) {
|
|
7342
|
-
const
|
|
7344
|
+
const b = (x - s / 2) * r + r / 2, T = (E - s / 2) * r + r / 2, A = d ? c * (0.8 + Math.random() * 0.4) : c, P = new w.Shape(), I = a / 2;
|
|
7343
7345
|
P.moveTo(-I, -I), P.lineTo(I, -I), P.lineTo(I, I), P.lineTo(-I, I), P.closePath();
|
|
7344
7346
|
const M = {
|
|
7345
7347
|
depth: A,
|
|
@@ -7350,7 +7352,7 @@ class Yh {
|
|
|
7350
7352
|
}, O = new w.ExtrudeGeometry(P, M);
|
|
7351
7353
|
O.rotateX(-Math.PI / 2);
|
|
7352
7354
|
const C = new w.Mesh(O, f);
|
|
7353
|
-
C.position.set(
|
|
7355
|
+
C.position.set(b, -A / 2, T), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
|
|
7354
7356
|
}
|
|
7355
7357
|
return t;
|
|
7356
7358
|
}
|
|
@@ -7505,37 +7507,39 @@ class qh {
|
|
|
7505
7507
|
if (!(a != null && a.enabled))
|
|
7506
7508
|
return k.ok(void 0);
|
|
7507
7509
|
const c = [];
|
|
7508
|
-
r.traverse((
|
|
7509
|
-
var
|
|
7510
|
-
((
|
|
7511
|
-
}), c.forEach((
|
|
7512
|
-
$s(
|
|
7510
|
+
r.traverse((O) => {
|
|
7511
|
+
var C, N, D;
|
|
7512
|
+
((C = O.userData) != null && C.isGrid || (N = O.userData) != null && N.isHexGrid || (D = O.userData) != null && D.isDefaultGrid) && c.push(O);
|
|
7513
|
+
}), c.forEach((O) => {
|
|
7514
|
+
$s(O), r.remove(O);
|
|
7513
7515
|
});
|
|
7514
7516
|
let u;
|
|
7515
7517
|
t instanceof Oe || "getThreeObject" in t && typeof t.getThreeObject == "function" ? u = t.getThreeObject() : u = t;
|
|
7516
7518
|
const d = new w.Box3().setFromObject(u), h = d.getSize(new w.Vector3());
|
|
7517
7519
|
if (d.isEmpty() || !Number.isFinite(h.x) || !Number.isFinite(h.z))
|
|
7518
7520
|
return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), k.ok(void 0);
|
|
7519
|
-
const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1,
|
|
7520
|
-
let
|
|
7521
|
+
const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, S = sn.getGridSpacing(p).width, _ = Math.max(h.x, h.z) * n + h.y;
|
|
7522
|
+
let x = _ <= S ? 0 : Math.ceil((_ / S - 1) / 2);
|
|
7521
7523
|
const E = 60;
|
|
7522
|
-
|
|
7523
|
-
`Dynamic grid would need ${
|
|
7524
|
-
),
|
|
7525
|
-
const
|
|
7524
|
+
x > E && (console.warn(
|
|
7525
|
+
`Dynamic grid would need ${x} rings to cover the object; capping at ${E}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
|
|
7526
|
+
), x = E), _ < S * 0.8 ? x = 0 : x < 3 && _ > S * 2 && (x = 3);
|
|
7527
|
+
const b = a.type || Ot.HEXAGONAL_GLASS, A = {
|
|
7526
7528
|
size: Math.max(h.x, h.z) * n,
|
|
7527
|
-
divisions:
|
|
7529
|
+
divisions: x * 2 + 1,
|
|
7528
7530
|
color: a.color,
|
|
7529
7531
|
opacity: a.opacity,
|
|
7530
7532
|
styleOptions: {
|
|
7531
|
-
hexRadius:
|
|
7533
|
+
hexRadius: x,
|
|
7532
7534
|
tileSize: p,
|
|
7533
7535
|
...a.styleOptions
|
|
7534
7536
|
}
|
|
7535
|
-
}, P = Zs.createGrid(
|
|
7537
|
+
}, P = Zs.createGrid(b, A);
|
|
7536
7538
|
P.userData.isGrid = !0, P.userData.isHexGrid = !0;
|
|
7537
7539
|
const I = P.getObjectByName(xn);
|
|
7538
|
-
|
|
7540
|
+
I && (I.position.y = w.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3));
|
|
7541
|
+
const M = d.getCenter(new w.Vector3());
|
|
7542
|
+
return P.position.set(M.x, 0, M.z), r.add(P), k.ok(void 0);
|
|
7539
7543
|
} catch (r) {
|
|
7540
7544
|
return k.err(
|
|
7541
7545
|
new Z(
|
|
@@ -7586,17 +7590,17 @@ class qh {
|
|
|
7586
7590
|
const d = new w.Box3().setFromObject(n);
|
|
7587
7591
|
if (d.isEmpty() || !Number.isFinite(d.min.x) || !Number.isFinite(d.max.x))
|
|
7588
7592
|
return k.ok(void 0);
|
|
7589
|
-
const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f,
|
|
7593
|
+
const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, y = d.min.y - f, S = new w.Raycaster(), _ = new w.Vector3(0, -1, 0), x = new w.Vector3(0, 1, 0);
|
|
7590
7594
|
let E = 1 / 0;
|
|
7591
|
-
const
|
|
7592
|
-
|
|
7593
|
-
for (const M of
|
|
7595
|
+
const b = (T, A, P, I) => {
|
|
7596
|
+
S.set(new w.Vector3(T, A, P), I);
|
|
7597
|
+
for (const M of S.intersectObjects(a, !1))
|
|
7594
7598
|
M.point.y < E && (E = M.point.y);
|
|
7595
7599
|
};
|
|
7596
7600
|
for (let T = 0; T <= h; T++)
|
|
7597
7601
|
for (let A = 0; A <= h; A++) {
|
|
7598
7602
|
const P = d.min.x + (d.max.x - d.min.x) * (T / h), I = d.min.z + (d.max.z - d.min.z) * (A / h);
|
|
7599
|
-
|
|
7603
|
+
b(P, p, I, _), b(P, y, I, x);
|
|
7600
7604
|
}
|
|
7601
7605
|
if (Number.isFinite(E)) {
|
|
7602
7606
|
const T = E - c;
|
|
@@ -7627,11 +7631,15 @@ class qh {
|
|
|
7627
7631
|
const s = new w.Box3().setFromObject(n);
|
|
7628
7632
|
if (s.isEmpty() || !Number.isFinite(s.min.x) || !Number.isFinite(s.max.x))
|
|
7629
7633
|
return k.ok(void 0);
|
|
7630
|
-
const r = s.getSize(new w.Vector3()), o = e.getThreeScene(),
|
|
7631
|
-
if (!
|
|
7634
|
+
const r = s.getSize(new w.Vector3()), o = s.getCenter(new w.Vector3()), a = e.getThreeScene(), c = co(a);
|
|
7635
|
+
if (!c || !c.castShadow)
|
|
7632
7636
|
return k.ok(void 0);
|
|
7633
|
-
|
|
7634
|
-
|
|
7637
|
+
if (c.parent === a && c.target.parent === a) {
|
|
7638
|
+
const y = c.position.clone().sub(c.target.position);
|
|
7639
|
+
c.target.position.copy(o), c.position.copy(o).add(y);
|
|
7640
|
+
}
|
|
7641
|
+
const f = Math.max(r.x, r.y, r.z, 0.1) * 2, p = c.shadow.camera;
|
|
7642
|
+
return p.left = -f, p.right = f, p.top = f, p.bottom = -f, p.updateProjectionMatrix(), k.ok(void 0);
|
|
7635
7643
|
} catch (n) {
|
|
7636
7644
|
return k.err(
|
|
7637
7645
|
new Z(
|
|
@@ -7819,8 +7827,8 @@ class qh {
|
|
|
7819
7827
|
"fov" in r ? h = r.fov * (Math.PI / 180) : h = 50 * (Math.PI / 180);
|
|
7820
7828
|
let f = Math.abs(d / 2 / Math.tan(h / 2));
|
|
7821
7829
|
f *= 2;
|
|
7822
|
-
const p = -Math.PI / 4,
|
|
7823
|
-
return r.position.set(
|
|
7830
|
+
const p = -Math.PI / 4, y = Math.PI / 8, S = c.x + f * Math.sin(p) * Math.cos(y), _ = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
|
|
7831
|
+
return r.position.set(S, _, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
|
|
7824
7832
|
} catch (s) {
|
|
7825
7833
|
return k.err(
|
|
7826
7834
|
new Z(
|
|
@@ -7837,7 +7845,7 @@ class $h {
|
|
|
7837
7845
|
this.events = new nr(), this.disposed = !1;
|
|
7838
7846
|
}
|
|
7839
7847
|
async initialize(e) {
|
|
7840
|
-
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-
|
|
7848
|
+
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-DTWmDzs1.js");
|
|
7841
7849
|
if (this.disposed)
|
|
7842
7850
|
return k.ok(void 0);
|
|
7843
7851
|
const n = new t();
|
|
@@ -7885,7 +7893,7 @@ fflate - fast JavaScript compression/decompression
|
|
|
7885
7893
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
7886
7894
|
version 0.8.2
|
|
7887
7895
|
*/
|
|
7888
|
-
var
|
|
7896
|
+
var lt = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new lt([
|
|
7889
7897
|
0,
|
|
7890
7898
|
0,
|
|
7891
7899
|
0,
|
|
@@ -7920,7 +7928,7 @@ var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
|
|
|
7920
7928
|
0,
|
|
7921
7929
|
/* impossible */
|
|
7922
7930
|
0
|
|
7923
|
-
]), $o = new
|
|
7931
|
+
]), $o = new lt([
|
|
7924
7932
|
0,
|
|
7925
7933
|
0,
|
|
7926
7934
|
0,
|
|
@@ -7954,7 +7962,7 @@ var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
|
|
|
7954
7962
|
/* unused */
|
|
7955
7963
|
0,
|
|
7956
7964
|
0
|
|
7957
|
-
]), Jh = new
|
|
7965
|
+
]), Jh = new lt([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
|
|
7958
7966
|
for (var t = new Sn(31), n = 0; n < 31; ++n)
|
|
7959
7967
|
t[n] = e += 1 << i[n - 1];
|
|
7960
7968
|
for (var s = new Qh(t[30]), n = 1; n < 30; ++n)
|
|
@@ -7968,7 +7976,7 @@ for (var Se = 0; Se < 32768; ++Se) {
|
|
|
7968
7976
|
var Ht = (Se & 43690) >> 1 | (Se & 21845) << 1;
|
|
7969
7977
|
Ht = (Ht & 52428) >> 2 | (Ht & 13107) << 2, Ht = (Ht & 61680) >> 4 | (Ht & 3855) << 4, Wi[Se] = ((Ht & 65280) >> 8 | (Ht & 255) << 8) >> 1;
|
|
7970
7978
|
}
|
|
7971
|
-
var
|
|
7979
|
+
var Xn = (function(i, e, t) {
|
|
7972
7980
|
for (var n = i.length, s = 0, r = new Sn(e); s < n; ++s)
|
|
7973
7981
|
i[s] && ++r[i[s] - 1];
|
|
7974
7982
|
var o = new Sn(e);
|
|
@@ -7986,7 +7994,7 @@ var Kn = (function(i, e, t) {
|
|
|
7986
7994
|
for (a = new Sn(n), s = 0; s < n; ++s)
|
|
7987
7995
|
i[s] && (a[s] = Wi[o[i[s] - 1]++] >> 15 - i[s]);
|
|
7988
7996
|
return a;
|
|
7989
|
-
}), ts = new
|
|
7997
|
+
}), ts = new lt(288);
|
|
7990
7998
|
for (var Se = 0; Se < 144; ++Se)
|
|
7991
7999
|
ts[Se] = 8;
|
|
7992
8000
|
for (var Se = 144; Se < 256; ++Se)
|
|
@@ -7995,10 +8003,10 @@ for (var Se = 256; Se < 280; ++Se)
|
|
|
7995
8003
|
ts[Se] = 7;
|
|
7996
8004
|
for (var Se = 280; Se < 288; ++Se)
|
|
7997
8005
|
ts[Se] = 8;
|
|
7998
|
-
var ta = new
|
|
8006
|
+
var ta = new lt(32);
|
|
7999
8007
|
for (var Se = 0; Se < 32; ++Se)
|
|
8000
8008
|
ta[Se] = 5;
|
|
8001
|
-
var su = /* @__PURE__ */
|
|
8009
|
+
var su = /* @__PURE__ */ Xn(ts, 9, 1), iu = /* @__PURE__ */ Xn(ta, 5, 1), Ei = function(i) {
|
|
8002
8010
|
for (var e = i[0], t = 1; t < i.length; ++t)
|
|
8003
8011
|
i[t] > e && (e = i[t]);
|
|
8004
8012
|
return e;
|
|
@@ -8011,7 +8019,7 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
|
|
|
8011
8019
|
}, ru = function(i) {
|
|
8012
8020
|
return (i + 7) / 8 | 0;
|
|
8013
8021
|
}, ou = function(i, e, t) {
|
|
8014
|
-
return (t == null || t > i.length) && (t = i.length), new
|
|
8022
|
+
return (t == null || t > i.length) && (t = i.length), new lt(i.subarray(e, t));
|
|
8015
8023
|
}, au = [
|
|
8016
8024
|
"unexpected EOF",
|
|
8017
8025
|
"invalid block type",
|
|
@@ -8036,63 +8044,63 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
|
|
|
8036
8044
|
}, cu = function(i, e, t, n) {
|
|
8037
8045
|
var s = i.length, r = 0;
|
|
8038
8046
|
if (!s || e.f && !e.l)
|
|
8039
|
-
return t || new
|
|
8047
|
+
return t || new lt(0);
|
|
8040
8048
|
var o = !t, a = o || e.i != 2, c = e.i;
|
|
8041
|
-
o && (t = new
|
|
8049
|
+
o && (t = new lt(s * 3));
|
|
8042
8050
|
var u = function(rn) {
|
|
8043
8051
|
var It = t.length;
|
|
8044
8052
|
if (rn > It) {
|
|
8045
|
-
var ns = new
|
|
8053
|
+
var ns = new lt(Math.max(It * 2, rn));
|
|
8046
8054
|
ns.set(t), t = ns;
|
|
8047
8055
|
}
|
|
8048
|
-
}, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l,
|
|
8056
|
+
}, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, S = e.m, _ = e.n, x = s * 8;
|
|
8049
8057
|
do {
|
|
8050
8058
|
if (!p) {
|
|
8051
8059
|
d = mt(i, h, 1);
|
|
8052
8060
|
var E = mt(i, h + 1, 3);
|
|
8053
8061
|
if (h += 3, E)
|
|
8054
8062
|
if (E == 1)
|
|
8055
|
-
p = su,
|
|
8063
|
+
p = su, y = iu, S = 9, _ = 5;
|
|
8056
8064
|
else if (E == 2) {
|
|
8057
8065
|
var P = mt(i, h, 31) + 257, I = mt(i, h + 10, 15) + 4, M = P + mt(i, h + 5, 31) + 1;
|
|
8058
8066
|
h += 14;
|
|
8059
|
-
for (var O = new
|
|
8067
|
+
for (var O = new lt(M), C = new lt(19), N = 0; N < I; ++N)
|
|
8060
8068
|
C[Jh[N]] = mt(i, h + N * 3, 7);
|
|
8061
8069
|
h += I * 3;
|
|
8062
|
-
for (var D = Ei(C), H = (1 << D) - 1, j =
|
|
8070
|
+
for (var D = Ei(C), H = (1 << D) - 1, j = Xn(C, D, 1), N = 0; N < M; ) {
|
|
8063
8071
|
var q = j[mt(i, h, H)];
|
|
8064
8072
|
h += q & 15;
|
|
8065
|
-
var
|
|
8066
|
-
if (
|
|
8067
|
-
O[N++] =
|
|
8073
|
+
var b = q >> 4;
|
|
8074
|
+
if (b < 16)
|
|
8075
|
+
O[N++] = b;
|
|
8068
8076
|
else {
|
|
8069
8077
|
var ie = 0, ke = 0;
|
|
8070
|
-
for (
|
|
8078
|
+
for (b == 16 ? (ke = 3 + mt(i, h, 3), h += 2, ie = O[N - 1]) : b == 17 ? (ke = 3 + mt(i, h, 7), h += 3) : b == 18 && (ke = 11 + mt(i, h, 127), h += 7); ke--; )
|
|
8071
8079
|
O[N++] = ie;
|
|
8072
8080
|
}
|
|
8073
8081
|
}
|
|
8074
8082
|
var dt = O.subarray(0, P), Me = O.subarray(P);
|
|
8075
|
-
|
|
8083
|
+
S = Ei(dt), _ = Ei(Me), p = Xn(dt, S, 1), y = Xn(Me, _, 1);
|
|
8076
8084
|
} else
|
|
8077
8085
|
yt(1);
|
|
8078
8086
|
else {
|
|
8079
|
-
var
|
|
8087
|
+
var b = ru(h) + 4, T = i[b - 4] | i[b - 3] << 8, A = b + T;
|
|
8080
8088
|
if (A > s) {
|
|
8081
8089
|
c && yt(0);
|
|
8082
8090
|
break;
|
|
8083
8091
|
}
|
|
8084
|
-
a && u(f + T), t.set(i.subarray(
|
|
8092
|
+
a && u(f + T), t.set(i.subarray(b, A), f), e.b = f += T, e.p = h = A * 8, e.f = d;
|
|
8085
8093
|
continue;
|
|
8086
8094
|
}
|
|
8087
|
-
if (h >
|
|
8095
|
+
if (h > x) {
|
|
8088
8096
|
c && yt(0);
|
|
8089
8097
|
break;
|
|
8090
8098
|
}
|
|
8091
8099
|
}
|
|
8092
8100
|
a && u(f + 131072);
|
|
8093
|
-
for (var He = (1 <<
|
|
8101
|
+
for (var He = (1 << S) - 1, We = (1 << _) - 1, ve = h; ; ve = h) {
|
|
8094
8102
|
var ie = p[Ti(i, h) & He], ge = ie >> 4;
|
|
8095
|
-
if (h += ie & 15, h >
|
|
8103
|
+
if (h += ie & 15, h > x) {
|
|
8096
8104
|
c && yt(0);
|
|
8097
8105
|
break;
|
|
8098
8106
|
}
|
|
@@ -8107,35 +8115,35 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
|
|
|
8107
8115
|
var N = ge - 257, Ze = qo[N];
|
|
8108
8116
|
St = mt(i, h, (1 << Ze) - 1) + ea[N], h += Ze;
|
|
8109
8117
|
}
|
|
8110
|
-
var Ft =
|
|
8118
|
+
var Ft = y[Ti(i, h) & We], me = Ft >> 4;
|
|
8111
8119
|
Ft || yt(3), h += Ft & 15;
|
|
8112
8120
|
var Me = nu[me];
|
|
8113
8121
|
if (me > 3) {
|
|
8114
8122
|
var Ze = $o[me];
|
|
8115
8123
|
Me += Ti(i, h) & (1 << Ze) - 1, h += Ze;
|
|
8116
8124
|
}
|
|
8117
|
-
if (h >
|
|
8125
|
+
if (h > x) {
|
|
8118
8126
|
c && yt(0);
|
|
8119
8127
|
break;
|
|
8120
8128
|
}
|
|
8121
8129
|
a && u(f + 131072);
|
|
8122
8130
|
var ft = f + St;
|
|
8123
8131
|
if (f < Me) {
|
|
8124
|
-
var pt = r - Me,
|
|
8125
|
-
for (pt + f < 0 && yt(3); f <
|
|
8132
|
+
var pt = r - Me, Rn = Math.min(Me, ft);
|
|
8133
|
+
for (pt + f < 0 && yt(3); f < Rn; ++f)
|
|
8126
8134
|
t[f] = n[pt + f];
|
|
8127
8135
|
}
|
|
8128
8136
|
for (; f < ft; ++f)
|
|
8129
8137
|
t[f] = t[f - Me];
|
|
8130
8138
|
}
|
|
8131
8139
|
}
|
|
8132
|
-
e.l = p, e.p = ve, e.b = f, e.f = d, p && (d = 1, e.m =
|
|
8140
|
+
e.l = p, e.p = ve, e.b = f, e.f = d, p && (d = 1, e.m = S, e.d = y, e.n = _);
|
|
8133
8141
|
} while (!d);
|
|
8134
8142
|
return f != t.length && o ? ou(t, 0, f) : t.subarray(0, f);
|
|
8135
|
-
}, lu = /* @__PURE__ */ new
|
|
8143
|
+
}, lu = /* @__PURE__ */ new lt(0), hu = function(i, e) {
|
|
8136
8144
|
return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && yt(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && yt(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;
|
|
8137
8145
|
};
|
|
8138
|
-
function
|
|
8146
|
+
function Un(i, e) {
|
|
8139
8147
|
return cu(i.subarray(hu(i), -4), { i: 2 }, e, e);
|
|
8140
8148
|
}
|
|
8141
8149
|
var uu = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), du = 0;
|
|
@@ -8162,11 +8170,11 @@ class fu extends Co {
|
|
|
8162
8170
|
const O = Math.pow(2.7182818, 2.2);
|
|
8163
8171
|
let C = null;
|
|
8164
8172
|
function N(l, m) {
|
|
8165
|
-
let
|
|
8173
|
+
let g = 0;
|
|
8166
8174
|
for (let L = 0; L < 65536; ++L)
|
|
8167
|
-
(L == 0 || l[L >> 3] & 1 << (L & 7)) && (m[
|
|
8168
|
-
const R =
|
|
8169
|
-
for (;
|
|
8175
|
+
(L == 0 || l[L >> 3] & 1 << (L & 7)) && (m[g++] = L);
|
|
8176
|
+
const R = g - 1;
|
|
8177
|
+
for (; g < 65536; ) m[g++] = 0;
|
|
8170
8178
|
return R;
|
|
8171
8179
|
}
|
|
8172
8180
|
function D(l) {
|
|
@@ -8174,34 +8182,34 @@ class fu extends Co {
|
|
|
8174
8182
|
l[m] = {}, l[m].len = 0, l[m].lit = 0, l[m].p = null;
|
|
8175
8183
|
}
|
|
8176
8184
|
const H = { l: 0, c: 0, lc: 0 };
|
|
8177
|
-
function j(l, m,
|
|
8178
|
-
for (;
|
|
8179
|
-
m = m << 8 | Er(R, L),
|
|
8180
|
-
|
|
8185
|
+
function j(l, m, g, R, L) {
|
|
8186
|
+
for (; g < l; )
|
|
8187
|
+
m = m << 8 | Er(R, L), g += 8;
|
|
8188
|
+
g -= l, H.l = m >> g & (1 << l) - 1, H.c = m, H.lc = g;
|
|
8181
8189
|
}
|
|
8182
8190
|
const q = new Array(59);
|
|
8183
8191
|
function ie(l) {
|
|
8184
|
-
for (let
|
|
8185
|
-
for (let
|
|
8192
|
+
for (let g = 0; g <= 58; ++g) q[g] = 0;
|
|
8193
|
+
for (let g = 0; g < 65537; ++g) q[l[g]] += 1;
|
|
8186
8194
|
let m = 0;
|
|
8187
|
-
for (let
|
|
8188
|
-
const R = m + q[
|
|
8189
|
-
q[
|
|
8195
|
+
for (let g = 58; g > 0; --g) {
|
|
8196
|
+
const R = m + q[g] >> 1;
|
|
8197
|
+
q[g] = m, m = R;
|
|
8190
8198
|
}
|
|
8191
|
-
for (let
|
|
8192
|
-
const R = l[
|
|
8193
|
-
R > 0 && (l[
|
|
8199
|
+
for (let g = 0; g < 65537; ++g) {
|
|
8200
|
+
const R = l[g];
|
|
8201
|
+
R > 0 && (l[g] = R | q[R]++ << 6);
|
|
8194
8202
|
}
|
|
8195
8203
|
}
|
|
8196
|
-
function ke(l, m,
|
|
8204
|
+
function ke(l, m, g, R, L, z) {
|
|
8197
8205
|
const v = m;
|
|
8198
8206
|
let U = 0, F = 0;
|
|
8199
8207
|
for (; R <= L; R++) {
|
|
8200
|
-
if (v.value - m.value >
|
|
8208
|
+
if (v.value - m.value > g) return !1;
|
|
8201
8209
|
j(6, U, F, l, v);
|
|
8202
8210
|
const B = H.l;
|
|
8203
8211
|
if (U = H.c, F = H.lc, z[R] = B, B == 63) {
|
|
8204
|
-
if (v.value - m.value >
|
|
8212
|
+
if (v.value - m.value > g)
|
|
8205
8213
|
throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
|
|
8206
8214
|
j(8, U, F, l, v);
|
|
8207
8215
|
let G = H.l + 6;
|
|
@@ -8225,8 +8233,8 @@ class fu extends Co {
|
|
|
8225
8233
|
function Me(l) {
|
|
8226
8234
|
return l >> 6;
|
|
8227
8235
|
}
|
|
8228
|
-
function He(l, m,
|
|
8229
|
-
for (; m <=
|
|
8236
|
+
function He(l, m, g, R) {
|
|
8237
|
+
for (; m <= g; m++) {
|
|
8230
8238
|
const L = Me(l[m]), z = dt(l[m]);
|
|
8231
8239
|
if (L >> z)
|
|
8232
8240
|
throw new Error("THREE.EXRLoader: Invalid table entry");
|
|
@@ -8255,14 +8263,14 @@ class fu extends Co {
|
|
|
8255
8263
|
return !0;
|
|
8256
8264
|
}
|
|
8257
8265
|
const We = { c: 0, lc: 0 };
|
|
8258
|
-
function ve(l, m,
|
|
8259
|
-
l = l << 8 | Er(
|
|
8266
|
+
function ve(l, m, g, R) {
|
|
8267
|
+
l = l << 8 | Er(g, R), m += 8, We.c = l, We.lc = m;
|
|
8260
8268
|
}
|
|
8261
8269
|
const ge = { c: 0, lc: 0 };
|
|
8262
|
-
function St(l, m,
|
|
8270
|
+
function St(l, m, g, R, L, z, v, U, F) {
|
|
8263
8271
|
if (l == m) {
|
|
8264
|
-
R < 8 && (ve(
|
|
8265
|
-
let B =
|
|
8272
|
+
R < 8 && (ve(g, R, L, z), g = We.c, R = We.lc), R -= 8;
|
|
8273
|
+
let B = g >> R;
|
|
8266
8274
|
if (B = new Uint8Array([B])[0], U.value + B > F)
|
|
8267
8275
|
return !1;
|
|
8268
8276
|
const G = v[U.value - 1];
|
|
@@ -8272,7 +8280,7 @@ class fu extends Co {
|
|
|
8272
8280
|
v[U.value++] = l;
|
|
8273
8281
|
else
|
|
8274
8282
|
return !1;
|
|
8275
|
-
ge.c =
|
|
8283
|
+
ge.c = g, ge.lc = R;
|
|
8276
8284
|
}
|
|
8277
8285
|
function Ze(l) {
|
|
8278
8286
|
return l & 65535;
|
|
@@ -8283,15 +8291,15 @@ class fu extends Co {
|
|
|
8283
8291
|
}
|
|
8284
8292
|
const me = { a: 0, b: 0 };
|
|
8285
8293
|
function ft(l, m) {
|
|
8286
|
-
const
|
|
8294
|
+
const g = Ft(l), L = Ft(m), z = g + (L & 1) + (L >> 1), v = z, U = z - L;
|
|
8287
8295
|
me.a = v, me.b = U;
|
|
8288
8296
|
}
|
|
8289
8297
|
function pt(l, m) {
|
|
8290
|
-
const
|
|
8298
|
+
const g = Ze(l), R = Ze(m), L = g - (R >> 1) & 65535, z = R + L - 32768 & 65535;
|
|
8291
8299
|
me.a = z, me.b = L;
|
|
8292
8300
|
}
|
|
8293
|
-
function
|
|
8294
|
-
const U = v < 16384, F =
|
|
8301
|
+
function Rn(l, m, g, R, L, z, v) {
|
|
8302
|
+
const U = v < 16384, F = g > L ? L : g;
|
|
8295
8303
|
let B = 1, G, W;
|
|
8296
8304
|
for (; B <= F; ) B <<= 1;
|
|
8297
8305
|
for (B >>= 1, G = B, B >>= 1; B >= 1; ) {
|
|
@@ -8300,19 +8308,19 @@ class fu extends Co {
|
|
|
8300
8308
|
let re, le, oe, ue;
|
|
8301
8309
|
for (; W <= V; W += ee) {
|
|
8302
8310
|
let ne = W;
|
|
8303
|
-
const te = W + R * (
|
|
8311
|
+
const te = W + R * (g - G);
|
|
8304
8312
|
for (; ne <= te; ne += Q) {
|
|
8305
8313
|
const se = ne + K, ye = ne + X, fe = ye + K;
|
|
8306
8314
|
U ? (ft(l[ne + m], l[ye + m]), re = me.a, oe = me.b, ft(l[se + m], l[fe + m]), le = me.a, ue = me.b, ft(re, le), l[ne + m] = me.a, l[se + m] = me.b, ft(oe, ue), l[ye + m] = me.a, l[fe + m] = me.b) : (pt(l[ne + m], l[ye + m]), re = me.a, oe = me.b, pt(l[se + m], l[fe + m]), le = me.a, ue = me.b, pt(re, le), l[ne + m] = me.a, l[se + m] = me.b, pt(oe, ue), l[ye + m] = me.a, l[fe + m] = me.b);
|
|
8307
8315
|
}
|
|
8308
|
-
if (
|
|
8316
|
+
if (g & B) {
|
|
8309
8317
|
const se = ne + X;
|
|
8310
8318
|
U ? ft(l[ne + m], l[se + m]) : pt(l[ne + m], l[se + m]), re = me.a, l[se + m] = me.b, l[ne + m] = re;
|
|
8311
8319
|
}
|
|
8312
8320
|
}
|
|
8313
8321
|
if (L & B) {
|
|
8314
8322
|
let ne = W;
|
|
8315
|
-
const te = W + R * (
|
|
8323
|
+
const te = W + R * (g - G);
|
|
8316
8324
|
for (; ne <= te; ne += Q) {
|
|
8317
8325
|
const se = ne + K;
|
|
8318
8326
|
U ? ft(l[ne + m], l[se + m]) : pt(l[ne + m], l[se + m]), re = me.a, l[se + m] = me.b, l[ne + m] = re;
|
|
@@ -8322,14 +8330,14 @@ class fu extends Co {
|
|
|
8322
8330
|
}
|
|
8323
8331
|
return W;
|
|
8324
8332
|
}
|
|
8325
|
-
function rn(l, m,
|
|
8333
|
+
function rn(l, m, g, R, L, z, v, U, F) {
|
|
8326
8334
|
let B = 0, G = 0;
|
|
8327
8335
|
const W = v, V = Math.trunc(R.value + (L + 7) / 8);
|
|
8328
8336
|
for (; R.value < V; )
|
|
8329
|
-
for (ve(B, G,
|
|
8337
|
+
for (ve(B, G, g, R), B = We.c, G = We.lc; G >= 14; ) {
|
|
8330
8338
|
const ee = B >> G - 14 & 16383, K = m[ee];
|
|
8331
8339
|
if (K.len)
|
|
8332
|
-
G -= K.len, St(K.lit, z, B, G,
|
|
8340
|
+
G -= K.len, St(K.lit, z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
|
|
8333
8341
|
else {
|
|
8334
8342
|
if (!K.p)
|
|
8335
8343
|
throw new Error("THREE.EXRLoader: hufDecode issues");
|
|
@@ -8337,9 +8345,9 @@ class fu extends Co {
|
|
|
8337
8345
|
for (Q = 0; Q < K.lit; Q++) {
|
|
8338
8346
|
const re = dt(l[K.p[Q]]);
|
|
8339
8347
|
for (; G < re && R.value < V; )
|
|
8340
|
-
ve(B, G,
|
|
8348
|
+
ve(B, G, g, R), B = We.c, G = We.lc;
|
|
8341
8349
|
if (G >= re && Me(l[K.p[Q]]) == (B >> G - re & (1 << re) - 1)) {
|
|
8342
|
-
G -= re, St(K.p[Q], z, B, G,
|
|
8350
|
+
G -= re, St(K.p[Q], z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
|
|
8343
8351
|
break;
|
|
8344
8352
|
}
|
|
8345
8353
|
}
|
|
@@ -8351,44 +8359,44 @@ class fu extends Co {
|
|
|
8351
8359
|
for (B >>= X, G -= X; G > 0; ) {
|
|
8352
8360
|
const ee = m[B << 14 - G & 16383];
|
|
8353
8361
|
if (ee.len)
|
|
8354
|
-
G -= ee.len, St(ee.lit, z, B, G,
|
|
8362
|
+
G -= ee.len, St(ee.lit, z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
|
|
8355
8363
|
else
|
|
8356
8364
|
throw new Error("THREE.EXRLoader: hufDecode issues");
|
|
8357
8365
|
}
|
|
8358
8366
|
return !0;
|
|
8359
8367
|
}
|
|
8360
|
-
function It(l, m,
|
|
8361
|
-
const v = { value: 0 }, U =
|
|
8362
|
-
|
|
8363
|
-
const G = st(m,
|
|
8364
|
-
if (
|
|
8368
|
+
function It(l, m, g, R, L, z) {
|
|
8369
|
+
const v = { value: 0 }, U = g.value, F = st(m, g), B = st(m, g);
|
|
8370
|
+
g.value += 4;
|
|
8371
|
+
const G = st(m, g);
|
|
8372
|
+
if (g.value += 4, F < 0 || F >= 65537 || B < 0 || B >= 65537)
|
|
8365
8373
|
throw new Error("THREE.EXRLoader: Something wrong with HUF_ENCSIZE");
|
|
8366
8374
|
const W = new Array(65537), V = new Array(16384);
|
|
8367
8375
|
D(V);
|
|
8368
|
-
const X = R - (
|
|
8369
|
-
if (ke(l,
|
|
8376
|
+
const X = R - (g.value - U);
|
|
8377
|
+
if (ke(l, g, X, F, B, W), G > 8 * (R - (g.value - U)))
|
|
8370
8378
|
throw new Error("THREE.EXRLoader: Something wrong with hufUncompress");
|
|
8371
|
-
He(W, F, B, V), rn(W, V, l,
|
|
8379
|
+
He(W, F, B, V), rn(W, V, l, g, G, B, z, L, v);
|
|
8372
8380
|
}
|
|
8373
|
-
function ns(l, m,
|
|
8374
|
-
for (let R = 0; R <
|
|
8381
|
+
function ns(l, m, g) {
|
|
8382
|
+
for (let R = 0; R < g; ++R)
|
|
8375
8383
|
m[R] = l[m[R]];
|
|
8376
8384
|
}
|
|
8377
8385
|
function ss(l) {
|
|
8378
8386
|
for (let m = 1; m < l.length; m++) {
|
|
8379
|
-
const
|
|
8380
|
-
l[m] =
|
|
8387
|
+
const g = l[m - 1] + l[m] - 128;
|
|
8388
|
+
l[m] = g;
|
|
8381
8389
|
}
|
|
8382
8390
|
}
|
|
8383
8391
|
function is(l, m) {
|
|
8384
|
-
let
|
|
8392
|
+
let g = 0, R = Math.floor((l.length + 1) / 2), L = 0;
|
|
8385
8393
|
const z = l.length - 1;
|
|
8386
|
-
for (; !(L > z || (m[L++] = l[
|
|
8394
|
+
for (; !(L > z || (m[L++] = l[g++], L > z)); )
|
|
8387
8395
|
m[L++] = l[R++];
|
|
8388
8396
|
}
|
|
8389
8397
|
function Qs(l) {
|
|
8390
8398
|
let m = l.byteLength;
|
|
8391
|
-
const
|
|
8399
|
+
const g = new Array();
|
|
8392
8400
|
let R = 0;
|
|
8393
8401
|
const L = new DataView(l);
|
|
8394
8402
|
for (; m > 0; ) {
|
|
@@ -8397,20 +8405,20 @@ class fu extends Co {
|
|
|
8397
8405
|
const v = -z;
|
|
8398
8406
|
m -= v + 1;
|
|
8399
8407
|
for (let U = 0; U < v; U++)
|
|
8400
|
-
|
|
8408
|
+
g.push(L.getUint8(R++));
|
|
8401
8409
|
} else {
|
|
8402
8410
|
const v = z;
|
|
8403
8411
|
m -= 2;
|
|
8404
8412
|
const U = L.getUint8(R++);
|
|
8405
8413
|
for (let F = 0; F < v + 1; F++)
|
|
8406
|
-
|
|
8414
|
+
g.push(U);
|
|
8407
8415
|
}
|
|
8408
8416
|
}
|
|
8409
|
-
return
|
|
8417
|
+
return g;
|
|
8410
8418
|
}
|
|
8411
|
-
function fa(l, m,
|
|
8419
|
+
function fa(l, m, g, R, L, z) {
|
|
8412
8420
|
let v = new DataView(z.buffer);
|
|
8413
|
-
const U =
|
|
8421
|
+
const U = g[l.idx[0]].width, F = g[l.idx[0]].height, B = 3, G = Math.floor(U / 8), W = Math.ceil(U / 8), V = Math.ceil(F / 8), X = U - (W - 1) * 8, ee = F - (V - 1) * 8, K = { value: 0 }, Q = new Array(B), re = new Array(B), le = new Array(B), oe = new Array(B), ue = new Array(B);
|
|
8414
8422
|
for (let te = 0; te < B; ++te)
|
|
8415
8423
|
ue[te] = m[l.idx[te]], Q[te] = te < 1 ? 0 : Q[te - 1] + W * V, re[te] = new Float32Array(64), le[te] = new Uint16Array(64), oe[te] = new Uint16Array(W * 64);
|
|
8416
8424
|
for (let te = 0; te < V; ++te) {
|
|
@@ -8427,7 +8435,7 @@ class fu extends Co {
|
|
|
8427
8435
|
}
|
|
8428
8436
|
let fe = 0;
|
|
8429
8437
|
for (let ae = 0; ae < B; ++ae) {
|
|
8430
|
-
const he =
|
|
8438
|
+
const he = g[l.idx[ae]].type;
|
|
8431
8439
|
for (let Ie = 8 * te; Ie < 8 * te + se; ++Ie) {
|
|
8432
8440
|
fe = ue[ae][Ie];
|
|
8433
8441
|
for (let it = 0; it < G; ++it) {
|
|
@@ -8446,9 +8454,9 @@ class fu extends Co {
|
|
|
8446
8454
|
const ne = new Uint16Array(U);
|
|
8447
8455
|
v = new DataView(z.buffer);
|
|
8448
8456
|
for (let te = 0; te < B; ++te) {
|
|
8449
|
-
|
|
8450
|
-
const se =
|
|
8451
|
-
if (
|
|
8457
|
+
g[l.idx[te]].decoded = !0;
|
|
8458
|
+
const se = g[l.idx[te]].type;
|
|
8459
|
+
if (g[te].type == 2)
|
|
8452
8460
|
for (let ye = 0; ye < F; ++ye) {
|
|
8453
8461
|
const fe = ue[te][ye];
|
|
8454
8462
|
for (let ae = 0; ae < U; ++ae)
|
|
@@ -8458,8 +8466,8 @@ class fu extends Co {
|
|
|
8458
8466
|
}
|
|
8459
8467
|
}
|
|
8460
8468
|
}
|
|
8461
|
-
function pa(l, m,
|
|
8462
|
-
const v = new DataView(z.buffer), U =
|
|
8469
|
+
function pa(l, m, g, R, L, z) {
|
|
8470
|
+
const v = new DataView(z.buffer), U = g[l], F = U.width, B = U.height, G = Math.ceil(F / 8), W = Math.ceil(B / 8), V = Math.floor(F / 8), X = F - (G - 1) * 8, ee = B - (W - 1) * 8, K = { value: 0 };
|
|
8463
8471
|
let Q = 0;
|
|
8464
8472
|
const re = new Float32Array(64), le = new Uint16Array(64), oe = new Uint16Array(G * 64);
|
|
8465
8473
|
for (let ue = 0; ue < W; ++ue) {
|
|
@@ -8484,32 +8492,32 @@ class fu extends Co {
|
|
|
8484
8492
|
}
|
|
8485
8493
|
U.decoded = !0;
|
|
8486
8494
|
}
|
|
8487
|
-
function pr(l, m,
|
|
8495
|
+
function pr(l, m, g) {
|
|
8488
8496
|
let R, L = 1;
|
|
8489
8497
|
for (; L < 64; )
|
|
8490
|
-
R = m[l.value], R == 65280 ? L = 64 : R >> 8 == 255 ? L += R & 255 : (
|
|
8498
|
+
R = m[l.value], R == 65280 ? L = 64 : R >> 8 == 255 ? L += R & 255 : (g[L] = R, L++), l.value++;
|
|
8491
8499
|
}
|
|
8492
8500
|
function mr(l, m) {
|
|
8493
8501
|
m[0] = J(l[0]), m[1] = J(l[1]), m[2] = J(l[5]), m[3] = J(l[6]), m[4] = J(l[14]), m[5] = J(l[15]), m[6] = J(l[27]), m[7] = J(l[28]), m[8] = J(l[2]), m[9] = J(l[4]), m[10] = J(l[7]), m[11] = J(l[13]), m[12] = J(l[16]), m[13] = J(l[26]), m[14] = J(l[29]), m[15] = J(l[42]), m[16] = J(l[3]), m[17] = J(l[8]), m[18] = J(l[12]), m[19] = J(l[17]), m[20] = J(l[25]), m[21] = J(l[30]), m[22] = J(l[41]), m[23] = J(l[43]), m[24] = J(l[9]), m[25] = J(l[11]), m[26] = J(l[18]), m[27] = J(l[24]), m[28] = J(l[31]), m[29] = J(l[40]), m[30] = J(l[44]), m[31] = J(l[53]), m[32] = J(l[10]), m[33] = J(l[19]), m[34] = J(l[23]), m[35] = J(l[32]), m[36] = J(l[39]), m[37] = J(l[45]), m[38] = J(l[52]), m[39] = J(l[54]), m[40] = J(l[20]), m[41] = J(l[22]), m[42] = J(l[33]), m[43] = J(l[38]), m[44] = J(l[46]), m[45] = J(l[51]), m[46] = J(l[55]), m[47] = J(l[60]), m[48] = J(l[21]), m[49] = J(l[34]), m[50] = J(l[37]), m[51] = J(l[47]), m[52] = J(l[50]), m[53] = J(l[56]), m[54] = J(l[59]), m[55] = J(l[61]), m[56] = J(l[35]), m[57] = J(l[36]), m[58] = J(l[48]), m[59] = J(l[49]), m[60] = J(l[57]), m[61] = J(l[58]), m[62] = J(l[62]), m[63] = J(l[63]);
|
|
8494
8502
|
}
|
|
8495
8503
|
function gr(l) {
|
|
8496
|
-
const m = 0.5 * Math.cos(0.7853975),
|
|
8504
|
+
const m = 0.5 * Math.cos(0.7853975), g = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), L = 0.5 * Math.cos(3 * 3.14159 / 16), z = 0.5 * Math.cos(5 * 3.14159 / 16), v = 0.5 * Math.cos(3 * 3.14159 / 8), U = 0.5 * Math.cos(7 * 3.14159 / 16), F = new Array(4), B = new Array(4), G = new Array(4), W = new Array(4);
|
|
8497
8505
|
for (let V = 0; V < 8; ++V) {
|
|
8498
8506
|
const X = V * 8;
|
|
8499
|
-
F[0] = R * l[X + 2], F[1] = v * l[X + 2], F[2] = R * l[X + 6], F[3] = v * l[X + 6], B[0] =
|
|
8507
|
+
F[0] = R * l[X + 2], F[1] = v * l[X + 2], F[2] = R * l[X + 6], F[3] = v * l[X + 6], B[0] = g * l[X + 1] + L * l[X + 3] + z * l[X + 5] + U * l[X + 7], B[1] = L * l[X + 1] - U * l[X + 3] - g * l[X + 5] - z * l[X + 7], B[2] = z * l[X + 1] - g * l[X + 3] + U * l[X + 5] + L * l[X + 7], B[3] = U * l[X + 1] - z * l[X + 3] + L * l[X + 5] - g * l[X + 7], G[0] = m * (l[X + 0] + l[X + 4]), G[3] = m * (l[X + 0] - l[X + 4]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[X + 0] = W[0] + B[0], l[X + 1] = W[1] + B[1], l[X + 2] = W[2] + B[2], l[X + 3] = W[3] + B[3], l[X + 4] = W[3] - B[3], l[X + 5] = W[2] - B[2], l[X + 6] = W[1] - B[1], l[X + 7] = W[0] - B[0];
|
|
8500
8508
|
}
|
|
8501
8509
|
for (let V = 0; V < 8; ++V)
|
|
8502
|
-
F[0] = R * l[16 + V], F[1] = v * l[16 + V], F[2] = R * l[48 + V], F[3] = v * l[48 + V], B[0] =
|
|
8510
|
+
F[0] = R * l[16 + V], F[1] = v * l[16 + V], F[2] = R * l[48 + V], F[3] = v * l[48 + V], B[0] = g * l[8 + V] + L * l[24 + V] + z * l[40 + V] + U * l[56 + V], B[1] = L * l[8 + V] - U * l[24 + V] - g * l[40 + V] - z * l[56 + V], B[2] = z * l[8 + V] - g * l[24 + V] + U * l[40 + V] + L * l[56 + V], B[3] = U * l[8 + V] - z * l[24 + V] + L * l[40 + V] - g * l[56 + V], G[0] = m * (l[V] + l[32 + V]), G[3] = m * (l[V] - l[32 + V]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[0 + V] = W[0] + B[0], l[8 + V] = W[1] + B[1], l[16 + V] = W[2] + B[2], l[24 + V] = W[3] + B[3], l[32 + V] = W[3] - B[3], l[40 + V] = W[2] - B[2], l[48 + V] = W[1] - B[1], l[56 + V] = W[0] - B[0];
|
|
8503
8511
|
}
|
|
8504
8512
|
function ma(l) {
|
|
8505
8513
|
for (let m = 0; m < 64; ++m) {
|
|
8506
|
-
const
|
|
8507
|
-
l[0][m] =
|
|
8514
|
+
const g = l[0][m], R = l[1][m], L = l[2][m];
|
|
8515
|
+
l[0][m] = g + 1.5747 * L, l[1][m] = g - 0.1873 * R - 0.4682 * L, l[2][m] = g + 1.8556 * R;
|
|
8508
8516
|
}
|
|
8509
8517
|
}
|
|
8510
|
-
function yr(l, m,
|
|
8518
|
+
function yr(l, m, g) {
|
|
8511
8519
|
for (let R = 0; R < 64; ++R)
|
|
8512
|
-
m[
|
|
8520
|
+
m[g + R] = Et.toHalfFloat(ga(l[R]));
|
|
8513
8521
|
}
|
|
8514
8522
|
function ga(l) {
|
|
8515
8523
|
return l <= 1 ? Math.sign(l) * Math.pow(Math.abs(l), 2.2) : Math.sign(l) * Math.pow(O, Math.abs(l) - 1);
|
|
@@ -8518,31 +8526,31 @@ class fu extends Co {
|
|
|
8518
8526
|
return new DataView(l.array.buffer, l.offset.value, l.size);
|
|
8519
8527
|
}
|
|
8520
8528
|
function ya(l) {
|
|
8521
|
-
const m = l.viewer.buffer.slice(l.offset.value, l.offset.value + l.size),
|
|
8522
|
-
return ss(
|
|
8529
|
+
const m = l.viewer.buffer.slice(l.offset.value, l.offset.value + l.size), g = new Uint8Array(Qs(m)), R = new Uint8Array(g.length);
|
|
8530
|
+
return ss(g), is(g, R), new DataView(R.buffer);
|
|
8523
8531
|
}
|
|
8524
8532
|
function Js(l) {
|
|
8525
|
-
const m = l.array.slice(l.offset.value, l.offset.value + l.size),
|
|
8526
|
-
return ss(
|
|
8533
|
+
const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = Un(m), R = new Uint8Array(g.length);
|
|
8534
|
+
return ss(g), is(g, R), new DataView(R.buffer);
|
|
8527
8535
|
}
|
|
8528
8536
|
function wa(l) {
|
|
8529
|
-
const m = l.viewer,
|
|
8537
|
+
const m = l.viewer, g = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), L = new Uint8Array(8192);
|
|
8530
8538
|
let z = 0;
|
|
8531
8539
|
const v = new Array(l.inputChannels.length);
|
|
8532
8540
|
for (let ee = 0, K = l.inputChannels.length; ee < K; ee++)
|
|
8533
8541
|
v[ee] = {}, v[ee].start = z, v[ee].end = v[ee].start, v[ee].nx = l.columns, v[ee].ny = l.lines, v[ee].size = l.type, z += v[ee].nx * v[ee].ny * v[ee].size;
|
|
8534
|
-
const U =
|
|
8542
|
+
const U = Mn(m, g), F = Mn(m, g);
|
|
8535
8543
|
if (F >= 8192)
|
|
8536
8544
|
throw new Error("THREE.EXRLoader: Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");
|
|
8537
8545
|
if (U <= F)
|
|
8538
8546
|
for (let ee = 0; ee < F - U + 1; ee++)
|
|
8539
|
-
L[ee + U] = zt(m,
|
|
8540
|
-
const B = new Uint16Array(65536), G = N(L, B), W = st(m,
|
|
8541
|
-
It(l.array, m,
|
|
8547
|
+
L[ee + U] = zt(m, g);
|
|
8548
|
+
const B = new Uint16Array(65536), G = N(L, B), W = st(m, g);
|
|
8549
|
+
It(l.array, m, g, W, R, z);
|
|
8542
8550
|
for (let ee = 0; ee < l.inputChannels.length; ++ee) {
|
|
8543
8551
|
const K = v[ee];
|
|
8544
8552
|
for (let Q = 0; Q < v[ee].size; ++Q)
|
|
8545
|
-
|
|
8553
|
+
Rn(
|
|
8546
8554
|
R,
|
|
8547
8555
|
K.start + Q,
|
|
8548
8556
|
K.nx,
|
|
@@ -8563,7 +8571,7 @@ class fu extends Co {
|
|
|
8563
8571
|
return new DataView(X.buffer);
|
|
8564
8572
|
}
|
|
8565
8573
|
function Ea(l) {
|
|
8566
|
-
const m = l.array.slice(l.offset.value, l.offset.value + l.size),
|
|
8574
|
+
const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = Un(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), z = new DataView(L);
|
|
8567
8575
|
let v = 0, U = 0;
|
|
8568
8576
|
const F = new Array(4);
|
|
8569
8577
|
for (let B = 0; B < l.lines; B++)
|
|
@@ -8573,14 +8581,14 @@ class fu extends Co {
|
|
|
8573
8581
|
case 1:
|
|
8574
8582
|
F[0] = v, F[1] = F[0] + l.columns, v = F[1] + l.columns;
|
|
8575
8583
|
for (let X = 0; X < l.columns; ++X) {
|
|
8576
|
-
const ee =
|
|
8584
|
+
const ee = g[F[0]++] << 8 | g[F[1]++];
|
|
8577
8585
|
W += ee, z.setUint16(U, W, !0), U += 2;
|
|
8578
8586
|
}
|
|
8579
8587
|
break;
|
|
8580
8588
|
case 2:
|
|
8581
8589
|
F[0] = v, F[1] = F[0] + l.columns, F[2] = F[1] + l.columns, v = F[2] + l.columns;
|
|
8582
8590
|
for (let X = 0; X < l.columns; ++X) {
|
|
8583
|
-
const ee =
|
|
8591
|
+
const ee = g[F[0]++] << 24 | g[F[1]++] << 16 | g[F[2]++] << 8;
|
|
8584
8592
|
W += ee, z.setUint32(U, W, !0), U += 4;
|
|
8585
8593
|
}
|
|
8586
8594
|
break;
|
|
@@ -8590,7 +8598,7 @@ class fu extends Co {
|
|
|
8590
8598
|
}
|
|
8591
8599
|
function Ta(l) {
|
|
8592
8600
|
const m = l.array;
|
|
8593
|
-
let
|
|
8601
|
+
let g = l.offset.value;
|
|
8594
8602
|
const R = l.columns, L = l.lines, z = l.inputChannels, v = l.totalBytes, U = Xe.compression === "B44A_COMPRESSION", F = new Uint8Array(L * R * v), B = new Uint16Array(16);
|
|
8595
8603
|
let G = 0;
|
|
8596
8604
|
for (let W = 0; W < z.length; W++) {
|
|
@@ -8600,23 +8608,23 @@ class fu extends Co {
|
|
|
8600
8608
|
if (Q) {
|
|
8601
8609
|
const ue = oe * R * v + G * R;
|
|
8602
8610
|
for (let ne = 0; ne < ee * X; ne++)
|
|
8603
|
-
F[ue + ne] = m[
|
|
8611
|
+
F[ue + ne] = m[g++];
|
|
8604
8612
|
} else
|
|
8605
|
-
|
|
8613
|
+
g += ee * X;
|
|
8606
8614
|
G += X;
|
|
8607
8615
|
continue;
|
|
8608
8616
|
}
|
|
8609
8617
|
const re = Math.ceil(ee / 4), le = Math.ceil(K / 4);
|
|
8610
8618
|
for (let oe = 0; oe < le; oe++)
|
|
8611
8619
|
for (let ue = 0; ue < re; ue++) {
|
|
8612
|
-
if (U && m[
|
|
8613
|
-
const ne = m[
|
|
8614
|
-
B.fill(te),
|
|
8620
|
+
if (U && m[g + 2] >= 52) {
|
|
8621
|
+
const ne = m[g] << 8 | m[g + 1], te = ne & 32768 ? ne & 32767 : ~ne & 65535;
|
|
8622
|
+
B.fill(te), g += 3;
|
|
8615
8623
|
} else {
|
|
8616
|
-
const ne = m[
|
|
8624
|
+
const ne = m[g] << 8 | m[g + 1], te = m[g + 2] >> 2, se = 32 << te, ye = ne + ((m[g + 2] << 4 | m[g + 3] >> 4) & 63) * (1 << te) - se & 65535, fe = ye + ((m[g + 3] << 2 | m[g + 4] >> 6) & 63) * (1 << te) - se & 65535, ae = fe + (m[g + 4] & 63) * (1 << te) - se & 65535, he = ne + (m[g + 5] >> 2 & 63) * (1 << te) - se & 65535, Ie = ye + ((m[g + 5] << 4 | m[g + 6] >> 4) & 63) * (1 << te) - se & 65535, it = fe + ((m[g + 6] << 2 | m[g + 7] >> 6) & 63) * (1 << te) - se & 65535, _e = ae + (m[g + 7] & 63) * (1 << te) - se & 65535, bt = he + (m[g + 8] >> 2 & 63) * (1 << te) - se & 65535, on = Ie + ((m[g + 8] << 4 | m[g + 9] >> 4) & 63) * (1 << te) - se & 65535, In = it + ((m[g + 9] << 2 | m[g + 10] >> 6) & 63) * (1 << te) - se & 65535, xt = _e + (m[g + 10] & 63) * (1 << te) - se & 65535, Xt = bt + (m[g + 11] >> 2 & 63) * (1 << te) - se & 65535, hs = on + ((m[g + 11] << 4 | m[g + 12] >> 4) & 63) * (1 << te) - se & 65535, us = In + ((m[g + 12] << 2 | m[g + 13] >> 6) & 63) * (1 << te) - se & 65535, ds = xt + (m[g + 13] & 63) * (1 << te) - se & 65535, Cn = [ne, he, bt, Xt, ye, Ie, on, hs, fe, it, In, us, ae, _e, xt, ds];
|
|
8617
8625
|
for (let an = 0; an < 16; an++)
|
|
8618
|
-
B[an] =
|
|
8619
|
-
|
|
8626
|
+
B[an] = Cn[an] & 32768 ? Cn[an] & 32767 : ~Cn[an] & 65535;
|
|
8627
|
+
g += 14;
|
|
8620
8628
|
}
|
|
8621
8629
|
if (V.pLinear) {
|
|
8622
8630
|
if (C === null) {
|
|
@@ -8656,25 +8664,25 @@ class fu extends Co {
|
|
|
8656
8664
|
return new DataView(F.buffer);
|
|
8657
8665
|
}
|
|
8658
8666
|
function wr(l) {
|
|
8659
|
-
const m = l.viewer,
|
|
8660
|
-
version: Fe(m,
|
|
8661
|
-
unknownUncompressedSize: Fe(m,
|
|
8662
|
-
unknownCompressedSize: Fe(m,
|
|
8663
|
-
acCompressedSize: Fe(m,
|
|
8664
|
-
dcCompressedSize: Fe(m,
|
|
8665
|
-
rleCompressedSize: Fe(m,
|
|
8666
|
-
rleUncompressedSize: Fe(m,
|
|
8667
|
-
rleRawSize: Fe(m,
|
|
8668
|
-
totalAcUncompressedCount: Fe(m,
|
|
8669
|
-
totalDcUncompressedCount: Fe(m,
|
|
8670
|
-
acCompression: Fe(m,
|
|
8667
|
+
const m = l.viewer, g = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), L = {
|
|
8668
|
+
version: Fe(m, g),
|
|
8669
|
+
unknownUncompressedSize: Fe(m, g),
|
|
8670
|
+
unknownCompressedSize: Fe(m, g),
|
|
8671
|
+
acCompressedSize: Fe(m, g),
|
|
8672
|
+
dcCompressedSize: Fe(m, g),
|
|
8673
|
+
rleCompressedSize: Fe(m, g),
|
|
8674
|
+
rleUncompressedSize: Fe(m, g),
|
|
8675
|
+
rleRawSize: Fe(m, g),
|
|
8676
|
+
totalAcUncompressedCount: Fe(m, g),
|
|
8677
|
+
totalDcUncompressedCount: Fe(m, g),
|
|
8678
|
+
acCompression: Fe(m, g)
|
|
8671
8679
|
};
|
|
8672
8680
|
if (L.version < 2)
|
|
8673
8681
|
throw new Error("THREE.EXRLoader: " + Xe.compression + " version " + L.version + " is unsupported");
|
|
8674
8682
|
const z = new Array();
|
|
8675
|
-
let v =
|
|
8683
|
+
let v = Mn(m, g) - 2;
|
|
8676
8684
|
for (; v > 0; ) {
|
|
8677
|
-
const K = os(m.buffer,
|
|
8685
|
+
const K = os(m.buffer, g), Q = zt(m, g), re = Q >> 2 & 3, le = (Q >> 4) - 1, oe = new Int8Array([le])[0], ue = zt(m, g);
|
|
8678
8686
|
z.push({
|
|
8679
8687
|
name: K,
|
|
8680
8688
|
index: oe,
|
|
@@ -8701,24 +8709,24 @@ class fu extends Co {
|
|
|
8701
8709
|
if (L.acCompressedSize > 0)
|
|
8702
8710
|
switch (L.acCompression) {
|
|
8703
8711
|
case 0:
|
|
8704
|
-
G = new Uint16Array(L.totalAcUncompressedCount), It(l.array, m,
|
|
8712
|
+
G = new Uint16Array(L.totalAcUncompressedCount), It(l.array, m, g, L.acCompressedSize, G, L.totalAcUncompressedCount);
|
|
8705
8713
|
break;
|
|
8706
8714
|
case 1:
|
|
8707
|
-
const K = l.array.slice(
|
|
8708
|
-
G = new Uint16Array(Q.buffer),
|
|
8715
|
+
const K = l.array.slice(g.value, g.value + L.totalAcUncompressedCount), Q = Un(K);
|
|
8716
|
+
G = new Uint16Array(Q.buffer), g.value += L.totalAcUncompressedCount;
|
|
8709
8717
|
break;
|
|
8710
8718
|
}
|
|
8711
8719
|
if (L.dcCompressedSize > 0) {
|
|
8712
8720
|
const K = {
|
|
8713
8721
|
array: l.array,
|
|
8714
|
-
offset:
|
|
8722
|
+
offset: g,
|
|
8715
8723
|
size: L.dcCompressedSize
|
|
8716
8724
|
};
|
|
8717
|
-
W = new Uint16Array(Js(K).buffer),
|
|
8725
|
+
W = new Uint16Array(Js(K).buffer), g.value += L.dcCompressedSize;
|
|
8718
8726
|
}
|
|
8719
8727
|
if (L.rleRawSize > 0) {
|
|
8720
|
-
const K = l.array.slice(
|
|
8721
|
-
V = Qs(Q.buffer),
|
|
8728
|
+
const K = l.array.slice(g.value, g.value + L.rleCompressedSize), Q = Un(K);
|
|
8729
|
+
V = Qs(Q.buffer), g.value += L.rleCompressedSize;
|
|
8722
8730
|
}
|
|
8723
8731
|
let X = 0;
|
|
8724
8732
|
const ee = new Array(F.length);
|
|
@@ -8754,73 +8762,73 @@ class fu extends Co {
|
|
|
8754
8762
|
return new DataView(R.buffer);
|
|
8755
8763
|
}
|
|
8756
8764
|
function os(l, m) {
|
|
8757
|
-
const
|
|
8765
|
+
const g = new Uint8Array(l);
|
|
8758
8766
|
let R = 0;
|
|
8759
|
-
for (;
|
|
8767
|
+
for (; g[m.value + R] != 0; )
|
|
8760
8768
|
R += 1;
|
|
8761
8769
|
const L = new TextDecoder().decode(
|
|
8762
|
-
|
|
8770
|
+
g.slice(m.value, m.value + R)
|
|
8763
8771
|
);
|
|
8764
8772
|
return m.value = m.value + R + 1, L;
|
|
8765
8773
|
}
|
|
8766
|
-
function _a(l, m,
|
|
8774
|
+
function _a(l, m, g) {
|
|
8767
8775
|
const R = new TextDecoder().decode(
|
|
8768
|
-
new Uint8Array(l).slice(m.value, m.value +
|
|
8776
|
+
new Uint8Array(l).slice(m.value, m.value + g)
|
|
8769
8777
|
);
|
|
8770
|
-
return m.value = m.value +
|
|
8778
|
+
return m.value = m.value + g, R;
|
|
8771
8779
|
}
|
|
8772
8780
|
function Sa(l, m) {
|
|
8773
|
-
const
|
|
8774
|
-
return [
|
|
8781
|
+
const g = et(l, m), R = st(l, m);
|
|
8782
|
+
return [g, R];
|
|
8775
8783
|
}
|
|
8776
8784
|
function ba(l, m) {
|
|
8777
|
-
const
|
|
8778
|
-
return [
|
|
8785
|
+
const g = st(l, m), R = st(l, m);
|
|
8786
|
+
return [g, R];
|
|
8779
8787
|
}
|
|
8780
8788
|
function et(l, m) {
|
|
8781
|
-
const
|
|
8782
|
-
return m.value = m.value + 4,
|
|
8789
|
+
const g = l.getInt32(m.value, !0);
|
|
8790
|
+
return m.value = m.value + 4, g;
|
|
8783
8791
|
}
|
|
8784
8792
|
function st(l, m) {
|
|
8785
|
-
const
|
|
8786
|
-
return m.value = m.value + 4,
|
|
8793
|
+
const g = l.getUint32(m.value, !0);
|
|
8794
|
+
return m.value = m.value + 4, g;
|
|
8787
8795
|
}
|
|
8788
8796
|
function Er(l, m) {
|
|
8789
|
-
const
|
|
8790
|
-
return m.value = m.value + 1,
|
|
8797
|
+
const g = l[m.value];
|
|
8798
|
+
return m.value = m.value + 1, g;
|
|
8791
8799
|
}
|
|
8792
8800
|
function zt(l, m) {
|
|
8793
|
-
const
|
|
8794
|
-
return m.value = m.value + 1,
|
|
8801
|
+
const g = l.getUint8(m.value);
|
|
8802
|
+
return m.value = m.value + 1, g;
|
|
8795
8803
|
}
|
|
8796
8804
|
const Fe = function(l, m) {
|
|
8797
|
-
const
|
|
8798
|
-
return m.value += 8,
|
|
8805
|
+
const g = Number(l.getBigInt64(m.value, !0));
|
|
8806
|
+
return m.value += 8, g;
|
|
8799
8807
|
};
|
|
8800
8808
|
function Ke(l, m) {
|
|
8801
|
-
const
|
|
8802
|
-
return m.value += 4,
|
|
8809
|
+
const g = l.getFloat32(m.value, !0);
|
|
8810
|
+
return m.value += 4, g;
|
|
8803
8811
|
}
|
|
8804
8812
|
function xa(l, m) {
|
|
8805
8813
|
return Et.toHalfFloat(Ke(l, m));
|
|
8806
8814
|
}
|
|
8807
8815
|
function J(l) {
|
|
8808
|
-
const m = (l & 31744) >> 10,
|
|
8809
|
-
return (l >> 15 ? -1 : 1) * (m ? m === 31 ?
|
|
8816
|
+
const m = (l & 31744) >> 10, g = l & 1023;
|
|
8817
|
+
return (l >> 15 ? -1 : 1) * (m ? m === 31 ? g ? NaN : 1 / 0 : Math.pow(2, m - 15) * (1 + g / 1024) : 6103515625e-14 * (g / 1024));
|
|
8810
8818
|
}
|
|
8811
|
-
function
|
|
8812
|
-
const
|
|
8813
|
-
return m.value += 2,
|
|
8819
|
+
function Mn(l, m) {
|
|
8820
|
+
const g = l.getUint16(m.value, !0);
|
|
8821
|
+
return m.value += 2, g;
|
|
8814
8822
|
}
|
|
8815
8823
|
function Aa(l, m) {
|
|
8816
|
-
return J(
|
|
8817
|
-
}
|
|
8818
|
-
function va(l, m,
|
|
8819
|
-
const L =
|
|
8820
|
-
for (;
|
|
8821
|
-
const v = os(m,
|
|
8822
|
-
|
|
8823
|
-
const B = et(l,
|
|
8824
|
+
return J(Mn(l, m));
|
|
8825
|
+
}
|
|
8826
|
+
function va(l, m, g, R) {
|
|
8827
|
+
const L = g.value, z = [];
|
|
8828
|
+
for (; g.value < L + R - 1; ) {
|
|
8829
|
+
const v = os(m, g), U = et(l, g), F = zt(l, g);
|
|
8830
|
+
g.value += 3;
|
|
8831
|
+
const B = et(l, g), G = et(l, g);
|
|
8824
8832
|
z.push({
|
|
8825
8833
|
name: v,
|
|
8826
8834
|
pixelType: U,
|
|
@@ -8829,14 +8837,14 @@ class fu extends Co {
|
|
|
8829
8837
|
ySampling: G
|
|
8830
8838
|
});
|
|
8831
8839
|
}
|
|
8832
|
-
return
|
|
8840
|
+
return g.value += 1, z;
|
|
8833
8841
|
}
|
|
8834
8842
|
function Ra(l, m) {
|
|
8835
|
-
const
|
|
8836
|
-
return { redX:
|
|
8843
|
+
const g = Ke(l, m), R = Ke(l, m), L = Ke(l, m), z = Ke(l, m), v = Ke(l, m), U = Ke(l, m), F = Ke(l, m), B = Ke(l, m);
|
|
8844
|
+
return { redX: g, redY: R, greenX: L, greenY: z, blueX: v, blueY: U, whiteX: F, whiteY: B };
|
|
8837
8845
|
}
|
|
8838
8846
|
function Ma(l, m) {
|
|
8839
|
-
const
|
|
8847
|
+
const g = [
|
|
8840
8848
|
"NO_COMPRESSION",
|
|
8841
8849
|
"RLE_COMPRESSION",
|
|
8842
8850
|
"ZIPS_COMPRESSION",
|
|
@@ -8848,29 +8856,29 @@ class fu extends Co {
|
|
|
8848
8856
|
"DWAA_COMPRESSION",
|
|
8849
8857
|
"DWAB_COMPRESSION"
|
|
8850
8858
|
], R = zt(l, m);
|
|
8851
|
-
return
|
|
8859
|
+
return g[R];
|
|
8852
8860
|
}
|
|
8853
8861
|
function Ia(l, m) {
|
|
8854
|
-
const
|
|
8855
|
-
return { xMin:
|
|
8862
|
+
const g = et(l, m), R = et(l, m), L = et(l, m), z = et(l, m);
|
|
8863
|
+
return { xMin: g, yMin: R, xMax: L, yMax: z };
|
|
8856
8864
|
}
|
|
8857
8865
|
function Ca(l, m) {
|
|
8858
|
-
const
|
|
8866
|
+
const g = [
|
|
8859
8867
|
"INCREASING_Y",
|
|
8860
8868
|
"DECREASING_Y",
|
|
8861
8869
|
"RANDOM_Y"
|
|
8862
8870
|
], R = zt(l, m);
|
|
8863
|
-
return
|
|
8871
|
+
return g[R];
|
|
8864
8872
|
}
|
|
8865
8873
|
function Pa(l, m) {
|
|
8866
|
-
const
|
|
8874
|
+
const g = [
|
|
8867
8875
|
"ENVMAP_LATLONG",
|
|
8868
8876
|
"ENVMAP_CUBE"
|
|
8869
8877
|
], R = zt(l, m);
|
|
8870
|
-
return
|
|
8878
|
+
return g[R];
|
|
8871
8879
|
}
|
|
8872
8880
|
function La(l, m) {
|
|
8873
|
-
const
|
|
8881
|
+
const g = [
|
|
8874
8882
|
"ONE_LEVEL",
|
|
8875
8883
|
"MIPMAP_LEVELS",
|
|
8876
8884
|
"RIPMAP_LEVELS"
|
|
@@ -8881,82 +8889,82 @@ class fu extends Co {
|
|
|
8881
8889
|
return {
|
|
8882
8890
|
xSize: L,
|
|
8883
8891
|
ySize: z,
|
|
8884
|
-
levelMode:
|
|
8892
|
+
levelMode: g[v & 15],
|
|
8885
8893
|
roundingMode: R[v >> 4]
|
|
8886
8894
|
};
|
|
8887
8895
|
}
|
|
8888
8896
|
function Oa(l, m) {
|
|
8889
|
-
const
|
|
8890
|
-
return [
|
|
8897
|
+
const g = Ke(l, m), R = Ke(l, m);
|
|
8898
|
+
return [g, R];
|
|
8891
8899
|
}
|
|
8892
8900
|
function Da(l, m) {
|
|
8893
|
-
const
|
|
8894
|
-
return [
|
|
8901
|
+
const g = Ke(l, m), R = Ke(l, m), L = Ke(l, m);
|
|
8902
|
+
return [g, R, L];
|
|
8895
8903
|
}
|
|
8896
|
-
function Na(l, m,
|
|
8904
|
+
function Na(l, m, g, R, L) {
|
|
8897
8905
|
if (R === "string" || R === "stringvector" || R === "iccProfile")
|
|
8898
|
-
return _a(m,
|
|
8906
|
+
return _a(m, g, L);
|
|
8899
8907
|
if (R === "chlist")
|
|
8900
|
-
return va(l, m,
|
|
8908
|
+
return va(l, m, g, L);
|
|
8901
8909
|
if (R === "chromaticities")
|
|
8902
|
-
return Ra(l,
|
|
8910
|
+
return Ra(l, g);
|
|
8903
8911
|
if (R === "compression")
|
|
8904
|
-
return Ma(l,
|
|
8912
|
+
return Ma(l, g);
|
|
8905
8913
|
if (R === "box2i")
|
|
8906
|
-
return Ia(l,
|
|
8914
|
+
return Ia(l, g);
|
|
8907
8915
|
if (R === "envmap")
|
|
8908
|
-
return Pa(l,
|
|
8916
|
+
return Pa(l, g);
|
|
8909
8917
|
if (R === "tiledesc")
|
|
8910
|
-
return La(l,
|
|
8918
|
+
return La(l, g);
|
|
8911
8919
|
if (R === "lineOrder")
|
|
8912
|
-
return Ca(l,
|
|
8920
|
+
return Ca(l, g);
|
|
8913
8921
|
if (R === "float")
|
|
8914
|
-
return Ke(l,
|
|
8922
|
+
return Ke(l, g);
|
|
8915
8923
|
if (R === "v2f")
|
|
8916
|
-
return Oa(l,
|
|
8924
|
+
return Oa(l, g);
|
|
8917
8925
|
if (R === "v3f")
|
|
8918
|
-
return Da(l,
|
|
8926
|
+
return Da(l, g);
|
|
8919
8927
|
if (R === "int")
|
|
8920
|
-
return et(l,
|
|
8928
|
+
return et(l, g);
|
|
8921
8929
|
if (R === "rational")
|
|
8922
|
-
return Sa(l,
|
|
8930
|
+
return Sa(l, g);
|
|
8923
8931
|
if (R === "timecode")
|
|
8924
|
-
return ba(l,
|
|
8932
|
+
return ba(l, g);
|
|
8925
8933
|
if (R === "preview" || R === "deepImageState" || R === "idmanifest")
|
|
8926
|
-
return
|
|
8927
|
-
|
|
8934
|
+
return g.value += L, "skipped";
|
|
8935
|
+
g.value += L;
|
|
8928
8936
|
}
|
|
8929
8937
|
function ka(l, m) {
|
|
8930
|
-
const
|
|
8931
|
-
return m == "ROUND_DOWN" ? Math.floor(
|
|
8938
|
+
const g = Math.log2(l);
|
|
8939
|
+
return m == "ROUND_DOWN" ? Math.floor(g) : Math.ceil(g);
|
|
8932
8940
|
}
|
|
8933
|
-
function Fa(l, m,
|
|
8941
|
+
function Fa(l, m, g) {
|
|
8934
8942
|
let R = 0;
|
|
8935
8943
|
switch (l.levelMode) {
|
|
8936
8944
|
case "ONE_LEVEL":
|
|
8937
8945
|
R = 1;
|
|
8938
8946
|
break;
|
|
8939
8947
|
case "MIPMAP_LEVELS":
|
|
8940
|
-
R = ka(Math.max(m,
|
|
8948
|
+
R = ka(Math.max(m, g), l.roundingMode) + 1;
|
|
8941
8949
|
break;
|
|
8942
8950
|
case "RIPMAP_LEVELS":
|
|
8943
8951
|
throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.");
|
|
8944
8952
|
}
|
|
8945
8953
|
return R;
|
|
8946
8954
|
}
|
|
8947
|
-
function Tr(l, m,
|
|
8955
|
+
function Tr(l, m, g, R) {
|
|
8948
8956
|
const L = new Array(l);
|
|
8949
8957
|
for (let z = 0; z < l; z++) {
|
|
8950
8958
|
const v = 1 << z;
|
|
8951
8959
|
let U = m / v | 0;
|
|
8952
8960
|
R == "ROUND_UP" && U * v < m && (U += 1);
|
|
8953
8961
|
const F = Math.max(U, 1);
|
|
8954
|
-
L[z] = (F +
|
|
8962
|
+
L[z] = (F + g - 1) / g | 0;
|
|
8955
8963
|
}
|
|
8956
8964
|
return L;
|
|
8957
8965
|
}
|
|
8958
8966
|
function za() {
|
|
8959
|
-
const l = this, m = l.offset,
|
|
8967
|
+
const l = this, m = l.offset, g = { value: 0 };
|
|
8960
8968
|
for (let R = 0; R < l.tileCount; R++) {
|
|
8961
8969
|
const L = et(l.viewer, m), z = et(l.viewer, m);
|
|
8962
8970
|
m.value += 8, l.size = st(l.viewer, m);
|
|
@@ -8969,18 +8977,18 @@ class fu extends Co {
|
|
|
8969
8977
|
for (let X = 0; X < l.inputChannels.length; X++) {
|
|
8970
8978
|
const ee = Xe.channels[X].name, K = l.channelByteOffsets[ee] * l.columns, Q = l.decodeChannels[ee];
|
|
8971
8979
|
if (Q === void 0) continue;
|
|
8972
|
-
|
|
8980
|
+
g.value = V + K;
|
|
8973
8981
|
const re = (l.height - (1 + U + W)) * l.outLineWidth;
|
|
8974
8982
|
for (let le = 0; le < l.columns; le++) {
|
|
8975
8983
|
const oe = re + (le + v) * l.outputChannels + Q;
|
|
8976
|
-
l.byteArray[oe] = l.getter(G,
|
|
8984
|
+
l.byteArray[oe] = l.getter(G, g);
|
|
8977
8985
|
}
|
|
8978
8986
|
}
|
|
8979
8987
|
}
|
|
8980
8988
|
}
|
|
8981
8989
|
}
|
|
8982
8990
|
function Ba() {
|
|
8983
|
-
const l = this, m = l.offset,
|
|
8991
|
+
const l = this, m = l.offset, g = { value: 0 };
|
|
8984
8992
|
for (let R = 0; R < l.height / l.blockHeight; R++) {
|
|
8985
8993
|
const L = et(l.viewer, m) - Xe.dataWindow.yMin;
|
|
8986
8994
|
l.size = st(l.viewer, m), l.lines = L + l.blockHeight > l.height ? l.height - L : l.blockHeight;
|
|
@@ -8991,10 +8999,10 @@ class fu extends Co {
|
|
|
8991
8999
|
for (let V = 0; V < l.inputChannels.length; V++) {
|
|
8992
9000
|
const X = Xe.channels[V].name, ee = l.channelByteOffsets[X] * l.columns, K = l.decodeChannels[X];
|
|
8993
9001
|
if (K !== void 0) {
|
|
8994
|
-
|
|
9002
|
+
g.value = G + ee;
|
|
8995
9003
|
for (let Q = 0; Q < l.columns; Q++) {
|
|
8996
9004
|
const re = W + Q * l.outputChannels + K;
|
|
8997
|
-
l.byteArray[re] = l.getter(U,
|
|
9005
|
+
l.byteArray[re] = l.getter(U, g);
|
|
8998
9006
|
}
|
|
8999
9007
|
}
|
|
9000
9008
|
}
|
|
@@ -9002,7 +9010,7 @@ class fu extends Co {
|
|
|
9002
9010
|
}
|
|
9003
9011
|
}
|
|
9004
9012
|
function Ua() {
|
|
9005
|
-
const l = this, m = l.chunkOffsets,
|
|
9013
|
+
const l = this, m = l.chunkOffsets, g = { value: 0 };
|
|
9006
9014
|
for (let R = 0; R < m.length; R++) {
|
|
9007
9015
|
const L = { value: m[R] };
|
|
9008
9016
|
L.value += 4;
|
|
@@ -9017,19 +9025,19 @@ class fu extends Co {
|
|
|
9017
9025
|
for (let ee = 0; ee < l.inputChannels.length; ee++) {
|
|
9018
9026
|
const K = Xe.channels[ee].name, Q = l.channelByteOffsets[K] * l.columns, re = l.decodeChannels[K];
|
|
9019
9027
|
if (re !== void 0) {
|
|
9020
|
-
|
|
9028
|
+
g.value = V + Q;
|
|
9021
9029
|
for (let le = 0; le < l.columns; le++) {
|
|
9022
9030
|
const oe = X + le * l.outputChannels + re;
|
|
9023
|
-
l.byteArray[oe] = l.getter(B,
|
|
9031
|
+
l.byteArray[oe] = l.getter(B, g);
|
|
9024
9032
|
}
|
|
9025
9033
|
}
|
|
9026
9034
|
}
|
|
9027
9035
|
}
|
|
9028
9036
|
}
|
|
9029
9037
|
}
|
|
9030
|
-
function _r(l, m,
|
|
9031
|
-
if (
|
|
9032
|
-
const L = l.slice(m, m +
|
|
9038
|
+
function _r(l, m, g, R) {
|
|
9039
|
+
if (g === 0) return null;
|
|
9040
|
+
const L = l.slice(m, m + g);
|
|
9033
9041
|
switch (R) {
|
|
9034
9042
|
case "NO_COMPRESSION":
|
|
9035
9043
|
return new DataView(L.buffer, L.byteOffset, L.byteLength);
|
|
@@ -9038,7 +9046,7 @@ class fu extends Co {
|
|
|
9038
9046
|
return ss(z), is(z, v), new DataView(v.buffer);
|
|
9039
9047
|
}
|
|
9040
9048
|
case "ZIPS_COMPRESSION": {
|
|
9041
|
-
const z =
|
|
9049
|
+
const z = Un(L), v = new Uint8Array(z.length);
|
|
9042
9050
|
return ss(z), is(z, v), new DataView(v.buffer);
|
|
9043
9051
|
}
|
|
9044
9052
|
default:
|
|
@@ -9046,7 +9054,7 @@ class fu extends Co {
|
|
|
9046
9054
|
}
|
|
9047
9055
|
}
|
|
9048
9056
|
function Ha() {
|
|
9049
|
-
const l = this, m = l.chunkOffsets,
|
|
9057
|
+
const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, z = Xe.compression, v = l.multiPart, U = l.decodeChannels, F = l.outputChannels, B = l.byteArray instanceof Uint16Array;
|
|
9050
9058
|
let G = -1;
|
|
9051
9059
|
for (let W = 0; W < L.length; W++)
|
|
9052
9060
|
if (L[W].name === "A") {
|
|
@@ -9060,10 +9068,10 @@ class fu extends Co {
|
|
|
9060
9068
|
Fe(l.viewer, V);
|
|
9061
9069
|
const Q = _r(l.array, V.value, ee, z);
|
|
9062
9070
|
if (V.value += ee, Q === null) continue;
|
|
9063
|
-
const re = new Uint32Array(
|
|
9064
|
-
for (let se = 0; se <
|
|
9071
|
+
const re = new Uint32Array(g);
|
|
9072
|
+
for (let se = 0; se < g; se++)
|
|
9065
9073
|
re[se] = Q.getUint32(se * 4, !0);
|
|
9066
|
-
const le = re[
|
|
9074
|
+
const le = re[g - 1];
|
|
9067
9075
|
if (le === 0) {
|
|
9068
9076
|
V.value += K;
|
|
9069
9077
|
continue;
|
|
@@ -9073,7 +9081,7 @@ class fu extends Co {
|
|
|
9073
9081
|
for (let se = 0; se < L.length; se++)
|
|
9074
9082
|
ue.push(ne), ne += le * L[se].bytesPerSample;
|
|
9075
9083
|
const te = (R - 1 - X) * l.outLineWidth;
|
|
9076
|
-
for (let se = 0; se <
|
|
9084
|
+
for (let se = 0; se < g; se++) {
|
|
9077
9085
|
const ye = se === 0 ? 0 : re[se - 1], ae = re[se] - ye;
|
|
9078
9086
|
if (ae === 0) continue;
|
|
9079
9087
|
const he = new Float32Array(F);
|
|
@@ -9081,18 +9089,18 @@ class fu extends Co {
|
|
|
9081
9089
|
for (let _e = 0; _e < ae; _e++) {
|
|
9082
9090
|
const bt = ye + _e, on = 1 - Ie;
|
|
9083
9091
|
if (on <= 0) break;
|
|
9084
|
-
let
|
|
9092
|
+
let In = 1;
|
|
9085
9093
|
if (G >= 0) {
|
|
9086
9094
|
const xt = L[G].bytesPerSample, Xt = ue[G] + bt * xt;
|
|
9087
|
-
|
|
9095
|
+
In = xt === 2 ? J(oe.getUint16(Xt, !0)) : oe.getFloat32(Xt, !0);
|
|
9088
9096
|
}
|
|
9089
9097
|
for (let xt = 0; xt < L.length; xt++) {
|
|
9090
9098
|
const Xt = L[xt], hs = U[Xt.name];
|
|
9091
9099
|
if (hs === void 0) continue;
|
|
9092
|
-
const us = Xt.bytesPerSample, ds = ue[xt] + bt * us,
|
|
9093
|
-
he[hs] +=
|
|
9100
|
+
const us = Xt.bytesPerSample, ds = ue[xt] + bt * us, Cn = us === 2 ? J(oe.getUint16(ds, !0)) : oe.getFloat32(ds, !0);
|
|
9101
|
+
he[hs] += Cn * on;
|
|
9094
9102
|
}
|
|
9095
|
-
Ie +=
|
|
9103
|
+
Ie += In * on;
|
|
9096
9104
|
}
|
|
9097
9105
|
U.A !== void 0 && (he[U.A] = Ie);
|
|
9098
9106
|
const it = te + se * F;
|
|
@@ -9101,19 +9109,19 @@ class fu extends Co {
|
|
|
9101
9109
|
}
|
|
9102
9110
|
}
|
|
9103
9111
|
}
|
|
9104
|
-
function Sr(l, m,
|
|
9112
|
+
function Sr(l, m, g) {
|
|
9105
9113
|
const R = {};
|
|
9106
9114
|
let L = !1;
|
|
9107
9115
|
for (; ; ) {
|
|
9108
|
-
const z = os(m,
|
|
9116
|
+
const z = os(m, g);
|
|
9109
9117
|
if (z === "") break;
|
|
9110
9118
|
L = !0;
|
|
9111
|
-
const v = os(m,
|
|
9119
|
+
const v = os(m, g), U = st(l, g), F = Na(l, m, g, v, U);
|
|
9112
9120
|
F === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${v}'.`) : R[z] = F;
|
|
9113
9121
|
}
|
|
9114
9122
|
return L ? R : null;
|
|
9115
9123
|
}
|
|
9116
|
-
function Ga(l, m,
|
|
9124
|
+
function Ga(l, m, g) {
|
|
9117
9125
|
if (l.getUint32(0, !0) != 20000630)
|
|
9118
9126
|
throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");
|
|
9119
9127
|
const R = l.getUint8(4), L = l.getUint8(5), z = {
|
|
@@ -9122,27 +9130,27 @@ class fu extends Co {
|
|
|
9122
9130
|
deepFormat: !!(L & 8),
|
|
9123
9131
|
multiPart: !!(L & 16)
|
|
9124
9132
|
};
|
|
9125
|
-
|
|
9133
|
+
g.value = 8;
|
|
9126
9134
|
const v = [];
|
|
9127
9135
|
if (z.multiPart) {
|
|
9128
9136
|
for (; ; ) {
|
|
9129
|
-
const U = Sr(l, m,
|
|
9137
|
+
const U = Sr(l, m, g);
|
|
9130
9138
|
if (U === null) break;
|
|
9131
9139
|
U.version = R, U.spec = z, v.push(U);
|
|
9132
9140
|
}
|
|
9133
9141
|
if (v.length === 0)
|
|
9134
9142
|
throw new Error("THREE.EXRLoader: No valid part headers found.");
|
|
9135
9143
|
} else {
|
|
9136
|
-
const U = Sr(l, m,
|
|
9144
|
+
const U = Sr(l, m, g);
|
|
9137
9145
|
U.version = R, U.spec = z, v.push(U);
|
|
9138
9146
|
}
|
|
9139
9147
|
return v;
|
|
9140
9148
|
}
|
|
9141
|
-
function ja(l, m,
|
|
9149
|
+
function ja(l, m, g, R, L, z) {
|
|
9142
9150
|
const v = {
|
|
9143
9151
|
size: 0,
|
|
9144
9152
|
viewer: m,
|
|
9145
|
-
array:
|
|
9153
|
+
array: g,
|
|
9146
9154
|
offset: R,
|
|
9147
9155
|
width: l.dataWindow.xMax - l.dataWindow.xMin + 1,
|
|
9148
9156
|
height: l.dataWindow.yMax - l.dataWindow.yMin + 1,
|
|
@@ -9214,10 +9222,10 @@ class fu extends Co {
|
|
|
9214
9222
|
throw new Error("THREE.EXRLoader: file contains unsupported data channels.");
|
|
9215
9223
|
switch (v.outputChannels) {
|
|
9216
9224
|
case 4:
|
|
9217
|
-
z == Yt ? (F = !U.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z ==
|
|
9225
|
+
z == Yt ? (F = !U.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == Pn ? (v.format = Pn, v.colorSpace = je, v.outputChannels = 2, v.decodeChannels = { R: 0, G: 1 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { R: 0 }) : B = !0;
|
|
9218
9226
|
break;
|
|
9219
9227
|
case 1:
|
|
9220
|
-
z == Yt ? (F = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z ==
|
|
9228
|
+
z == Yt ? (F = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == Pn ? (v.format = Pn, v.colorSpace = je, v.outputChannels = 2, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { Y: 0 }) : B = !0;
|
|
9221
9229
|
break;
|
|
9222
9230
|
default:
|
|
9223
9231
|
B = !0;
|
|
@@ -9225,16 +9233,16 @@ class fu extends Co {
|
|
|
9225
9233
|
if (B) throw new Error("THREE.EXRLoader: invalid output format for specified file.");
|
|
9226
9234
|
if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 }, F = !0), v.type == 1)
|
|
9227
9235
|
switch (L) {
|
|
9228
|
-
case
|
|
9236
|
+
case Zn:
|
|
9229
9237
|
v.getter = Aa;
|
|
9230
9238
|
break;
|
|
9231
9239
|
case Vt:
|
|
9232
|
-
v.getter =
|
|
9240
|
+
v.getter = Mn;
|
|
9233
9241
|
break;
|
|
9234
9242
|
}
|
|
9235
9243
|
else if (v.type == 2)
|
|
9236
9244
|
switch (L) {
|
|
9237
|
-
case
|
|
9245
|
+
case Zn:
|
|
9238
9246
|
v.getter = Ke;
|
|
9239
9247
|
break;
|
|
9240
9248
|
case Vt:
|
|
@@ -9245,7 +9253,7 @@ class fu extends Co {
|
|
|
9245
9253
|
v.columns = v.width;
|
|
9246
9254
|
const G = v.width * v.height * v.outputChannels;
|
|
9247
9255
|
switch (L) {
|
|
9248
|
-
case
|
|
9256
|
+
case Zn:
|
|
9249
9257
|
v.byteArray = new Float32Array(G), F && v.byteArray.fill(1, 0, G);
|
|
9250
9258
|
break;
|
|
9251
9259
|
case Vt:
|
|
@@ -9296,42 +9304,42 @@ class fu extends Co {
|
|
|
9296
9304
|
const m = ls[l].chunkCount;
|
|
9297
9305
|
if (l === br) {
|
|
9298
9306
|
Xe._chunkOffsets = [];
|
|
9299
|
-
for (let
|
|
9307
|
+
for (let g = 0; g < m; g++)
|
|
9300
9308
|
Xe._chunkOffsets.push(Fe(cs, as));
|
|
9301
9309
|
} else
|
|
9302
|
-
for (let
|
|
9310
|
+
for (let g = 0; g < m; g++)
|
|
9303
9311
|
Fe(cs, as);
|
|
9304
9312
|
}
|
|
9305
|
-
const
|
|
9306
|
-
if (
|
|
9307
|
-
const l =
|
|
9313
|
+
const ot = ja(Xe, cs, Va, as, this.type, this.outputFormat);
|
|
9314
|
+
if (ot.decode(), ot.shouldExpand) {
|
|
9315
|
+
const l = ot.byteArray;
|
|
9308
9316
|
if (this.outputFormat == Yt)
|
|
9309
9317
|
for (let m = 0; m < l.length; m += 4)
|
|
9310
9318
|
l[m + 2] = l[m + 1] = l[m];
|
|
9311
|
-
else if (this.outputFormat ==
|
|
9319
|
+
else if (this.outputFormat == Pn)
|
|
9312
9320
|
for (let m = 0; m < l.length; m += 2)
|
|
9313
9321
|
l[m + 1] = l[m];
|
|
9314
9322
|
}
|
|
9315
|
-
if (
|
|
9316
|
-
const l =
|
|
9323
|
+
if (ot.yCbCr) {
|
|
9324
|
+
const l = ot.byteArray, m = ot.width * ot.height;
|
|
9317
9325
|
if (this.type === Vt)
|
|
9318
|
-
for (let
|
|
9319
|
-
const R =
|
|
9326
|
+
for (let g = 0; g < m; g++) {
|
|
9327
|
+
const R = g * 4, L = J(l[R]), z = J(l[R + 1]), v = J(l[R + 2]), U = (1 + z) * L, F = (1 + v) * L, B = (L - U * 0.2126 - F * 0.0722) / 0.7152;
|
|
9320
9328
|
l[R] = Et.toHalfFloat(Math.max(0, U)), l[R + 1] = Et.toHalfFloat(Math.max(0, B)), l[R + 2] = Et.toHalfFloat(Math.max(0, F));
|
|
9321
9329
|
}
|
|
9322
9330
|
else
|
|
9323
|
-
for (let
|
|
9324
|
-
const R =
|
|
9331
|
+
for (let g = 0; g < m; g++) {
|
|
9332
|
+
const R = g * 4, L = l[R], z = l[R + 1], v = l[R + 2], U = (1 + z) * L, F = (1 + v) * L;
|
|
9325
9333
|
l[R] = Math.max(0, U), l[R + 1] = Math.max(0, (L - U * 0.2126 - F * 0.0722) / 0.7152), l[R + 2] = Math.max(0, F);
|
|
9326
9334
|
}
|
|
9327
9335
|
}
|
|
9328
9336
|
return {
|
|
9329
9337
|
header: Xe,
|
|
9330
|
-
width:
|
|
9331
|
-
height:
|
|
9332
|
-
data:
|
|
9333
|
-
format:
|
|
9334
|
-
colorSpace:
|
|
9338
|
+
width: ot.width,
|
|
9339
|
+
height: ot.height,
|
|
9340
|
+
data: ot.byteArray,
|
|
9341
|
+
format: ot.format,
|
|
9342
|
+
colorSpace: ot.colorSpace,
|
|
9335
9343
|
type: this.type,
|
|
9336
9344
|
minFilter: nn,
|
|
9337
9345
|
magFilter: nn,
|
|
@@ -9469,29 +9477,29 @@ class pu extends Co {
|
|
|
9469
9477
|
dt--;
|
|
9470
9478
|
}
|
|
9471
9479
|
return D;
|
|
9472
|
-
},
|
|
9480
|
+
}, y = function(M, O, C, N) {
|
|
9473
9481
|
const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
|
|
9474
9482
|
C[N + 0] = M[O + 0] * H, C[N + 1] = M[O + 1] * H, C[N + 2] = M[O + 2] * H, C[N + 3] = 1;
|
|
9475
|
-
},
|
|
9483
|
+
}, S = function(M, O, C, N) {
|
|
9476
9484
|
const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
|
|
9477
9485
|
C[N + 0] = Et.toHalfFloat(Math.min(M[O + 0] * H, 65504)), C[N + 1] = Et.toHalfFloat(Math.min(M[O + 1] * H, 65504)), C[N + 2] = Et.toHalfFloat(Math.min(M[O + 2] * H, 65504)), C[N + 3] = Et.toHalfFloat(1);
|
|
9478
9486
|
}, _ = new Uint8Array(e);
|
|
9479
9487
|
_.pos = 0;
|
|
9480
|
-
const
|
|
9488
|
+
const x = f(_), E = x.width, b = x.height, T = p(_.subarray(_.pos), E, b);
|
|
9481
9489
|
let A, P, I;
|
|
9482
9490
|
switch (this.type) {
|
|
9483
|
-
case
|
|
9491
|
+
case Zn:
|
|
9484
9492
|
I = T.length / 4;
|
|
9485
9493
|
const M = new Float32Array(I * 4);
|
|
9486
9494
|
for (let C = 0; C < I; C++)
|
|
9487
|
-
|
|
9488
|
-
A = M, P =
|
|
9495
|
+
y(T, C * 4, M, C * 4);
|
|
9496
|
+
A = M, P = Zn;
|
|
9489
9497
|
break;
|
|
9490
9498
|
case Vt:
|
|
9491
9499
|
I = T.length / 4;
|
|
9492
9500
|
const O = new Uint16Array(I * 4);
|
|
9493
9501
|
for (let C = 0; C < I; C++)
|
|
9494
|
-
|
|
9502
|
+
S(T, C * 4, O, C * 4);
|
|
9495
9503
|
A = O, P = Vt;
|
|
9496
9504
|
break;
|
|
9497
9505
|
default:
|
|
@@ -9499,11 +9507,11 @@ class pu extends Co {
|
|
|
9499
9507
|
}
|
|
9500
9508
|
return {
|
|
9501
9509
|
width: E,
|
|
9502
|
-
height:
|
|
9510
|
+
height: b,
|
|
9503
9511
|
data: A,
|
|
9504
|
-
header:
|
|
9505
|
-
gamma:
|
|
9506
|
-
exposure:
|
|
9512
|
+
header: x.string,
|
|
9513
|
+
gamma: x.gamma,
|
|
9514
|
+
exposure: x.exposure,
|
|
9507
9515
|
type: P,
|
|
9508
9516
|
colorSpace: je,
|
|
9509
9517
|
minFilter: nn,
|
|
@@ -10022,7 +10030,7 @@ class Ru {
|
|
|
10022
10030
|
* Create a ViewerCore instance with Three.js implementations
|
|
10023
10031
|
*/
|
|
10024
10032
|
static createViewer(e, t) {
|
|
10025
|
-
var E,
|
|
10033
|
+
var E, b, T;
|
|
10026
10034
|
Po(t.units);
|
|
10027
10035
|
const n = new Gl(e), s = new Lt(), r = this.createCamera(t), o = this.createControls(
|
|
10028
10036
|
r.getThreeCamera(),
|
|
@@ -10034,12 +10042,12 @@ class Ru {
|
|
|
10034
10042
|
...t.loaders
|
|
10035
10043
|
}), c = new qh(), u = new yu();
|
|
10036
10044
|
let d;
|
|
10037
|
-
(((
|
|
10038
|
-
const f = new Eu(), p = new Tu(),
|
|
10045
|
+
(((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (d = new $h());
|
|
10046
|
+
const f = new Eu(), p = new Tu(), y = new bu(), S = new xu(), _ = vu.convertRendererOptions(
|
|
10039
10047
|
t.renderer || {}
|
|
10040
10048
|
);
|
|
10041
10049
|
(t.replaceWithScreenshotOnComplete || (T = t.pathTracing) != null && T.enabled) && (_.preserveDrawingBuffer = !0);
|
|
10042
|
-
const
|
|
10050
|
+
const x = {
|
|
10043
10051
|
renderer: n,
|
|
10044
10052
|
scene: s,
|
|
10045
10053
|
camera: r,
|
|
@@ -10052,10 +10060,10 @@ class Ru {
|
|
|
10052
10060
|
pathTracingService: d,
|
|
10053
10061
|
floorAlignmentService: f,
|
|
10054
10062
|
selectionService: p,
|
|
10055
|
-
anchorProjectionService:
|
|
10056
|
-
animationService:
|
|
10063
|
+
anchorProjectionService: y,
|
|
10064
|
+
animationService: S
|
|
10057
10065
|
};
|
|
10058
|
-
return new Fc(
|
|
10066
|
+
return new Fc(x);
|
|
10059
10067
|
}
|
|
10060
10068
|
static createCamera(e) {
|
|
10061
10069
|
const n = e.camera || {}, s = n.fov || n.cameraFov || 75, r = n.near || n.cameraNear || 0.1, o = n.far || n.cameraFar || 1e5, a = n.position || n.cameraPosition, c = n.target || n.cameraTarget, u = lr.create(
|
|
@@ -10347,59 +10355,83 @@ function Ou(i) {
|
|
|
10347
10355
|
}, [i.preset, i.backgroundColor, i.renderer, i.environment, i.controls, i.animations]);
|
|
10348
10356
|
return { options: Dt(() => i, [e, t]), structuralKey: e, runtimeKey: t };
|
|
10349
10357
|
}
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10358
|
+
const Du = "200px";
|
|
10359
|
+
function Nu(i, e) {
|
|
10360
|
+
const [t, n] = An(!e);
|
|
10361
|
+
return rt(() => {
|
|
10362
|
+
if (t)
|
|
10363
|
+
return;
|
|
10364
|
+
if (!e) {
|
|
10365
|
+
n(!0);
|
|
10366
|
+
return;
|
|
10367
|
+
}
|
|
10368
|
+
const s = i.current;
|
|
10369
|
+
if (!s || typeof IntersectionObserver > "u") {
|
|
10370
|
+
n(!0);
|
|
10371
|
+
return;
|
|
10372
|
+
}
|
|
10373
|
+
const r = new IntersectionObserver(
|
|
10374
|
+
(o) => {
|
|
10375
|
+
o.some((a) => a.isIntersecting) && n(!0);
|
|
10376
|
+
},
|
|
10377
|
+
{ rootMargin: Du }
|
|
10378
|
+
);
|
|
10379
|
+
return r.observe(s), () => r.disconnect();
|
|
10380
|
+
}, [i, e, t]), t;
|
|
10381
|
+
}
|
|
10382
|
+
function ku(i, e) {
|
|
10383
|
+
const t = Ve(null), [n, s] = An(!1), [r, o] = An(null), { options: a, structuralKey: c, runtimeKey: u } = Ou(e), d = Nu(i, (e.loading ?? "eager") === "lazy");
|
|
10384
|
+
rt(() => {
|
|
10385
|
+
if (!d || !i.current || t.current)
|
|
10354
10386
|
return;
|
|
10355
10387
|
o(null);
|
|
10356
|
-
const
|
|
10357
|
-
let
|
|
10388
|
+
const f = Ki(Zi, a);
|
|
10389
|
+
let p;
|
|
10358
10390
|
try {
|
|
10359
|
-
|
|
10360
|
-
} catch (
|
|
10361
|
-
console.error("Failed to create viewer:",
|
|
10391
|
+
p = Ru.createViewer(i.current, f);
|
|
10392
|
+
} catch (S) {
|
|
10393
|
+
console.error("Failed to create viewer:", S), o(S instanceof Error ? S : new Error(String(S)));
|
|
10362
10394
|
return;
|
|
10363
10395
|
}
|
|
10364
|
-
t.current =
|
|
10365
|
-
let
|
|
10366
|
-
return
|
|
10367
|
-
|
|
10396
|
+
t.current = p;
|
|
10397
|
+
let y = !1;
|
|
10398
|
+
return p.initialize().then((S) => {
|
|
10399
|
+
y || (S.ok ? s(!0) : (console.error("Failed to initialize viewer:", S.error), o(S.error)));
|
|
10368
10400
|
}), () => {
|
|
10369
|
-
|
|
10401
|
+
y = !0, p.dispose(), t.current = null, s(!1);
|
|
10370
10402
|
};
|
|
10371
|
-
}, [i, c]),
|
|
10403
|
+
}, [i, c, d]), rt(() => {
|
|
10372
10404
|
if (!t.current || !n)
|
|
10373
10405
|
return;
|
|
10374
|
-
const
|
|
10375
|
-
t.current.updateOptions(na(
|
|
10406
|
+
const f = Ki(Zi, a);
|
|
10407
|
+
t.current.updateOptions(na(f));
|
|
10376
10408
|
}, [u, n]);
|
|
10377
|
-
const
|
|
10378
|
-
return
|
|
10409
|
+
const h = Ve({ width: 0, height: 0 });
|
|
10410
|
+
return rt(() => {
|
|
10379
10411
|
if (!t.current || !i.current)
|
|
10380
10412
|
return;
|
|
10381
|
-
let
|
|
10382
|
-
const
|
|
10413
|
+
let f = null;
|
|
10414
|
+
const p = (_) => {
|
|
10383
10415
|
if (i.current && t.current) {
|
|
10384
|
-
const
|
|
10385
|
-
let { clientWidth:
|
|
10386
|
-
if (
|
|
10387
|
-
const { width:
|
|
10388
|
-
|
|
10416
|
+
const x = i.current.parentElement || i.current;
|
|
10417
|
+
let { clientWidth: E, clientHeight: b } = x;
|
|
10418
|
+
if (_ && _[0]) {
|
|
10419
|
+
const { width: T, height: A } = _[0].contentRect;
|
|
10420
|
+
E = Math.floor(T), b = Math.floor(A);
|
|
10389
10421
|
}
|
|
10390
|
-
if (
|
|
10422
|
+
if (h.current.width === E && h.current.height === b)
|
|
10391
10423
|
return;
|
|
10392
|
-
|
|
10393
|
-
t.current && i.current && (t.current.resize(
|
|
10424
|
+
f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
10425
|
+
t.current && i.current && (t.current.resize(E, b), h.current = { width: E, height: b });
|
|
10394
10426
|
});
|
|
10395
10427
|
}
|
|
10396
10428
|
};
|
|
10397
|
-
|
|
10398
|
-
const
|
|
10399
|
-
window.addEventListener("resize",
|
|
10400
|
-
let
|
|
10401
|
-
return typeof ResizeObserver < "u" && i.current.parentElement && (
|
|
10402
|
-
window.removeEventListener("resize",
|
|
10429
|
+
p();
|
|
10430
|
+
const y = () => p();
|
|
10431
|
+
window.addEventListener("resize", y);
|
|
10432
|
+
let S = null;
|
|
10433
|
+
return typeof ResizeObserver < "u" && i.current.parentElement && (S = new ResizeObserver(p), S.observe(i.current.parentElement)), () => {
|
|
10434
|
+
window.removeEventListener("resize", y), S == null || S.disconnect(), f !== null && cancelAnimationFrame(f);
|
|
10403
10435
|
};
|
|
10404
10436
|
}, [n, i]), {
|
|
10405
10437
|
viewer: t.current,
|
|
@@ -10410,7 +10442,7 @@ function Du(i, e) {
|
|
|
10410
10442
|
}
|
|
10411
10443
|
function ia(i, e) {
|
|
10412
10444
|
const t = Ve(e);
|
|
10413
|
-
t.current = e,
|
|
10445
|
+
t.current = e, rt(() => {
|
|
10414
10446
|
if (!i)
|
|
10415
10447
|
return;
|
|
10416
10448
|
const n = i.getEvents(), s = [], r = (o) => {
|
|
@@ -10427,9 +10459,9 @@ function ia(i, e) {
|
|
|
10427
10459
|
};
|
|
10428
10460
|
}, [i]);
|
|
10429
10461
|
}
|
|
10430
|
-
function
|
|
10431
|
-
const [t, n] =
|
|
10432
|
-
|
|
10462
|
+
function Fu(i, e) {
|
|
10463
|
+
const [t, n] = An(null), s = Ve(/* @__PURE__ */ new Set());
|
|
10464
|
+
rt(() => {
|
|
10433
10465
|
if (i !== void 0 && s.current.has(i)) {
|
|
10434
10466
|
s.current.delete(i), n((c) => c === i ? null : c);
|
|
10435
10467
|
return;
|
|
@@ -10437,7 +10469,7 @@ function Nu(i, e) {
|
|
|
10437
10469
|
s.current.clear(), n(null);
|
|
10438
10470
|
}, [i]);
|
|
10439
10471
|
const r = !!(e != null && e.presets);
|
|
10440
|
-
|
|
10472
|
+
rt(() => {
|
|
10441
10473
|
r || (s.current.clear(), n(null));
|
|
10442
10474
|
}, [r]);
|
|
10443
10475
|
const o = e == null ? void 0 : e.onPresetChange, a = Rt(
|
|
@@ -10452,7 +10484,7 @@ function Nu(i, e) {
|
|
|
10452
10484
|
selectPreset: a
|
|
10453
10485
|
};
|
|
10454
10486
|
}
|
|
10455
|
-
function
|
|
10487
|
+
function zu(i, e, t, n, s) {
|
|
10456
10488
|
return Dt(() => {
|
|
10457
10489
|
var u, d, h;
|
|
10458
10490
|
const r = i.preset !== e, o = t === !0 && ((u = i.pathTracing) == null ? void 0 : u.enabled) === void 0, a = n !== void 0 && ((d = i.controls) == null ? void 0 : d.autoRotate) === void 0, c = s !== void 0 && ((h = i.animations) == null ? void 0 : h.autoplay) === void 0;
|
|
@@ -10465,18 +10497,18 @@ function ku(i, e, t, n, s) {
|
|
|
10465
10497
|
};
|
|
10466
10498
|
}, [i, e, t, n, s]);
|
|
10467
10499
|
}
|
|
10468
|
-
function
|
|
10500
|
+
function Bu(i, e, t) {
|
|
10469
10501
|
const n = Dt(() => {
|
|
10470
10502
|
if (typeof t == "string")
|
|
10471
10503
|
return t;
|
|
10472
10504
|
if (t)
|
|
10473
10505
|
return `object-${t.uuid || "no-uuid"}`;
|
|
10474
|
-
}, [t]), [s, r] =
|
|
10506
|
+
}, [t]), [s, r] = An(() => ({
|
|
10475
10507
|
status: t ? "loading" : "idle"
|
|
10476
10508
|
}));
|
|
10477
|
-
return
|
|
10509
|
+
return rt(() => {
|
|
10478
10510
|
r({ status: t ? "loading" : "idle" });
|
|
10479
|
-
}, [n]),
|
|
10511
|
+
}, [n]), rt(() => {
|
|
10480
10512
|
if (!i || !e || !t)
|
|
10481
10513
|
return;
|
|
10482
10514
|
let o = !0;
|
|
@@ -10557,7 +10589,7 @@ class Si {
|
|
|
10557
10589
|
};
|
|
10558
10590
|
}
|
|
10559
10591
|
}
|
|
10560
|
-
function
|
|
10592
|
+
function Uu(i) {
|
|
10561
10593
|
const e = Ve(new nr()), t = Dt(
|
|
10562
10594
|
() => ({
|
|
10563
10595
|
"model:loading": (n) => e.current.emit("model:loading", n),
|
|
@@ -10574,7 +10606,7 @@ function zu(i) {
|
|
|
10574
10606
|
);
|
|
10575
10607
|
return ia(i, t), e.current;
|
|
10576
10608
|
}
|
|
10577
|
-
function
|
|
10609
|
+
function Hu(i, e, t) {
|
|
10578
10610
|
const n = Ve(t);
|
|
10579
10611
|
n.current = t;
|
|
10580
10612
|
const s = Dt(
|
|
@@ -10600,7 +10632,7 @@ function Bu(i, e, t) {
|
|
|
10600
10632
|
);
|
|
10601
10633
|
ia(i, s);
|
|
10602
10634
|
const r = Ve(null);
|
|
10603
|
-
|
|
10635
|
+
rt(() => {
|
|
10604
10636
|
if (!e) {
|
|
10605
10637
|
r.current = null;
|
|
10606
10638
|
return;
|
|
@@ -10610,7 +10642,7 @@ function Bu(i, e, t) {
|
|
|
10610
10642
|
});
|
|
10611
10643
|
}
|
|
10612
10644
|
const ra = Wa(null);
|
|
10613
|
-
function
|
|
10645
|
+
function Gu({ viewer: i, canvasRef: e, children: t }) {
|
|
10614
10646
|
const n = Dt(() => ({ viewer: i, canvasRef: e }), [i, e]);
|
|
10615
10647
|
return /* @__PURE__ */ Te(ra.Provider, { value: n, children: t });
|
|
10616
10648
|
}
|
|
@@ -10620,7 +10652,7 @@ function oa() {
|
|
|
10620
10652
|
throw new Error("useViewerContext must be used within ViewerProvider");
|
|
10621
10653
|
return i;
|
|
10622
10654
|
}
|
|
10623
|
-
function
|
|
10655
|
+
function ju() {
|
|
10624
10656
|
const { canvasRef: i } = oa();
|
|
10625
10657
|
return /* @__PURE__ */ Te(
|
|
10626
10658
|
"canvas",
|
|
@@ -10648,13 +10680,13 @@ function Hu() {
|
|
|
10648
10680
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
10649
10681
|
}
|
|
10650
10682
|
})();
|
|
10651
|
-
const
|
|
10683
|
+
const Vu = (i, e, t, n, s, r) => {
|
|
10652
10684
|
const o = performance.now(), a = () => {
|
|
10653
10685
|
const c = performance.now() - o, u = Math.min(c / s, 1);
|
|
10654
10686
|
i.position.lerpVectors(t, n, u), e == null || e.update(), r(), u < 1 && requestAnimationFrame(a);
|
|
10655
10687
|
};
|
|
10656
10688
|
requestAnimationFrame(a);
|
|
10657
|
-
}, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(),
|
|
10689
|
+
}, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), Wu = Math.cos(70 * tr.DEG2RAD), Le = new $(), nt = 2 * Math.PI, Ee = {
|
|
10658
10690
|
NONE: -1,
|
|
10659
10691
|
ROTATE: 0,
|
|
10660
10692
|
DOLLY: 1,
|
|
@@ -10672,7 +10704,7 @@ class ca extends Io {
|
|
|
10672
10704
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
10673
10705
|
*/
|
|
10674
10706
|
constructor(e, t = null) {
|
|
10675
|
-
super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new
|
|
10707
|
+
super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new vn(), this._lastTargetPosition = new $(), this._quat = new vn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ku.bind(this), this._onPointerDown = Zu.bind(this), this._onPointerUp = Xu.bind(this), this._onContextMenu = td.bind(this), this._onMouseWheel = $u.bind(this), this._onKeyDown = Qu.bind(this), this._onTouchStart = Ju.bind(this), this._onTouchMove = ed.bind(this), this._onMouseDown = Yu.bind(this), this._onMouseMove = qu.bind(this), this._interceptControlDown = nd.bind(this), this._interceptControlUp = sd.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
10676
10708
|
}
|
|
10677
10709
|
connect(e) {
|
|
10678
10710
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -10763,7 +10795,7 @@ class ca extends Io {
|
|
|
10763
10795
|
u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Le.length();
|
|
10764
10796
|
} else
|
|
10765
10797
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
10766
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) <
|
|
10798
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < Wu ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
|
|
10767
10799
|
} else if (this.object.isOrthographicCamera) {
|
|
10768
10800
|
const o = this.object.zoom;
|
|
10769
10801
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
|
|
@@ -10960,13 +10992,13 @@ class ca extends Io {
|
|
|
10960
10992
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
10961
10993
|
}
|
|
10962
10994
|
}
|
|
10963
|
-
function
|
|
10995
|
+
function Zu(i) {
|
|
10964
10996
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
10965
10997
|
}
|
|
10966
|
-
function
|
|
10998
|
+
function Ku(i) {
|
|
10967
10999
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
10968
11000
|
}
|
|
10969
|
-
function
|
|
11001
|
+
function Xu(i) {
|
|
10970
11002
|
switch (this._removePointer(i), this._pointers.length) {
|
|
10971
11003
|
case 0:
|
|
10972
11004
|
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(aa), this.state = Ee.NONE;
|
|
@@ -10977,7 +11009,7 @@ function Zu(i) {
|
|
|
10977
11009
|
break;
|
|
10978
11010
|
}
|
|
10979
11011
|
}
|
|
10980
|
-
function
|
|
11012
|
+
function Yu(i) {
|
|
10981
11013
|
let e;
|
|
10982
11014
|
switch (i.button) {
|
|
10983
11015
|
case 0:
|
|
@@ -11020,7 +11052,7 @@ function Ku(i) {
|
|
|
11020
11052
|
}
|
|
11021
11053
|
this.state !== Ee.NONE && this.dispatchEvent(dr);
|
|
11022
11054
|
}
|
|
11023
|
-
function
|
|
11055
|
+
function qu(i) {
|
|
11024
11056
|
switch (this.state) {
|
|
11025
11057
|
case Ee.ROTATE:
|
|
11026
11058
|
if (this.enableRotate === !1) return;
|
|
@@ -11036,13 +11068,13 @@ function Xu(i) {
|
|
|
11036
11068
|
break;
|
|
11037
11069
|
}
|
|
11038
11070
|
}
|
|
11039
|
-
function
|
|
11071
|
+
function $u(i) {
|
|
11040
11072
|
this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(dr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(aa));
|
|
11041
11073
|
}
|
|
11042
|
-
function
|
|
11074
|
+
function Qu(i) {
|
|
11043
11075
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
11044
11076
|
}
|
|
11045
|
-
function
|
|
11077
|
+
function Ju(i) {
|
|
11046
11078
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
11047
11079
|
case 1:
|
|
11048
11080
|
switch (this.touches.ONE) {
|
|
@@ -11077,7 +11109,7 @@ function $u(i) {
|
|
|
11077
11109
|
}
|
|
11078
11110
|
this.state !== Ee.NONE && this.dispatchEvent(dr);
|
|
11079
11111
|
}
|
|
11080
|
-
function
|
|
11112
|
+
function ed(i) {
|
|
11081
11113
|
switch (this._trackPointer(i), this.state) {
|
|
11082
11114
|
case Ee.TOUCH_ROTATE:
|
|
11083
11115
|
if (this.enableRotate === !1) return;
|
|
@@ -11099,16 +11131,16 @@ function Qu(i) {
|
|
|
11099
11131
|
this.state = Ee.NONE;
|
|
11100
11132
|
}
|
|
11101
11133
|
}
|
|
11102
|
-
function
|
|
11134
|
+
function td(i) {
|
|
11103
11135
|
this.enabled !== !1 && i.preventDefault();
|
|
11104
11136
|
}
|
|
11105
|
-
function
|
|
11137
|
+
function nd(i) {
|
|
11106
11138
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
11107
11139
|
}
|
|
11108
|
-
function
|
|
11140
|
+
function sd(i) {
|
|
11109
11141
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
11110
11142
|
}
|
|
11111
|
-
class
|
|
11143
|
+
class id extends ca {
|
|
11112
11144
|
constructor(e, t) {
|
|
11113
11145
|
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ue.PAN, MIDDLE: Ue.DOLLY, RIGHT: Ue.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE };
|
|
11114
11146
|
}
|
|
@@ -11129,7 +11161,7 @@ const de = {
|
|
|
11129
11161
|
};
|
|
11130
11162
|
var jt = /* @__PURE__ */ ((i) => (i.FRONT = "FRONT", i.BACK = "BACK", i.RIGHT = "RIGHT", i.LEFT = "LEFT", i.TOP = "TOP", i.BOTTOM = "BOTTOM", i))(jt || {});
|
|
11131
11163
|
new w.Vector3(0, 1, 0);
|
|
11132
|
-
const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name",
|
|
11164
|
+
const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", rd = "gizmo-group-name", od = [
|
|
11133
11165
|
Xs,
|
|
11134
11166
|
Xi
|
|
11135
11167
|
], Us = {
|
|
@@ -11137,7 +11169,7 @@ const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-
|
|
|
11137
11169
|
DEFAULT_UP: new w.Vector3(0, 1, 0),
|
|
11138
11170
|
FORWARD: new w.Vector3(0, 0, -1)
|
|
11139
11171
|
}, xi = (i) => Us.FORWARD.clone().applyQuaternion(i), po = (i, e, t = new w.Vector3()) => t.clone().add(i.multiplyScalar(-e));
|
|
11140
|
-
class
|
|
11172
|
+
class ad {
|
|
11141
11173
|
constructor(e, t = $n) {
|
|
11142
11174
|
this.gizmoScene = e, this.gizmoArrowsName = t;
|
|
11143
11175
|
}
|
|
@@ -11152,7 +11184,7 @@ class rd {
|
|
|
11152
11184
|
}
|
|
11153
11185
|
syncMainWithGizmo(e, t, n) {
|
|
11154
11186
|
const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof w.PerspectiveCamera;
|
|
11155
|
-
n instanceof
|
|
11187
|
+
n instanceof id && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
|
|
11156
11188
|
}
|
|
11157
11189
|
syncMapControls(e, t, n, s) {
|
|
11158
11190
|
const r = e.position.y - n.y, o = xi(t.quaternion);
|
|
@@ -11167,7 +11199,7 @@ class rd {
|
|
|
11167
11199
|
e.position.copy(a), e.up.copy(o), e.camera.lookAt(n);
|
|
11168
11200
|
}
|
|
11169
11201
|
}
|
|
11170
|
-
const la = (i) => new
|
|
11202
|
+
const la = (i) => new ad(i), mo = (i, e, t) => {
|
|
11171
11203
|
la(t).syncGizmoWithMain(
|
|
11172
11204
|
{
|
|
11173
11205
|
camera: i,
|
|
@@ -11182,7 +11214,7 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
|
|
|
11182
11214
|
up: e.up
|
|
11183
11215
|
}
|
|
11184
11216
|
);
|
|
11185
|
-
},
|
|
11217
|
+
}, cd = (i, e, t) => {
|
|
11186
11218
|
la(e.userData.scene).syncMainWithGizmo(
|
|
11187
11219
|
{
|
|
11188
11220
|
camera: i,
|
|
@@ -11198,14 +11230,14 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
|
|
|
11198
11230
|
},
|
|
11199
11231
|
t
|
|
11200
11232
|
);
|
|
11201
|
-
},
|
|
11233
|
+
}, ld = () => {
|
|
11202
11234
|
try {
|
|
11203
11235
|
const i = document.createElement("canvas");
|
|
11204
11236
|
return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")));
|
|
11205
11237
|
} catch {
|
|
11206
11238
|
return !1;
|
|
11207
11239
|
}
|
|
11208
|
-
},
|
|
11240
|
+
}, hd = () => ld() ? new w.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), ud = (i) => {
|
|
11209
11241
|
const e = new w.AmbientLight(16777215, 1);
|
|
11210
11242
|
i.add(e);
|
|
11211
11243
|
const t = new w.DirectionalLight(16777215, 1);
|
|
@@ -11215,7 +11247,7 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
|
|
|
11215
11247
|
const s = new w.PointLight(16777215, 1, 100);
|
|
11216
11248
|
s.position.set(0, 0, 5), i.add(s), t.castShadow = !1, n.castShadow = !1, s.castShadow = !1;
|
|
11217
11249
|
};
|
|
11218
|
-
class
|
|
11250
|
+
class dd {
|
|
11219
11251
|
static createTextTexture(e) {
|
|
11220
11252
|
const t = document.createElement("canvas"), n = t.getContext("2d");
|
|
11221
11253
|
t.width = de.CANVAS_SIZE, t.height = de.CANVAS_SIZE, n && (n.clearRect(0, 0, t.width, t.height), n.font = `${de.FONT_SIZE} Arial`, n.fillStyle = de.TEXT_COLOR, n.textAlign = de.TEXT_ALIGN, n.textBaseline = de.TEXT_BASELINE, n.fillText(e, t.width / 2, t.height / 2));
|
|
@@ -11257,14 +11289,14 @@ class Ns {
|
|
|
11257
11289
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
|
|
11258
11290
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE
|
|
11259
11291
|
), u = new w.MeshStandardMaterial({
|
|
11260
|
-
map:
|
|
11292
|
+
map: dd.createTextTexture(n),
|
|
11261
11293
|
transparent: !0,
|
|
11262
11294
|
depthWrite: !1
|
|
11263
11295
|
}), d = new w.Mesh(c, u);
|
|
11264
11296
|
return d.position.set(0, 0, de.FACE_THICKNESS / 2 + 0.01), s.add(d), s.position.copy(e), s.rotation.copy(t), s;
|
|
11265
11297
|
}
|
|
11266
11298
|
}
|
|
11267
|
-
const
|
|
11299
|
+
const fd = (i, e) => {
|
|
11268
11300
|
const t = document.createElement("canvas");
|
|
11269
11301
|
t.width = 64, t.height = 64;
|
|
11270
11302
|
const n = t.getContext("2d");
|
|
@@ -11272,7 +11304,7 @@ const ud = (i, e) => {
|
|
|
11272
11304
|
const s = new w.CanvasTexture(t), r = new w.SpriteMaterial({ map: s }), o = new w.Sprite(r);
|
|
11273
11305
|
return o.scale.set(0.5, 0.5, 0.5), o;
|
|
11274
11306
|
};
|
|
11275
|
-
class
|
|
11307
|
+
class pd {
|
|
11276
11308
|
constructor(e) {
|
|
11277
11309
|
this.hoveredObject = null, this.originalColor = null, this.config = e;
|
|
11278
11310
|
}
|
|
@@ -11390,11 +11422,11 @@ class dd {
|
|
|
11390
11422
|
createAxis(e) {
|
|
11391
11423
|
const { color: t, direction: n, length: s, origin: r, lineWidth: o, label: a } = e, c = new w.Group(), u = o / 2, d = new w.CylinderGeometry(u, u, s, 32), h = new w.MeshBasicMaterial({ color: t }), f = new w.Mesh(d, h);
|
|
11392
11424
|
if (f.position.copy(r).add(n.clone().multiplyScalar(s / 2)), !n.equals(new w.Vector3(0, 1, 0))) {
|
|
11393
|
-
const
|
|
11394
|
-
f.setRotationFromAxisAngle(
|
|
11425
|
+
const y = new w.Vector3(0, 1, 0).cross(n).normalize(), S = Math.acos(new w.Vector3(0, 1, 0).dot(n));
|
|
11426
|
+
f.setRotationFromAxisAngle(y, S);
|
|
11395
11427
|
}
|
|
11396
11428
|
c.add(f);
|
|
11397
|
-
const p =
|
|
11429
|
+
const p = fd(a, t);
|
|
11398
11430
|
return p.position.copy(r).add(n.clone().multiplyScalar(s + 0.1)), c.add(p), c;
|
|
11399
11431
|
}
|
|
11400
11432
|
createCoordinateAxes() {
|
|
@@ -11437,7 +11469,7 @@ class dd {
|
|
|
11437
11469
|
}
|
|
11438
11470
|
create() {
|
|
11439
11471
|
const e = new w.Group();
|
|
11440
|
-
e.name =
|
|
11472
|
+
e.name = rd;
|
|
11441
11473
|
const t = this.createWireframe();
|
|
11442
11474
|
e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
|
|
11443
11475
|
const n = this.createCoordinateAxes();
|
|
@@ -11462,7 +11494,7 @@ class dd {
|
|
|
11462
11494
|
}
|
|
11463
11495
|
}
|
|
11464
11496
|
}
|
|
11465
|
-
class
|
|
11497
|
+
class md {
|
|
11466
11498
|
constructor(e) {
|
|
11467
11499
|
this.onChangeMainControlsListener = () => {
|
|
11468
11500
|
}, this.onChangeGizmoControlsListener = () => {
|
|
@@ -11484,10 +11516,10 @@ class fd {
|
|
|
11484
11516
|
}
|
|
11485
11517
|
initializeScene() {
|
|
11486
11518
|
var e;
|
|
11487
|
-
const t = new
|
|
11519
|
+
const t = new pd({
|
|
11488
11520
|
initialFace: ((e = this.options) == null ? void 0 : e.initialFace) ?? jt.FRONT
|
|
11489
11521
|
}).create();
|
|
11490
|
-
this.gizmoScene.add(t),
|
|
11522
|
+
this.gizmoScene.add(t), ud(this.gizmoScene);
|
|
11491
11523
|
}
|
|
11492
11524
|
initializeControls() {
|
|
11493
11525
|
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(
|
|
@@ -11527,7 +11559,7 @@ class fd {
|
|
|
11527
11559
|
), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
|
|
11528
11560
|
}
|
|
11529
11561
|
}
|
|
11530
|
-
const
|
|
11562
|
+
const gd = (i, e) => {
|
|
11531
11563
|
let t;
|
|
11532
11564
|
return function(...n) {
|
|
11533
11565
|
t || (i.apply(this, n), t = !0, setTimeout(() => t = !1, e));
|
|
@@ -11543,12 +11575,12 @@ const ha = (i, e, t, n) => (n.setFromCamera(i, e), n.intersectObjects(t.children
|
|
|
11543
11575
|
const t = ["Wireframe", ""];
|
|
11544
11576
|
return ((e = i.find((n) => !t.includes(n.object.name))) == null ? void 0 : e.object) || null;
|
|
11545
11577
|
};
|
|
11546
|
-
function
|
|
11578
|
+
function yd(i, e, t, n) {
|
|
11547
11579
|
if (!e || !t) return null;
|
|
11548
11580
|
const s = ha(i, e, t, n);
|
|
11549
11581
|
return ua(s);
|
|
11550
11582
|
}
|
|
11551
|
-
function
|
|
11583
|
+
function wd(i, e) {
|
|
11552
11584
|
const t = i == null ? void 0 : i.userData.gizmoCube;
|
|
11553
11585
|
if (i && t) {
|
|
11554
11586
|
t.handleClick();
|
|
@@ -11556,22 +11588,22 @@ function gd(i, e) {
|
|
|
11556
11588
|
n && e(n);
|
|
11557
11589
|
}
|
|
11558
11590
|
}
|
|
11559
|
-
const
|
|
11591
|
+
const Ed = {
|
|
11560
11592
|
radius: 2.1,
|
|
11561
11593
|
color: 12369854,
|
|
11562
11594
|
tubeRadius: 0.1,
|
|
11563
11595
|
tubeSegments: 8,
|
|
11564
11596
|
numPoints: 64,
|
|
11565
11597
|
tubeOffset: 1.5
|
|
11566
|
-
},
|
|
11598
|
+
}, Td = {
|
|
11567
11599
|
size: 0.2,
|
|
11568
11600
|
depth: 0.1,
|
|
11569
11601
|
heightRatio: 1.4,
|
|
11570
11602
|
segments: 1
|
|
11571
11603
|
};
|
|
11572
|
-
class
|
|
11604
|
+
class _d {
|
|
11573
11605
|
constructor(e = {}) {
|
|
11574
|
-
this.config = { ...
|
|
11606
|
+
this.config = { ...Ed, ...e }, this.material = new w.MeshBasicMaterial({ color: this.config.color });
|
|
11575
11607
|
}
|
|
11576
11608
|
create() {
|
|
11577
11609
|
const e = new w.Group(), t = this.createQuarterCircleCurves();
|
|
@@ -11612,7 +11644,7 @@ class Ed {
|
|
|
11612
11644
|
];
|
|
11613
11645
|
}
|
|
11614
11646
|
createArrowHeads([e, t]) {
|
|
11615
|
-
const { size: n, depth: s, heightRatio: r, segments: o } =
|
|
11647
|
+
const { size: n, depth: s, heightRatio: r, segments: o } = Td, a = this.createArrowShape(n, r), c = new w.ExtrudeGeometry(a, {
|
|
11616
11648
|
steps: o,
|
|
11617
11649
|
depth: s,
|
|
11618
11650
|
bevelEnabled: !1
|
|
@@ -11640,11 +11672,11 @@ class Ed {
|
|
|
11640
11672
|
return Math.atan2(e.y, e.x);
|
|
11641
11673
|
}
|
|
11642
11674
|
}
|
|
11643
|
-
const
|
|
11675
|
+
const Sd = (i) => {
|
|
11644
11676
|
const e = i.rotation, t = 0.01, n = Math.PI, s = (Math.abs(e.x) % (2 * n) + 2 * n) % (2 * n), r = (Math.abs(e.y) % (2 * n) + 2 * n) % (2 * n), o = Math.abs(s - n / 2) < t || Math.abs(s - 3 * n / 2) < t || Math.abs(r - n / 2) < t || Math.abs(r - 3 * n / 2) < t, a = (Math.abs(s) < t || Math.abs(s - n) < t) && (Math.abs(r) < t || Math.abs(r - n) < t);
|
|
11645
11677
|
return !(o || a);
|
|
11646
|
-
},
|
|
11647
|
-
function
|
|
11678
|
+
}, bd = 25, xd = 200;
|
|
11679
|
+
function Ad({
|
|
11648
11680
|
gizmoRenderer: i,
|
|
11649
11681
|
gizmoScene: e,
|
|
11650
11682
|
gizmoCamera: t,
|
|
@@ -11652,31 +11684,31 @@ function bd({
|
|
|
11652
11684
|
gizmoControlRef: s
|
|
11653
11685
|
}) {
|
|
11654
11686
|
const r = Ve(null), o = Ve(null), a = Ve(new w.Raycaster()).current, c = Ve(new w.Vector2()).current, u = Rt(() => {
|
|
11655
|
-
const
|
|
11656
|
-
if (
|
|
11657
|
-
e.remove(
|
|
11687
|
+
const S = e.getObjectByName($n), _ = Sd(t);
|
|
11688
|
+
if (S && _) {
|
|
11689
|
+
e.remove(S);
|
|
11658
11690
|
return;
|
|
11659
11691
|
}
|
|
11660
|
-
if (
|
|
11661
|
-
const
|
|
11662
|
-
|
|
11692
|
+
if (S || _) return;
|
|
11693
|
+
const x = new _d().create();
|
|
11694
|
+
x.rotation.copy(t.rotation), e.add(x);
|
|
11663
11695
|
}, [e, t]), d = Rt(() => {
|
|
11664
|
-
const
|
|
11665
|
-
|
|
11696
|
+
const S = e.getObjectByName($n);
|
|
11697
|
+
S && e.remove(S);
|
|
11666
11698
|
}, [e]), h = Rt(
|
|
11667
|
-
|
|
11699
|
+
gd((S) => {
|
|
11668
11700
|
if (!s.current || !i) return;
|
|
11669
|
-
go(
|
|
11701
|
+
go(S, i, c);
|
|
11670
11702
|
const _ = ha(
|
|
11671
11703
|
c,
|
|
11672
11704
|
t,
|
|
11673
11705
|
e,
|
|
11674
11706
|
a
|
|
11675
|
-
),
|
|
11676
|
-
|
|
11707
|
+
), x = ua(_);
|
|
11708
|
+
x != null && x.userData.gizmoCube ? x.userData.gizmoCube.highlightObject(x) : e.traverse((E) => {
|
|
11677
11709
|
E.userData.gizmoCube && E.userData.gizmoCube.highlightObject(null);
|
|
11678
11710
|
}), _.length > 0 ? u() : d();
|
|
11679
|
-
}, 1e3 /
|
|
11711
|
+
}, 1e3 / bd),
|
|
11680
11712
|
[
|
|
11681
11713
|
s,
|
|
11682
11714
|
i,
|
|
@@ -11687,26 +11719,26 @@ function bd({
|
|
|
11687
11719
|
u,
|
|
11688
11720
|
d
|
|
11689
11721
|
]
|
|
11690
|
-
), f = Rt((
|
|
11691
|
-
r.current = Date.now(), o.current = { x:
|
|
11722
|
+
), f = Rt((S) => {
|
|
11723
|
+
r.current = Date.now(), o.current = { x: S.clientX, y: S.clientY };
|
|
11692
11724
|
}, []), p = Rt(
|
|
11693
|
-
(
|
|
11725
|
+
(S) => {
|
|
11694
11726
|
var _;
|
|
11695
|
-
const
|
|
11696
|
-
A.makeRotationZ(T), t.up.applyMatrix4(A), t.lookAt(
|
|
11727
|
+
const x = S.name === Xs ? 1 : -1, E = 90 * Math.PI / 180, b = new w.Vector3(0, 0, 0), T = x * E, A = new w.Matrix4();
|
|
11728
|
+
A.makeRotationZ(T), t.up.applyMatrix4(A), t.lookAt(b), (_ = s.current) == null || _.gizmoControls.update();
|
|
11697
11729
|
},
|
|
11698
11730
|
[t, s]
|
|
11699
|
-
),
|
|
11700
|
-
(
|
|
11701
|
-
if ((r.current ? Date.now() - r.current : 0) <
|
|
11702
|
-
go(
|
|
11703
|
-
const _ =
|
|
11731
|
+
), y = Rt(
|
|
11732
|
+
(S) => {
|
|
11733
|
+
if ((r.current ? Date.now() - r.current : 0) < xd) {
|
|
11734
|
+
go(S, i, c);
|
|
11735
|
+
const _ = yd(
|
|
11704
11736
|
c,
|
|
11705
11737
|
t,
|
|
11706
11738
|
e,
|
|
11707
11739
|
a
|
|
11708
11740
|
);
|
|
11709
|
-
_ != null && _.name &&
|
|
11741
|
+
_ != null && _.name && od.includes(_.name) ? p(_) : wd(_, n);
|
|
11710
11742
|
}
|
|
11711
11743
|
r.current = null, o.current = null;
|
|
11712
11744
|
},
|
|
@@ -11723,23 +11755,23 @@ function bd({
|
|
|
11723
11755
|
return {
|
|
11724
11756
|
onMouseDown: f,
|
|
11725
11757
|
onMouseMove: h,
|
|
11726
|
-
onMouseUp:
|
|
11758
|
+
onMouseUp: y,
|
|
11727
11759
|
onMouseLeave: d
|
|
11728
11760
|
};
|
|
11729
11761
|
}
|
|
11730
|
-
const
|
|
11762
|
+
const vd = ({
|
|
11731
11763
|
camera: i,
|
|
11732
11764
|
controls: e,
|
|
11733
11765
|
className: t,
|
|
11734
11766
|
render: n,
|
|
11735
11767
|
options: s
|
|
11736
11768
|
}) => {
|
|
11737
|
-
const r = Ve(null), o = Ve(new w.Scene()).current, [a] =
|
|
11769
|
+
const r = Ve(null), o = Ve(new w.Scene()).current, [a] = An(() => hd()), c = 30, u = 1, d = 0.1, h = 10, f = new w.PerspectiveCamera(
|
|
11738
11770
|
c,
|
|
11739
11771
|
u,
|
|
11740
11772
|
d,
|
|
11741
11773
|
h
|
|
11742
|
-
), p = Ve(f).current,
|
|
11774
|
+
), p = Ve(f).current, y = Ve(null), S = Rt(() => {
|
|
11743
11775
|
a && (n(), a.render(o, p));
|
|
11744
11776
|
}, [n, a, o, p]), _ = Rt(
|
|
11745
11777
|
(A) => {
|
|
@@ -11747,27 +11779,27 @@ const xd = ({
|
|
|
11747
11779
|
const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, O = new w.Matrix4();
|
|
11748
11780
|
O.lookAt(I, new w.Vector3(0, 0, 0), new w.Vector3(0, 1, 0));
|
|
11749
11781
|
const C = new w.Quaternion();
|
|
11750
|
-
C.setFromRotationMatrix(O), i.quaternion.copy(C),
|
|
11782
|
+
C.setFromRotationMatrix(O), i.quaternion.copy(C), Vu(
|
|
11751
11783
|
i,
|
|
11752
11784
|
e,
|
|
11753
11785
|
i.position.clone(),
|
|
11754
11786
|
I,
|
|
11755
11787
|
M,
|
|
11756
|
-
|
|
11788
|
+
S
|
|
11757
11789
|
), i.up.set(0, 1, 0), i.lookAt(new w.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
|
|
11758
11790
|
},
|
|
11759
|
-
[i, e,
|
|
11760
|
-
), { onMouseDown:
|
|
11791
|
+
[i, e, S, o]
|
|
11792
|
+
), { onMouseDown: x, onMouseMove: E, onMouseUp: b, onMouseLeave: T } = Ad({
|
|
11761
11793
|
gizmoRenderer: a,
|
|
11762
11794
|
gizmoScene: o,
|
|
11763
11795
|
gizmoCamera: p,
|
|
11764
11796
|
alignCameraWithVector: _,
|
|
11765
|
-
gizmoControlRef:
|
|
11797
|
+
gizmoControlRef: y
|
|
11766
11798
|
});
|
|
11767
|
-
return
|
|
11799
|
+
return rt(() => {
|
|
11768
11800
|
const A = r.current;
|
|
11769
11801
|
if (!A || !i || !e || !a) return;
|
|
11770
|
-
|
|
11802
|
+
y.current && y.current.dispose();
|
|
11771
11803
|
const P = {
|
|
11772
11804
|
gizmoDiv: A,
|
|
11773
11805
|
gizmoScene: o,
|
|
@@ -11776,34 +11808,34 @@ const xd = ({
|
|
|
11776
11808
|
}, I = {
|
|
11777
11809
|
mainCamera: i,
|
|
11778
11810
|
mainControls: e,
|
|
11779
|
-
renderGizmo:
|
|
11811
|
+
renderGizmo: S
|
|
11780
11812
|
}, M = {
|
|
11781
11813
|
syncGizmoCameraWithMain: mo,
|
|
11782
|
-
syncMainCameraWithGizmo:
|
|
11814
|
+
syncMainCameraWithGizmo: cd
|
|
11783
11815
|
};
|
|
11784
|
-
return
|
|
11816
|
+
return y.current = new md({
|
|
11785
11817
|
gizmoParams: P,
|
|
11786
11818
|
mainParams: I,
|
|
11787
11819
|
syncFunctions: M,
|
|
11788
11820
|
options: s
|
|
11789
|
-
}), A.addEventListener("mousedown",
|
|
11790
|
-
|
|
11821
|
+
}), A.addEventListener("mousedown", x), A.addEventListener("mousemove", E), A.addEventListener("mouseup", b), A.addEventListener("mouseleave", T), () => {
|
|
11822
|
+
y.current && (y.current.dispose(), y.current = null), A.removeEventListener("mousedown", x), A.removeEventListener("mousemove", E), A.removeEventListener("mouseup", b), A.removeEventListener("mouseleave", T);
|
|
11791
11823
|
};
|
|
11792
|
-
}, [i, e,
|
|
11793
|
-
i && (mo(p, i, o),
|
|
11794
|
-
}, [i,
|
|
11824
|
+
}, [i, e, S, E, x, b]), rt(() => {
|
|
11825
|
+
i && (mo(p, i, o), S());
|
|
11826
|
+
}, [i, S]), /* @__PURE__ */ Te(
|
|
11795
11827
|
"div",
|
|
11796
11828
|
{
|
|
11797
11829
|
className: t ? `${t}` : "gizmo-default",
|
|
11798
11830
|
ref: r
|
|
11799
11831
|
}
|
|
11800
11832
|
);
|
|
11801
|
-
}, ks = 10,
|
|
11833
|
+
}, ks = 10, Rd = (i) => ({
|
|
11802
11834
|
top: i.startsWith("top") ? ks : "auto",
|
|
11803
11835
|
bottom: i.startsWith("bottom") ? ks : "auto",
|
|
11804
11836
|
left: i.endsWith("left") ? ks : "auto",
|
|
11805
11837
|
right: i.endsWith("right") ? ks : "auto"
|
|
11806
|
-
}),
|
|
11838
|
+
}), Md = ({
|
|
11807
11839
|
camera: i,
|
|
11808
11840
|
controls: e,
|
|
11809
11841
|
render: t,
|
|
@@ -11822,10 +11854,10 @@ const xd = ({
|
|
|
11822
11854
|
width: s,
|
|
11823
11855
|
height: s,
|
|
11824
11856
|
zIndex: 1e3,
|
|
11825
|
-
...
|
|
11857
|
+
...Rd(n)
|
|
11826
11858
|
},
|
|
11827
11859
|
children: /* @__PURE__ */ Te(
|
|
11828
|
-
|
|
11860
|
+
vd,
|
|
11829
11861
|
{
|
|
11830
11862
|
camera: i,
|
|
11831
11863
|
controls: r,
|
|
@@ -11835,7 +11867,7 @@ const xd = ({
|
|
|
11835
11867
|
}
|
|
11836
11868
|
);
|
|
11837
11869
|
};
|
|
11838
|
-
class
|
|
11870
|
+
class Id extends Ka {
|
|
11839
11871
|
constructor(e) {
|
|
11840
11872
|
super(e), this.reset = () => {
|
|
11841
11873
|
this.setState({ hasError: !1, error: null });
|
|
@@ -11860,16 +11892,16 @@ class Rd extends Ka {
|
|
|
11860
11892
|
fontFamily: "sans-serif",
|
|
11861
11893
|
padding: "20px",
|
|
11862
11894
|
textAlign: "center"
|
|
11863
|
-
}, children: /* @__PURE__ */
|
|
11895
|
+
}, children: /* @__PURE__ */ jn("div", { children: [
|
|
11864
11896
|
/* @__PURE__ */ Te("h3", { children: "Error Loading 3D Viewer" }),
|
|
11865
11897
|
/* @__PURE__ */ Te("p", { children: ((e = this.state.error) == null ? void 0 : e.message) || "An unexpected error occurred" }),
|
|
11866
11898
|
/* @__PURE__ */ Te("button", { type: "button", onClick: this.reset, children: "Try again" })
|
|
11867
11899
|
] }) }) : this.props.children;
|
|
11868
11900
|
}
|
|
11869
11901
|
}
|
|
11870
|
-
function
|
|
11902
|
+
function Cd({ status: i, label: e, color: t, backdrop: n }) {
|
|
11871
11903
|
const s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
11872
|
-
return /* @__PURE__ */
|
|
11904
|
+
return /* @__PURE__ */ jn(
|
|
11873
11905
|
"div",
|
|
11874
11906
|
{
|
|
11875
11907
|
"data-testid": "viewer-loading-overlay",
|
|
@@ -11894,7 +11926,7 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
|
|
|
11894
11926
|
fontSize: 14
|
|
11895
11927
|
},
|
|
11896
11928
|
children: [
|
|
11897
|
-
i === "loading" ? /* @__PURE__ */
|
|
11929
|
+
i === "loading" ? /* @__PURE__ */ jn("svg", { width: "44", height: "44", viewBox: "0 0 44 44", "aria-hidden": "true", children: [
|
|
11898
11930
|
/* @__PURE__ */ Te("circle", { cx: "22", cy: "22", r: "18", fill: "none", stroke: t, strokeOpacity: "0.25", strokeWidth: "4" }),
|
|
11899
11931
|
/* @__PURE__ */ Te("path", { d: "M22 4 a18 18 0 0 1 18 18", fill: "none", stroke: t, strokeWidth: "4", strokeLinecap: "round", children: !s && /* @__PURE__ */ Te(
|
|
11900
11932
|
"animateTransform",
|
|
@@ -11907,7 +11939,7 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
|
|
|
11907
11939
|
repeatCount: "indefinite"
|
|
11908
11940
|
}
|
|
11909
11941
|
) })
|
|
11910
|
-
] }) : /* @__PURE__ */
|
|
11942
|
+
] }) : /* @__PURE__ */ jn("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: t, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
11911
11943
|
/* @__PURE__ */ Te("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
11912
11944
|
/* @__PURE__ */ Te("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
11913
11945
|
/* @__PURE__ */ Te("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
@@ -11917,14 +11949,14 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
|
|
|
11917
11949
|
}
|
|
11918
11950
|
);
|
|
11919
11951
|
}
|
|
11920
|
-
const
|
|
11952
|
+
const Pd = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Ld = {
|
|
11921
11953
|
background: "rgba(255,255,255,0.78)",
|
|
11922
11954
|
backdropFilter: "blur(16px)",
|
|
11923
11955
|
WebkitBackdropFilter: "blur(16px)",
|
|
11924
11956
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
11925
11957
|
boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
|
|
11926
|
-
},
|
|
11927
|
-
function
|
|
11958
|
+
}, Od = Object.keys(sa);
|
|
11959
|
+
function Dd({ active: i, onSelect: e }) {
|
|
11928
11960
|
return /* @__PURE__ */ Te(
|
|
11929
11961
|
"div",
|
|
11930
11962
|
{
|
|
@@ -11945,9 +11977,9 @@ function Ld({ active: i, onSelect: e }) {
|
|
|
11945
11977
|
// instead of bleeding past the canvas edges.
|
|
11946
11978
|
maxWidth: "calc(100% - 16px)",
|
|
11947
11979
|
overflowX: "auto",
|
|
11948
|
-
...
|
|
11980
|
+
...Ld
|
|
11949
11981
|
},
|
|
11950
|
-
children:
|
|
11982
|
+
children: Od.map((t) => /* @__PURE__ */ Te(
|
|
11951
11983
|
"button",
|
|
11952
11984
|
{
|
|
11953
11985
|
type: "button",
|
|
@@ -11962,7 +11994,7 @@ function Ld({ active: i, onSelect: e }) {
|
|
|
11962
11994
|
border: t === i ? "1px solid #111318" : "1px solid transparent",
|
|
11963
11995
|
background: t === i ? "#111318" : "transparent",
|
|
11964
11996
|
color: t === i ? "#fff" : "#3f3f4a",
|
|
11965
|
-
fontFamily:
|
|
11997
|
+
fontFamily: Pd,
|
|
11966
11998
|
fontSize: 13,
|
|
11967
11999
|
fontWeight: 500,
|
|
11968
12000
|
lineHeight: 1,
|
|
@@ -11979,7 +12011,7 @@ function Ld({ active: i, onSelect: e }) {
|
|
|
11979
12011
|
}
|
|
11980
12012
|
);
|
|
11981
12013
|
}
|
|
11982
|
-
const
|
|
12014
|
+
const Hn = {
|
|
11983
12015
|
enabled: !0,
|
|
11984
12016
|
label: "Loading…",
|
|
11985
12017
|
color: "#ffffff",
|
|
@@ -11987,84 +12019,84 @@ const Un = {
|
|
|
11987
12019
|
// default light background (#f0f0f7) and dark studio mode.
|
|
11988
12020
|
backdrop: "rgba(15,16,20,0.6)"
|
|
11989
12021
|
};
|
|
11990
|
-
function
|
|
11991
|
-
return i === void 0 || i === !0 ?
|
|
12022
|
+
function Nd(i) {
|
|
12023
|
+
return i === void 0 || i === !0 ? Hn : i === !1 ? { ...Hn, enabled: !1 } : {
|
|
11992
12024
|
enabled: i.enabled ?? !0,
|
|
11993
|
-
label: i.label ??
|
|
12025
|
+
label: i.label ?? Hn.label,
|
|
11994
12026
|
errorLabel: i.errorLabel,
|
|
11995
|
-
color: i.color ??
|
|
11996
|
-
backdrop: i.backdrop ??
|
|
12027
|
+
color: i.color ?? Hn.color,
|
|
12028
|
+
backdrop: i.backdrop ?? Hn.backdrop
|
|
11997
12029
|
};
|
|
11998
12030
|
}
|
|
11999
12031
|
const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da = yo(
|
|
12000
12032
|
({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
|
|
12001
12033
|
var D, H;
|
|
12002
|
-
const c = Ve(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } =
|
|
12034
|
+
const c = Ve(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = Fu(
|
|
12003
12035
|
u,
|
|
12004
12036
|
e.ui
|
|
12005
|
-
), p =
|
|
12037
|
+
), p = zu(
|
|
12006
12038
|
e,
|
|
12007
12039
|
d,
|
|
12008
12040
|
n,
|
|
12009
12041
|
s,
|
|
12010
12042
|
r
|
|
12011
|
-
), { viewer:
|
|
12012
|
-
|
|
12013
|
-
const
|
|
12014
|
-
|
|
12015
|
-
}, [
|
|
12016
|
-
() =>
|
|
12043
|
+
), { viewer: y, isInitialized: S, initError: _ } = ku(c, p), x = Bu(y, S, i), E = Uu(y);
|
|
12044
|
+
Hu(y, _, e);
|
|
12045
|
+
const b = y ? es(y.getCamera()) : null, T = y ? ur(y.getControls()) : null, A = y ? Xo(y.getRenderer()) : null, P = Rt(() => {
|
|
12046
|
+
y == null || y.requestRender();
|
|
12047
|
+
}, [y]), I = ((D = e.helpers) == null ? void 0 : D.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((H = e.helpers) == null ? void 0 : H.gizmo) == "object" ? e.helpers.gizmo : {}, O = Dt(
|
|
12048
|
+
() => Nd(e.loadingIndicator),
|
|
12017
12049
|
[e.loadingIndicator]
|
|
12018
|
-
), C =
|
|
12050
|
+
), C = x.status === "error" || !!_, N = O.enabled && (x.status === "loading" || C);
|
|
12019
12051
|
return Xa(a, () => ({
|
|
12020
|
-
scene:
|
|
12021
|
-
camera:
|
|
12052
|
+
scene: y ? Gi(y.getScene()) : null,
|
|
12053
|
+
camera: b,
|
|
12022
12054
|
renderer: A,
|
|
12023
12055
|
controls: T,
|
|
12024
12056
|
events: E,
|
|
12025
12057
|
loadModel: async (j) => {
|
|
12026
|
-
if (!
|
|
12058
|
+
if (!y)
|
|
12027
12059
|
throw Fs();
|
|
12028
|
-
const q = typeof j == "string" ? j : new Oe(j), ie = await
|
|
12060
|
+
const q = typeof j == "string" ? j : new Oe(j), ie = await y.loadModel(q);
|
|
12029
12061
|
if (!ie.ok)
|
|
12030
12062
|
throw ie.error;
|
|
12031
12063
|
},
|
|
12032
12064
|
captureStill: async (j) => {
|
|
12033
|
-
if (!
|
|
12065
|
+
if (!y)
|
|
12034
12066
|
throw Fs();
|
|
12035
|
-
const q = await
|
|
12067
|
+
const q = await y.captureStill(j);
|
|
12036
12068
|
if (!q.ok)
|
|
12037
12069
|
throw q.error;
|
|
12038
12070
|
return q.value;
|
|
12039
12071
|
},
|
|
12040
12072
|
captureVideo: async (j) => {
|
|
12041
|
-
if (!
|
|
12073
|
+
if (!y)
|
|
12042
12074
|
throw Fs();
|
|
12043
|
-
const q = await
|
|
12075
|
+
const q = await y.captureVideo(j);
|
|
12044
12076
|
if (!q.ok)
|
|
12045
12077
|
throw q.error;
|
|
12046
12078
|
return q.value;
|
|
12047
12079
|
},
|
|
12048
|
-
getAnimationNames: () => (
|
|
12080
|
+
getAnimationNames: () => (y == null ? void 0 : y.getAnimationNames()) ?? [],
|
|
12049
12081
|
playAnimations: (j) => {
|
|
12050
|
-
if (!
|
|
12082
|
+
if (!y)
|
|
12051
12083
|
throw Fs();
|
|
12052
|
-
const q =
|
|
12084
|
+
const q = y.playAnimations(j);
|
|
12053
12085
|
if (!q.ok)
|
|
12054
12086
|
throw q.error;
|
|
12055
12087
|
},
|
|
12056
12088
|
pauseAnimations: () => {
|
|
12057
|
-
|
|
12089
|
+
y == null || y.pauseAnimations();
|
|
12058
12090
|
},
|
|
12059
12091
|
dispose: () => {
|
|
12060
|
-
|
|
12092
|
+
y == null || y.dispose();
|
|
12061
12093
|
}
|
|
12062
|
-
}), [
|
|
12063
|
-
/* @__PURE__ */ Te(
|
|
12064
|
-
I &&
|
|
12065
|
-
|
|
12094
|
+
}), [y, b, A, T, E]), /* @__PURE__ */ Te(Id, { children: /* @__PURE__ */ Te(Gu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ jn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
12095
|
+
/* @__PURE__ */ Te(ju, {}),
|
|
12096
|
+
I && S && b && T && /* @__PURE__ */ Te(
|
|
12097
|
+
Md,
|
|
12066
12098
|
{
|
|
12067
|
-
camera:
|
|
12099
|
+
camera: b,
|
|
12068
12100
|
controls: T,
|
|
12069
12101
|
render: P,
|
|
12070
12102
|
placement: M.placement,
|
|
@@ -12072,27 +12104,27 @@ const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da =
|
|
|
12072
12104
|
}
|
|
12073
12105
|
),
|
|
12074
12106
|
N && /* @__PURE__ */ Te(
|
|
12075
|
-
|
|
12107
|
+
Cd,
|
|
12076
12108
|
{
|
|
12077
12109
|
status: C ? "error" : "loading",
|
|
12078
|
-
label: C ? O.errorLabel ?? (_ == null ? void 0 : _.message) ??
|
|
12110
|
+
label: C ? O.errorLabel ?? (_ == null ? void 0 : _.message) ?? x.error ?? "Failed to load model" : O.label,
|
|
12079
12111
|
color: O.color,
|
|
12080
12112
|
backdrop: O.backdrop
|
|
12081
12113
|
}
|
|
12082
12114
|
),
|
|
12083
12115
|
h && /* The defaults ARE the studio look (pinned by presets.test.ts),
|
|
12084
12116
|
so with no preset set the studio chip is the honest active one. */
|
|
12085
|
-
/* @__PURE__ */ Te(
|
|
12117
|
+
/* @__PURE__ */ Te(Dd, { active: d ?? "studio", onSelect: f }),
|
|
12086
12118
|
o
|
|
12087
12119
|
] }) }) });
|
|
12088
12120
|
}
|
|
12089
12121
|
);
|
|
12090
12122
|
da.displayName = "SimpleViewer";
|
|
12091
|
-
const
|
|
12123
|
+
const kd = yo(
|
|
12092
12124
|
(i, e) => /* @__PURE__ */ Te(da, { ref: e, ...i })
|
|
12093
12125
|
);
|
|
12094
|
-
|
|
12095
|
-
const
|
|
12126
|
+
kd.displayName = "SimpleViewer";
|
|
12127
|
+
const Fd = () => /* @__PURE__ */ Te(
|
|
12096
12128
|
"span",
|
|
12097
12129
|
{
|
|
12098
12130
|
"aria-hidden": "true",
|
|
@@ -12107,9 +12139,9 @@ const Nd = () => /* @__PURE__ */ Te(
|
|
|
12107
12139
|
}
|
|
12108
12140
|
}
|
|
12109
12141
|
);
|
|
12110
|
-
function
|
|
12142
|
+
function Vd({ position: i, occlude: e = !1, children: t }) {
|
|
12111
12143
|
const { viewer: n } = oa(), s = Ve(null), [r, o, a] = i;
|
|
12112
|
-
|
|
12144
|
+
rt(() => {
|
|
12113
12145
|
if (!n)
|
|
12114
12146
|
return;
|
|
12115
12147
|
const u = s.current;
|
|
@@ -12131,13 +12163,13 @@ function Gd({ position: i, occlude: e = !1, children: t }) {
|
|
|
12131
12163
|
d.invalidate(), f();
|
|
12132
12164
|
};
|
|
12133
12165
|
f();
|
|
12134
|
-
const
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
|
|
12166
|
+
const y = n.getEvents(), S = [
|
|
12167
|
+
y.on("render:complete", f),
|
|
12168
|
+
y.on("controls:change", f),
|
|
12169
|
+
y.on("model:loaded", p)
|
|
12138
12170
|
];
|
|
12139
12171
|
return window.addEventListener("resize", p), () => {
|
|
12140
|
-
|
|
12172
|
+
S.forEach((_) => _()), window.removeEventListener("resize", p);
|
|
12141
12173
|
};
|
|
12142
12174
|
}, [n, r, o, a, e]);
|
|
12143
12175
|
const c = t != null && t !== !1;
|
|
@@ -12158,7 +12190,7 @@ function Gd({ position: i, occlude: e = !1, children: t }) {
|
|
|
12158
12190
|
// interactive custom children keep receiving pointer events.
|
|
12159
12191
|
pointerEvents: c ? "auto" : "none"
|
|
12160
12192
|
},
|
|
12161
|
-
children: c ? t : /* @__PURE__ */ Te(
|
|
12193
|
+
children: c ? t : /* @__PURE__ */ Te(Fd, {})
|
|
12162
12194
|
}
|
|
12163
12195
|
);
|
|
12164
12196
|
}
|
|
@@ -12167,9 +12199,9 @@ export {
|
|
|
12167
12199
|
Qe as C,
|
|
12168
12200
|
Ir as D,
|
|
12169
12201
|
Y as E,
|
|
12170
|
-
|
|
12202
|
+
Vd as H,
|
|
12171
12203
|
Ne as I,
|
|
12172
|
-
|
|
12204
|
+
Hd as L,
|
|
12173
12205
|
Ws as M,
|
|
12174
12206
|
$e as O,
|
|
12175
12207
|
k as R,
|
|
@@ -12177,14 +12209,14 @@ export {
|
|
|
12177
12209
|
nr as T,
|
|
12178
12210
|
sa as V,
|
|
12179
12211
|
ar as a,
|
|
12180
|
-
|
|
12212
|
+
Gd as b,
|
|
12181
12213
|
Bc as c,
|
|
12182
12214
|
Yo as d,
|
|
12183
12215
|
Z as e,
|
|
12184
12216
|
Ks as f,
|
|
12185
12217
|
Jc as g,
|
|
12186
12218
|
Oc as h,
|
|
12187
|
-
|
|
12219
|
+
kd as i,
|
|
12188
12220
|
Zi as j,
|
|
12189
12221
|
Lu as r
|
|
12190
12222
|
};
|