softbox 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThreePathTracingService-CaXZfNBg.js → ThreePathTracingService-C1nzzkD0.js} +1 -1
- package/dist/{ThreePathTracingService-CV1X4U4s.cjs → ThreePathTracingService-DMeHUmKM.cjs} +1 -1
- package/dist/{index-Boctv1Ta.cjs → index-BW9wb96V.cjs} +5 -5
- package/dist/{index-CWhSg5nm.js → index-CiNsCOOs.js} +567 -545
- 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
1
|
import { jsx as Te, jsxs as Zn } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as Nt, useState as An, useEffect as rt, useRef as je, useCallback as Mt, createContext as Xa, useContext as Ya, Component as qa, forwardRef as
|
|
2
|
+
import { useMemo as Nt, useState as An, useEffect as rt, useRef as je, useCallback as Mt, createContext as Xa, useContext as Ya, Component as qa, forwardRef as So, useImperativeHandle as $a } from "react";
|
|
3
3
|
import * as g from "three";
|
|
4
|
-
import { Box3 as
|
|
4
|
+
import { Box3 as bt, Matrix4 as ut, BufferAttribute as Kn, Vector3 as $, Line3 as kt, Plane as ts, Vector2 as pe, Triangle as Tn, BackSide as bo, DoubleSide as _o, REVISION as xo, Ray as Qi, FrontSide as Ri, Mesh as wt, LineSegments as Ji, LineLoop as er, Line as tr, Points as nr, Sphere as vo, BatchedMesh as Qa, TrianglesDrawMode as Ja, TriangleFanDrawMode as Mi, TriangleStripDrawMode as Ao, Loader as ec, LoaderUtils as Xn, FileLoader as Ro, MeshPhysicalMaterial as It, Color as sn, LinearSRGBColorSpace as Ge, SRGBColorSpace as Jn, SpotLight as tc, PointLight as Mo, DirectionalLight as nc, Quaternion as Rn, InstancedMesh as Co, InstancedBufferAttribute as sc, Object3D as sr, TextureLoader as ic, ImageBitmapLoader as rc, InterleavedBuffer as oc, InterleavedBufferAttribute as ac, LinearMipmapLinearFilter as Io, NearestMipmapLinearFilter as cc, LinearMipmapNearestFilter as lc, NearestMipmapNearestFilter as hc, LinearFilter as rn, NearestFilter as Po, RepeatWrapping as Ci, MirroredRepeatWrapping as uc, ClampToEdgeWrapping as dc, PointsMaterial as fc, Material as ti, LineBasicMaterial as pc, MeshStandardMaterial as js, MeshBasicMaterial as Wn, PropertyBinding as mc, BufferGeometry as gc, SkinnedMesh as yc, Group as ni, PerspectiveCamera as wc, MathUtils as ir, OrthographicCamera as Ec, Skeleton as Tc, AnimationClip as Sc, Bone as bc, InterpolateDiscrete as _c, InterpolateLinear as Lo, Texture as Cr, VectorKeyframeTrack as Ir, NumberKeyframeTrack as Pr, QuaternionKeyframeTrack as Lr, ColorManagement as Or, Interpolant as xc, Controls as Oo, MOUSE as Be, TOUCH as Ye, Spherical as Vs, Raycaster as vc, DataTextureLoader as Do, HalfFloatType as Zt, RGBAFormat as $t, RGFormat as On, DataUtils as Et, RedFormat as ms, FloatType as Yn, Scene as Ac, BoxGeometry as Rc, MeshLambertMaterial as Mc } from "three";
|
|
5
5
|
class W 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, W);
|
|
@@ -184,14 +184,14 @@ class Ic {
|
|
|
184
184
|
environmentIntensity: (f = r.environment) == null ? void 0 : f.environmentIntensity
|
|
185
185
|
}, u = (p = r.environment) == null ? void 0 : p.url;
|
|
186
186
|
if (u) {
|
|
187
|
-
const
|
|
187
|
+
const S = await t.loadEnvironmentMap(u);
|
|
188
188
|
if (o())
|
|
189
189
|
return;
|
|
190
|
-
|
|
190
|
+
S.ok ? t.applyToScene(e, S.value, c) : console.warn("Failed to load environment map:", S.error);
|
|
191
191
|
} else if ((y = r.helpers) != null && y.studioEnvironment) {
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
if (t.applyToScene(e,
|
|
192
|
+
const S = t.createStudioEnvironment();
|
|
193
|
+
if (S.ok) {
|
|
194
|
+
if (t.applyToScene(e, S.value, {
|
|
195
195
|
...c,
|
|
196
196
|
setBackground: !1
|
|
197
197
|
}), (_ = r.helpers) != null && _.darkStudioMode && n) {
|
|
@@ -202,7 +202,7 @@ class Ic {
|
|
|
202
202
|
v.ok || console.warn("Failed to set dark studio background:", v.error);
|
|
203
203
|
}
|
|
204
204
|
} else
|
|
205
|
-
console.warn("Failed to create studio environment:",
|
|
205
|
+
console.warn("Failed to create studio environment:", S.error);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -1078,8 +1078,8 @@ class zc {
|
|
|
1078
1078
|
const f = [];
|
|
1079
1079
|
let p = null, y = !1;
|
|
1080
1080
|
const _ = (v) => {
|
|
1081
|
-
y || (y = !0, this.pendingSettlers.delete(
|
|
1082
|
-
},
|
|
1081
|
+
y || (y = !0, this.pendingSettlers.delete(S), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((E) => E.stop()), h(v));
|
|
1082
|
+
}, S = () => {
|
|
1083
1083
|
_(
|
|
1084
1084
|
D.err(
|
|
1085
1085
|
new W("Viewer was disposed during video capture", Z.INVALID_STATE)
|
|
@@ -1090,7 +1090,7 @@ class zc {
|
|
|
1090
1090
|
} catch {
|
|
1091
1091
|
}
|
|
1092
1092
|
};
|
|
1093
|
-
this.pendingSettlers.add(
|
|
1093
|
+
this.pendingSettlers.add(S), r.ondataavailable = (v) => {
|
|
1094
1094
|
v.data.size > 0 && f.push(v.data);
|
|
1095
1095
|
}, r.onstop = () => {
|
|
1096
1096
|
_(D.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
|
|
@@ -1175,8 +1175,8 @@ class zc {
|
|
|
1175
1175
|
)
|
|
1176
1176
|
);
|
|
1177
1177
|
t.setPixelRatio(1), t.setSize(f, p), Ii(s, f / p);
|
|
1178
|
-
const _ = t.renderPostProcessed ? t.renderPostProcessed(n, s) : t.render(n, s),
|
|
1179
|
-
return t.setSize(u, d), t.setPixelRatio(a), Ii(s, h), t.render(n, s), r.requestRender(),
|
|
1178
|
+
const _ = t.renderPostProcessed ? t.renderPostProcessed(n, s) : t.render(n, s), S = _.ok ? this.readCanvasPng() : D.err(_.error);
|
|
1179
|
+
return t.setSize(u, d), t.setPixelRatio(a), Ii(s, h), t.render(n, s), r.requestRender(), S;
|
|
1180
1180
|
}
|
|
1181
1181
|
readCanvasPng() {
|
|
1182
1182
|
const e = Fo(this.deps.renderer.getDomElement());
|
|
@@ -1388,10 +1388,10 @@ class Bc {
|
|
|
1388
1388
|
* helpers — take effect at construction time and require a rebuild.
|
|
1389
1389
|
*/
|
|
1390
1390
|
updateOptions(e) {
|
|
1391
|
-
var y, _,
|
|
1391
|
+
var y, _, S, v, E, T, b, x, P, I, M;
|
|
1392
1392
|
if (this.disposed)
|
|
1393
1393
|
return;
|
|
1394
|
-
const t = (y = this.options.animations) == null ? void 0 : y.autoplay, n = (_ = this.options.controls) == null ? void 0 : _.autoRotate, s = ((
|
|
1394
|
+
const t = (y = this.options.animations) == null ? void 0 : y.autoplay, n = (_ = this.options.controls) == null ? void 0 : _.autoRotate, s = ((S = this.options.pathTracing) == null ? void 0 : S.enabled) ?? !1;
|
|
1395
1395
|
this.options = xn(this.options, e), "backgroundColorEdge" in e && (this.options.backgroundColorEdge = e.backgroundColorEdge);
|
|
1396
1396
|
let r = !1;
|
|
1397
1397
|
(e.backgroundColor !== void 0 || e.backgroundColorEdge !== void 0) && this.options.backgroundColor !== void 0 && this.applyBackgroundColor(this.options.backgroundColor);
|
|
@@ -1401,7 +1401,7 @@ class Bc {
|
|
|
1401
1401
|
c !== void 0 && (this.scene.setEnvironmentIntensity(c), r = !0);
|
|
1402
1402
|
const u = (T = e.controls) == null ? void 0 : T.autoRotate;
|
|
1403
1403
|
u !== void 0 && u !== n && (this.controls.autoRotate = u, u ? (this.renderLoopManager.requireContinuous("turntable"), this.capture.notifyTurntableEnabled()) : this.renderLoopManager.releaseContinuous("turntable"), r = !0);
|
|
1404
|
-
const d = (
|
|
1404
|
+
const d = (b = e.controls) == null ? void 0 : b.autoRotateSpeed;
|
|
1405
1405
|
d !== void 0 && (this.controls.autoRotateSpeed = d, r = !0);
|
|
1406
1406
|
const h = (x = e.animations) == null ? void 0 : x.autoplay;
|
|
1407
1407
|
h !== void 0 && h !== t && (h ? this.modelManager.getCurrentModel() && this.autoplayFromOptions(h) : this.pauseAnimations(), r = !0);
|
|
@@ -1739,7 +1739,7 @@ class Xt {
|
|
|
1739
1739
|
return new Xt(new g.Vector3(e, t, n));
|
|
1740
1740
|
}
|
|
1741
1741
|
}
|
|
1742
|
-
const Bo = 0, Uc = 1, Hc = 2, kr = 2, oi = 1.25, Fr = 1, qe = 32, Oe = qe / 4, or = 65535,
|
|
1742
|
+
const Bo = 0, Uc = 1, Hc = 2, kr = 2, oi = 1.25, Fr = 1, qe = 32, Oe = qe / 4, or = 65535, uf = or << 16, Us = Math.pow(2, -24), ar = Symbol("SKIP_GENERATION"), Uo = {
|
|
1743
1743
|
strategy: Bo,
|
|
1744
1744
|
maxDepth: 40,
|
|
1745
1745
|
maxLeafSize: 10,
|
|
@@ -1801,21 +1801,21 @@ function ze(i, e) {
|
|
|
1801
1801
|
function cr(i, e) {
|
|
1802
1802
|
return e[i + 7];
|
|
1803
1803
|
}
|
|
1804
|
-
function
|
|
1804
|
+
function df(i) {
|
|
1805
1805
|
return i;
|
|
1806
1806
|
}
|
|
1807
1807
|
function ai(i, e, t, n, s) {
|
|
1808
|
-
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, _ = -1 / 0,
|
|
1808
|
+
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, _ = -1 / 0, S = -1 / 0;
|
|
1809
1809
|
const v = i.offset || 0;
|
|
1810
1810
|
for (let E = (e - v) * 6, T = (e + t - v) * 6; E < T; E += 6) {
|
|
1811
|
-
const
|
|
1812
|
-
P < r && (r = P), I > c && (c = I),
|
|
1811
|
+
const b = i[E + 0], x = i[E + 1], P = b - x, I = b + x;
|
|
1812
|
+
P < r && (r = P), I > c && (c = I), b < h && (h = b), b > y && (y = b);
|
|
1813
1813
|
const M = i[E + 2], O = i[E + 3], C = M - O, k = M + O;
|
|
1814
1814
|
C < o && (o = C), k > u && (u = k), M < f && (f = M), M > _ && (_ = M);
|
|
1815
1815
|
const N = i[E + 4], G = i[E + 5], z = N - G, X = N + G;
|
|
1816
|
-
z < a && (a = z), X > d && (d = X), N < p && (p = N), N >
|
|
1816
|
+
z < a && (a = z), X > d && (d = X), N < p && (p = N), N > S && (S = N);
|
|
1817
1817
|
}
|
|
1818
|
-
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[5] =
|
|
1818
|
+
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[5] = S;
|
|
1819
1819
|
}
|
|
1820
1820
|
const Ot = 32, Gc = (i, e) => i.candidate - e.candidate, Ut = /* @__PURE__ */ new Array(Ot).fill().map(() => ({
|
|
1821
1821
|
count: 0,
|
|
@@ -1853,20 +1853,20 @@ function jc(i, e, t, n, s, r) {
|
|
|
1853
1853
|
ys(x, t, I);
|
|
1854
1854
|
}
|
|
1855
1855
|
E.sort(Gc);
|
|
1856
|
-
let
|
|
1857
|
-
for (let x = 0; x <
|
|
1856
|
+
let b = s;
|
|
1857
|
+
for (let x = 0; x < b; x++) {
|
|
1858
1858
|
const P = E[x];
|
|
1859
|
-
for (; x + 1 <
|
|
1860
|
-
E.splice(x + 1, 1),
|
|
1859
|
+
for (; x + 1 < b && E[x + 1].candidate === P.candidate; )
|
|
1860
|
+
E.splice(x + 1, 1), b--;
|
|
1861
1861
|
}
|
|
1862
1862
|
for (let x = h; x < f; x += 6) {
|
|
1863
1863
|
const P = t[x + 2 * p];
|
|
1864
|
-
for (let I = 0; I <
|
|
1864
|
+
for (let I = 0; I < b; I++) {
|
|
1865
1865
|
const M = E[I];
|
|
1866
1866
|
P >= M.candidate ? ys(x, t, M.rightCacheBounds) : (ys(x, t, M.leftCacheBounds), M.count++);
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
for (let x = 0; x <
|
|
1869
|
+
for (let x = 0; x < b; x++) {
|
|
1870
1870
|
const P = E[x], I = P.count, M = s - P.count, O = P.leftCacheBounds, C = P.rightCacheBounds;
|
|
1871
1871
|
let k = 0;
|
|
1872
1872
|
I !== 0 && (k = Dn(O) / c);
|
|
@@ -1876,28 +1876,28 @@ function jc(i, e, t, n, s, r) {
|
|
|
1876
1876
|
G < u && (o = p, u = G, a = P.candidate);
|
|
1877
1877
|
}
|
|
1878
1878
|
} else {
|
|
1879
|
-
for (let
|
|
1880
|
-
const x = Ut[
|
|
1881
|
-
x.count = 0, x.candidate = y + v +
|
|
1879
|
+
for (let b = 0; b < Ot; b++) {
|
|
1880
|
+
const x = Ut[b];
|
|
1881
|
+
x.count = 0, x.candidate = y + v + b * v;
|
|
1882
1882
|
const P = x.bounds;
|
|
1883
1883
|
for (let I = 0; I < 3; I++)
|
|
1884
1884
|
P[I] = 1 / 0, P[I + 3] = -1 / 0;
|
|
1885
1885
|
}
|
|
1886
|
-
for (let
|
|
1887
|
-
let I = ~~((t[
|
|
1886
|
+
for (let b = h; b < f; b += 6) {
|
|
1887
|
+
let I = ~~((t[b + 2 * p] - y) / v);
|
|
1888
1888
|
I >= Ot && (I = Ot - 1);
|
|
1889
1889
|
const M = Ut[I];
|
|
1890
|
-
M.count++, ys(
|
|
1890
|
+
M.count++, ys(b, t, M.bounds);
|
|
1891
1891
|
}
|
|
1892
1892
|
const E = Ut[Ot - 1];
|
|
1893
1893
|
Br(E.bounds, E.rightCacheBounds);
|
|
1894
|
-
for (let
|
|
1895
|
-
const x = Ut[
|
|
1894
|
+
for (let b = Ot - 2; b >= 0; b--) {
|
|
1895
|
+
const x = Ut[b], P = Ut[b + 1];
|
|
1896
1896
|
Ur(x.bounds, P.rightCacheBounds, x.rightCacheBounds);
|
|
1897
1897
|
}
|
|
1898
1898
|
let T = 0;
|
|
1899
|
-
for (let
|
|
1900
|
-
const x = Ut[
|
|
1899
|
+
for (let b = 0; b < Ot - 1; b++) {
|
|
1900
|
+
const x = Ut[b], P = x.count, I = x.bounds, O = Ut[b + 1].rightCacheBounds;
|
|
1901
1901
|
P !== 0 && (T === 0 ? Br(I, ws) : Ur(I, ws, ws)), T += P;
|
|
1902
1902
|
let C = 0, k = 0;
|
|
1903
1903
|
T !== 0 && (C = Dn(ws) / c);
|
|
@@ -1980,23 +1980,23 @@ function Xc(i, e, t, n, s, r) {
|
|
|
1980
1980
|
let y = !1;
|
|
1981
1981
|
const _ = new ci();
|
|
1982
1982
|
return ai(e, t, n, _.boundingData, p), v(_, t, n, p), _;
|
|
1983
|
-
function
|
|
1983
|
+
function S(E) {
|
|
1984
1984
|
d && d((E - r.offset) / r.count);
|
|
1985
1985
|
}
|
|
1986
|
-
function v(E, T,
|
|
1987
|
-
if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)),
|
|
1988
|
-
return
|
|
1989
|
-
const I = jc(E.boundingData, x, e, T,
|
|
1986
|
+
function v(E, T, b, x = null, P = 0) {
|
|
1987
|
+
if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), b <= c || P >= o)
|
|
1988
|
+
return S(T + b), E.offset = T, E.count = b, E;
|
|
1989
|
+
const I = jc(E.boundingData, x, e, T, b, u);
|
|
1990
1990
|
if (I.axis === -1)
|
|
1991
|
-
return
|
|
1992
|
-
const M = Wc(h, f, e, T,
|
|
1993
|
-
if (M === T || M === T +
|
|
1994
|
-
|
|
1991
|
+
return S(T + b), E.offset = T, E.count = b, E;
|
|
1992
|
+
const M = Wc(h, f, e, T, b, I);
|
|
1993
|
+
if (M === T || M === T + b)
|
|
1994
|
+
S(T + b), E.offset = T, E.count = b;
|
|
1995
1995
|
else {
|
|
1996
1996
|
E.splitAxis = I.axis;
|
|
1997
1997
|
const O = new ci(), C = T, k = M - T;
|
|
1998
1998
|
E.left = O, ai(e, C, k, O.boundingData, p), v(O, C, k, p, P + 1);
|
|
1999
|
-
const N = new ci(), G = M, z =
|
|
1999
|
+
const N = new ci(), G = M, z = b - k;
|
|
2000
2000
|
E.right = N, ai(e, G, z, N.boundingData, p), v(N, G, z, p, P + 1);
|
|
2001
2001
|
}
|
|
2002
2002
|
return E;
|
|
@@ -2037,14 +2037,14 @@ class qc {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
}
|
|
2039
2039
|
const _e = /* @__PURE__ */ new qc();
|
|
2040
|
-
let Kt,
|
|
2041
|
-
const hn = [], Es = /* @__PURE__ */ new lr(() => new
|
|
2040
|
+
let Kt, bn;
|
|
2041
|
+
const hn = [], Es = /* @__PURE__ */ new lr(() => new bt());
|
|
2042
2042
|
function $c(i, e, t, n, s, r) {
|
|
2043
|
-
Kt = Es.getPrimitive(),
|
|
2043
|
+
Kt = Es.getPrimitive(), bn = Es.getPrimitive(), hn.push(Kt, bn), _e.setBuffer(i._roots[e]);
|
|
2044
2044
|
const o = Di(0, i.geometry, t, n, s, r);
|
|
2045
|
-
_e.clearBuffer(), Es.releasePrimitive(Kt), Es.releasePrimitive(
|
|
2045
|
+
_e.clearBuffer(), Es.releasePrimitive(Kt), Es.releasePrimitive(bn), hn.pop(), hn.pop();
|
|
2046
2046
|
const a = hn.length;
|
|
2047
|
-
return a > 0 && (
|
|
2047
|
+
return a > 0 && (bn = hn[a - 1], Kt = hn[a - 2]), o;
|
|
2048
2048
|
}
|
|
2049
2049
|
function Di(i, e, t, n, s = null, r = 0, o = 0) {
|
|
2050
2050
|
const { float32Array: a, uint16Array: c, uint32Array: u } = _e;
|
|
@@ -2067,14 +2067,14 @@ function Di(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
2067
2067
|
return $e(N, z) + Qe(X, G);
|
|
2068
2068
|
};
|
|
2069
2069
|
const f = Fe(i), p = ze(i, u);
|
|
2070
|
-
let y = f, _ = p,
|
|
2071
|
-
if (s && (E = Kt, T =
|
|
2070
|
+
let y = f, _ = p, S, v, E, T;
|
|
2071
|
+
if (s && (E = Kt, T = bn, ve(y, a, E), ve(_, a, T), S = s(E), v = s(T), v < S)) {
|
|
2072
2072
|
y = p, _ = f;
|
|
2073
|
-
const N =
|
|
2074
|
-
|
|
2073
|
+
const N = S;
|
|
2074
|
+
S = v, v = N, E = T;
|
|
2075
2075
|
}
|
|
2076
2076
|
E || (E = Kt, ve(y, a, E));
|
|
2077
|
-
const
|
|
2077
|
+
const b = De(y * 2, c), x = t(E, b, S, o + 1, r + y / Oe);
|
|
2078
2078
|
let P;
|
|
2079
2079
|
if (x === kr) {
|
|
2080
2080
|
const N = C(y), z = k(y) - N;
|
|
@@ -2090,7 +2090,7 @@ function Di(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
2090
2090
|
o + 1
|
|
2091
2091
|
);
|
|
2092
2092
|
if (P) return !0;
|
|
2093
|
-
T =
|
|
2093
|
+
T = bn, ve(_, a, T);
|
|
2094
2094
|
const I = De(_ * 2, c), M = t(T, I, v, o + 1, r + _ / Oe);
|
|
2095
2095
|
let O;
|
|
2096
2096
|
if (M === kr) {
|
|
@@ -2109,7 +2109,7 @@ function Di(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
2109
2109
|
return !!O;
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
|
-
const qn = /* @__PURE__ */ new _e.constructor(), Ws = /* @__PURE__ */ new _e.constructor(), Vt = /* @__PURE__ */ new lr(() => new
|
|
2112
|
+
const qn = /* @__PURE__ */ new _e.constructor(), Ws = /* @__PURE__ */ new _e.constructor(), Vt = /* @__PURE__ */ new lr(() => new bt()), un = /* @__PURE__ */ new bt(), dn = /* @__PURE__ */ new bt(), li = /* @__PURE__ */ new bt(), hi = /* @__PURE__ */ new bt();
|
|
2113
2113
|
let ui = !1;
|
|
2114
2114
|
function Qc(i, e, t, n) {
|
|
2115
2115
|
if (ui)
|
|
@@ -2143,7 +2143,7 @@ function Qc(i, e, t, n) {
|
|
|
2143
2143
|
function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
2144
2144
|
let h, f;
|
|
2145
2145
|
d ? (h = Ws, f = qn) : (h = qn, f = Ws);
|
|
2146
|
-
const p = h.float32Array, y = h.uint32Array, _ = h.uint16Array,
|
|
2146
|
+
const p = h.float32Array, y = h.uint32Array, _ = h.uint16Array, S = f.float32Array, v = f.uint32Array, E = f.uint16Array, T = i * 2, b = e * 2, x = De(T, _), P = De(b, E);
|
|
2147
2147
|
let I = !1;
|
|
2148
2148
|
if (P && x)
|
|
2149
2149
|
d ? I = s(
|
|
@@ -2167,7 +2167,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2167
2167
|
);
|
|
2168
2168
|
else if (P) {
|
|
2169
2169
|
const M = Vt.getPrimitive();
|
|
2170
|
-
ve(e,
|
|
2170
|
+
ve(e, S, M), M.applyMatrix4(t);
|
|
2171
2171
|
const O = Fe(i), C = ze(i, y);
|
|
2172
2172
|
ve(O, p, un), ve(C, p, dn);
|
|
2173
2173
|
const k = M.intersectsBox(un), N = M.intersectsBox(dn);
|
|
@@ -2198,7 +2198,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2198
2198
|
), Vt.releasePrimitive(M);
|
|
2199
2199
|
} else {
|
|
2200
2200
|
const M = Fe(e), O = ze(e, v);
|
|
2201
|
-
ve(M,
|
|
2201
|
+
ve(M, S, li), ve(O, S, hi);
|
|
2202
2202
|
const C = u.intersectsBox(li), k = u.intersectsBox(hi);
|
|
2203
2203
|
if (C && k)
|
|
2204
2204
|
I = gt(
|
|
@@ -2323,7 +2323,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2323
2323
|
}
|
|
2324
2324
|
return I;
|
|
2325
2325
|
}
|
|
2326
|
-
const Hr = /* @__PURE__ */ new
|
|
2326
|
+
const Hr = /* @__PURE__ */ new bt(), fn = /* @__PURE__ */ new Float32Array(6);
|
|
2327
2327
|
class Jc {
|
|
2328
2328
|
constructor() {
|
|
2329
2329
|
this._roots = null, this.primitiveBuffer = null, this.primitiveBufferStride = null;
|
|
@@ -2348,8 +2348,8 @@ class Jc {
|
|
|
2348
2348
|
let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0;
|
|
2349
2349
|
for (let h = e, f = e + t; h < f; h++) {
|
|
2350
2350
|
this.writePrimitiveBounds(h, fn, 0);
|
|
2351
|
-
const [p, y, _,
|
|
2352
|
-
p < r && (r = p),
|
|
2351
|
+
const [p, y, _, S, v, E] = fn;
|
|
2352
|
+
p < r && (r = p), S > c && (c = S), y < o && (o = y), v > u && (u = v), _ < a && (a = _), E > d && (d = E);
|
|
2353
2353
|
}
|
|
2354
2354
|
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;
|
|
2355
2355
|
}
|
|
@@ -2357,8 +2357,8 @@ class Jc {
|
|
|
2357
2357
|
const s = n.offset || 0;
|
|
2358
2358
|
for (let r = e, o = e + t; r < o; r++) {
|
|
2359
2359
|
this.writePrimitiveBounds(r, fn, 0);
|
|
2360
|
-
const [a, c, u, d, h, f] = fn, p = (a + d) / 2, y = (c + h) / 2, _ = (u + f) / 2,
|
|
2361
|
-
n[T + 0] = p, n[T + 1] =
|
|
2360
|
+
const [a, c, u, d, h, f] = fn, p = (a + d) / 2, y = (c + h) / 2, _ = (u + f) / 2, S = (d - a) / 2, v = (h - c) / 2, E = (f - u) / 2, T = (r - s) * 6;
|
|
2361
|
+
n[T + 0] = p, n[T + 1] = S + (Math.abs(p) + S) * Us, n[T + 2] = y, n[T + 3] = v + (Math.abs(y) + v) * Us, n[T + 4] = _, n[T + 5] = E + (Math.abs(_) + E) * Us;
|
|
2362
2362
|
}
|
|
2363
2363
|
return n;
|
|
2364
2364
|
}
|
|
@@ -2423,8 +2423,8 @@ class Jc {
|
|
|
2423
2423
|
} else {
|
|
2424
2424
|
const p = Fe(d), y = ze(d, r);
|
|
2425
2425
|
for (let _ = 0; _ < 3; _++) {
|
|
2426
|
-
const
|
|
2427
|
-
a[d + _] =
|
|
2426
|
+
const S = a[p + _], v = a[p + _ + 3], E = a[y + _], T = a[y + _ + 3];
|
|
2427
|
+
a[d + _] = S < E ? S : E, a[d + _ + 3] = v > T ? v : T;
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
@@ -2466,7 +2466,7 @@ class Jc {
|
|
|
2466
2466
|
} = e;
|
|
2467
2467
|
if (s && r) {
|
|
2468
2468
|
const h = s;
|
|
2469
|
-
s = (f, p, y, _,
|
|
2469
|
+
s = (f, p, y, _, S) => h(f, p, y, _, S) ? !0 : a(f, p, this, r, y, _, o);
|
|
2470
2470
|
} else s || (r ? s = (h, f, p, y) => a(h, f, this, r, p, y, o) : s = (h, f, p) => p);
|
|
2471
2471
|
let c = !1, u = 0;
|
|
2472
2472
|
const d = this._roots;
|
|
@@ -2533,7 +2533,7 @@ function Gr(i, e, t) {
|
|
|
2533
2533
|
return [n];
|
|
2534
2534
|
const r = [], o = n.offset, a = n.offset + n.count, c = hr(i) / t, u = [];
|
|
2535
2535
|
for (const f of s) {
|
|
2536
|
-
const { offset: p, count: y } = f, _ = p,
|
|
2536
|
+
const { offset: p, count: y } = f, _ = p, S = isFinite(y) ? y : c - p, v = p + S;
|
|
2537
2537
|
_ < a && v > o && (u.push({ pos: Math.max(o, _), isStart: !0 }), u.push({ pos: Math.min(a, v), isStart: !1 }));
|
|
2538
2538
|
}
|
|
2539
2539
|
u.sort((f, p) => f.pos !== p.pos ? f.pos - p.pos : f.type === "end" ? -1 : 1);
|
|
@@ -2599,7 +2599,7 @@ class ol extends Jc {
|
|
|
2599
2599
|
this._indirectBuffer = r;
|
|
2600
2600
|
} else
|
|
2601
2601
|
nl(t, e);
|
|
2602
|
-
super.init(e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new
|
|
2602
|
+
super.init(e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new bt()));
|
|
2603
2603
|
}
|
|
2604
2604
|
// Abstract methods to be implemented by subclasses
|
|
2605
2605
|
getRootRanges(e) {
|
|
@@ -2653,9 +2653,9 @@ const al = /* @__PURE__ */ (function() {
|
|
|
2653
2653
|
return function(s, r, o) {
|
|
2654
2654
|
const a = s.start, c = i, u = r.start, d = e;
|
|
2655
2655
|
t.subVectors(a, u), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
|
|
2656
|
-
const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c),
|
|
2656
|
+
const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c), S = c.dot(c) * p - f * f;
|
|
2657
2657
|
let v, E;
|
|
2658
|
-
|
|
2658
|
+
S !== 0 ? v = (h * f - y * p) / S : v = 0, E = (h + v * f) / p, o.x = v, o.y = E;
|
|
2659
2659
|
};
|
|
2660
2660
|
})(), ur = /* @__PURE__ */ (function() {
|
|
2661
2661
|
const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
|
|
@@ -2723,8 +2723,8 @@ class Tt extends Tn {
|
|
|
2723
2723
|
h.subVectors(t, n), f.setFromPoints(h, s);
|
|
2724
2724
|
const p = r[3], y = o[3];
|
|
2725
2725
|
p.subVectors(n, e), y.setFromPoints(p, s);
|
|
2726
|
-
const _ = u.length(),
|
|
2727
|
-
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, _ < Dt ?
|
|
2726
|
+
const _ = u.length(), S = h.length(), v = p.length();
|
|
2727
|
+
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, _ < Dt ? S < Dt || v < Dt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : S < Dt ? v < Dt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : v < Dt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
|
|
2728
2728
|
}
|
|
2729
2729
|
}
|
|
2730
2730
|
Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
@@ -2741,56 +2741,56 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
|
2741
2741
|
})();
|
|
2742
2742
|
Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
2743
2743
|
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new Ft(), t = /* @__PURE__ */ new Ft(), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $(), r = /* @__PURE__ */ new $(), o = /* @__PURE__ */ new $(), a = /* @__PURE__ */ new kt(), c = /* @__PURE__ */ new kt(), u = /* @__PURE__ */ new $(), d = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
|
|
2744
|
-
function f(T,
|
|
2744
|
+
function f(T, b, x, P) {
|
|
2745
2745
|
const I = n;
|
|
2746
|
-
!T.isDegenerateIntoPoint && !T.isDegenerateIntoSegment ? I.copy(T.plane.normal) : I.copy(
|
|
2746
|
+
!T.isDegenerateIntoPoint && !T.isDegenerateIntoSegment ? I.copy(T.plane.normal) : I.copy(b.plane.normal);
|
|
2747
2747
|
const M = T.satBounds, O = T.satAxes;
|
|
2748
2748
|
for (let N = 1; N < 4; N++) {
|
|
2749
2749
|
const G = M[N], z = O[N];
|
|
2750
|
-
if (e.setFromPoints(z,
|
|
2750
|
+
if (e.setFromPoints(z, b.points), G.isSeparated(e) || (o.copy(I).cross(z), e.setFromPoints(o, T.points), t.setFromPoints(o, b.points), e.isSeparated(t))) return !1;
|
|
2751
2751
|
}
|
|
2752
|
-
const C =
|
|
2752
|
+
const C = b.satBounds, k = b.satAxes;
|
|
2753
2753
|
for (let N = 1; N < 4; N++) {
|
|
2754
2754
|
const G = C[N], z = k[N];
|
|
2755
|
-
if (e.setFromPoints(z, T.points), G.isSeparated(e) || (o.crossVectors(I, z), e.setFromPoints(o, T.points), t.setFromPoints(o,
|
|
2755
|
+
if (e.setFromPoints(z, T.points), G.isSeparated(e) || (o.crossVectors(I, z), e.setFromPoints(o, T.points), t.setFromPoints(o, b.points), e.isSeparated(t))) return !1;
|
|
2756
2756
|
}
|
|
2757
2757
|
return x && (P || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), x.start.set(0, 0, 0), x.end.set(0, 0, 0)), !0;
|
|
2758
2758
|
}
|
|
2759
|
-
function p(T,
|
|
2759
|
+
function p(T, b, x, P, I, M, O, C, k, N, G) {
|
|
2760
2760
|
let z = O / (O - C);
|
|
2761
|
-
N.x = P + (I - P) * z, G.start.subVectors(
|
|
2761
|
+
N.x = P + (I - P) * z, G.start.subVectors(b, T).multiplyScalar(z).add(T), z = O / (O - k), N.y = P + (M - P) * z, G.end.subVectors(x, T).multiplyScalar(z).add(T);
|
|
2762
2762
|
}
|
|
2763
|
-
function y(T,
|
|
2763
|
+
function y(T, b, x, P, I, M, O, C, k, N, G) {
|
|
2764
2764
|
if (I > 0)
|
|
2765
|
-
p(T.c, T.a, T.b, P,
|
|
2765
|
+
p(T.c, T.a, T.b, P, b, x, k, O, C, N, G);
|
|
2766
2766
|
else if (M > 0)
|
|
2767
|
-
p(T.b, T.a, T.c, x,
|
|
2767
|
+
p(T.b, T.a, T.c, x, b, P, C, O, k, N, G);
|
|
2768
2768
|
else if (C * k > 0 || O != 0)
|
|
2769
|
-
p(T.a, T.b, T.c,
|
|
2769
|
+
p(T.a, T.b, T.c, b, x, P, O, C, k, N, G);
|
|
2770
2770
|
else if (C != 0)
|
|
2771
|
-
p(T.b, T.a, T.c, x,
|
|
2771
|
+
p(T.b, T.a, T.c, x, b, P, C, O, k, N, G);
|
|
2772
2772
|
else if (k != 0)
|
|
2773
|
-
p(T.c, T.a, T.b, P,
|
|
2773
|
+
p(T.c, T.a, T.b, P, b, x, k, O, C, N, G);
|
|
2774
2774
|
else
|
|
2775
2775
|
return !0;
|
|
2776
2776
|
return !1;
|
|
2777
2777
|
}
|
|
2778
|
-
function _(T,
|
|
2779
|
-
const I =
|
|
2780
|
-
return at(M) ? at(O) ? f(T,
|
|
2778
|
+
function _(T, b, x, P) {
|
|
2779
|
+
const I = b.degenerateSegment, M = T.plane.distanceToPoint(I.start), O = T.plane.distanceToPoint(I.end);
|
|
2780
|
+
return at(M) ? at(O) ? f(T, b, x, P) : (x && (x.start.copy(I.start), x.end.copy(I.start)), T.containsPoint(I.start)) : at(O) ? (x && (x.start.copy(I.end), x.end.copy(I.end)), T.containsPoint(I.end)) : T.plane.intersectLine(I, n) != null ? (x && (x.start.copy(n), x.end.copy(n)), T.containsPoint(n)) : !1;
|
|
2781
2781
|
}
|
|
2782
|
-
function
|
|
2783
|
-
const P =
|
|
2782
|
+
function S(T, b, x) {
|
|
2783
|
+
const P = b.a;
|
|
2784
2784
|
return at(T.plane.distanceToPoint(P)) && T.containsPoint(P) ? (x && (x.start.copy(P), x.end.copy(P)), !0) : !1;
|
|
2785
2785
|
}
|
|
2786
|
-
function v(T,
|
|
2787
|
-
const P = T.degenerateSegment, I =
|
|
2786
|
+
function v(T, b, x) {
|
|
2787
|
+
const P = T.degenerateSegment, I = b.a;
|
|
2788
2788
|
return P.closestPointToPoint(I, !0, n), I.distanceToSquared(n) < jr ? (x && (x.start.copy(I), x.end.copy(I)), !0) : !1;
|
|
2789
2789
|
}
|
|
2790
|
-
function E(T,
|
|
2790
|
+
function E(T, b, x, P) {
|
|
2791
2791
|
if (T.isDegenerateIntoSegment)
|
|
2792
|
-
if (
|
|
2793
|
-
const I = T.degenerateSegment, M =
|
|
2792
|
+
if (b.isDegenerateIntoSegment) {
|
|
2793
|
+
const I = T.degenerateSegment, M = b.degenerateSegment, O = s, C = r;
|
|
2794
2794
|
I.delta(O), M.delta(C);
|
|
2795
2795
|
const k = n.subVectors(M.start, I.start), N = O.x * C.y - O.y * C.x;
|
|
2796
2796
|
if (at(N))
|
|
@@ -2800,28 +2800,28 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2800
2800
|
return !1;
|
|
2801
2801
|
const X = I.start.z + O.z * G, ie = M.start.z + C.z * z;
|
|
2802
2802
|
return at(X - ie) ? (x && (x.start.copy(I.start).addScaledVector(O, G), x.end.copy(I.start).addScaledVector(O, G)), !0) : !1;
|
|
2803
|
-
} else return
|
|
2803
|
+
} else return b.isDegenerateIntoPoint ? v(T, b, x) : _(b, T, x, P);
|
|
2804
2804
|
else {
|
|
2805
2805
|
if (T.isDegenerateIntoPoint)
|
|
2806
|
-
return
|
|
2807
|
-
if (
|
|
2808
|
-
return
|
|
2809
|
-
if (
|
|
2810
|
-
return _(T,
|
|
2806
|
+
return b.isDegenerateIntoPoint ? b.a.distanceToSquared(T.a) < jr ? (x && (x.start.copy(T.a), x.end.copy(T.a)), !0) : !1 : b.isDegenerateIntoSegment ? v(b, T, x) : S(b, T, x);
|
|
2807
|
+
if (b.isDegenerateIntoPoint)
|
|
2808
|
+
return S(T, b, x);
|
|
2809
|
+
if (b.isDegenerateIntoSegment)
|
|
2810
|
+
return _(T, b, x, P);
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
|
-
return function(
|
|
2814
|
-
this.needsUpdate && this.update(),
|
|
2815
|
-
const I = E(this,
|
|
2813
|
+
return function(b, x = null, P = !1) {
|
|
2814
|
+
this.needsUpdate && this.update(), b.isExtendedTriangle ? b.needsUpdate && b.update() : (i.copy(b), i.update(), b = i);
|
|
2815
|
+
const I = E(this, b, x, P);
|
|
2816
2816
|
if (I !== void 0)
|
|
2817
2817
|
return I;
|
|
2818
|
-
const M = this.plane, O =
|
|
2818
|
+
const M = this.plane, O = b.plane;
|
|
2819
2819
|
let C = O.distanceToPoint(this.a), k = O.distanceToPoint(this.b), N = O.distanceToPoint(this.c);
|
|
2820
2820
|
at(C) && (C = 0), at(k) && (k = 0), at(N) && (N = 0);
|
|
2821
2821
|
const G = C * k, z = C * N;
|
|
2822
2822
|
if (G > 0 && z > 0)
|
|
2823
2823
|
return !1;
|
|
2824
|
-
let X = M.distanceToPoint(
|
|
2824
|
+
let X = M.distanceToPoint(b.a), ie = M.distanceToPoint(b.b), Ne = M.distanceToPoint(b.c);
|
|
2825
2825
|
at(X) && (X = 0), at(ie) && (ie = 0), at(Ne) && (Ne = 0);
|
|
2826
2826
|
const dt = X * ie, Me = X * Ne;
|
|
2827
2827
|
if (dt > 0 && Me > 0)
|
|
@@ -2831,11 +2831,11 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2831
2831
|
let Ve = 0, Ae = Math.abs(Ue.x);
|
|
2832
2832
|
const ge = Math.abs(Ue.y);
|
|
2833
2833
|
ge > Ae && (Ae = ge, Ve = 1), Math.abs(Ue.z) > Ae && (Ve = 2);
|
|
2834
|
-
const We = ll[Ve], zt = this.a[We], me = this.b[We], ft = this.c[We], pt =
|
|
2834
|
+
const We = ll[Ve], zt = this.a[We], me = this.b[We], ft = this.c[We], pt = b.a[We], Cn = b.b[We], an = b.c[We];
|
|
2835
2835
|
if (y(this, zt, me, ft, G, z, C, k, N, d, a))
|
|
2836
|
-
return f(this,
|
|
2837
|
-
if (y(
|
|
2838
|
-
return f(this,
|
|
2836
|
+
return f(this, b, x, P);
|
|
2837
|
+
if (y(b, pt, Cn, an, dt, Me, X, ie, Ne, h, c))
|
|
2838
|
+
return f(this, b, x, P);
|
|
2839
2839
|
if (d.y < d.x) {
|
|
2840
2840
|
const Lt = d.y;
|
|
2841
2841
|
d.y = d.x, d.x = Lt, u.copy(a.start), a.start.copy(a.end), a.end.copy(u);
|
|
@@ -2871,8 +2871,8 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
|
2871
2871
|
const f = t[h], p = t[(h + 1) % 3];
|
|
2872
2872
|
n.set(this[f], this[p]);
|
|
2873
2873
|
for (let y = 0; y < 3; y++) {
|
|
2874
|
-
const _ = t[y],
|
|
2875
|
-
s.set(o[_], o[
|
|
2874
|
+
const _ = t[y], S = t[(y + 1) % 3];
|
|
2875
|
+
s.set(o[_], o[S]), ur(n, s, i, e);
|
|
2876
2876
|
const v = i.distanceToSquared(e);
|
|
2877
2877
|
v < d && (d = v, a && a.copy(i), c && c.copy(e));
|
|
2878
2878
|
}
|
|
@@ -2971,38 +2971,38 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
2971
2971
|
return (c || u) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), u && u.copy(s)), 0;
|
|
2972
2972
|
const d = a * a, h = o.min, f = o.max, p = this.points;
|
|
2973
2973
|
let y = 1 / 0;
|
|
2974
|
-
for (let
|
|
2975
|
-
const v = p[
|
|
2974
|
+
for (let S = 0; S < 8; S++) {
|
|
2975
|
+
const v = p[S];
|
|
2976
2976
|
s.copy(v).clamp(h, f);
|
|
2977
2977
|
const E = v.distanceToSquared(s);
|
|
2978
2978
|
if (E < y && (y = E, c && c.copy(v), u && u.copy(s), E < d))
|
|
2979
2979
|
return Math.sqrt(E);
|
|
2980
2980
|
}
|
|
2981
2981
|
let _ = 0;
|
|
2982
|
-
for (let
|
|
2982
|
+
for (let S = 0; S < 3; S++)
|
|
2983
2983
|
for (let v = 0; v <= 1; v++)
|
|
2984
2984
|
for (let E = 0; E <= 1; E++) {
|
|
2985
|
-
const T = (
|
|
2985
|
+
const T = (S + 1) % 3, b = (S + 2) % 3, x = v << T | E << b, P = 1 << S | v << T | E << b, I = p[x], M = p[P];
|
|
2986
2986
|
e[_].set(I, M);
|
|
2987
|
-
const C = i[
|
|
2987
|
+
const C = i[S], k = i[T], N = i[b], G = t[_], z = G.start, X = G.end;
|
|
2988
2988
|
z[C] = h[C], z[k] = v ? h[k] : f[k], z[N] = E ? h[N] : f[k], X[C] = f[C], X[k] = v ? h[k] : f[k], X[N] = E ? h[N] : f[k], _++;
|
|
2989
2989
|
}
|
|
2990
|
-
for (let
|
|
2990
|
+
for (let S = 0; S <= 1; S++)
|
|
2991
2991
|
for (let v = 0; v <= 1; v++)
|
|
2992
2992
|
for (let E = 0; E <= 1; E++) {
|
|
2993
|
-
s.x =
|
|
2993
|
+
s.x = S ? f.x : h.x, s.y = v ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
|
|
2994
2994
|
const T = s.distanceToSquared(n);
|
|
2995
2995
|
if (T < y && (y = T, c && c.copy(n), u && u.copy(s), T < d))
|
|
2996
2996
|
return Math.sqrt(T);
|
|
2997
2997
|
}
|
|
2998
|
-
for (let
|
|
2999
|
-
const v = e[
|
|
2998
|
+
for (let S = 0; S < 12; S++) {
|
|
2999
|
+
const v = e[S];
|
|
3000
3000
|
for (let E = 0; E < 12; E++) {
|
|
3001
3001
|
const T = t[E];
|
|
3002
3002
|
ur(v, T, n, s);
|
|
3003
|
-
const
|
|
3004
|
-
if (
|
|
3005
|
-
return Math.sqrt(
|
|
3003
|
+
const b = n.distanceToSquared(s);
|
|
3004
|
+
if (b < y && (y = b, c && c.copy(n), u && u.copy(s), b < d))
|
|
3005
|
+
return Math.sqrt(b);
|
|
3006
3006
|
}
|
|
3007
3007
|
}
|
|
3008
3008
|
return Math.sqrt(y);
|
|
@@ -3031,10 +3031,10 @@ function ul(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
|
3031
3031
|
const u = Math.sqrt(a);
|
|
3032
3032
|
return t.point ? t.point.copy(di) : t.point = di.clone(), t.distance = u, t.faceIndex = c, t;
|
|
3033
3033
|
}
|
|
3034
|
-
const Ts = parseInt(xo) >= 169, dl = parseInt(xo) <= 161, Qt = /* @__PURE__ */ new $(), Jt = /* @__PURE__ */ new $(), en = /* @__PURE__ */ new $(),
|
|
3034
|
+
const Ts = parseInt(xo) >= 169, dl = parseInt(xo) <= 161, Qt = /* @__PURE__ */ new $(), Jt = /* @__PURE__ */ new $(), en = /* @__PURE__ */ new $(), Ss = /* @__PURE__ */ new pe(), bs = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Vr = /* @__PURE__ */ new $(), Wr = /* @__PURE__ */ new $(), Zr = /* @__PURE__ */ new $(), kn = /* @__PURE__ */ new $();
|
|
3035
3035
|
function fl(i, e, t, n, s, r, o, a) {
|
|
3036
3036
|
let c;
|
|
3037
|
-
if (r ===
|
|
3037
|
+
if (r === bo ? c = i.intersectTriangle(n, t, e, !0, s) : c = i.intersectTriangle(e, t, n, r !== _o, s), c === null) return null;
|
|
3038
3038
|
const u = i.origin.distanceTo(s);
|
|
3039
3039
|
return u < o || u > a ? null : {
|
|
3040
3040
|
distance: u,
|
|
@@ -3046,13 +3046,13 @@ function Kr(i, e, t, n, s, r, o, a, c, u, d) {
|
|
|
3046
3046
|
const h = fl(i, Qt, Jt, en, kn, c, u, d);
|
|
3047
3047
|
if (h) {
|
|
3048
3048
|
if (n) {
|
|
3049
|
-
|
|
3050
|
-
const p = Tn.getInterpolation(kn, Qt, Jt, en,
|
|
3049
|
+
Ss.fromBufferAttribute(n, r), bs.fromBufferAttribute(n, o), _s.fromBufferAttribute(n, a), h.uv = new pe();
|
|
3050
|
+
const p = Tn.getInterpolation(kn, Qt, Jt, en, Ss, bs, _s, h.uv);
|
|
3051
3051
|
Ts || (h.uv = p);
|
|
3052
3052
|
}
|
|
3053
3053
|
if (s) {
|
|
3054
|
-
|
|
3055
|
-
const p = Tn.getInterpolation(kn, Qt, Jt, en,
|
|
3054
|
+
Ss.fromBufferAttribute(s, r), bs.fromBufferAttribute(s, o), _s.fromBufferAttribute(s, a), h.uv1 = new pe();
|
|
3055
|
+
const p = Tn.getInterpolation(kn, Qt, Jt, en, Ss, bs, _s, h.uv1);
|
|
3056
3056
|
Ts || (h.uv1 = p), dl && (h.uv2 = h.uv1);
|
|
3057
3057
|
}
|
|
3058
3058
|
if (t) {
|
|
@@ -3082,13 +3082,13 @@ function $s(i, e, t, n, s, r, o) {
|
|
|
3082
3082
|
let c = a + 0, u = a + 1, d = a + 2;
|
|
3083
3083
|
const { index: h, groups: f } = i;
|
|
3084
3084
|
i.index && (c = h.getX(c), u = h.getX(u), d = h.getX(d));
|
|
3085
|
-
const { position: p, normal: y, uv: _, uv1:
|
|
3085
|
+
const { position: p, normal: y, uv: _, uv1: S } = i.attributes;
|
|
3086
3086
|
if (Array.isArray(e)) {
|
|
3087
3087
|
const v = n * 3;
|
|
3088
3088
|
for (let E = 0, T = f.length; E < T; E++) {
|
|
3089
|
-
const { start:
|
|
3090
|
-
if (v >=
|
|
3091
|
-
const I = Xr(e[P]), M = Kr(t, p, y, _,
|
|
3089
|
+
const { start: b, count: x, materialIndex: P } = f[E];
|
|
3090
|
+
if (v >= b && v < b + x) {
|
|
3091
|
+
const I = Xr(e[P]), M = Kr(t, p, y, _, S, c, u, d, I, r, o);
|
|
3092
3092
|
if (M)
|
|
3093
3093
|
if (M.faceIndex = n, M.face.materialIndex = P, s)
|
|
3094
3094
|
s.push(M);
|
|
@@ -3097,7 +3097,7 @@ function $s(i, e, t, n, s, r, o) {
|
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
3099
|
} else {
|
|
3100
|
-
const v = Xr(e), E = Kr(t, p, y, _,
|
|
3100
|
+
const v = Xr(e), E = Kr(t, p, y, _, S, c, u, d, v, r, o);
|
|
3101
3101
|
if (E)
|
|
3102
3102
|
if (E.faceIndex = n, E.face.materialIndex = 0, s)
|
|
3103
3103
|
s.push(E);
|
|
@@ -3144,33 +3144,33 @@ function yl(i, e = null) {
|
|
|
3144
3144
|
function h(f, p, y = !1) {
|
|
3145
3145
|
const _ = f * 2;
|
|
3146
3146
|
if (De(_, a)) {
|
|
3147
|
-
const
|
|
3148
|
-
let E = 1 / 0, T = 1 / 0,
|
|
3149
|
-
for (let M = 3 *
|
|
3147
|
+
const S = $e(f, o), v = Qe(_, a);
|
|
3148
|
+
let E = 1 / 0, T = 1 / 0, b = 1 / 0, x = -1 / 0, P = -1 / 0, I = -1 / 0;
|
|
3149
|
+
for (let M = 3 * S, O = 3 * (S + v); M < O; M++) {
|
|
3150
3150
|
let C = n[M];
|
|
3151
3151
|
const k = s.getX(C), N = s.getY(C), G = s.getZ(C);
|
|
3152
|
-
k < E && (E = k), k > x && (x = k), N < T && (T = N), N > P && (P = N), G <
|
|
3152
|
+
k < E && (E = k), k > x && (x = k), N < T && (T = N), N > P && (P = N), G < b && (b = G), G > I && (I = G);
|
|
3153
3153
|
}
|
|
3154
|
-
return c[f + 0] !== E || c[f + 1] !== T || c[f + 2] !==
|
|
3154
|
+
return c[f + 0] !== E || c[f + 1] !== T || c[f + 2] !== b || c[f + 3] !== x || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = T, c[f + 2] = b, c[f + 3] = x, c[f + 4] = P, c[f + 5] = I, !0) : !1;
|
|
3155
3155
|
} else {
|
|
3156
|
-
const
|
|
3157
|
-
let E = y, T = !1,
|
|
3156
|
+
const S = Fe(f), v = ze(f, o);
|
|
3157
|
+
let E = y, T = !1, b = !1;
|
|
3158
3158
|
if (e) {
|
|
3159
3159
|
if (!E) {
|
|
3160
|
-
const C =
|
|
3161
|
-
T = e.has(C),
|
|
3160
|
+
const C = S / Oe + p / qe, k = v / Oe + p / qe;
|
|
3161
|
+
T = e.has(C), b = e.has(k), E = !T && !b;
|
|
3162
3162
|
}
|
|
3163
3163
|
} else
|
|
3164
|
-
T = !0,
|
|
3165
|
-
const x = E || T, P = E ||
|
|
3164
|
+
T = !0, b = !0;
|
|
3165
|
+
const x = E || T, P = E || b;
|
|
3166
3166
|
let I = !1;
|
|
3167
|
-
x && (I = h(
|
|
3167
|
+
x && (I = h(S, p, E));
|
|
3168
3168
|
let M = !1;
|
|
3169
3169
|
P && (M = h(v, p, E));
|
|
3170
3170
|
const O = I || M;
|
|
3171
3171
|
if (O)
|
|
3172
3172
|
for (let C = 0; C < 3; C++) {
|
|
3173
|
-
const k =
|
|
3173
|
+
const k = S + C, N = v + C, G = c[k], z = c[k + 3], X = c[N], ie = c[N + 3];
|
|
3174
3174
|
c[f + C] = G < X ? G : X, c[f + C + 3] = z > ie ? z : ie;
|
|
3175
3175
|
}
|
|
3176
3176
|
return O;
|
|
@@ -3179,9 +3179,9 @@ function yl(i, e = null) {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
function Yt(i, e, t, n, s) {
|
|
3181
3181
|
let r, o, a, c, u, d;
|
|
3182
|
-
const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, _ = t.origin.y,
|
|
3183
|
-
let v = e[i], E = e[i + 3], T = e[i + 1],
|
|
3184
|
-
return h >= 0 ? (r = (v - y) * h, o = (E - y) * h) : (r = (E - y) * h, o = (v - y) * h), f >= 0 ? (a = (T - _) * f, c = (
|
|
3182
|
+
const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, _ = t.origin.y, S = t.origin.z;
|
|
3183
|
+
let v = e[i], E = e[i + 3], T = e[i + 1], b = e[i + 3 + 1], x = e[i + 2], P = e[i + 3 + 2];
|
|
3184
|
+
return h >= 0 ? (r = (v - y) * h, o = (E - y) * h) : (r = (E - y) * h, o = (v - y) * h), f >= 0 ? (a = (T - _) * f, c = (b - _) * f) : (a = (b - _) * f, c = (T - _) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (x - S) * p, d = (P - S) * p) : (u = (P - S) * p, d = (x - S) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
|
|
3185
3185
|
}
|
|
3186
3186
|
function wl(i, e, t, n, s, r, o, a) {
|
|
3187
3187
|
const { geometry: c, _indirectBuffer: u } = i;
|
|
@@ -3208,7 +3208,7 @@ function Tl(i, e, t, n, s, r, o) {
|
|
|
3208
3208
|
}
|
|
3209
3209
|
return !1;
|
|
3210
3210
|
}
|
|
3211
|
-
function
|
|
3211
|
+
function Sl(i, e, t, n, s, r, o) {
|
|
3212
3212
|
_e.setBuffer(i._roots[e]), Ni(0, i, t, n, s, r, o), _e.clearBuffer();
|
|
3213
3213
|
}
|
|
3214
3214
|
function Ni(i, e, t, n, s, r, o) {
|
|
@@ -3223,7 +3223,7 @@ function Ni(i, e, t, n, s, r, o) {
|
|
|
3223
3223
|
Yt(p, a, n, r, o) && Ni(p, e, t, n, s, r, o);
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
3226
|
-
const
|
|
3226
|
+
const bl = ["x", "y", "z"];
|
|
3227
3227
|
function _l(i, e, t, n, s, r) {
|
|
3228
3228
|
_e.setBuffer(i._roots[e]);
|
|
3229
3229
|
const o = ki(0, i, t, n, s, r);
|
|
@@ -3236,23 +3236,23 @@ function ki(i, e, t, n, s, r) {
|
|
|
3236
3236
|
const h = $e(i, c), f = Qe(u, a);
|
|
3237
3237
|
return ml(e, t, n, h, f, s, r);
|
|
3238
3238
|
} else {
|
|
3239
|
-
const h = cr(i, c), f =
|
|
3240
|
-
let _,
|
|
3241
|
-
y ? (_ = Fe(i),
|
|
3239
|
+
const h = cr(i, c), f = bl[h], y = n.direction[f] >= 0;
|
|
3240
|
+
let _, S;
|
|
3241
|
+
y ? (_ = Fe(i), S = ze(i, c)) : (_ = ze(i, c), S = Fe(i));
|
|
3242
3242
|
const E = Yt(_, o, n, s, r) ? ki(_, e, t, n, s, r) : null;
|
|
3243
3243
|
if (E) {
|
|
3244
3244
|
const x = E.point[f];
|
|
3245
|
-
if (y ? x <= o[
|
|
3245
|
+
if (y ? x <= o[S + h] : (
|
|
3246
3246
|
// min bounding data
|
|
3247
|
-
x >= o[
|
|
3247
|
+
x >= o[S + h + 3]
|
|
3248
3248
|
))
|
|
3249
3249
|
return E;
|
|
3250
3250
|
}
|
|
3251
|
-
const
|
|
3252
|
-
return E &&
|
|
3251
|
+
const b = Yt(S, o, n, s, r) ? ki(S, e, t, n, s, r) : null;
|
|
3252
|
+
return E && b ? E.distance <= b.distance ? E : b : E || b || null;
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
|
-
const xs = /* @__PURE__ */ new
|
|
3255
|
+
const xs = /* @__PURE__ */ new bt(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), Fn = /* @__PURE__ */ new ut(), Yr = /* @__PURE__ */ new Je(), vs = /* @__PURE__ */ new Je();
|
|
3256
3256
|
function xl(i, e, t, n) {
|
|
3257
3257
|
_e.setBuffer(i._roots[e]);
|
|
3258
3258
|
const s = Fi(0, i, t, n);
|
|
@@ -3262,13 +3262,13 @@ function Fi(i, e, t, n, s = null) {
|
|
|
3262
3262
|
const { float32Array: r, uint16Array: o, uint32Array: a } = _e;
|
|
3263
3263
|
let c = i * 2;
|
|
3264
3264
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), Yr.set(t.boundingBox.min, t.boundingBox.max, n), s = Yr), De(c, o)) {
|
|
3265
|
-
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, _ = $e(i, a),
|
|
3265
|
+
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, _ = $e(i, a), S = Qe(c, o);
|
|
3266
3266
|
if (Fn.copy(n).invert(), t.boundsTree)
|
|
3267
3267
|
return ve(i, r, vs), vs.matrix.copy(Fn), vs.needsUpdate = !0, t.boundsTree.shapecast({
|
|
3268
3268
|
intersectsBounds: (E) => vs.intersectsBox(E),
|
|
3269
3269
|
intersectsTriangle: (E) => {
|
|
3270
3270
|
E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
|
|
3271
|
-
for (let T = _ * 3,
|
|
3271
|
+
for (let T = _ * 3, b = (S + _) * 3; T < b; T += 3)
|
|
3272
3272
|
if (Ie(mn, T, h, f), mn.needsUpdate = !0, E.intersectsTriangle(mn))
|
|
3273
3273
|
return !0;
|
|
3274
3274
|
return !1;
|
|
@@ -3276,10 +3276,10 @@ function Fi(i, e, t, n, s = null) {
|
|
|
3276
3276
|
});
|
|
3277
3277
|
{
|
|
3278
3278
|
const v = qs(t);
|
|
3279
|
-
for (let E = _ * 3, T = (
|
|
3279
|
+
for (let E = _ * 3, T = (S + _) * 3; E < T; E += 3) {
|
|
3280
3280
|
Ie(pn, E, h, f), pn.a.applyMatrix4(Fn), pn.b.applyMatrix4(Fn), pn.c.applyMatrix4(Fn), pn.needsUpdate = !0;
|
|
3281
|
-
for (let
|
|
3282
|
-
if (Ie(mn,
|
|
3281
|
+
for (let b = 0, x = v * 3; b < x; b += 3)
|
|
3282
|
+
if (Ie(mn, b, p, y), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
|
|
3283
3283
|
return !0;
|
|
3284
3284
|
}
|
|
3285
3285
|
}
|
|
@@ -3292,9 +3292,9 @@ const As = /* @__PURE__ */ new ut(), fi = /* @__PURE__ */ new Je(), zn = /* @__P
|
|
|
3292
3292
|
function Cl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3293
3293
|
e.boundingBox || e.computeBoundingBox(), fi.set(e.boundingBox.min, e.boundingBox.max, t), fi.needsUpdate = !0;
|
|
3294
3294
|
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
|
|
3295
|
-
let y = vl, _ = Al,
|
|
3296
|
-
s && (
|
|
3297
|
-
let E = 1 / 0, T = null,
|
|
3295
|
+
let y = vl, _ = Al, S = null, v = null;
|
|
3296
|
+
s && (S = Rl, v = Ml);
|
|
3297
|
+
let E = 1 / 0, T = null, b = null;
|
|
3298
3298
|
return As.copy(t).invert(), zn.matrix.copy(As), i.shapecast(
|
|
3299
3299
|
{
|
|
3300
3300
|
boundsTraverseOrder: (x) => fi.distanceToBox(x),
|
|
@@ -3309,8 +3309,8 @@ function Cl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3309
3309
|
Ie(p, 3 * C, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
|
|
3310
3310
|
for (let N = x, G = x + P; N < G; N++) {
|
|
3311
3311
|
Ie(f, 3 * N, u, c), f.needsUpdate = !0;
|
|
3312
|
-
const z = f.distanceToTriangle(p, y,
|
|
3313
|
-
if (z < E && (_.copy(y), v && v.copy(
|
|
3312
|
+
const z = f.distanceToTriangle(p, y, S);
|
|
3313
|
+
if (z < E && (_.copy(y), v && v.copy(S), E = z, T = N, b = C), z < r)
|
|
3314
3314
|
return !0;
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
@@ -3322,15 +3322,15 @@ function Cl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3322
3322
|
Ie(p, 3 * M, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
|
|
3323
3323
|
for (let C = x, k = x + P; C < k; C++) {
|
|
3324
3324
|
Ie(f, 3 * C, u, c), f.needsUpdate = !0;
|
|
3325
|
-
const N = f.distanceToTriangle(p, y,
|
|
3326
|
-
if (N < E && (_.copy(y), v && v.copy(
|
|
3325
|
+
const N = f.distanceToTriangle(p, y, S);
|
|
3326
|
+
if (N < E && (_.copy(y), v && v.copy(S), E = N, T = C, b = M), N < r)
|
|
3327
3327
|
return !0;
|
|
3328
3328
|
}
|
|
3329
3329
|
}
|
|
3330
3330
|
}
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
|
-
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(As), _.applyMatrix4(As), s.distance = _.sub(s.point).length(), s.faceIndex =
|
|
3333
|
+
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(As), _.applyMatrix4(As), s.distance = _.sub(s.point).length(), s.faceIndex = b), n);
|
|
3334
3334
|
}
|
|
3335
3335
|
function Il(i, e = null) {
|
|
3336
3336
|
e && Array.isArray(e) && (e = new Set(e));
|
|
@@ -3342,37 +3342,37 @@ function Il(i, e = null) {
|
|
|
3342
3342
|
function h(f, p, y = !1) {
|
|
3343
3343
|
const _ = f * 2;
|
|
3344
3344
|
if (De(_, a)) {
|
|
3345
|
-
const
|
|
3346
|
-
let E = 1 / 0, T = 1 / 0,
|
|
3347
|
-
for (let M =
|
|
3345
|
+
const S = $e(f, o), v = Qe(_, a);
|
|
3346
|
+
let E = 1 / 0, T = 1 / 0, b = 1 / 0, x = -1 / 0, P = -1 / 0, I = -1 / 0;
|
|
3347
|
+
for (let M = S, O = S + v; M < O; M++) {
|
|
3348
3348
|
const C = 3 * i.resolveTriangleIndex(M);
|
|
3349
3349
|
for (let k = 0; k < 3; k++) {
|
|
3350
3350
|
let N = C + k;
|
|
3351
3351
|
N = n ? n[N] : N;
|
|
3352
3352
|
const G = s.getX(N), z = s.getY(N), X = s.getZ(N);
|
|
3353
|
-
G < E && (E = G), G > x && (x = G), z < T && (T = z), z > P && (P = z), X <
|
|
3353
|
+
G < E && (E = G), G > x && (x = G), z < T && (T = z), z > P && (P = z), X < b && (b = X), X > I && (I = X);
|
|
3354
3354
|
}
|
|
3355
3355
|
}
|
|
3356
|
-
return c[f + 0] !== E || c[f + 1] !== T || c[f + 2] !==
|
|
3356
|
+
return c[f + 0] !== E || c[f + 1] !== T || c[f + 2] !== b || c[f + 3] !== x || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = T, c[f + 2] = b, c[f + 3] = x, c[f + 4] = P, c[f + 5] = I, !0) : !1;
|
|
3357
3357
|
} else {
|
|
3358
|
-
const
|
|
3359
|
-
let E = y, T = !1,
|
|
3358
|
+
const S = Fe(f), v = ze(f, o);
|
|
3359
|
+
let E = y, T = !1, b = !1;
|
|
3360
3360
|
if (e) {
|
|
3361
3361
|
if (!E) {
|
|
3362
|
-
const C =
|
|
3363
|
-
T = e.has(C),
|
|
3362
|
+
const C = S / Oe + p / qe, k = v / Oe + p / qe;
|
|
3363
|
+
T = e.has(C), b = e.has(k), E = !T && !b;
|
|
3364
3364
|
}
|
|
3365
3365
|
} else
|
|
3366
|
-
T = !0,
|
|
3367
|
-
const x = E || T, P = E ||
|
|
3366
|
+
T = !0, b = !0;
|
|
3367
|
+
const x = E || T, P = E || b;
|
|
3368
3368
|
let I = !1;
|
|
3369
|
-
x && (I = h(
|
|
3369
|
+
x && (I = h(S, p, E));
|
|
3370
3370
|
let M = !1;
|
|
3371
3371
|
P && (M = h(v, p, E));
|
|
3372
3372
|
const O = I || M;
|
|
3373
3373
|
if (O)
|
|
3374
3374
|
for (let C = 0; C < 3; C++) {
|
|
3375
|
-
const k =
|
|
3375
|
+
const k = S + C, N = v + C, G = c[k], z = c[k + 3], X = c[N], ie = c[N + 3];
|
|
3376
3376
|
c[f + C] = G < X ? G : X, c[f + C + 3] = z > ie ? z : ie;
|
|
3377
3377
|
}
|
|
3378
3378
|
return O;
|
|
@@ -3408,22 +3408,22 @@ function Bi(i, e, t, n, s, r) {
|
|
|
3408
3408
|
return El(e, t, n, h, f, s, r);
|
|
3409
3409
|
} else {
|
|
3410
3410
|
const h = cr(i, c), f = Ll[h], y = n.direction[f] >= 0;
|
|
3411
|
-
let _,
|
|
3412
|
-
y ? (_ = Fe(i),
|
|
3411
|
+
let _, S;
|
|
3412
|
+
y ? (_ = Fe(i), S = ze(i, c)) : (_ = ze(i, c), S = Fe(i));
|
|
3413
3413
|
const E = Yt(_, o, n, s, r) ? Bi(_, e, t, n, s, r) : null;
|
|
3414
3414
|
if (E) {
|
|
3415
3415
|
const x = E.point[f];
|
|
3416
|
-
if (y ? x <= o[
|
|
3416
|
+
if (y ? x <= o[S + h] : (
|
|
3417
3417
|
// min bounding data
|
|
3418
|
-
x >= o[
|
|
3418
|
+
x >= o[S + h + 3]
|
|
3419
3419
|
))
|
|
3420
3420
|
return E;
|
|
3421
3421
|
}
|
|
3422
|
-
const
|
|
3423
|
-
return E &&
|
|
3422
|
+
const b = Yt(S, o, n, s, r) ? Bi(S, e, t, n, s, r) : null;
|
|
3423
|
+
return E && b ? E.distance <= b.distance ? E : b : E || b || null;
|
|
3424
3424
|
}
|
|
3425
3425
|
}
|
|
3426
|
-
const Rs = /* @__PURE__ */ new
|
|
3426
|
+
const Rs = /* @__PURE__ */ new bt(), gn = /* @__PURE__ */ new Tt(), yn = /* @__PURE__ */ new Tt(), Bn = /* @__PURE__ */ new ut(), qr = /* @__PURE__ */ new Je(), Ms = /* @__PURE__ */ new Je();
|
|
3427
3427
|
function Dl(i, e, t, n) {
|
|
3428
3428
|
_e.setBuffer(i._roots[e]);
|
|
3429
3429
|
const s = Ui(0, i, t, n);
|
|
@@ -3433,13 +3433,13 @@ function Ui(i, e, t, n, s = null) {
|
|
|
3433
3433
|
const { float32Array: r, uint16Array: o, uint32Array: a } = _e;
|
|
3434
3434
|
let c = i * 2;
|
|
3435
3435
|
if (s === null && (t.boundingBox || t.computeBoundingBox(), qr.set(t.boundingBox.min, t.boundingBox.max, n), s = qr), De(c, o)) {
|
|
3436
|
-
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, _ = $e(i, a),
|
|
3436
|
+
const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, _ = $e(i, a), S = Qe(c, o);
|
|
3437
3437
|
if (Bn.copy(n).invert(), t.boundsTree)
|
|
3438
3438
|
return ve(i, r, Ms), Ms.matrix.copy(Bn), Ms.needsUpdate = !0, t.boundsTree.shapecast({
|
|
3439
3439
|
intersectsBounds: (E) => Ms.intersectsBox(E),
|
|
3440
3440
|
intersectsTriangle: (E) => {
|
|
3441
3441
|
E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
|
|
3442
|
-
for (let T = _,
|
|
3442
|
+
for (let T = _, b = S + _; T < b; T++)
|
|
3443
3443
|
if (Ie(yn, 3 * e.resolveTriangleIndex(T), h, f), yn.needsUpdate = !0, E.intersectsTriangle(yn))
|
|
3444
3444
|
return !0;
|
|
3445
3445
|
return !1;
|
|
@@ -3447,9 +3447,9 @@ function Ui(i, e, t, n, s = null) {
|
|
|
3447
3447
|
});
|
|
3448
3448
|
{
|
|
3449
3449
|
const v = qs(t);
|
|
3450
|
-
for (let E = _, T =
|
|
3451
|
-
const
|
|
3452
|
-
Ie(gn, 3 *
|
|
3450
|
+
for (let E = _, T = S + _; E < T; E++) {
|
|
3451
|
+
const b = e.resolveTriangleIndex(E);
|
|
3452
|
+
Ie(gn, 3 * b, h, f), gn.a.applyMatrix4(Bn), gn.b.applyMatrix4(Bn), gn.c.applyMatrix4(Bn), gn.needsUpdate = !0;
|
|
3453
3453
|
for (let x = 0, P = v * 3; x < P; x += 3)
|
|
3454
3454
|
if (Ie(yn, x, p, y), yn.needsUpdate = !0, gn.intersectsTriangle(yn))
|
|
3455
3455
|
return !0;
|
|
@@ -3464,9 +3464,9 @@ const Cs = /* @__PURE__ */ new ut(), pi = /* @__PURE__ */ new Je(), Un = /* @__P
|
|
|
3464
3464
|
function Bl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3465
3465
|
e.boundingBox || e.computeBoundingBox(), pi.set(e.boundingBox.min, e.boundingBox.max, t), pi.needsUpdate = !0;
|
|
3466
3466
|
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
|
|
3467
|
-
let y = Nl, _ = kl,
|
|
3468
|
-
s && (
|
|
3469
|
-
let E = 1 / 0, T = null,
|
|
3467
|
+
let y = Nl, _ = kl, S = null, v = null;
|
|
3468
|
+
s && (S = Fl, v = zl);
|
|
3469
|
+
let E = 1 / 0, T = null, b = null;
|
|
3470
3470
|
return Cs.copy(t).invert(), Un.matrix.copy(Cs), i.shapecast(
|
|
3471
3471
|
{
|
|
3472
3472
|
boundsTraverseOrder: (x) => pi.distanceToBox(x),
|
|
@@ -3484,8 +3484,8 @@ function Bl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3484
3484
|
for (let G = x, z = x + P; G < z; G++) {
|
|
3485
3485
|
const X = i.resolveTriangleIndex(G);
|
|
3486
3486
|
Ie(f, 3 * X, u, c), f.needsUpdate = !0;
|
|
3487
|
-
const ie = f.distanceToTriangle(p, y,
|
|
3488
|
-
if (ie < E && (_.copy(y), v && v.copy(
|
|
3487
|
+
const ie = f.distanceToTriangle(p, y, S);
|
|
3488
|
+
if (ie < E && (_.copy(y), v && v.copy(S), E = ie, T = G, b = C), ie < r)
|
|
3489
3489
|
return !0;
|
|
3490
3490
|
}
|
|
3491
3491
|
}
|
|
@@ -3498,15 +3498,15 @@ function Bl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3498
3498
|
for (let C = x, k = x + P; C < k; C++) {
|
|
3499
3499
|
const N = i.resolveTriangleIndex(C);
|
|
3500
3500
|
Ie(f, 3 * N, u, c), f.needsUpdate = !0;
|
|
3501
|
-
const G = f.distanceToTriangle(p, y,
|
|
3502
|
-
if (G < E && (_.copy(y), v && v.copy(
|
|
3501
|
+
const G = f.distanceToTriangle(p, y, S);
|
|
3502
|
+
if (G < E && (_.copy(y), v && v.copy(S), E = G, T = C, b = M), G < r)
|
|
3503
3503
|
return !0;
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
}
|
|
3507
3507
|
}
|
|
3508
3508
|
}
|
|
3509
|
-
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(Cs), _.applyMatrix4(Cs), s.distance = _.sub(s.point).length(), s.faceIndex =
|
|
3509
|
+
), ht.releasePrimitive(f), ht.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = T, s && (s.point ? s.point.copy(v) : s.point = v.clone(), s.point.applyMatrix4(Cs), _.applyMatrix4(Cs), s.distance = _.sub(s.point).length(), s.faceIndex = b), n);
|
|
3510
3510
|
}
|
|
3511
3511
|
function $r(i, e, t) {
|
|
3512
3512
|
return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
|
|
@@ -3578,8 +3578,8 @@ class Zs extends ol {
|
|
|
3578
3578
|
for (let d = 0; d < u.length; d++) {
|
|
3579
3579
|
const h = u[d], f = new Uint32Array(h), p = new Uint16Array(h);
|
|
3580
3580
|
for (let y = 0, _ = h.byteLength / qe; y < _; y++) {
|
|
3581
|
-
const
|
|
3582
|
-
De(v, p) || (f[
|
|
3581
|
+
const S = Oe * y, v = 2 * S;
|
|
3582
|
+
De(v, p) || (f[S + 6] = f[S + 6] / Oe - y);
|
|
3583
3583
|
}
|
|
3584
3584
|
}
|
|
3585
3585
|
}
|
|
@@ -3623,11 +3623,11 @@ class Zs extends ol {
|
|
|
3623
3623
|
let d = u + 0, h = u + 1, f = u + 2;
|
|
3624
3624
|
a && (d = a[d], h = a[h], f = a[f]);
|
|
3625
3625
|
for (let p = 0; p < 3; p++) {
|
|
3626
|
-
const y = o[mi[p]](d), _ = o[mi[p]](h),
|
|
3626
|
+
const y = o[mi[p]](d), _ = o[mi[p]](h), S = o[mi[p]](f);
|
|
3627
3627
|
let v = y;
|
|
3628
|
-
_ < v && (v = _),
|
|
3628
|
+
_ < v && (v = _), S < v && (v = S);
|
|
3629
3629
|
let E = y;
|
|
3630
|
-
_ > E && (E = _),
|
|
3630
|
+
_ > E && (E = _), S > E && (E = S), t[n + p] = v, t[n + p + 3] = E;
|
|
3631
3631
|
}
|
|
3632
3632
|
return t;
|
|
3633
3633
|
}
|
|
@@ -3645,11 +3645,11 @@ class Zs extends ol {
|
|
|
3645
3645
|
const f = ["getX", "getY", "getZ"], p = n.offset;
|
|
3646
3646
|
for (let y = e, _ = e + t; y < _; y++) {
|
|
3647
3647
|
const v = (r ? r[y] : y) * 3, E = (y - p) * 6;
|
|
3648
|
-
let T = v + 0,
|
|
3649
|
-
a && (T = a[T],
|
|
3648
|
+
let T = v + 0, b = v + 1, x = v + 2;
|
|
3649
|
+
a && (T = a[T], b = a[b], x = a[x]), c || (T = T * h + d, b = b * h + d, x = x * h + d);
|
|
3650
3650
|
for (let P = 0; P < 3; P++) {
|
|
3651
3651
|
let I, M, O;
|
|
3652
|
-
c ? (I = o[f[P]](T), M = o[f[P]](
|
|
3652
|
+
c ? (I = o[f[P]](T), M = o[f[P]](b), O = o[f[P]](x)) : (I = u[T + P], M = u[b + P], O = u[x + P]);
|
|
3653
3653
|
let C = I;
|
|
3654
3654
|
M < C && (C = M), O < C && (C = O);
|
|
3655
3655
|
let k = I;
|
|
@@ -3719,7 +3719,7 @@ class Zs extends ol {
|
|
|
3719
3719
|
* @returns {Array<Intersection>}
|
|
3720
3720
|
*/
|
|
3721
3721
|
raycast(e, t = Ri, n = 0, s = 1 / 0) {
|
|
3722
|
-
const r = this._roots, o = [], a = this.indirect ? Pl :
|
|
3722
|
+
const r = this._roots, o = [], a = this.indirect ? Pl : Sl;
|
|
3723
3723
|
for (let c = 0, u = r.length; c < u; c++)
|
|
3724
3724
|
a(this, c, t, e, o, n, s);
|
|
3725
3725
|
return o;
|
|
@@ -3825,19 +3825,19 @@ class Zs extends ol {
|
|
|
3825
3825
|
if (r) {
|
|
3826
3826
|
if (!(e instanceof Zs))
|
|
3827
3827
|
throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
|
|
3828
|
-
const y = (_,
|
|
3828
|
+
const y = (_, S, v, E, T, b, x, P) => {
|
|
3829
3829
|
for (let I = v, M = v + E; I < M; I++) {
|
|
3830
3830
|
p(I), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
|
|
3831
|
-
for (let O = _, C = _ +
|
|
3832
|
-
if (u(O), o.needsUpdate = !0, r(o, d, O, I, T,
|
|
3831
|
+
for (let O = _, C = _ + S; O < C; O++)
|
|
3832
|
+
if (u(O), o.needsUpdate = !0, r(o, d, O, I, T, b, x, P))
|
|
3833
3833
|
return !0;
|
|
3834
3834
|
}
|
|
3835
3835
|
return !1;
|
|
3836
3836
|
};
|
|
3837
3837
|
if (s) {
|
|
3838
3838
|
const _ = s;
|
|
3839
|
-
s = function(
|
|
3840
|
-
return _(
|
|
3839
|
+
s = function(S, v, E, T, b, x, P, I) {
|
|
3840
|
+
return _(S, v, E, T, b, x, P, I) ? !0 : y(S, v, E, T, b, x, P, I);
|
|
3841
3841
|
};
|
|
3842
3842
|
} else
|
|
3843
3843
|
s = y;
|
|
@@ -3945,7 +3945,7 @@ class Zs extends ol {
|
|
|
3945
3945
|
);
|
|
3946
3946
|
}
|
|
3947
3947
|
}
|
|
3948
|
-
const
|
|
3948
|
+
const Sn = {
|
|
3949
3949
|
Mesh: wt.prototype.raycast,
|
|
3950
3950
|
Line: tr.prototype.raycast,
|
|
3951
3951
|
LineSegments: Ji.prototype.raycast,
|
|
@@ -3963,15 +3963,15 @@ function Ul(i, e) {
|
|
|
3963
3963
|
else {
|
|
3964
3964
|
let n;
|
|
3965
3965
|
if (this instanceof wt)
|
|
3966
|
-
n =
|
|
3966
|
+
n = Sn.Mesh;
|
|
3967
3967
|
else if (this instanceof Ji)
|
|
3968
|
-
n =
|
|
3968
|
+
n = Sn.LineSegments;
|
|
3969
3969
|
else if (this instanceof er)
|
|
3970
|
-
n =
|
|
3970
|
+
n = Sn.LineLoop;
|
|
3971
3971
|
else if (this instanceof tr)
|
|
3972
|
-
n =
|
|
3972
|
+
n = Sn.Line;
|
|
3973
3973
|
else if (this instanceof nr)
|
|
3974
|
-
n =
|
|
3974
|
+
n = Sn.Points;
|
|
3975
3975
|
else
|
|
3976
3976
|
throw new Error("BVH: Fallback raycast function not found.");
|
|
3977
3977
|
n.call(this, i, e);
|
|
@@ -4002,7 +4002,7 @@ function Hl(i, e) {
|
|
|
4002
4002
|
}
|
|
4003
4003
|
He.geometry.boundsTree = o, He.geometry.drawRange = a, He.material = null, He.geometry = null;
|
|
4004
4004
|
} else
|
|
4005
|
-
|
|
4005
|
+
Sn.BatchedMesh.call(this, i, e);
|
|
4006
4006
|
}
|
|
4007
4007
|
function jo(i) {
|
|
4008
4008
|
i.traverse((e) => {
|
|
@@ -5291,14 +5291,14 @@ class fh {
|
|
|
5291
5291
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
|
|
5292
5292
|
const d = u.pop(), h = d.isGroup ? d.children : [d], f = u[0].count, p = [];
|
|
5293
5293
|
for (const y of h) {
|
|
5294
|
-
const _ = new ut(),
|
|
5295
|
-
for (let
|
|
5296
|
-
c.TRANSLATION &&
|
|
5297
|
-
for (const
|
|
5298
|
-
if (
|
|
5299
|
-
const x = c[
|
|
5294
|
+
const _ = new ut(), S = new $(), v = new Rn(), E = new $(1, 1, 1), T = new Co(y.geometry, y.material, f);
|
|
5295
|
+
for (let b = 0; b < f; b++)
|
|
5296
|
+
c.TRANSLATION && S.fromBufferAttribute(c.TRANSLATION, b), c.ROTATION && v.fromBufferAttribute(c.ROTATION, b), c.SCALE && E.fromBufferAttribute(c.SCALE, b), T.setMatrixAt(b, _.compose(S, v, E));
|
|
5297
|
+
for (const b in c)
|
|
5298
|
+
if (b === "_COLOR_0") {
|
|
5299
|
+
const x = c[b];
|
|
5300
5300
|
T.instanceColor = new sc(x.array, x.itemSize, x.normalized);
|
|
5301
|
-
} else
|
|
5301
|
+
} else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && y.geometry.setAttribute(b, c[b]);
|
|
5302
5302
|
sr.prototype.copy.call(T, y), this.parser.assignFinalMaterial(T), p.push(T);
|
|
5303
5303
|
}
|
|
5304
5304
|
return d.isGroup ? (d.clear(), d.add(...p), d) : p[0];
|
|
@@ -5360,8 +5360,8 @@ class mh {
|
|
|
5360
5360
|
return new Promise(function(h, f) {
|
|
5361
5361
|
s.decodeDracoFile(d, function(p) {
|
|
5362
5362
|
for (const y in p.attributes) {
|
|
5363
|
-
const _ = p.attributes[y],
|
|
5364
|
-
|
|
5363
|
+
const _ = p.attributes[y], S = c[y];
|
|
5364
|
+
S !== void 0 && (_.normalized = S);
|
|
5365
5365
|
}
|
|
5366
5366
|
h(p);
|
|
5367
5367
|
}, a, u, Ge, f);
|
|
@@ -5393,10 +5393,10 @@ class Zo extends xc {
|
|
|
5393
5393
|
return t;
|
|
5394
5394
|
}
|
|
5395
5395
|
interpolate_(e, t, n, s) {
|
|
5396
|
-
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, _ = y - u,
|
|
5397
|
-
for (let
|
|
5398
|
-
const x = o[_ +
|
|
5399
|
-
r[
|
|
5396
|
+
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, _ = y - u, S = -2 * p + 3 * f, v = p - f, E = 1 - S, T = v - f + h;
|
|
5397
|
+
for (let b = 0; b !== a; b++) {
|
|
5398
|
+
const x = o[_ + b + a], P = o[_ + b + c] * d, I = o[y + b + a], M = o[y + b] * d;
|
|
5399
|
+
r[b] = E * x + T * P + S * I + v * M;
|
|
5400
5400
|
}
|
|
5401
5401
|
return r;
|
|
5402
5402
|
}
|
|
@@ -5469,7 +5469,7 @@ const ct = {
|
|
|
5469
5469
|
MASK: "MASK",
|
|
5470
5470
|
BLEND: "BLEND"
|
|
5471
5471
|
};
|
|
5472
|
-
function
|
|
5472
|
+
function Sh(i) {
|
|
5473
5473
|
return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new js({
|
|
5474
5474
|
color: 16777215,
|
|
5475
5475
|
emissive: 0,
|
|
@@ -5487,7 +5487,7 @@ function tn(i, e, t) {
|
|
|
5487
5487
|
function Rt(i, e) {
|
|
5488
5488
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
5489
5489
|
}
|
|
5490
|
-
function
|
|
5490
|
+
function bh(i, e, t) {
|
|
5491
5491
|
let n = !1, s = !1, r = !1;
|
|
5492
5492
|
for (let u = 0, d = e.length; u < d; u++) {
|
|
5493
5493
|
const h = e[u];
|
|
@@ -5822,23 +5822,23 @@ class Rh {
|
|
|
5822
5822
|
const r = [];
|
|
5823
5823
|
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) {
|
|
5824
5824
|
const a = o[0], c = gi[s.type], u = vn[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;
|
|
5825
|
-
let _,
|
|
5825
|
+
let _, S;
|
|
5826
5826
|
if (p && p !== h) {
|
|
5827
5827
|
const v = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + v + ":" + s.count;
|
|
5828
5828
|
let T = t.cache.get(E);
|
|
5829
|
-
T || (_ = new u(a, v * p, s.count * p / d), T = new oc(_, p / d), t.cache.add(E, T)),
|
|
5829
|
+
T || (_ = new u(a, v * p, s.count * p / d), T = new oc(_, p / d), t.cache.add(E, T)), S = new ac(T, c, f % p / d, y);
|
|
5830
5830
|
} else
|
|
5831
|
-
a === null ? _ = new u(s.count * c) : _ = new u(a, f, s.count * c),
|
|
5831
|
+
a === null ? _ = new u(s.count * c) : _ = new u(a, f, s.count * c), S = new Kn(_, c, y);
|
|
5832
5832
|
if (s.sparse !== void 0) {
|
|
5833
|
-
const v = gi.SCALAR, E = vn[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0,
|
|
5834
|
-
a !== null && (
|
|
5833
|
+
const v = gi.SCALAR, E = vn[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0, b = s.sparse.values.byteOffset || 0, x = new E(o[1], T, s.sparse.count * v), P = new u(o[2], b, s.sparse.count * c);
|
|
5834
|
+
a !== null && (S = new Kn(S.array.slice(), S.itemSize, S.normalized)), S.normalized = !1;
|
|
5835
5835
|
for (let I = 0, M = x.length; I < M; I++) {
|
|
5836
5836
|
const O = x[I];
|
|
5837
|
-
if (
|
|
5837
|
+
if (S.setX(O, P[I * c]), c >= 2 && S.setY(O, P[I * c + 1]), c >= 3 && S.setZ(O, P[I * c + 2]), c >= 4 && S.setW(O, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
5838
5838
|
}
|
|
5839
|
-
|
|
5839
|
+
S.normalized = y;
|
|
5840
5840
|
}
|
|
5841
|
-
return
|
|
5841
|
+
return S;
|
|
5842
5842
|
});
|
|
5843
5843
|
}
|
|
5844
5844
|
/**
|
|
@@ -5888,8 +5888,8 @@ class Rh {
|
|
|
5888
5888
|
return new Promise(function(f, p) {
|
|
5889
5889
|
let y = f;
|
|
5890
5890
|
t.isImageBitmapLoader === !0 && (y = function(_) {
|
|
5891
|
-
const
|
|
5892
|
-
|
|
5891
|
+
const S = new Cr(_);
|
|
5892
|
+
S.needsUpdate = !0, f(S);
|
|
5893
5893
|
}), t.load(Xn.resolveURL(h, r.path), y, void 0, p);
|
|
5894
5894
|
});
|
|
5895
5895
|
}).then(function(h) {
|
|
@@ -6047,28 +6047,28 @@ class Rh {
|
|
|
6047
6047
|
loadMesh(e) {
|
|
6048
6048
|
const t = this, n = this.json, s = this.extensions, r = n.meshes[e], o = r.primitives, a = [];
|
|
6049
6049
|
for (let c = 0, u = o.length; c < u; c++) {
|
|
6050
|
-
const d = o[c].material === void 0 ?
|
|
6050
|
+
const d = o[c].material === void 0 ? Sh(this.cache) : this.getDependency("material", o[c].material);
|
|
6051
6051
|
a.push(d);
|
|
6052
6052
|
}
|
|
6053
6053
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
6054
6054
|
const u = c.slice(0, c.length - 1), d = c[c.length - 1], h = [];
|
|
6055
6055
|
for (let p = 0, y = d.length; p < y; p++) {
|
|
6056
|
-
const _ = d[p],
|
|
6056
|
+
const _ = d[p], S = o[p];
|
|
6057
6057
|
let v;
|
|
6058
6058
|
const E = u[p];
|
|
6059
|
-
if (
|
|
6060
|
-
v = r.isSkinnedMesh === !0 ? new yc(_, E) : new wt(_, E), v.isSkinnedMesh === !0 && v.normalizeSkinWeights(),
|
|
6061
|
-
else if (
|
|
6059
|
+
if (S.mode === ct.TRIANGLES || S.mode === ct.TRIANGLE_STRIP || S.mode === ct.TRIANGLE_FAN || S.mode === void 0)
|
|
6060
|
+
v = r.isSkinnedMesh === !0 ? new yc(_, E) : new wt(_, E), v.isSkinnedMesh === !0 && v.normalizeSkinWeights(), S.mode === ct.TRIANGLE_STRIP ? v.geometry = so(v.geometry, Ao) : S.mode === ct.TRIANGLE_FAN && (v.geometry = so(v.geometry, Mi));
|
|
6061
|
+
else if (S.mode === ct.LINES)
|
|
6062
6062
|
v = new Ji(_, E);
|
|
6063
|
-
else if (
|
|
6063
|
+
else if (S.mode === ct.LINE_STRIP)
|
|
6064
6064
|
v = new tr(_, E);
|
|
6065
|
-
else if (
|
|
6065
|
+
else if (S.mode === ct.LINE_LOOP)
|
|
6066
6066
|
v = new er(_, E);
|
|
6067
|
-
else if (
|
|
6067
|
+
else if (S.mode === ct.POINTS)
|
|
6068
6068
|
v = new nr(_, E);
|
|
6069
6069
|
else
|
|
6070
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
6071
|
-
Object.keys(v.geometry.morphAttributes).length > 0 && _h(v, r), v.name = t.createUniqueName(r.name || "mesh_" + e), Rt(v, r),
|
|
6070
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + S.mode);
|
|
6071
|
+
Object.keys(v.geometry.morphAttributes).length > 0 && _h(v, r), v.name = t.createUniqueName(r.name || "mesh_" + e), Rt(v, r), S.extensions && tn(s, v, S), t.assignFinalMaterial(v), h.push(v);
|
|
6072
6072
|
}
|
|
6073
6073
|
for (let p = 0, y = h.length; p < y; p++)
|
|
6074
6074
|
t.associations.set(h[p], {
|
|
@@ -6135,8 +6135,8 @@ class Rh {
|
|
|
6135
6135
|
loadAnimation(e) {
|
|
6136
6136
|
const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], u = [], d = [];
|
|
6137
6137
|
for (let h = 0, f = s.channels.length; h < f; h++) {
|
|
6138
|
-
const p = s.channels[h], y = s.samplers[p.sampler], _ = p.target,
|
|
6139
|
-
_.node !== void 0 && (o.push(this.getDependency("node",
|
|
6138
|
+
const p = s.channels[h], y = s.samplers[p.sampler], _ = p.target, S = _.node, v = s.parameters !== void 0 ? s.parameters[y.input] : y.input, E = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
|
|
6139
|
+
_.node !== void 0 && (o.push(this.getDependency("node", S)), a.push(this.getDependency("accessor", v)), c.push(this.getDependency("accessor", E)), u.push(y), d.push(_));
|
|
6140
6140
|
}
|
|
6141
6141
|
return Promise.all([
|
|
6142
6142
|
Promise.all(o),
|
|
@@ -6145,9 +6145,9 @@ class Rh {
|
|
|
6145
6145
|
Promise.all(u),
|
|
6146
6146
|
Promise.all(d)
|
|
6147
6147
|
]).then(function(h) {
|
|
6148
|
-
const f = h[0], p = h[1], y = h[2], _ = h[3],
|
|
6149
|
-
for (let T = 0,
|
|
6150
|
-
const x = f[T], P = p[T], I = y[T], M = _[T], O =
|
|
6148
|
+
const f = h[0], p = h[1], y = h[2], _ = h[3], S = h[4], v = [];
|
|
6149
|
+
for (let T = 0, b = f.length; T < b; T++) {
|
|
6150
|
+
const x = f[T], P = p[T], I = y[T], M = _[T], O = S[T];
|
|
6151
6151
|
if (x === void 0) continue;
|
|
6152
6152
|
x.updateMatrix && x.updateMatrix();
|
|
6153
6153
|
const C = n._createAnimationTracks(x, P, I, M, O);
|
|
@@ -6155,7 +6155,7 @@ class Rh {
|
|
|
6155
6155
|
for (let k = 0; k < C.length; k++)
|
|
6156
6156
|
v.push(C[k]);
|
|
6157
6157
|
}
|
|
6158
|
-
const E = new
|
|
6158
|
+
const E = new Sc(r, void 0, v);
|
|
6159
6159
|
return Rt(E, s), E;
|
|
6160
6160
|
});
|
|
6161
6161
|
}
|
|
@@ -6217,7 +6217,7 @@ class Rh {
|
|
|
6217
6217
|
a.push(u);
|
|
6218
6218
|
}), this.nodeCache[e] = Promise.all(a).then(function(u) {
|
|
6219
6219
|
let d;
|
|
6220
|
-
if (r.isBone === !0 ? d = new
|
|
6220
|
+
if (r.isBone === !0 ? d = new bc() : u.length > 1 ? d = new ni() : u.length === 1 ? d = u[0] : d = new sr(), d !== u[0])
|
|
6221
6221
|
for (let h = 0, f = u.length; h < f; h++)
|
|
6222
6222
|
d.add(u[h]);
|
|
6223
6223
|
if (r.name && (d.userData.name = r.name, d.name = o), Rt(d, r), r.extensions && tn(n, d, r), r.matrix !== void 0) {
|
|
@@ -6325,7 +6325,7 @@ class Rh {
|
|
|
6325
6325
|
}
|
|
6326
6326
|
}
|
|
6327
6327
|
function Mh(i, e, t) {
|
|
6328
|
-
const n = e.attributes, s = new
|
|
6328
|
+
const n = e.attributes, s = new bt();
|
|
6329
6329
|
if (n.POSITION !== void 0) {
|
|
6330
6330
|
const a = t.json.accessors[n.POSITION], c = a.min, u = a.max;
|
|
6331
6331
|
if (c !== void 0 && u !== void 0) {
|
|
@@ -6383,7 +6383,7 @@ function co(i, e, t) {
|
|
|
6383
6383
|
s.push(o);
|
|
6384
6384
|
}
|
|
6385
6385
|
return Or.workingColorSpace !== Ge && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Or.workingColorSpace}" not supported.`), Rt(i, e), Mh(i, e, t), Promise.all(s).then(function() {
|
|
6386
|
-
return e.targets !== void 0 ?
|
|
6386
|
+
return e.targets !== void 0 ? bh(i, e.targets, t) : i;
|
|
6387
6387
|
});
|
|
6388
6388
|
}
|
|
6389
6389
|
const Ch = g.REVISION.replace(/\D/g, ""), Ko = `https://cdn.jsdelivr.net/npm/three@0.${Ch}/examples/jsm/libs`, Ih = `${Ko}/draco/`, Ph = `${Ko}/basis/`;
|
|
@@ -7022,7 +7022,7 @@ function Vh(i) {
|
|
|
7022
7022
|
function Wh(i) {
|
|
7023
7023
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
7024
7024
|
}
|
|
7025
|
-
const Ti = new ts(), Ns = new vc(), wn = new pe(),
|
|
7025
|
+
const Ti = new ts(), Ns = new vc(), wn = new pe(), Si = new $();
|
|
7026
7026
|
class Zh extends Yo {
|
|
7027
7027
|
constructor(e, t) {
|
|
7028
7028
|
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Be.PAN, MIDDLE: Be.DOLLY, RIGHT: Be.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE }, this._panWorldStart = new $();
|
|
@@ -7039,7 +7039,7 @@ class Zh extends Yo {
|
|
|
7039
7039
|
return;
|
|
7040
7040
|
}
|
|
7041
7041
|
const n = this.domElement.getBoundingClientRect();
|
|
7042
|
-
wn.x = (e.clientX - n.left) / n.width * 2 - 1, wn.y = -((e.clientY - n.top) / n.height) * 2 + 1, Ns.setFromCamera(wn, this.object), Ns.ray.intersectPlane(Ti,
|
|
7042
|
+
wn.x = (e.clientX - n.left) / n.width * 2 - 1, wn.y = -((e.clientY - n.top) / n.height) * 2 + 1, Ns.setFromCamera(wn, this.object), Ns.ray.intersectPlane(Ti, Si) && (Si.sub(this._panWorldStart), this._panOffset.copy(Si).negate(), this.update());
|
|
7043
7043
|
}
|
|
7044
7044
|
}
|
|
7045
7045
|
class qo {
|
|
@@ -7272,15 +7272,15 @@ const Zi = "contact-shadow-baked", nn = "contact-shadow-live", pr = "softboxCont
|
|
|
7272
7272
|
f.rotation.x = -Math.PI / 2, f.position.set(s.center.x, 0, s.center.z), f.receiveShadow = !0, a.add(f);
|
|
7273
7273
|
const p = this.createBakeCamera(s);
|
|
7274
7274
|
a.add(p);
|
|
7275
|
-
const y = e.getRenderTarget(), _ = e.autoClear,
|
|
7275
|
+
const y = e.getRenderTarget(), _ = e.autoClear, S = e.getClearColor(new g.Color()), v = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
|
|
7276
7276
|
try {
|
|
7277
7277
|
e.shadowMap.autoUpdate = !0, e.setRenderTarget(r), e.setClearColor(0, 0), e.clear(!0, !1, !1), e.autoClear = !1;
|
|
7278
7278
|
const T = this.explicitPasses ?? this.measureAffordablePasses(e, a, p, n, d, r);
|
|
7279
7279
|
h.opacity = 1 / T;
|
|
7280
|
-
for (const
|
|
7281
|
-
d.position.copy(
|
|
7280
|
+
for (const b of this.sampleLightPositions(n, T))
|
|
7281
|
+
d.position.copy(b), e.render(a, p);
|
|
7282
7282
|
} finally {
|
|
7283
|
-
e.autoClear = _, e.setClearColor(
|
|
7283
|
+
e.autoClear = _, e.setClearColor(S, v), e.setRenderTarget(y), e.shadowMap.autoUpdate = E, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
|
|
7284
7284
|
}
|
|
7285
7285
|
}
|
|
7286
7286
|
/**
|
|
@@ -7361,14 +7361,14 @@ const Zi = "contact-shadow-baked", nn = "contact-shadow-live", pr = "softboxCont
|
|
|
7361
7361
|
}
|
|
7362
7362
|
const _ = Math.sin(
|
|
7363
7363
|
g.MathUtils.degToRad(xe.AMBIENT_MIN_ELEVATION_DEGREES)
|
|
7364
|
-
),
|
|
7364
|
+
), S = 0.98;
|
|
7365
7365
|
for (let v = 0; v < d; v++) {
|
|
7366
|
-
const E = Math.sqrt((v + 0.5) / d), T = _ + (
|
|
7366
|
+
const E = Math.sqrt((v + 0.5) / d), T = _ + (S - _) * E, b = Math.sqrt(1 - T * T), x = v * fo;
|
|
7367
7367
|
y.push(
|
|
7368
7368
|
new g.Vector3(
|
|
7369
|
-
|
|
7369
|
+
b * Math.cos(x),
|
|
7370
7370
|
T,
|
|
7371
|
-
|
|
7371
|
+
b * Math.sin(x)
|
|
7372
7372
|
).multiplyScalar(o).add(s)
|
|
7373
7373
|
);
|
|
7374
7374
|
}
|
|
@@ -7430,7 +7430,7 @@ function Pt(i) {
|
|
|
7430
7430
|
function ns(i) {
|
|
7431
7431
|
return Mn(i, "getThreeCamera") ?? (i instanceof g.Camera ? i : null);
|
|
7432
7432
|
}
|
|
7433
|
-
function
|
|
7433
|
+
function St(i) {
|
|
7434
7434
|
return Mn(i, "getThreeScene") ?? (i instanceof g.Scene ? i : null);
|
|
7435
7435
|
}
|
|
7436
7436
|
function Yh(i) {
|
|
@@ -7472,13 +7472,13 @@ class $h {
|
|
|
7472
7472
|
for (let h = -n; h <= n; h++) {
|
|
7473
7473
|
const f = Math.max(-n, -h - n), p = Math.min(n, -h + n);
|
|
7474
7474
|
for (let y = f; y <= p; y++) {
|
|
7475
|
-
const _ = c * (h + y / 2),
|
|
7475
|
+
const _ = c * (h + y / 2), S = u * 0.75 * y, v = [], E = Math.PI * 2 / 6;
|
|
7476
7476
|
for (let x = 0; x <= 6; x++) {
|
|
7477
|
-
const P = x * E + Math.PI / 6, I = _ + s * Math.cos(P), M =
|
|
7477
|
+
const P = x * E + Math.PI / 6, I = _ + s * Math.cos(P), M = S + s * Math.sin(P);
|
|
7478
7478
|
v.push(new g.Vector3(I, 0, M));
|
|
7479
7479
|
}
|
|
7480
|
-
const T = new g.BufferGeometry().setFromPoints(v),
|
|
7481
|
-
t.add(
|
|
7480
|
+
const T = new g.BufferGeometry().setFromPoints(v), b = new g.Line(T, a);
|
|
7481
|
+
t.add(b);
|
|
7482
7482
|
}
|
|
7483
7483
|
}
|
|
7484
7484
|
return t;
|
|
@@ -7617,13 +7617,13 @@ class eu {
|
|
|
7617
7617
|
this.name = "Hexagonal Glass Grid";
|
|
7618
7618
|
}
|
|
7619
7619
|
createGrid(e) {
|
|
7620
|
-
var y, _,
|
|
7620
|
+
var y, _, S, v, E, T, b;
|
|
7621
7621
|
const t = new g.Group(), n = ((y = e.styleOptions) == null ? void 0 : y.hexRadius) ?? Math.floor(e.divisions / 2), s = ((_ = e.styleOptions) == null ? void 0 : _.tileSize) || 1, r = String(e.color || "#ffffff"), o = on.getGridSpacing(s), a = o.width, c = o.height, u = new Qh(new g.Vector3(0, 0, 0), s, r, {
|
|
7622
|
-
metalness: (
|
|
7622
|
+
metalness: (S = e.styleOptions) == null ? void 0 : S.metalness,
|
|
7623
7623
|
roughness: (v = e.styleOptions) == null ? void 0 : v.roughness,
|
|
7624
7624
|
transmission: (E = e.styleOptions) == null ? void 0 : E.transmission,
|
|
7625
7625
|
thickness: (T = e.styleOptions) == null ? void 0 : T.thickness,
|
|
7626
|
-
ior: (
|
|
7626
|
+
ior: (b = e.styleOptions) == null ? void 0 : b.ior
|
|
7627
7627
|
}), d = u.createGeometry(), h = on.getYPosition(s), f = [];
|
|
7628
7628
|
for (let x = -n; x <= n; x++) {
|
|
7629
7629
|
const P = Math.max(-n, -x - n), I = Math.min(n, -x + n);
|
|
@@ -7651,11 +7651,11 @@ class tu {
|
|
|
7651
7651
|
this.name = "Stone Tile Grid", this.textureLoader = new g.TextureLoader();
|
|
7652
7652
|
}
|
|
7653
7653
|
createGrid(e) {
|
|
7654
|
-
var p, y, _,
|
|
7655
|
-
const t = new g.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 = ((_ = e.styleOptions) == null ? void 0 : _.randomHeight) || !1, h = ((
|
|
7654
|
+
var p, y, _, S;
|
|
7655
|
+
const t = new g.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 = ((_ = e.styleOptions) == null ? void 0 : _.randomHeight) || !1, h = ((S = e.styleOptions) == null ? void 0 : S.randomRotation) || !1, f = this.createStoneMaterial(e);
|
|
7656
7656
|
for (let v = 0; v < s; v++)
|
|
7657
7657
|
for (let E = 0; E < s; E++) {
|
|
7658
|
-
const T = (v - s / 2) * r + r / 2,
|
|
7658
|
+
const T = (v - s / 2) * r + r / 2, b = (E - s / 2) * r + r / 2, x = d ? c * (0.8 + Math.random() * 0.4) : c, P = new g.Shape(), I = a / 2;
|
|
7659
7659
|
P.moveTo(-I, -I), P.lineTo(I, -I), P.lineTo(I, I), P.lineTo(-I, I), P.closePath();
|
|
7660
7660
|
const M = {
|
|
7661
7661
|
depth: x,
|
|
@@ -7666,7 +7666,7 @@ class tu {
|
|
|
7666
7666
|
}, O = new g.ExtrudeGeometry(P, M);
|
|
7667
7667
|
O.rotateX(-Math.PI / 2);
|
|
7668
7668
|
const C = new g.Mesh(O, f);
|
|
7669
|
-
C.position.set(T, -x / 2,
|
|
7669
|
+
C.position.set(T, -x / 2, b), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
|
|
7670
7670
|
}
|
|
7671
7671
|
return t;
|
|
7672
7672
|
}
|
|
@@ -7801,7 +7801,7 @@ wr.gridStyles = /* @__PURE__ */ new Map([
|
|
|
7801
7801
|
let Ks = wr;
|
|
7802
7802
|
function su(i, e) {
|
|
7803
7803
|
try {
|
|
7804
|
-
const t =
|
|
7804
|
+
const t = St(i);
|
|
7805
7805
|
if (!t)
|
|
7806
7806
|
return D.err(
|
|
7807
7807
|
new W(
|
|
@@ -7853,7 +7853,7 @@ function su(i, e) {
|
|
|
7853
7853
|
function iu(i, e, t = 1.2) {
|
|
7854
7854
|
var n;
|
|
7855
7855
|
try {
|
|
7856
|
-
const s =
|
|
7856
|
+
const s = St(i);
|
|
7857
7857
|
if (!s)
|
|
7858
7858
|
return D.err(
|
|
7859
7859
|
new W(
|
|
@@ -7883,22 +7883,22 @@ function iu(i, e, t = 1.2) {
|
|
|
7883
7883
|
if (u.isEmpty() || !Number.isFinite(d.x) || !Number.isFinite(d.z))
|
|
7884
7884
|
return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), D.ok(void 0);
|
|
7885
7885
|
const h = (n = o.styleOptions) == null ? void 0 : n.tileSize, f = typeof h == "number" ? h : 1, y = on.getGridSpacing(f).width, _ = Math.max(d.x, d.z) * t + d.y;
|
|
7886
|
-
let
|
|
7886
|
+
let S = _ <= y ? 0 : Math.ceil((_ / y - 1) / 2);
|
|
7887
7887
|
const v = 60;
|
|
7888
|
-
|
|
7889
|
-
`Dynamic grid would need ${
|
|
7890
|
-
),
|
|
7891
|
-
const E = o.type || Ct.HEXAGONAL_GLASS,
|
|
7888
|
+
S > v && (console.warn(
|
|
7889
|
+
`Dynamic grid would need ${S} rings to cover the object; capping at ${v}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
|
|
7890
|
+
), S = v), _ < y * 0.8 ? S = 0 : S < 3 && _ > y * 2 && (S = 3);
|
|
7891
|
+
const E = o.type || Ct.HEXAGONAL_GLASS, b = {
|
|
7892
7892
|
size: Math.max(d.x, d.z) * t,
|
|
7893
|
-
divisions:
|
|
7893
|
+
divisions: S * 2 + 1,
|
|
7894
7894
|
color: o.color,
|
|
7895
7895
|
opacity: o.opacity,
|
|
7896
7896
|
styleOptions: {
|
|
7897
|
-
hexRadius:
|
|
7897
|
+
hexRadius: S,
|
|
7898
7898
|
tileSize: f,
|
|
7899
7899
|
...o.styleOptions
|
|
7900
7900
|
}
|
|
7901
|
-
}, x = Ks.createGrid(E,
|
|
7901
|
+
}, x = Ks.createGrid(E, b);
|
|
7902
7902
|
x.userData.isGrid = !0, x.userData.isHexGrid = !0;
|
|
7903
7903
|
const P = g.MathUtils.clamp(d.y * 25e-4, 2e-4, 2e-3), I = x.getObjectByName(nn);
|
|
7904
7904
|
I && (I.position.y = P), x.traverse((O) => {
|
|
@@ -7919,7 +7919,7 @@ function iu(i, e, t = 1.2) {
|
|
|
7919
7919
|
}
|
|
7920
7920
|
function ru(i, e) {
|
|
7921
7921
|
try {
|
|
7922
|
-
const t =
|
|
7922
|
+
const t = St(i);
|
|
7923
7923
|
if (!t)
|
|
7924
7924
|
return D.err(
|
|
7925
7925
|
new W(
|
|
@@ -7937,19 +7937,19 @@ function ru(i, e) {
|
|
|
7937
7937
|
);
|
|
7938
7938
|
const s = (T) => {
|
|
7939
7939
|
var x, P, I;
|
|
7940
|
-
let
|
|
7941
|
-
for (;
|
|
7942
|
-
if ((x =
|
|
7940
|
+
let b = T;
|
|
7941
|
+
for (; b; ) {
|
|
7942
|
+
if ((x = b.userData) != null && x.isGrid || (P = b.userData) != null && P.isHexGrid || (I = b.userData) != null && I.isDefaultGrid)
|
|
7943
7943
|
return !0;
|
|
7944
|
-
|
|
7944
|
+
b = b.parent;
|
|
7945
7945
|
}
|
|
7946
7946
|
return !1;
|
|
7947
7947
|
};
|
|
7948
7948
|
t.updateMatrixWorld(!0);
|
|
7949
7949
|
const r = [];
|
|
7950
7950
|
t.traverse((T) => {
|
|
7951
|
-
var
|
|
7952
|
-
(
|
|
7951
|
+
var b;
|
|
7952
|
+
(b = T.userData) != null && b[mr] || T.isMesh && s(T) && r.push(T);
|
|
7953
7953
|
});
|
|
7954
7954
|
const o = [];
|
|
7955
7955
|
if (n.traverse((T) => {
|
|
@@ -7965,17 +7965,17 @@ function ru(i, e) {
|
|
|
7965
7965
|
const u = new g.Box3().setFromObject(n);
|
|
7966
7966
|
if (u.isEmpty() || !Number.isFinite(u.min.x) || !Number.isFinite(u.max.x))
|
|
7967
7967
|
return D.ok(void 0);
|
|
7968
|
-
const d = 40, h = Math.max(1, u.max.y - u.min.y), f = u.max.y + h, p = u.min.y - h, y = new g.Raycaster(), _ = new g.Vector3(0, -1, 0),
|
|
7968
|
+
const d = 40, h = Math.max(1, u.max.y - u.min.y), f = u.max.y + h, p = u.min.y - h, y = new g.Raycaster(), _ = new g.Vector3(0, -1, 0), S = new g.Vector3(0, 1, 0);
|
|
7969
7969
|
let v = 1 / 0;
|
|
7970
|
-
const E = (T,
|
|
7971
|
-
y.set(new g.Vector3(T,
|
|
7970
|
+
const E = (T, b, x, P) => {
|
|
7971
|
+
y.set(new g.Vector3(T, b, x), P);
|
|
7972
7972
|
for (const I of y.intersectObjects(o, !1))
|
|
7973
7973
|
I.point.y < v && (v = I.point.y);
|
|
7974
7974
|
};
|
|
7975
7975
|
for (let T = 0; T <= d; T++)
|
|
7976
|
-
for (let
|
|
7977
|
-
const x = u.min.x + (u.max.x - u.min.x) * (T / d), P = u.min.z + (u.max.z - u.min.z) * (
|
|
7978
|
-
E(x, f, P, _), E(x, p, P,
|
|
7976
|
+
for (let b = 0; b <= d; b++) {
|
|
7977
|
+
const x = u.min.x + (u.max.x - u.min.x) * (T / d), P = u.min.z + (u.max.z - u.min.z) * (b / d);
|
|
7978
|
+
E(x, f, P, _), E(x, p, P, S);
|
|
7979
7979
|
}
|
|
7980
7980
|
if (Number.isFinite(v)) {
|
|
7981
7981
|
const T = v - a;
|
|
@@ -8000,7 +8000,7 @@ const Qo = (i) => {
|
|
|
8000
8000
|
};
|
|
8001
8001
|
function ou(i, e) {
|
|
8002
8002
|
try {
|
|
8003
|
-
const t =
|
|
8003
|
+
const t = St(i);
|
|
8004
8004
|
if (!t)
|
|
8005
8005
|
return D.err(
|
|
8006
8006
|
new W(
|
|
@@ -8040,7 +8040,7 @@ function ou(i, e) {
|
|
|
8040
8040
|
}
|
|
8041
8041
|
function au(i, e, t, n) {
|
|
8042
8042
|
try {
|
|
8043
|
-
const s =
|
|
8043
|
+
const s = St(i);
|
|
8044
8044
|
if (!s)
|
|
8045
8045
|
return D.err(
|
|
8046
8046
|
new W(
|
|
@@ -8078,7 +8078,7 @@ function au(i, e, t, n) {
|
|
|
8078
8078
|
}
|
|
8079
8079
|
function cu(i, e) {
|
|
8080
8080
|
try {
|
|
8081
|
-
const t =
|
|
8081
|
+
const t = St(i);
|
|
8082
8082
|
if (!t)
|
|
8083
8083
|
return D.err(
|
|
8084
8084
|
new W(
|
|
@@ -8122,7 +8122,7 @@ function lu(i, e) {
|
|
|
8122
8122
|
}
|
|
8123
8123
|
function hu(i, e) {
|
|
8124
8124
|
try {
|
|
8125
|
-
const t =
|
|
8125
|
+
const t = St(i);
|
|
8126
8126
|
if (!t)
|
|
8127
8127
|
return D.err(
|
|
8128
8128
|
new W(
|
|
@@ -8182,7 +8182,7 @@ function hu(i, e) {
|
|
|
8182
8182
|
}
|
|
8183
8183
|
function uu(i, e) {
|
|
8184
8184
|
try {
|
|
8185
|
-
const t =
|
|
8185
|
+
const t = St(i);
|
|
8186
8186
|
if (!t)
|
|
8187
8187
|
return D.err(
|
|
8188
8188
|
new W(
|
|
@@ -8252,8 +8252,8 @@ function du(i, e, t) {
|
|
|
8252
8252
|
"fov" in s ? d = s.fov * (Math.PI / 180) : d = 50 * (Math.PI / 180);
|
|
8253
8253
|
let h = Math.abs(u / 2 / Math.tan(d / 2));
|
|
8254
8254
|
h *= 1.65;
|
|
8255
|
-
const f = -Math.PI / 4, p = Math.PI / 8, y = a.x + h * Math.sin(f) * Math.cos(p), _ = a.y + h * Math.sin(p),
|
|
8256
|
-
return s.position.set(y, _,
|
|
8255
|
+
const f = -Math.PI / 4, p = Math.PI / 8, y = a.x + h * Math.sin(f) * Math.cos(p), _ = a.y + h * Math.sin(p), S = a.z + h * Math.cos(f) * Math.cos(p);
|
|
8256
|
+
return s.position.set(y, _, S), s.lookAt(a), s.updateProjectionMatrix(), r.target && (r.target.copy(a), r.update()), D.ok(void 0);
|
|
8257
8257
|
} catch (n) {
|
|
8258
8258
|
return D.err(
|
|
8259
8259
|
new W(
|
|
@@ -8304,7 +8304,7 @@ class pu {
|
|
|
8304
8304
|
this.events = new rr(), this.disposed = !1;
|
|
8305
8305
|
}
|
|
8306
8306
|
async initialize(e) {
|
|
8307
|
-
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-
|
|
8307
|
+
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-C1nzzkD0.js");
|
|
8308
8308
|
if (this.disposed)
|
|
8309
8309
|
return D.ok(void 0);
|
|
8310
8310
|
const n = new t();
|
|
@@ -8435,9 +8435,9 @@ var lt = Uint8Array, _n = Uint16Array, mu = Int32Array, Jo = new lt([
|
|
|
8435
8435
|
}, na = ta(Jo, 2), sa = na.b, yu = na.r;
|
|
8436
8436
|
sa[28] = 258, yu[258] = 28;
|
|
8437
8437
|
var wu = ta(ea, 0), Eu = wu.b, Xi = new _n(32768);
|
|
8438
|
-
for (var
|
|
8439
|
-
var Gt = (
|
|
8440
|
-
Gt = (Gt & 52428) >> 2 | (Gt & 13107) << 2, Gt = (Gt & 61680) >> 4 | (Gt & 3855) << 4, Xi[
|
|
8438
|
+
for (var be = 0; be < 32768; ++be) {
|
|
8439
|
+
var Gt = (be & 43690) >> 1 | (be & 21845) << 1;
|
|
8440
|
+
Gt = (Gt & 52428) >> 2 | (Gt & 13107) << 2, Gt = (Gt & 61680) >> 4 | (Gt & 3855) << 4, Xi[be] = ((Gt & 65280) >> 8 | (Gt & 255) << 8) >> 1;
|
|
8441
8441
|
}
|
|
8442
8442
|
var $n = (function(i, e, t) {
|
|
8443
8443
|
for (var n = i.length, s = 0, r = new _n(e); s < n; ++s)
|
|
@@ -8458,18 +8458,18 @@ var $n = (function(i, e, t) {
|
|
|
8458
8458
|
i[s] && (a[s] = Xi[o[i[s] - 1]++] >> 15 - i[s]);
|
|
8459
8459
|
return a;
|
|
8460
8460
|
}), ss = new lt(288);
|
|
8461
|
-
for (var
|
|
8462
|
-
ss[
|
|
8463
|
-
for (var
|
|
8464
|
-
ss[
|
|
8465
|
-
for (var
|
|
8466
|
-
ss[
|
|
8467
|
-
for (var
|
|
8468
|
-
ss[
|
|
8461
|
+
for (var be = 0; be < 144; ++be)
|
|
8462
|
+
ss[be] = 8;
|
|
8463
|
+
for (var be = 144; be < 256; ++be)
|
|
8464
|
+
ss[be] = 9;
|
|
8465
|
+
for (var be = 256; be < 280; ++be)
|
|
8466
|
+
ss[be] = 7;
|
|
8467
|
+
for (var be = 280; be < 288; ++be)
|
|
8468
|
+
ss[be] = 8;
|
|
8469
8469
|
var ia = new lt(32);
|
|
8470
|
-
for (var
|
|
8471
|
-
ia[
|
|
8472
|
-
var Tu = /* @__PURE__ */ $n(ss, 9, 1),
|
|
8470
|
+
for (var be = 0; be < 32; ++be)
|
|
8471
|
+
ia[be] = 5;
|
|
8472
|
+
var Tu = /* @__PURE__ */ $n(ss, 9, 1), Su = /* @__PURE__ */ $n(ia, 5, 1), bi = function(i) {
|
|
8473
8473
|
for (var e = i[0], t = 1; t < i.length; ++t)
|
|
8474
8474
|
i[t] > e && (e = i[t]);
|
|
8475
8475
|
return e;
|
|
@@ -8479,7 +8479,7 @@ var Tu = /* @__PURE__ */ $n(ss, 9, 1), bu = /* @__PURE__ */ $n(ia, 5, 1), Si = f
|
|
|
8479
8479
|
}, _i = function(i, e) {
|
|
8480
8480
|
var t = e / 8 | 0;
|
|
8481
8481
|
return (i[t] | i[t + 1] << 8 | i[t + 2] << 16) >> (e & 7);
|
|
8482
|
-
},
|
|
8482
|
+
}, bu = function(i) {
|
|
8483
8483
|
return (i + 7) / 8 | 0;
|
|
8484
8484
|
}, _u = function(i, e, t) {
|
|
8485
8485
|
return (t == null || t > i.length) && (t = i.length), new lt(i.subarray(e, t));
|
|
@@ -8516,21 +8516,21 @@ var Tu = /* @__PURE__ */ $n(ss, 9, 1), bu = /* @__PURE__ */ $n(ia, 5, 1), Si = f
|
|
|
8516
8516
|
var is = new lt(Math.max(Lt * 2, an));
|
|
8517
8517
|
is.set(t), t = is;
|
|
8518
8518
|
}
|
|
8519
|
-
}, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, _ = e.m,
|
|
8519
|
+
}, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, _ = e.m, S = e.n, v = s * 8;
|
|
8520
8520
|
do {
|
|
8521
8521
|
if (!p) {
|
|
8522
8522
|
d = mt(i, h, 1);
|
|
8523
8523
|
var E = mt(i, h + 1, 3);
|
|
8524
8524
|
if (h += 3, E)
|
|
8525
8525
|
if (E == 1)
|
|
8526
|
-
p = Tu, y =
|
|
8526
|
+
p = Tu, y = Su, _ = 9, S = 5;
|
|
8527
8527
|
else if (E == 2) {
|
|
8528
8528
|
var P = mt(i, h, 31) + 257, I = mt(i, h + 10, 15) + 4, M = P + mt(i, h + 5, 31) + 1;
|
|
8529
8529
|
h += 14;
|
|
8530
8530
|
for (var O = new lt(M), C = new lt(19), k = 0; k < I; ++k)
|
|
8531
8531
|
C[gu[k]] = mt(i, h + k * 3, 7);
|
|
8532
8532
|
h += I * 3;
|
|
8533
|
-
for (var N =
|
|
8533
|
+
for (var N = bi(C), G = (1 << N) - 1, z = $n(C, N, 1), k = 0; k < M; ) {
|
|
8534
8534
|
var X = z[mt(i, h, G)];
|
|
8535
8535
|
h += X & 15;
|
|
8536
8536
|
var T = X >> 4;
|
|
@@ -8543,16 +8543,16 @@ var Tu = /* @__PURE__ */ $n(ss, 9, 1), bu = /* @__PURE__ */ $n(ia, 5, 1), Si = f
|
|
|
8543
8543
|
}
|
|
8544
8544
|
}
|
|
8545
8545
|
var dt = O.subarray(0, P), Me = O.subarray(P);
|
|
8546
|
-
_ =
|
|
8546
|
+
_ = bi(dt), S = bi(Me), p = $n(dt, _, 1), y = $n(Me, S, 1);
|
|
8547
8547
|
} else
|
|
8548
8548
|
yt(1);
|
|
8549
8549
|
else {
|
|
8550
|
-
var T =
|
|
8550
|
+
var T = bu(h) + 4, b = i[T - 4] | i[T - 3] << 8, x = T + b;
|
|
8551
8551
|
if (x > s) {
|
|
8552
8552
|
c && yt(0);
|
|
8553
8553
|
break;
|
|
8554
8554
|
}
|
|
8555
|
-
a && u(f +
|
|
8555
|
+
a && u(f + b), t.set(i.subarray(T, x), f), e.b = f += b, e.p = h = x * 8, e.f = d;
|
|
8556
8556
|
continue;
|
|
8557
8557
|
}
|
|
8558
8558
|
if (h > v) {
|
|
@@ -8561,7 +8561,7 @@ var Tu = /* @__PURE__ */ $n(ss, 9, 1), bu = /* @__PURE__ */ $n(ia, 5, 1), Si = f
|
|
|
8561
8561
|
}
|
|
8562
8562
|
}
|
|
8563
8563
|
a && u(f + 131072);
|
|
8564
|
-
for (var Ue = (1 << _) - 1, Ve = (1 <<
|
|
8564
|
+
for (var Ue = (1 << _) - 1, Ve = (1 << S) - 1, Ae = h; ; Ae = h) {
|
|
8565
8565
|
var ie = p[_i(i, h) & Ue], ge = ie >> 4;
|
|
8566
8566
|
if (h += ie & 15, h > v) {
|
|
8567
8567
|
c && yt(0);
|
|
@@ -8600,7 +8600,7 @@ var Tu = /* @__PURE__ */ $n(ss, 9, 1), bu = /* @__PURE__ */ $n(ia, 5, 1), Si = f
|
|
|
8600
8600
|
t[f] = t[f - Me];
|
|
8601
8601
|
}
|
|
8602
8602
|
}
|
|
8603
|
-
e.l = p, e.p = Ae, e.b = f, e.f = d, p && (d = 1, e.m = _, e.d = y, e.n =
|
|
8603
|
+
e.l = p, e.p = Ae, e.b = f, e.f = d, p && (d = 1, e.m = _, e.d = y, e.n = S);
|
|
8604
8604
|
} while (!d);
|
|
8605
8605
|
return f != t.length && o ? _u(t, 0, f) : t.subarray(0, f);
|
|
8606
8606
|
}, Au = /* @__PURE__ */ new lt(0), Ru = function(i, e) {
|
|
@@ -8891,10 +8891,10 @@ class Iu extends Do {
|
|
|
8891
8891
|
for (let ae = 0; ae < K; ++ae) {
|
|
8892
8892
|
ae == K - 1 && (ye = q);
|
|
8893
8893
|
for (let he = 0; he < U; ++he)
|
|
8894
|
-
le[he].fill(0), le[he][0] = L[Q[he]++], Er(Y, R, le[he]), Tr(le[he], re[he]),
|
|
8894
|
+
le[he].fill(0), le[he][0] = L[Q[he]++], Er(Y, R, le[he]), Tr(le[he], re[he]), Sr(re[he]);
|
|
8895
8895
|
wa(re);
|
|
8896
8896
|
for (let he = 0; he < U; ++he)
|
|
8897
|
-
|
|
8897
|
+
br(re[he], oe[he], ae * 64);
|
|
8898
8898
|
}
|
|
8899
8899
|
let fe = 0;
|
|
8900
8900
|
for (let ae = 0; ae < U; ++ae) {
|
|
@@ -8902,15 +8902,15 @@ class Iu extends Do {
|
|
|
8902
8902
|
for (let Ce = 8 * te; Ce < 8 * te + se; ++Ce) {
|
|
8903
8903
|
fe = ue[ae][Ce];
|
|
8904
8904
|
for (let it = 0; it < j; ++it) {
|
|
8905
|
-
const
|
|
8906
|
-
A.setUint16(fe + 0 * he, oe[ae][
|
|
8905
|
+
const Se = it * 64 + (Ce & 7) * 8;
|
|
8906
|
+
A.setUint16(fe + 0 * he, oe[ae][Se + 0], !0), A.setUint16(fe + 2 * he, oe[ae][Se + 1], !0), A.setUint16(fe + 4 * he, oe[ae][Se + 2], !0), A.setUint16(fe + 6 * he, oe[ae][Se + 3], !0), A.setUint16(fe + 8 * he, oe[ae][Se + 4], !0), A.setUint16(fe + 10 * he, oe[ae][Se + 5], !0), A.setUint16(fe + 12 * he, oe[ae][Se + 6], !0), A.setUint16(fe + 14 * he, oe[ae][Se + 7], !0), fe += 16 * he;
|
|
8907
8907
|
}
|
|
8908
8908
|
}
|
|
8909
8909
|
if (j != K)
|
|
8910
8910
|
for (let Ce = 8 * te; Ce < 8 * te + se; ++Ce) {
|
|
8911
|
-
const it = ue[ae][Ce] + 8 * j * 2 * he,
|
|
8911
|
+
const it = ue[ae][Ce] + 8 * j * 2 * he, Se = j * 64 + (Ce & 7) * 8;
|
|
8912
8912
|
for (let xt = 0; xt < ye; ++xt)
|
|
8913
|
-
A.setUint16(it + xt * 2 * he, oe[ae][
|
|
8913
|
+
A.setUint16(it + xt * 2 * he, oe[ae][Se + xt], !0);
|
|
8914
8914
|
}
|
|
8915
8915
|
}
|
|
8916
8916
|
}
|
|
@@ -8937,7 +8937,7 @@ class Iu extends Do {
|
|
|
8937
8937
|
let ne = 8;
|
|
8938
8938
|
ue == K - 1 && (ne = ee);
|
|
8939
8939
|
for (let te = 0; te < j; ++te)
|
|
8940
|
-
le.fill(0), le[0] = L[Q++], Er(Y, R, le), Tr(le, re),
|
|
8940
|
+
le.fill(0), le[0] = L[Q++], Er(Y, R, le), Tr(le, re), Sr(re), br(re, oe, te * 64);
|
|
8941
8941
|
for (let te = 8 * ue; te < 8 * ue + ne; ++te) {
|
|
8942
8942
|
let se = m[l][te];
|
|
8943
8943
|
for (let ye = 0; ye < V; ++ye) {
|
|
@@ -8963,7 +8963,7 @@ class Iu extends Do {
|
|
|
8963
8963
|
function Tr(l, m) {
|
|
8964
8964
|
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]);
|
|
8965
8965
|
}
|
|
8966
|
-
function
|
|
8966
|
+
function Sr(l) {
|
|
8967
8967
|
const m = 0.5 * Math.cos(0.7853975), w = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), L = 0.5 * Math.cos(3 * 3.14159 / 16), B = 0.5 * Math.cos(5 * 3.14159 / 16), A = 0.5 * Math.cos(3 * 3.14159 / 8), H = 0.5 * Math.cos(7 * 3.14159 / 16), F = new Array(4), U = new Array(4), j = new Array(4), K = new Array(4);
|
|
8968
8968
|
for (let V = 0; V < 8; ++V) {
|
|
8969
8969
|
const q = V * 8;
|
|
@@ -8978,7 +8978,7 @@ class Iu extends Do {
|
|
|
8978
8978
|
l[0][m] = w + 1.5747 * L, l[1][m] = w - 0.1873 * R - 0.4682 * L, l[2][m] = w + 1.8556 * R;
|
|
8979
8979
|
}
|
|
8980
8980
|
}
|
|
8981
|
-
function
|
|
8981
|
+
function br(l, m, w) {
|
|
8982
8982
|
for (let R = 0; R < 64; ++R)
|
|
8983
8983
|
m[w + R] = Et.toHalfFloat(Ea(l[R]));
|
|
8984
8984
|
}
|
|
@@ -8996,7 +8996,7 @@ class Iu extends Do {
|
|
|
8996
8996
|
const m = l.array.slice(l.offset.value, l.offset.value + l.size), w = Gn(m), R = new Uint8Array(w.length);
|
|
8997
8997
|
return rs(w), os(w, R), new DataView(R.buffer);
|
|
8998
8998
|
}
|
|
8999
|
-
function
|
|
8999
|
+
function Sa(l) {
|
|
9000
9000
|
const m = l.viewer, w = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), L = new Uint8Array(8192);
|
|
9001
9001
|
let B = 0;
|
|
9002
9002
|
const A = new Array(l.inputChannels.length);
|
|
@@ -9033,7 +9033,7 @@ class Iu extends Do {
|
|
|
9033
9033
|
}
|
|
9034
9034
|
return new DataView(q.buffer);
|
|
9035
9035
|
}
|
|
9036
|
-
function
|
|
9036
|
+
function ba(l) {
|
|
9037
9037
|
const m = l.array.slice(l.offset.value, l.offset.value + l.size), w = Gn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), B = new DataView(L);
|
|
9038
9038
|
let A = 0, H = 0;
|
|
9039
9039
|
const F = new Array(4);
|
|
@@ -9084,7 +9084,7 @@ class Iu extends Do {
|
|
|
9084
9084
|
const ne = m[w] << 8 | m[w + 1], te = ne & 32768 ? ne & 32767 : ~ne & 65535;
|
|
9085
9085
|
U.fill(te), w += 3;
|
|
9086
9086
|
} else {
|
|
9087
|
-
const ne = m[w] << 8 | m[w + 1], te = m[w + 2] >> 2, se = 32 << te, ye = ne + ((m[w + 2] << 4 | m[w + 3] >> 4) & 63) * (1 << te) - se & 65535, fe = ye + ((m[w + 3] << 2 | m[w + 4] >> 6) & 63) * (1 << te) - se & 65535, ae = fe + (m[w + 4] & 63) * (1 << te) - se & 65535, he = ne + (m[w + 5] >> 2 & 63) * (1 << te) - se & 65535, Ce = ye + ((m[w + 5] << 4 | m[w + 6] >> 4) & 63) * (1 << te) - se & 65535, it = fe + ((m[w + 6] << 2 | m[w + 7] >> 6) & 63) * (1 << te) - se & 65535,
|
|
9087
|
+
const ne = m[w] << 8 | m[w + 1], te = m[w + 2] >> 2, se = 32 << te, ye = ne + ((m[w + 2] << 4 | m[w + 3] >> 4) & 63) * (1 << te) - se & 65535, fe = ye + ((m[w + 3] << 2 | m[w + 4] >> 6) & 63) * (1 << te) - se & 65535, ae = fe + (m[w + 4] & 63) * (1 << te) - se & 65535, he = ne + (m[w + 5] >> 2 & 63) * (1 << te) - se & 65535, Ce = ye + ((m[w + 5] << 4 | m[w + 6] >> 4) & 63) * (1 << te) - se & 65535, it = fe + ((m[w + 6] << 2 | m[w + 7] >> 6) & 63) * (1 << te) - se & 65535, Se = ae + (m[w + 7] & 63) * (1 << te) - se & 65535, xt = he + (m[w + 8] >> 2 & 63) * (1 << te) - se & 65535, cn = Ce + ((m[w + 8] << 4 | m[w + 9] >> 4) & 63) * (1 << te) - se & 65535, Pn = it + ((m[w + 9] << 2 | m[w + 10] >> 6) & 63) * (1 << te) - se & 65535, vt = Se + (m[w + 10] & 63) * (1 << te) - se & 65535, qt = xt + (m[w + 11] >> 2 & 63) * (1 << te) - se & 65535, ds = cn + ((m[w + 11] << 4 | m[w + 12] >> 4) & 63) * (1 << te) - se & 65535, fs = Pn + ((m[w + 12] << 2 | m[w + 13] >> 6) & 63) * (1 << te) - se & 65535, ps = vt + (m[w + 13] & 63) * (1 << te) - se & 65535, Ln = [ne, he, xt, qt, ye, Ce, cn, ds, fe, it, Pn, fs, ae, Se, vt, ps];
|
|
9088
9088
|
for (let ln = 0; ln < 16; ln++)
|
|
9089
9089
|
U[ln] = Ln[ln] & 32768 ? Ln[ln] & 32767 : ~Ln[ln] & 65535;
|
|
9090
9090
|
w += 14;
|
|
@@ -9115,8 +9115,8 @@ class Iu extends Do {
|
|
|
9115
9115
|
for (let Ce = 0; Ce < V.xSampling; Ce++) {
|
|
9116
9116
|
const it = ye * V.xSampling + Ce;
|
|
9117
9117
|
if (it >= R) continue;
|
|
9118
|
-
const
|
|
9119
|
-
F[
|
|
9118
|
+
const Se = he * R * A + j * R + it * 2;
|
|
9119
|
+
F[Se] = fe & 255, F[Se + 1] = fe >> 8 & 255;
|
|
9120
9120
|
}
|
|
9121
9121
|
}
|
|
9122
9122
|
}
|
|
@@ -9549,8 +9549,8 @@ class Iu extends Do {
|
|
|
9549
9549
|
if (ae === 0) continue;
|
|
9550
9550
|
const he = new Float32Array(F);
|
|
9551
9551
|
let Ce = 0;
|
|
9552
|
-
for (let
|
|
9553
|
-
const xt = ye +
|
|
9552
|
+
for (let Se = 0; Se < ae; Se++) {
|
|
9553
|
+
const xt = ye + Se, cn = 1 - Ce;
|
|
9554
9554
|
if (cn <= 0) break;
|
|
9555
9555
|
let Pn = 1;
|
|
9556
9556
|
if (j >= 0) {
|
|
@@ -9567,8 +9567,8 @@ class Iu extends Do {
|
|
|
9567
9567
|
}
|
|
9568
9568
|
H.A !== void 0 && (he[H.A] = Ce);
|
|
9569
9569
|
const it = te + se * F;
|
|
9570
|
-
for (let
|
|
9571
|
-
l.byteArray[it +
|
|
9570
|
+
for (let Se = 0; Se < F; Se++)
|
|
9571
|
+
l.byteArray[it + Se] = U ? Et.toHalfFloat(he[Se]) : he[Se];
|
|
9572
9572
|
}
|
|
9573
9573
|
}
|
|
9574
9574
|
}
|
|
@@ -9644,10 +9644,10 @@ class Iu extends Do {
|
|
|
9644
9644
|
A.blockHeight = 16, A.uncompress = ei;
|
|
9645
9645
|
break;
|
|
9646
9646
|
case "PIZ_COMPRESSION":
|
|
9647
|
-
A.blockHeight = 32, A.uncompress =
|
|
9647
|
+
A.blockHeight = 32, A.uncompress = Sa;
|
|
9648
9648
|
break;
|
|
9649
9649
|
case "PXR24_COMPRESSION":
|
|
9650
|
-
A.blockHeight = 16, A.uncompress =
|
|
9650
|
+
A.blockHeight = 16, A.uncompress = ba;
|
|
9651
9651
|
break;
|
|
9652
9652
|
case "B44_COMPRESSION":
|
|
9653
9653
|
case "B44A_COMPRESSION":
|
|
@@ -9946,23 +9946,23 @@ class Pu extends Do {
|
|
|
9946
9946
|
}, _ = function(M, O, C, k) {
|
|
9947
9947
|
const N = M[O + 3], G = Math.pow(2, N - 128) / 255;
|
|
9948
9948
|
C[k + 0] = Et.toHalfFloat(Math.min(M[O + 0] * G, 65504)), C[k + 1] = Et.toHalfFloat(Math.min(M[O + 1] * G, 65504)), C[k + 2] = Et.toHalfFloat(Math.min(M[O + 2] * G, 65504)), C[k + 3] = Et.toHalfFloat(1);
|
|
9949
|
-
},
|
|
9950
|
-
|
|
9951
|
-
const v = f(
|
|
9949
|
+
}, S = new Uint8Array(e);
|
|
9950
|
+
S.pos = 0;
|
|
9951
|
+
const v = f(S), E = v.width, T = v.height, b = p(S.subarray(S.pos), E, T);
|
|
9952
9952
|
let x, P, I;
|
|
9953
9953
|
switch (this.type) {
|
|
9954
9954
|
case Yn:
|
|
9955
|
-
I =
|
|
9955
|
+
I = b.length / 4;
|
|
9956
9956
|
const M = new Float32Array(I * 4);
|
|
9957
9957
|
for (let C = 0; C < I; C++)
|
|
9958
|
-
y(
|
|
9958
|
+
y(b, C * 4, M, C * 4);
|
|
9959
9959
|
x = M, P = Yn;
|
|
9960
9960
|
break;
|
|
9961
9961
|
case Zt:
|
|
9962
|
-
I =
|
|
9962
|
+
I = b.length / 4;
|
|
9963
9963
|
const O = new Uint16Array(I * 4);
|
|
9964
9964
|
for (let C = 0; C < I; C++)
|
|
9965
|
-
_(
|
|
9965
|
+
_(b, C * 4, O, C * 4);
|
|
9966
9966
|
x = O, P = Zt;
|
|
9967
9967
|
break;
|
|
9968
9968
|
default:
|
|
@@ -10003,7 +10003,7 @@ class Ou extends Ac {
|
|
|
10003
10003
|
super(), this.name = "RoomEnvironment", this.position.y = -3.5;
|
|
10004
10004
|
const e = new Rc();
|
|
10005
10005
|
e.deleteAttribute("uv");
|
|
10006
|
-
const t = new js({ side:
|
|
10006
|
+
const t = new js({ side: bo }), n = new js(), s = new Mo(16777215, 900, 28, 2);
|
|
10007
10007
|
s.position.set(0.418, 16.199, 0.3), this.add(s);
|
|
10008
10008
|
const r = new wt(e, t);
|
|
10009
10009
|
r.position.set(-0.757, 13.219, 0.717), r.scale.set(31.713, 28.305, 28.591), this.add(r);
|
|
@@ -10042,7 +10042,27 @@ function En(i) {
|
|
|
10042
10042
|
emissiveIntensity: i
|
|
10043
10043
|
});
|
|
10044
10044
|
}
|
|
10045
|
-
|
|
10045
|
+
const Du = 0.42, Nu = 1.15, ku = 0.7, Fu = 1;
|
|
10046
|
+
function zu(i) {
|
|
10047
|
+
i.traverse((e) => {
|
|
10048
|
+
const t = e;
|
|
10049
|
+
if (t.isPointLight) {
|
|
10050
|
+
t.intensity *= ku;
|
|
10051
|
+
return;
|
|
10052
|
+
}
|
|
10053
|
+
const n = e;
|
|
10054
|
+
if (!n.isMesh)
|
|
10055
|
+
return;
|
|
10056
|
+
const s = Array.isArray(n.material) ? n.material : [n.material];
|
|
10057
|
+
for (const r of s) {
|
|
10058
|
+
if (!r)
|
|
10059
|
+
continue;
|
|
10060
|
+
const o = r;
|
|
10061
|
+
(o.emissiveIntensity ?? 0) > Fu ? o.emissiveIntensity *= Nu : o.color && o.color.multiplyScalar(Du);
|
|
10062
|
+
}
|
|
10063
|
+
});
|
|
10064
|
+
}
|
|
10065
|
+
class Bu {
|
|
10046
10066
|
constructor() {
|
|
10047
10067
|
this.pmremGenerator = null, this.threeRenderer = null, this.loadedTextures = /* @__PURE__ */ new Map(), this.renderTargets = [], this.studioPmremTexture = null, this.studioCubeTarget = null, this.disposed = !1;
|
|
10048
10068
|
}
|
|
@@ -10141,7 +10161,7 @@ class Du {
|
|
|
10141
10161
|
}
|
|
10142
10162
|
applyToScene(e, t, n) {
|
|
10143
10163
|
try {
|
|
10144
|
-
const s =
|
|
10164
|
+
const s = St(e);
|
|
10145
10165
|
if (!s)
|
|
10146
10166
|
return D.err(
|
|
10147
10167
|
new W(
|
|
@@ -10198,7 +10218,7 @@ class Du {
|
|
|
10198
10218
|
*/
|
|
10199
10219
|
async setBackgroundImage(e, t) {
|
|
10200
10220
|
try {
|
|
10201
|
-
const n =
|
|
10221
|
+
const n = St(e);
|
|
10202
10222
|
if (!n)
|
|
10203
10223
|
return D.err(
|
|
10204
10224
|
new W("Scene must be ThreeSceneAdapter", Z.INVALID_PARAMETER)
|
|
@@ -10243,7 +10263,9 @@ class Du {
|
|
|
10243
10263
|
Z.INITIALIZATION_FAILED
|
|
10244
10264
|
)
|
|
10245
10265
|
);
|
|
10246
|
-
const t = new Ou()
|
|
10266
|
+
const t = new Ou();
|
|
10267
|
+
zu(t);
|
|
10268
|
+
const n = this.pmremGenerator.fromScene(t);
|
|
10247
10269
|
this.renderTargets.push(n);
|
|
10248
10270
|
const s = n.texture;
|
|
10249
10271
|
return this.captureStudioCubeOriginal(t, s), t.dispose(), D.ok(new jn(s));
|
|
@@ -10309,7 +10331,7 @@ class jn {
|
|
|
10309
10331
|
return this.texture;
|
|
10310
10332
|
}
|
|
10311
10333
|
}
|
|
10312
|
-
class
|
|
10334
|
+
class Uu {
|
|
10313
10335
|
constructor(e) {
|
|
10314
10336
|
this.object = e, this.boundingBox = new g.Box3().setFromObject(this.object);
|
|
10315
10337
|
}
|
|
@@ -10325,11 +10347,11 @@ class Nu {
|
|
|
10325
10347
|
this.object.position.add(e);
|
|
10326
10348
|
}
|
|
10327
10349
|
}
|
|
10328
|
-
class
|
|
10350
|
+
class Hu {
|
|
10329
10351
|
alignToFloor(e) {
|
|
10330
10352
|
try {
|
|
10331
10353
|
let t = null;
|
|
10332
|
-
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof g.Object3D && (t = e), t ? (new
|
|
10354
|
+
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof g.Object3D && (t = e), t ? (new Uu(t).alignToFloor(), D.ok(void 0)) : D.err(
|
|
10333
10355
|
new W(
|
|
10334
10356
|
"Could not get Three.js object for floor alignment",
|
|
10335
10357
|
Z.INVALID_PARAMETER
|
|
@@ -10347,7 +10369,7 @@ class ku {
|
|
|
10347
10369
|
}
|
|
10348
10370
|
}
|
|
10349
10371
|
const po = { touch: 10, default: 5 };
|
|
10350
|
-
class
|
|
10372
|
+
class Gu {
|
|
10351
10373
|
constructor() {
|
|
10352
10374
|
this.raycaster = new g.Raycaster(), this.activePointers = /* @__PURE__ */ new Set(), this.options = null, this.pending = null, this.detach = null;
|
|
10353
10375
|
}
|
|
@@ -10413,8 +10435,8 @@ class Fu {
|
|
|
10413
10435
|
(e = this.detach) == null || e.call(this), this.detach = null, this.options = null, this.pending = null, this.activePointers.clear();
|
|
10414
10436
|
}
|
|
10415
10437
|
}
|
|
10416
|
-
const
|
|
10417
|
-
class
|
|
10438
|
+
const ju = 1e-3, mo = { visible: !1 };
|
|
10439
|
+
class Vu {
|
|
10418
10440
|
constructor(e) {
|
|
10419
10441
|
this.sources = e, this.anchor = new g.Vector3(), this.projected = new g.Vector3(), this.cameraPosition = new g.Vector3(), this.toAnchor = new g.Vector3(), this.raycaster = new g.Raycaster(), this.lastCameraMatrix = new g.Matrix4(), this.lastWidth = -1, this.lastHeight = -1, this.hasProjected = !1;
|
|
10420
10442
|
}
|
|
@@ -10440,15 +10462,15 @@ class Bu {
|
|
|
10440
10462
|
const n = this.toAnchor.length();
|
|
10441
10463
|
this.raycaster.set(this.cameraPosition, this.toAnchor.normalize()), this.raycaster.camera = e, this.raycaster.firstHitOnly = !0;
|
|
10442
10464
|
const s = this.raycaster.intersectObject(t, !0)[0];
|
|
10443
|
-
return !!(s && s.distance < n -
|
|
10465
|
+
return !!(s && s.distance < n - ju);
|
|
10444
10466
|
}
|
|
10445
10467
|
}
|
|
10446
|
-
class
|
|
10468
|
+
class Wu {
|
|
10447
10469
|
createProjector(e) {
|
|
10448
|
-
return new
|
|
10470
|
+
return new Vu(e);
|
|
10449
10471
|
}
|
|
10450
10472
|
}
|
|
10451
|
-
class
|
|
10473
|
+
class Zu {
|
|
10452
10474
|
constructor() {
|
|
10453
10475
|
this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1, this.speed = 1;
|
|
10454
10476
|
}
|
|
@@ -10457,7 +10479,7 @@ class Hu {
|
|
|
10457
10479
|
const t = Pt(e);
|
|
10458
10480
|
if (!t)
|
|
10459
10481
|
return;
|
|
10460
|
-
const n =
|
|
10482
|
+
const n = Ku(t);
|
|
10461
10483
|
n && (this.clips = n.animations, this.mixer = new g.AnimationMixer(n), this.mixer.timeScale = this.speed);
|
|
10462
10484
|
}
|
|
10463
10485
|
getClipNames() {
|
|
@@ -10511,7 +10533,7 @@ class Hu {
|
|
|
10511
10533
|
this.mixer && (this.mixer.stopAllAction(), this.mixer.uncacheRoot(this.mixer.getRoot())), this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1;
|
|
10512
10534
|
}
|
|
10513
10535
|
}
|
|
10514
|
-
function
|
|
10536
|
+
function Ku(i) {
|
|
10515
10537
|
let e = null;
|
|
10516
10538
|
return i.traverse((t) => {
|
|
10517
10539
|
var n;
|
|
@@ -10519,7 +10541,7 @@ function Gu(i) {
|
|
|
10519
10541
|
}), e;
|
|
10520
10542
|
}
|
|
10521
10543
|
var Xs = /* @__PURE__ */ ((i) => (i.MapControls = "MapControls", i.OrbitControls = "OrbitControls", i))(Xs || {});
|
|
10522
|
-
class
|
|
10544
|
+
class Xu {
|
|
10523
10545
|
static convertRendererOptions(e) {
|
|
10524
10546
|
const t = {
|
|
10525
10547
|
antialias: e.antialias,
|
|
@@ -10565,7 +10587,7 @@ class ju {
|
|
|
10565
10587
|
return typeof e == "string" ? e : "neutral";
|
|
10566
10588
|
}
|
|
10567
10589
|
}
|
|
10568
|
-
class
|
|
10590
|
+
class Yu {
|
|
10569
10591
|
/**
|
|
10570
10592
|
* Create a ViewerCore instance with Three.js implementations
|
|
10571
10593
|
*/
|
|
@@ -10576,15 +10598,15 @@ class Vu {
|
|
|
10576
10598
|
r.getThreeCamera(),
|
|
10577
10599
|
e,
|
|
10578
10600
|
t
|
|
10579
|
-
), a = new
|
|
10601
|
+
), a = new qu().createDefaultLoader({
|
|
10580
10602
|
renderer: n.getThreeRenderer() ?? void 0,
|
|
10581
10603
|
bvh: (v = t.selection) == null ? void 0 : v.bvh,
|
|
10582
10604
|
...t.loaders
|
|
10583
|
-
}), c = new fu(), u = new
|
|
10605
|
+
}), c = new fu(), u = new Bu(), d = new pu(), h = new Hu(), f = new Gu(), p = new Wu(), y = new Zu(), _ = Xu.convertRendererOptions(
|
|
10584
10606
|
t.renderer || {}
|
|
10585
10607
|
);
|
|
10586
10608
|
_.preserveDrawingBuffer = !0;
|
|
10587
|
-
const
|
|
10609
|
+
const S = {
|
|
10588
10610
|
renderer: n,
|
|
10589
10611
|
scene: s,
|
|
10590
10612
|
camera: r,
|
|
@@ -10600,7 +10622,7 @@ class Vu {
|
|
|
10600
10622
|
anchorProjectionService: p,
|
|
10601
10623
|
animationService: y
|
|
10602
10624
|
};
|
|
10603
|
-
return new Bc(
|
|
10625
|
+
return new Bc(S);
|
|
10604
10626
|
}
|
|
10605
10627
|
static createCamera(e) {
|
|
10606
10628
|
const n = e.camera || {}, s = n.fov || n.cameraFov || 30, r = n.near || n.cameraNear || 0.1, o = n.far || n.cameraFar || 1e5, a = n.position || n.cameraPosition, c = n.target || n.cameraTarget, u = dr.create(
|
|
@@ -10639,12 +10661,12 @@ class Vu {
|
|
|
10639
10661
|
return u && o.target && (o.target.set(u[0], u[1], u[2]), o.update()), o;
|
|
10640
10662
|
}
|
|
10641
10663
|
}
|
|
10642
|
-
class
|
|
10664
|
+
class qu extends lo {
|
|
10643
10665
|
createDefaultLoader(e = {}) {
|
|
10644
10666
|
return lo.createLoader("model.glb", e);
|
|
10645
10667
|
}
|
|
10646
10668
|
}
|
|
10647
|
-
const
|
|
10669
|
+
const $u = ["toneMappingExposure"], Qu = ["environmentIntensity"], Ju = ["autoRotate", "autoRotateSpeed"], ed = ["enabled"];
|
|
10648
10670
|
function ra(i) {
|
|
10649
10671
|
var t, n, s, r, o, a, c, u, d, h, f;
|
|
10650
10672
|
const e = {
|
|
@@ -10875,11 +10897,11 @@ const Yi = {
|
|
|
10875
10897
|
environment: { environmentIntensity: 0.6 }
|
|
10876
10898
|
}
|
|
10877
10899
|
};
|
|
10878
|
-
function
|
|
10900
|
+
function td(i) {
|
|
10879
10901
|
return i ? oa[i] : {};
|
|
10880
10902
|
}
|
|
10881
10903
|
function qi(i, e) {
|
|
10882
|
-
return xn(xn(i,
|
|
10904
|
+
return xn(xn(i, td(e.preset)), e);
|
|
10883
10905
|
}
|
|
10884
10906
|
const ks = (i, ...e) => {
|
|
10885
10907
|
if (!i)
|
|
@@ -10889,7 +10911,7 @@ const ks = (i, ...e) => {
|
|
|
10889
10911
|
delete t[n];
|
|
10890
10912
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
10891
10913
|
};
|
|
10892
|
-
function
|
|
10914
|
+
function nd(i) {
|
|
10893
10915
|
const e = Nt(
|
|
10894
10916
|
() => {
|
|
10895
10917
|
var s;
|
|
@@ -10898,17 +10920,17 @@ function $u(i) {
|
|
|
10898
10920
|
// (updateOptions) — flipping it must not rebuild or re-fetch the model.
|
|
10899
10921
|
// The other fields (samples, bounces, …) configure the tracer at
|
|
10900
10922
|
// construction, so a change to them still rebuilds.
|
|
10901
|
-
pathTracing: ks(i.pathTracing, ...
|
|
10923
|
+
pathTracing: ks(i.pathTracing, ...ed),
|
|
10902
10924
|
staticScene: i.staticScene,
|
|
10903
10925
|
// renderer/environment minus their runtime-tunable fields: a direct
|
|
10904
10926
|
// toneMappingExposure / environmentIntensity change is exactly what
|
|
10905
10927
|
// the live updateOptions path exists for and must not rebuild.
|
|
10906
|
-
renderer: ks(i.renderer,
|
|
10928
|
+
renderer: ks(i.renderer, ...$u),
|
|
10907
10929
|
camera: i.camera,
|
|
10908
10930
|
// The turntable fields toggle live (updateOptions), like the look
|
|
10909
10931
|
// fields — flipping auto-rotate must not reload the model.
|
|
10910
|
-
controls: ks(i.controls, ...
|
|
10911
|
-
environment: ks(i.environment, ...
|
|
10932
|
+
controls: ks(i.controls, ...Ju),
|
|
10933
|
+
environment: ks(i.environment, ...Qu),
|
|
10912
10934
|
lighting: i.lighting,
|
|
10913
10935
|
helpers: i.helpers,
|
|
10914
10936
|
rendering: i.rendering,
|
|
@@ -10945,8 +10967,8 @@ function $u(i) {
|
|
|
10945
10967
|
}, [i.preset, i.backgroundColor, i.backgroundColorEdge, i.renderer, i.environment, i.controls, i.animations, i.pathTracing]);
|
|
10946
10968
|
return { options: Nt(() => i, [e, t]), structuralKey: e, runtimeKey: t };
|
|
10947
10969
|
}
|
|
10948
|
-
const
|
|
10949
|
-
function
|
|
10970
|
+
const sd = "200px";
|
|
10971
|
+
function id(i, e) {
|
|
10950
10972
|
const [t, n] = An(!e);
|
|
10951
10973
|
return rt(() => {
|
|
10952
10974
|
if (t)
|
|
@@ -10964,13 +10986,13 @@ function Ju(i, e) {
|
|
|
10964
10986
|
(o) => {
|
|
10965
10987
|
o.some((a) => a.isIntersecting) && n(!0);
|
|
10966
10988
|
},
|
|
10967
|
-
{ rootMargin:
|
|
10989
|
+
{ rootMargin: sd }
|
|
10968
10990
|
);
|
|
10969
10991
|
return r.observe(s), () => r.disconnect();
|
|
10970
10992
|
}, [i, e, t]), t;
|
|
10971
10993
|
}
|
|
10972
|
-
function
|
|
10973
|
-
const t = je(null), n = je({ width: 0, height: 0 }), [s, r] = An(!1), [o, a] = An(null), { options: c, structuralKey: u, runtimeKey: d } =
|
|
10994
|
+
function rd(i, e) {
|
|
10995
|
+
const t = je(null), n = je({ width: 0, height: 0 }), [s, r] = An(!1), [o, a] = An(null), { options: c, structuralKey: u, runtimeKey: d } = nd(e), h = id(i, (e.loading ?? "eager") === "lazy");
|
|
10974
10996
|
return rt(() => {
|
|
10975
10997
|
if (!h || !i.current || t.current)
|
|
10976
10998
|
return;
|
|
@@ -10978,7 +11000,7 @@ function ed(i, e) {
|
|
|
10978
11000
|
const f = qi(Yi, c);
|
|
10979
11001
|
let p;
|
|
10980
11002
|
try {
|
|
10981
|
-
p =
|
|
11003
|
+
p = Yu.createViewer(i.current, f);
|
|
10982
11004
|
} catch (_) {
|
|
10983
11005
|
console.error("Failed to create viewer:", _), a(_ instanceof Error ? _ : new Error(String(_)));
|
|
10984
11006
|
return;
|
|
@@ -10999,13 +11021,13 @@ function ed(i, e) {
|
|
|
10999
11021
|
if (!t.current || !i.current)
|
|
11000
11022
|
return;
|
|
11001
11023
|
let f = null;
|
|
11002
|
-
const p = (
|
|
11024
|
+
const p = (S) => {
|
|
11003
11025
|
if (i.current && t.current) {
|
|
11004
11026
|
const v = i.current.parentElement || i.current;
|
|
11005
11027
|
let { clientWidth: E, clientHeight: T } = v;
|
|
11006
|
-
if (
|
|
11007
|
-
const { width:
|
|
11008
|
-
E = Math.floor(
|
|
11028
|
+
if (S && S[0]) {
|
|
11029
|
+
const { width: b, height: x } = S[0].contentRect;
|
|
11030
|
+
E = Math.floor(b), T = Math.floor(x);
|
|
11009
11031
|
}
|
|
11010
11032
|
if (n.current.width === E && n.current.height === T)
|
|
11011
11033
|
return;
|
|
@@ -11047,7 +11069,7 @@ function aa(i, e) {
|
|
|
11047
11069
|
};
|
|
11048
11070
|
}, [i]);
|
|
11049
11071
|
}
|
|
11050
|
-
function
|
|
11072
|
+
function od(i, e) {
|
|
11051
11073
|
const [t, n] = An(null), s = je(/* @__PURE__ */ new Set());
|
|
11052
11074
|
rt(() => {
|
|
11053
11075
|
if (i !== void 0 && s.current.has(i)) {
|
|
@@ -11072,7 +11094,7 @@ function td(i, e) {
|
|
|
11072
11094
|
selectPreset: a
|
|
11073
11095
|
};
|
|
11074
11096
|
}
|
|
11075
|
-
function
|
|
11097
|
+
function ad(i, e, t, n, s) {
|
|
11076
11098
|
return Nt(() => {
|
|
11077
11099
|
var u, d, h;
|
|
11078
11100
|
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;
|
|
@@ -11085,7 +11107,7 @@ function nd(i, e, t, n, s) {
|
|
|
11085
11107
|
};
|
|
11086
11108
|
}, [i, e, t, n, s]);
|
|
11087
11109
|
}
|
|
11088
|
-
function
|
|
11110
|
+
function cd(i, e, t) {
|
|
11089
11111
|
const n = Nt(() => {
|
|
11090
11112
|
if (typeof t == "string")
|
|
11091
11113
|
return t;
|
|
@@ -11177,7 +11199,7 @@ class xi {
|
|
|
11177
11199
|
};
|
|
11178
11200
|
}
|
|
11179
11201
|
}
|
|
11180
|
-
function
|
|
11202
|
+
function ld(i) {
|
|
11181
11203
|
const e = je(new rr()), t = Nt(
|
|
11182
11204
|
() => ({
|
|
11183
11205
|
"model:loading": (n) => e.current.emit("model:loading", n),
|
|
@@ -11194,7 +11216,7 @@ function id(i) {
|
|
|
11194
11216
|
);
|
|
11195
11217
|
return aa(i, t), e.current;
|
|
11196
11218
|
}
|
|
11197
|
-
function
|
|
11219
|
+
function hd(i, e, t) {
|
|
11198
11220
|
const n = je(t);
|
|
11199
11221
|
n.current = t;
|
|
11200
11222
|
const s = Nt(
|
|
@@ -11230,7 +11252,7 @@ function rd(i, e, t) {
|
|
|
11230
11252
|
});
|
|
11231
11253
|
}
|
|
11232
11254
|
const ca = Xa(null);
|
|
11233
|
-
function
|
|
11255
|
+
function ud({ viewer: i, canvasRef: e, children: t }) {
|
|
11234
11256
|
const n = Nt(() => ({ viewer: i, canvasRef: e }), [i, e]);
|
|
11235
11257
|
return /* @__PURE__ */ Te(ca.Provider, { value: n, children: t });
|
|
11236
11258
|
}
|
|
@@ -11240,7 +11262,7 @@ function la() {
|
|
|
11240
11262
|
throw new Error("useViewerContext must be used within ViewerProvider");
|
|
11241
11263
|
return i;
|
|
11242
11264
|
}
|
|
11243
|
-
function
|
|
11265
|
+
function dd() {
|
|
11244
11266
|
const { canvasRef: i } = la();
|
|
11245
11267
|
return /* @__PURE__ */ Te(
|
|
11246
11268
|
"canvas",
|
|
@@ -11268,13 +11290,13 @@ function ad() {
|
|
|
11268
11290
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
11269
11291
|
}
|
|
11270
11292
|
})();
|
|
11271
|
-
const
|
|
11293
|
+
const fd = (i, e, t, n, s, r) => {
|
|
11272
11294
|
const o = performance.now(), a = () => {
|
|
11273
11295
|
const c = performance.now() - o, u = Math.min(c / s, 1);
|
|
11274
11296
|
i.position.lerpVectors(t, n, u), e == null || e.update(), r(), u < 1 && requestAnimationFrame(a);
|
|
11275
11297
|
};
|
|
11276
11298
|
requestAnimationFrame(a);
|
|
11277
|
-
}, go = { type: "change" }, yr = { type: "start" }, ha = { type: "end" }, Fs = new Qi(), yo = new ts(),
|
|
11299
|
+
}, go = { type: "change" }, yr = { type: "start" }, ha = { type: "end" }, Fs = new Qi(), yo = new ts(), pd = Math.cos(70 * ir.DEG2RAD), Le = new $(), nt = 2 * Math.PI, Ee = {
|
|
11278
11300
|
NONE: -1,
|
|
11279
11301
|
ROTATE: 0,
|
|
11280
11302
|
DOLLY: 1,
|
|
@@ -11292,7 +11314,7 @@ class ua extends Oo {
|
|
|
11292
11314
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
11293
11315
|
*/
|
|
11294
11316
|
constructor(e, t = null) {
|
|
11295
|
-
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: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.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 Rn(), this._lastTargetPosition = new $(), this._quat = new Rn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Vs(), this._sphericalDelta = new Vs(), 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 =
|
|
11317
|
+
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: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.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 Rn(), this._lastTargetPosition = new $(), this._quat = new Rn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Vs(), this._sphericalDelta = new Vs(), 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 = gd.bind(this), this._onPointerDown = md.bind(this), this._onPointerUp = yd.bind(this), this._onContextMenu = xd.bind(this), this._onMouseWheel = Td.bind(this), this._onKeyDown = Sd.bind(this), this._onTouchStart = bd.bind(this), this._onTouchMove = _d.bind(this), this._onMouseDown = wd.bind(this), this._onMouseMove = Ed.bind(this), this._interceptControlDown = vd.bind(this), this._interceptControlUp = Ad.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
11296
11318
|
}
|
|
11297
11319
|
connect(e) {
|
|
11298
11320
|
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";
|
|
@@ -11383,7 +11405,7 @@ class ua extends Oo {
|
|
|
11383
11405
|
u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Le.length();
|
|
11384
11406
|
} else
|
|
11385
11407
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
11386
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Fs.origin.copy(this.object.position), Fs.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Fs.direction)) <
|
|
11408
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Fs.origin.copy(this.object.position), Fs.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Fs.direction)) < pd ? this.object.lookAt(this.target) : (yo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Fs.intersectPlane(yo, this.target))));
|
|
11387
11409
|
} else if (this.object.isOrthographicCamera) {
|
|
11388
11410
|
const o = this.object.zoom;
|
|
11389
11411
|
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);
|
|
@@ -11580,13 +11602,13 @@ class ua extends Oo {
|
|
|
11580
11602
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
11581
11603
|
}
|
|
11582
11604
|
}
|
|
11583
|
-
function
|
|
11605
|
+
function md(i) {
|
|
11584
11606
|
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)));
|
|
11585
11607
|
}
|
|
11586
|
-
function
|
|
11608
|
+
function gd(i) {
|
|
11587
11609
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
11588
11610
|
}
|
|
11589
|
-
function
|
|
11611
|
+
function yd(i) {
|
|
11590
11612
|
switch (this._removePointer(i), this._pointers.length) {
|
|
11591
11613
|
case 0:
|
|
11592
11614
|
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ha), this.state = Ee.NONE;
|
|
@@ -11597,7 +11619,7 @@ function dd(i) {
|
|
|
11597
11619
|
break;
|
|
11598
11620
|
}
|
|
11599
11621
|
}
|
|
11600
|
-
function
|
|
11622
|
+
function wd(i) {
|
|
11601
11623
|
let e;
|
|
11602
11624
|
switch (i.button) {
|
|
11603
11625
|
case 0:
|
|
@@ -11640,7 +11662,7 @@ function fd(i) {
|
|
|
11640
11662
|
}
|
|
11641
11663
|
this.state !== Ee.NONE && this.dispatchEvent(yr);
|
|
11642
11664
|
}
|
|
11643
|
-
function
|
|
11665
|
+
function Ed(i) {
|
|
11644
11666
|
switch (this.state) {
|
|
11645
11667
|
case Ee.ROTATE:
|
|
11646
11668
|
if (this.enableRotate === !1) return;
|
|
@@ -11656,13 +11678,13 @@ function pd(i) {
|
|
|
11656
11678
|
break;
|
|
11657
11679
|
}
|
|
11658
11680
|
}
|
|
11659
|
-
function
|
|
11681
|
+
function Td(i) {
|
|
11660
11682
|
this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(yr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(ha));
|
|
11661
11683
|
}
|
|
11662
|
-
function
|
|
11684
|
+
function Sd(i) {
|
|
11663
11685
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
11664
11686
|
}
|
|
11665
|
-
function
|
|
11687
|
+
function bd(i) {
|
|
11666
11688
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
11667
11689
|
case 1:
|
|
11668
11690
|
switch (this.touches.ONE) {
|
|
@@ -11697,7 +11719,7 @@ function yd(i) {
|
|
|
11697
11719
|
}
|
|
11698
11720
|
this.state !== Ee.NONE && this.dispatchEvent(yr);
|
|
11699
11721
|
}
|
|
11700
|
-
function
|
|
11722
|
+
function _d(i) {
|
|
11701
11723
|
switch (this._trackPointer(i), this.state) {
|
|
11702
11724
|
case Ee.TOUCH_ROTATE:
|
|
11703
11725
|
if (this.enableRotate === !1) return;
|
|
@@ -11719,16 +11741,16 @@ function wd(i) {
|
|
|
11719
11741
|
this.state = Ee.NONE;
|
|
11720
11742
|
}
|
|
11721
11743
|
}
|
|
11722
|
-
function
|
|
11744
|
+
function xd(i) {
|
|
11723
11745
|
this.enabled !== !1 && i.preventDefault();
|
|
11724
11746
|
}
|
|
11725
|
-
function
|
|
11747
|
+
function vd(i) {
|
|
11726
11748
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
11727
11749
|
}
|
|
11728
|
-
function
|
|
11750
|
+
function Ad(i) {
|
|
11729
11751
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
11730
11752
|
}
|
|
11731
|
-
class
|
|
11753
|
+
class Rd extends ua {
|
|
11732
11754
|
constructor(e, t) {
|
|
11733
11755
|
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Be.PAN, MIDDLE: Be.DOLLY, RIGHT: Be.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE };
|
|
11734
11756
|
}
|
|
@@ -11749,7 +11771,7 @@ const de = {
|
|
|
11749
11771
|
};
|
|
11750
11772
|
var Wt = /* @__PURE__ */ ((i) => (i.FRONT = "FRONT", i.BACK = "BACK", i.RIGHT = "RIGHT", i.LEFT = "LEFT", i.TOP = "TOP", i.BOTTOM = "BOTTOM", i))(Wt || {});
|
|
11751
11773
|
new g.Vector3(0, 1, 0);
|
|
11752
|
-
const es = "rotation-arrows-name", $i = "left-rotation-arrow-name", Ys = "right-rotation-arrow-name",
|
|
11774
|
+
const es = "rotation-arrows-name", $i = "left-rotation-arrow-name", Ys = "right-rotation-arrow-name", Md = "gizmo-group-name", Cd = [
|
|
11753
11775
|
Ys,
|
|
11754
11776
|
$i
|
|
11755
11777
|
], Gs = {
|
|
@@ -11757,7 +11779,7 @@ const es = "rotation-arrows-name", $i = "left-rotation-arrow-name", Ys = "right-
|
|
|
11757
11779
|
DEFAULT_UP: new g.Vector3(0, 1, 0),
|
|
11758
11780
|
FORWARD: new g.Vector3(0, 0, -1)
|
|
11759
11781
|
}, Ai = (i) => Gs.FORWARD.clone().applyQuaternion(i), wo = (i, e, t = new g.Vector3()) => t.clone().add(i.multiplyScalar(-e));
|
|
11760
|
-
class
|
|
11782
|
+
class Id {
|
|
11761
11783
|
constructor(e, t = es) {
|
|
11762
11784
|
this.gizmoScene = e, this.gizmoArrowsName = t;
|
|
11763
11785
|
}
|
|
@@ -11772,7 +11794,7 @@ class vd {
|
|
|
11772
11794
|
}
|
|
11773
11795
|
syncMainWithGizmo(e, t, n) {
|
|
11774
11796
|
const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof g.PerspectiveCamera;
|
|
11775
|
-
n instanceof
|
|
11797
|
+
n instanceof Rd && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
|
|
11776
11798
|
}
|
|
11777
11799
|
syncMapControls(e, t, n, s) {
|
|
11778
11800
|
const r = e.position.y - n.y, o = Ai(t.quaternion);
|
|
@@ -11787,7 +11809,7 @@ class vd {
|
|
|
11787
11809
|
e.position.copy(a), e.up.copy(o), e.camera.lookAt(n);
|
|
11788
11810
|
}
|
|
11789
11811
|
}
|
|
11790
|
-
const da = (i) => new
|
|
11812
|
+
const da = (i) => new Id(i), Eo = (i, e, t) => {
|
|
11791
11813
|
da(t).syncGizmoWithMain(
|
|
11792
11814
|
{
|
|
11793
11815
|
camera: i,
|
|
@@ -11802,7 +11824,7 @@ const da = (i) => new vd(i), Eo = (i, e, t) => {
|
|
|
11802
11824
|
up: e.up
|
|
11803
11825
|
}
|
|
11804
11826
|
);
|
|
11805
|
-
},
|
|
11827
|
+
}, Pd = (i, e, t) => {
|
|
11806
11828
|
da(e.userData.scene).syncMainWithGizmo(
|
|
11807
11829
|
{
|
|
11808
11830
|
camera: i,
|
|
@@ -11818,14 +11840,14 @@ const da = (i) => new vd(i), Eo = (i, e, t) => {
|
|
|
11818
11840
|
},
|
|
11819
11841
|
t
|
|
11820
11842
|
);
|
|
11821
|
-
},
|
|
11843
|
+
}, Ld = () => {
|
|
11822
11844
|
try {
|
|
11823
11845
|
const i = document.createElement("canvas");
|
|
11824
11846
|
return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")));
|
|
11825
11847
|
} catch {
|
|
11826
11848
|
return !1;
|
|
11827
11849
|
}
|
|
11828
|
-
},
|
|
11850
|
+
}, Od = () => Ld() ? new g.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), Dd = (i) => {
|
|
11829
11851
|
const e = new g.AmbientLight(16777215, 1);
|
|
11830
11852
|
i.add(e);
|
|
11831
11853
|
const t = new g.DirectionalLight(16777215, 1);
|
|
@@ -11835,7 +11857,7 @@ const da = (i) => new vd(i), Eo = (i, e, t) => {
|
|
|
11835
11857
|
const s = new g.PointLight(16777215, 1, 100);
|
|
11836
11858
|
s.position.set(0, 0, 5), i.add(s), t.castShadow = !1, n.castShadow = !1, s.castShadow = !1;
|
|
11837
11859
|
};
|
|
11838
|
-
class
|
|
11860
|
+
class Nd {
|
|
11839
11861
|
static createTextTexture(e) {
|
|
11840
11862
|
const t = document.createElement("canvas"), n = t.getContext("2d");
|
|
11841
11863
|
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));
|
|
@@ -11877,14 +11899,14 @@ class zs {
|
|
|
11877
11899
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
|
|
11878
11900
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE
|
|
11879
11901
|
), u = new g.MeshStandardMaterial({
|
|
11880
|
-
map:
|
|
11902
|
+
map: Nd.createTextTexture(n),
|
|
11881
11903
|
transparent: !0,
|
|
11882
11904
|
depthWrite: !1
|
|
11883
11905
|
}), d = new g.Mesh(c, u);
|
|
11884
11906
|
return d.position.set(0, 0, de.FACE_THICKNESS / 2 + 0.01), s.add(d), s.position.copy(e), s.rotation.copy(t), s;
|
|
11885
11907
|
}
|
|
11886
11908
|
}
|
|
11887
|
-
const
|
|
11909
|
+
const kd = (i, e) => {
|
|
11888
11910
|
const t = document.createElement("canvas");
|
|
11889
11911
|
t.width = 64, t.height = 64;
|
|
11890
11912
|
const n = t.getContext("2d");
|
|
@@ -11892,7 +11914,7 @@ const Pd = (i, e) => {
|
|
|
11892
11914
|
const s = new g.CanvasTexture(t), r = new g.SpriteMaterial({ map: s }), o = new g.Sprite(r);
|
|
11893
11915
|
return o.scale.set(0.5, 0.5, 0.5), o;
|
|
11894
11916
|
};
|
|
11895
|
-
class
|
|
11917
|
+
class Fd {
|
|
11896
11918
|
constructor(e) {
|
|
11897
11919
|
this.hoveredObject = null, this.originalColor = null, this.config = e;
|
|
11898
11920
|
}
|
|
@@ -12014,7 +12036,7 @@ class Ld {
|
|
|
12014
12036
|
f.setRotationFromAxisAngle(y, _);
|
|
12015
12037
|
}
|
|
12016
12038
|
c.add(f);
|
|
12017
|
-
const p =
|
|
12039
|
+
const p = kd(a, t);
|
|
12018
12040
|
return p.position.copy(r).add(n.clone().multiplyScalar(s + 0.1)), c.add(p), c;
|
|
12019
12041
|
}
|
|
12020
12042
|
createCoordinateAxes() {
|
|
@@ -12057,7 +12079,7 @@ class Ld {
|
|
|
12057
12079
|
}
|
|
12058
12080
|
create() {
|
|
12059
12081
|
const e = new g.Group();
|
|
12060
|
-
e.name =
|
|
12082
|
+
e.name = Md;
|
|
12061
12083
|
const t = this.createWireframe();
|
|
12062
12084
|
e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
|
|
12063
12085
|
const n = this.createCoordinateAxes();
|
|
@@ -12082,7 +12104,7 @@ class Ld {
|
|
|
12082
12104
|
}
|
|
12083
12105
|
}
|
|
12084
12106
|
}
|
|
12085
|
-
class
|
|
12107
|
+
class zd {
|
|
12086
12108
|
constructor(e) {
|
|
12087
12109
|
this.onChangeMainControlsListener = () => {
|
|
12088
12110
|
}, this.onChangeGizmoControlsListener = () => {
|
|
@@ -12104,10 +12126,10 @@ class Od {
|
|
|
12104
12126
|
}
|
|
12105
12127
|
initializeScene() {
|
|
12106
12128
|
var e;
|
|
12107
|
-
const t = new
|
|
12129
|
+
const t = new Fd({
|
|
12108
12130
|
initialFace: ((e = this.options) == null ? void 0 : e.initialFace) ?? Wt.FRONT
|
|
12109
12131
|
}).create();
|
|
12110
|
-
this.gizmoScene.add(t),
|
|
12132
|
+
this.gizmoScene.add(t), Dd(this.gizmoScene);
|
|
12111
12133
|
}
|
|
12112
12134
|
initializeControls() {
|
|
12113
12135
|
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(
|
|
@@ -12147,7 +12169,7 @@ class Od {
|
|
|
12147
12169
|
), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
|
|
12148
12170
|
}
|
|
12149
12171
|
}
|
|
12150
|
-
const
|
|
12172
|
+
const Bd = (i, e) => {
|
|
12151
12173
|
let t;
|
|
12152
12174
|
return function(...n) {
|
|
12153
12175
|
t || (i.apply(this, n), t = !0, setTimeout(() => t = !1, e));
|
|
@@ -12163,12 +12185,12 @@ const fa = (i, e, t, n) => (n.setFromCamera(i, e), n.intersectObjects(t.children
|
|
|
12163
12185
|
const t = ["Wireframe", ""];
|
|
12164
12186
|
return ((e = i.find((n) => !t.includes(n.object.name))) == null ? void 0 : e.object) || null;
|
|
12165
12187
|
};
|
|
12166
|
-
function
|
|
12188
|
+
function Ud(i, e, t, n) {
|
|
12167
12189
|
if (!e || !t) return null;
|
|
12168
12190
|
const s = fa(i, e, t, n);
|
|
12169
12191
|
return pa(s);
|
|
12170
12192
|
}
|
|
12171
|
-
function
|
|
12193
|
+
function Hd(i, e) {
|
|
12172
12194
|
const t = i == null ? void 0 : i.userData.gizmoCube;
|
|
12173
12195
|
if (i && t) {
|
|
12174
12196
|
t.handleClick();
|
|
@@ -12176,22 +12198,22 @@ function kd(i, e) {
|
|
|
12176
12198
|
n && e(n);
|
|
12177
12199
|
}
|
|
12178
12200
|
}
|
|
12179
|
-
const
|
|
12201
|
+
const Gd = {
|
|
12180
12202
|
radius: 2.1,
|
|
12181
12203
|
color: 12369854,
|
|
12182
12204
|
tubeRadius: 0.1,
|
|
12183
12205
|
tubeSegments: 8,
|
|
12184
12206
|
numPoints: 64,
|
|
12185
12207
|
tubeOffset: 1.5
|
|
12186
|
-
},
|
|
12208
|
+
}, jd = {
|
|
12187
12209
|
size: 0.2,
|
|
12188
12210
|
depth: 0.1,
|
|
12189
12211
|
heightRatio: 1.4,
|
|
12190
12212
|
segments: 1
|
|
12191
12213
|
};
|
|
12192
|
-
class
|
|
12214
|
+
class Vd {
|
|
12193
12215
|
constructor(e = {}) {
|
|
12194
|
-
this.config = { ...
|
|
12216
|
+
this.config = { ...Gd, ...e }, this.material = new g.MeshBasicMaterial({ color: this.config.color });
|
|
12195
12217
|
}
|
|
12196
12218
|
create() {
|
|
12197
12219
|
const e = new g.Group(), t = this.createQuarterCircleCurves();
|
|
@@ -12232,7 +12254,7 @@ class Bd {
|
|
|
12232
12254
|
];
|
|
12233
12255
|
}
|
|
12234
12256
|
createArrowHeads([e, t]) {
|
|
12235
|
-
const { size: n, depth: s, heightRatio: r, segments: o } =
|
|
12257
|
+
const { size: n, depth: s, heightRatio: r, segments: o } = jd, a = this.createArrowShape(n, r), c = new g.ExtrudeGeometry(a, {
|
|
12236
12258
|
steps: o,
|
|
12237
12259
|
depth: s,
|
|
12238
12260
|
bevelEnabled: !1
|
|
@@ -12260,11 +12282,11 @@ class Bd {
|
|
|
12260
12282
|
return Math.atan2(e.y, e.x);
|
|
12261
12283
|
}
|
|
12262
12284
|
}
|
|
12263
|
-
const
|
|
12285
|
+
const Wd = (i) => {
|
|
12264
12286
|
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);
|
|
12265
12287
|
return !(o || a);
|
|
12266
|
-
},
|
|
12267
|
-
function
|
|
12288
|
+
}, Zd = 25, Kd = 200;
|
|
12289
|
+
function Xd({
|
|
12268
12290
|
gizmoRenderer: i,
|
|
12269
12291
|
gizmoScene: e,
|
|
12270
12292
|
gizmoCamera: t,
|
|
@@ -12272,31 +12294,31 @@ function jd({
|
|
|
12272
12294
|
gizmoControlRef: s
|
|
12273
12295
|
}) {
|
|
12274
12296
|
const r = je(null), o = je(null), a = je(new g.Raycaster()).current, c = je(new g.Vector2()).current, u = Mt(() => {
|
|
12275
|
-
const _ = e.getObjectByName(es),
|
|
12276
|
-
if (_ &&
|
|
12297
|
+
const _ = e.getObjectByName(es), S = Wd(t);
|
|
12298
|
+
if (_ && S) {
|
|
12277
12299
|
e.remove(_);
|
|
12278
12300
|
return;
|
|
12279
12301
|
}
|
|
12280
|
-
if (_ ||
|
|
12281
|
-
const v = new
|
|
12302
|
+
if (_ || S) return;
|
|
12303
|
+
const v = new Vd().create();
|
|
12282
12304
|
v.rotation.copy(t.rotation), e.add(v);
|
|
12283
12305
|
}, [e, t]), d = Mt(() => {
|
|
12284
12306
|
const _ = e.getObjectByName(es);
|
|
12285
12307
|
_ && e.remove(_);
|
|
12286
12308
|
}, [e]), h = Mt(
|
|
12287
|
-
|
|
12309
|
+
Bd((_) => {
|
|
12288
12310
|
if (!s.current || !i) return;
|
|
12289
12311
|
To(_, i, c);
|
|
12290
|
-
const
|
|
12312
|
+
const S = fa(
|
|
12291
12313
|
c,
|
|
12292
12314
|
t,
|
|
12293
12315
|
e,
|
|
12294
12316
|
a
|
|
12295
|
-
), v = pa(
|
|
12317
|
+
), v = pa(S);
|
|
12296
12318
|
v != null && v.userData.gizmoCube ? v.userData.gizmoCube.highlightObject(v) : e.traverse((E) => {
|
|
12297
12319
|
E.userData.gizmoCube && E.userData.gizmoCube.highlightObject(null);
|
|
12298
|
-
}),
|
|
12299
|
-
}, 1e3 /
|
|
12320
|
+
}), S.length > 0 ? u() : d();
|
|
12321
|
+
}, 1e3 / Zd),
|
|
12300
12322
|
[
|
|
12301
12323
|
s,
|
|
12302
12324
|
i,
|
|
@@ -12311,22 +12333,22 @@ function jd({
|
|
|
12311
12333
|
r.current = Date.now(), o.current = { x: _.clientX, y: _.clientY };
|
|
12312
12334
|
}, []), p = Mt(
|
|
12313
12335
|
(_) => {
|
|
12314
|
-
var
|
|
12315
|
-
const v = _.name === Ys ? 1 : -1, E = 90 * Math.PI / 180, T = new g.Vector3(0, 0, 0),
|
|
12316
|
-
x.makeRotationZ(
|
|
12336
|
+
var S;
|
|
12337
|
+
const v = _.name === Ys ? 1 : -1, E = 90 * Math.PI / 180, T = new g.Vector3(0, 0, 0), b = v * E, x = new g.Matrix4();
|
|
12338
|
+
x.makeRotationZ(b), t.up.applyMatrix4(x), t.lookAt(T), (S = s.current) == null || S.gizmoControls.update();
|
|
12317
12339
|
},
|
|
12318
12340
|
[t, s]
|
|
12319
12341
|
), y = Mt(
|
|
12320
12342
|
(_) => {
|
|
12321
|
-
if ((r.current ? Date.now() - r.current : 0) <
|
|
12343
|
+
if ((r.current ? Date.now() - r.current : 0) < Kd) {
|
|
12322
12344
|
To(_, i, c);
|
|
12323
|
-
const
|
|
12345
|
+
const S = Ud(
|
|
12324
12346
|
c,
|
|
12325
12347
|
t,
|
|
12326
12348
|
e,
|
|
12327
12349
|
a
|
|
12328
12350
|
);
|
|
12329
|
-
|
|
12351
|
+
S != null && S.name && Cd.includes(S.name) ? p(S) : Hd(S, n);
|
|
12330
12352
|
}
|
|
12331
12353
|
r.current = null, o.current = null;
|
|
12332
12354
|
},
|
|
@@ -12347,27 +12369,27 @@ function jd({
|
|
|
12347
12369
|
onMouseLeave: d
|
|
12348
12370
|
};
|
|
12349
12371
|
}
|
|
12350
|
-
const
|
|
12372
|
+
const Yd = ({
|
|
12351
12373
|
camera: i,
|
|
12352
12374
|
controls: e,
|
|
12353
12375
|
className: t,
|
|
12354
12376
|
render: n,
|
|
12355
12377
|
options: s
|
|
12356
12378
|
}) => {
|
|
12357
|
-
const r = je(null), o = je(new g.Scene()).current, [a] = An(() =>
|
|
12379
|
+
const r = je(null), o = je(new g.Scene()).current, [a] = An(() => Od()), c = 30, u = 1, d = 0.1, h = 10, f = new g.PerspectiveCamera(
|
|
12358
12380
|
c,
|
|
12359
12381
|
u,
|
|
12360
12382
|
d,
|
|
12361
12383
|
h
|
|
12362
12384
|
), p = je(f).current, y = je(null), _ = Mt(() => {
|
|
12363
12385
|
a && (n(), a.render(o, p));
|
|
12364
|
-
}, [n, a, o, p]),
|
|
12386
|
+
}, [n, a, o, p]), S = Mt(
|
|
12365
12387
|
(x) => {
|
|
12366
12388
|
if (!i || !e) return;
|
|
12367
12389
|
const P = i.position.length(), I = x.clone().multiplyScalar(P), M = 400, O = new g.Matrix4();
|
|
12368
12390
|
O.lookAt(I, new g.Vector3(0, 0, 0), new g.Vector3(0, 1, 0));
|
|
12369
12391
|
const C = new g.Quaternion();
|
|
12370
|
-
C.setFromRotationMatrix(O), i.quaternion.copy(C),
|
|
12392
|
+
C.setFromRotationMatrix(O), i.quaternion.copy(C), fd(
|
|
12371
12393
|
i,
|
|
12372
12394
|
e,
|
|
12373
12395
|
i.position.clone(),
|
|
@@ -12377,11 +12399,11 @@ const Vd = ({
|
|
|
12377
12399
|
), i.up.set(0, 1, 0), i.lookAt(new g.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
|
|
12378
12400
|
},
|
|
12379
12401
|
[i, e, _, o]
|
|
12380
|
-
), { onMouseDown: v, onMouseMove: E, onMouseUp: T, onMouseLeave:
|
|
12402
|
+
), { onMouseDown: v, onMouseMove: E, onMouseUp: T, onMouseLeave: b } = Xd({
|
|
12381
12403
|
gizmoRenderer: a,
|
|
12382
12404
|
gizmoScene: o,
|
|
12383
12405
|
gizmoCamera: p,
|
|
12384
|
-
alignCameraWithVector:
|
|
12406
|
+
alignCameraWithVector: S,
|
|
12385
12407
|
gizmoControlRef: y
|
|
12386
12408
|
});
|
|
12387
12409
|
return rt(() => {
|
|
@@ -12399,15 +12421,15 @@ const Vd = ({
|
|
|
12399
12421
|
renderGizmo: _
|
|
12400
12422
|
}, M = {
|
|
12401
12423
|
syncGizmoCameraWithMain: Eo,
|
|
12402
|
-
syncMainCameraWithGizmo:
|
|
12424
|
+
syncMainCameraWithGizmo: Pd
|
|
12403
12425
|
};
|
|
12404
|
-
return y.current = new
|
|
12426
|
+
return y.current = new zd({
|
|
12405
12427
|
gizmoParams: P,
|
|
12406
12428
|
mainParams: I,
|
|
12407
12429
|
syncFunctions: M,
|
|
12408
12430
|
options: s
|
|
12409
|
-
}), x.addEventListener("mousedown", v), x.addEventListener("mousemove", E), x.addEventListener("mouseup", T), x.addEventListener("mouseleave",
|
|
12410
|
-
y.current && (y.current.dispose(), y.current = null), x.removeEventListener("mousedown", v), x.removeEventListener("mousemove", E), x.removeEventListener("mouseup", T), x.removeEventListener("mouseleave",
|
|
12431
|
+
}), x.addEventListener("mousedown", v), x.addEventListener("mousemove", E), x.addEventListener("mouseup", T), x.addEventListener("mouseleave", b), () => {
|
|
12432
|
+
y.current && (y.current.dispose(), y.current = null), x.removeEventListener("mousedown", v), x.removeEventListener("mousemove", E), x.removeEventListener("mouseup", T), x.removeEventListener("mouseleave", b);
|
|
12411
12433
|
};
|
|
12412
12434
|
}, [i, e, _, E, v, T]), rt(() => {
|
|
12413
12435
|
i && (Eo(p, i, o), _());
|
|
@@ -12418,12 +12440,12 @@ const Vd = ({
|
|
|
12418
12440
|
ref: r
|
|
12419
12441
|
}
|
|
12420
12442
|
);
|
|
12421
|
-
}, Bs = 10,
|
|
12443
|
+
}, Bs = 10, qd = (i) => ({
|
|
12422
12444
|
top: i.startsWith("top") ? Bs : "auto",
|
|
12423
12445
|
bottom: i.startsWith("bottom") ? Bs : "auto",
|
|
12424
12446
|
left: i.endsWith("left") ? Bs : "auto",
|
|
12425
12447
|
right: i.endsWith("right") ? Bs : "auto"
|
|
12426
|
-
}),
|
|
12448
|
+
}), $d = ({
|
|
12427
12449
|
camera: i,
|
|
12428
12450
|
controls: e,
|
|
12429
12451
|
render: t,
|
|
@@ -12442,10 +12464,10 @@ const Vd = ({
|
|
|
12442
12464
|
width: s,
|
|
12443
12465
|
height: s,
|
|
12444
12466
|
zIndex: 1e3,
|
|
12445
|
-
...
|
|
12467
|
+
...qd(n)
|
|
12446
12468
|
},
|
|
12447
12469
|
children: /* @__PURE__ */ Te(
|
|
12448
|
-
|
|
12470
|
+
Yd,
|
|
12449
12471
|
{
|
|
12450
12472
|
camera: i,
|
|
12451
12473
|
controls: r,
|
|
@@ -12455,7 +12477,7 @@ const Vd = ({
|
|
|
12455
12477
|
}
|
|
12456
12478
|
);
|
|
12457
12479
|
};
|
|
12458
|
-
class
|
|
12480
|
+
class Qd extends qa {
|
|
12459
12481
|
constructor(e) {
|
|
12460
12482
|
super(e), this.reset = () => {
|
|
12461
12483
|
this.setState({ hasError: !1, error: null });
|
|
@@ -12487,7 +12509,7 @@ class Kd extends qa {
|
|
|
12487
12509
|
] }) }) : this.props.children;
|
|
12488
12510
|
}
|
|
12489
12511
|
}
|
|
12490
|
-
function
|
|
12512
|
+
function Jd({ status: i, label: e, color: t, backdrop: n }) {
|
|
12491
12513
|
const s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
12492
12514
|
return /* @__PURE__ */ Zn(
|
|
12493
12515
|
"div",
|
|
@@ -12537,14 +12559,14 @@ function Xd({ status: i, label: e, color: t, backdrop: n }) {
|
|
|
12537
12559
|
}
|
|
12538
12560
|
);
|
|
12539
12561
|
}
|
|
12540
|
-
const
|
|
12562
|
+
const ef = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', tf = {
|
|
12541
12563
|
background: "rgba(255,255,255,0.78)",
|
|
12542
12564
|
backdropFilter: "blur(16px)",
|
|
12543
12565
|
WebkitBackdropFilter: "blur(16px)",
|
|
12544
12566
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
12545
12567
|
boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
|
|
12546
|
-
},
|
|
12547
|
-
function
|
|
12568
|
+
}, nf = Object.keys(oa);
|
|
12569
|
+
function sf({ active: i, onSelect: e }) {
|
|
12548
12570
|
return /* @__PURE__ */ Te(
|
|
12549
12571
|
"div",
|
|
12550
12572
|
{
|
|
@@ -12565,9 +12587,9 @@ function Qd({ active: i, onSelect: e }) {
|
|
|
12565
12587
|
// instead of bleeding past the canvas edges.
|
|
12566
12588
|
maxWidth: "calc(100% - 16px)",
|
|
12567
12589
|
overflowX: "auto",
|
|
12568
|
-
...
|
|
12590
|
+
...tf
|
|
12569
12591
|
},
|
|
12570
|
-
children:
|
|
12592
|
+
children: nf.map((t) => /* @__PURE__ */ Te(
|
|
12571
12593
|
"button",
|
|
12572
12594
|
{
|
|
12573
12595
|
type: "button",
|
|
@@ -12582,7 +12604,7 @@ function Qd({ active: i, onSelect: e }) {
|
|
|
12582
12604
|
border: t === i ? "1px solid #111318" : "1px solid transparent",
|
|
12583
12605
|
background: t === i ? "#111318" : "transparent",
|
|
12584
12606
|
color: t === i ? "#fff" : "#3f3f4a",
|
|
12585
|
-
fontFamily:
|
|
12607
|
+
fontFamily: ef,
|
|
12586
12608
|
fontSize: 13,
|
|
12587
12609
|
fontWeight: 500,
|
|
12588
12610
|
lineHeight: 1,
|
|
@@ -12607,7 +12629,7 @@ const Vn = {
|
|
|
12607
12629
|
// default light background (#f0f0f7) and dark studio mode.
|
|
12608
12630
|
backdrop: "rgba(15,16,20,0.6)"
|
|
12609
12631
|
};
|
|
12610
|
-
function
|
|
12632
|
+
function rf(i) {
|
|
12611
12633
|
return i === void 0 || i === !0 ? Vn : i === !1 ? { ...Vn, enabled: !1 } : {
|
|
12612
12634
|
enabled: i.enabled ?? !0,
|
|
12613
12635
|
label: i.label ?? Vn.label,
|
|
@@ -12616,31 +12638,31 @@ function Jd(i) {
|
|
|
12616
12638
|
backdrop: i.backdrop ?? Vn.backdrop
|
|
12617
12639
|
};
|
|
12618
12640
|
}
|
|
12619
|
-
const jt = () => new W("Viewer is not ready yet", Z.COMPONENT_NOT_MOUNTED), ma =
|
|
12641
|
+
const jt = () => new W("Viewer is not ready yet", Z.COMPONENT_NOT_MOUNTED), ma = So(
|
|
12620
12642
|
({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
|
|
12621
12643
|
var N, G;
|
|
12622
|
-
const c = je(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } =
|
|
12644
|
+
const c = je(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = od(
|
|
12623
12645
|
u,
|
|
12624
12646
|
e.ui
|
|
12625
|
-
), p =
|
|
12647
|
+
), p = ad(
|
|
12626
12648
|
e,
|
|
12627
12649
|
d,
|
|
12628
12650
|
n,
|
|
12629
12651
|
s,
|
|
12630
12652
|
r
|
|
12631
|
-
), { viewer: y, isInitialized: _, initError:
|
|
12632
|
-
|
|
12633
|
-
const T = y ? ns(y.getCamera()) : null,
|
|
12653
|
+
), { viewer: y, isInitialized: _, initError: S } = rd(c, p), v = cd(y, _, i), E = ld(y);
|
|
12654
|
+
hd(y, S, e);
|
|
12655
|
+
const T = y ? ns(y.getCamera()) : null, b = y ? gr(y.getControls()) : null, x = y ? $o(y.getRenderer()) : null, P = Mt(() => {
|
|
12634
12656
|
y == null || y.requestRender();
|
|
12635
12657
|
}, [y]), I = ((N = e.helpers) == null ? void 0 : N.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((G = e.helpers) == null ? void 0 : G.gizmo) == "object" ? e.helpers.gizmo : {}, O = Nt(
|
|
12636
|
-
() =>
|
|
12658
|
+
() => rf(e.loadingIndicator),
|
|
12637
12659
|
[e.loadingIndicator]
|
|
12638
|
-
), C = v.status === "error" || !!
|
|
12660
|
+
), C = v.status === "error" || !!S, k = O.enabled && (v.status === "loading" || C);
|
|
12639
12661
|
return $a(a, () => ({
|
|
12640
|
-
scene: y ?
|
|
12662
|
+
scene: y ? St(y.getScene()) : null,
|
|
12641
12663
|
camera: T,
|
|
12642
12664
|
renderer: x,
|
|
12643
|
-
controls:
|
|
12665
|
+
controls: b,
|
|
12644
12666
|
events: E,
|
|
12645
12667
|
loadModel: async (z) => {
|
|
12646
12668
|
if (!y)
|
|
@@ -12707,40 +12729,40 @@ const jt = () => new W("Viewer is not ready yet", Z.COMPONENT_NOT_MOUNTED), ma =
|
|
|
12707
12729
|
dispose: () => {
|
|
12708
12730
|
y == null || y.dispose();
|
|
12709
12731
|
}
|
|
12710
|
-
}), [y, T, x,
|
|
12711
|
-
/* @__PURE__ */ Te(
|
|
12712
|
-
I && _ && T &&
|
|
12713
|
-
|
|
12732
|
+
}), [y, T, x, b, E]), /* @__PURE__ */ Te(Qd, { children: /* @__PURE__ */ Te(ud, { viewer: y, canvasRef: c, children: /* @__PURE__ */ Zn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
12733
|
+
/* @__PURE__ */ Te(dd, {}),
|
|
12734
|
+
I && _ && T && b && /* @__PURE__ */ Te(
|
|
12735
|
+
$d,
|
|
12714
12736
|
{
|
|
12715
12737
|
camera: T,
|
|
12716
|
-
controls:
|
|
12738
|
+
controls: b,
|
|
12717
12739
|
render: P,
|
|
12718
12740
|
placement: M.placement,
|
|
12719
12741
|
size: M.size
|
|
12720
12742
|
}
|
|
12721
12743
|
),
|
|
12722
12744
|
k && /* @__PURE__ */ Te(
|
|
12723
|
-
|
|
12745
|
+
Jd,
|
|
12724
12746
|
{
|
|
12725
12747
|
status: C ? "error" : "loading",
|
|
12726
|
-
label: C ? O.errorLabel ?? (
|
|
12748
|
+
label: C ? O.errorLabel ?? (S == null ? void 0 : S.message) ?? v.error ?? "Failed to load model" : O.label,
|
|
12727
12749
|
color: O.color,
|
|
12728
12750
|
backdrop: O.backdrop
|
|
12729
12751
|
}
|
|
12730
12752
|
),
|
|
12731
12753
|
h && /* The defaults ARE the studio look (pinned by presets.test.ts),
|
|
12732
12754
|
so with no preset set the studio chip is the honest active one. */
|
|
12733
|
-
/* @__PURE__ */ Te(
|
|
12755
|
+
/* @__PURE__ */ Te(sf, { active: d ?? "studio", onSelect: f }),
|
|
12734
12756
|
o
|
|
12735
12757
|
] }) }) });
|
|
12736
12758
|
}
|
|
12737
12759
|
);
|
|
12738
12760
|
ma.displayName = "SimpleViewer";
|
|
12739
|
-
const
|
|
12761
|
+
const of = So(
|
|
12740
12762
|
(i, e) => /* @__PURE__ */ Te(ma, { ref: e, ...i })
|
|
12741
12763
|
);
|
|
12742
|
-
|
|
12743
|
-
const
|
|
12764
|
+
of.displayName = "SimpleViewer";
|
|
12765
|
+
const af = () => /* @__PURE__ */ Te(
|
|
12744
12766
|
"span",
|
|
12745
12767
|
{
|
|
12746
12768
|
"aria-hidden": "true",
|
|
@@ -12755,7 +12777,7 @@ const tf = () => /* @__PURE__ */ Te(
|
|
|
12755
12777
|
}
|
|
12756
12778
|
}
|
|
12757
12779
|
);
|
|
12758
|
-
function
|
|
12780
|
+
function pf({ position: i, occlude: e = !1, children: t }) {
|
|
12759
12781
|
const { viewer: n } = la(), s = je(null), [r, o, a] = i;
|
|
12760
12782
|
rt(() => {
|
|
12761
12783
|
if (!n)
|
|
@@ -12767,13 +12789,13 @@ function lf({ position: i, occlude: e = !1, children: t }) {
|
|
|
12767
12789
|
if (!d)
|
|
12768
12790
|
return;
|
|
12769
12791
|
const h = { x: r, y: o, z: a }, f = () => {
|
|
12770
|
-
const
|
|
12771
|
-
if (
|
|
12772
|
-
if (!
|
|
12792
|
+
const S = d.project(h, e);
|
|
12793
|
+
if (S) {
|
|
12794
|
+
if (!S.visible) {
|
|
12773
12795
|
u.style.visibility = "hidden";
|
|
12774
12796
|
return;
|
|
12775
12797
|
}
|
|
12776
|
-
u.style.visibility = "visible", u.style.left = `${
|
|
12798
|
+
u.style.visibility = "visible", u.style.left = `${S.left}px`, u.style.top = `${S.top}px`;
|
|
12777
12799
|
}
|
|
12778
12800
|
}, p = () => {
|
|
12779
12801
|
d.invalidate(), f();
|
|
@@ -12785,7 +12807,7 @@ function lf({ position: i, occlude: e = !1, children: t }) {
|
|
|
12785
12807
|
y.on("model:loaded", p)
|
|
12786
12808
|
];
|
|
12787
12809
|
return window.addEventListener("resize", p), () => {
|
|
12788
|
-
_.forEach((
|
|
12810
|
+
_.forEach((S) => S()), window.removeEventListener("resize", p);
|
|
12789
12811
|
};
|
|
12790
12812
|
}, [n, r, o, a, e]);
|
|
12791
12813
|
const c = t != null && t !== !1;
|
|
@@ -12806,7 +12828,7 @@ function lf({ position: i, occlude: e = !1, children: t }) {
|
|
|
12806
12828
|
// interactive custom children keep receiving pointer events.
|
|
12807
12829
|
pointerEvents: c ? "auto" : "none"
|
|
12808
12830
|
},
|
|
12809
|
-
children: c ? t : /* @__PURE__ */ Te(
|
|
12831
|
+
children: c ? t : /* @__PURE__ */ Te(af, {})
|
|
12810
12832
|
}
|
|
12811
12833
|
);
|
|
12812
12834
|
}
|
|
@@ -12815,9 +12837,9 @@ export {
|
|
|
12815
12837
|
Qe as C,
|
|
12816
12838
|
Dr as D,
|
|
12817
12839
|
Z as E,
|
|
12818
|
-
|
|
12840
|
+
pf as H,
|
|
12819
12841
|
De as I,
|
|
12820
|
-
|
|
12842
|
+
uf as L,
|
|
12821
12843
|
Zs as M,
|
|
12822
12844
|
$e as O,
|
|
12823
12845
|
mr as P,
|
|
@@ -12826,13 +12848,13 @@ export {
|
|
|
12826
12848
|
rr as T,
|
|
12827
12849
|
oa as V,
|
|
12828
12850
|
hr as a,
|
|
12829
|
-
|
|
12851
|
+
df as b,
|
|
12830
12852
|
Hc as c,
|
|
12831
12853
|
pr as d,
|
|
12832
12854
|
W as e,
|
|
12833
12855
|
Xs as f,
|
|
12834
12856
|
tl as g,
|
|
12835
|
-
|
|
12857
|
+
of as h,
|
|
12836
12858
|
Yi as i,
|
|
12837
|
-
|
|
12859
|
+
td as r
|
|
12838
12860
|
};
|