softbox 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThreePathTracingService-BE8t2ThI.js → ThreePathTracingService-CPU_eQdF.js} +391 -370
- package/dist/{ThreePathTracingService-D0M3HT7t.cjs → ThreePathTracingService-CqzQw5mN.cjs} +9 -9
- package/dist/{index-BBIH_9cu.cjs → index-B1GvtGsa.cjs} +5 -5
- package/dist/{index-B0k0_Cfm.js → index-ryi3d7wY.js} +517 -516
- package/dist/simple-viewer.cjs +1 -1
- package/dist/simple-viewer.es.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as Te, jsxs as Hn } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as Dt, useRef as Ge, useState as Xn, useEffect as ht, useCallback as Rt, createContext as
|
|
2
|
+
import { useMemo as Dt, useRef as Ge, useState as Xn, useEffect as ht, useCallback as Rt, createContext as Za, useContext as Wa, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
|
|
3
3
|
import * as T from "three";
|
|
4
|
-
import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as q, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as
|
|
4
|
+
import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as q, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Gn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as Yn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as xn, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Un, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Be, TOUCH as Ye, Spherical as js, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as In, DataUtils as Et, RedFormat as fs, FloatType as Vn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } 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);
|
|
@@ -97,7 +97,7 @@ const Ir = 300, ni = {
|
|
|
97
97
|
millimeters: 1e-3,
|
|
98
98
|
feet: 0.3048,
|
|
99
99
|
inches: 0.0254
|
|
100
|
-
},
|
|
100
|
+
}, vc = "softbox-units-scale";
|
|
101
101
|
function Po(i) {
|
|
102
102
|
const e = i ?? "meters";
|
|
103
103
|
if (!Object.prototype.hasOwnProperty.call(ni, e))
|
|
@@ -108,7 +108,7 @@ function Po(i) {
|
|
|
108
108
|
return ni[e];
|
|
109
109
|
}
|
|
110
110
|
const Cr = "#1a1a1f";
|
|
111
|
-
class
|
|
111
|
+
class Rc {
|
|
112
112
|
/**
|
|
113
113
|
* Apply helpers, lighting and a solid-color gradient background. Synchronous;
|
|
114
114
|
* failures are logged and skipped so one bad section never aborts setup.
|
|
@@ -194,7 +194,7 @@ class vc {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
class
|
|
197
|
+
class Mc {
|
|
198
198
|
constructor(e = {}) {
|
|
199
199
|
this.animationFrameId = null, this.lastRenderTime = 0, this.idleTimeout = null, this.isIdle = !1, this.needsRender = !0, this.continuousRenderingEnabled = !1, this.continuousReasons = /* @__PURE__ */ new Set(), this.alwaysRender = !1, this.enableIdleDetection = e.enableIdleDetection ?? !0, this.idleDelay = e.idleDelay ?? 1e3, this.targetFPS = e.targetFPS ?? 60, this.frameInterval = 1e3 / this.targetFPS, this.enableFrameRateLimiting = e.enableFrameRateLimiting ?? !0, this.alwaysRender = e.alwaysRender ?? !1, this.lastRenderTime = performance.now();
|
|
200
200
|
}
|
|
@@ -458,7 +458,7 @@ class At {
|
|
|
458
458
|
return { ...this.data };
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class Ic {
|
|
462
462
|
constructor() {
|
|
463
463
|
this.state = new At(), this.stateChangeCallbacks = /* @__PURE__ */ new Set();
|
|
464
464
|
}
|
|
@@ -565,7 +565,7 @@ function Oo(i) {
|
|
|
565
565
|
const e = i.toDataURL("image/png");
|
|
566
566
|
return !e || e === "data:," ? null : e;
|
|
567
567
|
}
|
|
568
|
-
class
|
|
568
|
+
class Cc {
|
|
569
569
|
constructor(e) {
|
|
570
570
|
this.screenshotElement = null, this.isShowingScreenshot = !1, this.renderer = e.renderer, this.onRestore = e.onRestore;
|
|
571
571
|
}
|
|
@@ -626,7 +626,7 @@ class Ic {
|
|
|
626
626
|
this.screenshotResizeHandler && (window.removeEventListener("resize", this.screenshotResizeHandler), this.screenshotResizeHandler = void 0), this.screenshotElement && this.screenshotElement.parentElement && this.screenshotElement.parentElement.removeChild(this.screenshotElement), this.isShowingScreenshot && (this.renderer.getDomElement().style.display = ""), this.screenshotElement = null, this.isShowingScreenshot = !1, this.serializedSceneState = void 0;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
class
|
|
629
|
+
class Pc {
|
|
630
630
|
constructor(e) {
|
|
631
631
|
this.currentModel = null, this.modelLoader = e.modelLoader, this.scene = e.scene, this.camera = e.camera, this.controls = e.controls, this.floorAlignmentService = e.floorAlignmentService, this.sceneSetupService = e.sceneSetupService, this.renderer = e.renderer, this.autoFitToObject = e.autoFitToObject ?? !1, this.unitsScaleToMeters = e.unitsScaleToMeters ?? 1;
|
|
632
632
|
}
|
|
@@ -735,7 +735,7 @@ class Cc {
|
|
|
735
735
|
this.disposeCurrentModel(), (t = (e = this.modelLoader).dispose) == null || t.call(e), this.lastModelUrl = void 0;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
class
|
|
738
|
+
class Lc {
|
|
739
739
|
constructor(e) {
|
|
740
740
|
this.scene = e.scene, this.pathTracingService = e.pathTracingService, this.environmentService = e.environmentService;
|
|
741
741
|
}
|
|
@@ -782,10 +782,10 @@ class Pc {
|
|
|
782
782
|
globalThis.gc && ((e = globalThis.gc) == null || e.call(globalThis));
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Oc(i) {
|
|
786
786
|
return typeof i == "object" && i !== null && "getInternalRenderer" in i && typeof i.getInternalRenderer == "function";
|
|
787
787
|
}
|
|
788
|
-
class
|
|
788
|
+
class Dc {
|
|
789
789
|
constructor(e) {
|
|
790
790
|
this.completeHandled = !1, this.selfPauseListeners = /* @__PURE__ */ new Set(), this.deps = e;
|
|
791
791
|
}
|
|
@@ -895,7 +895,7 @@ class Oc {
|
|
|
895
895
|
}, 100);
|
|
896
896
|
return;
|
|
897
897
|
}
|
|
898
|
-
if (s.requestRender(), o(d, 100),
|
|
898
|
+
if (s.requestRender(), o(d, 100), Oc(c)) {
|
|
899
899
|
const u = c.getInternalRenderer();
|
|
900
900
|
u && (u.autoClear = !1);
|
|
901
901
|
}
|
|
@@ -918,14 +918,14 @@ function Do() {
|
|
|
918
918
|
const i = "0123456789abcdef";
|
|
919
919
|
return Array.from("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", (t) => t === "x" ? i[Math.floor(Math.random() * 16)] : t === "y" ? (Math.floor(Math.random() * 16) & 3 | 8).toString(16) : t).join("");
|
|
920
920
|
}
|
|
921
|
-
const
|
|
921
|
+
const Nc = (i) => [
|
|
922
922
|
i,
|
|
923
923
|
"video/webm;codecs=vp9",
|
|
924
924
|
"video/webm;codecs=vp8",
|
|
925
925
|
"video/webm",
|
|
926
926
|
"video/mp4"
|
|
927
927
|
].filter((t) => !!t).find((t) => MediaRecorder.isTypeSupported(t));
|
|
928
|
-
class
|
|
928
|
+
class kc {
|
|
929
929
|
constructor(e) {
|
|
930
930
|
this.pendingSettlers = /* @__PURE__ */ new Set(), this.deps = e;
|
|
931
931
|
}
|
|
@@ -987,7 +987,7 @@ class Nc {
|
|
|
987
987
|
let r;
|
|
988
988
|
try {
|
|
989
989
|
r = new MediaRecorder(s, {
|
|
990
|
-
mimeType:
|
|
990
|
+
mimeType: Nc(e.mimeType),
|
|
991
991
|
videoBitsPerSecond: e.videoBitsPerSecond
|
|
992
992
|
});
|
|
993
993
|
} catch (h) {
|
|
@@ -1100,17 +1100,17 @@ class Nc {
|
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
class
|
|
1103
|
+
class Fc {
|
|
1104
1104
|
constructor(e) {
|
|
1105
1105
|
var r;
|
|
1106
|
-
this.frameCount = 0, this.disposed = !1, this.pendingTimers = /* @__PURE__ */ new Set(), this.modelLoadChain = Promise.resolve(), this.renderer = e.renderer, this.scene = e.scene, this.camera = e.camera, this.controls = e.controls, this.options = e.options, this.rendererOptions = e.rendererOptions, this.sceneSetupService = e.sceneSetupService, this.environmentService = e.environmentService, this.selectionService = e.selectionService, this.anchorProjectionService = e.anchorProjectionService, this.animationService = e.animationService, this.stateManager = new
|
|
1106
|
+
this.frameCount = 0, this.disposed = !1, this.pendingTimers = /* @__PURE__ */ new Set(), this.modelLoadChain = Promise.resolve(), this.renderer = e.renderer, this.scene = e.scene, this.camera = e.camera, this.controls = e.controls, this.options = e.options, this.rendererOptions = e.rendererOptions, this.sceneSetupService = e.sceneSetupService, this.environmentService = e.environmentService, this.selectionService = e.selectionService, this.anchorProjectionService = e.anchorProjectionService, this.animationService = e.animationService, this.stateManager = new Ic(), this.screenshotManager = new Cc({
|
|
1107
1107
|
renderer: this.renderer,
|
|
1108
1108
|
onRestore: async () => {
|
|
1109
1109
|
await this.restoreFromScreenshot();
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
1112
1112
|
const t = Po(this.options.units);
|
|
1113
|
-
this.modelManager = new
|
|
1113
|
+
this.modelManager = new Pc({
|
|
1114
1114
|
modelLoader: e.modelLoader,
|
|
1115
1115
|
scene: this.scene,
|
|
1116
1116
|
camera: this.camera,
|
|
@@ -1120,20 +1120,20 @@ class kc {
|
|
|
1120
1120
|
renderer: this.renderer,
|
|
1121
1121
|
autoFitToObject: (r = this.options.camera) == null ? void 0 : r.autoFitToObject,
|
|
1122
1122
|
unitsScaleToMeters: t
|
|
1123
|
-
}), this.resourceManager = new
|
|
1123
|
+
}), this.resourceManager = new Lc({
|
|
1124
1124
|
scene: this.scene,
|
|
1125
1125
|
pathTracingService: e.pathTracingService,
|
|
1126
1126
|
environmentService: this.environmentService
|
|
1127
|
-
}), this.sceneConfigurator = new
|
|
1127
|
+
}), this.sceneConfigurator = new Rc(), this.events = new nr();
|
|
1128
1128
|
const n = this.options.rendering || {}, s = this.options.staticScene !== !1;
|
|
1129
|
-
this.renderLoopManager = new
|
|
1129
|
+
this.renderLoopManager = new Mc({
|
|
1130
1130
|
enableIdleDetection: n.enableIdleDetection ?? s,
|
|
1131
1131
|
idleDelay: n.idleDelay,
|
|
1132
1132
|
targetFPS: n.targetFPS,
|
|
1133
1133
|
enableFrameRateLimiting: n.enableFrameRateLimiting,
|
|
1134
1134
|
alwaysRender: !1
|
|
1135
1135
|
// Will be set later based on staticScene
|
|
1136
|
-
}), this.pathTracing = new
|
|
1136
|
+
}), this.pathTracing = new Dc({
|
|
1137
1137
|
service: e.pathTracingService,
|
|
1138
1138
|
events: this.events,
|
|
1139
1139
|
renderLoopManager: this.renderLoopManager,
|
|
@@ -1142,7 +1142,7 @@ class kc {
|
|
|
1142
1142
|
isDisposed: () => this.disposed,
|
|
1143
1143
|
schedule: (o, a) => this.schedule(o, a),
|
|
1144
1144
|
replaceWithScreenshot: () => this.replaceWithScreenshot()
|
|
1145
|
-
}), this.capture = new
|
|
1145
|
+
}), this.capture = new kc({
|
|
1146
1146
|
renderer: this.renderer,
|
|
1147
1147
|
scene: this.scene,
|
|
1148
1148
|
camera: this.camera,
|
|
@@ -1530,7 +1530,7 @@ class Wt {
|
|
|
1530
1530
|
return new Wt(new T.Vector3(e, t, n));
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
const No = 0,
|
|
1533
|
+
const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, Oe = qe / 4, sr = 65535, zd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
|
|
1534
1534
|
strategy: No,
|
|
1535
1535
|
maxDepth: 40,
|
|
1536
1536
|
maxLeafSize: 10,
|
|
@@ -1592,7 +1592,7 @@ function ze(i, e) {
|
|
|
1592
1592
|
function rr(i, e) {
|
|
1593
1593
|
return e[i + 7];
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function Bd(i) {
|
|
1596
1596
|
return i;
|
|
1597
1597
|
}
|
|
1598
1598
|
function ii(i, e, t, n, s) {
|
|
@@ -1608,20 +1608,20 @@ function ii(i, e, t, n, s) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = d, n[5] = u, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = w;
|
|
1610
1610
|
}
|
|
1611
|
-
const Ct = 32,
|
|
1611
|
+
const Ct = 32, Uc = (i, e) => i.candidate - e.candidate, Bt = /* @__PURE__ */ new Array(Ct).fill().map(() => ({
|
|
1612
1612
|
count: 0,
|
|
1613
1613
|
bounds: new Float32Array(6),
|
|
1614
1614
|
rightCacheBounds: new Float32Array(6),
|
|
1615
1615
|
leftCacheBounds: new Float32Array(6),
|
|
1616
1616
|
candidate: 0
|
|
1617
1617
|
})), gs = /* @__PURE__ */ new Float32Array(6);
|
|
1618
|
-
function
|
|
1618
|
+
function Hc(i, e, t, n, s, r) {
|
|
1619
1619
|
let o = -1, a = 0;
|
|
1620
1620
|
if (r === No)
|
|
1621
1621
|
o = Or(e), o !== -1 && (a = (e[o] + e[o + 3]) / 2);
|
|
1622
|
-
else if (r ===
|
|
1623
|
-
o = Or(i), o !== -1 && (a =
|
|
1624
|
-
else if (r ===
|
|
1622
|
+
else if (r === zc)
|
|
1623
|
+
o = Or(i), o !== -1 && (a = jc(t, n, s, o));
|
|
1624
|
+
else if (r === Bc) {
|
|
1625
1625
|
const c = Cn(i);
|
|
1626
1626
|
let d = si * s;
|
|
1627
1627
|
const u = t.offset || 0, h = (n - u) * 6, f = (n + s - u) * 6;
|
|
@@ -1643,7 +1643,7 @@ function Uc(i, e, t, n, s, r) {
|
|
|
1643
1643
|
O[C] = 1 / 0, O[C + 3] = -1 / 0, M[C] = 1 / 0, M[C + 3] = -1 / 0, I[C] = 1 / 0, I[C + 3] = -1 / 0;
|
|
1644
1644
|
ms(A, t, I);
|
|
1645
1645
|
}
|
|
1646
|
-
E.sort(
|
|
1646
|
+
E.sort(Uc);
|
|
1647
1647
|
let _ = s;
|
|
1648
1648
|
for (let A = 0; A < _; A++) {
|
|
1649
1649
|
const P = E[A];
|
|
@@ -1703,7 +1703,7 @@ function Uc(i, e, t, n, s, r) {
|
|
|
1703
1703
|
console.warn(`BVH: Invalid build strategy value ${r} used.`);
|
|
1704
1704
|
return { axis: o, pos: a };
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function jc(i, e, t, n) {
|
|
1707
1707
|
let s = 0;
|
|
1708
1708
|
const r = i.offset;
|
|
1709
1709
|
for (let o = e, a = e + t; o < a; o++)
|
|
@@ -1715,7 +1715,7 @@ class ri {
|
|
|
1715
1715
|
this.boundingData = new Float32Array(6);
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1718
|
+
function Gc(i, e, t, n, s, r) {
|
|
1719
1719
|
let o = n, a = n + s - 1;
|
|
1720
1720
|
const c = r.pos, d = r.axis * 2, u = t.offset || 0;
|
|
1721
1721
|
for (; ; ) {
|
|
@@ -1738,11 +1738,11 @@ function jc(i, e, t, n, s, r) {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
let Fo, Bs, Ii, zo;
|
|
1741
|
-
const
|
|
1741
|
+
const Vc = Math.pow(2, 32);
|
|
1742
1742
|
function Ci(i) {
|
|
1743
1743
|
return "count" in i ? 1 : 1 + Ci(i.left) + Ci(i.right);
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1745
|
+
function Zc(i, e, t) {
|
|
1746
1746
|
return Fo = new Float32Array(t), Bs = new Uint32Array(t), Ii = new Uint16Array(t), zo = new Uint8Array(t), Pi(i, e);
|
|
1747
1747
|
}
|
|
1748
1748
|
function Pi(i, e) {
|
|
@@ -1755,12 +1755,12 @@ function Pi(i, e) {
|
|
|
1755
1755
|
const { left: o, right: a, splitAxis: c } = e, d = i + qe;
|
|
1756
1756
|
let u = Pi(d, o);
|
|
1757
1757
|
const h = i / qe, p = u / qe - h;
|
|
1758
|
-
if (p >
|
|
1758
|
+
if (p > Vc)
|
|
1759
1759
|
throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");
|
|
1760
1760
|
return Bs[t + 6] = p, Bs[t + 7] = c, Pi(u, a);
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function Wc(i, e, t, n, s, r) {
|
|
1764
1764
|
const {
|
|
1765
1765
|
maxDepth: o,
|
|
1766
1766
|
verbose: a,
|
|
@@ -1777,10 +1777,10 @@ function Zc(i, e, t, n, s, r) {
|
|
|
1777
1777
|
function x(E, b, _, A = null, P = 0) {
|
|
1778
1778
|
if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), _ <= c || P >= o)
|
|
1779
1779
|
return w(b + _), E.offset = b, E.count = _, E;
|
|
1780
|
-
const I =
|
|
1780
|
+
const I = Hc(E.boundingData, A, e, b, _, d);
|
|
1781
1781
|
if (I.axis === -1)
|
|
1782
1782
|
return w(b + _), E.offset = b, E.count = _, E;
|
|
1783
|
-
const M =
|
|
1783
|
+
const M = Gc(h, f, e, b, _, I);
|
|
1784
1784
|
if (M === b || M === b + _)
|
|
1785
1785
|
w(b + _), E.offset = b, E.count = _;
|
|
1786
1786
|
else {
|
|
@@ -1793,14 +1793,14 @@ function Zc(i, e, t, n, s, r) {
|
|
|
1793
1793
|
return E;
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function Kc(i, e) {
|
|
1797
1797
|
const t = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, n = i.getRootRanges(e.range), s = n[0], r = n[n.length - 1], o = {
|
|
1798
1798
|
offset: s.offset,
|
|
1799
1799
|
count: r.offset + r.count - s.offset
|
|
1800
1800
|
}, a = new Float32Array(6 * o.count);
|
|
1801
1801
|
a.offset = o.offset, i.computePrimitiveBounds(o.offset, o.count, a), i._roots = n.map((c) => {
|
|
1802
|
-
const d =
|
|
1803
|
-
return
|
|
1802
|
+
const d = Wc(i, a, c.offset, c.count, e, o), u = Ci(d), h = new t(qe * u);
|
|
1803
|
+
return Zc(0, d, h), h;
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
1806
|
class or {
|
|
@@ -1815,7 +1815,7 @@ class or {
|
|
|
1815
1815
|
this._primitives.push(e);
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
|
-
class
|
|
1818
|
+
class Xc {
|
|
1819
1819
|
constructor() {
|
|
1820
1820
|
this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
|
|
1821
1821
|
const e = [];
|
|
@@ -1827,10 +1827,10 @@ class Kc {
|
|
|
1827
1827
|
};
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
|
-
const be = /* @__PURE__ */ new
|
|
1830
|
+
const be = /* @__PURE__ */ new Xc();
|
|
1831
1831
|
let Zt, _n;
|
|
1832
1832
|
const cn = [], ys = /* @__PURE__ */ new or(() => new _t());
|
|
1833
|
-
function
|
|
1833
|
+
function Yc(i, e, t, n, s, r) {
|
|
1834
1834
|
Zt = ys.getPrimitive(), _n = ys.getPrimitive(), cn.push(Zt, _n), be.setBuffer(i._roots[e]);
|
|
1835
1835
|
const o = Li(0, i.geometry, t, n, s, r);
|
|
1836
1836
|
be.clearBuffer(), ys.releasePrimitive(Zt), ys.releasePrimitive(_n), cn.pop(), cn.pop();
|
|
@@ -1902,7 +1902,7 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
const Zn = /* @__PURE__ */ new be.constructor(), Vs = /* @__PURE__ */ new be.constructor(), jt = /* @__PURE__ */ new or(() => new _t()), ln = /* @__PURE__ */ new _t(), hn = /* @__PURE__ */ new _t(), oi = /* @__PURE__ */ new _t(), ai = /* @__PURE__ */ new _t();
|
|
1904
1904
|
let ci = !1;
|
|
1905
|
-
function
|
|
1905
|
+
function qc(i, e, t, n) {
|
|
1906
1906
|
if (ci)
|
|
1907
1907
|
throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
|
|
1908
1908
|
ci = !0;
|
|
@@ -2115,7 +2115,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
|
|
|
2115
2115
|
return I;
|
|
2116
2116
|
}
|
|
2117
2117
|
const kr = /* @__PURE__ */ new _t(), un = /* @__PURE__ */ new Float32Array(6);
|
|
2118
|
-
class
|
|
2118
|
+
class $c {
|
|
2119
2119
|
constructor() {
|
|
2120
2120
|
this._roots = null, this.primitiveBuffer = null, this.primitiveBufferStride = null;
|
|
2121
2121
|
}
|
|
@@ -2123,7 +2123,7 @@ class qc {
|
|
|
2123
2123
|
e = {
|
|
2124
2124
|
...ko,
|
|
2125
2125
|
...e
|
|
2126
|
-
},
|
|
2126
|
+
}, Kc(this, e);
|
|
2127
2127
|
}
|
|
2128
2128
|
getRootRanges() {
|
|
2129
2129
|
throw new Error("BVH: getRootRanges() not implemented");
|
|
@@ -2263,7 +2263,7 @@ class qc {
|
|
|
2263
2263
|
const u = this._roots;
|
|
2264
2264
|
for (let h = 0, f = u.length; h < f; h++) {
|
|
2265
2265
|
const p = u[h];
|
|
2266
|
-
if (c =
|
|
2266
|
+
if (c = Yc(this, h, n, s, t, d), c)
|
|
2267
2267
|
break;
|
|
2268
2268
|
d += p.byteLength / qe;
|
|
2269
2269
|
}
|
|
@@ -2282,10 +2282,10 @@ class qc {
|
|
|
2282
2282
|
*/
|
|
2283
2283
|
bvhcast(e, t, n) {
|
|
2284
2284
|
let { intersectsRanges: s } = n;
|
|
2285
|
-
return
|
|
2285
|
+
return qc(this, e, t, s);
|
|
2286
2286
|
}
|
|
2287
2287
|
}
|
|
2288
|
-
function
|
|
2288
|
+
function Qc() {
|
|
2289
2289
|
return typeof SharedArrayBuffer < "u";
|
|
2290
2290
|
}
|
|
2291
2291
|
function ar(i) {
|
|
@@ -2294,32 +2294,32 @@ function ar(i) {
|
|
|
2294
2294
|
function Ys(i) {
|
|
2295
2295
|
return ar(i) / 3;
|
|
2296
2296
|
}
|
|
2297
|
-
function
|
|
2297
|
+
function Jc(i, e = ArrayBuffer) {
|
|
2298
2298
|
return i > 65535 ? new Uint32Array(new e(4 * i)) : new Uint16Array(new e(2 * i));
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function el(i, e) {
|
|
2301
2301
|
if (!i.index) {
|
|
2302
|
-
const t = i.attributes.position.count, n = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s =
|
|
2302
|
+
const t = i.attributes.position.count, n = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Jc(t, n);
|
|
2303
2303
|
i.setIndex(new jn(s, 1));
|
|
2304
2304
|
for (let r = 0; r < t; r++)
|
|
2305
2305
|
s[r] = r;
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function tl(i, e, t) {
|
|
2309
2309
|
const n = ar(i) / t, s = e || i.drawRange, r = s.start / t, o = (s.start + s.count) / t, a = Math.max(0, r), c = Math.min(n, o) - a;
|
|
2310
2310
|
return {
|
|
2311
2311
|
offset: Math.floor(a),
|
|
2312
2312
|
count: Math.floor(c)
|
|
2313
2313
|
};
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function nl(i, e) {
|
|
2316
2316
|
return i.groups.map((t) => ({
|
|
2317
2317
|
offset: t.start / e,
|
|
2318
2318
|
count: t.count / e
|
|
2319
2319
|
}));
|
|
2320
2320
|
}
|
|
2321
2321
|
function Fr(i, e, t) {
|
|
2322
|
-
const n =
|
|
2322
|
+
const n = tl(i, e, t), s = nl(i, t);
|
|
2323
2323
|
if (!s.length)
|
|
2324
2324
|
return [n];
|
|
2325
2325
|
const r = [], o = n.offset, a = n.offset + n.count, c = ar(i) / t, d = [];
|
|
@@ -2338,7 +2338,7 @@ function Fr(i, e, t) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
return r;
|
|
2340
2340
|
}
|
|
2341
|
-
function
|
|
2341
|
+
function sl(i, e) {
|
|
2342
2342
|
const t = i[i.length - 1], n = t.offset + t.count > 2 ** 16, s = i.reduce((d, u) => d + u.count, 0), r = n ? 4 : 2, o = e ? new SharedArrayBuffer(s * r) : new ArrayBuffer(s * r), a = n ? new Uint32Array(o) : new Uint16Array(o);
|
|
2343
2343
|
let c = 0;
|
|
2344
2344
|
for (let d = 0; d < i.length; d++) {
|
|
@@ -2349,7 +2349,7 @@ function nl(i, e) {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
return a;
|
|
2351
2351
|
}
|
|
2352
|
-
class
|
|
2352
|
+
class il extends $c {
|
|
2353
2353
|
/**
|
|
2354
2354
|
* Whether the BVH was built in indirect mode.
|
|
2355
2355
|
* @type {boolean}
|
|
@@ -2376,7 +2376,7 @@ class sl extends qc {
|
|
|
2376
2376
|
if (e.index && e.index.isInterleavedBufferAttribute)
|
|
2377
2377
|
throw new Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.");
|
|
2378
2378
|
} else throw new Error("BVH: Only BufferGeometries are supported.");
|
|
2379
|
-
if (t.useSharedArrayBuffer &&
|
|
2379
|
+
if (t.useSharedArrayBuffer && !Qc())
|
|
2380
2380
|
throw new Error("BVH: SharedArrayBuffer is not available.");
|
|
2381
2381
|
super(), this.geometry = e, this.resolvePrimitiveIndex = t.indirect ? (n) => this._indirectBuffer[n] : (n) => n, this.primitiveBuffer = null, this.primitiveBufferStride = null, this._indirectBuffer = null, t = {
|
|
2382
2382
|
...ko,
|
|
@@ -2386,10 +2386,10 @@ class sl extends qc {
|
|
|
2386
2386
|
init(e) {
|
|
2387
2387
|
const { geometry: t, primitiveStride: n } = this;
|
|
2388
2388
|
if (e.indirect) {
|
|
2389
|
-
const s = Fr(t, e.range, n), r =
|
|
2389
|
+
const s = Fr(t, e.range, n), r = sl(s, e.useSharedArrayBuffer);
|
|
2390
2390
|
this._indirectBuffer = r;
|
|
2391
2391
|
} else
|
|
2392
|
-
|
|
2392
|
+
el(t, e);
|
|
2393
2393
|
super.init(e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new _t()));
|
|
2394
2394
|
}
|
|
2395
2395
|
// Abstract methods to be implemented by subclasses
|
|
@@ -2439,7 +2439,7 @@ kt.prototype.setFromBox = /* @__PURE__ */ (function() {
|
|
|
2439
2439
|
this.min = o, this.max = a;
|
|
2440
2440
|
};
|
|
2441
2441
|
})();
|
|
2442
|
-
const
|
|
2442
|
+
const rl = /* @__PURE__ */ (function() {
|
|
2443
2443
|
const i = /* @__PURE__ */ new q(), e = /* @__PURE__ */ new q(), t = /* @__PURE__ */ new q();
|
|
2444
2444
|
return function(s, r, o) {
|
|
2445
2445
|
const a = s.start, c = i, d = r.start, u = e;
|
|
@@ -2451,7 +2451,7 @@ const il = /* @__PURE__ */ (function() {
|
|
|
2451
2451
|
})(), cr = /* @__PURE__ */ (function() {
|
|
2452
2452
|
const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new q(), t = /* @__PURE__ */ new q();
|
|
2453
2453
|
return function(s, r, o, a) {
|
|
2454
|
-
|
|
2454
|
+
rl(s, r, i);
|
|
2455
2455
|
let c = i.x, d = i.y;
|
|
2456
2456
|
if (c >= 0 && c <= 1 && d >= 0 && d <= 1) {
|
|
2457
2457
|
s.at(c, o), r.at(d, a);
|
|
@@ -2477,7 +2477,7 @@ const il = /* @__PURE__ */ (function() {
|
|
|
2477
2477
|
}
|
|
2478
2478
|
}
|
|
2479
2479
|
};
|
|
2480
|
-
})(),
|
|
2480
|
+
})(), ol = /* @__PURE__ */ (function() {
|
|
2481
2481
|
const i = /* @__PURE__ */ new q(), e = /* @__PURE__ */ new q(), t = /* @__PURE__ */ new Qn(), n = /* @__PURE__ */ new Nt();
|
|
2482
2482
|
return function(r, o) {
|
|
2483
2483
|
const { radius: a, center: c } = r, { a: d, b: u, c: h } = o;
|
|
@@ -2489,7 +2489,7 @@ const il = /* @__PURE__ */ (function() {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
return !1;
|
|
2491
2491
|
};
|
|
2492
|
-
})(),
|
|
2492
|
+
})(), al = ["x", "y", "z"], Pt = 1e-15, zr = Pt * Pt;
|
|
2493
2493
|
function ot(i) {
|
|
2494
2494
|
return Math.abs(i) < Pt;
|
|
2495
2495
|
}
|
|
@@ -2503,7 +2503,7 @@ class Tt extends En {
|
|
|
2503
2503
|
* @returns {boolean}
|
|
2504
2504
|
*/
|
|
2505
2505
|
intersectsSphere(e) {
|
|
2506
|
-
return
|
|
2506
|
+
return ol(e, this);
|
|
2507
2507
|
}
|
|
2508
2508
|
update() {
|
|
2509
2509
|
const e = this.a, t = this.b, n = this.c, s = this.points, r = this.satAxes, o = this.satBounds, a = r[0], c = o[0];
|
|
@@ -2622,7 +2622,7 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2622
2622
|
let Ve = 0, Ae = Math.abs(Ue.x);
|
|
2623
2623
|
const ge = Math.abs(Ue.y);
|
|
2624
2624
|
ge > Ae && (Ae = ge, Ve = 1), Math.abs(Ue.z) > Ae && (Ve = 2);
|
|
2625
|
-
const Ze =
|
|
2625
|
+
const Ze = al[Ve], Ft = this.a[Ze], me = this.b[Ze], ft = this.c[Ze], pt = _.a[Ze], An = _.b[Ze], rn = _.c[Ze];
|
|
2626
2626
|
if (y(this, Ft, me, ft, H, G, C, N, D, u, a))
|
|
2627
2627
|
return f(this, _, A, P);
|
|
2628
2628
|
if (y(_, pt, An, rn, dt, Re, $, ie, Ne, h, c))
|
|
@@ -2799,13 +2799,13 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
2799
2799
|
return Math.sqrt(y);
|
|
2800
2800
|
};
|
|
2801
2801
|
})();
|
|
2802
|
-
class
|
|
2802
|
+
class cl extends or {
|
|
2803
2803
|
constructor() {
|
|
2804
2804
|
super(() => new Tt());
|
|
2805
2805
|
}
|
|
2806
2806
|
}
|
|
2807
|
-
const lt = /* @__PURE__ */ new
|
|
2808
|
-
function
|
|
2807
|
+
const lt = /* @__PURE__ */ new cl(), Pn = /* @__PURE__ */ new q(), li = /* @__PURE__ */ new q();
|
|
2808
|
+
function ll(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
2809
2809
|
const r = n * n, o = s * s;
|
|
2810
2810
|
let a = 1 / 0, c = null;
|
|
2811
2811
|
if (i.shapecast(
|
|
@@ -2822,8 +2822,8 @@ function cl(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
|
2822
2822
|
const d = Math.sqrt(a);
|
|
2823
2823
|
return t.point ? t.point.copy(li) : t.point = li.clone(), t.distance = d, t.faceIndex = c, t;
|
|
2824
2824
|
}
|
|
2825
|
-
const ws = parseInt(To) >= 169,
|
|
2826
|
-
function
|
|
2825
|
+
const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new q(), $t = /* @__PURE__ */ new q(), Qt = /* @__PURE__ */ new q(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new q(), Ur = /* @__PURE__ */ new q(), Hr = /* @__PURE__ */ new q(), Ln = /* @__PURE__ */ new q();
|
|
2826
|
+
function ul(i, e, t, n, s, r, o, a) {
|
|
2827
2827
|
let c;
|
|
2828
2828
|
if (r === wo ? c = i.intersectTriangle(n, t, e, !0, s) : c = i.intersectTriangle(e, t, n, r !== Eo, s), c === null) return null;
|
|
2829
2829
|
const d = i.origin.distanceTo(s);
|
|
@@ -2834,7 +2834,7 @@ function hl(i, e, t, n, s, r, o, a) {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
function jr(i, e, t, n, s, r, o, a, c, d, u) {
|
|
2836
2836
|
qt.fromBufferAttribute(e, r), $t.fromBufferAttribute(e, o), Qt.fromBufferAttribute(e, a);
|
|
2837
|
-
const h =
|
|
2837
|
+
const h = ul(i, qt, $t, Qt, Ln, c, d, u);
|
|
2838
2838
|
if (h) {
|
|
2839
2839
|
if (n) {
|
|
2840
2840
|
Es.fromBufferAttribute(n, r), Ts.fromBufferAttribute(n, o), _s.fromBufferAttribute(n, a), h.uv = new pe();
|
|
@@ -2844,7 +2844,7 @@ function jr(i, e, t, n, s, r, o, a, c, d, u) {
|
|
|
2844
2844
|
if (s) {
|
|
2845
2845
|
Es.fromBufferAttribute(s, r), Ts.fromBufferAttribute(s, o), _s.fromBufferAttribute(s, a), h.uv1 = new pe();
|
|
2846
2846
|
const p = En.getInterpolation(Ln, qt, $t, Qt, Es, Ts, _s, h.uv1);
|
|
2847
|
-
ws || (h.uv1 = p),
|
|
2847
|
+
ws || (h.uv1 = p), hl && (h.uv2 = h.uv1);
|
|
2848
2848
|
}
|
|
2849
2849
|
if (t) {
|
|
2850
2850
|
Br.fromBufferAttribute(t, r), Ur.fromBufferAttribute(t, o), Hr.fromBufferAttribute(t, a), h.normal = new q();
|
|
@@ -2902,12 +2902,12 @@ function Ie(i, e, t, n) {
|
|
|
2902
2902
|
let a = e, c = e + 1, d = e + 2;
|
|
2903
2903
|
t && (a = t.getX(a), c = t.getX(c), d = t.getX(d)), s.x = n.getX(a), s.y = n.getY(a), s.z = n.getZ(a), r.x = n.getX(c), r.y = n.getY(c), r.z = n.getZ(c), o.x = n.getX(d), o.y = n.getY(d), o.z = n.getZ(d);
|
|
2904
2904
|
}
|
|
2905
|
-
function
|
|
2905
|
+
function dl(i, e, t, n, s, r, o, a) {
|
|
2906
2906
|
const { geometry: c, _indirectBuffer: d } = i;
|
|
2907
2907
|
for (let u = n, h = n + s; u < h; u++)
|
|
2908
2908
|
qs(c, e, t, u, r, o, a);
|
|
2909
2909
|
}
|
|
2910
|
-
function
|
|
2910
|
+
function fl(i, e, t, n, s, r, o) {
|
|
2911
2911
|
const { geometry: a, _indirectBuffer: c } = i;
|
|
2912
2912
|
let d = 1 / 0, u = null;
|
|
2913
2913
|
for (let h = n, f = n + s; h < f; h++) {
|
|
@@ -2916,7 +2916,7 @@ function dl(i, e, t, n, s, r, o) {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
return u;
|
|
2918
2918
|
}
|
|
2919
|
-
function
|
|
2919
|
+
function pl(i, e, t, n, s, r, o) {
|
|
2920
2920
|
const { geometry: a } = t, { index: c } = a, d = a.attributes.position;
|
|
2921
2921
|
for (let u = i, h = e + i; u < h; u++) {
|
|
2922
2922
|
let f;
|
|
@@ -2925,7 +2925,7 @@ function fl(i, e, t, n, s, r, o) {
|
|
|
2925
2925
|
}
|
|
2926
2926
|
return !1;
|
|
2927
2927
|
}
|
|
2928
|
-
function
|
|
2928
|
+
function ml(i, e = null) {
|
|
2929
2929
|
e && Array.isArray(e) && (e = new Set(e));
|
|
2930
2930
|
const t = i.geometry, n = t.index ? t.index.array : null, s = t.attributes.position;
|
|
2931
2931
|
let r, o, a, c, d = 0;
|
|
@@ -2974,14 +2974,14 @@ function Kt(i, e, t, n, s) {
|
|
|
2974
2974
|
let x = e[i], E = e[i + 3], b = e[i + 1], _ = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
|
|
2975
2975
|
return h >= 0 ? (r = (x - y) * h, o = (E - y) * h) : (r = (E - y) * h, o = (x - y) * h), f >= 0 ? (a = (b - S) * f, c = (_ - S) * f) : (a = (_ - S) * f, c = (b - S) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (d = (A - w) * p, u = (P - w) * p) : (d = (P - w) * p, u = (A - w) * p), r > u || d > o) ? !1 : ((d > r || r !== r) && (r = d), (u < o || o !== o) && (o = u), r <= s && o >= n);
|
|
2976
2976
|
}
|
|
2977
|
-
function
|
|
2977
|
+
function gl(i, e, t, n, s, r, o, a) {
|
|
2978
2978
|
const { geometry: c, _indirectBuffer: d } = i;
|
|
2979
2979
|
for (let u = n, h = n + s; u < h; u++) {
|
|
2980
2980
|
let f = d ? d[u] : u;
|
|
2981
2981
|
qs(c, e, t, f, r, o, a);
|
|
2982
2982
|
}
|
|
2983
2983
|
}
|
|
2984
|
-
function
|
|
2984
|
+
function yl(i, e, t, n, s, r, o) {
|
|
2985
2985
|
const { geometry: a, _indirectBuffer: c } = i;
|
|
2986
2986
|
let d = 1 / 0, u = null;
|
|
2987
2987
|
for (let h = n, f = n + s; h < f; h++) {
|
|
@@ -2990,7 +2990,7 @@ function gl(i, e, t, n, s, r, o) {
|
|
|
2990
2990
|
}
|
|
2991
2991
|
return u;
|
|
2992
2992
|
}
|
|
2993
|
-
function
|
|
2993
|
+
function wl(i, e, t, n, s, r, o) {
|
|
2994
2994
|
const { geometry: a } = t, { index: c } = a, d = a.attributes.position;
|
|
2995
2995
|
for (let u = i, h = e + i; u < h; u++) {
|
|
2996
2996
|
let f;
|
|
@@ -2999,14 +2999,14 @@ function yl(i, e, t, n, s, r, o) {
|
|
|
2999
2999
|
}
|
|
3000
3000
|
return !1;
|
|
3001
3001
|
}
|
|
3002
|
-
function
|
|
3002
|
+
function El(i, e, t, n, s, r, o) {
|
|
3003
3003
|
be.setBuffer(i._roots[e]), Oi(0, i, t, n, s, r, o), be.clearBuffer();
|
|
3004
3004
|
}
|
|
3005
3005
|
function Oi(i, e, t, n, s, r, o) {
|
|
3006
3006
|
const { float32Array: a, uint16Array: c, uint32Array: d } = be, u = i * 2;
|
|
3007
3007
|
if (De(u, c)) {
|
|
3008
3008
|
const f = $e(i, d), p = Qe(u, c);
|
|
3009
|
-
|
|
3009
|
+
dl(e, t, n, f, p, s, r, o);
|
|
3010
3010
|
} else {
|
|
3011
3011
|
const f = Fe(i);
|
|
3012
3012
|
Kt(f, a, n, r, o) && Oi(f, e, t, n, s, r, o);
|
|
@@ -3014,8 +3014,8 @@ function Oi(i, e, t, n, s, r, o) {
|
|
|
3014
3014
|
Kt(p, a, n, r, o) && Oi(p, e, t, n, s, r, o);
|
|
3015
3015
|
}
|
|
3016
3016
|
}
|
|
3017
|
-
const
|
|
3018
|
-
function
|
|
3017
|
+
const Tl = ["x", "y", "z"];
|
|
3018
|
+
function _l(i, e, t, n, s, r) {
|
|
3019
3019
|
be.setBuffer(i._roots[e]);
|
|
3020
3020
|
const o = Di(0, i, t, n, s, r);
|
|
3021
3021
|
return be.clearBuffer(), o;
|
|
@@ -3025,9 +3025,9 @@ function Di(i, e, t, n, s, r) {
|
|
|
3025
3025
|
let d = i * 2;
|
|
3026
3026
|
if (De(d, a)) {
|
|
3027
3027
|
const h = $e(i, c), f = Qe(d, a);
|
|
3028
|
-
return
|
|
3028
|
+
return fl(e, t, n, h, f, s, r);
|
|
3029
3029
|
} else {
|
|
3030
|
-
const h = rr(i, c), f =
|
|
3030
|
+
const h = rr(i, c), f = Tl[h], y = n.direction[f] >= 0;
|
|
3031
3031
|
let S, w;
|
|
3032
3032
|
y ? (S = Fe(i), w = ze(i, c)) : (S = ze(i, c), w = Fe(i));
|
|
3033
3033
|
const E = Kt(S, o, n, s, r) ? Di(S, e, t, n, s, r) : null;
|
|
@@ -3044,7 +3044,7 @@ function Di(i, e, t, n, s, r) {
|
|
|
3044
3044
|
}
|
|
3045
3045
|
}
|
|
3046
3046
|
const Ss = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(), On = /* @__PURE__ */ new ut(), Vr = /* @__PURE__ */ new Je(), bs = /* @__PURE__ */ new Je();
|
|
3047
|
-
function
|
|
3047
|
+
function Sl(i, e, t, n) {
|
|
3048
3048
|
be.setBuffer(i._roots[e]);
|
|
3049
3049
|
const s = Ni(0, i, t, n);
|
|
3050
3050
|
return be.clearBuffer(), s;
|
|
@@ -3079,12 +3079,12 @@ function Ni(i, e, t, n, s = null) {
|
|
|
3079
3079
|
return xe(u, r, Ss), !!(s.intersectsBox(Ss) && Ni(u, e, t, n, s) || (xe(h, r, Ss), s.intersectsBox(Ss) && Ni(h, e, t, n, s)));
|
|
3080
3080
|
}
|
|
3081
3081
|
}
|
|
3082
|
-
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Dn = /* @__PURE__ */ new Je(),
|
|
3083
|
-
function
|
|
3082
|
+
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Dn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new q(), xl = /* @__PURE__ */ new q(), Al = /* @__PURE__ */ new q(), vl = /* @__PURE__ */ new q();
|
|
3083
|
+
function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3084
3084
|
e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
|
|
3085
3085
|
const a = i.geometry, c = a.attributes.position, d = a.index, u = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
|
|
3086
|
-
let y =
|
|
3087
|
-
s && (w =
|
|
3086
|
+
let y = bl, S = xl, w = null, x = null;
|
|
3087
|
+
s && (w = Al, x = vl);
|
|
3088
3088
|
let E = 1 / 0, b = null, _ = null;
|
|
3089
3089
|
return xs.copy(t).invert(), Dn.matrix.copy(xs), i.shapecast(
|
|
3090
3090
|
{
|
|
@@ -3123,7 +3123,7 @@ function vl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3123
3123
|
}
|
|
3124
3124
|
), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(xs), S.applyMatrix4(xs), s.distance = S.sub(s.point).length(), s.faceIndex = _), n);
|
|
3125
3125
|
}
|
|
3126
|
-
function
|
|
3126
|
+
function Ml(i, e = null) {
|
|
3127
3127
|
e && Array.isArray(e) && (e = new Set(e));
|
|
3128
3128
|
const t = i.geometry, n = t.index ? t.index.array : null, s = t.attributes.position;
|
|
3129
3129
|
let r, o, a, c, d = 0;
|
|
@@ -3170,14 +3170,14 @@ function Rl(i, e = null) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
3173
|
-
function
|
|
3173
|
+
function Il(i, e, t, n, s, r, o) {
|
|
3174
3174
|
be.setBuffer(i._roots[e]), ki(0, i, t, n, s, r, o), be.clearBuffer();
|
|
3175
3175
|
}
|
|
3176
3176
|
function ki(i, e, t, n, s, r, o) {
|
|
3177
3177
|
const { float32Array: a, uint16Array: c, uint32Array: d } = be, u = i * 2;
|
|
3178
3178
|
if (De(u, c)) {
|
|
3179
3179
|
const f = $e(i, d), p = Qe(u, c);
|
|
3180
|
-
|
|
3180
|
+
gl(e, t, n, f, p, s, r, o);
|
|
3181
3181
|
} else {
|
|
3182
3182
|
const f = Fe(i);
|
|
3183
3183
|
Kt(f, a, n, r, o) && ki(f, e, t, n, s, r, o);
|
|
@@ -3185,8 +3185,8 @@ function ki(i, e, t, n, s, r, o) {
|
|
|
3185
3185
|
Kt(p, a, n, r, o) && ki(p, e, t, n, s, r, o);
|
|
3186
3186
|
}
|
|
3187
3187
|
}
|
|
3188
|
-
const
|
|
3189
|
-
function
|
|
3188
|
+
const Cl = ["x", "y", "z"];
|
|
3189
|
+
function Pl(i, e, t, n, s, r) {
|
|
3190
3190
|
be.setBuffer(i._roots[e]);
|
|
3191
3191
|
const o = Fi(0, i, t, n, s, r);
|
|
3192
3192
|
return be.clearBuffer(), o;
|
|
@@ -3196,9 +3196,9 @@ function Fi(i, e, t, n, s, r) {
|
|
|
3196
3196
|
let d = i * 2;
|
|
3197
3197
|
if (De(d, a)) {
|
|
3198
3198
|
const h = $e(i, c), f = Qe(d, a);
|
|
3199
|
-
return
|
|
3199
|
+
return yl(e, t, n, h, f, s, r);
|
|
3200
3200
|
} else {
|
|
3201
|
-
const h = rr(i, c), f =
|
|
3201
|
+
const h = rr(i, c), f = Cl[h], y = n.direction[f] >= 0;
|
|
3202
3202
|
let S, w;
|
|
3203
3203
|
y ? (S = Fe(i), w = ze(i, c)) : (S = ze(i, c), w = Fe(i));
|
|
3204
3204
|
const E = Kt(S, o, n, s, r) ? Fi(S, e, t, n, s, r) : null;
|
|
@@ -3215,7 +3215,7 @@ function Fi(i, e, t, n, s, r) {
|
|
|
3215
3215
|
}
|
|
3216
3216
|
}
|
|
3217
3217
|
const As = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), Nn = /* @__PURE__ */ new ut(), Zr = /* @__PURE__ */ new Je(), vs = /* @__PURE__ */ new Je();
|
|
3218
|
-
function
|
|
3218
|
+
function Ll(i, e, t, n) {
|
|
3219
3219
|
be.setBuffer(i._roots[e]);
|
|
3220
3220
|
const s = zi(0, i, t, n);
|
|
3221
3221
|
return be.clearBuffer(), s;
|
|
@@ -3251,12 +3251,12 @@ function zi(i, e, t, n, s = null) {
|
|
|
3251
3251
|
return xe(u, r, As), !!(s.intersectsBox(As) && zi(u, e, t, n, s) || (xe(h, r, As), s.intersectsBox(As) && zi(h, e, t, n, s)));
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
3254
|
-
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(),
|
|
3255
|
-
function
|
|
3254
|
+
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new q(), Dl = /* @__PURE__ */ new q(), Nl = /* @__PURE__ */ new q(), kl = /* @__PURE__ */ new q();
|
|
3255
|
+
function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3256
3256
|
e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
|
|
3257
3257
|
const a = i.geometry, c = a.attributes.position, d = a.index, u = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
|
|
3258
|
-
let y =
|
|
3259
|
-
s && (w =
|
|
3258
|
+
let y = Ol, S = Dl, w = null, x = null;
|
|
3259
|
+
s && (w = Nl, x = kl);
|
|
3260
3260
|
let E = 1 / 0, b = null, _ = null;
|
|
3261
3261
|
return Rs.copy(t).invert(), kn.matrix.copy(Rs), i.shapecast(
|
|
3262
3262
|
{
|
|
@@ -3303,7 +3303,7 @@ function Wr(i, e, t) {
|
|
|
3303
3303
|
return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
|
|
3304
3304
|
}
|
|
3305
3305
|
const Ms = /* @__PURE__ */ new Je(), Is = /* @__PURE__ */ new Yi(), Kr = /* @__PURE__ */ new q(), Xr = /* @__PURE__ */ new ut(), Yr = /* @__PURE__ */ new q(), di = ["getX", "getY", "getZ"];
|
|
3306
|
-
class Zs extends
|
|
3306
|
+
class Zs extends il {
|
|
3307
3307
|
/**
|
|
3308
3308
|
* Generates a representation of the complete bounds tree and the geometry index buffer which
|
|
3309
3309
|
* can be used to recreate a bounds tree using the `deserialize` function. The `serialize` and
|
|
@@ -3487,7 +3487,7 @@ class Zs extends sl {
|
|
|
3487
3487
|
* @param {Set<number>|Array<number>|null} [nodeIndices=null]
|
|
3488
3488
|
*/
|
|
3489
3489
|
refit(e = null) {
|
|
3490
|
-
return (this.indirect ?
|
|
3490
|
+
return (this.indirect ? Ml : ml)(this, e);
|
|
3491
3491
|
}
|
|
3492
3492
|
/* Core Cast Functions */
|
|
3493
3493
|
/**
|
|
@@ -3510,7 +3510,7 @@ class Zs extends sl {
|
|
|
3510
3510
|
* @returns {Array<Intersection>}
|
|
3511
3511
|
*/
|
|
3512
3512
|
raycast(e, t = Ai, n = 0, s = 1 / 0) {
|
|
3513
|
-
const r = this._roots, o = [], a = this.indirect ?
|
|
3513
|
+
const r = this._roots, o = [], a = this.indirect ? Il : El;
|
|
3514
3514
|
for (let c = 0, d = r.length; c < d; c++)
|
|
3515
3515
|
a(this, c, t, e, o, n, s);
|
|
3516
3516
|
return o;
|
|
@@ -3529,7 +3529,7 @@ class Zs extends sl {
|
|
|
3529
3529
|
raycastFirst(e, t = Ai, n = 0, s = 1 / 0) {
|
|
3530
3530
|
const r = this._roots;
|
|
3531
3531
|
let o = null;
|
|
3532
|
-
const a = this.indirect ?
|
|
3532
|
+
const a = this.indirect ? Pl : _l;
|
|
3533
3533
|
for (let c = 0, d = r.length; c < d; c++) {
|
|
3534
3534
|
const u = a(this, c, t, e, n, s);
|
|
3535
3535
|
u != null && (o == null || u.distance < o.distance) && (o = u);
|
|
@@ -3550,7 +3550,7 @@ class Zs extends sl {
|
|
|
3550
3550
|
*/
|
|
3551
3551
|
intersectsGeometry(e, t) {
|
|
3552
3552
|
let n = !1;
|
|
3553
|
-
const s = this._roots, r = this.indirect ?
|
|
3553
|
+
const s = this._roots, r = this.indirect ? Ll : Sl;
|
|
3554
3554
|
for (let o = 0, a = s.length; o < a && (n = r(this, o, e, t), !n); o++)
|
|
3555
3555
|
;
|
|
3556
3556
|
return n;
|
|
@@ -3576,7 +3576,7 @@ class Zs extends sl {
|
|
|
3576
3576
|
scratchPrimitive: t,
|
|
3577
3577
|
// TODO: is the performance significant enough for the added complexity here?
|
|
3578
3578
|
// can we just use one function?
|
|
3579
|
-
iterate: this.indirect ?
|
|
3579
|
+
iterate: this.indirect ? wl : pl
|
|
3580
3580
|
}
|
|
3581
3581
|
);
|
|
3582
3582
|
return lt.releasePrimitive(t), n;
|
|
@@ -3697,7 +3697,7 @@ class Zs extends sl {
|
|
|
3697
3697
|
* @returns {HitPointInfo|null}
|
|
3698
3698
|
*/
|
|
3699
3699
|
closestPointToGeometry(e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3700
|
-
return (this.indirect ?
|
|
3700
|
+
return (this.indirect ? Fl : Rl)(
|
|
3701
3701
|
this,
|
|
3702
3702
|
e,
|
|
3703
3703
|
t,
|
|
@@ -3727,7 +3727,7 @@ class Zs extends sl {
|
|
|
3727
3727
|
* @returns {HitPointInfo|null}
|
|
3728
3728
|
*/
|
|
3729
3729
|
closestPointToPoint(e, t = {}, n = 0, s = 1 / 0) {
|
|
3730
|
-
return
|
|
3730
|
+
return ll(
|
|
3731
3731
|
this,
|
|
3732
3732
|
e,
|
|
3733
3733
|
t,
|
|
@@ -3742,11 +3742,11 @@ const Tn = {
|
|
|
3742
3742
|
LineSegments: qi.prototype.raycast,
|
|
3743
3743
|
LineLoop: $i.prototype.raycast,
|
|
3744
3744
|
Points: Ji.prototype.raycast,
|
|
3745
|
-
BatchedMesh:
|
|
3745
|
+
BatchedMesh: Ya.prototype.raycast
|
|
3746
3746
|
}, He = /* @__PURE__ */ new wt(), Cs = [];
|
|
3747
|
-
function
|
|
3747
|
+
function zl(i, e) {
|
|
3748
3748
|
if (this.isBatchedMesh)
|
|
3749
|
-
|
|
3749
|
+
Bl.call(this, i, e);
|
|
3750
3750
|
else {
|
|
3751
3751
|
const { geometry: t } = this;
|
|
3752
3752
|
if (t.boundsTree)
|
|
@@ -3769,7 +3769,7 @@ function Fl(i, e) {
|
|
|
3769
3769
|
}
|
|
3770
3770
|
}
|
|
3771
3771
|
}
|
|
3772
|
-
function
|
|
3772
|
+
function Bl(i, e) {
|
|
3773
3773
|
if (this.boundsTrees) {
|
|
3774
3774
|
const t = this.boundsTrees, n = this._drawInfo || this._instanceInfo, s = this._drawRanges || this._geometryInfo, r = this.matrixWorld;
|
|
3775
3775
|
He.material = this.material, He.geometry = this.geometry;
|
|
@@ -3802,10 +3802,10 @@ function Bo(i) {
|
|
|
3802
3802
|
if (!t.isMesh || t.isSkinnedMesh || t.isInstancedMesh || t.isBatchedMesh)
|
|
3803
3803
|
return;
|
|
3804
3804
|
const n = t.geometry;
|
|
3805
|
-
!((s = n == null ? void 0 : n.attributes) != null && s.position) || (o = (r = n.morphAttributes) == null ? void 0 : r.position) != null && o.length || (n.boundsTree || (n.boundsTree = new Zs(n)), t.raycast =
|
|
3805
|
+
!((s = n == null ? void 0 : n.attributes) != null && s.position) || (o = (r = n.morphAttributes) == null ? void 0 : r.position) != null && o.length || (n.boundsTree || (n.boundsTree = new Zs(n)), t.raycast = zl);
|
|
3806
3806
|
});
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function Ul(i) {
|
|
3809
3809
|
i.boundsTree && (i.boundsTree = void 0);
|
|
3810
3810
|
}
|
|
3811
3811
|
function qr(i) {
|
|
@@ -3824,14 +3824,14 @@ function $s(i) {
|
|
|
3824
3824
|
i.traverse((e) => {
|
|
3825
3825
|
var r;
|
|
3826
3826
|
const t = e;
|
|
3827
|
-
t.geometry && typeof t.geometry.dispose == "function" && (
|
|
3827
|
+
t.geometry && typeof t.geometry.dispose == "function" && (Ul(t.geometry), t.geometry.dispose());
|
|
3828
3828
|
const n = t.material;
|
|
3829
3829
|
Array.isArray(n) ? n.forEach(qr) : n && qr(n);
|
|
3830
3830
|
const s = e;
|
|
3831
3831
|
s.isLight && ((r = s.shadow) != null && r.dispose) && s.shadow.dispose();
|
|
3832
3832
|
});
|
|
3833
3833
|
}
|
|
3834
|
-
function
|
|
3834
|
+
function Hl(i, e) {
|
|
3835
3835
|
if (!(e != null && e.keepBackgrounds)) {
|
|
3836
3836
|
i.background instanceof T.Texture && (i.background.dispose(), i.background = null), i.environment instanceof T.Texture && (i.environment.dispose(), i.environment = null);
|
|
3837
3837
|
const t = i;
|
|
@@ -3993,7 +3993,7 @@ class Lt {
|
|
|
3993
3993
|
this.scene.remove(this.scene.children[0]);
|
|
3994
3994
|
}
|
|
3995
3995
|
disposeContents(e) {
|
|
3996
|
-
|
|
3996
|
+
Hl(this.scene, e);
|
|
3997
3997
|
}
|
|
3998
3998
|
traverse(e) {
|
|
3999
3999
|
this.scene.traverse((t) => {
|
|
@@ -4172,7 +4172,7 @@ class lr extends Uo {
|
|
|
4172
4172
|
);
|
|
4173
4173
|
}
|
|
4174
4174
|
}
|
|
4175
|
-
class
|
|
4175
|
+
class jl {
|
|
4176
4176
|
constructor(e) {
|
|
4177
4177
|
this.renderer = null, this._id = Do(), this.canvas = e;
|
|
4178
4178
|
}
|
|
@@ -4324,7 +4324,7 @@ class Hl {
|
|
|
4324
4324
|
}
|
|
4325
4325
|
}
|
|
4326
4326
|
function Qr(i, e) {
|
|
4327
|
-
if (e ===
|
|
4327
|
+
if (e === qa)
|
|
4328
4328
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), i;
|
|
4329
4329
|
if (e === vi || e === So) {
|
|
4330
4330
|
let t = i.getIndex();
|
|
@@ -4350,7 +4350,7 @@ function Qr(i, e) {
|
|
|
4350
4350
|
} else
|
|
4351
4351
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), i;
|
|
4352
4352
|
}
|
|
4353
|
-
function
|
|
4353
|
+
function Gl(i) {
|
|
4354
4354
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = i.clone();
|
|
4355
4355
|
return Ho(i, n, function(s, r) {
|
|
4356
4356
|
e.set(r, s), t.set(s, r);
|
|
@@ -4367,7 +4367,7 @@ function Ho(i, e, t) {
|
|
|
4367
4367
|
for (let n = 0; n < i.children.length; n++)
|
|
4368
4368
|
Ho(i.children[n], e.children[n], t);
|
|
4369
4369
|
}
|
|
4370
|
-
class
|
|
4370
|
+
class Vl extends $a {
|
|
4371
4371
|
/**
|
|
4372
4372
|
* Constructs a new glTF loader.
|
|
4373
4373
|
*
|
|
@@ -4375,41 +4375,41 @@ class Gl extends qa {
|
|
|
4375
4375
|
*/
|
|
4376
4376
|
constructor(e) {
|
|
4377
4377
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
4378
|
-
return new Xl(t);
|
|
4379
|
-
}), this.register(function(t) {
|
|
4380
4378
|
return new Yl(t);
|
|
4381
4379
|
}), this.register(function(t) {
|
|
4382
|
-
return new
|
|
4380
|
+
return new ql(t);
|
|
4383
4381
|
}), this.register(function(t) {
|
|
4384
4382
|
return new rh(t);
|
|
4385
4383
|
}), this.register(function(t) {
|
|
4386
4384
|
return new oh(t);
|
|
4387
4385
|
}), this.register(function(t) {
|
|
4388
|
-
return new
|
|
4386
|
+
return new ah(t);
|
|
4389
4387
|
}), this.register(function(t) {
|
|
4390
4388
|
return new Ql(t);
|
|
4391
4389
|
}), this.register(function(t) {
|
|
4392
4390
|
return new Jl(t);
|
|
4393
4391
|
}), this.register(function(t) {
|
|
4394
4392
|
return new eh(t);
|
|
4395
|
-
}), this.register(function(t) {
|
|
4396
|
-
return new Kl(t);
|
|
4397
4393
|
}), this.register(function(t) {
|
|
4398
4394
|
return new th(t);
|
|
4399
4395
|
}), this.register(function(t) {
|
|
4400
|
-
return new
|
|
4401
|
-
}), this.register(function(t) {
|
|
4402
|
-
return new sh(t);
|
|
4396
|
+
return new Xl(t);
|
|
4403
4397
|
}), this.register(function(t) {
|
|
4404
4398
|
return new nh(t);
|
|
4405
4399
|
}), this.register(function(t) {
|
|
4406
|
-
return new
|
|
4400
|
+
return new $l(t);
|
|
4401
|
+
}), this.register(function(t) {
|
|
4402
|
+
return new ih(t);
|
|
4403
|
+
}), this.register(function(t) {
|
|
4404
|
+
return new sh(t);
|
|
4405
|
+
}), this.register(function(t) {
|
|
4406
|
+
return new Wl(t);
|
|
4407
4407
|
}), this.register(function(t) {
|
|
4408
4408
|
return new Jr(t, ce.EXT_MESHOPT_COMPRESSION);
|
|
4409
4409
|
}), this.register(function(t) {
|
|
4410
4410
|
return new Jr(t, ce.KHR_MESHOPT_COMPRESSION);
|
|
4411
4411
|
}), this.register(function(t) {
|
|
4412
|
-
return new
|
|
4412
|
+
return new ch(t);
|
|
4413
4413
|
});
|
|
4414
4414
|
}
|
|
4415
4415
|
/**
|
|
@@ -4511,7 +4511,7 @@ class Gl extends qa {
|
|
|
4511
4511
|
else if (e instanceof ArrayBuffer)
|
|
4512
4512
|
if (c.decode(new Uint8Array(e, 0, 4)) === jo) {
|
|
4513
4513
|
try {
|
|
4514
|
-
o[ce.KHR_BINARY_GLTF] = new
|
|
4514
|
+
o[ce.KHR_BINARY_GLTF] = new lh(e);
|
|
4515
4515
|
} catch (h) {
|
|
4516
4516
|
s && s(h);
|
|
4517
4517
|
return;
|
|
@@ -4525,7 +4525,7 @@ class Gl extends qa {
|
|
|
4525
4525
|
s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
4526
4526
|
return;
|
|
4527
4527
|
}
|
|
4528
|
-
const d = new
|
|
4528
|
+
const d = new Sh(r, {
|
|
4529
4529
|
path: t || this.resourcePath || "",
|
|
4530
4530
|
crossOrigin: this.crossOrigin,
|
|
4531
4531
|
requestHeader: this.requestHeader,
|
|
@@ -4543,16 +4543,16 @@ class Gl extends qa {
|
|
|
4543
4543
|
const h = r.extensionsUsed[u], f = r.extensionsRequired || [];
|
|
4544
4544
|
switch (h) {
|
|
4545
4545
|
case ce.KHR_MATERIALS_UNLIT:
|
|
4546
|
-
o[h] = new
|
|
4546
|
+
o[h] = new Kl();
|
|
4547
4547
|
break;
|
|
4548
4548
|
case ce.KHR_DRACO_MESH_COMPRESSION:
|
|
4549
|
-
o[h] = new
|
|
4549
|
+
o[h] = new hh(r, this.dracoLoader);
|
|
4550
4550
|
break;
|
|
4551
4551
|
case ce.KHR_TEXTURE_TRANSFORM:
|
|
4552
|
-
o[h] = new
|
|
4552
|
+
o[h] = new uh();
|
|
4553
4553
|
break;
|
|
4554
4554
|
case ce.KHR_MESH_QUANTIZATION:
|
|
4555
|
-
o[h] = new
|
|
4555
|
+
o[h] = new dh();
|
|
4556
4556
|
break;
|
|
4557
4557
|
default:
|
|
4558
4558
|
f.indexOf(h) >= 0 && a[h] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
|
|
@@ -4575,7 +4575,7 @@ class Gl extends qa {
|
|
|
4575
4575
|
});
|
|
4576
4576
|
}
|
|
4577
4577
|
}
|
|
4578
|
-
function
|
|
4578
|
+
function Zl() {
|
|
4579
4579
|
let i = {};
|
|
4580
4580
|
return {
|
|
4581
4581
|
get: function(e) {
|
|
@@ -4621,7 +4621,7 @@ const ce = {
|
|
|
4621
4621
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
4622
4622
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
4623
4623
|
};
|
|
4624
|
-
class
|
|
4624
|
+
class Wl {
|
|
4625
4625
|
constructor(e) {
|
|
4626
4626
|
this.parser = e, this.name = ce.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
4627
4627
|
}
|
|
@@ -4643,13 +4643,13 @@ class Zl {
|
|
|
4643
4643
|
const h = c.range !== void 0 ? c.range : 0;
|
|
4644
4644
|
switch (c.type) {
|
|
4645
4645
|
case "directional":
|
|
4646
|
-
d = new
|
|
4646
|
+
d = new Ja(u), d.target.position.set(0, 0, -1), d.add(d.target);
|
|
4647
4647
|
break;
|
|
4648
4648
|
case "point":
|
|
4649
4649
|
d = new xo(u), d.distance = h;
|
|
4650
4650
|
break;
|
|
4651
4651
|
case "spot":
|
|
4652
|
-
d = new
|
|
4652
|
+
d = new Qa(u), d.distance = h, c.spot = c.spot || {}, c.spot.innerConeAngle = c.spot.innerConeAngle !== void 0 ? c.spot.innerConeAngle : 0, c.spot.outerConeAngle = c.spot.outerConeAngle !== void 0 ? c.spot.outerConeAngle : Math.PI / 4, d.angle = c.spot.outerConeAngle, d.penumbra = 1 - c.spot.innerConeAngle / c.spot.outerConeAngle, d.target.position.set(0, 0, -1), d.add(d.target);
|
|
4653
4653
|
break;
|
|
4654
4654
|
default:
|
|
4655
4655
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + c.type);
|
|
@@ -4667,7 +4667,7 @@ class Zl {
|
|
|
4667
4667
|
});
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
4670
|
-
class
|
|
4670
|
+
class Kl {
|
|
4671
4671
|
constructor() {
|
|
4672
4672
|
this.name = ce.KHR_MATERIALS_UNLIT;
|
|
4673
4673
|
}
|
|
@@ -4688,7 +4688,7 @@ class Wl {
|
|
|
4688
4688
|
return Promise.all(s);
|
|
4689
4689
|
}
|
|
4690
4690
|
}
|
|
4691
|
-
class
|
|
4691
|
+
class Xl {
|
|
4692
4692
|
constructor(e) {
|
|
4693
4693
|
this.parser = e, this.name = ce.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
4694
4694
|
}
|
|
@@ -4697,7 +4697,7 @@ class Kl {
|
|
|
4697
4697
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
4698
4698
|
}
|
|
4699
4699
|
}
|
|
4700
|
-
class
|
|
4700
|
+
class Yl {
|
|
4701
4701
|
constructor(e) {
|
|
4702
4702
|
this.parser = e, this.name = ce.KHR_MATERIALS_CLEARCOAT;
|
|
4703
4703
|
}
|
|
@@ -4715,7 +4715,7 @@ class Xl {
|
|
|
4715
4715
|
return Promise.all(s);
|
|
4716
4716
|
}
|
|
4717
4717
|
}
|
|
4718
|
-
class
|
|
4718
|
+
class ql {
|
|
4719
4719
|
constructor(e) {
|
|
4720
4720
|
this.parser = e, this.name = ce.KHR_MATERIALS_DISPERSION;
|
|
4721
4721
|
}
|
|
@@ -4727,7 +4727,7 @@ class Yl {
|
|
|
4727
4727
|
return n === null || (t.dispersion = n.dispersion !== void 0 ? n.dispersion : 0), Promise.resolve();
|
|
4728
4728
|
}
|
|
4729
4729
|
}
|
|
4730
|
-
class
|
|
4730
|
+
class $l {
|
|
4731
4731
|
constructor(e) {
|
|
4732
4732
|
this.parser = e, this.name = ce.KHR_MATERIALS_IRIDESCENCE;
|
|
4733
4733
|
}
|
|
@@ -4741,7 +4741,7 @@ class ql {
|
|
|
4741
4741
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && s.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(s);
|
|
4742
4742
|
}
|
|
4743
4743
|
}
|
|
4744
|
-
class
|
|
4744
|
+
class Ql {
|
|
4745
4745
|
constructor(e) {
|
|
4746
4746
|
this.parser = e, this.name = ce.KHR_MATERIALS_SHEEN;
|
|
4747
4747
|
}
|
|
@@ -4759,7 +4759,7 @@ class $l {
|
|
|
4759
4759
|
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, Yn)), n.sheenRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(s);
|
|
4760
4760
|
}
|
|
4761
4761
|
}
|
|
4762
|
-
class
|
|
4762
|
+
class Jl {
|
|
4763
4763
|
constructor(e) {
|
|
4764
4764
|
this.parser = e, this.name = ce.KHR_MATERIALS_TRANSMISSION;
|
|
4765
4765
|
}
|
|
@@ -4773,7 +4773,7 @@ class Ql {
|
|
|
4773
4773
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && s.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(s);
|
|
4774
4774
|
}
|
|
4775
4775
|
}
|
|
4776
|
-
class
|
|
4776
|
+
class eh {
|
|
4777
4777
|
constructor(e) {
|
|
4778
4778
|
this.parser = e, this.name = ce.KHR_MATERIALS_VOLUME;
|
|
4779
4779
|
}
|
|
@@ -4789,7 +4789,7 @@ class Jl {
|
|
|
4789
4789
|
return t.attenuationColor = new tn().setRGB(r[0], r[1], r[2], je), Promise.all(s);
|
|
4790
4790
|
}
|
|
4791
4791
|
}
|
|
4792
|
-
class
|
|
4792
|
+
class th {
|
|
4793
4793
|
constructor(e) {
|
|
4794
4794
|
this.parser = e, this.name = ce.KHR_MATERIALS_IOR;
|
|
4795
4795
|
}
|
|
@@ -4801,7 +4801,7 @@ class eh {
|
|
|
4801
4801
|
return n === null || (t.ior = n.ior !== void 0 ? n.ior : 1.5, t.ior === 0 && (t.ior = 1e3)), Promise.resolve();
|
|
4802
4802
|
}
|
|
4803
4803
|
}
|
|
4804
|
-
class
|
|
4804
|
+
class nh {
|
|
4805
4805
|
constructor(e) {
|
|
4806
4806
|
this.parser = e, this.name = ce.KHR_MATERIALS_SPECULAR;
|
|
4807
4807
|
}
|
|
@@ -4817,7 +4817,7 @@ class th {
|
|
|
4817
4817
|
return t.specularColor = new tn().setRGB(r[0], r[1], r[2], je), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, Yn)), Promise.all(s);
|
|
4818
4818
|
}
|
|
4819
4819
|
}
|
|
4820
|
-
class
|
|
4820
|
+
class sh {
|
|
4821
4821
|
constructor(e) {
|
|
4822
4822
|
this.parser = e, this.name = ce.EXT_MATERIALS_BUMP;
|
|
4823
4823
|
}
|
|
@@ -4831,7 +4831,7 @@ class nh {
|
|
|
4831
4831
|
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && s.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(s);
|
|
4832
4832
|
}
|
|
4833
4833
|
}
|
|
4834
|
-
class
|
|
4834
|
+
class ih {
|
|
4835
4835
|
constructor(e) {
|
|
4836
4836
|
this.parser = e, this.name = ce.KHR_MATERIALS_ANISOTROPY;
|
|
4837
4837
|
}
|
|
@@ -4845,7 +4845,7 @@ class sh {
|
|
|
4845
4845
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && s.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(s);
|
|
4846
4846
|
}
|
|
4847
4847
|
}
|
|
4848
|
-
class
|
|
4848
|
+
class rh {
|
|
4849
4849
|
constructor(e) {
|
|
4850
4850
|
this.parser = e, this.name = ce.KHR_TEXTURE_BASISU;
|
|
4851
4851
|
}
|
|
@@ -4862,7 +4862,7 @@ class ih {
|
|
|
4862
4862
|
return t.loadTextureImage(e, r.source, o);
|
|
4863
4863
|
}
|
|
4864
4864
|
}
|
|
4865
|
-
class
|
|
4865
|
+
class oh {
|
|
4866
4866
|
constructor(e) {
|
|
4867
4867
|
this.parser = e, this.name = ce.EXT_TEXTURE_WEBP;
|
|
4868
4868
|
}
|
|
@@ -4879,7 +4879,7 @@ class rh {
|
|
|
4879
4879
|
return n.loadTextureImage(e, o.source, c);
|
|
4880
4880
|
}
|
|
4881
4881
|
}
|
|
4882
|
-
class
|
|
4882
|
+
class ah {
|
|
4883
4883
|
constructor(e) {
|
|
4884
4884
|
this.parser = e, this.name = ce.EXT_TEXTURE_AVIF;
|
|
4885
4885
|
}
|
|
@@ -4922,7 +4922,7 @@ class Jr {
|
|
|
4922
4922
|
return null;
|
|
4923
4923
|
}
|
|
4924
4924
|
}
|
|
4925
|
-
class
|
|
4925
|
+
class ch {
|
|
4926
4926
|
constructor(e) {
|
|
4927
4927
|
this.name = ce.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
4928
4928
|
}
|
|
@@ -4946,7 +4946,7 @@ class ah {
|
|
|
4946
4946
|
for (const _ in c)
|
|
4947
4947
|
if (_ === "_COLOR_0") {
|
|
4948
4948
|
const A = c[_];
|
|
4949
|
-
b.instanceColor = new
|
|
4949
|
+
b.instanceColor = new ec(A.array, A.itemSize, A.normalized);
|
|
4950
4950
|
} else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && y.geometry.setAttribute(_, c[_]);
|
|
4951
4951
|
er.prototype.copy.call(b, y), this.parser.assignFinalMaterial(b), p.push(b);
|
|
4952
4952
|
}
|
|
@@ -4955,7 +4955,7 @@ class ah {
|
|
|
4955
4955
|
}
|
|
4956
4956
|
}
|
|
4957
4957
|
const jo = "glTF", Fn = 12, eo = { JSON: 1313821514, BIN: 5130562 };
|
|
4958
|
-
class
|
|
4958
|
+
class lh {
|
|
4959
4959
|
constructor(e) {
|
|
4960
4960
|
this.name = ce.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
4961
4961
|
const t = new DataView(e, 0, Fn), n = new TextDecoder();
|
|
@@ -4986,7 +4986,7 @@ class ch {
|
|
|
4986
4986
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
4987
4987
|
}
|
|
4988
4988
|
}
|
|
4989
|
-
class
|
|
4989
|
+
class hh {
|
|
4990
4990
|
constructor(e, t) {
|
|
4991
4991
|
if (!t)
|
|
4992
4992
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -5018,7 +5018,7 @@ class lh {
|
|
|
5018
5018
|
});
|
|
5019
5019
|
}
|
|
5020
5020
|
}
|
|
5021
|
-
class
|
|
5021
|
+
class uh {
|
|
5022
5022
|
constructor() {
|
|
5023
5023
|
this.name = ce.KHR_TEXTURE_TRANSFORM;
|
|
5024
5024
|
}
|
|
@@ -5026,12 +5026,12 @@ class hh {
|
|
|
5026
5026
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
5027
5027
|
}
|
|
5028
5028
|
}
|
|
5029
|
-
class
|
|
5029
|
+
class dh {
|
|
5030
5030
|
constructor() {
|
|
5031
5031
|
this.name = ce.KHR_MESH_QUANTIZATION;
|
|
5032
5032
|
}
|
|
5033
5033
|
}
|
|
5034
|
-
class Go extends
|
|
5034
|
+
class Go extends _c {
|
|
5035
5035
|
constructor(e, t, n, s) {
|
|
5036
5036
|
super(e, t, n, s);
|
|
5037
5037
|
}
|
|
@@ -5050,11 +5050,11 @@ class Go extends Tc {
|
|
|
5050
5050
|
return r;
|
|
5051
5051
|
}
|
|
5052
5052
|
}
|
|
5053
|
-
const
|
|
5054
|
-
class
|
|
5053
|
+
const fh = new xn();
|
|
5054
|
+
class ph extends Go {
|
|
5055
5055
|
interpolate_(e, t, n, s) {
|
|
5056
5056
|
const r = super.interpolate_(e, t, n, s);
|
|
5057
|
-
return
|
|
5057
|
+
return fh.fromArray(r).normalize().toArray(r), r;
|
|
5058
5058
|
}
|
|
5059
5059
|
}
|
|
5060
5060
|
const at = {
|
|
@@ -5075,13 +5075,13 @@ const at = {
|
|
|
5075
5075
|
}, to = {
|
|
5076
5076
|
9728: Ro,
|
|
5077
5077
|
9729: nn,
|
|
5078
|
-
9984:
|
|
5079
|
-
9985:
|
|
5080
|
-
9986:
|
|
5078
|
+
9984: ac,
|
|
5079
|
+
9985: oc,
|
|
5080
|
+
9986: rc,
|
|
5081
5081
|
9987: vo
|
|
5082
5082
|
}, no = {
|
|
5083
|
-
33071:
|
|
5084
|
-
33648:
|
|
5083
|
+
33071: lc,
|
|
5084
|
+
33648: cc,
|
|
5085
5085
|
10497: Ri
|
|
5086
5086
|
}, fi = {
|
|
5087
5087
|
SCALAR: 1,
|
|
@@ -5107,18 +5107,18 @@ const at = {
|
|
|
5107
5107
|
translation: "position",
|
|
5108
5108
|
rotation: "quaternion",
|
|
5109
5109
|
weights: "morphTargetInfluences"
|
|
5110
|
-
},
|
|
5110
|
+
}, mh = {
|
|
5111
5111
|
CUBICSPLINE: void 0,
|
|
5112
5112
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
5113
5113
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
5114
5114
|
LINEAR: Mo,
|
|
5115
|
-
STEP:
|
|
5115
|
+
STEP: Tc
|
|
5116
5116
|
}, pi = {
|
|
5117
5117
|
OPAQUE: "OPAQUE",
|
|
5118
5118
|
MASK: "MASK",
|
|
5119
5119
|
BLEND: "BLEND"
|
|
5120
5120
|
};
|
|
5121
|
-
function
|
|
5121
|
+
function gh(i) {
|
|
5122
5122
|
return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new Hs({
|
|
5123
5123
|
color: 16777215,
|
|
5124
5124
|
emissive: 0,
|
|
@@ -5136,7 +5136,7 @@ function Jt(i, e, t) {
|
|
|
5136
5136
|
function vt(i, e) {
|
|
5137
5137
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
5138
5138
|
}
|
|
5139
|
-
function
|
|
5139
|
+
function yh(i, e, t) {
|
|
5140
5140
|
let n = !1, s = !1, r = !1;
|
|
5141
5141
|
for (let d = 0, u = e.length; d < u; d++) {
|
|
5142
5142
|
const h = e[d];
|
|
@@ -5168,7 +5168,7 @@ function gh(i, e, t) {
|
|
|
5168
5168
|
return n && (i.morphAttributes.position = u), s && (i.morphAttributes.normal = h), r && (i.morphAttributes.color = f), i.morphTargetsRelative = !0, i;
|
|
5169
5169
|
});
|
|
5170
5170
|
}
|
|
5171
|
-
function
|
|
5171
|
+
function wh(i, e) {
|
|
5172
5172
|
if (i.updateMorphTargets(), e.weights !== void 0)
|
|
5173
5173
|
for (let t = 0, n = e.weights.length; t < n; t++)
|
|
5174
5174
|
i.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -5182,7 +5182,7 @@ function yh(i, e) {
|
|
|
5182
5182
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
5183
5183
|
}
|
|
5184
5184
|
}
|
|
5185
|
-
function
|
|
5185
|
+
function Eh(i) {
|
|
5186
5186
|
let e;
|
|
5187
5187
|
const t = i.extensions && i.extensions[ce.KHR_DRACO_MESH_COMPRESSION];
|
|
5188
5188
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + mi(t.attributes) : e = i.indices + ":" + mi(i.attributes) + ":" + i.mode, i.targets !== void 0)
|
|
@@ -5211,13 +5211,13 @@ function Hi(i) {
|
|
|
5211
5211
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
5212
5212
|
}
|
|
5213
5213
|
}
|
|
5214
|
-
function
|
|
5214
|
+
function Th(i) {
|
|
5215
5215
|
return i.search(/\.jpe?g($|\?)/i) > 0 || i.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : i.search(/\.webp($|\?)/i) > 0 || i.search(/^data\:image\/webp/) === 0 ? "image/webp" : i.search(/\.ktx2($|\?)/i) > 0 || i.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
5216
5216
|
}
|
|
5217
|
-
const
|
|
5218
|
-
class
|
|
5217
|
+
const _h = new ut();
|
|
5218
|
+
class Sh {
|
|
5219
5219
|
constructor(e = {}, t = {}) {
|
|
5220
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
5220
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Zl(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
5221
5221
|
let n = !1, s = -1, r = !1, o = -1;
|
|
5222
5222
|
if (typeof navigator < "u" && typeof navigator.userAgent < "u") {
|
|
5223
5223
|
const a = navigator.userAgent;
|
|
@@ -5225,7 +5225,7 @@ class _h {
|
|
|
5225
5225
|
const c = a.match(/Version\/(\d+)/);
|
|
5226
5226
|
s = n && c ? parseInt(c[1], 10) : -1, r = a.indexOf("Firefox") > -1, o = r ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
5227
5227
|
}
|
|
5228
|
-
typeof createImageBitmap > "u" || n && s < 17 || r && o < 98 ? this.textureLoader = new
|
|
5228
|
+
typeof createImageBitmap > "u" || n && s < 17 || r && o < 98 ? this.textureLoader = new tc(this.options.manager) : this.textureLoader = new nc(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new bo(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
5229
5229
|
}
|
|
5230
5230
|
setExtensions(e) {
|
|
5231
5231
|
this.extensions = e;
|
|
@@ -5475,7 +5475,7 @@ class _h {
|
|
|
5475
5475
|
if (p && p !== h) {
|
|
5476
5476
|
const x = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
|
|
5477
5477
|
let b = t.cache.get(E);
|
|
5478
|
-
b || (S = new d(a, x * p, s.count * p / u), b = new
|
|
5478
|
+
b || (S = new d(a, x * p, s.count * p / u), b = new sc(S, p / u), t.cache.add(E, b)), w = new ic(b, c, f % p / u, y);
|
|
5479
5479
|
} else
|
|
5480
5480
|
a === null ? S = new d(s.count * c) : S = new d(a, f, s.count * c), w = new jn(S, c, y);
|
|
5481
5481
|
if (s.sparse !== void 0) {
|
|
@@ -5542,7 +5542,7 @@ class _h {
|
|
|
5542
5542
|
}), t.load(Gn.resolveURL(h, r.path), y, void 0, p);
|
|
5543
5543
|
});
|
|
5544
5544
|
}).then(function(h) {
|
|
5545
|
-
return d === !0 && a.revokeObjectURL(c), vt(h, o), h.userData.mimeType = o.mimeType ||
|
|
5545
|
+
return d === !0 && a.revokeObjectURL(c), vt(h, o), h.userData.mimeType = o.mimeType || Th(o.uri), h;
|
|
5546
5546
|
}).catch(function(h) {
|
|
5547
5547
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", c), h;
|
|
5548
5548
|
});
|
|
@@ -5589,11 +5589,11 @@ class _h {
|
|
|
5589
5589
|
if (e.isPoints) {
|
|
5590
5590
|
const a = "PointsMaterial:" + n.uuid;
|
|
5591
5591
|
let c = this.cache.get(a);
|
|
5592
|
-
c || (c = new
|
|
5592
|
+
c || (c = new hc(), ei.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, c.sizeAttenuation = !1, this.cache.add(a, c)), n = c;
|
|
5593
5593
|
} else if (e.isLine) {
|
|
5594
5594
|
const a = "LineBasicMaterial:" + n.uuid;
|
|
5595
5595
|
let c = this.cache.get(a);
|
|
5596
|
-
c || (c = new
|
|
5596
|
+
c || (c = new uc(), ei.prototype.copy.call(c, n), c.color.copy(n.color), c.map = n.map, this.cache.add(a, c)), n = c;
|
|
5597
5597
|
}
|
|
5598
5598
|
if (s || r || o) {
|
|
5599
5599
|
let a = "ClonedMaterial:" + n.uuid + ":";
|
|
@@ -5655,7 +5655,7 @@ class _h {
|
|
|
5655
5655
|
* @return {string}
|
|
5656
5656
|
*/
|
|
5657
5657
|
createUniqueName(e) {
|
|
5658
|
-
const t =
|
|
5658
|
+
const t = dc.sanitizeNodeName(e || "");
|
|
5659
5659
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
5660
5660
|
}
|
|
5661
5661
|
/**
|
|
@@ -5676,12 +5676,12 @@ class _h {
|
|
|
5676
5676
|
}
|
|
5677
5677
|
const o = [];
|
|
5678
5678
|
for (let a = 0, c = e.length; a < c; a++) {
|
|
5679
|
-
const d = e[a], u =
|
|
5679
|
+
const d = e[a], u = Eh(d), h = s[u];
|
|
5680
5680
|
if (h)
|
|
5681
5681
|
o.push(h.promise);
|
|
5682
5682
|
else {
|
|
5683
5683
|
let f;
|
|
5684
|
-
d.extensions && d.extensions[ce.KHR_DRACO_MESH_COMPRESSION] ? f = r(d) : f = so(new
|
|
5684
|
+
d.extensions && d.extensions[ce.KHR_DRACO_MESH_COMPRESSION] ? f = r(d) : f = so(new fc(), d, t), s[u] = { primitive: d, promise: f }, o.push(f);
|
|
5685
5685
|
}
|
|
5686
5686
|
}
|
|
5687
5687
|
return Promise.all(o);
|
|
@@ -5696,7 +5696,7 @@ class _h {
|
|
|
5696
5696
|
loadMesh(e) {
|
|
5697
5697
|
const t = this, n = this.json, s = this.extensions, r = n.meshes[e], o = r.primitives, a = [];
|
|
5698
5698
|
for (let c = 0, d = o.length; c < d; c++) {
|
|
5699
|
-
const u = o[c].material === void 0 ?
|
|
5699
|
+
const u = o[c].material === void 0 ? gh(this.cache) : this.getDependency("material", o[c].material);
|
|
5700
5700
|
a.push(u);
|
|
5701
5701
|
}
|
|
5702
5702
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
|
|
@@ -5706,7 +5706,7 @@ class _h {
|
|
|
5706
5706
|
let x;
|
|
5707
5707
|
const E = d[p];
|
|
5708
5708
|
if (w.mode === at.TRIANGLES || w.mode === at.TRIANGLE_STRIP || w.mode === at.TRIANGLE_FAN || w.mode === void 0)
|
|
5709
|
-
x = r.isSkinnedMesh === !0 ? new
|
|
5709
|
+
x = r.isSkinnedMesh === !0 ? new pc(S, E) : new wt(S, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), w.mode === at.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : w.mode === at.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
|
|
5710
5710
|
else if (w.mode === at.LINES)
|
|
5711
5711
|
x = new qi(S, E);
|
|
5712
5712
|
else if (w.mode === at.LINE_STRIP)
|
|
@@ -5717,7 +5717,7 @@ class _h {
|
|
|
5717
5717
|
x = new Ji(S, E);
|
|
5718
5718
|
else
|
|
5719
5719
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + w.mode);
|
|
5720
|
-
Object.keys(x.geometry.morphAttributes).length > 0 &&
|
|
5720
|
+
Object.keys(x.geometry.morphAttributes).length > 0 && wh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), w.extensions && Jt(s, x, w), t.assignFinalMaterial(x), h.push(x);
|
|
5721
5721
|
}
|
|
5722
5722
|
for (let p = 0, y = h.length; p < y; p++)
|
|
5723
5723
|
t.associations.set(h[p], {
|
|
@@ -5747,7 +5747,7 @@ class _h {
|
|
|
5747
5747
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
5748
5748
|
return;
|
|
5749
5749
|
}
|
|
5750
|
-
return n.type === "perspective" ? t = new
|
|
5750
|
+
return n.type === "perspective" ? t = new mc(tr.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new gc(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), vt(t, n), Promise.resolve(t);
|
|
5751
5751
|
}
|
|
5752
5752
|
/**
|
|
5753
5753
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -5771,7 +5771,7 @@ class _h {
|
|
|
5771
5771
|
} else
|
|
5772
5772
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[d]);
|
|
5773
5773
|
}
|
|
5774
|
-
return new
|
|
5774
|
+
return new yc(a, c);
|
|
5775
5775
|
});
|
|
5776
5776
|
}
|
|
5777
5777
|
/**
|
|
@@ -5804,7 +5804,7 @@ class _h {
|
|
|
5804
5804
|
for (let N = 0; N < C.length; N++)
|
|
5805
5805
|
x.push(C[N]);
|
|
5806
5806
|
}
|
|
5807
|
-
const E = new
|
|
5807
|
+
const E = new wc(r, void 0, x);
|
|
5808
5808
|
return vt(E, s), E;
|
|
5809
5809
|
});
|
|
5810
5810
|
}
|
|
@@ -5838,7 +5838,7 @@ class _h {
|
|
|
5838
5838
|
]).then(function(d) {
|
|
5839
5839
|
const u = d[0], h = d[1], f = d[2];
|
|
5840
5840
|
f !== null && u.traverse(function(p) {
|
|
5841
|
-
p.isSkinnedMesh && p.bind(f,
|
|
5841
|
+
p.isSkinnedMesh && p.bind(f, _h);
|
|
5842
5842
|
});
|
|
5843
5843
|
for (let p = 0, y = h.length; p < y; p++)
|
|
5844
5844
|
u.add(h[p]);
|
|
@@ -5866,7 +5866,7 @@ class _h {
|
|
|
5866
5866
|
a.push(d);
|
|
5867
5867
|
}), this.nodeCache[e] = Promise.all(a).then(function(d) {
|
|
5868
5868
|
let u;
|
|
5869
|
-
if (r.isBone === !0 ? u = new
|
|
5869
|
+
if (r.isBone === !0 ? u = new Ec() : d.length > 1 ? u = new ti() : d.length === 1 ? u = d[0] : u = new er(), u !== d[0])
|
|
5870
5870
|
for (let h = 0, f = d.length; h < f; h++)
|
|
5871
5871
|
u.add(d[h]);
|
|
5872
5872
|
if (r.name && (u.userData.name = r.name, u.name = o), vt(u, r), r.extensions && Jt(n, u, r), r.matrix !== void 0) {
|
|
@@ -5899,7 +5899,7 @@ class _h {
|
|
|
5899
5899
|
return Promise.all(a).then(function(c) {
|
|
5900
5900
|
for (let u = 0, h = c.length; u < h; u++) {
|
|
5901
5901
|
const f = c[u];
|
|
5902
|
-
f.parent !== null ? r.add(
|
|
5902
|
+
f.parent !== null ? r.add(Gl(f)) : r.add(f);
|
|
5903
5903
|
}
|
|
5904
5904
|
const d = (u) => {
|
|
5905
5905
|
const h = /* @__PURE__ */ new Map();
|
|
@@ -5944,7 +5944,7 @@ class _h {
|
|
|
5944
5944
|
}
|
|
5945
5945
|
break;
|
|
5946
5946
|
}
|
|
5947
|
-
const h = s.interpolation !== void 0 ?
|
|
5947
|
+
const h = s.interpolation !== void 0 ? mh[s.interpolation] : Mo, f = this._getArrayFromAccessor(n);
|
|
5948
5948
|
for (let p = 0, y = c.length; p < y; p++) {
|
|
5949
5949
|
const S = new u(
|
|
5950
5950
|
c[p] + "." + Ut[r.path],
|
|
@@ -5968,12 +5968,12 @@ class _h {
|
|
|
5968
5968
|
}
|
|
5969
5969
|
_createCubicSplineTrackInterpolant(e) {
|
|
5970
5970
|
e.createInterpolant = function(n) {
|
|
5971
|
-
const s = this instanceof Rr ?
|
|
5971
|
+
const s = this instanceof Rr ? ph : Go;
|
|
5972
5972
|
return new s(this.times, this.values, this.getValueSize() / 3, n);
|
|
5973
5973
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
5974
5974
|
}
|
|
5975
5975
|
}
|
|
5976
|
-
function
|
|
5976
|
+
function bh(i, e, t) {
|
|
5977
5977
|
const n = e.attributes, s = new _t();
|
|
5978
5978
|
if (n.POSITION !== void 0) {
|
|
5979
5979
|
const a = t.json.accessors[n.POSITION], c = a.min, d = a.max;
|
|
@@ -6031,14 +6031,14 @@ function so(i, e, t) {
|
|
|
6031
6031
|
});
|
|
6032
6032
|
s.push(o);
|
|
6033
6033
|
}
|
|
6034
|
-
return Mr.workingColorSpace !== je && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Mr.workingColorSpace}" not supported.`), vt(i, e),
|
|
6035
|
-
return e.targets !== void 0 ?
|
|
6034
|
+
return Mr.workingColorSpace !== je && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Mr.workingColorSpace}" not supported.`), vt(i, e), bh(i, e, t), Promise.all(s).then(function() {
|
|
6035
|
+
return e.targets !== void 0 ? yh(i, e.targets, t) : i;
|
|
6036
6036
|
});
|
|
6037
6037
|
}
|
|
6038
|
-
const
|
|
6039
|
-
class
|
|
6038
|
+
const xh = T.REVISION.replace(/\D/g, ""), Vo = `https://cdn.jsdelivr.net/npm/three@0.${xh}/examples/jsm/libs`, Ah = `${Vo}/draco/`, vh = `${Vo}/basis/`;
|
|
6039
|
+
class Rh {
|
|
6040
6040
|
constructor(e = {}) {
|
|
6041
|
-
this.loadingManager = new T.LoadingManager(), this.loader = new
|
|
6041
|
+
this.loadingManager = new T.LoadingManager(), this.loader = new Vl(this.loadingManager), this.config = e;
|
|
6042
6042
|
}
|
|
6043
6043
|
ensureDecoders() {
|
|
6044
6044
|
return this.decodersReady || (this.decodersReady = this.configureDecoders()), this.decodersReady;
|
|
@@ -6055,11 +6055,11 @@ class vh {
|
|
|
6055
6055
|
}
|
|
6056
6056
|
async configureDraco(e) {
|
|
6057
6057
|
const { DRACOLoader: t } = await import("three/examples/jsm/loaders/DRACOLoader.js"), n = new t(this.loadingManager);
|
|
6058
|
-
n.setDecoderPath(e.dracoDecoderPath ??
|
|
6058
|
+
n.setDecoderPath(e.dracoDecoderPath ?? Ah), this.dracoLoader = n, this.loader.setDRACOLoader(n);
|
|
6059
6059
|
}
|
|
6060
6060
|
async configureKtx2(e) {
|
|
6061
6061
|
const { KTX2Loader: t } = await import("three/examples/jsm/loaders/KTX2Loader.js"), n = new t(this.loadingManager);
|
|
6062
|
-
n.setTranscoderPath(e.ktx2TranscoderPath ??
|
|
6062
|
+
n.setTranscoderPath(e.ktx2TranscoderPath ?? vh), e.renderer && n.detectSupport(e.renderer), this.ktx2Loader = n, this.loader.setKTX2Loader(n);
|
|
6063
6063
|
}
|
|
6064
6064
|
async configureMeshopt() {
|
|
6065
6065
|
const e = await import("three/examples/jsm/libs/meshopt_decoder.module.js");
|
|
@@ -6153,7 +6153,7 @@ class io {
|
|
|
6153
6153
|
switch (n) {
|
|
6154
6154
|
case "gltf":
|
|
6155
6155
|
case "glb":
|
|
6156
|
-
return new
|
|
6156
|
+
return new Rh(t);
|
|
6157
6157
|
// Add more loaders here in the future (FBX, OBJ, etc.)
|
|
6158
6158
|
default:
|
|
6159
6159
|
throw new W(
|
|
@@ -6164,7 +6164,7 @@ class io {
|
|
|
6164
6164
|
}
|
|
6165
6165
|
}
|
|
6166
6166
|
}
|
|
6167
|
-
const ro = { type: "change" }, hr = { type: "start" }, Zo = { type: "end" }, Ls = new Yi(), oo = new Qn(),
|
|
6167
|
+
const ro = { type: "change" }, hr = { type: "start" }, Zo = { type: "end" }, Ls = new Yi(), oo = new Qn(), Mh = Math.cos(70 * tr.DEG2RAD), Ce = new q(), tt = 2 * Math.PI, we = {
|
|
6168
6168
|
NONE: -1,
|
|
6169
6169
|
ROTATE: 0,
|
|
6170
6170
|
DOLLY: 1,
|
|
@@ -6182,7 +6182,7 @@ class Wo extends Io {
|
|
|
6182
6182
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
6183
6183
|
*/
|
|
6184
6184
|
constructor(e, t = null) {
|
|
6185
|
-
super(e, t), this.state = we.NONE, this.target = new q(), this.cursor = new q(), 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._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new q(), this._lastQuaternion = new xn(), this._lastTargetPosition = new q(), this._quat = new xn().setFromUnitVectors(e.up, new q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new q(), 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 q(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
6185
|
+
super(e, t), this.state = we.NONE, this.target = new q(), this.cursor = new q(), 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._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new q(), this._lastQuaternion = new xn(), this._lastTargetPosition = new q(), this._quat = new xn().setFromUnitVectors(e.up, new q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new q(), 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 q(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ch.bind(this), this._onPointerDown = Ih.bind(this), this._onPointerUp = Ph.bind(this), this._onContextMenu = zh.bind(this), this._onMouseWheel = Dh.bind(this), this._onKeyDown = Nh.bind(this), this._onTouchStart = kh.bind(this), this._onTouchMove = Fh.bind(this), this._onMouseDown = Lh.bind(this), this._onMouseMove = Oh.bind(this), this._interceptControlDown = Bh.bind(this), this._interceptControlUp = Uh.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
6186
6186
|
}
|
|
6187
6187
|
/**
|
|
6188
6188
|
* Defines the visual representation of the cursor.
|
|
@@ -6326,7 +6326,7 @@ class Wo extends Io {
|
|
|
6326
6326
|
d.unproject(this.object), this.object.position.sub(d).add(a), this.object.updateMatrixWorld(), o = Ce.length();
|
|
6327
6327
|
} else
|
|
6328
6328
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
6329
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ls.origin.copy(this.object.position), Ls.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ls.direction)) <
|
|
6329
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ls.origin.copy(this.object.position), Ls.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ls.direction)) < Mh ? this.object.lookAt(this.target) : (oo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ls.intersectPlane(oo, this.target))));
|
|
6330
6330
|
} else if (this.object.isOrthographicCamera) {
|
|
6331
6331
|
const o = this.object.zoom;
|
|
6332
6332
|
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);
|
|
@@ -6523,13 +6523,13 @@ class Wo extends Io {
|
|
|
6523
6523
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
6524
6524
|
}
|
|
6525
6525
|
}
|
|
6526
|
-
function
|
|
6526
|
+
function Ih(i) {
|
|
6527
6527
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
|
|
6528
6528
|
}
|
|
6529
|
-
function
|
|
6529
|
+
function Ch(i) {
|
|
6530
6530
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
6531
6531
|
}
|
|
6532
|
-
function
|
|
6532
|
+
function Ph(i) {
|
|
6533
6533
|
switch (this._removePointer(i), this._pointers.length) {
|
|
6534
6534
|
case 0:
|
|
6535
6535
|
this.domElement.releasePointerCapture(i.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Zo), this.state = we.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
@@ -6540,7 +6540,7 @@ function Ch(i) {
|
|
|
6540
6540
|
break;
|
|
6541
6541
|
}
|
|
6542
6542
|
}
|
|
6543
|
-
function
|
|
6543
|
+
function Lh(i) {
|
|
6544
6544
|
let e;
|
|
6545
6545
|
switch (i.button) {
|
|
6546
6546
|
case 0:
|
|
@@ -6583,7 +6583,7 @@ function Ph(i) {
|
|
|
6583
6583
|
}
|
|
6584
6584
|
this.state !== we.NONE && this.dispatchEvent(hr);
|
|
6585
6585
|
}
|
|
6586
|
-
function
|
|
6586
|
+
function Oh(i) {
|
|
6587
6587
|
switch (this.state) {
|
|
6588
6588
|
case we.ROTATE:
|
|
6589
6589
|
if (this.enableRotate === !1) return;
|
|
@@ -6599,13 +6599,13 @@ function Lh(i) {
|
|
|
6599
6599
|
break;
|
|
6600
6600
|
}
|
|
6601
6601
|
}
|
|
6602
|
-
function
|
|
6602
|
+
function Dh(i) {
|
|
6603
6603
|
this.enabled === !1 || this.enableZoom === !1 || this.state !== we.NONE || (i.preventDefault(), this.dispatchEvent(hr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(Zo));
|
|
6604
6604
|
}
|
|
6605
|
-
function
|
|
6605
|
+
function Nh(i) {
|
|
6606
6606
|
this.enabled !== !1 && this._handleKeyDown(i);
|
|
6607
6607
|
}
|
|
6608
|
-
function
|
|
6608
|
+
function kh(i) {
|
|
6609
6609
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
6610
6610
|
case 1:
|
|
6611
6611
|
switch (this.touches.ONE) {
|
|
@@ -6640,7 +6640,7 @@ function Nh(i) {
|
|
|
6640
6640
|
}
|
|
6641
6641
|
this.state !== we.NONE && this.dispatchEvent(hr);
|
|
6642
6642
|
}
|
|
6643
|
-
function
|
|
6643
|
+
function Fh(i) {
|
|
6644
6644
|
switch (this._trackPointer(i), this.state) {
|
|
6645
6645
|
case we.TOUCH_ROTATE:
|
|
6646
6646
|
if (this.enableRotate === !1) return;
|
|
@@ -6662,17 +6662,17 @@ function kh(i) {
|
|
|
6662
6662
|
this.state = we.NONE;
|
|
6663
6663
|
}
|
|
6664
6664
|
}
|
|
6665
|
-
function
|
|
6665
|
+
function zh(i) {
|
|
6666
6666
|
this.enabled !== !1 && i.preventDefault();
|
|
6667
6667
|
}
|
|
6668
|
-
function
|
|
6668
|
+
function Bh(i) {
|
|
6669
6669
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
6670
6670
|
}
|
|
6671
|
-
function
|
|
6671
|
+
function Uh(i) {
|
|
6672
6672
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
6673
6673
|
}
|
|
6674
|
-
const yi = new Qn(), Os = new
|
|
6675
|
-
class
|
|
6674
|
+
const yi = new Qn(), Os = new Sc(), gn = new pe(), wi = new q();
|
|
6675
|
+
class Hh extends Wo {
|
|
6676
6676
|
constructor(e, t) {
|
|
6677
6677
|
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 q();
|
|
6678
6678
|
}
|
|
@@ -6825,7 +6825,7 @@ class Ko {
|
|
|
6825
6825
|
return this.controls;
|
|
6826
6826
|
}
|
|
6827
6827
|
}
|
|
6828
|
-
class
|
|
6828
|
+
class jh extends Ko {
|
|
6829
6829
|
constructor(e, t) {
|
|
6830
6830
|
super(new Wo(e, t));
|
|
6831
6831
|
}
|
|
@@ -6833,9 +6833,9 @@ class Hh extends Ko {
|
|
|
6833
6833
|
return "orbit";
|
|
6834
6834
|
}
|
|
6835
6835
|
}
|
|
6836
|
-
class
|
|
6836
|
+
class Gh extends Ko {
|
|
6837
6837
|
constructor(e, t) {
|
|
6838
|
-
const n = new
|
|
6838
|
+
const n = new Hh(e, t);
|
|
6839
6839
|
super(n), n.screenSpacePanning = !0;
|
|
6840
6840
|
}
|
|
6841
6841
|
get type() {
|
|
@@ -6870,7 +6870,7 @@ function Xo(i) {
|
|
|
6870
6870
|
function ur(i) {
|
|
6871
6871
|
return Jn(i, "getThreeControls");
|
|
6872
6872
|
}
|
|
6873
|
-
const Gi = "contact-shadow-baked", qn = "contact-shadow-live", ao = Math.PI * (3 - Math.sqrt(5)), Xe = class Xe {
|
|
6873
|
+
const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxContactShadowHelper", ao = Math.PI * (3 - Math.sqrt(5)), Xe = class Xe {
|
|
6874
6874
|
constructor(e) {
|
|
6875
6875
|
this.passes = (e == null ? void 0 : e.passes) ?? 96;
|
|
6876
6876
|
}
|
|
@@ -6996,7 +6996,7 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", ao = Math.PI * (3
|
|
|
6996
6996
|
);
|
|
6997
6997
|
}, o.customProgramCacheKey = () => "contact-shadow-alpha-gamma", o.addEventListener("dispose", () => n.dispose());
|
|
6998
6998
|
const a = new T.Mesh(s, o);
|
|
6999
|
-
a.name = Gi, a.rotation.x = -Math.PI / 2;
|
|
6999
|
+
a.name = Gi, a.userData[Yo] = !0, a.rotation.x = -Math.PI / 2;
|
|
7000
7000
|
const c = T.MathUtils.clamp(t.objectHeight * 25e-4, 2e-4, 0.01);
|
|
7001
7001
|
a.position.set(t.center.x, c, t.center.z), a.userData.renderTarget = n, e.add(a);
|
|
7002
7002
|
const d = e.getObjectByName(qn);
|
|
@@ -7077,7 +7077,7 @@ const Kn = class Kn {
|
|
|
7077
7077
|
Kn.HEIGHT_RATIO = 0.075, Kn.BEVEL_RATIO = 0.04, Kn.GAP_FACTOR = 1.05;
|
|
7078
7078
|
let sn = Kn;
|
|
7079
7079
|
var Ot = /* @__PURE__ */ ((i) => (i.SQUARE_WIRE = "square_wire", i.HEXAGONAL_WIRE = "hexagonal_wire", i.HEXAGONAL_GLASS = "hexagonal_glass", i.STONE_TILES = "stone_tiles", i.CUSTOM = "custom", i))(Ot || {});
|
|
7080
|
-
class
|
|
7080
|
+
class Vh {
|
|
7081
7081
|
constructor() {
|
|
7082
7082
|
this.name = "Square Wire Grid";
|
|
7083
7083
|
}
|
|
@@ -7092,7 +7092,7 @@ class Gh {
|
|
|
7092
7092
|
dispose() {
|
|
7093
7093
|
}
|
|
7094
7094
|
}
|
|
7095
|
-
class
|
|
7095
|
+
class Zh {
|
|
7096
7096
|
constructor() {
|
|
7097
7097
|
this.name = "Hexagonal Wire Grid";
|
|
7098
7098
|
}
|
|
@@ -7120,7 +7120,7 @@ class Vh {
|
|
|
7120
7120
|
dispose() {
|
|
7121
7121
|
}
|
|
7122
7122
|
}
|
|
7123
|
-
class
|
|
7123
|
+
class Wh {
|
|
7124
7124
|
constructor(e, t, n, s = {}) {
|
|
7125
7125
|
this.position = e, this.size = t, this.color = n, this.materialOptions = s, this.height = sn.getHeight(this.size), this.bevel = sn.getBevelSize(this.size);
|
|
7126
7126
|
}
|
|
@@ -7169,7 +7169,7 @@ class Zh {
|
|
|
7169
7169
|
return y.add(p), y.position.set(this.position.x, this.position.y, this.position.z), y.rotation.x = Math.PI / 2, y.rotation.z = Math.PI / 6, y;
|
|
7170
7170
|
}
|
|
7171
7171
|
}
|
|
7172
|
-
class
|
|
7172
|
+
class Kh {
|
|
7173
7173
|
constructor() {
|
|
7174
7174
|
this.name = "Hexagonal Glass Grid";
|
|
7175
7175
|
}
|
|
@@ -7179,7 +7179,7 @@ class Wh {
|
|
|
7179
7179
|
for (let w = -n; w <= n; w++) {
|
|
7180
7180
|
const x = Math.max(-n, -w - n), E = Math.min(n, -w + n);
|
|
7181
7181
|
for (let b = x; b <= E; b++) {
|
|
7182
|
-
const _ = a * (w + b / 2), A = c * 0.75 * b, P = sn.getYPosition(s), M = new
|
|
7182
|
+
const _ = a * (w + b / 2), A = c * 0.75 * b, P = sn.getYPosition(s), M = new Wh(new T.Vector3(_, P, A), s, r, {
|
|
7183
7183
|
metalness: (h = e.styleOptions) == null ? void 0 : h.metalness,
|
|
7184
7184
|
roughness: (f = e.styleOptions) == null ? void 0 : f.roughness,
|
|
7185
7185
|
transmission: (p = e.styleOptions) == null ? void 0 : p.transmission,
|
|
@@ -7196,12 +7196,12 @@ class Wh {
|
|
|
7196
7196
|
new T.CircleGeometry(Math.max(e, 1), 64),
|
|
7197
7197
|
new T.ShadowMaterial({ opacity: 0.35 })
|
|
7198
7198
|
);
|
|
7199
|
-
return t.name = qn, t.rotation.x = -Math.PI / 2, t.position.y = 2e-3, t.receiveShadow = !0, t;
|
|
7199
|
+
return t.name = qn, t.userData[Yo] = !0, t.rotation.x = -Math.PI / 2, t.position.y = 2e-3, t.receiveShadow = !0, t;
|
|
7200
7200
|
}
|
|
7201
7201
|
dispose() {
|
|
7202
7202
|
}
|
|
7203
7203
|
}
|
|
7204
|
-
class
|
|
7204
|
+
class Xh {
|
|
7205
7205
|
constructor() {
|
|
7206
7206
|
this.name = "Stone Tile Grid", this.textureLoader = new T.TextureLoader();
|
|
7207
7207
|
}
|
|
@@ -7295,10 +7295,10 @@ const fr = class fr {
|
|
|
7295
7295
|
}
|
|
7296
7296
|
};
|
|
7297
7297
|
fr.gridStyles = /* @__PURE__ */ new Map([
|
|
7298
|
-
[Ot.SQUARE_WIRE, new
|
|
7299
|
-
[Ot.HEXAGONAL_WIRE, new
|
|
7300
|
-
[Ot.HEXAGONAL_GLASS, new
|
|
7301
|
-
[Ot.STONE_TILES, new
|
|
7298
|
+
[Ot.SQUARE_WIRE, new Vh()],
|
|
7299
|
+
[Ot.HEXAGONAL_WIRE, new Zh()],
|
|
7300
|
+
[Ot.HEXAGONAL_GLASS, new Kh()],
|
|
7301
|
+
[Ot.STONE_TILES, new Xh()]
|
|
7302
7302
|
]);
|
|
7303
7303
|
let Ws = fr;
|
|
7304
7304
|
const co = (i) => {
|
|
@@ -7307,7 +7307,7 @@ const co = (i) => {
|
|
|
7307
7307
|
!e && t.isDirectionalLight && (e = t);
|
|
7308
7308
|
}), e;
|
|
7309
7309
|
};
|
|
7310
|
-
class
|
|
7310
|
+
class Yh {
|
|
7311
7311
|
constructor() {
|
|
7312
7312
|
this.contactShadowBaker = new Vi();
|
|
7313
7313
|
}
|
|
@@ -7584,7 +7584,7 @@ class Xh {
|
|
|
7584
7584
|
)
|
|
7585
7585
|
);
|
|
7586
7586
|
const s = new T.Group();
|
|
7587
|
-
return s.name =
|
|
7587
|
+
return s.name = vc, s.scale.setScalar(t), s.add(n), z.ok(new Le(s));
|
|
7588
7588
|
} catch (n) {
|
|
7589
7589
|
return z.err(
|
|
7590
7590
|
new W(
|
|
@@ -7703,12 +7703,12 @@ class Xh {
|
|
|
7703
7703
|
}
|
|
7704
7704
|
}
|
|
7705
7705
|
}
|
|
7706
|
-
class
|
|
7706
|
+
class qh {
|
|
7707
7707
|
constructor() {
|
|
7708
7708
|
this.events = new nr(), this.disposed = !1;
|
|
7709
7709
|
}
|
|
7710
7710
|
async initialize(e) {
|
|
7711
|
-
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-
|
|
7711
|
+
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-CPU_eQdF.js");
|
|
7712
7712
|
if (this.disposed)
|
|
7713
7713
|
return z.ok(void 0);
|
|
7714
7714
|
const n = new t();
|
|
@@ -7756,7 +7756,7 @@ fflate - fast JavaScript compression/decompression
|
|
|
7756
7756
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
7757
7757
|
version 0.8.2
|
|
7758
7758
|
*/
|
|
7759
|
-
var ct = Uint8Array, Sn = Uint16Array,
|
|
7759
|
+
var ct = Uint8Array, Sn = Uint16Array, $h = Int32Array, qo = new ct([
|
|
7760
7760
|
0,
|
|
7761
7761
|
0,
|
|
7762
7762
|
0,
|
|
@@ -7791,7 +7791,7 @@ var ct = Uint8Array, Sn = Uint16Array, qh = Int32Array, Yo = new ct([
|
|
|
7791
7791
|
0,
|
|
7792
7792
|
/* impossible */
|
|
7793
7793
|
0
|
|
7794
|
-
]),
|
|
7794
|
+
]), $o = new ct([
|
|
7795
7795
|
0,
|
|
7796
7796
|
0,
|
|
7797
7797
|
0,
|
|
@@ -7825,16 +7825,16 @@ var ct = Uint8Array, Sn = Uint16Array, qh = Int32Array, Yo = new ct([
|
|
|
7825
7825
|
/* unused */
|
|
7826
7826
|
0,
|
|
7827
7827
|
0
|
|
7828
|
-
]),
|
|
7828
|
+
]), Qh = new ct([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
|
|
7829
7829
|
for (var t = new Sn(31), n = 0; n < 31; ++n)
|
|
7830
7830
|
t[n] = e += 1 << i[n - 1];
|
|
7831
|
-
for (var s = new
|
|
7831
|
+
for (var s = new $h(t[30]), n = 1; n < 30; ++n)
|
|
7832
7832
|
for (var r = t[n]; r < t[n + 1]; ++r)
|
|
7833
7833
|
s[r] = r - t[n] << 5 | n;
|
|
7834
7834
|
return { b: t, r: s };
|
|
7835
|
-
},
|
|
7836
|
-
|
|
7837
|
-
var
|
|
7835
|
+
}, Jo = Qo(qo, 2), ea = Jo.b, Jh = Jo.r;
|
|
7836
|
+
ea[28] = 258, Jh[258] = 28;
|
|
7837
|
+
var eu = Qo($o, 0), tu = eu.b, Zi = new Sn(32768);
|
|
7838
7838
|
for (var Se = 0; Se < 32768; ++Se) {
|
|
7839
7839
|
var Ht = (Se & 43690) >> 1 | (Se & 21845) << 1;
|
|
7840
7840
|
Ht = (Ht & 52428) >> 2 | (Ht & 13107) << 2, Ht = (Ht & 61680) >> 4 | (Ht & 3855) << 4, Zi[Se] = ((Ht & 65280) >> 8 | (Ht & 255) << 8) >> 1;
|
|
@@ -7866,10 +7866,10 @@ for (var Se = 256; Se < 280; ++Se)
|
|
|
7866
7866
|
ts[Se] = 7;
|
|
7867
7867
|
for (var Se = 280; Se < 288; ++Se)
|
|
7868
7868
|
ts[Se] = 8;
|
|
7869
|
-
var
|
|
7869
|
+
var ta = new ct(32);
|
|
7870
7870
|
for (var Se = 0; Se < 32; ++Se)
|
|
7871
|
-
|
|
7872
|
-
var
|
|
7871
|
+
ta[Se] = 5;
|
|
7872
|
+
var nu = /* @__PURE__ */ Wn(ts, 9, 1), su = /* @__PURE__ */ Wn(ta, 5, 1), Ei = function(i) {
|
|
7873
7873
|
for (var e = i[0], t = 1; t < i.length; ++t)
|
|
7874
7874
|
i[t] > e && (e = i[t]);
|
|
7875
7875
|
return e;
|
|
@@ -7879,11 +7879,11 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
7879
7879
|
}, Ti = function(i, e) {
|
|
7880
7880
|
var t = e / 8 | 0;
|
|
7881
7881
|
return (i[t] | i[t + 1] << 8 | i[t + 2] << 16) >> (e & 7);
|
|
7882
|
-
},
|
|
7882
|
+
}, iu = function(i) {
|
|
7883
7883
|
return (i + 7) / 8 | 0;
|
|
7884
|
-
},
|
|
7884
|
+
}, ru = function(i, e, t) {
|
|
7885
7885
|
return (t == null || t > i.length) && (t = i.length), new ct(i.subarray(e, t));
|
|
7886
|
-
},
|
|
7886
|
+
}, ou = [
|
|
7887
7887
|
"unexpected EOF",
|
|
7888
7888
|
"invalid block type",
|
|
7889
7889
|
"invalid length/literal",
|
|
@@ -7900,11 +7900,11 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
7900
7900
|
"invalid zip data"
|
|
7901
7901
|
// determined by unknown compression method
|
|
7902
7902
|
], yt = function(i, e, t) {
|
|
7903
|
-
var n = new Error(e ||
|
|
7903
|
+
var n = new Error(e || ou[i]);
|
|
7904
7904
|
if (n.code = i, Error.captureStackTrace && Error.captureStackTrace(n, yt), !t)
|
|
7905
7905
|
throw n;
|
|
7906
7906
|
return n;
|
|
7907
|
-
},
|
|
7907
|
+
}, au = function(i, e, t, n) {
|
|
7908
7908
|
var s = i.length, r = 0;
|
|
7909
7909
|
if (!s || e.f && !e.l)
|
|
7910
7910
|
return t || new ct(0);
|
|
@@ -7923,12 +7923,12 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
7923
7923
|
var E = mt(i, h + 1, 3);
|
|
7924
7924
|
if (h += 3, E)
|
|
7925
7925
|
if (E == 1)
|
|
7926
|
-
p =
|
|
7926
|
+
p = nu, y = su, S = 9, w = 5;
|
|
7927
7927
|
else if (E == 2) {
|
|
7928
7928
|
var P = mt(i, h, 31) + 257, I = mt(i, h + 10, 15) + 4, M = P + mt(i, h + 5, 31) + 1;
|
|
7929
7929
|
h += 14;
|
|
7930
7930
|
for (var O = new ct(M), C = new ct(19), N = 0; N < I; ++N)
|
|
7931
|
-
C[
|
|
7931
|
+
C[Qh[N]] = mt(i, h + N * 3, 7);
|
|
7932
7932
|
h += I * 3;
|
|
7933
7933
|
for (var D = Ei(C), H = (1 << D) - 1, G = Wn(C, D, 1), N = 0; N < M; ) {
|
|
7934
7934
|
var $ = G[mt(i, h, H)];
|
|
@@ -7947,7 +7947,7 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
7947
7947
|
} else
|
|
7948
7948
|
yt(1);
|
|
7949
7949
|
else {
|
|
7950
|
-
var b =
|
|
7950
|
+
var b = iu(h) + 4, _ = i[b - 4] | i[b - 3] << 8, A = b + _;
|
|
7951
7951
|
if (A > s) {
|
|
7952
7952
|
c && yt(0);
|
|
7953
7953
|
break;
|
|
@@ -7975,14 +7975,14 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
7975
7975
|
} else {
|
|
7976
7976
|
var St = ge - 254;
|
|
7977
7977
|
if (ge > 264) {
|
|
7978
|
-
var N = ge - 257, Ze =
|
|
7979
|
-
St = mt(i, h, (1 << Ze) - 1) +
|
|
7978
|
+
var N = ge - 257, Ze = qo[N];
|
|
7979
|
+
St = mt(i, h, (1 << Ze) - 1) + ea[N], h += Ze;
|
|
7980
7980
|
}
|
|
7981
7981
|
var Ft = y[Ti(i, h) & Ve], me = Ft >> 4;
|
|
7982
7982
|
Ft || yt(3), h += Ft & 15;
|
|
7983
|
-
var Re =
|
|
7983
|
+
var Re = tu[me];
|
|
7984
7984
|
if (me > 3) {
|
|
7985
|
-
var Ze =
|
|
7985
|
+
var Ze = $o[me];
|
|
7986
7986
|
Re += Ti(i, h) & (1 << Ze) - 1, h += Ze;
|
|
7987
7987
|
}
|
|
7988
7988
|
if (h > x) {
|
|
@@ -8002,19 +8002,19 @@ var tu = /* @__PURE__ */ Wn(ts, 9, 1), nu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
|
|
|
8002
8002
|
}
|
|
8003
8003
|
e.l = p, e.p = Ae, e.b = f, e.f = u, p && (u = 1, e.m = S, e.d = y, e.n = w);
|
|
8004
8004
|
} while (!u);
|
|
8005
|
-
return f != t.length && o ?
|
|
8006
|
-
},
|
|
8005
|
+
return f != t.length && o ? ru(t, 0, f) : t.subarray(0, f);
|
|
8006
|
+
}, cu = /* @__PURE__ */ new ct(0), lu = function(i, e) {
|
|
8007
8007
|
return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && yt(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && yt(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;
|
|
8008
8008
|
};
|
|
8009
8009
|
function zn(i, e) {
|
|
8010
|
-
return
|
|
8010
|
+
return au(i.subarray(lu(i), -4), { i: 2 }, e, e);
|
|
8011
8011
|
}
|
|
8012
|
-
var
|
|
8012
|
+
var hu = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), uu = 0;
|
|
8013
8013
|
try {
|
|
8014
|
-
|
|
8014
|
+
hu.decode(cu, { stream: !0 }), uu = 1;
|
|
8015
8015
|
} catch {
|
|
8016
8016
|
}
|
|
8017
|
-
class
|
|
8017
|
+
class du extends Co {
|
|
8018
8018
|
/**
|
|
8019
8019
|
* Constructs a new EXR loader.
|
|
8020
8020
|
*
|
|
@@ -8279,7 +8279,7 @@ class uu extends Co {
|
|
|
8279
8279
|
}
|
|
8280
8280
|
return g;
|
|
8281
8281
|
}
|
|
8282
|
-
function
|
|
8282
|
+
function fa(l, m, g, R, L, F) {
|
|
8283
8283
|
let v = new DataView(F.buffer);
|
|
8284
8284
|
const U = g[l.idx[0]].width, k = g[l.idx[0]].height, B = 3, j = Math.floor(U / 8), Z = Math.ceil(U / 8), V = Math.ceil(k / 8), X = U - (Z - 1) * 8, ee = k - (V - 1) * 8, K = { value: 0 }, Q = new Array(B), re = new Array(B), le = new Array(B), oe = new Array(B), ue = new Array(B);
|
|
8285
8285
|
for (let te = 0; te < B; ++te)
|
|
@@ -8292,7 +8292,7 @@ class uu extends Co {
|
|
|
8292
8292
|
ae == Z - 1 && (ye = X);
|
|
8293
8293
|
for (let he = 0; he < B; ++he)
|
|
8294
8294
|
le[he].fill(0), le[he][0] = L[Q[he]++], pr(K, R, le[he]), mr(le[he], re[he]), gr(re[he]);
|
|
8295
|
-
|
|
8295
|
+
ma(re);
|
|
8296
8296
|
for (let he = 0; he < B; ++he)
|
|
8297
8297
|
yr(re[he], oe[he], ae * 64);
|
|
8298
8298
|
}
|
|
@@ -8329,7 +8329,7 @@ class uu extends Co {
|
|
|
8329
8329
|
}
|
|
8330
8330
|
}
|
|
8331
8331
|
}
|
|
8332
|
-
function
|
|
8332
|
+
function pa(l, m, g, R, L, F) {
|
|
8333
8333
|
const v = new DataView(F.buffer), U = g[l], k = U.width, B = U.height, j = Math.ceil(k / 8), Z = Math.ceil(B / 8), V = Math.floor(k / 8), X = k - (j - 1) * 8, ee = B - (Z - 1) * 8, K = { value: 0 };
|
|
8334
8334
|
let Q = 0;
|
|
8335
8335
|
const re = new Float32Array(64), le = new Uint16Array(64), oe = new Uint16Array(j * 64);
|
|
@@ -8372,7 +8372,7 @@ class uu extends Co {
|
|
|
8372
8372
|
for (let V = 0; V < 8; ++V)
|
|
8373
8373
|
k[0] = R * l[16 + V], k[1] = v * l[16 + V], k[2] = R * l[48 + V], k[3] = v * l[48 + V], B[0] = g * l[8 + V] + L * l[24 + V] + F * l[40 + V] + U * l[56 + V], B[1] = L * l[8 + V] - U * l[24 + V] - g * l[40 + V] - F * l[56 + V], B[2] = F * l[8 + V] - g * l[24 + V] + U * l[40 + V] + L * l[56 + V], B[3] = U * l[8 + V] - F * l[24 + V] + L * l[40 + V] - g * l[56 + V], j[0] = m * (l[V] + l[32 + V]), j[3] = m * (l[V] - l[32 + V]), j[1] = k[0] + k[3], j[2] = k[1] - k[2], Z[0] = j[0] + j[1], Z[1] = j[3] + j[2], Z[2] = j[3] - j[2], Z[3] = j[0] - j[1], l[0 + V] = Z[0] + B[0], l[8 + V] = Z[1] + B[1], l[16 + V] = Z[2] + B[2], l[24 + V] = Z[3] + B[3], l[32 + V] = Z[3] - B[3], l[40 + V] = Z[2] - B[2], l[48 + V] = Z[1] - B[1], l[56 + V] = Z[0] - B[0];
|
|
8374
8374
|
}
|
|
8375
|
-
function
|
|
8375
|
+
function ma(l) {
|
|
8376
8376
|
for (let m = 0; m < 64; ++m) {
|
|
8377
8377
|
const g = l[0][m], R = l[1][m], L = l[2][m];
|
|
8378
8378
|
l[0][m] = g + 1.5747 * L, l[1][m] = g - 0.1873 * R - 0.4682 * L, l[2][m] = g + 1.8556 * R;
|
|
@@ -8380,15 +8380,15 @@ class uu extends Co {
|
|
|
8380
8380
|
}
|
|
8381
8381
|
function yr(l, m, g) {
|
|
8382
8382
|
for (let R = 0; R < 64; ++R)
|
|
8383
|
-
m[g + R] = Et.toHalfFloat(
|
|
8383
|
+
m[g + R] = Et.toHalfFloat(ga(l[R]));
|
|
8384
8384
|
}
|
|
8385
|
-
function
|
|
8385
|
+
function ga(l) {
|
|
8386
8386
|
return l <= 1 ? Math.sign(l) * Math.pow(Math.abs(l), 2.2) : Math.sign(l) * Math.pow(O, Math.abs(l) - 1);
|
|
8387
8387
|
}
|
|
8388
8388
|
function rs(l) {
|
|
8389
8389
|
return new DataView(l.array.buffer, l.offset.value, l.size);
|
|
8390
8390
|
}
|
|
8391
|
-
function
|
|
8391
|
+
function ya(l) {
|
|
8392
8392
|
const m = l.viewer.buffer.slice(l.offset.value, l.offset.value + l.size), g = new Uint8Array(Qs(m)), R = new Uint8Array(g.length);
|
|
8393
8393
|
return ss(g), is(g, R), new DataView(R.buffer);
|
|
8394
8394
|
}
|
|
@@ -8396,7 +8396,7 @@ class uu extends Co {
|
|
|
8396
8396
|
const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = zn(m), R = new Uint8Array(g.length);
|
|
8397
8397
|
return ss(g), is(g, R), new DataView(R.buffer);
|
|
8398
8398
|
}
|
|
8399
|
-
function
|
|
8399
|
+
function wa(l) {
|
|
8400
8400
|
const m = l.viewer, g = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), L = new Uint8Array(8192);
|
|
8401
8401
|
let F = 0;
|
|
8402
8402
|
const v = new Array(l.inputChannels.length);
|
|
@@ -8433,7 +8433,7 @@ class uu extends Co {
|
|
|
8433
8433
|
}
|
|
8434
8434
|
return new DataView(X.buffer);
|
|
8435
8435
|
}
|
|
8436
|
-
function
|
|
8436
|
+
function Ea(l) {
|
|
8437
8437
|
const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = zn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), F = new DataView(L);
|
|
8438
8438
|
let v = 0, U = 0;
|
|
8439
8439
|
const k = new Array(4);
|
|
@@ -8459,7 +8459,7 @@ class uu extends Co {
|
|
|
8459
8459
|
}
|
|
8460
8460
|
return F;
|
|
8461
8461
|
}
|
|
8462
|
-
function
|
|
8462
|
+
function Ta(l) {
|
|
8463
8463
|
const m = l.array;
|
|
8464
8464
|
let g = l.offset.value;
|
|
8465
8465
|
const R = l.columns, L = l.lines, F = l.inputChannels, v = l.totalBytes, U = Ke.compression === "B44A_COMPRESSION", k = new Uint8Array(L * R * v), B = new Uint16Array(16);
|
|
@@ -8598,7 +8598,7 @@ class uu extends Co {
|
|
|
8598
8598
|
for (let K = 0; K < l.lines; ++K)
|
|
8599
8599
|
for (let Q = 0; Q < k.length; ++Q)
|
|
8600
8600
|
ee[Q].push(X), X += k[Q].width * l.type * 2;
|
|
8601
|
-
B.idx[0] !== void 0 && k[B.idx[0]] &&
|
|
8601
|
+
B.idx[0] !== void 0 && k[B.idx[0]] && fa(B, ee, k, j, Z, R);
|
|
8602
8602
|
for (let K = 0; K < k.length; ++K) {
|
|
8603
8603
|
const Q = k[K];
|
|
8604
8604
|
if (!Q.decoded)
|
|
@@ -8616,7 +8616,7 @@ class uu extends Co {
|
|
|
8616
8616
|
}
|
|
8617
8617
|
break;
|
|
8618
8618
|
case 1:
|
|
8619
|
-
|
|
8619
|
+
pa(K, ee, k, j, Z, R);
|
|
8620
8620
|
break;
|
|
8621
8621
|
default:
|
|
8622
8622
|
throw new Error("THREE.EXRLoader: unsupported channel compression");
|
|
@@ -8634,17 +8634,17 @@ class uu extends Co {
|
|
|
8634
8634
|
);
|
|
8635
8635
|
return m.value = m.value + R + 1, L;
|
|
8636
8636
|
}
|
|
8637
|
-
function
|
|
8637
|
+
function _a(l, m, g) {
|
|
8638
8638
|
const R = new TextDecoder().decode(
|
|
8639
8639
|
new Uint8Array(l).slice(m.value, m.value + g)
|
|
8640
8640
|
);
|
|
8641
8641
|
return m.value = m.value + g, R;
|
|
8642
8642
|
}
|
|
8643
|
-
function
|
|
8643
|
+
function Sa(l, m) {
|
|
8644
8644
|
const g = et(l, m), R = st(l, m);
|
|
8645
8645
|
return [g, R];
|
|
8646
8646
|
}
|
|
8647
|
-
function
|
|
8647
|
+
function ba(l, m) {
|
|
8648
8648
|
const g = st(l, m), R = st(l, m);
|
|
8649
8649
|
return [g, R];
|
|
8650
8650
|
}
|
|
@@ -8672,7 +8672,7 @@ class uu extends Co {
|
|
|
8672
8672
|
const g = l.getFloat32(m.value, !0);
|
|
8673
8673
|
return m.value += 4, g;
|
|
8674
8674
|
}
|
|
8675
|
-
function
|
|
8675
|
+
function xa(l, m) {
|
|
8676
8676
|
return Et.toHalfFloat(We(l, m));
|
|
8677
8677
|
}
|
|
8678
8678
|
function J(l) {
|
|
@@ -8683,10 +8683,10 @@ class uu extends Co {
|
|
|
8683
8683
|
const g = l.getUint16(m.value, !0);
|
|
8684
8684
|
return m.value += 2, g;
|
|
8685
8685
|
}
|
|
8686
|
-
function
|
|
8686
|
+
function Aa(l, m) {
|
|
8687
8687
|
return J(vn(l, m));
|
|
8688
8688
|
}
|
|
8689
|
-
function
|
|
8689
|
+
function va(l, m, g, R) {
|
|
8690
8690
|
const L = g.value, F = [];
|
|
8691
8691
|
for (; g.value < L + R - 1; ) {
|
|
8692
8692
|
const v = os(m, g), U = et(l, g), k = zt(l, g);
|
|
@@ -8702,11 +8702,11 @@ class uu extends Co {
|
|
|
8702
8702
|
}
|
|
8703
8703
|
return g.value += 1, F;
|
|
8704
8704
|
}
|
|
8705
|
-
function
|
|
8705
|
+
function Ra(l, m) {
|
|
8706
8706
|
const g = We(l, m), R = We(l, m), L = We(l, m), F = We(l, m), v = We(l, m), U = We(l, m), k = We(l, m), B = We(l, m);
|
|
8707
8707
|
return { redX: g, redY: R, greenX: L, greenY: F, blueX: v, blueY: U, whiteX: k, whiteY: B };
|
|
8708
8708
|
}
|
|
8709
|
-
function
|
|
8709
|
+
function Ma(l, m) {
|
|
8710
8710
|
const g = [
|
|
8711
8711
|
"NO_COMPRESSION",
|
|
8712
8712
|
"RLE_COMPRESSION",
|
|
@@ -8721,11 +8721,11 @@ class uu extends Co {
|
|
|
8721
8721
|
], R = zt(l, m);
|
|
8722
8722
|
return g[R];
|
|
8723
8723
|
}
|
|
8724
|
-
function
|
|
8724
|
+
function Ia(l, m) {
|
|
8725
8725
|
const g = et(l, m), R = et(l, m), L = et(l, m), F = et(l, m);
|
|
8726
8726
|
return { xMin: g, yMin: R, xMax: L, yMax: F };
|
|
8727
8727
|
}
|
|
8728
|
-
function
|
|
8728
|
+
function Ca(l, m) {
|
|
8729
8729
|
const g = [
|
|
8730
8730
|
"INCREASING_Y",
|
|
8731
8731
|
"DECREASING_Y",
|
|
@@ -8733,14 +8733,14 @@ class uu extends Co {
|
|
|
8733
8733
|
], R = zt(l, m);
|
|
8734
8734
|
return g[R];
|
|
8735
8735
|
}
|
|
8736
|
-
function
|
|
8736
|
+
function Pa(l, m) {
|
|
8737
8737
|
const g = [
|
|
8738
8738
|
"ENVMAP_LATLONG",
|
|
8739
8739
|
"ENVMAP_CUBE"
|
|
8740
8740
|
], R = zt(l, m);
|
|
8741
8741
|
return g[R];
|
|
8742
8742
|
}
|
|
8743
|
-
function
|
|
8743
|
+
function La(l, m) {
|
|
8744
8744
|
const g = [
|
|
8745
8745
|
"ONE_LEVEL",
|
|
8746
8746
|
"MIPMAP_LEVELS",
|
|
@@ -8756,59 +8756,59 @@ class uu extends Co {
|
|
|
8756
8756
|
roundingMode: R[v >> 4]
|
|
8757
8757
|
};
|
|
8758
8758
|
}
|
|
8759
|
-
function
|
|
8759
|
+
function Oa(l, m) {
|
|
8760
8760
|
const g = We(l, m), R = We(l, m);
|
|
8761
8761
|
return [g, R];
|
|
8762
8762
|
}
|
|
8763
|
-
function
|
|
8763
|
+
function Da(l, m) {
|
|
8764
8764
|
const g = We(l, m), R = We(l, m), L = We(l, m);
|
|
8765
8765
|
return [g, R, L];
|
|
8766
8766
|
}
|
|
8767
|
-
function
|
|
8767
|
+
function Na(l, m, g, R, L) {
|
|
8768
8768
|
if (R === "string" || R === "stringvector" || R === "iccProfile")
|
|
8769
|
-
return
|
|
8769
|
+
return _a(m, g, L);
|
|
8770
8770
|
if (R === "chlist")
|
|
8771
|
-
return
|
|
8771
|
+
return va(l, m, g, L);
|
|
8772
8772
|
if (R === "chromaticities")
|
|
8773
|
-
return va(l, g);
|
|
8774
|
-
if (R === "compression")
|
|
8775
8773
|
return Ra(l, g);
|
|
8776
|
-
if (R === "
|
|
8774
|
+
if (R === "compression")
|
|
8777
8775
|
return Ma(l, g);
|
|
8776
|
+
if (R === "box2i")
|
|
8777
|
+
return Ia(l, g);
|
|
8778
8778
|
if (R === "envmap")
|
|
8779
|
-
return Ca(l, g);
|
|
8780
|
-
if (R === "tiledesc")
|
|
8781
8779
|
return Pa(l, g);
|
|
8780
|
+
if (R === "tiledesc")
|
|
8781
|
+
return La(l, g);
|
|
8782
8782
|
if (R === "lineOrder")
|
|
8783
|
-
return
|
|
8783
|
+
return Ca(l, g);
|
|
8784
8784
|
if (R === "float")
|
|
8785
8785
|
return We(l, g);
|
|
8786
8786
|
if (R === "v2f")
|
|
8787
|
-
return La(l, g);
|
|
8788
|
-
if (R === "v3f")
|
|
8789
8787
|
return Oa(l, g);
|
|
8788
|
+
if (R === "v3f")
|
|
8789
|
+
return Da(l, g);
|
|
8790
8790
|
if (R === "int")
|
|
8791
8791
|
return et(l, g);
|
|
8792
8792
|
if (R === "rational")
|
|
8793
|
-
return _a(l, g);
|
|
8794
|
-
if (R === "timecode")
|
|
8795
8793
|
return Sa(l, g);
|
|
8794
|
+
if (R === "timecode")
|
|
8795
|
+
return ba(l, g);
|
|
8796
8796
|
if (R === "preview" || R === "deepImageState" || R === "idmanifest")
|
|
8797
8797
|
return g.value += L, "skipped";
|
|
8798
8798
|
g.value += L;
|
|
8799
8799
|
}
|
|
8800
|
-
function
|
|
8800
|
+
function ka(l, m) {
|
|
8801
8801
|
const g = Math.log2(l);
|
|
8802
8802
|
return m == "ROUND_DOWN" ? Math.floor(g) : Math.ceil(g);
|
|
8803
8803
|
}
|
|
8804
|
-
function
|
|
8804
|
+
function Fa(l, m, g) {
|
|
8805
8805
|
let R = 0;
|
|
8806
8806
|
switch (l.levelMode) {
|
|
8807
8807
|
case "ONE_LEVEL":
|
|
8808
8808
|
R = 1;
|
|
8809
8809
|
break;
|
|
8810
8810
|
case "MIPMAP_LEVELS":
|
|
8811
|
-
R =
|
|
8811
|
+
R = ka(Math.max(m, g), l.roundingMode) + 1;
|
|
8812
8812
|
break;
|
|
8813
8813
|
case "RIPMAP_LEVELS":
|
|
8814
8814
|
throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.");
|
|
@@ -8826,7 +8826,7 @@ class uu extends Co {
|
|
|
8826
8826
|
}
|
|
8827
8827
|
return L;
|
|
8828
8828
|
}
|
|
8829
|
-
function
|
|
8829
|
+
function za() {
|
|
8830
8830
|
const l = this, m = l.offset, g = { value: 0 };
|
|
8831
8831
|
for (let R = 0; R < l.tileCount; R++) {
|
|
8832
8832
|
const L = et(l.viewer, m), F = et(l.viewer, m);
|
|
@@ -8850,7 +8850,7 @@ class uu extends Co {
|
|
|
8850
8850
|
}
|
|
8851
8851
|
}
|
|
8852
8852
|
}
|
|
8853
|
-
function
|
|
8853
|
+
function Ba() {
|
|
8854
8854
|
const l = this, m = l.offset, g = { value: 0 };
|
|
8855
8855
|
for (let R = 0; R < l.height / l.blockHeight; R++) {
|
|
8856
8856
|
const L = et(l.viewer, m) - Ke.dataWindow.yMin;
|
|
@@ -8872,7 +8872,7 @@ class uu extends Co {
|
|
|
8872
8872
|
}
|
|
8873
8873
|
}
|
|
8874
8874
|
}
|
|
8875
|
-
function
|
|
8875
|
+
function Ua() {
|
|
8876
8876
|
const l = this, m = l.chunkOffsets, g = { value: 0 };
|
|
8877
8877
|
for (let R = 0; R < m.length; R++) {
|
|
8878
8878
|
const L = { value: m[R] };
|
|
@@ -8916,7 +8916,7 @@ class uu extends Co {
|
|
|
8916
8916
|
throw new Error("THREE.EXRLoader: " + R + " is unsupported for deep data");
|
|
8917
8917
|
}
|
|
8918
8918
|
}
|
|
8919
|
-
function
|
|
8919
|
+
function Ha() {
|
|
8920
8920
|
const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, F = Ke.compression, v = l.multiPart, U = l.decodeChannels, k = l.outputChannels, B = l.byteArray instanceof Uint16Array;
|
|
8921
8921
|
let j = -1;
|
|
8922
8922
|
for (let Z = 0; Z < L.length; Z++)
|
|
@@ -8979,12 +8979,12 @@ class uu extends Co {
|
|
|
8979
8979
|
const F = os(m, g);
|
|
8980
8980
|
if (F === "") break;
|
|
8981
8981
|
L = !0;
|
|
8982
|
-
const v = os(m, g), U = st(l, g), k =
|
|
8982
|
+
const v = os(m, g), U = st(l, g), k = Na(l, m, g, v, U);
|
|
8983
8983
|
k === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${v}'.`) : R[F] = k;
|
|
8984
8984
|
}
|
|
8985
8985
|
return L ? R : null;
|
|
8986
8986
|
}
|
|
8987
|
-
function
|
|
8987
|
+
function ja(l, m, g) {
|
|
8988
8988
|
if (l.getUint32(0, !0) != 20000630)
|
|
8989
8989
|
throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");
|
|
8990
8990
|
const R = l.getUint8(4), L = l.getUint8(5), F = {
|
|
@@ -9009,7 +9009,7 @@ class uu extends Co {
|
|
|
9009
9009
|
}
|
|
9010
9010
|
return v;
|
|
9011
9011
|
}
|
|
9012
|
-
function
|
|
9012
|
+
function Ga(l, m, g, R, L, F) {
|
|
9013
9013
|
const v = {
|
|
9014
9014
|
size: 0,
|
|
9015
9015
|
viewer: m,
|
|
@@ -9035,7 +9035,7 @@ class uu extends Co {
|
|
|
9035
9035
|
v.blockHeight = 1, v.uncompress = rs;
|
|
9036
9036
|
break;
|
|
9037
9037
|
case "RLE_COMPRESSION":
|
|
9038
|
-
v.blockHeight = 1, v.uncompress =
|
|
9038
|
+
v.blockHeight = 1, v.uncompress = ya;
|
|
9039
9039
|
break;
|
|
9040
9040
|
case "ZIPS_COMPRESSION":
|
|
9041
9041
|
v.blockHeight = 1, v.uncompress = Js;
|
|
@@ -9044,14 +9044,14 @@ class uu extends Co {
|
|
|
9044
9044
|
v.blockHeight = 16, v.uncompress = Js;
|
|
9045
9045
|
break;
|
|
9046
9046
|
case "PIZ_COMPRESSION":
|
|
9047
|
-
v.blockHeight = 32, v.uncompress =
|
|
9047
|
+
v.blockHeight = 32, v.uncompress = wa;
|
|
9048
9048
|
break;
|
|
9049
9049
|
case "PXR24_COMPRESSION":
|
|
9050
|
-
v.blockHeight = 16, v.uncompress =
|
|
9050
|
+
v.blockHeight = 16, v.uncompress = Ea;
|
|
9051
9051
|
break;
|
|
9052
9052
|
case "B44_COMPRESSION":
|
|
9053
9053
|
case "B44A_COMPRESSION":
|
|
9054
|
-
v.blockHeight = 32, v.uncompress =
|
|
9054
|
+
v.blockHeight = 32, v.uncompress = Ta;
|
|
9055
9055
|
break;
|
|
9056
9056
|
case "DWAA_COMPRESSION":
|
|
9057
9057
|
v.blockHeight = 32, v.uncompress = wr;
|
|
@@ -9097,7 +9097,7 @@ class uu extends Co {
|
|
|
9097
9097
|
if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 }, k = !0), v.type == 1)
|
|
9098
9098
|
switch (L) {
|
|
9099
9099
|
case Vn:
|
|
9100
|
-
v.getter =
|
|
9100
|
+
v.getter = Aa;
|
|
9101
9101
|
break;
|
|
9102
9102
|
case Vt:
|
|
9103
9103
|
v.getter = vn;
|
|
@@ -9109,7 +9109,7 @@ class uu extends Co {
|
|
|
9109
9109
|
v.getter = We;
|
|
9110
9110
|
break;
|
|
9111
9111
|
case Vt:
|
|
9112
|
-
v.getter =
|
|
9112
|
+
v.getter = xa;
|
|
9113
9113
|
}
|
|
9114
9114
|
else
|
|
9115
9115
|
throw new Error("THREE.EXRLoader: unsupported pixelType " + v.type + " for " + l.compression + ".");
|
|
@@ -9140,28 +9140,28 @@ class uu extends Co {
|
|
|
9140
9140
|
bytesPerSample: ee
|
|
9141
9141
|
}), V += ee;
|
|
9142
9142
|
}
|
|
9143
|
-
v.deepBytesPerSample = V, v.chunkOffsets = l._chunkOffsets, v.multiPart = l.spec.multiPart, v.decode =
|
|
9143
|
+
v.deepBytesPerSample = V, v.chunkOffsets = l._chunkOffsets, v.multiPart = l.spec.multiPart, v.decode = Ha.bind(v);
|
|
9144
9144
|
} else if (l.spec.singleTile) {
|
|
9145
9145
|
v.blockHeight = l.tiles.ySize, v.blockWidth = l.tiles.xSize;
|
|
9146
|
-
const V =
|
|
9146
|
+
const V = Fa(l.tiles, v.width, v.height), X = Tr(V, v.width, l.tiles.xSize, l.tiles.roundingMode), ee = Tr(V, v.height, l.tiles.ySize, l.tiles.roundingMode);
|
|
9147
9147
|
v.tileCount = X[0] * ee[0];
|
|
9148
9148
|
for (let K = 0; K < V; K++)
|
|
9149
9149
|
for (let Q = 0; Q < ee[K]; Q++)
|
|
9150
9150
|
for (let re = 0; re < X[K]; re++)
|
|
9151
9151
|
ke(m, R);
|
|
9152
|
-
v.decode =
|
|
9152
|
+
v.decode = za.bind(v);
|
|
9153
9153
|
} else if (l.spec.multiPart)
|
|
9154
|
-
v.blockWidth = v.width, v.chunkOffsets = l._chunkOffsets, v.decode =
|
|
9154
|
+
v.blockWidth = v.width, v.chunkOffsets = l._chunkOffsets, v.decode = Ua.bind(v);
|
|
9155
9155
|
else {
|
|
9156
9156
|
v.blockWidth = v.width;
|
|
9157
9157
|
const V = Math.ceil(v.height / v.blockHeight);
|
|
9158
9158
|
for (let X = 0; X < V; X++)
|
|
9159
9159
|
ke(m, R);
|
|
9160
|
-
v.decode =
|
|
9160
|
+
v.decode = Ba.bind(v);
|
|
9161
9161
|
}
|
|
9162
9162
|
return v;
|
|
9163
9163
|
}
|
|
9164
|
-
const as = { value: 0 }, cs = new DataView(e),
|
|
9164
|
+
const as = { value: 0 }, cs = new DataView(e), Va = new Uint8Array(e), ls = ja(cs, e, as), br = Math.max(0, Math.min(this.part, ls.length - 1)), Ke = ls[br];
|
|
9165
9165
|
if (Ke.spec.multiPart || Ke.spec.deepFormat)
|
|
9166
9166
|
for (let l = 0; l < ls.length; l++) {
|
|
9167
9167
|
const m = ls[l].chunkCount;
|
|
@@ -9173,7 +9173,7 @@ class uu extends Co {
|
|
|
9173
9173
|
for (let g = 0; g < m; g++)
|
|
9174
9174
|
ke(cs, as);
|
|
9175
9175
|
}
|
|
9176
|
-
const rt =
|
|
9176
|
+
const rt = Ga(Ke, cs, Va, as, this.type, this.outputFormat);
|
|
9177
9177
|
if (rt.decode(), rt.shouldExpand) {
|
|
9178
9178
|
const l = rt.byteArray;
|
|
9179
9179
|
if (this.outputFormat == Yt)
|
|
@@ -9238,7 +9238,7 @@ class uu extends Co {
|
|
|
9238
9238
|
return this.part = e, this;
|
|
9239
9239
|
}
|
|
9240
9240
|
}
|
|
9241
|
-
class
|
|
9241
|
+
class fu extends Co {
|
|
9242
9242
|
/**
|
|
9243
9243
|
* Constructs a new RGBE/HDR loader.
|
|
9244
9244
|
*
|
|
@@ -9393,15 +9393,15 @@ class du extends Co {
|
|
|
9393
9393
|
return this.type = e, this;
|
|
9394
9394
|
}
|
|
9395
9395
|
}
|
|
9396
|
-
class
|
|
9396
|
+
class pu extends fu {
|
|
9397
9397
|
constructor(e) {
|
|
9398
9398
|
console.warn("RGBELoader has been deprecated. Please use HDRLoader instead."), super(e);
|
|
9399
9399
|
}
|
|
9400
9400
|
}
|
|
9401
|
-
class
|
|
9401
|
+
class mu extends bc {
|
|
9402
9402
|
constructor() {
|
|
9403
9403
|
super(), this.name = "RoomEnvironment", this.position.y = -3.5;
|
|
9404
|
-
const e = new
|
|
9404
|
+
const e = new xc();
|
|
9405
9405
|
e.deleteAttribute("uv");
|
|
9406
9406
|
const t = new Hs({ side: wo }), n = new Hs(), s = new xo(16777215, 900, 28, 2);
|
|
9407
9407
|
s.position.set(0.418, 16.199, 0.3), this.add(s);
|
|
@@ -9436,13 +9436,13 @@ class pu extends Sc {
|
|
|
9436
9436
|
}
|
|
9437
9437
|
}
|
|
9438
9438
|
function yn(i) {
|
|
9439
|
-
return new
|
|
9439
|
+
return new Ac({
|
|
9440
9440
|
color: 0,
|
|
9441
9441
|
emissive: 16777215,
|
|
9442
9442
|
emissiveIntensity: i
|
|
9443
9443
|
});
|
|
9444
9444
|
}
|
|
9445
|
-
class
|
|
9445
|
+
class gu {
|
|
9446
9446
|
constructor() {
|
|
9447
9447
|
this.pmremGenerator = null, this.loadedTextures = /* @__PURE__ */ new Map(), this.renderTargets = [], this.disposed = !1;
|
|
9448
9448
|
}
|
|
@@ -9484,10 +9484,10 @@ class mu {
|
|
|
9484
9484
|
let r;
|
|
9485
9485
|
switch (s) {
|
|
9486
9486
|
case "hdr":
|
|
9487
|
-
r = new
|
|
9487
|
+
r = new pu();
|
|
9488
9488
|
break;
|
|
9489
9489
|
case "exr":
|
|
9490
|
-
r = new
|
|
9490
|
+
r = new du();
|
|
9491
9491
|
break;
|
|
9492
9492
|
case "jpg":
|
|
9493
9493
|
case "jpeg":
|
|
@@ -9599,7 +9599,7 @@ class mu {
|
|
|
9599
9599
|
Y.INITIALIZATION_FAILED
|
|
9600
9600
|
)
|
|
9601
9601
|
);
|
|
9602
|
-
const t = new
|
|
9602
|
+
const t = new mu(), n = this.pmremGenerator.fromScene(t);
|
|
9603
9603
|
this.renderTargets.push(n);
|
|
9604
9604
|
const s = n.texture;
|
|
9605
9605
|
return t.dispose(), z.ok(new wn(s));
|
|
@@ -9640,7 +9640,7 @@ class wn {
|
|
|
9640
9640
|
return this.texture;
|
|
9641
9641
|
}
|
|
9642
9642
|
}
|
|
9643
|
-
class
|
|
9643
|
+
class yu {
|
|
9644
9644
|
constructor(e) {
|
|
9645
9645
|
this.object = e, this.boundingBox = new T.Box3().setFromObject(this.object);
|
|
9646
9646
|
}
|
|
@@ -9656,11 +9656,11 @@ class gu {
|
|
|
9656
9656
|
this.object.position.add(e);
|
|
9657
9657
|
}
|
|
9658
9658
|
}
|
|
9659
|
-
class
|
|
9659
|
+
class wu {
|
|
9660
9660
|
alignToFloor(e) {
|
|
9661
9661
|
try {
|
|
9662
9662
|
let t = null;
|
|
9663
|
-
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof T.Object3D && (t = e), t ? (new
|
|
9663
|
+
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof T.Object3D && (t = e), t ? (new yu(t).alignToFloor(), z.ok(void 0)) : z.err(
|
|
9664
9664
|
new W(
|
|
9665
9665
|
"Could not get Three.js object for floor alignment",
|
|
9666
9666
|
Y.INVALID_PARAMETER
|
|
@@ -9678,7 +9678,7 @@ class yu {
|
|
|
9678
9678
|
}
|
|
9679
9679
|
}
|
|
9680
9680
|
const lo = { touch: 10, default: 5 };
|
|
9681
|
-
class
|
|
9681
|
+
class Eu {
|
|
9682
9682
|
constructor() {
|
|
9683
9683
|
this.raycaster = new T.Raycaster(), this.activePointers = /* @__PURE__ */ new Set(), this.options = null, this.pending = null, this.detach = null;
|
|
9684
9684
|
}
|
|
@@ -9744,8 +9744,8 @@ class wu {
|
|
|
9744
9744
|
(e = this.detach) == null || e.call(this), this.detach = null, this.options = null, this.pending = null, this.activePointers.clear();
|
|
9745
9745
|
}
|
|
9746
9746
|
}
|
|
9747
|
-
const
|
|
9748
|
-
class
|
|
9747
|
+
const Tu = 1e-3, ho = { visible: !1 };
|
|
9748
|
+
class _u {
|
|
9749
9749
|
constructor(e) {
|
|
9750
9750
|
this.sources = e, this.anchor = new T.Vector3(), this.projected = new T.Vector3(), this.cameraPosition = new T.Vector3(), this.toAnchor = new T.Vector3(), this.raycaster = new T.Raycaster(), this.lastCameraMatrix = new T.Matrix4(), this.lastWidth = -1, this.lastHeight = -1, this.hasProjected = !1;
|
|
9751
9751
|
}
|
|
@@ -9771,15 +9771,15 @@ class Tu {
|
|
|
9771
9771
|
const n = this.toAnchor.length();
|
|
9772
9772
|
this.raycaster.set(this.cameraPosition, this.toAnchor.normalize()), this.raycaster.camera = e, this.raycaster.firstHitOnly = !0;
|
|
9773
9773
|
const s = this.raycaster.intersectObject(t, !0)[0];
|
|
9774
|
-
return !!(s && s.distance < n -
|
|
9774
|
+
return !!(s && s.distance < n - Tu);
|
|
9775
9775
|
}
|
|
9776
9776
|
}
|
|
9777
|
-
class
|
|
9777
|
+
class Su {
|
|
9778
9778
|
createProjector(e) {
|
|
9779
|
-
return new
|
|
9779
|
+
return new _u(e);
|
|
9780
9780
|
}
|
|
9781
9781
|
}
|
|
9782
|
-
class
|
|
9782
|
+
class bu {
|
|
9783
9783
|
constructor() {
|
|
9784
9784
|
this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1, this.speed = 1;
|
|
9785
9785
|
}
|
|
@@ -9788,7 +9788,7 @@ class Su {
|
|
|
9788
9788
|
const t = en(e);
|
|
9789
9789
|
if (!t)
|
|
9790
9790
|
return;
|
|
9791
|
-
const n =
|
|
9791
|
+
const n = xu(t);
|
|
9792
9792
|
n && (this.clips = n.animations, this.mixer = new T.AnimationMixer(n), this.mixer.timeScale = this.speed);
|
|
9793
9793
|
}
|
|
9794
9794
|
getClipNames() {
|
|
@@ -9826,7 +9826,7 @@ class Su {
|
|
|
9826
9826
|
this.mixer && (this.mixer.stopAllAction(), this.mixer.uncacheRoot(this.mixer.getRoot())), this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1;
|
|
9827
9827
|
}
|
|
9828
9828
|
}
|
|
9829
|
-
function
|
|
9829
|
+
function xu(i) {
|
|
9830
9830
|
let e = null;
|
|
9831
9831
|
return i.traverse((t) => {
|
|
9832
9832
|
var n;
|
|
@@ -9834,7 +9834,7 @@ function bu(i) {
|
|
|
9834
9834
|
}), e;
|
|
9835
9835
|
}
|
|
9836
9836
|
var Ks = /* @__PURE__ */ ((i) => (i.MapControls = "MapControls", i.OrbitControls = "OrbitControls", i))(Ks || {});
|
|
9837
|
-
class
|
|
9837
|
+
class Au {
|
|
9838
9838
|
static convertRendererOptions(e) {
|
|
9839
9839
|
const t = {
|
|
9840
9840
|
antialias: e.antialias,
|
|
@@ -9872,25 +9872,25 @@ class xu {
|
|
|
9872
9872
|
return typeof e == "string" ? e : "aces";
|
|
9873
9873
|
}
|
|
9874
9874
|
}
|
|
9875
|
-
class
|
|
9875
|
+
class vu {
|
|
9876
9876
|
/**
|
|
9877
9877
|
* Create a ViewerCore instance with Three.js implementations
|
|
9878
9878
|
*/
|
|
9879
9879
|
static createViewer(e, t) {
|
|
9880
9880
|
var E, b, _;
|
|
9881
9881
|
Po(t.units);
|
|
9882
|
-
const n = new
|
|
9882
|
+
const n = new jl(e), s = new Lt(), r = this.createCamera(t), o = this.createControls(
|
|
9883
9883
|
r.getThreeCamera(),
|
|
9884
9884
|
e,
|
|
9885
9885
|
t
|
|
9886
|
-
), a = new
|
|
9886
|
+
), a = new Ru().createDefaultLoader({
|
|
9887
9887
|
renderer: n.getThreeRenderer() ?? void 0,
|
|
9888
9888
|
bvh: (E = t.selection) == null ? void 0 : E.bvh,
|
|
9889
9889
|
...t.loaders
|
|
9890
|
-
}), c = new
|
|
9890
|
+
}), c = new Yh(), d = new gu();
|
|
9891
9891
|
let u;
|
|
9892
|
-
(((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (u = new
|
|
9893
|
-
const f = new
|
|
9892
|
+
(((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (u = new qh());
|
|
9893
|
+
const f = new wu(), p = new Eu(), y = new Su(), S = new bu(), w = Au.convertRendererOptions(
|
|
9894
9894
|
t.renderer || {}
|
|
9895
9895
|
);
|
|
9896
9896
|
(t.replaceWithScreenshotOnComplete || (_ = t.pathTracing) != null && _.enabled) && (w.preserveDrawingBuffer = !0);
|
|
@@ -9910,7 +9910,7 @@ class Au {
|
|
|
9910
9910
|
anchorProjectionService: y,
|
|
9911
9911
|
animationService: S
|
|
9912
9912
|
};
|
|
9913
|
-
return new
|
|
9913
|
+
return new Fc(x);
|
|
9914
9914
|
}
|
|
9915
9915
|
static createCamera(e) {
|
|
9916
9916
|
const n = e.camera || {}, s = n.fov || n.cameraFov || 75, r = n.near || n.cameraNear || 0.1, o = n.far || n.cameraFar || 1e5, a = n.position || n.cameraPosition, c = n.target || n.cameraTarget, d = lr.create(
|
|
@@ -9944,18 +9944,18 @@ class Au {
|
|
|
9944
9944
|
static createControls(e, t, n) {
|
|
9945
9945
|
const s = n.controls || {}, r = s.type || Ks.OrbitControls;
|
|
9946
9946
|
let o;
|
|
9947
|
-
r === Ks.MapControls ? o = new
|
|
9947
|
+
r === Ks.MapControls ? o = new Gh(e, t) : o = new jh(e, t), o.enabled = s.enabled ?? !0, o.enableDamping = s.enableDamping ?? !0, o.dampingFactor = s.dampingFactor ?? 0.25, o.enableZoom = s.enableZoom ?? !0, o.enableRotate = s.enableRotate ?? !0, o.enablePan = s.enablePan ?? !0, o.autoRotate = s.autoRotate ?? !1, s.autoRotateSpeed !== void 0 && (o.autoRotateSpeed = s.autoRotateSpeed), s.minDistance !== void 0 && (o.minDistance = s.minDistance), s.maxDistance !== void 0 && (o.maxDistance = s.maxDistance), s.minPolarAngle !== void 0 && (o.minPolarAngle = s.minPolarAngle), s.maxPolarAngle !== void 0 && (o.maxPolarAngle = s.maxPolarAngle);
|
|
9948
9948
|
const c = n.camera || {}, d = c.target || c.cameraTarget;
|
|
9949
9949
|
return d && o.target && (o.target.set(d[0], d[1], d[2]), o.update()), o;
|
|
9950
9950
|
}
|
|
9951
9951
|
}
|
|
9952
|
-
class
|
|
9952
|
+
class Ru extends io {
|
|
9953
9953
|
createDefaultLoader(e = {}) {
|
|
9954
9954
|
return io.createLoader("model.glb", e);
|
|
9955
9955
|
}
|
|
9956
9956
|
}
|
|
9957
|
-
const
|
|
9958
|
-
function
|
|
9957
|
+
const Mu = ["toneMappingExposure"], Iu = ["environmentIntensity"], Cu = ["autoRotate", "autoRotateSpeed"];
|
|
9958
|
+
function na(i) {
|
|
9959
9959
|
var t, n, s, r, o, a, c, d, u, h;
|
|
9960
9960
|
const e = {
|
|
9961
9961
|
backgroundColor: i.backgroundColor
|
|
@@ -10109,7 +10109,7 @@ const Wi = {
|
|
|
10109
10109
|
studioEnvironment: !0,
|
|
10110
10110
|
darkStudioMode: !1
|
|
10111
10111
|
}
|
|
10112
|
-
},
|
|
10112
|
+
}, sa = {
|
|
10113
10113
|
studio: {
|
|
10114
10114
|
backgroundColor: "#f0f0f7",
|
|
10115
10115
|
renderer: { toneMappingExposure: 1.1 },
|
|
@@ -10136,11 +10136,11 @@ const Wi = {
|
|
|
10136
10136
|
environment: { environmentIntensity: 0.85 }
|
|
10137
10137
|
}
|
|
10138
10138
|
};
|
|
10139
|
-
function
|
|
10140
|
-
return i ?
|
|
10139
|
+
function Pu(i) {
|
|
10140
|
+
return i ? sa[i] : {};
|
|
10141
10141
|
}
|
|
10142
10142
|
function Ki(i, e) {
|
|
10143
|
-
return Gs(Gs(i,
|
|
10143
|
+
return Gs(Gs(i, Pu(e.preset)), e);
|
|
10144
10144
|
}
|
|
10145
10145
|
const _i = (i, ...e) => {
|
|
10146
10146
|
if (!i)
|
|
@@ -10150,7 +10150,7 @@ const _i = (i, ...e) => {
|
|
|
10150
10150
|
delete t[n];
|
|
10151
10151
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
10152
10152
|
};
|
|
10153
|
-
function
|
|
10153
|
+
function Lu(i) {
|
|
10154
10154
|
const e = Dt(
|
|
10155
10155
|
() => {
|
|
10156
10156
|
var s;
|
|
@@ -10160,12 +10160,12 @@ function Pu(i) {
|
|
|
10160
10160
|
// renderer/environment minus their runtime-tunable fields: a direct
|
|
10161
10161
|
// toneMappingExposure / environmentIntensity change is exactly what
|
|
10162
10162
|
// the live updateOptions path exists for and must not rebuild.
|
|
10163
|
-
renderer: _i(i.renderer, ...
|
|
10163
|
+
renderer: _i(i.renderer, ...Mu),
|
|
10164
10164
|
camera: i.camera,
|
|
10165
10165
|
// The turntable fields toggle live (updateOptions), like the look
|
|
10166
10166
|
// fields — flipping auto-rotate must not reload the model.
|
|
10167
|
-
controls: _i(i.controls, ...
|
|
10168
|
-
environment: _i(i.environment, ...
|
|
10167
|
+
controls: _i(i.controls, ...Cu),
|
|
10168
|
+
environment: _i(i.environment, ...Iu),
|
|
10169
10169
|
lighting: i.lighting,
|
|
10170
10170
|
helpers: i.helpers,
|
|
10171
10171
|
rendering: i.rendering,
|
|
@@ -10198,12 +10198,12 @@ function Pu(i) {
|
|
|
10198
10198
|
]
|
|
10199
10199
|
), t = Dt(() => {
|
|
10200
10200
|
const s = Ki(Wi, i);
|
|
10201
|
-
return JSON.stringify(
|
|
10201
|
+
return JSON.stringify(na(s));
|
|
10202
10202
|
}, [i.preset, i.backgroundColor, i.renderer, i.environment, i.controls, i.animations]);
|
|
10203
10203
|
return { options: Dt(() => i, [e, t]), structuralKey: e, runtimeKey: t };
|
|
10204
10204
|
}
|
|
10205
|
-
function
|
|
10206
|
-
const t = Ge(null), [n, s] = Xn(!1), [r, o] = Xn(null), { options: a, structuralKey: c, runtimeKey: d } =
|
|
10205
|
+
function Ou(i, e) {
|
|
10206
|
+
const t = Ge(null), [n, s] = Xn(!1), [r, o] = Xn(null), { options: a, structuralKey: c, runtimeKey: d } = Lu(e);
|
|
10207
10207
|
ht(() => {
|
|
10208
10208
|
if (!i.current || t.current)
|
|
10209
10209
|
return;
|
|
@@ -10211,7 +10211,7 @@ function Lu(i, e) {
|
|
|
10211
10211
|
const h = Ki(Wi, a);
|
|
10212
10212
|
let f;
|
|
10213
10213
|
try {
|
|
10214
|
-
f =
|
|
10214
|
+
f = vu.createViewer(i.current, h);
|
|
10215
10215
|
} catch (y) {
|
|
10216
10216
|
console.error("Failed to create viewer:", y), o(y instanceof Error ? y : new Error(String(y)));
|
|
10217
10217
|
return;
|
|
@@ -10227,7 +10227,7 @@ function Lu(i, e) {
|
|
|
10227
10227
|
if (!t.current || !n)
|
|
10228
10228
|
return;
|
|
10229
10229
|
const h = Ki(Wi, a);
|
|
10230
|
-
t.current.updateOptions(
|
|
10230
|
+
t.current.updateOptions(na(h));
|
|
10231
10231
|
}, [d, n]);
|
|
10232
10232
|
const u = Ge({ width: 0, height: 0 });
|
|
10233
10233
|
return ht(() => {
|
|
@@ -10263,7 +10263,7 @@ function Lu(i, e) {
|
|
|
10263
10263
|
initError: r
|
|
10264
10264
|
};
|
|
10265
10265
|
}
|
|
10266
|
-
function
|
|
10266
|
+
function ia(i, e) {
|
|
10267
10267
|
const t = Ge(e);
|
|
10268
10268
|
t.current = e, ht(() => {
|
|
10269
10269
|
if (!i)
|
|
@@ -10282,7 +10282,7 @@ function sa(i, e) {
|
|
|
10282
10282
|
};
|
|
10283
10283
|
}, [i]);
|
|
10284
10284
|
}
|
|
10285
|
-
function
|
|
10285
|
+
function Du(i, e) {
|
|
10286
10286
|
const [t, n] = Xn(null), s = Ge(/* @__PURE__ */ new Set());
|
|
10287
10287
|
ht(() => {
|
|
10288
10288
|
if (i !== void 0 && s.current.has(i)) {
|
|
@@ -10307,7 +10307,7 @@ function Ou(i, e) {
|
|
|
10307
10307
|
selectPreset: a
|
|
10308
10308
|
};
|
|
10309
10309
|
}
|
|
10310
|
-
function
|
|
10310
|
+
function Nu(i, e, t, n, s) {
|
|
10311
10311
|
return Dt(() => {
|
|
10312
10312
|
var d, u, h;
|
|
10313
10313
|
const r = i.preset !== e, o = t === !0 && ((d = i.pathTracing) == null ? void 0 : d.enabled) === void 0, a = n !== void 0 && ((u = i.controls) == null ? void 0 : u.autoRotate) === void 0, c = s !== void 0 && ((h = i.animations) == null ? void 0 : h.autoplay) === void 0;
|
|
@@ -10320,7 +10320,7 @@ function Du(i, e, t, n, s) {
|
|
|
10320
10320
|
};
|
|
10321
10321
|
}, [i, e, t, n, s]);
|
|
10322
10322
|
}
|
|
10323
|
-
function
|
|
10323
|
+
function ku(i, e, t) {
|
|
10324
10324
|
const n = Dt(() => {
|
|
10325
10325
|
if (typeof t == "string")
|
|
10326
10326
|
return t;
|
|
@@ -10412,7 +10412,7 @@ class Si {
|
|
|
10412
10412
|
};
|
|
10413
10413
|
}
|
|
10414
10414
|
}
|
|
10415
|
-
function
|
|
10415
|
+
function Fu(i) {
|
|
10416
10416
|
const e = Ge(new nr()), t = Dt(
|
|
10417
10417
|
() => ({
|
|
10418
10418
|
"model:loading": (n) => e.current.emit("model:loading", n),
|
|
@@ -10427,9 +10427,9 @@ function ku(i) {
|
|
|
10427
10427
|
[]
|
|
10428
10428
|
// eventsRef is stable
|
|
10429
10429
|
);
|
|
10430
|
-
return
|
|
10430
|
+
return ia(i, t), e.current;
|
|
10431
10431
|
}
|
|
10432
|
-
function
|
|
10432
|
+
function zu(i, e, t) {
|
|
10433
10433
|
const n = Ge(t);
|
|
10434
10434
|
n.current = t;
|
|
10435
10435
|
const s = Dt(
|
|
@@ -10453,7 +10453,7 @@ function Fu(i, e, t) {
|
|
|
10453
10453
|
[]
|
|
10454
10454
|
// callbacksRef is stable
|
|
10455
10455
|
);
|
|
10456
|
-
|
|
10456
|
+
ia(i, s);
|
|
10457
10457
|
const r = Ge(null);
|
|
10458
10458
|
ht(() => {
|
|
10459
10459
|
if (!e) {
|
|
@@ -10464,19 +10464,19 @@ function Fu(i, e, t) {
|
|
|
10464
10464
|
o && r.current !== e && (r.current = e, o(e));
|
|
10465
10465
|
});
|
|
10466
10466
|
}
|
|
10467
|
-
const
|
|
10468
|
-
function
|
|
10467
|
+
const ra = Za(null);
|
|
10468
|
+
function Bu({ viewer: i, canvasRef: e, children: t }) {
|
|
10469
10469
|
const n = Dt(() => ({ viewer: i, canvasRef: e }), [i, e]);
|
|
10470
|
-
return /* @__PURE__ */ Te(
|
|
10470
|
+
return /* @__PURE__ */ Te(ra.Provider, { value: n, children: t });
|
|
10471
10471
|
}
|
|
10472
|
-
function
|
|
10473
|
-
const i =
|
|
10472
|
+
function oa() {
|
|
10473
|
+
const i = Wa(ra);
|
|
10474
10474
|
if (!i)
|
|
10475
10475
|
throw new Error("useViewerContext must be used within ViewerProvider");
|
|
10476
10476
|
return i;
|
|
10477
10477
|
}
|
|
10478
|
-
function
|
|
10479
|
-
const { canvasRef: i } =
|
|
10478
|
+
function Uu() {
|
|
10479
|
+
const { canvasRef: i } = oa();
|
|
10480
10480
|
return /* @__PURE__ */ Te(
|
|
10481
10481
|
"canvas",
|
|
10482
10482
|
{
|
|
@@ -10503,13 +10503,13 @@ function Bu() {
|
|
|
10503
10503
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
10504
10504
|
}
|
|
10505
10505
|
})();
|
|
10506
|
-
const
|
|
10506
|
+
const Hu = (i, e, t, n, s, r) => {
|
|
10507
10507
|
const o = performance.now(), a = () => {
|
|
10508
10508
|
const c = performance.now() - o, d = Math.min(c / s, 1);
|
|
10509
10509
|
i.position.lerpVectors(t, n, d), e == null || e.update(), r(), d < 1 && requestAnimationFrame(a);
|
|
10510
10510
|
};
|
|
10511
10511
|
requestAnimationFrame(a);
|
|
10512
|
-
}, uo = { type: "change" }, dr = { type: "start" },
|
|
10512
|
+
}, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), ju = Math.cos(70 * tr.DEG2RAD), Pe = new q(), nt = 2 * Math.PI, Ee = {
|
|
10513
10513
|
NONE: -1,
|
|
10514
10514
|
ROTATE: 0,
|
|
10515
10515
|
DOLLY: 1,
|
|
@@ -10519,7 +10519,7 @@ const Uu = (i, e, t, n, s, r) => {
|
|
|
10519
10519
|
TOUCH_DOLLY_PAN: 5,
|
|
10520
10520
|
TOUCH_DOLLY_ROTATE: 6
|
|
10521
10521
|
}, bi = 1e-6;
|
|
10522
|
-
class
|
|
10522
|
+
class ca extends Io {
|
|
10523
10523
|
/**
|
|
10524
10524
|
* Constructs a new controls instance.
|
|
10525
10525
|
*
|
|
@@ -10527,7 +10527,7 @@ class aa extends Io {
|
|
|
10527
10527
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
10528
10528
|
*/
|
|
10529
10529
|
constructor(e, t = null) {
|
|
10530
|
-
super(e, t), this.state = Ee.NONE, this.target = new q(), this.cursor = new q(), 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 q(), this._lastQuaternion = new xn(), this._lastTargetPosition = new q(), this._quat = new xn().setFromUnitVectors(e.up, new q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new q(), 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 q(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
10530
|
+
super(e, t), this.state = Ee.NONE, this.target = new q(), this.cursor = new q(), 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 q(), this._lastQuaternion = new xn(), this._lastTargetPosition = new q(), this._quat = new xn().setFromUnitVectors(e.up, new q(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new q(), 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 q(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Vu.bind(this), this._onPointerDown = Gu.bind(this), this._onPointerUp = Zu.bind(this), this._onContextMenu = Qu.bind(this), this._onMouseWheel = Xu.bind(this), this._onKeyDown = Yu.bind(this), this._onTouchStart = qu.bind(this), this._onTouchMove = $u.bind(this), this._onMouseDown = Wu.bind(this), this._onMouseMove = Ku.bind(this), this._interceptControlDown = Ju.bind(this), this._interceptControlUp = ed.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
10531
10531
|
}
|
|
10532
10532
|
connect(e) {
|
|
10533
10533
|
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";
|
|
@@ -10618,7 +10618,7 @@ class aa extends Io {
|
|
|
10618
10618
|
d.unproject(this.object), this.object.position.sub(d).add(a), this.object.updateMatrixWorld(), o = Pe.length();
|
|
10619
10619
|
} else
|
|
10620
10620
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
10621
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) <
|
|
10621
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < ju ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
|
|
10622
10622
|
} else if (this.object.isOrthographicCamera) {
|
|
10623
10623
|
const o = this.object.zoom;
|
|
10624
10624
|
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);
|
|
@@ -10815,16 +10815,16 @@ class aa extends Io {
|
|
|
10815
10815
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
10816
10816
|
}
|
|
10817
10817
|
}
|
|
10818
|
-
function
|
|
10818
|
+
function Gu(i) {
|
|
10819
10819
|
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)));
|
|
10820
10820
|
}
|
|
10821
|
-
function
|
|
10821
|
+
function Vu(i) {
|
|
10822
10822
|
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
10823
10823
|
}
|
|
10824
|
-
function
|
|
10824
|
+
function Zu(i) {
|
|
10825
10825
|
switch (this._removePointer(i), this._pointers.length) {
|
|
10826
10826
|
case 0:
|
|
10827
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
10827
|
+
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(aa), this.state = Ee.NONE;
|
|
10828
10828
|
break;
|
|
10829
10829
|
case 1:
|
|
10830
10830
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -10832,7 +10832,7 @@ function Vu(i) {
|
|
|
10832
10832
|
break;
|
|
10833
10833
|
}
|
|
10834
10834
|
}
|
|
10835
|
-
function
|
|
10835
|
+
function Wu(i) {
|
|
10836
10836
|
let e;
|
|
10837
10837
|
switch (i.button) {
|
|
10838
10838
|
case 0:
|
|
@@ -10875,7 +10875,7 @@ function Zu(i) {
|
|
|
10875
10875
|
}
|
|
10876
10876
|
this.state !== Ee.NONE && this.dispatchEvent(dr);
|
|
10877
10877
|
}
|
|
10878
|
-
function
|
|
10878
|
+
function Ku(i) {
|
|
10879
10879
|
switch (this.state) {
|
|
10880
10880
|
case Ee.ROTATE:
|
|
10881
10881
|
if (this.enableRotate === !1) return;
|
|
@@ -10891,13 +10891,13 @@ function Wu(i) {
|
|
|
10891
10891
|
break;
|
|
10892
10892
|
}
|
|
10893
10893
|
}
|
|
10894
|
-
function Ku(i) {
|
|
10895
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(dr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(oa));
|
|
10896
|
-
}
|
|
10897
10894
|
function Xu(i) {
|
|
10898
|
-
this.enabled
|
|
10895
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(dr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(aa));
|
|
10899
10896
|
}
|
|
10900
10897
|
function Yu(i) {
|
|
10898
|
+
this.enabled !== !1 && this._handleKeyDown(i);
|
|
10899
|
+
}
|
|
10900
|
+
function qu(i) {
|
|
10901
10901
|
switch (this._trackPointer(i), this._pointers.length) {
|
|
10902
10902
|
case 1:
|
|
10903
10903
|
switch (this.touches.ONE) {
|
|
@@ -10932,7 +10932,7 @@ function Yu(i) {
|
|
|
10932
10932
|
}
|
|
10933
10933
|
this.state !== Ee.NONE && this.dispatchEvent(dr);
|
|
10934
10934
|
}
|
|
10935
|
-
function
|
|
10935
|
+
function $u(i) {
|
|
10936
10936
|
switch (this._trackPointer(i), this.state) {
|
|
10937
10937
|
case Ee.TOUCH_ROTATE:
|
|
10938
10938
|
if (this.enableRotate === !1) return;
|
|
@@ -10954,16 +10954,16 @@ function qu(i) {
|
|
|
10954
10954
|
this.state = Ee.NONE;
|
|
10955
10955
|
}
|
|
10956
10956
|
}
|
|
10957
|
-
function
|
|
10957
|
+
function Qu(i) {
|
|
10958
10958
|
this.enabled !== !1 && i.preventDefault();
|
|
10959
10959
|
}
|
|
10960
|
-
function
|
|
10960
|
+
function Ju(i) {
|
|
10961
10961
|
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
10962
10962
|
}
|
|
10963
|
-
function
|
|
10963
|
+
function ed(i) {
|
|
10964
10964
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
10965
10965
|
}
|
|
10966
|
-
class
|
|
10966
|
+
class td extends ca {
|
|
10967
10967
|
constructor(e, t) {
|
|
10968
10968
|
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 };
|
|
10969
10969
|
}
|
|
@@ -10984,7 +10984,7 @@ const de = {
|
|
|
10984
10984
|
};
|
|
10985
10985
|
var Gt = /* @__PURE__ */ ((i) => (i.FRONT = "FRONT", i.BACK = "BACK", i.RIGHT = "RIGHT", i.LEFT = "LEFT", i.TOP = "TOP", i.BOTTOM = "BOTTOM", i))(Gt || {});
|
|
10986
10986
|
new T.Vector3(0, 1, 0);
|
|
10987
|
-
const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name",
|
|
10987
|
+
const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", nd = "gizmo-group-name", sd = [
|
|
10988
10988
|
Xs,
|
|
10989
10989
|
Xi
|
|
10990
10990
|
], Us = {
|
|
@@ -10992,7 +10992,7 @@ const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-
|
|
|
10992
10992
|
DEFAULT_UP: new T.Vector3(0, 1, 0),
|
|
10993
10993
|
FORWARD: new T.Vector3(0, 0, -1)
|
|
10994
10994
|
}, xi = (i) => Us.FORWARD.clone().applyQuaternion(i), po = (i, e, t = new T.Vector3()) => t.clone().add(i.multiplyScalar(-e));
|
|
10995
|
-
class
|
|
10995
|
+
class id {
|
|
10996
10996
|
constructor(e, t = $n) {
|
|
10997
10997
|
this.gizmoScene = e, this.gizmoArrowsName = t;
|
|
10998
10998
|
}
|
|
@@ -11007,7 +11007,7 @@ class sd {
|
|
|
11007
11007
|
}
|
|
11008
11008
|
syncMainWithGizmo(e, t, n) {
|
|
11009
11009
|
const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof T.PerspectiveCamera;
|
|
11010
|
-
n instanceof
|
|
11010
|
+
n instanceof td && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
|
|
11011
11011
|
}
|
|
11012
11012
|
syncMapControls(e, t, n, s) {
|
|
11013
11013
|
const r = e.position.y - n.y, o = xi(t.quaternion);
|
|
@@ -11022,8 +11022,8 @@ class sd {
|
|
|
11022
11022
|
e.position.copy(a), e.up.copy(o), e.camera.lookAt(n);
|
|
11023
11023
|
}
|
|
11024
11024
|
}
|
|
11025
|
-
const
|
|
11026
|
-
|
|
11025
|
+
const la = (i) => new id(i), mo = (i, e, t) => {
|
|
11026
|
+
la(t).syncGizmoWithMain(
|
|
11027
11027
|
{
|
|
11028
11028
|
camera: i,
|
|
11029
11029
|
position: i.position,
|
|
@@ -11037,8 +11037,8 @@ const ca = (i) => new sd(i), mo = (i, e, t) => {
|
|
|
11037
11037
|
up: e.up
|
|
11038
11038
|
}
|
|
11039
11039
|
);
|
|
11040
|
-
},
|
|
11041
|
-
|
|
11040
|
+
}, rd = (i, e, t) => {
|
|
11041
|
+
la(e.userData.scene).syncMainWithGizmo(
|
|
11042
11042
|
{
|
|
11043
11043
|
camera: i,
|
|
11044
11044
|
position: i.position,
|
|
@@ -11053,14 +11053,14 @@ const ca = (i) => new sd(i), mo = (i, e, t) => {
|
|
|
11053
11053
|
},
|
|
11054
11054
|
t
|
|
11055
11055
|
);
|
|
11056
|
-
},
|
|
11056
|
+
}, od = () => {
|
|
11057
11057
|
try {
|
|
11058
11058
|
const i = document.createElement("canvas");
|
|
11059
11059
|
return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")));
|
|
11060
11060
|
} catch {
|
|
11061
11061
|
return !1;
|
|
11062
11062
|
}
|
|
11063
|
-
},
|
|
11063
|
+
}, ad = () => od() ? new T.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), cd = (i) => {
|
|
11064
11064
|
const e = new T.AmbientLight(16777215, 1);
|
|
11065
11065
|
i.add(e);
|
|
11066
11066
|
const t = new T.DirectionalLight(16777215, 1);
|
|
@@ -11070,7 +11070,7 @@ const ca = (i) => new sd(i), mo = (i, e, t) => {
|
|
|
11070
11070
|
const s = new T.PointLight(16777215, 1, 100);
|
|
11071
11071
|
s.position.set(0, 0, 5), i.add(s), t.castShadow = !1, n.castShadow = !1, s.castShadow = !1;
|
|
11072
11072
|
};
|
|
11073
|
-
class
|
|
11073
|
+
class ld {
|
|
11074
11074
|
static createTextTexture(e) {
|
|
11075
11075
|
const t = document.createElement("canvas"), n = t.getContext("2d");
|
|
11076
11076
|
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));
|
|
@@ -11112,14 +11112,14 @@ class Ns {
|
|
|
11112
11112
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
|
|
11113
11113
|
de.CUBE_SIZE - de.EDGE_SECTION_SIZE
|
|
11114
11114
|
), d = new T.MeshStandardMaterial({
|
|
11115
|
-
map:
|
|
11115
|
+
map: ld.createTextTexture(n),
|
|
11116
11116
|
transparent: !0,
|
|
11117
11117
|
depthWrite: !1
|
|
11118
11118
|
}), u = new T.Mesh(c, d);
|
|
11119
11119
|
return u.position.set(0, 0, de.FACE_THICKNESS / 2 + 0.01), s.add(u), s.position.copy(e), s.rotation.copy(t), s;
|
|
11120
11120
|
}
|
|
11121
11121
|
}
|
|
11122
|
-
const
|
|
11122
|
+
const hd = (i, e) => {
|
|
11123
11123
|
const t = document.createElement("canvas");
|
|
11124
11124
|
t.width = 64, t.height = 64;
|
|
11125
11125
|
const n = t.getContext("2d");
|
|
@@ -11127,7 +11127,7 @@ const ld = (i, e) => {
|
|
|
11127
11127
|
const s = new T.CanvasTexture(t), r = new T.SpriteMaterial({ map: s }), o = new T.Sprite(r);
|
|
11128
11128
|
return o.scale.set(0.5, 0.5, 0.5), o;
|
|
11129
11129
|
};
|
|
11130
|
-
class
|
|
11130
|
+
class ud {
|
|
11131
11131
|
constructor(e) {
|
|
11132
11132
|
this.hoveredObject = null, this.originalColor = null, this.config = e;
|
|
11133
11133
|
}
|
|
@@ -11249,7 +11249,7 @@ class hd {
|
|
|
11249
11249
|
f.setRotationFromAxisAngle(y, S);
|
|
11250
11250
|
}
|
|
11251
11251
|
c.add(f);
|
|
11252
|
-
const p =
|
|
11252
|
+
const p = hd(a, t);
|
|
11253
11253
|
return p.position.copy(r).add(n.clone().multiplyScalar(s + 0.1)), c.add(p), c;
|
|
11254
11254
|
}
|
|
11255
11255
|
createCoordinateAxes() {
|
|
@@ -11292,7 +11292,7 @@ class hd {
|
|
|
11292
11292
|
}
|
|
11293
11293
|
create() {
|
|
11294
11294
|
const e = new T.Group();
|
|
11295
|
-
e.name =
|
|
11295
|
+
e.name = nd;
|
|
11296
11296
|
const t = this.createWireframe();
|
|
11297
11297
|
e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
|
|
11298
11298
|
const n = this.createCoordinateAxes();
|
|
@@ -11317,13 +11317,13 @@ class hd {
|
|
|
11317
11317
|
}
|
|
11318
11318
|
}
|
|
11319
11319
|
}
|
|
11320
|
-
class
|
|
11320
|
+
class dd {
|
|
11321
11321
|
constructor(e) {
|
|
11322
11322
|
this.onChangeMainControlsListener = () => {
|
|
11323
11323
|
}, this.onChangeGizmoControlsListener = () => {
|
|
11324
11324
|
}, this.animationId = 0;
|
|
11325
11325
|
const { gizmoParams: t, mainParams: n, syncFunctions: s, options: r } = e;
|
|
11326
|
-
this.gizmoDiv = t.gizmoDiv, this.gizmoScene = t.gizmoScene, this.gizmoRenderer = t.gizmoRenderer, this.gizmoCamera = t.gizmoCamera, this.mainCamera = n.mainCamera, this.mainControls = n.mainControls, this.renderGizmo = n.renderGizmo, this.syncFunctions = s, this.options = r, this.gizmoControls = new
|
|
11326
|
+
this.gizmoDiv = t.gizmoDiv, this.gizmoScene = t.gizmoScene, this.gizmoRenderer = t.gizmoRenderer, this.gizmoCamera = t.gizmoCamera, this.mainCamera = n.mainCamera, this.mainControls = n.mainControls, this.renderGizmo = n.renderGizmo, this.syncFunctions = s, this.options = r, this.gizmoControls = new ca(
|
|
11327
11327
|
this.gizmoCamera,
|
|
11328
11328
|
this.gizmoRenderer.domElement
|
|
11329
11329
|
), this.initializeRenderer(), this.initializeScene(), this.initializeControls(), this.startAnimationLoop();
|
|
@@ -11339,10 +11339,10 @@ class ud {
|
|
|
11339
11339
|
}
|
|
11340
11340
|
initializeScene() {
|
|
11341
11341
|
var e;
|
|
11342
|
-
const t = new
|
|
11342
|
+
const t = new ud({
|
|
11343
11343
|
initialFace: ((e = this.options) == null ? void 0 : e.initialFace) ?? Gt.FRONT
|
|
11344
11344
|
}).create();
|
|
11345
|
-
this.gizmoScene.add(t),
|
|
11345
|
+
this.gizmoScene.add(t), cd(this.gizmoScene);
|
|
11346
11346
|
}
|
|
11347
11347
|
initializeControls() {
|
|
11348
11348
|
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(
|
|
@@ -11382,7 +11382,7 @@ class ud {
|
|
|
11382
11382
|
), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
|
|
11383
11383
|
}
|
|
11384
11384
|
}
|
|
11385
|
-
const
|
|
11385
|
+
const fd = (i, e) => {
|
|
11386
11386
|
let t;
|
|
11387
11387
|
return function(...n) {
|
|
11388
11388
|
t || (i.apply(this, n), t = !0, setTimeout(() => t = !1, e));
|
|
@@ -11393,17 +11393,17 @@ function go(i, e, t) {
|
|
|
11393
11393
|
const n = e.domElement.getBoundingClientRect();
|
|
11394
11394
|
t.x = (i.clientX - n.left) / n.width * 2 - 1, t.y = -((i.clientY - n.top) / n.height) * 2 + 1;
|
|
11395
11395
|
}
|
|
11396
|
-
const
|
|
11396
|
+
const ha = (i, e, t, n) => (n.setFromCamera(i, e), n.intersectObjects(t.children, !0)), ua = (i) => {
|
|
11397
11397
|
var e;
|
|
11398
11398
|
const t = ["Wireframe", ""];
|
|
11399
11399
|
return ((e = i.find((n) => !t.includes(n.object.name))) == null ? void 0 : e.object) || null;
|
|
11400
11400
|
};
|
|
11401
|
-
function
|
|
11401
|
+
function pd(i, e, t, n) {
|
|
11402
11402
|
if (!e || !t) return null;
|
|
11403
|
-
const s =
|
|
11404
|
-
return
|
|
11403
|
+
const s = ha(i, e, t, n);
|
|
11404
|
+
return ua(s);
|
|
11405
11405
|
}
|
|
11406
|
-
function
|
|
11406
|
+
function md(i, e) {
|
|
11407
11407
|
const t = i == null ? void 0 : i.userData.gizmoCube;
|
|
11408
11408
|
if (i && t) {
|
|
11409
11409
|
t.handleClick();
|
|
@@ -11411,22 +11411,22 @@ function pd(i, e) {
|
|
|
11411
11411
|
n && e(n);
|
|
11412
11412
|
}
|
|
11413
11413
|
}
|
|
11414
|
-
const
|
|
11414
|
+
const gd = {
|
|
11415
11415
|
radius: 2.1,
|
|
11416
11416
|
color: 12369854,
|
|
11417
11417
|
tubeRadius: 0.1,
|
|
11418
11418
|
tubeSegments: 8,
|
|
11419
11419
|
numPoints: 64,
|
|
11420
11420
|
tubeOffset: 1.5
|
|
11421
|
-
},
|
|
11421
|
+
}, yd = {
|
|
11422
11422
|
size: 0.2,
|
|
11423
11423
|
depth: 0.1,
|
|
11424
11424
|
heightRatio: 1.4,
|
|
11425
11425
|
segments: 1
|
|
11426
11426
|
};
|
|
11427
|
-
class
|
|
11427
|
+
class wd {
|
|
11428
11428
|
constructor(e = {}) {
|
|
11429
|
-
this.config = { ...
|
|
11429
|
+
this.config = { ...gd, ...e }, this.material = new T.MeshBasicMaterial({ color: this.config.color });
|
|
11430
11430
|
}
|
|
11431
11431
|
create() {
|
|
11432
11432
|
const e = new T.Group(), t = this.createQuarterCircleCurves();
|
|
@@ -11467,7 +11467,7 @@ class yd {
|
|
|
11467
11467
|
];
|
|
11468
11468
|
}
|
|
11469
11469
|
createArrowHeads([e, t]) {
|
|
11470
|
-
const { size: n, depth: s, heightRatio: r, segments: o } =
|
|
11470
|
+
const { size: n, depth: s, heightRatio: r, segments: o } = yd, a = this.createArrowShape(n, r), c = new T.ExtrudeGeometry(a, {
|
|
11471
11471
|
steps: o,
|
|
11472
11472
|
depth: s,
|
|
11473
11473
|
bevelEnabled: !1
|
|
@@ -11495,11 +11495,11 @@ class yd {
|
|
|
11495
11495
|
return Math.atan2(e.y, e.x);
|
|
11496
11496
|
}
|
|
11497
11497
|
}
|
|
11498
|
-
const
|
|
11498
|
+
const Ed = (i) => {
|
|
11499
11499
|
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);
|
|
11500
11500
|
return !(o || a);
|
|
11501
|
-
},
|
|
11502
|
-
function
|
|
11501
|
+
}, Td = 25, _d = 200;
|
|
11502
|
+
function Sd({
|
|
11503
11503
|
gizmoRenderer: i,
|
|
11504
11504
|
gizmoScene: e,
|
|
11505
11505
|
gizmoCamera: t,
|
|
@@ -11507,31 +11507,31 @@ function _d({
|
|
|
11507
11507
|
gizmoControlRef: s
|
|
11508
11508
|
}) {
|
|
11509
11509
|
const r = Ge(null), o = Ge(null), a = Ge(new T.Raycaster()).current, c = Ge(new T.Vector2()).current, d = Rt(() => {
|
|
11510
|
-
const S = e.getObjectByName($n), w =
|
|
11510
|
+
const S = e.getObjectByName($n), w = Ed(t);
|
|
11511
11511
|
if (S && w) {
|
|
11512
11512
|
e.remove(S);
|
|
11513
11513
|
return;
|
|
11514
11514
|
}
|
|
11515
11515
|
if (S || w) return;
|
|
11516
|
-
const x = new
|
|
11516
|
+
const x = new wd().create();
|
|
11517
11517
|
x.rotation.copy(t.rotation), e.add(x);
|
|
11518
11518
|
}, [e, t]), u = Rt(() => {
|
|
11519
11519
|
const S = e.getObjectByName($n);
|
|
11520
11520
|
S && e.remove(S);
|
|
11521
11521
|
}, [e]), h = Rt(
|
|
11522
|
-
|
|
11522
|
+
fd((S) => {
|
|
11523
11523
|
if (!s.current || !i) return;
|
|
11524
11524
|
go(S, i, c);
|
|
11525
|
-
const w =
|
|
11525
|
+
const w = ha(
|
|
11526
11526
|
c,
|
|
11527
11527
|
t,
|
|
11528
11528
|
e,
|
|
11529
11529
|
a
|
|
11530
|
-
), x =
|
|
11530
|
+
), x = ua(w);
|
|
11531
11531
|
x != null && x.userData.gizmoCube ? x.userData.gizmoCube.highlightObject(x) : e.traverse((E) => {
|
|
11532
11532
|
E.userData.gizmoCube && E.userData.gizmoCube.highlightObject(null);
|
|
11533
11533
|
}), w.length > 0 ? d() : u();
|
|
11534
|
-
}, 1e3 /
|
|
11534
|
+
}, 1e3 / Td),
|
|
11535
11535
|
[
|
|
11536
11536
|
s,
|
|
11537
11537
|
i,
|
|
@@ -11553,15 +11553,15 @@ function _d({
|
|
|
11553
11553
|
[t, s]
|
|
11554
11554
|
), y = Rt(
|
|
11555
11555
|
(S) => {
|
|
11556
|
-
if ((r.current ? Date.now() - r.current : 0) <
|
|
11556
|
+
if ((r.current ? Date.now() - r.current : 0) < _d) {
|
|
11557
11557
|
go(S, i, c);
|
|
11558
|
-
const w =
|
|
11558
|
+
const w = pd(
|
|
11559
11559
|
c,
|
|
11560
11560
|
t,
|
|
11561
11561
|
e,
|
|
11562
11562
|
a
|
|
11563
11563
|
);
|
|
11564
|
-
w != null && w.name &&
|
|
11564
|
+
w != null && w.name && sd.includes(w.name) ? p(w) : md(w, n);
|
|
11565
11565
|
}
|
|
11566
11566
|
r.current = null, o.current = null;
|
|
11567
11567
|
},
|
|
@@ -11582,14 +11582,14 @@ function _d({
|
|
|
11582
11582
|
onMouseLeave: u
|
|
11583
11583
|
};
|
|
11584
11584
|
}
|
|
11585
|
-
const
|
|
11585
|
+
const bd = ({
|
|
11586
11586
|
camera: i,
|
|
11587
11587
|
controls: e,
|
|
11588
11588
|
className: t,
|
|
11589
11589
|
render: n,
|
|
11590
11590
|
options: s
|
|
11591
11591
|
}) => {
|
|
11592
|
-
const r = Ge(null), o = Ge(new T.Scene()).current, [a] = Xn(() =>
|
|
11592
|
+
const r = Ge(null), o = Ge(new T.Scene()).current, [a] = Xn(() => ad()), c = 30, d = 1, u = 0.1, h = 10, f = new T.PerspectiveCamera(
|
|
11593
11593
|
c,
|
|
11594
11594
|
d,
|
|
11595
11595
|
u,
|
|
@@ -11602,7 +11602,7 @@ const Sd = ({
|
|
|
11602
11602
|
const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, O = new T.Matrix4();
|
|
11603
11603
|
O.lookAt(I, new T.Vector3(0, 0, 0), new T.Vector3(0, 1, 0));
|
|
11604
11604
|
const C = new T.Quaternion();
|
|
11605
|
-
C.setFromRotationMatrix(O), i.quaternion.copy(C),
|
|
11605
|
+
C.setFromRotationMatrix(O), i.quaternion.copy(C), Hu(
|
|
11606
11606
|
i,
|
|
11607
11607
|
e,
|
|
11608
11608
|
i.position.clone(),
|
|
@@ -11612,7 +11612,7 @@ const Sd = ({
|
|
|
11612
11612
|
), i.up.set(0, 1, 0), i.lookAt(new T.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
|
|
11613
11613
|
},
|
|
11614
11614
|
[i, e, S, o]
|
|
11615
|
-
), { onMouseDown: x, onMouseMove: E, onMouseUp: b, onMouseLeave: _ } =
|
|
11615
|
+
), { onMouseDown: x, onMouseMove: E, onMouseUp: b, onMouseLeave: _ } = Sd({
|
|
11616
11616
|
gizmoRenderer: a,
|
|
11617
11617
|
gizmoScene: o,
|
|
11618
11618
|
gizmoCamera: p,
|
|
@@ -11634,9 +11634,9 @@ const Sd = ({
|
|
|
11634
11634
|
renderGizmo: S
|
|
11635
11635
|
}, M = {
|
|
11636
11636
|
syncGizmoCameraWithMain: mo,
|
|
11637
|
-
syncMainCameraWithGizmo:
|
|
11637
|
+
syncMainCameraWithGizmo: rd
|
|
11638
11638
|
};
|
|
11639
|
-
return y.current = new
|
|
11639
|
+
return y.current = new dd({
|
|
11640
11640
|
gizmoParams: P,
|
|
11641
11641
|
mainParams: I,
|
|
11642
11642
|
syncFunctions: M,
|
|
@@ -11653,12 +11653,12 @@ const Sd = ({
|
|
|
11653
11653
|
ref: r
|
|
11654
11654
|
}
|
|
11655
11655
|
);
|
|
11656
|
-
}, ks = 10,
|
|
11656
|
+
}, ks = 10, xd = (i) => ({
|
|
11657
11657
|
top: i.startsWith("top") ? ks : "auto",
|
|
11658
11658
|
bottom: i.startsWith("bottom") ? ks : "auto",
|
|
11659
11659
|
left: i.endsWith("left") ? ks : "auto",
|
|
11660
11660
|
right: i.endsWith("right") ? ks : "auto"
|
|
11661
|
-
}),
|
|
11661
|
+
}), Ad = ({
|
|
11662
11662
|
camera: i,
|
|
11663
11663
|
controls: e,
|
|
11664
11664
|
render: t,
|
|
@@ -11677,10 +11677,10 @@ const Sd = ({
|
|
|
11677
11677
|
width: s,
|
|
11678
11678
|
height: s,
|
|
11679
11679
|
zIndex: 1e3,
|
|
11680
|
-
...
|
|
11680
|
+
...xd(n)
|
|
11681
11681
|
},
|
|
11682
11682
|
children: /* @__PURE__ */ Te(
|
|
11683
|
-
|
|
11683
|
+
bd,
|
|
11684
11684
|
{
|
|
11685
11685
|
camera: i,
|
|
11686
11686
|
controls: r,
|
|
@@ -11690,7 +11690,7 @@ const Sd = ({
|
|
|
11690
11690
|
}
|
|
11691
11691
|
);
|
|
11692
11692
|
};
|
|
11693
|
-
class
|
|
11693
|
+
class vd extends Ka {
|
|
11694
11694
|
constructor(e) {
|
|
11695
11695
|
super(e), this.reset = () => {
|
|
11696
11696
|
this.setState({ hasError: !1, error: null });
|
|
@@ -11722,7 +11722,7 @@ class Ad extends Wa {
|
|
|
11722
11722
|
] }) }) : this.props.children;
|
|
11723
11723
|
}
|
|
11724
11724
|
}
|
|
11725
|
-
function
|
|
11725
|
+
function Rd({ status: i, label: e, color: t, backdrop: n }) {
|
|
11726
11726
|
const s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
11727
11727
|
return /* @__PURE__ */ Hn(
|
|
11728
11728
|
"div",
|
|
@@ -11772,14 +11772,14 @@ function vd({ status: i, label: e, color: t, backdrop: n }) {
|
|
|
11772
11772
|
}
|
|
11773
11773
|
);
|
|
11774
11774
|
}
|
|
11775
|
-
const
|
|
11775
|
+
const Md = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Id = {
|
|
11776
11776
|
background: "rgba(255,255,255,0.78)",
|
|
11777
11777
|
backdropFilter: "blur(16px)",
|
|
11778
11778
|
WebkitBackdropFilter: "blur(16px)",
|
|
11779
11779
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
11780
11780
|
boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
|
|
11781
|
-
},
|
|
11782
|
-
function
|
|
11781
|
+
}, Cd = Object.keys(sa);
|
|
11782
|
+
function Pd({ active: i, onSelect: e }) {
|
|
11783
11783
|
return /* @__PURE__ */ Te(
|
|
11784
11784
|
"div",
|
|
11785
11785
|
{
|
|
@@ -11800,9 +11800,9 @@ function Cd({ active: i, onSelect: e }) {
|
|
|
11800
11800
|
// instead of bleeding past the canvas edges.
|
|
11801
11801
|
maxWidth: "calc(100% - 16px)",
|
|
11802
11802
|
overflowX: "auto",
|
|
11803
|
-
...
|
|
11803
|
+
...Id
|
|
11804
11804
|
},
|
|
11805
|
-
children:
|
|
11805
|
+
children: Cd.map((t) => /* @__PURE__ */ Te(
|
|
11806
11806
|
"button",
|
|
11807
11807
|
{
|
|
11808
11808
|
type: "button",
|
|
@@ -11817,7 +11817,7 @@ function Cd({ active: i, onSelect: e }) {
|
|
|
11817
11817
|
border: t === i ? "1px solid #111318" : "1px solid transparent",
|
|
11818
11818
|
background: t === i ? "#111318" : "transparent",
|
|
11819
11819
|
color: t === i ? "#fff" : "#3f3f4a",
|
|
11820
|
-
fontFamily:
|
|
11820
|
+
fontFamily: Md,
|
|
11821
11821
|
fontSize: 13,
|
|
11822
11822
|
fontWeight: 500,
|
|
11823
11823
|
lineHeight: 1,
|
|
@@ -11842,7 +11842,7 @@ const Bn = {
|
|
|
11842
11842
|
// default light background (#f0f0f7) and dark studio mode.
|
|
11843
11843
|
backdrop: "rgba(15,16,20,0.6)"
|
|
11844
11844
|
};
|
|
11845
|
-
function
|
|
11845
|
+
function Ld(i) {
|
|
11846
11846
|
return i === void 0 || i === !0 ? Bn : i === !1 ? { ...Bn, enabled: !1 } : {
|
|
11847
11847
|
enabled: i.enabled ?? !0,
|
|
11848
11848
|
label: i.label ?? Bn.label,
|
|
@@ -11851,27 +11851,27 @@ function Pd(i) {
|
|
|
11851
11851
|
backdrop: i.backdrop ?? Bn.backdrop
|
|
11852
11852
|
};
|
|
11853
11853
|
}
|
|
11854
|
-
const Fs = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED),
|
|
11854
|
+
const Fs = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da = yo(
|
|
11855
11855
|
({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
|
|
11856
11856
|
var D, H;
|
|
11857
|
-
const c = Ge(null), d = e.preset ?? t, { activePreset: u, pickerEnabled: h, selectPreset: f } =
|
|
11857
|
+
const c = Ge(null), d = e.preset ?? t, { activePreset: u, pickerEnabled: h, selectPreset: f } = Du(
|
|
11858
11858
|
d,
|
|
11859
11859
|
e.ui
|
|
11860
|
-
), p =
|
|
11860
|
+
), p = Nu(
|
|
11861
11861
|
e,
|
|
11862
11862
|
u,
|
|
11863
11863
|
n,
|
|
11864
11864
|
s,
|
|
11865
11865
|
r
|
|
11866
|
-
), { viewer: y, isInitialized: S, initError: w } =
|
|
11867
|
-
|
|
11866
|
+
), { viewer: y, isInitialized: S, initError: w } = Ou(c, p), x = ku(y, S, i), E = Fu(y);
|
|
11867
|
+
zu(y, w, e);
|
|
11868
11868
|
const b = y ? es(y.getCamera()) : null, _ = y ? ur(y.getControls()) : null, A = y ? Xo(y.getRenderer()) : null, P = Rt(() => {
|
|
11869
11869
|
y == null || y.requestRender();
|
|
11870
11870
|
}, [y]), I = ((D = e.helpers) == null ? void 0 : D.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((H = e.helpers) == null ? void 0 : H.gizmo) == "object" ? e.helpers.gizmo : {}, O = Dt(
|
|
11871
|
-
() =>
|
|
11871
|
+
() => Ld(e.loadingIndicator),
|
|
11872
11872
|
[e.loadingIndicator]
|
|
11873
11873
|
), C = x.status === "error" || !!w, N = O.enabled && (x.status === "loading" || C);
|
|
11874
|
-
return
|
|
11874
|
+
return Xa(a, () => ({
|
|
11875
11875
|
scene: y ? ji(y.getScene()) : null,
|
|
11876
11876
|
camera: b,
|
|
11877
11877
|
renderer: A,
|
|
@@ -11912,10 +11912,10 @@ const Fs = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), ua =
|
|
|
11912
11912
|
dispose: () => {
|
|
11913
11913
|
y == null || y.dispose();
|
|
11914
11914
|
}
|
|
11915
|
-
}), [y, b, A, _, E]), /* @__PURE__ */ Te(
|
|
11916
|
-
/* @__PURE__ */ Te(
|
|
11915
|
+
}), [y, b, A, _, E]), /* @__PURE__ */ Te(vd, { children: /* @__PURE__ */ Te(Bu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ Hn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
11916
|
+
/* @__PURE__ */ Te(Uu, {}),
|
|
11917
11917
|
I && S && b && _ && /* @__PURE__ */ Te(
|
|
11918
|
-
|
|
11918
|
+
Ad,
|
|
11919
11919
|
{
|
|
11920
11920
|
camera: b,
|
|
11921
11921
|
controls: _,
|
|
@@ -11925,7 +11925,7 @@ const Fs = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), ua =
|
|
|
11925
11925
|
}
|
|
11926
11926
|
),
|
|
11927
11927
|
N && /* @__PURE__ */ Te(
|
|
11928
|
-
|
|
11928
|
+
Rd,
|
|
11929
11929
|
{
|
|
11930
11930
|
status: C ? "error" : "loading",
|
|
11931
11931
|
label: C ? O.errorLabel ?? (w == null ? void 0 : w.message) ?? x.error ?? "Failed to load model" : O.label,
|
|
@@ -11935,17 +11935,17 @@ const Fs = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), ua =
|
|
|
11935
11935
|
),
|
|
11936
11936
|
h && /* The defaults ARE the studio look (pinned by presets.test.ts),
|
|
11937
11937
|
so with no preset set the studio chip is the honest active one. */
|
|
11938
|
-
/* @__PURE__ */ Te(
|
|
11938
|
+
/* @__PURE__ */ Te(Pd, { active: u ?? "studio", onSelect: f }),
|
|
11939
11939
|
o
|
|
11940
11940
|
] }) }) });
|
|
11941
11941
|
}
|
|
11942
11942
|
);
|
|
11943
|
-
|
|
11944
|
-
const
|
|
11945
|
-
(i, e) => /* @__PURE__ */ Te(
|
|
11943
|
+
da.displayName = "SimpleViewer";
|
|
11944
|
+
const Od = yo(
|
|
11945
|
+
(i, e) => /* @__PURE__ */ Te(da, { ref: e, ...i })
|
|
11946
11946
|
);
|
|
11947
|
-
|
|
11948
|
-
const
|
|
11947
|
+
Od.displayName = "SimpleViewer";
|
|
11948
|
+
const Dd = () => /* @__PURE__ */ Te(
|
|
11949
11949
|
"span",
|
|
11950
11950
|
{
|
|
11951
11951
|
"aria-hidden": "true",
|
|
@@ -11960,8 +11960,8 @@ const Od = () => /* @__PURE__ */ Te(
|
|
|
11960
11960
|
}
|
|
11961
11961
|
}
|
|
11962
11962
|
);
|
|
11963
|
-
function
|
|
11964
|
-
const { viewer: n } =
|
|
11963
|
+
function Hd({ position: i, occlude: e = !1, children: t }) {
|
|
11964
|
+
const { viewer: n } = oa(), s = Ge(null), [r, o, a] = i;
|
|
11965
11965
|
ht(() => {
|
|
11966
11966
|
if (!n)
|
|
11967
11967
|
return;
|
|
@@ -12011,7 +12011,7 @@ function Ud({ position: i, occlude: e = !1, children: t }) {
|
|
|
12011
12011
|
// interactive custom children keep receiving pointer events.
|
|
12012
12012
|
pointerEvents: c ? "auto" : "none"
|
|
12013
12013
|
},
|
|
12014
|
-
children: c ? t : /* @__PURE__ */ Te(
|
|
12014
|
+
children: c ? t : /* @__PURE__ */ Te(Dd, {})
|
|
12015
12015
|
}
|
|
12016
12016
|
);
|
|
12017
12017
|
}
|
|
@@ -12020,23 +12020,24 @@ export {
|
|
|
12020
12020
|
Qe as C,
|
|
12021
12021
|
Ir as D,
|
|
12022
12022
|
Y as E,
|
|
12023
|
-
|
|
12023
|
+
Hd as H,
|
|
12024
12024
|
De as I,
|
|
12025
|
-
|
|
12025
|
+
zd as L,
|
|
12026
12026
|
Zs as M,
|
|
12027
12027
|
$e as O,
|
|
12028
12028
|
z as R,
|
|
12029
12029
|
rr as S,
|
|
12030
12030
|
nr as T,
|
|
12031
|
-
|
|
12031
|
+
sa as V,
|
|
12032
12032
|
ar as a,
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12033
|
+
Bd as b,
|
|
12034
|
+
Bc as c,
|
|
12035
|
+
Yo as d,
|
|
12036
|
+
W as e,
|
|
12037
|
+
Ks as f,
|
|
12038
|
+
Jc as g,
|
|
12039
|
+
Oc as h,
|
|
12040
|
+
Od as i,
|
|
12041
|
+
Wi as j,
|
|
12042
|
+
Pu as r
|
|
12042
12043
|
};
|