softbox 4.25.0 → 4.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/simple-viewer.cjs +7 -7
- package/dist/simple-viewer.es.js +673 -647
- package/package.json +3 -1
package/dist/simple-viewer.es.js
CHANGED
|
@@ -1598,7 +1598,28 @@ var un = class {
|
|
|
1598
1598
|
static create(t = 30, n = 1, r = .1, i = 1e3) {
|
|
1599
1599
|
return new e(new A.PerspectiveCamera(t, n, r, i));
|
|
1600
1600
|
}
|
|
1601
|
-
}, gn =
|
|
1601
|
+
}, gn = "softboxCoverFitBackground";
|
|
1602
|
+
function _n(e) {
|
|
1603
|
+
e.userData[gn] = !0;
|
|
1604
|
+
}
|
|
1605
|
+
function vn(e, t) {
|
|
1606
|
+
let n = e.background;
|
|
1607
|
+
if (!yn(n)) return;
|
|
1608
|
+
let r = bn(n.image);
|
|
1609
|
+
!xn(r) || !xn(t) || (n.repeat.set(Math.min(1, t / r), Math.min(1, r / t)), n.offset.set((1 - n.repeat.x) / 2, (1 - n.repeat.y) / 2));
|
|
1610
|
+
}
|
|
1611
|
+
function yn(e) {
|
|
1612
|
+
return e instanceof A.Texture && e.userData[gn] === !0;
|
|
1613
|
+
}
|
|
1614
|
+
function bn(e) {
|
|
1615
|
+
return (e?.naturalWidth || e?.width || 0) / (e?.naturalHeight || e?.height || 0);
|
|
1616
|
+
}
|
|
1617
|
+
function xn(e) {
|
|
1618
|
+
return Number.isFinite(e) && e > 0;
|
|
1619
|
+
}
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/infrastructure/converters/RendererOptionsConverter.ts
|
|
1622
|
+
var Sn = {
|
|
1602
1623
|
none: A.NoToneMapping,
|
|
1603
1624
|
linear: A.LinearToneMapping,
|
|
1604
1625
|
reinhard: A.ReinhardToneMapping,
|
|
@@ -1606,7 +1627,7 @@ var un = class {
|
|
|
1606
1627
|
aces: A.ACESFilmicToneMapping,
|
|
1607
1628
|
agx: A.AgXToneMapping,
|
|
1608
1629
|
neutral: A.NeutralToneMapping
|
|
1609
|
-
},
|
|
1630
|
+
}, Cn = new Map(Object.entries(Sn).map(([e, t]) => [t, e])), wn = class {
|
|
1610
1631
|
static convertRendererOptions(e) {
|
|
1611
1632
|
let t = {
|
|
1612
1633
|
antialias: e.antialias,
|
|
@@ -1663,7 +1684,7 @@ var un = class {
|
|
|
1663
1684
|
}
|
|
1664
1685
|
static convertToneMappingType(e) {
|
|
1665
1686
|
if (typeof e == "number") {
|
|
1666
|
-
let t =
|
|
1687
|
+
let t = Cn.get(e);
|
|
1667
1688
|
if (t) return t;
|
|
1668
1689
|
}
|
|
1669
1690
|
return typeof e == "string" ? e : "neutral";
|
|
@@ -1671,17 +1692,17 @@ var un = class {
|
|
|
1671
1692
|
};
|
|
1672
1693
|
//#endregion
|
|
1673
1694
|
//#region src/infrastructure/three/postprocessing/PostProcessingPipeline.ts
|
|
1674
|
-
function
|
|
1695
|
+
function Tn(e) {
|
|
1675
1696
|
return e.bloom || e.vignette || e.filmGrain || e.colorGrade !== null;
|
|
1676
1697
|
}
|
|
1677
|
-
var
|
|
1698
|
+
var En = .08, Dn = .25, On = 2.5, kn = 1.15, An = 1.05, jn = {
|
|
1678
1699
|
uniforms: {
|
|
1679
1700
|
tDiffuse: { value: null },
|
|
1680
1701
|
intensity: { value: .05 }
|
|
1681
1702
|
},
|
|
1682
1703
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",
|
|
1683
1704
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform float intensity;\n varying vec2 vUv;\n float hash( vec2 p ) {\n return fract( sin( dot( p, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );\n }\n void main() {\n vec4 color = texture2D( tDiffuse, vUv );\n float grain = hash( floor( gl_FragCoord.xy ) ) - 0.5;\n gl_FragColor = vec4( color.rgb + grain * intensity, color.a );\n }\n "
|
|
1684
|
-
},
|
|
1705
|
+
}, Mn = class {
|
|
1685
1706
|
constructor(e, t, n) {
|
|
1686
1707
|
this.modules = null, this.composer = null, this.renderPass = null, this.passes = [], this.disposed = !1, this.loadFailed = !1, this.renderer = e, this.config = t, this.onLoadError = n, this.load();
|
|
1687
1708
|
}
|
|
@@ -1724,7 +1745,7 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1724
1745
|
let r = this.renderer.getDrawingBufferSize(new A.Vector2()), i = new e.EffectComposer(this.renderer), a = Math.min(4, this.renderer.capabilities.maxSamples || 0);
|
|
1725
1746
|
a > 0 && (i.renderTarget1.samples = a, i.renderTarget2.samples = a);
|
|
1726
1747
|
let o = new e.RenderPass(t, n);
|
|
1727
|
-
this.renderPass = o, this.addPass(i, o), this.config.bloom && e.UnrealBloomPass && this.addPass(i, new e.UnrealBloomPass(new A.Vector2(r.x, r.y),
|
|
1748
|
+
this.renderPass = o, this.addPass(i, o), this.config.bloom && e.UnrealBloomPass && this.addPass(i, new e.UnrealBloomPass(new A.Vector2(r.x, r.y), En, Dn, On)), this.addPass(i, new e.OutputPass());
|
|
1728
1749
|
let s = this.config.colorGrade;
|
|
1729
1750
|
if (s && e.ShaderPass && e.BrightnessContrastShader && e.HueSaturationShader) {
|
|
1730
1751
|
let t = new e.ShaderPass(e.BrightnessContrastShader);
|
|
@@ -1734,9 +1755,9 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1734
1755
|
}
|
|
1735
1756
|
if (this.config.vignette && e.ShaderPass && e.VignetteShader) {
|
|
1736
1757
|
let t = new e.ShaderPass(e.VignetteShader);
|
|
1737
|
-
t.uniforms.offset.value =
|
|
1758
|
+
t.uniforms.offset.value = kn, t.uniforms.darkness.value = An, this.addPass(i, t);
|
|
1738
1759
|
}
|
|
1739
|
-
return this.config.filmGrain && e.ShaderPass && this.addPass(i, new e.ShaderPass(
|
|
1760
|
+
return this.config.filmGrain && e.ShaderPass && this.addPass(i, new e.ShaderPass(jn)), this.composer = i, i;
|
|
1740
1761
|
}
|
|
1741
1762
|
setSize(e, t) {
|
|
1742
1763
|
this.composer?.setSize(e, t);
|
|
@@ -1752,7 +1773,7 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1752
1773
|
for (let e of this.passes) e.dispose?.();
|
|
1753
1774
|
this.passes = [], this.composer?.dispose?.(), this.composer = null, this.renderPass = null, this.modules = null;
|
|
1754
1775
|
}
|
|
1755
|
-
},
|
|
1776
|
+
}, Nn = class {
|
|
1756
1777
|
constructor(e) {
|
|
1757
1778
|
this.renderer = null, this._id = Qt(), this.postPipeline = null, this.requestedPixelRatio = 1, this.canvas = e;
|
|
1758
1779
|
}
|
|
@@ -1780,18 +1801,18 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1780
1801
|
};
|
|
1781
1802
|
this.renderer.shadowMap.type = t[e.shadowMap.type];
|
|
1782
1803
|
}
|
|
1783
|
-
e.toneMapping && (this.renderer.toneMapping =
|
|
1804
|
+
e.toneMapping && (this.renderer.toneMapping = Sn[e.toneMapping.type], this.renderer.toneMappingExposure = e.toneMapping.exposure);
|
|
1784
1805
|
let t = {
|
|
1785
1806
|
bloom: e.postProcessing?.bloom ?? !1,
|
|
1786
1807
|
vignette: e.postProcessing?.vignette ?? !1,
|
|
1787
1808
|
filmGrain: e.postProcessing?.filmGrain ?? !1,
|
|
1788
1809
|
colorGrade: e.postProcessing?.colorGrade ?? null
|
|
1789
|
-
}, n =
|
|
1810
|
+
}, n = Tn(t);
|
|
1790
1811
|
if (this.requestedPixelRatio = e.pixelRatio ?? window.devicePixelRatio, this.renderer.setPixelRatio(n ? Math.min(this.requestedPixelRatio, 2) : this.requestedPixelRatio), this.canvas) {
|
|
1791
1812
|
let { clientWidth: e, clientHeight: t } = this.canvas.parentElement || this.canvas;
|
|
1792
1813
|
e && t && this.renderer.setSize(e, t);
|
|
1793
1814
|
}
|
|
1794
|
-
return this.renderer.outputColorSpace = A.SRGBColorSpace, n && (this.postPipeline = new
|
|
1815
|
+
return this.renderer.outputColorSpace = A.SRGBColorSpace, n && (this.postPipeline = new Mn(this.renderer, t, (e) => this.postLoadErrorHandler?.(e))), r.ok(void 0);
|
|
1795
1816
|
} catch (n) {
|
|
1796
1817
|
return r.err(new t("Failed to initialize renderer", i.RENDERER_INIT_FAILED, {
|
|
1797
1818
|
originalError: n,
|
|
@@ -1805,7 +1826,7 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1805
1826
|
if (!(e instanceof un)) return r.err(new t("Scene must be a ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
1806
1827
|
if (!(n instanceof mn)) return r.err(new t("Camera must be a ThreeCameraAdapter", i.INVALID_PARAMETER));
|
|
1807
1828
|
let a = e.getThreeScene(), o = n.getThreeCamera();
|
|
1808
|
-
return this.renderer.render(a, o), r.ok(void 0);
|
|
1829
|
+
return this.fitBackgroundToDrawingBuffer(a, this.renderer), this.renderer.render(a, o), r.ok(void 0);
|
|
1809
1830
|
} catch (e) {
|
|
1810
1831
|
return r.err(new t("Failed to render frame", i.RENDER_FAILED, { originalError: e }));
|
|
1811
1832
|
}
|
|
@@ -1813,11 +1834,16 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1813
1834
|
renderPostProcessed(e, n) {
|
|
1814
1835
|
if (!this.postPipeline || !this.renderer || !(e instanceof un) || !(n instanceof mn)) return this.render(e, n);
|
|
1815
1836
|
try {
|
|
1816
|
-
|
|
1837
|
+
let t = e.getThreeScene();
|
|
1838
|
+
return this.fitBackgroundToDrawingBuffer(t, this.renderer), this.postPipeline.render(t, n.getThreeCamera()) ? r.ok(void 0) : this.render(e, n);
|
|
1817
1839
|
} catch (e) {
|
|
1818
1840
|
return r.err(new t("Failed to render frame with post-processing", i.RENDER_FAILED, { originalError: e }));
|
|
1819
1841
|
}
|
|
1820
1842
|
}
|
|
1843
|
+
fitBackgroundToDrawingBuffer(e, t) {
|
|
1844
|
+
let n = t.domElement;
|
|
1845
|
+
vn(e, n.width / n.height);
|
|
1846
|
+
}
|
|
1821
1847
|
setSize(e, t) {
|
|
1822
1848
|
if (this.renderer) {
|
|
1823
1849
|
this.renderer.setSize(e, t, !1), this.postPipeline?.setSize(e, t);
|
|
@@ -1840,11 +1866,11 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1840
1866
|
bloom: e.bloom,
|
|
1841
1867
|
vignette: e.vignette,
|
|
1842
1868
|
filmGrain: e.filmGrain,
|
|
1843
|
-
colorGrade:
|
|
1869
|
+
colorGrade: wn.resolveColorGrade(e.colorGrade) ?? null
|
|
1844
1870
|
};
|
|
1845
1871
|
this.postPipeline?.dispose(), this.postPipeline = null;
|
|
1846
|
-
let n =
|
|
1847
|
-
this.renderer.setPixelRatio(n ? Math.min(this.requestedPixelRatio, 2) : this.requestedPixelRatio), n && (this.postPipeline = new
|
|
1872
|
+
let n = Tn(t);
|
|
1873
|
+
this.renderer.setPixelRatio(n ? Math.min(this.requestedPixelRatio, 2) : this.requestedPixelRatio), n && (this.postPipeline = new Mn(this.renderer, t, (e) => this.postLoadErrorHandler?.(e)));
|
|
1848
1874
|
}
|
|
1849
1875
|
getDomElement() {
|
|
1850
1876
|
if (!this.renderer) throw Error("Renderer not initialized");
|
|
@@ -1890,7 +1916,7 @@ var bn = .08, xn = .25, Sn = 2.5, Cn = 1.15, wn = 1.05, Tn = {
|
|
|
1890
1916
|
};
|
|
1891
1917
|
//#endregion
|
|
1892
1918
|
//#region node_modules/three/examples/jsm/utils/BufferGeometryUtils.js
|
|
1893
|
-
function
|
|
1919
|
+
function Pn(e, t) {
|
|
1894
1920
|
if (t === Tt) return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), e;
|
|
1895
1921
|
if (t === Ct || t === wt) {
|
|
1896
1922
|
let n = e.getIndex();
|
|
@@ -1911,9 +1937,9 @@ function On(e, t) {
|
|
|
1911
1937
|
}
|
|
1912
1938
|
//#endregion
|
|
1913
1939
|
//#region node_modules/three/examples/jsm/utils/SkeletonUtils.js
|
|
1914
|
-
function
|
|
1940
|
+
function Fn(e) {
|
|
1915
1941
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = e.clone();
|
|
1916
|
-
return
|
|
1942
|
+
return In(e, r, function(e, r) {
|
|
1917
1943
|
t.set(r, e), n.set(e, r);
|
|
1918
1944
|
}), r.traverse(function(e) {
|
|
1919
1945
|
if (!e.isSkinnedMesh) return;
|
|
@@ -1923,50 +1949,50 @@ function kn(e) {
|
|
|
1923
1949
|
}), r.bind(r.skeleton, r.bindMatrix);
|
|
1924
1950
|
}), r;
|
|
1925
1951
|
}
|
|
1926
|
-
function
|
|
1952
|
+
function In(e, t, n) {
|
|
1927
1953
|
n(e, t);
|
|
1928
|
-
for (let r = 0; r < e.children.length; r++)
|
|
1954
|
+
for (let r = 0; r < e.children.length; r++) In(e.children[r], t.children[r], n);
|
|
1929
1955
|
}
|
|
1930
1956
|
//#endregion
|
|
1931
1957
|
//#region node_modules/three/examples/jsm/loaders/GLTFLoader.js
|
|
1932
|
-
var
|
|
1958
|
+
var Ln = class extends Le {
|
|
1933
1959
|
constructor(e) {
|
|
1934
1960
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
|
|
1935
|
-
return new
|
|
1961
|
+
return new Hn(e);
|
|
1936
1962
|
}), this.register(function(e) {
|
|
1937
|
-
return new
|
|
1963
|
+
return new Un(e);
|
|
1938
1964
|
}), this.register(function(e) {
|
|
1939
|
-
return new
|
|
1965
|
+
return new Qn(e);
|
|
1940
1966
|
}), this.register(function(e) {
|
|
1941
|
-
return new
|
|
1967
|
+
return new $n(e);
|
|
1942
1968
|
}), this.register(function(e) {
|
|
1943
|
-
return new
|
|
1969
|
+
return new er(e);
|
|
1944
1970
|
}), this.register(function(e) {
|
|
1945
|
-
return new
|
|
1971
|
+
return new Gn(e);
|
|
1946
1972
|
}), this.register(function(e) {
|
|
1947
|
-
return new
|
|
1973
|
+
return new Kn(e);
|
|
1948
1974
|
}), this.register(function(e) {
|
|
1949
|
-
return new
|
|
1975
|
+
return new qn(e);
|
|
1950
1976
|
}), this.register(function(e) {
|
|
1951
|
-
return new
|
|
1977
|
+
return new Jn(e);
|
|
1952
1978
|
}), this.register(function(e) {
|
|
1953
|
-
return new
|
|
1979
|
+
return new Vn(e);
|
|
1954
1980
|
}), this.register(function(e) {
|
|
1955
|
-
return new
|
|
1981
|
+
return new Yn(e);
|
|
1956
1982
|
}), this.register(function(e) {
|
|
1957
|
-
return new
|
|
1983
|
+
return new Wn(e);
|
|
1958
1984
|
}), this.register(function(e) {
|
|
1959
|
-
return new
|
|
1985
|
+
return new Zn(e);
|
|
1960
1986
|
}), this.register(function(e) {
|
|
1961
|
-
return new
|
|
1987
|
+
return new Xn(e);
|
|
1962
1988
|
}), this.register(function(e) {
|
|
1963
|
-
return new
|
|
1989
|
+
return new zn(e);
|
|
1964
1990
|
}), this.register(function(e) {
|
|
1965
|
-
return new
|
|
1991
|
+
return new tr(e, W.EXT_MESHOPT_COMPRESSION);
|
|
1966
1992
|
}), this.register(function(e) {
|
|
1967
|
-
return new
|
|
1993
|
+
return new tr(e, W.KHR_MESHOPT_COMPRESSION);
|
|
1968
1994
|
}), this.register(function(e) {
|
|
1969
|
-
return new
|
|
1995
|
+
return new nr(e);
|
|
1970
1996
|
});
|
|
1971
1997
|
}
|
|
1972
1998
|
load(e, t, n, r) {
|
|
@@ -2008,9 +2034,9 @@ var jn = class extends Le {
|
|
|
2008
2034
|
parse(e, t, n, r) {
|
|
2009
2035
|
let i, a = {}, o = {}, s = new TextDecoder();
|
|
2010
2036
|
if (typeof e == "string") i = JSON.parse(e);
|
|
2011
|
-
else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) ===
|
|
2037
|
+
else if (e instanceof ArrayBuffer) if (s.decode(new Uint8Array(e, 0, 4)) === rr) {
|
|
2012
2038
|
try {
|
|
2013
|
-
a[W.KHR_BINARY_GLTF] = new
|
|
2039
|
+
a[W.KHR_BINARY_GLTF] = new or(e);
|
|
2014
2040
|
} catch (e) {
|
|
2015
2041
|
r && r(e);
|
|
2016
2042
|
return;
|
|
@@ -2022,7 +2048,7 @@ var jn = class extends Le {
|
|
|
2022
2048
|
r && r(/* @__PURE__ */ Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
2023
2049
|
return;
|
|
2024
2050
|
}
|
|
2025
|
-
let c = new
|
|
2051
|
+
let c = new Mr(i, {
|
|
2026
2052
|
path: t || this.resourcePath || "",
|
|
2027
2053
|
crossOrigin: this.crossOrigin,
|
|
2028
2054
|
requestHeader: this.requestHeader,
|
|
@@ -2039,16 +2065,16 @@ var jn = class extends Le {
|
|
|
2039
2065
|
let t = i.extensionsUsed[e], n = i.extensionsRequired || [];
|
|
2040
2066
|
switch (t) {
|
|
2041
2067
|
case W.KHR_MATERIALS_UNLIT:
|
|
2042
|
-
a[t] = new
|
|
2068
|
+
a[t] = new Bn();
|
|
2043
2069
|
break;
|
|
2044
2070
|
case W.KHR_DRACO_MESH_COMPRESSION:
|
|
2045
|
-
a[t] = new
|
|
2071
|
+
a[t] = new sr(i, this.dracoLoader);
|
|
2046
2072
|
break;
|
|
2047
2073
|
case W.KHR_TEXTURE_TRANSFORM:
|
|
2048
|
-
a[t] = new
|
|
2074
|
+
a[t] = new cr();
|
|
2049
2075
|
break;
|
|
2050
2076
|
case W.KHR_MESH_QUANTIZATION:
|
|
2051
|
-
a[t] = new
|
|
2077
|
+
a[t] = new lr();
|
|
2052
2078
|
break;
|
|
2053
2079
|
default: n.indexOf(t) >= 0 && o[t] === void 0 && console.warn("THREE.GLTFLoader: Unknown extension \"" + t + "\".");
|
|
2054
2080
|
}
|
|
@@ -2062,7 +2088,7 @@ var jn = class extends Le {
|
|
|
2062
2088
|
});
|
|
2063
2089
|
}
|
|
2064
2090
|
};
|
|
2065
|
-
function
|
|
2091
|
+
function Rn() {
|
|
2066
2092
|
let e = {};
|
|
2067
2093
|
return {
|
|
2068
2094
|
get: function(t) {
|
|
@@ -2107,7 +2133,7 @@ var W = {
|
|
|
2107
2133
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
2108
2134
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
2109
2135
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
2110
|
-
},
|
|
2136
|
+
}, zn = class {
|
|
2111
2137
|
constructor(e) {
|
|
2112
2138
|
this.parser = e, this.name = W.KHR_LIGHTS_PUNCTUAL, this.cache = {
|
|
2113
2139
|
refs: {},
|
|
@@ -2139,7 +2165,7 @@ var W = {
|
|
|
2139
2165
|
break;
|
|
2140
2166
|
default: throw Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
|
|
2141
2167
|
}
|
|
2142
|
-
return o.position.set(0, 0, 0),
|
|
2168
|
+
return o.position.set(0, 0, 0), wr(o, a), a.intensity !== void 0 && (o.intensity = a.intensity), o.name = t.createUniqueName(a.name || "light_" + e), r = Promise.resolve(o), t.cache.add(n, r), r;
|
|
2143
2169
|
}
|
|
2144
2170
|
getDependency(e, t) {
|
|
2145
2171
|
if (e === "light") return this._loadLight(t);
|
|
@@ -2150,7 +2176,7 @@ var W = {
|
|
|
2150
2176
|
return n._getNodeRef(t.cache, i, e);
|
|
2151
2177
|
});
|
|
2152
2178
|
}
|
|
2153
|
-
},
|
|
2179
|
+
}, Bn = class {
|
|
2154
2180
|
constructor() {
|
|
2155
2181
|
this.name = W.KHR_MATERIALS_UNLIT;
|
|
2156
2182
|
}
|
|
@@ -2170,7 +2196,7 @@ var W = {
|
|
|
2170
2196
|
}
|
|
2171
2197
|
return Promise.all(r);
|
|
2172
2198
|
}
|
|
2173
|
-
},
|
|
2199
|
+
}, Vn = class {
|
|
2174
2200
|
constructor(e) {
|
|
2175
2201
|
this.parser = e, this.name = W.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
2176
2202
|
}
|
|
@@ -2178,7 +2204,7 @@ var W = {
|
|
|
2178
2204
|
let n = U(this.parser, e, this.name);
|
|
2179
2205
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
2180
2206
|
}
|
|
2181
|
-
},
|
|
2207
|
+
}, Hn = class {
|
|
2182
2208
|
constructor(e) {
|
|
2183
2209
|
this.parser = e, this.name = W.KHR_MATERIALS_CLEARCOAT;
|
|
2184
2210
|
}
|
|
@@ -2195,7 +2221,7 @@ var W = {
|
|
|
2195
2221
|
}
|
|
2196
2222
|
return Promise.all(r);
|
|
2197
2223
|
}
|
|
2198
|
-
},
|
|
2224
|
+
}, Un = class {
|
|
2199
2225
|
constructor(e) {
|
|
2200
2226
|
this.parser = e, this.name = W.KHR_MATERIALS_DISPERSION;
|
|
2201
2227
|
}
|
|
@@ -2206,7 +2232,7 @@ var W = {
|
|
|
2206
2232
|
let n = U(this.parser, e, this.name);
|
|
2207
2233
|
return n === null || (t.dispersion = n.dispersion === void 0 ? 0 : n.dispersion), Promise.resolve();
|
|
2208
2234
|
}
|
|
2209
|
-
},
|
|
2235
|
+
}, Wn = class {
|
|
2210
2236
|
constructor(e) {
|
|
2211
2237
|
this.parser = e, this.name = W.KHR_MATERIALS_IRIDESCENCE;
|
|
2212
2238
|
}
|
|
@@ -2219,7 +2245,7 @@ var W = {
|
|
|
2219
2245
|
let r = [];
|
|
2220
2246
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.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 && r.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
|
|
2221
2247
|
}
|
|
2222
|
-
},
|
|
2248
|
+
}, Gn = class {
|
|
2223
2249
|
constructor(e) {
|
|
2224
2250
|
this.parser = e, this.name = W.KHR_MATERIALS_SHEEN;
|
|
2225
2251
|
}
|
|
@@ -2236,7 +2262,7 @@ var W = {
|
|
|
2236
2262
|
}
|
|
2237
2263
|
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, pt)), n.sheenRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
|
|
2238
2264
|
}
|
|
2239
|
-
},
|
|
2265
|
+
}, Kn = class {
|
|
2240
2266
|
constructor(e) {
|
|
2241
2267
|
this.parser = e, this.name = W.KHR_MATERIALS_TRANSMISSION;
|
|
2242
2268
|
}
|
|
@@ -2249,7 +2275,7 @@ var W = {
|
|
|
2249
2275
|
let r = [];
|
|
2250
2276
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
|
|
2251
2277
|
}
|
|
2252
|
-
},
|
|
2278
|
+
}, qn = class {
|
|
2253
2279
|
constructor(e) {
|
|
2254
2280
|
this.parser = e, this.name = W.KHR_MATERIALS_VOLUME;
|
|
2255
2281
|
}
|
|
@@ -2268,7 +2294,7 @@ var W = {
|
|
|
2268
2294
|
];
|
|
2269
2295
|
return t.attenuationColor = new he().setRGB(i[0], i[1], i[2], I), Promise.all(r);
|
|
2270
2296
|
}
|
|
2271
|
-
},
|
|
2297
|
+
}, Jn = class {
|
|
2272
2298
|
constructor(e) {
|
|
2273
2299
|
this.parser = e, this.name = W.KHR_MATERIALS_IOR;
|
|
2274
2300
|
}
|
|
@@ -2279,7 +2305,7 @@ var W = {
|
|
|
2279
2305
|
let n = U(this.parser, e, this.name);
|
|
2280
2306
|
return n === null ? Promise.resolve() : (t.ior = n.ior === void 0 ? 1.5 : n.ior, t.ior === 0 && (t.ior = 1e3), Promise.resolve());
|
|
2281
2307
|
}
|
|
2282
|
-
},
|
|
2308
|
+
}, Yn = class {
|
|
2283
2309
|
constructor(e) {
|
|
2284
2310
|
this.parser = e, this.name = W.KHR_MATERIALS_SPECULAR;
|
|
2285
2311
|
}
|
|
@@ -2298,7 +2324,7 @@ var W = {
|
|
|
2298
2324
|
];
|
|
2299
2325
|
return t.specularColor = new he().setRGB(i[0], i[1], i[2], I), n.specularColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, pt)), Promise.all(r);
|
|
2300
2326
|
}
|
|
2301
|
-
},
|
|
2327
|
+
}, Xn = class {
|
|
2302
2328
|
constructor(e) {
|
|
2303
2329
|
this.parser = e, this.name = W.EXT_MATERIALS_BUMP;
|
|
2304
2330
|
}
|
|
@@ -2311,7 +2337,7 @@ var W = {
|
|
|
2311
2337
|
let r = [];
|
|
2312
2338
|
return t.bumpScale = n.bumpFactor === void 0 ? 1 : n.bumpFactor, n.bumpTexture !== void 0 && r.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
|
|
2313
2339
|
}
|
|
2314
|
-
},
|
|
2340
|
+
}, Zn = class {
|
|
2315
2341
|
constructor(e) {
|
|
2316
2342
|
this.parser = e, this.name = W.KHR_MATERIALS_ANISOTROPY;
|
|
2317
2343
|
}
|
|
@@ -2324,7 +2350,7 @@ var W = {
|
|
|
2324
2350
|
let r = [];
|
|
2325
2351
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
|
|
2326
2352
|
}
|
|
2327
|
-
},
|
|
2353
|
+
}, Qn = class {
|
|
2328
2354
|
constructor(e) {
|
|
2329
2355
|
this.parser = e, this.name = W.KHR_TEXTURE_BASISU;
|
|
2330
2356
|
}
|
|
@@ -2338,7 +2364,7 @@ var W = {
|
|
|
2338
2364
|
}
|
|
2339
2365
|
return t.loadTextureImage(e, i.source, a);
|
|
2340
2366
|
}
|
|
2341
|
-
},
|
|
2367
|
+
}, $n = class {
|
|
2342
2368
|
constructor(e) {
|
|
2343
2369
|
this.parser = e, this.name = W.EXT_TEXTURE_WEBP;
|
|
2344
2370
|
}
|
|
@@ -2352,7 +2378,7 @@ var W = {
|
|
|
2352
2378
|
}
|
|
2353
2379
|
return n.loadTextureImage(e, a.source, s);
|
|
2354
2380
|
}
|
|
2355
|
-
},
|
|
2381
|
+
}, er = class {
|
|
2356
2382
|
constructor(e) {
|
|
2357
2383
|
this.parser = e, this.name = W.EXT_TEXTURE_AVIF;
|
|
2358
2384
|
}
|
|
@@ -2366,7 +2392,7 @@ var W = {
|
|
|
2366
2392
|
}
|
|
2367
2393
|
return n.loadTextureImage(e, a.source, s);
|
|
2368
2394
|
}
|
|
2369
|
-
},
|
|
2395
|
+
}, tr = class {
|
|
2370
2396
|
constructor(e, t) {
|
|
2371
2397
|
this.name = t, this.parser = e;
|
|
2372
2398
|
}
|
|
@@ -2389,7 +2415,7 @@ var W = {
|
|
|
2389
2415
|
});
|
|
2390
2416
|
} else return null;
|
|
2391
2417
|
}
|
|
2392
|
-
},
|
|
2418
|
+
}, nr = class {
|
|
2393
2419
|
constructor(e) {
|
|
2394
2420
|
this.name = W.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2395
2421
|
}
|
|
@@ -2397,7 +2423,7 @@ var W = {
|
|
|
2397
2423
|
let t = this.parser.json, n = t.nodes[e];
|
|
2398
2424
|
if (!n.extensions || !n.extensions[this.name] || n.mesh === void 0) return null;
|
|
2399
2425
|
let r = t.meshes[n.mesh];
|
|
2400
|
-
for (let e of r.primitives) if (e.mode !==
|
|
2426
|
+
for (let e of r.primitives) if (e.mode !== pr.TRIANGLES && e.mode !== pr.TRIANGLE_STRIP && e.mode !== pr.TRIANGLE_FAN && e.mode !== void 0) return null;
|
|
2401
2427
|
let i = n.extensions[this.name].attributes, a = [], o = {};
|
|
2402
2428
|
for (let e in i) a.push(this.parser.getDependency("accessor", i[e]).then((t) => (o[e] = t, o[e])));
|
|
2403
2429
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((e) => {
|
|
@@ -2414,36 +2440,36 @@ var W = {
|
|
|
2414
2440
|
return t.isGroup ? (t.clear(), t.add(...i), t) : i[0];
|
|
2415
2441
|
}));
|
|
2416
2442
|
}
|
|
2417
|
-
},
|
|
2443
|
+
}, rr = "glTF", ir = 12, ar = {
|
|
2418
2444
|
JSON: 1313821514,
|
|
2419
2445
|
BIN: 5130562
|
|
2420
|
-
},
|
|
2446
|
+
}, or = class {
|
|
2421
2447
|
constructor(e) {
|
|
2422
2448
|
this.name = W.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2423
|
-
let t = new DataView(e, 0,
|
|
2449
|
+
let t = new DataView(e, 0, ir), n = new TextDecoder();
|
|
2424
2450
|
if (this.header = {
|
|
2425
2451
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
2426
2452
|
version: t.getUint32(4, !0),
|
|
2427
2453
|
length: t.getUint32(8, !0)
|
|
2428
|
-
}, this.header.magic !==
|
|
2454
|
+
}, this.header.magic !== rr) throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
2429
2455
|
if (this.header.version < 2) throw Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
2430
|
-
let r = this.header.length -
|
|
2456
|
+
let r = this.header.length - ir, i = new DataView(e, ir), a = 0;
|
|
2431
2457
|
for (; a < r;) {
|
|
2432
2458
|
let t = i.getUint32(a, !0);
|
|
2433
2459
|
a += 4;
|
|
2434
2460
|
let r = i.getUint32(a, !0);
|
|
2435
|
-
if (a += 4, r ===
|
|
2436
|
-
let r = new Uint8Array(e,
|
|
2461
|
+
if (a += 4, r === ar.JSON) {
|
|
2462
|
+
let r = new Uint8Array(e, ir + a, t);
|
|
2437
2463
|
this.content = n.decode(r);
|
|
2438
|
-
} else if (r ===
|
|
2439
|
-
let n =
|
|
2464
|
+
} else if (r === ar.BIN) {
|
|
2465
|
+
let n = ir + a;
|
|
2440
2466
|
this.body = e.slice(n, n + t);
|
|
2441
2467
|
}
|
|
2442
2468
|
a += t;
|
|
2443
2469
|
}
|
|
2444
2470
|
if (this.content === null) throw Error("THREE.GLTFLoader: JSON content not found.");
|
|
2445
2471
|
}
|
|
2446
|
-
},
|
|
2472
|
+
}, sr = class {
|
|
2447
2473
|
constructor(e, t) {
|
|
2448
2474
|
if (!t) throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
2449
2475
|
this.name = W.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
@@ -2451,14 +2477,14 @@ var W = {
|
|
|
2451
2477
|
decodePrimitive(e, t) {
|
|
2452
2478
|
let n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, a = e.extensions[this.name].attributes, o = {}, s = {}, c = {};
|
|
2453
2479
|
for (let e in a) {
|
|
2454
|
-
let t =
|
|
2480
|
+
let t = vr[e] || e.toLowerCase();
|
|
2455
2481
|
o[t] = a[e];
|
|
2456
2482
|
}
|
|
2457
2483
|
for (let t in e.attributes) {
|
|
2458
|
-
let r =
|
|
2484
|
+
let r = vr[t] || t.toLowerCase();
|
|
2459
2485
|
if (a[t] !== void 0) {
|
|
2460
2486
|
let i = n.accessors[e.attributes[t]];
|
|
2461
|
-
c[r] =
|
|
2487
|
+
c[r] = mr[i.componentType].name, s[r] = i.normalized === !0;
|
|
2462
2488
|
}
|
|
2463
2489
|
}
|
|
2464
2490
|
return t.getDependency("bufferView", i).then(function(e) {
|
|
@@ -2473,18 +2499,18 @@ var W = {
|
|
|
2473
2499
|
});
|
|
2474
2500
|
});
|
|
2475
2501
|
}
|
|
2476
|
-
},
|
|
2502
|
+
}, cr = class {
|
|
2477
2503
|
constructor() {
|
|
2478
2504
|
this.name = W.KHR_TEXTURE_TRANSFORM;
|
|
2479
2505
|
}
|
|
2480
2506
|
extendTexture(e, t) {
|
|
2481
2507
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 ? e : (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);
|
|
2482
2508
|
}
|
|
2483
|
-
},
|
|
2509
|
+
}, lr = class {
|
|
2484
2510
|
constructor() {
|
|
2485
2511
|
this.name = W.KHR_MESH_QUANTIZATION;
|
|
2486
2512
|
}
|
|
2487
|
-
},
|
|
2513
|
+
}, ur = class extends Oe {
|
|
2488
2514
|
constructor(e, t, n, r) {
|
|
2489
2515
|
super(e, t, n, r);
|
|
2490
2516
|
}
|
|
@@ -2501,12 +2527,12 @@ var W = {
|
|
|
2501
2527
|
}
|
|
2502
2528
|
return i;
|
|
2503
2529
|
}
|
|
2504
|
-
},
|
|
2530
|
+
}, dr = new at(), fr = class extends ur {
|
|
2505
2531
|
interpolate_(e, t, n, r) {
|
|
2506
2532
|
let i = super.interpolate_(e, t, n, r);
|
|
2507
|
-
return
|
|
2533
|
+
return dr.fromArray(i).normalize().toArray(i), i;
|
|
2508
2534
|
}
|
|
2509
|
-
},
|
|
2535
|
+
}, pr = {
|
|
2510
2536
|
FLOAT: 5126,
|
|
2511
2537
|
FLOAT_MAT3: 35675,
|
|
2512
2538
|
FLOAT_MAT4: 35676,
|
|
@@ -2525,25 +2551,25 @@ var W = {
|
|
|
2525
2551
|
TRIANGLE_FAN: 6,
|
|
2526
2552
|
UNSIGNED_BYTE: 5121,
|
|
2527
2553
|
UNSIGNED_SHORT: 5123
|
|
2528
|
-
},
|
|
2554
|
+
}, mr = {
|
|
2529
2555
|
5120: Int8Array,
|
|
2530
2556
|
5121: Uint8Array,
|
|
2531
2557
|
5122: Int16Array,
|
|
2532
2558
|
5123: Uint16Array,
|
|
2533
2559
|
5125: Uint32Array,
|
|
2534
2560
|
5126: Float32Array
|
|
2535
|
-
},
|
|
2561
|
+
}, hr = {
|
|
2536
2562
|
9728: Je,
|
|
2537
2563
|
9729: Pe,
|
|
2538
2564
|
9984: Xe,
|
|
2539
2565
|
9985: Ie,
|
|
2540
2566
|
9986: Ye,
|
|
2541
2567
|
9987: Fe
|
|
2542
|
-
},
|
|
2568
|
+
}, gr = {
|
|
2543
2569
|
33071: me,
|
|
2544
2570
|
33648: qe,
|
|
2545
2571
|
10497: ft
|
|
2546
|
-
},
|
|
2572
|
+
}, _r = {
|
|
2547
2573
|
SCALAR: 1,
|
|
2548
2574
|
VEC2: 2,
|
|
2549
2575
|
VEC3: 3,
|
|
@@ -2551,7 +2577,7 @@ var W = {
|
|
|
2551
2577
|
MAT2: 4,
|
|
2552
2578
|
MAT3: 9,
|
|
2553
2579
|
MAT4: 16
|
|
2554
|
-
},
|
|
2580
|
+
}, vr = {
|
|
2555
2581
|
POSITION: "position",
|
|
2556
2582
|
NORMAL: "normal",
|
|
2557
2583
|
TANGENT: "tangent",
|
|
@@ -2562,21 +2588,21 @@ var W = {
|
|
|
2562
2588
|
COLOR_0: "color",
|
|
2563
2589
|
WEIGHTS_0: "skinWeight",
|
|
2564
2590
|
JOINTS_0: "skinIndex"
|
|
2565
|
-
},
|
|
2591
|
+
}, yr = {
|
|
2566
2592
|
scale: "scale",
|
|
2567
2593
|
translation: "position",
|
|
2568
2594
|
rotation: "quaternion",
|
|
2569
2595
|
weights: "morphTargetInfluences"
|
|
2570
|
-
},
|
|
2596
|
+
}, br = {
|
|
2571
2597
|
CUBICSPLINE: void 0,
|
|
2572
2598
|
LINEAR: ke,
|
|
2573
2599
|
STEP: F
|
|
2574
|
-
},
|
|
2600
|
+
}, xr = {
|
|
2575
2601
|
OPAQUE: "OPAQUE",
|
|
2576
2602
|
MASK: "MASK",
|
|
2577
2603
|
BLEND: "BLEND"
|
|
2578
2604
|
};
|
|
2579
|
-
function
|
|
2605
|
+
function Sr(e) {
|
|
2580
2606
|
return e.DefaultMaterial === void 0 && (e.DefaultMaterial = new Ke({
|
|
2581
2607
|
color: 16777215,
|
|
2582
2608
|
emissive: 0,
|
|
@@ -2587,13 +2613,13 @@ function gr(e) {
|
|
|
2587
2613
|
side: we
|
|
2588
2614
|
})), e.DefaultMaterial;
|
|
2589
2615
|
}
|
|
2590
|
-
function
|
|
2616
|
+
function Cr(e, t, n) {
|
|
2591
2617
|
for (let r in n.extensions) e[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = n.extensions[r]);
|
|
2592
2618
|
}
|
|
2593
|
-
function
|
|
2619
|
+
function wr(e, t) {
|
|
2594
2620
|
t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(e.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
|
|
2595
2621
|
}
|
|
2596
|
-
function
|
|
2622
|
+
function Tr(e, t, n) {
|
|
2597
2623
|
let r = !1, i = !1, a = !1;
|
|
2598
2624
|
for (let e = 0, n = t.length; e < n; e++) {
|
|
2599
2625
|
let n = t[e];
|
|
@@ -2625,7 +2651,7 @@ function yr(e, t, n) {
|
|
|
2625
2651
|
return r && (e.morphAttributes.position = n), i && (e.morphAttributes.normal = o), a && (e.morphAttributes.color = s), e.morphTargetsRelative = !0, e;
|
|
2626
2652
|
});
|
|
2627
2653
|
}
|
|
2628
|
-
function
|
|
2654
|
+
function Er(e, t) {
|
|
2629
2655
|
if (e.updateMorphTargets(), t.weights !== void 0) for (let n = 0, r = t.weights.length; n < r; n++) e.morphTargetInfluences[n] = t.weights[n];
|
|
2630
2656
|
if (t.extras && Array.isArray(t.extras.targetNames)) {
|
|
2631
2657
|
let n = t.extras.targetNames;
|
|
@@ -2635,17 +2661,17 @@ function br(e, t) {
|
|
|
2635
2661
|
} else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
2636
2662
|
}
|
|
2637
2663
|
}
|
|
2638
|
-
function
|
|
2664
|
+
function Dr(e) {
|
|
2639
2665
|
let t, n = e.extensions && e.extensions[W.KHR_DRACO_MESH_COMPRESSION];
|
|
2640
|
-
if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" +
|
|
2666
|
+
if (t = n ? "draco:" + n.bufferView + ":" + n.indices + ":" + Or(n.attributes) : e.indices + ":" + Or(e.attributes) + ":" + e.mode, e.targets !== void 0) for (let n = 0, r = e.targets.length; n < r; n++) t += ":" + Or(e.targets[n]);
|
|
2641
2667
|
return t;
|
|
2642
2668
|
}
|
|
2643
|
-
function
|
|
2669
|
+
function Or(e) {
|
|
2644
2670
|
let t = "", n = Object.keys(e).sort();
|
|
2645
2671
|
for (let r = 0, i = n.length; r < i; r++) t += n[r] + ":" + e[n[r]] + ";";
|
|
2646
2672
|
return t;
|
|
2647
2673
|
}
|
|
2648
|
-
function
|
|
2674
|
+
function kr(e) {
|
|
2649
2675
|
switch (e) {
|
|
2650
2676
|
case Int8Array: return 1 / 127;
|
|
2651
2677
|
case Uint8Array: return 1 / 255;
|
|
@@ -2654,12 +2680,12 @@ function Cr(e) {
|
|
|
2654
2680
|
default: throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
2655
2681
|
}
|
|
2656
2682
|
}
|
|
2657
|
-
function
|
|
2683
|
+
function Ar(e) {
|
|
2658
2684
|
return e.search(/\.jpe?g($|\?)/i) > 0 || e.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : e.search(/\.webp($|\?)/i) > 0 || e.search(/^data\:image\/webp/) === 0 ? "image/webp" : e.search(/\.ktx2($|\?)/i) > 0 || e.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
2659
2685
|
}
|
|
2660
|
-
var
|
|
2686
|
+
var jr = new Ve(), Mr = class {
|
|
2661
2687
|
constructor(e = {}, t = {}) {
|
|
2662
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
2688
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Rn(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = {
|
|
2663
2689
|
refs: {},
|
|
2664
2690
|
uses: {}
|
|
2665
2691
|
}, this.cameraCache = {
|
|
@@ -2706,7 +2732,7 @@ var Tr = new Ve(), Er = class {
|
|
|
2706
2732
|
parser: n,
|
|
2707
2733
|
userData: {}
|
|
2708
2734
|
};
|
|
2709
|
-
return
|
|
2735
|
+
return Cr(i, a, r), wr(a, r), Promise.all(n._invokeAll(function(e) {
|
|
2710
2736
|
return e.afterRoot && e.afterRoot(a);
|
|
2711
2737
|
})).then(function() {
|
|
2712
2738
|
for (let e of a.scenes) e.updateMatrixWorld();
|
|
@@ -2846,18 +2872,18 @@ var Tr = new Ve(), Er = class {
|
|
|
2846
2872
|
loadAccessor(e) {
|
|
2847
2873
|
let t = this, n = this.json, r = this.json.accessors[e];
|
|
2848
2874
|
if (r.bufferView === void 0 && r.sparse === void 0) {
|
|
2849
|
-
let e =
|
|
2875
|
+
let e = _r[r.type], t = mr[r.componentType], n = r.normalized === !0, i = new t(r.count * e);
|
|
2850
2876
|
return Promise.resolve(new fe(i, e, n));
|
|
2851
2877
|
}
|
|
2852
2878
|
let i = [];
|
|
2853
2879
|
return r.bufferView === void 0 ? i.push(null) : i.push(this.getDependency("bufferView", r.bufferView)), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(e) {
|
|
2854
|
-
let i = e[0], a =
|
|
2880
|
+
let i = e[0], a = _r[r.type], o = mr[r.componentType], s = o.BYTES_PER_ELEMENT, c = s * a, l = r.byteOffset || 0, u = r.bufferView === void 0 ? void 0 : n.bufferViews[r.bufferView].byteStride, d = r.normalized === !0, f, p;
|
|
2855
2881
|
if (u && u !== c) {
|
|
2856
2882
|
let e = Math.floor(l / u), n = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + e + ":" + r.count, c = t.cache.get(n);
|
|
2857
2883
|
c || (f = new o(i, e * u, r.count * u / s), c = new N(f, u / s), t.cache.add(n, c)), p = new P(c, a, l % u / s, d);
|
|
2858
2884
|
} else f = i === null ? new o(r.count * a) : new o(i, l, r.count * a), p = new fe(f, a, d);
|
|
2859
2885
|
if (r.sparse !== void 0) {
|
|
2860
|
-
let t =
|
|
2886
|
+
let t = _r.SCALAR, n = mr[r.sparse.indices.componentType], s = r.sparse.indices.byteOffset || 0, c = r.sparse.values.byteOffset || 0, l = new n(e[1], s, r.sparse.count * t), u = new o(e[2], c, r.sparse.count * a);
|
|
2861
2887
|
i !== null && (p = new fe(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
2862
2888
|
for (let e = 0, t = l.length; e < t; e++) {
|
|
2863
2889
|
let t = l[e];
|
|
@@ -2882,7 +2908,7 @@ var Tr = new Ve(), Er = class {
|
|
|
2882
2908
|
let c = this.loadImageSource(t, n).then(function(t) {
|
|
2883
2909
|
t.flipY = !1, t.name = a.name || o.name || "", t.name === "" && typeof o.uri == "string" && o.uri.startsWith("data:image/") === !1 && (t.name = o.uri);
|
|
2884
2910
|
let n = (i.samplers || {})[a.sampler] || {};
|
|
2885
|
-
return t.magFilter =
|
|
2911
|
+
return t.magFilter = hr[n.magFilter] || Pe, t.minFilter = hr[n.minFilter] || Fe, t.wrapS = gr[n.wrapS] || ft, t.wrapT = gr[n.wrapT] || ft, t.generateMipmaps = !t.isCompressedTexture && t.minFilter !== Je && t.minFilter !== Pe, r.associations.set(t, { textures: e }), t;
|
|
2886
2912
|
}).catch(function() {
|
|
2887
2913
|
return null;
|
|
2888
2914
|
});
|
|
@@ -2907,7 +2933,7 @@ var Tr = new Ve(), Er = class {
|
|
|
2907
2933
|
}), t.load(Re.resolveURL(e, i.path), a, void 0, r);
|
|
2908
2934
|
});
|
|
2909
2935
|
}).then(function(e) {
|
|
2910
|
-
return c === !0 && o.revokeObjectURL(s),
|
|
2936
|
+
return c === !0 && o.revokeObjectURL(s), wr(e, a), e.userData.mimeType = a.mimeType || Ar(a.uri), e;
|
|
2911
2937
|
}).catch(function(e) {
|
|
2912
2938
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", s), e;
|
|
2913
2939
|
});
|
|
@@ -2965,8 +2991,8 @@ var Tr = new Ve(), Er = class {
|
|
|
2965
2991
|
})));
|
|
2966
2992
|
}
|
|
2967
2993
|
i.doubleSided === !0 && (o.side = xe);
|
|
2968
|
-
let l = i.alphaMode ||
|
|
2969
|
-
if (l ===
|
|
2994
|
+
let l = i.alphaMode || xr.OPAQUE;
|
|
2995
|
+
if (l === xr.BLEND ? (o.transparent = !0, o.depthWrite = !1) : (o.transparent = !1, l === xr.MASK && (o.alphaTest = i.alphaCutoff === void 0 ? .5 : i.alphaCutoff)), i.normalTexture !== void 0 && a !== Ue && (c.push(t.assignTexture(o, "normalMap", i.normalTexture)), o.normalScale = new B(1, 1), i.normalTexture.scale !== void 0)) {
|
|
2970
2996
|
let e = i.normalTexture.scale;
|
|
2971
2997
|
o.normalScale.set(e, e);
|
|
2972
2998
|
}
|
|
@@ -2976,7 +3002,7 @@ var Tr = new Ve(), Er = class {
|
|
|
2976
3002
|
}
|
|
2977
3003
|
return i.emissiveTexture !== void 0 && a !== Ue && c.push(t.assignTexture(o, "emissiveMap", i.emissiveTexture, pt)), Promise.all(c).then(function() {
|
|
2978
3004
|
let n = new a(o);
|
|
2979
|
-
return i.name && (n.name = i.name),
|
|
3005
|
+
return i.name && (n.name = i.name), wr(n, i), t.associations.set(n, { materials: e }), i.extensions && Cr(r, n, i), n;
|
|
2980
3006
|
});
|
|
2981
3007
|
}
|
|
2982
3008
|
createUniqueName(e) {
|
|
@@ -2987,16 +3013,16 @@ var Tr = new Ve(), Er = class {
|
|
|
2987
3013
|
let t = this, n = this.extensions, r = this.primitiveCache;
|
|
2988
3014
|
function i(e) {
|
|
2989
3015
|
return n[W.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e, t).then(function(n) {
|
|
2990
|
-
return
|
|
3016
|
+
return Pr(n, e, t);
|
|
2991
3017
|
});
|
|
2992
3018
|
}
|
|
2993
3019
|
let a = [];
|
|
2994
3020
|
for (let n = 0, o = e.length; n < o; n++) {
|
|
2995
|
-
let o = e[n], s =
|
|
3021
|
+
let o = e[n], s = Dr(o), c = r[s];
|
|
2996
3022
|
if (c) a.push(c.promise);
|
|
2997
3023
|
else {
|
|
2998
3024
|
let e;
|
|
2999
|
-
e = o.extensions && o.extensions[W.KHR_DRACO_MESH_COMPRESSION] ? i(o) :
|
|
3025
|
+
e = o.extensions && o.extensions[W.KHR_DRACO_MESH_COMPRESSION] ? i(o) : Pr(new pe(), o, t), r[s] = {
|
|
3000
3026
|
primitive: o,
|
|
3001
3027
|
promise: e
|
|
3002
3028
|
}, a.push(e);
|
|
@@ -3007,28 +3033,28 @@ var Tr = new Ve(), Er = class {
|
|
|
3007
3033
|
loadMesh(e) {
|
|
3008
3034
|
let t = this, n = this.json, r = this.extensions, i = n.meshes[e], a = i.primitives, o = [];
|
|
3009
3035
|
for (let e = 0, t = a.length; e < t; e++) {
|
|
3010
|
-
let t = a[e].material === void 0 ?
|
|
3036
|
+
let t = a[e].material === void 0 ? Sr(this.cache) : this.getDependency("material", a[e].material);
|
|
3011
3037
|
o.push(t);
|
|
3012
3038
|
}
|
|
3013
3039
|
return o.push(t.loadGeometries(a)), Promise.all(o).then(function(n) {
|
|
3014
3040
|
let o = n.slice(0, n.length - 1), s = n[n.length - 1], c = [];
|
|
3015
3041
|
for (let n = 0, l = s.length; n < l; n++) {
|
|
3016
3042
|
let l = s[n], u = a[n], d, f = o[n];
|
|
3017
|
-
if (u.mode ===
|
|
3018
|
-
else if (u.mode ===
|
|
3019
|
-
else if (u.mode ===
|
|
3020
|
-
else if (u.mode ===
|
|
3021
|
-
else if (u.mode ===
|
|
3043
|
+
if (u.mode === pr.TRIANGLES || u.mode === pr.TRIANGLE_STRIP || u.mode === pr.TRIANGLE_FAN || u.mode === void 0) d = i.isSkinnedMesh === !0 ? new gt(l, f) : new He(l, f), d.isSkinnedMesh === !0 && d.normalizeSkinWeights(), u.mode === pr.TRIANGLE_STRIP ? d.geometry = Pn(d.geometry, wt) : u.mode === pr.TRIANGLE_FAN && (d.geometry = Pn(d.geometry, Ct));
|
|
3044
|
+
else if (u.mode === pr.LINES) d = new Ne(l, f);
|
|
3045
|
+
else if (u.mode === pr.LINE_STRIP) d = new Ae(l, f);
|
|
3046
|
+
else if (u.mode === pr.LINE_LOOP) d = new Me(l, f);
|
|
3047
|
+
else if (u.mode === pr.POINTS) d = new R(l, f);
|
|
3022
3048
|
else throw Error("THREE.GLTFLoader: Primitive mode unsupported: " + u.mode);
|
|
3023
|
-
Object.keys(d.geometry.morphAttributes).length > 0 &&
|
|
3049
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && Er(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), wr(d, i), u.extensions && Cr(r, d, u), t.assignFinalMaterial(d), c.push(d);
|
|
3024
3050
|
}
|
|
3025
3051
|
for (let n = 0, r = c.length; n < r; n++) t.associations.set(c[n], {
|
|
3026
3052
|
meshes: e,
|
|
3027
3053
|
primitives: n
|
|
3028
3054
|
});
|
|
3029
|
-
if (c.length === 1) return i.extensions &&
|
|
3055
|
+
if (c.length === 1) return i.extensions && Cr(r, c[0], i), c[0];
|
|
3030
3056
|
let l = new j();
|
|
3031
|
-
i.extensions &&
|
|
3057
|
+
i.extensions && Cr(r, l, i), t.associations.set(l, { meshes: e });
|
|
3032
3058
|
for (let e = 0, t = c.length; e < t; e++) l.add(c[e]);
|
|
3033
3059
|
return l;
|
|
3034
3060
|
});
|
|
@@ -3039,7 +3065,7 @@ var Tr = new Ve(), Er = class {
|
|
|
3039
3065
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3040
3066
|
return;
|
|
3041
3067
|
}
|
|
3042
|
-
return n.type === "perspective" ? t = new et(Be.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new $e(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)),
|
|
3068
|
+
return n.type === "perspective" ? t = new et(Be.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new $e(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), wr(t, n), Promise.resolve(t);
|
|
3043
3069
|
}
|
|
3044
3070
|
loadSkin(e) {
|
|
3045
3071
|
let t = this.json.skins[e], n = [];
|
|
@@ -3079,7 +3105,7 @@ var Tr = new Ve(), Er = class {
|
|
|
3079
3105
|
if (p) for (let e = 0; e < p.length; e++) l.push(p[e]);
|
|
3080
3106
|
}
|
|
3081
3107
|
let u = new se(i, void 0, l);
|
|
3082
|
-
return
|
|
3108
|
+
return wr(u, r), u;
|
|
3083
3109
|
});
|
|
3084
3110
|
}
|
|
3085
3111
|
createNodeMesh(e) {
|
|
@@ -3102,7 +3128,7 @@ var Tr = new Ve(), Er = class {
|
|
|
3102
3128
|
]).then(function(e) {
|
|
3103
3129
|
let t = e[0], n = e[1], r = e[2];
|
|
3104
3130
|
r !== null && t.traverse(function(e) {
|
|
3105
|
-
e.isSkinnedMesh && e.bind(r,
|
|
3131
|
+
e.isSkinnedMesh && e.bind(r, jr);
|
|
3106
3132
|
});
|
|
3107
3133
|
for (let e = 0, r = n.length; e < r; e++) t.add(n[e]);
|
|
3108
3134
|
if (t.userData.pivot !== void 0 && n.length > 0) {
|
|
@@ -3127,7 +3153,7 @@ var Tr = new Ve(), Er = class {
|
|
|
3127
3153
|
}), this.nodeCache[e] = Promise.all(o).then(function(t) {
|
|
3128
3154
|
let o;
|
|
3129
3155
|
if (o = i.isBone === !0 ? new le() : t.length > 1 ? new j() : t.length === 1 ? t[0] : new Qe(), o !== t[0]) for (let e = 0, n = t.length; e < n; e++) o.add(t[e]);
|
|
3130
|
-
if (i.name && (o.userData.name = i.name, o.name = a),
|
|
3156
|
+
if (i.name && (o.userData.name = i.name, o.name = a), wr(o, i), i.extensions && Cr(n, o, i), i.matrix !== void 0) {
|
|
3131
3157
|
let e = new Ve();
|
|
3132
3158
|
e.fromArray(i.matrix), o.applyMatrix4(e);
|
|
3133
3159
|
} else i.translation !== void 0 && o.position.fromArray(i.translation), i.rotation !== void 0 && o.quaternion.fromArray(i.rotation), i.scale !== void 0 && o.scale.fromArray(i.scale);
|
|
@@ -3141,13 +3167,13 @@ var Tr = new Ve(), Er = class {
|
|
|
3141
3167
|
}
|
|
3142
3168
|
loadScene(e) {
|
|
3143
3169
|
let t = this.extensions, n = this.json.scenes[e], r = this, i = new j();
|
|
3144
|
-
n.name && (i.name = r.createUniqueName(n.name)),
|
|
3170
|
+
n.name && (i.name = r.createUniqueName(n.name)), wr(i, n), n.extensions && Cr(t, i, n);
|
|
3145
3171
|
let a = n.nodes || [], o = [];
|
|
3146
3172
|
for (let e = 0, t = a.length; e < t; e++) o.push(r.getDependency("node", a[e]));
|
|
3147
3173
|
return Promise.all(o).then(function(e) {
|
|
3148
3174
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
3149
3175
|
let n = e[t];
|
|
3150
|
-
n.parent === null ? i.add(n) : i.add(
|
|
3176
|
+
n.parent === null ? i.add(n) : i.add(Fn(n));
|
|
3151
3177
|
}
|
|
3152
3178
|
return r.associations = ((e) => {
|
|
3153
3179
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3164,17 +3190,17 @@ var Tr = new Ve(), Er = class {
|
|
|
3164
3190
|
function c(e) {
|
|
3165
3191
|
e.morphTargetInfluences && s.push(e.name ? e.name : e.uuid);
|
|
3166
3192
|
}
|
|
3167
|
-
|
|
3193
|
+
yr[i.path] === yr.weights ? (c(e), e.isGroup && e.children.forEach(c)) : s.push(o);
|
|
3168
3194
|
let l;
|
|
3169
|
-
switch (
|
|
3170
|
-
case
|
|
3195
|
+
switch (yr[i.path]) {
|
|
3196
|
+
case yr.weights:
|
|
3171
3197
|
l = Ze;
|
|
3172
3198
|
break;
|
|
3173
|
-
case
|
|
3199
|
+
case yr.rotation:
|
|
3174
3200
|
l = ot;
|
|
3175
3201
|
break;
|
|
3176
|
-
case
|
|
3177
|
-
case
|
|
3202
|
+
case yr.translation:
|
|
3203
|
+
case yr.scale:
|
|
3178
3204
|
l = Et;
|
|
3179
3205
|
break;
|
|
3180
3206
|
default:
|
|
@@ -3188,9 +3214,9 @@ var Tr = new Ve(), Er = class {
|
|
|
3188
3214
|
}
|
|
3189
3215
|
break;
|
|
3190
3216
|
}
|
|
3191
|
-
let u = r.interpolation === void 0 ? ke :
|
|
3217
|
+
let u = r.interpolation === void 0 ? ke : br[r.interpolation], d = this._getArrayFromAccessor(n);
|
|
3192
3218
|
for (let e = 0, n = s.length; e < n; e++) {
|
|
3193
|
-
let n = new l(s[e] + "." +
|
|
3219
|
+
let n = new l(s[e] + "." + yr[i.path], t.array, d, u);
|
|
3194
3220
|
r.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(n), a.push(n);
|
|
3195
3221
|
}
|
|
3196
3222
|
return a;
|
|
@@ -3198,7 +3224,7 @@ var Tr = new Ve(), Er = class {
|
|
|
3198
3224
|
_getArrayFromAccessor(e) {
|
|
3199
3225
|
let t = e.array;
|
|
3200
3226
|
if (e.normalized) {
|
|
3201
|
-
let e =
|
|
3227
|
+
let e = kr(t.constructor), n = new Float32Array(t.length);
|
|
3202
3228
|
for (let r = 0, i = t.length; r < i; r++) n[r] = t[r] * e;
|
|
3203
3229
|
t = n;
|
|
3204
3230
|
}
|
|
@@ -3206,17 +3232,17 @@ var Tr = new Ve(), Er = class {
|
|
|
3206
3232
|
}
|
|
3207
3233
|
_createCubicSplineTrackInterpolant(e) {
|
|
3208
3234
|
e.createInterpolant = function(e) {
|
|
3209
|
-
return new (this instanceof ot ?
|
|
3235
|
+
return new (this instanceof ot ? fr : ur)(this.times, this.values, this.getValueSize() / 3, e);
|
|
3210
3236
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3211
3237
|
}
|
|
3212
3238
|
};
|
|
3213
|
-
function
|
|
3239
|
+
function Nr(e, t, n) {
|
|
3214
3240
|
let r = t.attributes, i = new ue();
|
|
3215
3241
|
if (r.POSITION !== void 0) {
|
|
3216
3242
|
let e = n.json.accessors[r.POSITION], t = e.min, a = e.max;
|
|
3217
3243
|
if (t !== void 0 && a !== void 0) {
|
|
3218
3244
|
if (i.set(new V(t[0], t[1], t[2]), new V(a[0], a[1], a[2])), e.normalized) {
|
|
3219
|
-
let t =
|
|
3245
|
+
let t = kr(mr[e.componentType]);
|
|
3220
3246
|
i.min.multiplyScalar(t), i.max.multiplyScalar(t);
|
|
3221
3247
|
}
|
|
3222
3248
|
} else {
|
|
@@ -3233,7 +3259,7 @@ function Dr(e, t, n) {
|
|
|
3233
3259
|
let r = n.json.accessors[i.POSITION], a = r.min, o = r.max;
|
|
3234
3260
|
if (a !== void 0 && o !== void 0) {
|
|
3235
3261
|
if (t.setX(Math.max(Math.abs(a[0]), Math.abs(o[0]))), t.setY(Math.max(Math.abs(a[1]), Math.abs(o[1]))), t.setZ(Math.max(Math.abs(a[2]), Math.abs(o[2]))), r.normalized) {
|
|
3236
|
-
let e =
|
|
3262
|
+
let e = kr(mr[r.componentType]);
|
|
3237
3263
|
t.multiplyScalar(e);
|
|
3238
3264
|
}
|
|
3239
3265
|
e.max(t);
|
|
@@ -3246,7 +3272,7 @@ function Dr(e, t, n) {
|
|
|
3246
3272
|
let o = new _t();
|
|
3247
3273
|
i.getCenter(o.center), o.radius = i.min.distanceTo(i.max) / 2, e.boundingSphere = o;
|
|
3248
3274
|
}
|
|
3249
|
-
function
|
|
3275
|
+
function Pr(e, t, n) {
|
|
3250
3276
|
let r = t.attributes, i = [];
|
|
3251
3277
|
function a(t, r) {
|
|
3252
3278
|
return n.getDependency("accessor", t).then(function(t) {
|
|
@@ -3254,7 +3280,7 @@ function Or(e, t, n) {
|
|
|
3254
3280
|
});
|
|
3255
3281
|
}
|
|
3256
3282
|
for (let t in r) {
|
|
3257
|
-
let n =
|
|
3283
|
+
let n = vr[t] || t.toLowerCase();
|
|
3258
3284
|
n in e.attributes || i.push(a(r[t], n));
|
|
3259
3285
|
}
|
|
3260
3286
|
if (t.indices !== void 0 && !e.index) {
|
|
@@ -3263,35 +3289,35 @@ function Or(e, t, n) {
|
|
|
3263
3289
|
});
|
|
3264
3290
|
i.push(r);
|
|
3265
3291
|
}
|
|
3266
|
-
return ge.workingColorSpace !== I && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ge.workingColorSpace}" not supported.`),
|
|
3267
|
-
return t.targets === void 0 ? e :
|
|
3292
|
+
return ge.workingColorSpace !== I && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ge.workingColorSpace}" not supported.`), wr(e, t), Nr(e, t, n), Promise.all(i).then(function() {
|
|
3293
|
+
return t.targets === void 0 ? e : Tr(e, t.targets, n);
|
|
3268
3294
|
});
|
|
3269
3295
|
}
|
|
3270
3296
|
//#endregion
|
|
3271
3297
|
//#region src/infrastructure/three/gltf/materialVariants.ts
|
|
3272
|
-
var
|
|
3273
|
-
function
|
|
3274
|
-
let t = (e.userData.gltfExtensions?.[
|
|
3275
|
-
t.length !== 0 && (e.userData[Ot] = t, e.scene.userData[
|
|
3298
|
+
var Fr = "KHR_materials_variants", Ir = "softboxVariantMaterials", Lr = "softboxDefaultMaterial", Rr = "softboxVariantResolution";
|
|
3299
|
+
function zr(e) {
|
|
3300
|
+
let t = (e.userData.gltfExtensions?.[Fr]?.variants ?? []).map((e) => e.name).filter((e) => typeof e == "string");
|
|
3301
|
+
t.length !== 0 && (e.userData[Ot] = t, e.scene.userData[Rr] = Vr(e, t).catch((e) => {
|
|
3276
3302
|
console.warn("Failed to resolve material variants:", e);
|
|
3277
3303
|
}));
|
|
3278
3304
|
}
|
|
3279
|
-
function
|
|
3305
|
+
function Br(e) {
|
|
3280
3306
|
let t = [];
|
|
3281
3307
|
return e.traverse((e) => {
|
|
3282
|
-
let n = e.userData[
|
|
3308
|
+
let n = e.userData[Rr];
|
|
3283
3309
|
n && t.push(n);
|
|
3284
3310
|
}), Promise.all(t).then(() => void 0);
|
|
3285
3311
|
}
|
|
3286
|
-
async function
|
|
3312
|
+
async function Vr(e, t) {
|
|
3287
3313
|
let n = e.parser, r = [];
|
|
3288
3314
|
e.scene.traverse((e) => {
|
|
3289
3315
|
let t = e;
|
|
3290
|
-
t.isMesh && t.userData.gltfExtensions?.[
|
|
3291
|
-
}), await Promise.all(r.map((e) =>
|
|
3316
|
+
t.isMesh && t.userData.gltfExtensions?.[Fr] && r.push(t);
|
|
3317
|
+
}), await Promise.all(r.map((e) => Hr(e, n, t)));
|
|
3292
3318
|
}
|
|
3293
|
-
async function
|
|
3294
|
-
let r = e.userData.gltfExtensions[
|
|
3319
|
+
async function Hr(e, t, n) {
|
|
3320
|
+
let r = e.userData.gltfExtensions[Fr].mappings ?? [], i = e.material, o = {};
|
|
3295
3321
|
try {
|
|
3296
3322
|
for (let i of r) {
|
|
3297
3323
|
e.material = await t.getDependency("material", i.material), t.assignFinalMaterial(e);
|
|
@@ -3309,22 +3335,22 @@ async function Ir(e, t, n) {
|
|
|
3309
3335
|
s.forEach(a);
|
|
3310
3336
|
return;
|
|
3311
3337
|
}
|
|
3312
|
-
e.userData[
|
|
3338
|
+
e.userData[Ir] = o, e.userData[Lr] = i, e.userData[d] = [.../* @__PURE__ */ new Set([...s, ...c])];
|
|
3313
3339
|
}
|
|
3314
|
-
function
|
|
3340
|
+
function Ur(e, t) {
|
|
3315
3341
|
let n = !1;
|
|
3316
3342
|
return e.traverse((e) => {
|
|
3317
3343
|
let r = e;
|
|
3318
3344
|
if (!r.isMesh || !r.userData.softboxVariantMaterials) return;
|
|
3319
|
-
let i = r.userData[
|
|
3345
|
+
let i = r.userData[Ir], a = (t === null ? void 0 : i[t]) ?? r.userData.softboxDefaultMaterial;
|
|
3320
3346
|
r.material !== a && (r.material = a, n = !0);
|
|
3321
3347
|
}), n;
|
|
3322
3348
|
}
|
|
3323
3349
|
//#endregion
|
|
3324
3350
|
//#region src/infrastructure/three/ThreeModelLoader.ts
|
|
3325
|
-
var
|
|
3351
|
+
var Wr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/examples/jsm/libs`, Gr = `${Wr}/draco/`, Kr = `${Wr}/basis/`, qr = class {
|
|
3326
3352
|
constructor(e = {}) {
|
|
3327
|
-
this.loadingManager = new A.LoadingManager(), this.loader = new
|
|
3353
|
+
this.loadingManager = new A.LoadingManager(), this.loader = new Ln(this.loadingManager), this.config = e;
|
|
3328
3354
|
}
|
|
3329
3355
|
ensureDecoders() {
|
|
3330
3356
|
return this.decodersReady ||= this.configureDecoders(), this.decodersReady;
|
|
@@ -3337,11 +3363,11 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3337
3363
|
}
|
|
3338
3364
|
async configureDraco(e) {
|
|
3339
3365
|
let { DRACOLoader: t } = await import("three/examples/jsm/loaders/DRACOLoader.js"), n = new t(this.loadingManager);
|
|
3340
|
-
n.setDecoderPath(e.dracoDecoderPath ??
|
|
3366
|
+
n.setDecoderPath(e.dracoDecoderPath ?? Gr), this.dracoLoader = n, this.loader.setDRACOLoader(n);
|
|
3341
3367
|
}
|
|
3342
3368
|
async configureKtx2(e) {
|
|
3343
3369
|
let { KTX2Loader: t } = await import("three/examples/jsm/loaders/KTX2Loader.js"), n = new t(this.loadingManager);
|
|
3344
|
-
n.setTranscoderPath(e.ktx2TranscoderPath ??
|
|
3370
|
+
n.setTranscoderPath(e.ktx2TranscoderPath ?? Kr), e.renderer && n.detectSupport(e.renderer), this.ktx2Loader = n, this.loader.setKTX2Loader(n);
|
|
3345
3371
|
}
|
|
3346
3372
|
async configureMeshopt() {
|
|
3347
3373
|
let e = await import("three/examples/jsm/libs/meshopt_decoder.module.js");
|
|
@@ -3353,7 +3379,7 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3353
3379
|
this.loader.load(e, (e) => {
|
|
3354
3380
|
(this.config.bvh ?? !0) && s(e.scene);
|
|
3355
3381
|
try {
|
|
3356
|
-
|
|
3382
|
+
zr(e);
|
|
3357
3383
|
} catch (e) {
|
|
3358
3384
|
console.warn("Failed to resolve material variants:", e);
|
|
3359
3385
|
}
|
|
@@ -3413,19 +3439,19 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3413
3439
|
getTrackType(e) {
|
|
3414
3440
|
return e instanceof A.VectorKeyframeTrack ? "vector" : e instanceof A.QuaternionKeyframeTrack ? "quaternion" : e instanceof A.NumberKeyframeTrack ? "number" : e instanceof A.BooleanKeyframeTrack ? "boolean" : "number";
|
|
3415
3441
|
}
|
|
3416
|
-
},
|
|
3442
|
+
}, Jr = class {
|
|
3417
3443
|
static createLoader(e, n = {}) {
|
|
3418
3444
|
let r = e.split(".").pop()?.toLowerCase();
|
|
3419
3445
|
switch (r) {
|
|
3420
3446
|
case "gltf":
|
|
3421
|
-
case "glb": return new
|
|
3447
|
+
case "glb": return new qr(n);
|
|
3422
3448
|
default: throw new t(`Unsupported file format: ${r}`, i.UNSUPPORTED_FORMAT, {
|
|
3423
3449
|
url: e,
|
|
3424
3450
|
extension: r
|
|
3425
3451
|
});
|
|
3426
3452
|
}
|
|
3427
3453
|
}
|
|
3428
|
-
},
|
|
3454
|
+
}, Yr = { type: "change" }, Xr = { type: "start" }, Zr = { type: "end" }, Qr = new lt(), $r = new tt(), ei = Math.cos(70 * Be.DEG2RAD), G = new V(), K = 2 * Math.PI, q = {
|
|
3429
3455
|
NONE: -1,
|
|
3430
3456
|
ROTATE: 0,
|
|
3431
3457
|
DOLLY: 1,
|
|
@@ -3434,7 +3460,7 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3434
3460
|
TOUCH_PAN: 4,
|
|
3435
3461
|
TOUCH_DOLLY_PAN: 5,
|
|
3436
3462
|
TOUCH_DOLLY_ROTATE: 6
|
|
3437
|
-
},
|
|
3463
|
+
}, ti = 1e-6, ni = class extends _e {
|
|
3438
3464
|
constructor(e, t = null) {
|
|
3439
3465
|
super(e, t), this.state = q.NONE, this.target = new V(), this.cursor = new V(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .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 = {
|
|
3440
3466
|
LEFT: "ArrowLeft",
|
|
@@ -3448,7 +3474,7 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3448
3474
|
}, this.touches = {
|
|
3449
3475
|
ONE: z.ROTATE,
|
|
3450
3476
|
TWO: z.DOLLY_PAN
|
|
3451
|
-
}, 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 V(), this._lastQuaternion = new at(), this._lastTargetPosition = new V(), this._quat = new at().setFromUnitVectors(e.up, new V(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new yt(), this._sphericalDelta = new yt(), this._scale = 1, this._panOffset = new V(), this._rotateStart = new B(), this._rotateEnd = new B(), this._rotateDelta = new B(), this._panStart = new B(), this._panEnd = new B(), this._panDelta = new B(), this._dollyStart = new B(), this._dollyEnd = new B(), this._dollyDelta = new B(), this._dollyDirection = new V(), this._mouse = new B(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
3477
|
+
}, 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 V(), this._lastQuaternion = new at(), this._lastTargetPosition = new V(), this._quat = new at().setFromUnitVectors(e.up, new V(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new yt(), this._sphericalDelta = new yt(), this._scale = 1, this._panOffset = new V(), this._rotateStart = new B(), this._rotateEnd = new B(), this._rotateDelta = new B(), this._panStart = new B(), this._panEnd = new B(), this._panDelta = new B(), this._dollyStart = new B(), this._dollyEnd = new B(), this._dollyDelta = new B(), this._dollyDirection = new V(), this._mouse = new B(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ii.bind(this), this._onPointerDown = ri.bind(this), this._onPointerUp = ai.bind(this), this._onContextMenu = fi.bind(this), this._onMouseWheel = ci.bind(this), this._onKeyDown = li.bind(this), this._onTouchStart = ui.bind(this), this._onTouchMove = di.bind(this), this._onMouseDown = oi.bind(this), this._onMouseMove = si.bind(this), this._interceptControlDown = pi.bind(this), this._interceptControlUp = mi.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
3452
3478
|
}
|
|
3453
3479
|
set cursorStyle(e) {
|
|
3454
3480
|
this._cursorStyle = e, e === "grab" ? this.domElement.style.cursor = "grab" : this.domElement.style.cursor = "auto";
|
|
@@ -3487,7 +3513,7 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3487
3513
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
3488
3514
|
}
|
|
3489
3515
|
reset() {
|
|
3490
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
3516
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Yr), this.update(), this.state = q.NONE;
|
|
3491
3517
|
}
|
|
3492
3518
|
pan(e, t) {
|
|
3493
3519
|
this._pan(e, t), this.update();
|
|
@@ -3530,12 +3556,12 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3530
3556
|
let r = new V(this._mouse.x, this._mouse.y, 0);
|
|
3531
3557
|
r.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = G.length();
|
|
3532
3558
|
} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
3533
|
-
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (
|
|
3559
|
+
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (Qr.origin.copy(this.object.position), Qr.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Qr.direction)) < ei ? this.object.lookAt(this.target) : ($r.setFromNormalAndCoplanarPoint(this.object.up, this.target), Qr.intersectPlane($r, this.target))));
|
|
3534
3560
|
} else if (this.object.isOrthographicCamera) {
|
|
3535
3561
|
let e = this.object.zoom;
|
|
3536
3562
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), e !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
3537
3563
|
}
|
|
3538
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) >
|
|
3564
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > ti || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > ti || this._lastTargetPosition.distanceToSquared(this.target) > ti ? (this.dispatchEvent(Yr), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
3539
3565
|
}
|
|
3540
3566
|
_getAutoRotationAngle(e) {
|
|
3541
3567
|
return e === null ? K / 60 / 60 * this.autoRotateSpeed : K / 60 * this.autoRotateSpeed * e;
|
|
@@ -3714,16 +3740,16 @@ var Rr = `https://cdn.jsdelivr.net/npm/three@0.${A.REVISION.replace(/\D/g, "")}/
|
|
|
3714
3740
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
3715
3741
|
}
|
|
3716
3742
|
};
|
|
3717
|
-
function
|
|
3743
|
+
function ri(e) {
|
|
3718
3744
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(e.pointerId), this.domElement.ownerDocument.addEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(e) && (this._addPointer(e), e.pointerType === "touch" ? this._onTouchStart(e) : this._onMouseDown(e), this._cursorStyle === "grab" && (this.domElement.style.cursor = "grabbing")));
|
|
3719
3745
|
}
|
|
3720
|
-
function
|
|
3746
|
+
function ii(e) {
|
|
3721
3747
|
this.enabled !== !1 && (e.pointerType === "touch" ? this._onTouchMove(e) : this._onMouseMove(e));
|
|
3722
3748
|
}
|
|
3723
|
-
function
|
|
3749
|
+
function ai(e) {
|
|
3724
3750
|
switch (this._removePointer(e), this._pointers.length) {
|
|
3725
3751
|
case 0:
|
|
3726
|
-
this.domElement.releasePointerCapture(e.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
3752
|
+
this.domElement.releasePointerCapture(e.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Zr), this.state = q.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
3727
3753
|
break;
|
|
3728
3754
|
case 1:
|
|
3729
3755
|
let t = this._pointers[0], n = this._pointerPositions[t];
|
|
@@ -3735,7 +3761,7 @@ function $r(e) {
|
|
|
3735
3761
|
break;
|
|
3736
3762
|
}
|
|
3737
3763
|
}
|
|
3738
|
-
function
|
|
3764
|
+
function oi(e) {
|
|
3739
3765
|
let t;
|
|
3740
3766
|
switch (e.button) {
|
|
3741
3767
|
case 0:
|
|
@@ -3774,9 +3800,9 @@ function ei(e) {
|
|
|
3774
3800
|
break;
|
|
3775
3801
|
default: this.state = q.NONE;
|
|
3776
3802
|
}
|
|
3777
|
-
this.state !== q.NONE && this.dispatchEvent(
|
|
3803
|
+
this.state !== q.NONE && this.dispatchEvent(Xr);
|
|
3778
3804
|
}
|
|
3779
|
-
function
|
|
3805
|
+
function si(e) {
|
|
3780
3806
|
switch (this.state) {
|
|
3781
3807
|
case q.ROTATE:
|
|
3782
3808
|
if (this.enableRotate === !1) return;
|
|
@@ -3792,13 +3818,13 @@ function ti(e) {
|
|
|
3792
3818
|
break;
|
|
3793
3819
|
}
|
|
3794
3820
|
}
|
|
3795
|
-
function
|
|
3796
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== q.NONE || (e.preventDefault(), this.dispatchEvent(
|
|
3821
|
+
function ci(e) {
|
|
3822
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== q.NONE || (e.preventDefault(), this.dispatchEvent(Xr), this._handleMouseWheel(this._customWheelEvent(e)), this.dispatchEvent(Zr));
|
|
3797
3823
|
}
|
|
3798
|
-
function
|
|
3824
|
+
function li(e) {
|
|
3799
3825
|
this.enabled !== !1 && this._handleKeyDown(e);
|
|
3800
3826
|
}
|
|
3801
|
-
function
|
|
3827
|
+
function ui(e) {
|
|
3802
3828
|
switch (this._trackPointer(e), this._pointers.length) {
|
|
3803
3829
|
case 1:
|
|
3804
3830
|
switch (this.touches.ONE) {
|
|
@@ -3828,9 +3854,9 @@ function ii(e) {
|
|
|
3828
3854
|
break;
|
|
3829
3855
|
default: this.state = q.NONE;
|
|
3830
3856
|
}
|
|
3831
|
-
this.state !== q.NONE && this.dispatchEvent(
|
|
3857
|
+
this.state !== q.NONE && this.dispatchEvent(Xr);
|
|
3832
3858
|
}
|
|
3833
|
-
function
|
|
3859
|
+
function di(e) {
|
|
3834
3860
|
switch (this._trackPointer(e), this.state) {
|
|
3835
3861
|
case q.TOUCH_ROTATE:
|
|
3836
3862
|
if (this.enableRotate === !1) return;
|
|
@@ -3851,16 +3877,16 @@ function ai(e) {
|
|
|
3851
3877
|
default: this.state = q.NONE;
|
|
3852
3878
|
}
|
|
3853
3879
|
}
|
|
3854
|
-
function
|
|
3880
|
+
function fi(e) {
|
|
3855
3881
|
this.enabled !== !1 && e.preventDefault();
|
|
3856
3882
|
}
|
|
3857
|
-
function
|
|
3883
|
+
function pi(e) {
|
|
3858
3884
|
e.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, {
|
|
3859
3885
|
passive: !0,
|
|
3860
3886
|
capture: !0
|
|
3861
3887
|
}));
|
|
3862
3888
|
}
|
|
3863
|
-
function
|
|
3889
|
+
function mi(e) {
|
|
3864
3890
|
e.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, {
|
|
3865
3891
|
passive: !0,
|
|
3866
3892
|
capture: !0
|
|
@@ -3868,7 +3894,7 @@ function ci(e) {
|
|
|
3868
3894
|
}
|
|
3869
3895
|
//#endregion
|
|
3870
3896
|
//#region node_modules/three/examples/jsm/controls/MapControls.js
|
|
3871
|
-
var
|
|
3897
|
+
var hi = new tt(), gi = new ut(), _i = new B(), vi = new V(), yi = class extends ni {
|
|
3872
3898
|
constructor(e, t) {
|
|
3873
3899
|
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = {
|
|
3874
3900
|
LEFT: L.PAN,
|
|
@@ -3881,9 +3907,9 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
3881
3907
|
}
|
|
3882
3908
|
_handleMouseDownPan(e) {
|
|
3883
3909
|
if (super._handleMouseDownPan(e), this._panOffset.set(0, 0, 0), this.screenSpacePanning === !0) return;
|
|
3884
|
-
|
|
3910
|
+
hi.setFromNormalAndCoplanarPoint(this.object.up, this.target);
|
|
3885
3911
|
let t = this.domElement.getBoundingClientRect();
|
|
3886
|
-
|
|
3912
|
+
_i.x = (e.clientX - t.left) / t.width * 2 - 1, _i.y = -((e.clientY - t.top) / t.height) * 2 + 1, gi.setFromCamera(_i, this.object), gi.ray.intersectPlane(hi, this._panWorldStart);
|
|
3887
3913
|
}
|
|
3888
3914
|
_handleMouseMovePan(e) {
|
|
3889
3915
|
if (this.screenSpacePanning === !0) {
|
|
@@ -3891,9 +3917,9 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
3891
3917
|
return;
|
|
3892
3918
|
}
|
|
3893
3919
|
let t = this.domElement.getBoundingClientRect();
|
|
3894
|
-
|
|
3920
|
+
_i.x = (e.clientX - t.left) / t.width * 2 - 1, _i.y = -((e.clientY - t.top) / t.height) * 2 + 1, gi.setFromCamera(_i, this.object), gi.ray.intersectPlane(hi, vi) && (vi.sub(this._panWorldStart), this._panOffset.copy(vi).negate(), this.update());
|
|
3895
3921
|
}
|
|
3896
|
-
},
|
|
3922
|
+
}, bi = class {
|
|
3897
3923
|
constructor(e) {
|
|
3898
3924
|
this.controls = e, this.targetAdapter = rn.fromThreeVector(e.target);
|
|
3899
3925
|
}
|
|
@@ -4027,16 +4053,16 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4027
4053
|
getThreeControls() {
|
|
4028
4054
|
return this.controls;
|
|
4029
4055
|
}
|
|
4030
|
-
},
|
|
4056
|
+
}, xi = class extends bi {
|
|
4031
4057
|
constructor(e, t) {
|
|
4032
|
-
super(new
|
|
4058
|
+
super(new ni(e, t));
|
|
4033
4059
|
}
|
|
4034
4060
|
get type() {
|
|
4035
4061
|
return "orbit";
|
|
4036
4062
|
}
|
|
4037
|
-
},
|
|
4063
|
+
}, Si = class extends bi {
|
|
4038
4064
|
constructor(e, t) {
|
|
4039
|
-
let n = new
|
|
4065
|
+
let n = new yi(e, t);
|
|
4040
4066
|
super(n), n.screenSpacePanning = !0;
|
|
4041
4067
|
}
|
|
4042
4068
|
get type() {
|
|
@@ -4046,9 +4072,9 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4046
4072
|
return !0;
|
|
4047
4073
|
}
|
|
4048
4074
|
set screenSpacePanning(e) {}
|
|
4049
|
-
},
|
|
4075
|
+
}, Ci = /* @__PURE__ */ function(e) {
|
|
4050
4076
|
return e.SHADOW_FLOOR = "shadow_floor", e.CONCRETE_DISC = "concrete_disc", e.SQUARE_WIRE = "square_wire", e.HEXAGONAL_WIRE = "hexagonal_wire", e.HEXAGONAL_GLASS = "hexagonal_glass", e.STONE_TILES = "stone_tiles", e.CUSTOM = "custom", e;
|
|
4051
|
-
}({}),
|
|
4077
|
+
}({}), wi = class {
|
|
4052
4078
|
constructor() {
|
|
4053
4079
|
this.name = "Square Wire Grid";
|
|
4054
4080
|
}
|
|
@@ -4061,7 +4087,7 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4061
4087
|
return a;
|
|
4062
4088
|
}
|
|
4063
4089
|
dispose() {}
|
|
4064
|
-
},
|
|
4090
|
+
}, Ti = class {
|
|
4065
4091
|
constructor() {
|
|
4066
4092
|
this.name = "Hexagonal Wire Grid";
|
|
4067
4093
|
}
|
|
@@ -4086,7 +4112,7 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4086
4112
|
return t;
|
|
4087
4113
|
}
|
|
4088
4114
|
dispose() {}
|
|
4089
|
-
},
|
|
4115
|
+
}, Ei = class {
|
|
4090
4116
|
static {
|
|
4091
4117
|
this.HEIGHT_RATIO = .075;
|
|
4092
4118
|
}
|
|
@@ -4121,9 +4147,9 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4121
4147
|
static getYPosition(e) {
|
|
4122
4148
|
return -this.getBevelSize(e);
|
|
4123
4149
|
}
|
|
4124
|
-
},
|
|
4150
|
+
}, Di = class {
|
|
4125
4151
|
constructor(e, t, n, r = {}) {
|
|
4126
|
-
this.position = e, this.size = t, this.color = n, this.materialOptions = r, this.height =
|
|
4152
|
+
this.position = e, this.size = t, this.color = n, this.materialOptions = r, this.height = Ei.getHeight(this.size), this.bevel = Ei.getBevelSize(this.size);
|
|
4127
4153
|
}
|
|
4128
4154
|
createGeometry() {
|
|
4129
4155
|
let e = new A.Shape(), t = this.size + this.bevel, n = Math.PI * 2 / 6;
|
|
@@ -4162,13 +4188,13 @@ var li = new tt(), ui = new ut(), di = new B(), fi = new V(), pi = class extends
|
|
|
4162
4188
|
};
|
|
4163
4189
|
//#endregion
|
|
4164
4190
|
//#region src/infrastructure/three/grids/shadowCatcher.ts
|
|
4165
|
-
function
|
|
4191
|
+
function Oi(e, t = .28) {
|
|
4166
4192
|
let n = new A.Mesh(new A.CircleGeometry(Math.max(e, 1), 64), new A.ShadowMaterial({ opacity: t }));
|
|
4167
4193
|
return n.name = ee, n.userData[h] = !0, n.rotation.x = -Math.PI / 2, n.position.y = .002, n.receiveShadow = !0, n;
|
|
4168
4194
|
}
|
|
4169
4195
|
//#endregion
|
|
4170
4196
|
//#region src/infrastructure/three/grids/HexagonalGlassGrid.ts
|
|
4171
|
-
function
|
|
4197
|
+
function ki(e, t) {
|
|
4172
4198
|
let n = e.getIndex() ? e.toNonIndexed() : e, r = n.getAttribute("position").array, i = n.getAttribute("normal").array, a = n.getAttribute("uv")?.array, o = new Float32Array(r.length * t.length), s = new Float32Array(i.length * t.length), c = a ? new Float32Array(a.length * t.length) : void 0;
|
|
4173
4199
|
t.forEach((e, t) => {
|
|
4174
4200
|
let n = t * r.length;
|
|
@@ -4179,27 +4205,27 @@ function Ci(e, t) {
|
|
|
4179
4205
|
let l = new A.BufferGeometry();
|
|
4180
4206
|
return l.setAttribute("position", new A.BufferAttribute(o, 3)), l.setAttribute("normal", new A.BufferAttribute(s, 3)), c && l.setAttribute("uv", new A.BufferAttribute(c, 2)), l;
|
|
4181
4207
|
}
|
|
4182
|
-
var
|
|
4208
|
+
var Ai = class {
|
|
4183
4209
|
constructor() {
|
|
4184
4210
|
this.name = "Hexagonal Glass Grid";
|
|
4185
4211
|
}
|
|
4186
4212
|
createGrid(e) {
|
|
4187
|
-
let t = new A.Group(), n = e.styleOptions?.hexRadius ?? Math.floor(e.divisions / 2), r = e.styleOptions?.tileSize || 1, i = String(e.color || "#ffffff"), a =
|
|
4213
|
+
let t = new A.Group(), n = e.styleOptions?.hexRadius ?? Math.floor(e.divisions / 2), r = e.styleOptions?.tileSize || 1, i = String(e.color || "#ffffff"), a = Ei.getGridSpacing(r), o = a.width, s = a.height, c = new Di(new A.Vector3(0, 0, 0), r, i, {
|
|
4188
4214
|
metalness: e.styleOptions?.metalness,
|
|
4189
4215
|
roughness: e.styleOptions?.roughness,
|
|
4190
4216
|
transmission: e.styleOptions?.transmission,
|
|
4191
4217
|
thickness: e.styleOptions?.thickness,
|
|
4192
4218
|
ior: e.styleOptions?.ior
|
|
4193
|
-
}), l = c.createGeometry(), u =
|
|
4219
|
+
}), l = c.createGeometry(), u = Ei.getYPosition(r), d = [];
|
|
4194
4220
|
for (let e = -n; e <= n; e++) {
|
|
4195
4221
|
let t = Math.max(-n, -e - n), r = Math.min(n, -e + n);
|
|
4196
4222
|
for (let n = t; n <= r; n++) d.push(new A.Vector3(o * (e + n / 2), u, s * .75 * n));
|
|
4197
4223
|
}
|
|
4198
|
-
let f = new A.Mesh(
|
|
4199
|
-
return f.receiveShadow = !0, t.add(f), l.dispose(), t.add(
|
|
4224
|
+
let f = new A.Mesh(ki(l, d), c.createMaterial());
|
|
4225
|
+
return f.receiveShadow = !0, t.add(f), l.dispose(), t.add(Oi(o * (n + .5), .35)), t;
|
|
4200
4226
|
}
|
|
4201
4227
|
dispose() {}
|
|
4202
|
-
},
|
|
4228
|
+
}, ji = class {
|
|
4203
4229
|
constructor() {
|
|
4204
4230
|
this.name = "Stone Tile Grid", this.textureLoader = new A.TextureLoader();
|
|
4205
4231
|
}
|
|
@@ -4248,13 +4274,13 @@ var wi = class {
|
|
|
4248
4274
|
return console.warn("Failed to load texture:", e, t), null;
|
|
4249
4275
|
}
|
|
4250
4276
|
}
|
|
4251
|
-
},
|
|
4277
|
+
}, Mi = class {
|
|
4252
4278
|
constructor() {
|
|
4253
4279
|
this.name = "Shadow Floor";
|
|
4254
4280
|
}
|
|
4255
4281
|
createGrid(e) {
|
|
4256
4282
|
let t = new A.Group(), n = Math.max(e.size || 1, 1) * 1.5;
|
|
4257
|
-
return t.add(
|
|
4283
|
+
return t.add(Oi(n)), t.add(this.createPathTracingDome(n)), t;
|
|
4258
4284
|
}
|
|
4259
4285
|
createPathTracingDome(e) {
|
|
4260
4286
|
let t = Math.max(e, 1), n = t * 1.6, r = t * 2, i = t * .5, a = n - i, o = [new A.Vector2(0, 0), new A.Vector2(a, 0)];
|
|
@@ -4272,14 +4298,14 @@ var wi = class {
|
|
|
4272
4298
|
return s.userData[u] = !0, s.position.y = .001, s.receiveShadow = !0, s.visible = !1, s;
|
|
4273
4299
|
}
|
|
4274
4300
|
dispose() {}
|
|
4275
|
-
},
|
|
4301
|
+
}, Ni = 4, Pi = 7, Fi = (e, t) => Math.min(Math.max(e / 10, .35), t), Ii = new A.Color(1.55, 1.62, 1.72), Li = 8, Ri = 70, zi = .55, Bi = "#b6b3ac", J = 512, Vi = 1592639710, Hi = (e) => {
|
|
4276
4302
|
let t = e;
|
|
4277
4303
|
return () => {
|
|
4278
4304
|
t |= 0, t = t + 1831565813 | 0;
|
|
4279
4305
|
let e = Math.imul(t ^ t >>> 15, 1 | t);
|
|
4280
4306
|
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
4281
4307
|
};
|
|
4282
|
-
},
|
|
4308
|
+
}, Ui = (e) => {
|
|
4283
4309
|
let t = /* @__PURE__ */ new Float32Array(16384);
|
|
4284
4310
|
for (let n = 0; n < t.length; n += 1) t[n] = e();
|
|
4285
4311
|
let n = (e, n, r) => {
|
|
@@ -4290,18 +4316,18 @@ var wi = class {
|
|
|
4290
4316
|
let i = e * r, a = t * r, o = Math.floor(i), s = Math.floor(a), c = S(i - o), l = S(a - s), u = n(o, s, r), d = n(o + 1, s, r), f = n(o, s + 1, r), p = n(o + 1, s + 1, r);
|
|
4291
4317
|
return (u * (1 - c) + d * c) * (1 - l) + (f * (1 - c) + p * c) * l;
|
|
4292
4318
|
};
|
|
4293
|
-
},
|
|
4319
|
+
}, Wi = (e) => (t, n) => .45 * e(t, n, 32) + .3 * e(t, n, 64) + .25 * e(t, n, 128), Gi = "\nvec3 softboxHash3(vec2 p) {\n return fract(sin(vec3(\n 1.0 + dot(p, vec2(37.0, 17.0)),\n 2.0 + dot(p, vec2(11.0, 47.0)),\n 3.0 + dot(p, vec2(41.0, 29.0))\n )) * 103.0);\n}\nmat2 softboxRot(float angle) {\n float s = sin(angle);\n float c = cos(angle);\n return mat2(c, -s, s, c);\n}\n// Full stochastic tiling: every virtual cell samples the SAME texture at a\n// hashed OFFSET and a hashed ROTATION (rotation is what kills directional\n// streaks — offsets alone leave the texture's grain orientation correlated\n// across cells), blended variance-preservingly (Heitz/Deliot): plain\n// averaging flattens contrast in every blend zone and that mush itself reads\n// as a cell-period quilt. Blend DEVIATIONS from the texture mean (top mip)\n// and renormalize by the blend energy — contrast stays constant everywhere.\n// textureGrad keeps mip selection continuous across the per-cell jumps.\nvec4 softboxCellSample(sampler2D samp, vec2 uv, vec2 cell, vec2 ddxv, vec2 ddyv) {\n vec3 h = softboxHash3(cell);\n mat2 rotation = softboxRot(h.z * 6.2831853);\n return textureGrad(samp, rotation * uv + h.xy, rotation * ddxv, rotation * ddyv);\n}\nvoid softboxCellWeights(vec2 uv, out vec2 iuv, out vec4 weights) {\n vec2 t = smoothstep(0.25, 0.75, fract(uv));\n iuv = floor(uv);\n weights = vec4(\n (1.0 - t.x) * (1.0 - t.y),\n t.x * (1.0 - t.y),\n (1.0 - t.x) * t.y,\n t.x * t.y\n );\n}\nvec4 softboxTextureNoTile(sampler2D samp, vec2 uv) {\n vec2 iuv;\n vec4 w;\n softboxCellWeights(uv, iuv, w);\n vec2 ddxv = dFdx(uv);\n vec2 ddyv = dFdy(uv);\n vec4 mean = textureLod(samp, uv, 10.0);\n vec4 a = softboxCellSample(samp, uv, iuv, ddxv, ddyv) - mean;\n vec4 b = softboxCellSample(samp, uv, iuv + vec2(1.0, 0.0), ddxv, ddyv) - mean;\n vec4 c = softboxCellSample(samp, uv, iuv + vec2(0.0, 1.0), ddxv, ddyv) - mean;\n vec4 d = softboxCellSample(samp, uv, iuv + vec2(1.0, 1.0), ddxv, ddyv) - mean;\n vec4 blended = mean + (w.x * a + w.y * b + w.z * c + w.w * d) * inversesqrt(dot(w, w));\n return clamp(blended, 0.0, 1.0);\n}\n// Tangent-space normals need the inverse per-cell rotation applied to each\n// sampled vector BEFORE blending, or the relief would point the wrong way.\nvec3 softboxNormalCellSample(sampler2D samp, vec2 uv, vec2 cell, vec2 ddxv, vec2 ddyv) {\n vec3 h = softboxHash3(cell);\n float angle = h.z * 6.2831853;\n mat2 rotation = softboxRot(angle);\n vec3 mapN = textureGrad(samp, rotation * uv + h.xy, rotation * ddxv, rotation * ddyv).xyz * 2.0 - 1.0;\n mapN.xy = softboxRot(-angle) * mapN.xy;\n return mapN;\n}\nvec3 softboxNormalNoTile(sampler2D samp, vec2 uv) {\n vec2 iuv;\n vec4 w;\n softboxCellWeights(uv, iuv, w);\n vec2 ddxv = dFdx(uv);\n vec2 ddyv = dFdy(uv);\n vec3 flat3 = vec3(0.0, 0.0, 1.0);\n vec3 a = softboxNormalCellSample(samp, uv, iuv, ddxv, ddyv) - flat3;\n vec3 b = softboxNormalCellSample(samp, uv, iuv + vec2(1.0, 0.0), ddxv, ddyv) - flat3;\n vec3 c = softboxNormalCellSample(samp, uv, iuv + vec2(0.0, 1.0), ddxv, ddyv) - flat3;\n vec3 d = softboxNormalCellSample(samp, uv, iuv + vec2(1.0, 1.0), ddxv, ddyv) - flat3;\n return normalize(\n flat3 + (w.x * a + w.y * b + w.z * c + w.w * d) * inversesqrt(dot(w, w))\n );\n}\n", Ki = "\n#ifdef USE_MAP\n vec4 sampledDiffuseColor = softboxTextureNoTile( map, vMapUv );\n diffuseColor *= sampledDiffuseColor;\n#endif\n", qi = "\n#ifdef USE_NORMALMAP_TANGENTSPACE\n vec3 mapN = softboxNormalNoTile( normalMap, vNormalMapUv );\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#endif\n", Ji = "\nfloat roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = softboxTextureNoTile( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif\n", Yi = (e) => {
|
|
4294
4320
|
e.onBeforeCompile = (e) => {
|
|
4295
|
-
e.fragmentShader = e.fragmentShader.replace("#include <common>", `#include <common>\n${
|
|
4321
|
+
e.fragmentShader = e.fragmentShader.replace("#include <common>", `#include <common>\n${Gi}`).replace("#include <map_fragment>", Ki).replace("#include <normal_fragment_maps>", qi).replace("#include <roughnessmap_fragment>", Ji);
|
|
4296
4322
|
};
|
|
4297
|
-
},
|
|
4298
|
-
let e =
|
|
4323
|
+
}, Xi = null, Zi = () => {
|
|
4324
|
+
let e = Hi(Vi), t = Wi(Ui(e)), n = new Float32Array(J * J);
|
|
4299
4325
|
for (let e = 0; e < J; e += 1) for (let r = 0; r < J; r += 1) n[e * J + r] = t(r / J, e / J);
|
|
4300
4326
|
for (let t = 0; t < 900; t += 1) {
|
|
4301
4327
|
let t = Math.floor(e() * J), r = Math.floor(e() * J), i = .12 + e() * .2;
|
|
4302
4328
|
n[r * J + t] = Math.max(0, n[r * J + t] - i);
|
|
4303
4329
|
}
|
|
4304
|
-
let r = (e, t) => n[(t + J) % J * J + (e + J) % J], i = new A.Color(
|
|
4330
|
+
let r = (e, t) => n[(t + J) % J * J + (e + J) % J], i = new A.Color(Bi), a = new Uint8ClampedArray(J * J * 4), o = new Uint8ClampedArray(J * J * 4), s = new Uint8ClampedArray(J * J * 4), c = 2.4;
|
|
4305
4331
|
for (let t = 0; t < J; t += 1) for (let n = 0; n < J; n += 1) {
|
|
4306
4332
|
let l = (t * J + n) * 4, u = r(n, t), d = .91 + u * .18 + (e() - .5) * .03;
|
|
4307
4333
|
a[l] = Math.min(255, i.r * 255 * d), a[l + 1] = Math.min(255, i.g * 255 * d), a[l + 2] = Math.min(255, i.b * 255 * d), a[l + 3] = 255;
|
|
@@ -4315,43 +4341,43 @@ var wi = class {
|
|
|
4315
4341
|
normal: o,
|
|
4316
4342
|
roughness: s
|
|
4317
4343
|
};
|
|
4318
|
-
},
|
|
4344
|
+
}, Qi = class {
|
|
4319
4345
|
constructor() {
|
|
4320
4346
|
this.name = "Concrete Disc";
|
|
4321
4347
|
}
|
|
4322
4348
|
createGrid(e) {
|
|
4323
|
-
let t = new A.Group(), n = Math.max(e.size || 1, 1), r = Math.min(n *
|
|
4349
|
+
let t = new A.Group(), n = Math.max(e.size || 1, 1), r = Math.min(n * Li, Ri), i = (e) => {
|
|
4324
4350
|
let t = new A.MeshStandardMaterial({
|
|
4325
|
-
color:
|
|
4351
|
+
color: Bi,
|
|
4326
4352
|
roughness: .95,
|
|
4327
4353
|
metalness: 0,
|
|
4328
4354
|
transparent: e,
|
|
4329
4355
|
vertexColors: !0
|
|
4330
4356
|
});
|
|
4331
|
-
return
|
|
4357
|
+
return Yi(t), t;
|
|
4332
4358
|
}, a = [i(!1), i(!0)];
|
|
4333
4359
|
e.styleOptions?.texture ? this.applyPhotoMaps(a, r, e.styleOptions) : this.applyProceduralMaps(a, r);
|
|
4334
|
-
let o = r *
|
|
4360
|
+
let o = r * zi, s = new A.Mesh(this.createGroundGeometry(r, 0, o), a[0]);
|
|
4335
4361
|
s.rotation.x = -Math.PI / 2, s.receiveShadow = !0, t.add(s);
|
|
4336
4362
|
let c = new A.Mesh(this.createGroundGeometry(r, o, r), a[1]);
|
|
4337
|
-
return c.rotation.x = -Math.PI / 2, c.receiveShadow = !0, c.renderOrder = -1, t.add(c), t.add(
|
|
4363
|
+
return c.rotation.x = -Math.PI / 2, c.receiveShadow = !0, c.renderOrder = -1, t.add(c), t.add(Oi(n * 1.5)), t;
|
|
4338
4364
|
}
|
|
4339
4365
|
applyPhotoMaps(e, t, n) {
|
|
4340
|
-
let r = new A.TextureLoader(), i = t * 2 /
|
|
4366
|
+
let r = new A.TextureLoader(), i = t * 2 / Fi(t, Pi), a = !1, o = () => {
|
|
4341
4367
|
if (!a && (a = !0, !e.every((e) => e.userData.softboxDisposed))) {
|
|
4342
|
-
for (let t of e) t.map?.dispose(), t.normalMap?.dispose(), t.roughnessMap?.dispose(), t.map = null, t.normalMap = null, t.roughnessMap = null, t.color = new A.Color(
|
|
4368
|
+
for (let t of e) t.map?.dispose(), t.normalMap?.dispose(), t.roughnessMap?.dispose(), t.map = null, t.normalMap = null, t.roughnessMap = null, t.color = new A.Color(Bi), t.roughness = .95, t.needsUpdate = !0;
|
|
4343
4369
|
this.applyProceduralMaps(e, t);
|
|
4344
4370
|
}
|
|
4345
4371
|
}, s = (e, t) => {
|
|
4346
4372
|
let n = r.load(e, void 0, void 0, o);
|
|
4347
4373
|
return n.wrapS = A.RepeatWrapping, n.wrapT = A.RepeatWrapping, n.repeat.set(i, i), n.anisotropy = 4, t && (n.colorSpace = A.SRGBColorSpace), n;
|
|
4348
4374
|
}, c = s(n.texture, !0), l = n.normalMap ? s(n.normalMap, !1) : null, u = n.roughnessMap ? s(n.roughnessMap, !1) : null;
|
|
4349
|
-
for (let t of e) t.map = c, l && (t.normalMap = l, t.normalScale = new A.Vector2(.9, .9)), u && (t.roughnessMap = u), t.color =
|
|
4375
|
+
for (let t of e) t.map = c, l && (t.normalMap = l, t.normalScale = new A.Vector2(.9, .9)), u && (t.roughnessMap = u), t.color = Ii.clone(), t.roughness = 1;
|
|
4350
4376
|
}
|
|
4351
4377
|
applyProceduralMaps(e, t) {
|
|
4352
4378
|
let n = this.createConcretePbrMaps();
|
|
4353
4379
|
if (!n) return;
|
|
4354
|
-
let r = t * 2 /
|
|
4380
|
+
let r = t * 2 / Fi(t, Ni);
|
|
4355
4381
|
for (let e of [
|
|
4356
4382
|
n.map,
|
|
4357
4383
|
n.normalMap,
|
|
@@ -4360,9 +4386,9 @@ var wi = class {
|
|
|
4360
4386
|
for (let t of e) t.map = n.map, t.normalMap = n.normalMap, t.normalScale = new A.Vector2(.6, .6), t.roughnessMap = n.roughnessMap, t.color = new A.Color("#ffffff"), t.roughness = 1;
|
|
4361
4387
|
}
|
|
4362
4388
|
createGroundGeometry(e, t, n) {
|
|
4363
|
-
let r = new A.RingGeometry(t, n, 128, 32), i =
|
|
4389
|
+
let r = new A.RingGeometry(t, n, 128, 32), i = Ui(Hi(-1059407513)), a = r.getAttribute("position"), o = new Float32Array(a.count * 4);
|
|
4364
4390
|
for (let t = 0; t < a.count; t += 1) {
|
|
4365
|
-
let n = a.getX(t), r = a.getY(t), s = Math.hypot(n, r) / e, c = s <=
|
|
4391
|
+
let n = a.getX(t), r = a.getY(t), s = Math.hypot(n, r) / e, c = s <= zi ? 1 : 1 - S(Math.min((s - zi) / (1 - zi), 1)), l = n / (e * 2) + .5, u = r / (e * 2) + .5, d = .9 + (.6 * i(l, u, 4) + .4 * i(l, u, 32)) * .2;
|
|
4366
4392
|
o[t * 4] = d, o[t * 4 + 1] = d, o[t * 4 + 2] = d, o[t * 4 + 3] = c;
|
|
4367
4393
|
}
|
|
4368
4394
|
return r.setAttribute("color", new A.BufferAttribute(o, 4)), r;
|
|
@@ -4377,11 +4403,11 @@ var wi = class {
|
|
|
4377
4403
|
if (!r) return null;
|
|
4378
4404
|
e.push(n), t.push(r);
|
|
4379
4405
|
}
|
|
4380
|
-
|
|
4406
|
+
Xi ??= Zi();
|
|
4381
4407
|
let n = [
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4408
|
+
Xi.albedo,
|
|
4409
|
+
Xi.normal,
|
|
4410
|
+
Xi.roughness
|
|
4385
4411
|
];
|
|
4386
4412
|
t.forEach((e, t) => {
|
|
4387
4413
|
let r = e.createImageData(J, J);
|
|
@@ -4398,22 +4424,22 @@ var wi = class {
|
|
|
4398
4424
|
};
|
|
4399
4425
|
}
|
|
4400
4426
|
dispose() {}
|
|
4401
|
-
},
|
|
4427
|
+
}, $i = class {
|
|
4402
4428
|
static {
|
|
4403
4429
|
this.gridStyles = /* @__PURE__ */ new Map([
|
|
4404
|
-
[
|
|
4405
|
-
[
|
|
4406
|
-
[
|
|
4407
|
-
[
|
|
4408
|
-
[
|
|
4409
|
-
[
|
|
4430
|
+
[Ci.SHADOW_FLOOR, new Mi()],
|
|
4431
|
+
[Ci.CONCRETE_DISC, new Qi()],
|
|
4432
|
+
[Ci.SQUARE_WIRE, new wi()],
|
|
4433
|
+
[Ci.HEXAGONAL_WIRE, new Ti()],
|
|
4434
|
+
[Ci.HEXAGONAL_GLASS, new Ai()],
|
|
4435
|
+
[Ci.STONE_TILES, new ji()]
|
|
4410
4436
|
]);
|
|
4411
4437
|
}
|
|
4412
4438
|
static createGrid(e, t) {
|
|
4413
4439
|
let n = this.gridStyles.get(e);
|
|
4414
4440
|
if (!n) {
|
|
4415
4441
|
console.warn(`Unknown grid type: ${e}, falling back to square wire grid`);
|
|
4416
|
-
let n = this.gridStyles.get(
|
|
4442
|
+
let n = this.gridStyles.get(Ci.SQUARE_WIRE);
|
|
4417
4443
|
if (!n) throw Error("Square wire grid style not found");
|
|
4418
4444
|
return n.createGrid(t);
|
|
4419
4445
|
}
|
|
@@ -4433,7 +4459,7 @@ var wi = class {
|
|
|
4433
4459
|
};
|
|
4434
4460
|
//#endregion
|
|
4435
4461
|
//#region src/infrastructure/three/sceneSetup/helpers.ts
|
|
4436
|
-
function
|
|
4462
|
+
function ea(e, n) {
|
|
4437
4463
|
try {
|
|
4438
4464
|
let a = v(e);
|
|
4439
4465
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4441,7 +4467,7 @@ function Ji(e, n) {
|
|
|
4441
4467
|
let e = a.userData, t = typeof n.grid == "object" ? n.grid : null, r = {
|
|
4442
4468
|
enabled: !0,
|
|
4443
4469
|
color: t?.colorGrid || n.gridColor || "#AAAAAA",
|
|
4444
|
-
type: t?.type ? t.type :
|
|
4470
|
+
type: t?.type ? t.type : Ci.HEXAGONAL_GLASS,
|
|
4445
4471
|
opacity: t?.opacity,
|
|
4446
4472
|
styleOptions: t?.styleOptions
|
|
4447
4473
|
};
|
|
@@ -4449,7 +4475,7 @@ function Ji(e, n) {
|
|
|
4449
4475
|
...e,
|
|
4450
4476
|
gridOptions: r
|
|
4451
4477
|
}, t?.size || t?.divisions) {
|
|
4452
|
-
let e = r.type ||
|
|
4478
|
+
let e = r.type || Ci.HEXAGONAL_GLASS, n = t.size || 10, i = t.divisions || 10, o = {
|
|
4453
4479
|
size: n,
|
|
4454
4480
|
divisions: i,
|
|
4455
4481
|
color: r.color,
|
|
@@ -4459,7 +4485,7 @@ function Ji(e, n) {
|
|
|
4459
4485
|
tileSize: 1,
|
|
4460
4486
|
...r.styleOptions
|
|
4461
4487
|
}
|
|
4462
|
-
}, s =
|
|
4488
|
+
}, s = $i.createGrid(e, o);
|
|
4463
4489
|
s.userData.isGrid = !0, s.userData.isDefaultGrid = !0, a.add(s);
|
|
4464
4490
|
}
|
|
4465
4491
|
}
|
|
@@ -4477,7 +4503,7 @@ function Ji(e, n) {
|
|
|
4477
4503
|
}
|
|
4478
4504
|
//#endregion
|
|
4479
4505
|
//#region src/infrastructure/three/sceneSetup/dynamicGrid.ts
|
|
4480
|
-
function
|
|
4506
|
+
function ta(e, n, a = 1.2) {
|
|
4481
4507
|
try {
|
|
4482
4508
|
let o = v(e);
|
|
4483
4509
|
if (!o) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4493,9 +4519,9 @@ function Yi(e, n, a = 1.2) {
|
|
|
4493
4519
|
if (!l) return r.err(new t("Object must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
4494
4520
|
let u = new A.Box3().setFromObject(l), d = u.getSize(new A.Vector3());
|
|
4495
4521
|
if (u.isEmpty() || !Number.isFinite(d.x) || !Number.isFinite(d.z)) return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), r.ok(void 0);
|
|
4496
|
-
let f = s.styleOptions?.tileSize, m = typeof f == "number" ? f : 1, h =
|
|
4522
|
+
let f = s.styleOptions?.tileSize, m = typeof f == "number" ? f : 1, h = Ei.getGridSpacing(m).width, g = Math.max(d.x, d.z) * a + d.y, _ = g <= h ? 0 : Math.ceil((g / h - 1) / 2);
|
|
4497
4523
|
_ > 60 && (console.warn(`Dynamic grid would need ${_} rings to cover the object; capping at 60. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`), _ = 60), g < h * .8 ? _ = 0 : _ < 3 && g > h * 2 && (_ = 3);
|
|
4498
|
-
let y = s.type ||
|
|
4524
|
+
let y = s.type || Ci.HEXAGONAL_GLASS, b = {
|
|
4499
4525
|
size: Math.max(d.x, d.z) * a,
|
|
4500
4526
|
divisions: _ * 2 + 1,
|
|
4501
4527
|
color: s.color,
|
|
@@ -4505,7 +4531,7 @@ function Yi(e, n, a = 1.2) {
|
|
|
4505
4531
|
tileSize: m,
|
|
4506
4532
|
...s.styleOptions
|
|
4507
4533
|
}
|
|
4508
|
-
}, x =
|
|
4534
|
+
}, x = $i.createGrid(y, b);
|
|
4509
4535
|
x.userData.isGrid = !0, x.userData.isHexGrid = !0;
|
|
4510
4536
|
let S = A.MathUtils.clamp(d.y * .0025, 2e-4, .002), C = x.getObjectByName(ee);
|
|
4511
4537
|
C && (C.position.y = S), x.traverse((e) => {
|
|
@@ -4519,7 +4545,7 @@ function Yi(e, n, a = 1.2) {
|
|
|
4519
4545
|
}
|
|
4520
4546
|
//#endregion
|
|
4521
4547
|
//#region src/infrastructure/three/sceneSetup/floorSnap.ts
|
|
4522
|
-
function
|
|
4548
|
+
function na(e, n) {
|
|
4523
4549
|
try {
|
|
4524
4550
|
let a = v(e);
|
|
4525
4551
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4566,7 +4592,7 @@ function Xi(e, n) {
|
|
|
4566
4592
|
}
|
|
4567
4593
|
//#endregion
|
|
4568
4594
|
//#region src/infrastructure/three/sceneSetup/findDirectionalLight.ts
|
|
4569
|
-
var
|
|
4595
|
+
var ra = (e) => {
|
|
4570
4596
|
let t = null;
|
|
4571
4597
|
return e.traverse((e) => {
|
|
4572
4598
|
!t && e.isDirectionalLight && (t = e);
|
|
@@ -4574,7 +4600,7 @@ var Zi = (e) => {
|
|
|
4574
4600
|
};
|
|
4575
4601
|
//#endregion
|
|
4576
4602
|
//#region src/infrastructure/three/sceneSetup/shadowRig.ts
|
|
4577
|
-
function
|
|
4603
|
+
function ia(e, n) {
|
|
4578
4604
|
try {
|
|
4579
4605
|
let a = v(e);
|
|
4580
4606
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4582,7 +4608,7 @@ function Qi(e, n) {
|
|
|
4582
4608
|
if (!o) return r.err(new t("Object must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
4583
4609
|
let s = new A.Box3().setFromObject(o);
|
|
4584
4610
|
if (s.isEmpty() || !Number.isFinite(s.min.x) || !Number.isFinite(s.max.x)) return r.ok(void 0);
|
|
4585
|
-
let c = s.getSize(new A.Vector3()), l = s.getCenter(new A.Vector3()), u =
|
|
4611
|
+
let c = s.getSize(new A.Vector3()), l = s.getCenter(new A.Vector3()), u = ra(a);
|
|
4586
4612
|
if (!u || !u.castShadow) return r.ok(void 0);
|
|
4587
4613
|
if (u.parent === a && u.target.parent === a) {
|
|
4588
4614
|
let e = u.position.clone().sub(u.target.position);
|
|
@@ -4598,7 +4624,7 @@ function Qi(e, n) {
|
|
|
4598
4624
|
}
|
|
4599
4625
|
//#endregion
|
|
4600
4626
|
//#region src/infrastructure/three/sceneSetup/contactShadow.ts
|
|
4601
|
-
function
|
|
4627
|
+
function aa(e, n, a, s) {
|
|
4602
4628
|
try {
|
|
4603
4629
|
let c = v(e);
|
|
4604
4630
|
if (!c) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4606,7 +4632,7 @@ function $i(e, n, a, s) {
|
|
|
4606
4632
|
if (!l) return r.err(new t("Object must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
4607
4633
|
let u = o(a);
|
|
4608
4634
|
if (!u || !u.shadowMap.enabled) return r.ok(void 0);
|
|
4609
|
-
let d =
|
|
4635
|
+
let d = ra(c);
|
|
4610
4636
|
return !d || !d.castShadow || s.bake({
|
|
4611
4637
|
renderer: u,
|
|
4612
4638
|
scene: c,
|
|
@@ -4617,7 +4643,7 @@ function $i(e, n, a, s) {
|
|
|
4617
4643
|
return r.err(new t("Failed to bake contact shadow", i.SCENE_OPERATION_FAILED, { originalError: e }));
|
|
4618
4644
|
}
|
|
4619
4645
|
}
|
|
4620
|
-
function
|
|
4646
|
+
function oa(e) {
|
|
4621
4647
|
try {
|
|
4622
4648
|
let n = v(e);
|
|
4623
4649
|
return n ? (y(n), r.ok(void 0)) : r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4625,7 +4651,7 @@ function ea(e) {
|
|
|
4625
4651
|
return r.err(new t("Failed to reset the contact shadow", i.SCENE_OPERATION_FAILED, { originalError: e }));
|
|
4626
4652
|
}
|
|
4627
4653
|
}
|
|
4628
|
-
function
|
|
4654
|
+
function sa(e, n) {
|
|
4629
4655
|
try {
|
|
4630
4656
|
let a = v(e);
|
|
4631
4657
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4637,7 +4663,7 @@ function ta(e, n) {
|
|
|
4637
4663
|
}
|
|
4638
4664
|
//#endregion
|
|
4639
4665
|
//#region src/infrastructure/three/sceneSetup/unitsScale.ts
|
|
4640
|
-
function
|
|
4666
|
+
function ca(n, a) {
|
|
4641
4667
|
try {
|
|
4642
4668
|
let o = p(n);
|
|
4643
4669
|
if (!o) return r.err(new t("Object must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
@@ -4649,7 +4675,7 @@ function na(n, a) {
|
|
|
4649
4675
|
}
|
|
4650
4676
|
//#endregion
|
|
4651
4677
|
//#region src/infrastructure/three/sceneSetup/lighting.ts
|
|
4652
|
-
function
|
|
4678
|
+
function la(e, n) {
|
|
4653
4679
|
try {
|
|
4654
4680
|
let a = v(e);
|
|
4655
4681
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4704,7 +4730,7 @@ function ra(e, n) {
|
|
|
4704
4730
|
}
|
|
4705
4731
|
//#endregion
|
|
4706
4732
|
//#region src/infrastructure/three/sceneSetup/gradientBackground.ts
|
|
4707
|
-
function
|
|
4733
|
+
function ua(e, n) {
|
|
4708
4734
|
try {
|
|
4709
4735
|
let a = v(e);
|
|
4710
4736
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
@@ -4725,7 +4751,7 @@ function ia(e, n) {
|
|
|
4725
4751
|
}
|
|
4726
4752
|
//#endregion
|
|
4727
4753
|
//#region src/infrastructure/three/sceneSetup/cameraFit.ts
|
|
4728
|
-
function
|
|
4754
|
+
function da(e, n, a) {
|
|
4729
4755
|
try {
|
|
4730
4756
|
let o = p(e);
|
|
4731
4757
|
if (!o) return r.err(new t("Object must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
@@ -4745,48 +4771,48 @@ function aa(e, n, a) {
|
|
|
4745
4771
|
}
|
|
4746
4772
|
//#endregion
|
|
4747
4773
|
//#region src/infrastructure/three/ThreeSceneSetupService.ts
|
|
4748
|
-
var
|
|
4774
|
+
var fa = class {
|
|
4749
4775
|
constructor() {
|
|
4750
4776
|
this.contactShadowBaker = new l();
|
|
4751
4777
|
}
|
|
4752
4778
|
addHelpers(e, t) {
|
|
4753
|
-
return
|
|
4779
|
+
return ea(e, t);
|
|
4754
4780
|
}
|
|
4755
4781
|
addDynamicGrid(e, t, n = 1.2) {
|
|
4756
|
-
return
|
|
4782
|
+
return ta(e, t, n);
|
|
4757
4783
|
}
|
|
4758
4784
|
snapObjectToFloor(e, t) {
|
|
4759
|
-
return
|
|
4785
|
+
return na(e, t);
|
|
4760
4786
|
}
|
|
4761
4787
|
fitShadowCameraToObject(e, t) {
|
|
4762
|
-
return
|
|
4788
|
+
return ia(e, t);
|
|
4763
4789
|
}
|
|
4764
4790
|
bakeContactShadow(e, t, n) {
|
|
4765
|
-
return
|
|
4791
|
+
return aa(e, t, n, this.contactShadowBaker);
|
|
4766
4792
|
}
|
|
4767
4793
|
resetContactShadow(e) {
|
|
4768
|
-
return
|
|
4794
|
+
return oa(e);
|
|
4769
4795
|
}
|
|
4770
4796
|
setContactShadowMode(e, t) {
|
|
4771
|
-
return
|
|
4797
|
+
return sa(e, t);
|
|
4772
4798
|
}
|
|
4773
4799
|
wrapInUnitsScaleGroup(e, t) {
|
|
4774
|
-
return
|
|
4800
|
+
return ca(e, t);
|
|
4775
4801
|
}
|
|
4776
4802
|
async applyMaterialVariant(e, n) {
|
|
4777
4803
|
let a = p(e);
|
|
4778
|
-
return a ? (await
|
|
4804
|
+
return a ? (await Br(a), r.ok(Ur(a, n))) : r.err(new t("Model must expose a Three.js Object3D", i.INVALID_PARAMETER));
|
|
4779
4805
|
}
|
|
4780
4806
|
addLighting(e, t) {
|
|
4781
|
-
return
|
|
4807
|
+
return la(e, t);
|
|
4782
4808
|
}
|
|
4783
4809
|
createGradientBackground(e, t) {
|
|
4784
|
-
return
|
|
4810
|
+
return ua(e, t);
|
|
4785
4811
|
}
|
|
4786
4812
|
fitCameraToObject(e, t, n) {
|
|
4787
|
-
return
|
|
4813
|
+
return da(e, t, n);
|
|
4788
4814
|
}
|
|
4789
|
-
},
|
|
4815
|
+
}, pa = class {
|
|
4790
4816
|
constructor() {
|
|
4791
4817
|
this.events = new n(), this.disposed = !1;
|
|
4792
4818
|
}
|
|
@@ -4836,7 +4862,7 @@ var oa = class {
|
|
|
4836
4862
|
isSupported() {
|
|
4837
4863
|
return this.inner?.isSupported() ?? !0;
|
|
4838
4864
|
}
|
|
4839
|
-
},
|
|
4865
|
+
}, ma = Uint8Array, ha = Uint16Array, ga = Int32Array, _a = new ma([
|
|
4840
4866
|
0,
|
|
4841
4867
|
0,
|
|
4842
4868
|
0,
|
|
@@ -4869,7 +4895,7 @@ var oa = class {
|
|
|
4869
4895
|
0,
|
|
4870
4896
|
0,
|
|
4871
4897
|
0
|
|
4872
|
-
]),
|
|
4898
|
+
]), va = new ma([
|
|
4873
4899
|
0,
|
|
4874
4900
|
0,
|
|
4875
4901
|
0,
|
|
@@ -4902,7 +4928,7 @@ var oa = class {
|
|
|
4902
4928
|
13,
|
|
4903
4929
|
0,
|
|
4904
4930
|
0
|
|
4905
|
-
]),
|
|
4931
|
+
]), ya = new ma([
|
|
4906
4932
|
16,
|
|
4907
4933
|
17,
|
|
4908
4934
|
18,
|
|
@@ -4922,51 +4948,51 @@ var oa = class {
|
|
|
4922
4948
|
14,
|
|
4923
4949
|
1,
|
|
4924
4950
|
15
|
|
4925
|
-
]),
|
|
4926
|
-
for (var n = new
|
|
4927
|
-
for (var i = new
|
|
4951
|
+
]), ba = function(e, t) {
|
|
4952
|
+
for (var n = new ha(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
|
|
4953
|
+
for (var i = new ga(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
|
|
4928
4954
|
return {
|
|
4929
4955
|
b: n,
|
|
4930
4956
|
r: i
|
|
4931
4957
|
};
|
|
4932
|
-
},
|
|
4933
|
-
|
|
4934
|
-
var
|
|
4935
|
-
|
|
4936
|
-
for (var
|
|
4937
|
-
var
|
|
4938
|
-
|
|
4958
|
+
}, xa = ba(_a, 2), Sa = xa.b, Ca = xa.r;
|
|
4959
|
+
Sa[28] = 258, Ca[258] = 28;
|
|
4960
|
+
var wa = ba(va, 0), Ta = wa.b;
|
|
4961
|
+
wa.r;
|
|
4962
|
+
for (var Ea = new ha(32768), Y = 0; Y < 32768; ++Y) {
|
|
4963
|
+
var Da = (Y & 43690) >> 1 | (Y & 21845) << 1;
|
|
4964
|
+
Da = (Da & 52428) >> 2 | (Da & 13107) << 2, Da = (Da & 61680) >> 4 | (Da & 3855) << 4, Ea[Y] = ((Da & 65280) >> 8 | (Da & 255) << 8) >> 1;
|
|
4939
4965
|
}
|
|
4940
|
-
for (var
|
|
4941
|
-
for (var r = e.length, i = 0, a = new
|
|
4942
|
-
var o = new
|
|
4966
|
+
for (var Oa = (function(e, t, n) {
|
|
4967
|
+
for (var r = e.length, i = 0, a = new ha(t); i < r; ++i) e[i] && ++a[e[i] - 1];
|
|
4968
|
+
var o = new ha(t);
|
|
4943
4969
|
for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
|
|
4944
4970
|
var s;
|
|
4945
4971
|
if (n) {
|
|
4946
|
-
s = new
|
|
4972
|
+
s = new ha(1 << t);
|
|
4947
4973
|
var c = 15 - t;
|
|
4948
|
-
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[
|
|
4949
|
-
} else for (s = new
|
|
4974
|
+
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[Ea[d] >> c] = l;
|
|
4975
|
+
} else for (s = new ha(r), i = 0; i < r; ++i) e[i] && (s[i] = Ea[o[e[i] - 1]++] >> 15 - e[i]);
|
|
4950
4976
|
return s;
|
|
4951
|
-
}),
|
|
4952
|
-
for (var Y = 144; Y < 256; ++Y)
|
|
4953
|
-
for (var Y = 256; Y < 280; ++Y)
|
|
4954
|
-
for (var Y = 280; Y < 288; ++Y)
|
|
4955
|
-
for (var
|
|
4956
|
-
var
|
|
4977
|
+
}), ka = new ma(288), Y = 0; Y < 144; ++Y) ka[Y] = 8;
|
|
4978
|
+
for (var Y = 144; Y < 256; ++Y) ka[Y] = 9;
|
|
4979
|
+
for (var Y = 256; Y < 280; ++Y) ka[Y] = 7;
|
|
4980
|
+
for (var Y = 280; Y < 288; ++Y) ka[Y] = 8;
|
|
4981
|
+
for (var Aa = new ma(32), Y = 0; Y < 32; ++Y) Aa[Y] = 5;
|
|
4982
|
+
var ja = /*#__PURE__*/ Oa(ka, 9, 1), Ma = /*#__PURE__*/ Oa(Aa, 5, 1), Na = function(e) {
|
|
4957
4983
|
for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
|
|
4958
4984
|
return t;
|
|
4959
|
-
},
|
|
4985
|
+
}, Pa = function(e, t, n) {
|
|
4960
4986
|
var r = t / 8 | 0;
|
|
4961
4987
|
return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
|
|
4962
|
-
},
|
|
4988
|
+
}, Fa = function(e, t) {
|
|
4963
4989
|
var n = t / 8 | 0;
|
|
4964
4990
|
return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
|
|
4965
|
-
},
|
|
4991
|
+
}, Ia = function(e) {
|
|
4966
4992
|
return (e + 7) / 8 | 0;
|
|
4967
|
-
},
|
|
4968
|
-
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new
|
|
4969
|
-
},
|
|
4993
|
+
}, La = function(e, t, n) {
|
|
4994
|
+
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new ma(e.subarray(t, n));
|
|
4995
|
+
}, Ra = [
|
|
4970
4996
|
"unexpected EOF",
|
|
4971
4997
|
"invalid block type",
|
|
4972
4998
|
"invalid length/literal",
|
|
@@ -4981,111 +5007,111 @@ var Ta = /*#__PURE__*/ Sa(Ca, 9, 1), Ea = /*#__PURE__*/ Sa(wa, 5, 1), Da = funct
|
|
|
4981
5007
|
"filename too long",
|
|
4982
5008
|
"stream finishing",
|
|
4983
5009
|
"invalid zip data"
|
|
4984
|
-
],
|
|
4985
|
-
var r = Error(t ||
|
|
4986
|
-
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r,
|
|
5010
|
+
], za = function(e, t, n) {
|
|
5011
|
+
var r = Error(t || Ra[e]);
|
|
5012
|
+
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, za), !n) throw r;
|
|
4987
5013
|
return r;
|
|
4988
|
-
},
|
|
5014
|
+
}, Ba = function(e, t, n, r) {
|
|
4989
5015
|
var i = e.length, a = r ? r.length : 0;
|
|
4990
|
-
if (!i || t.f && !t.l) return n || new
|
|
5016
|
+
if (!i || t.f && !t.l) return n || new ma(0);
|
|
4991
5017
|
var o = !n, s = o || t.i != 2, c = t.i;
|
|
4992
|
-
o && (n = new
|
|
5018
|
+
o && (n = new ma(i * 3));
|
|
4993
5019
|
var l = function(e) {
|
|
4994
5020
|
var t = n.length;
|
|
4995
5021
|
if (e > t) {
|
|
4996
|
-
var r = new
|
|
5022
|
+
var r = new ma(Math.max(t * 2, e));
|
|
4997
5023
|
r.set(n), n = r;
|
|
4998
5024
|
}
|
|
4999
5025
|
}, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
|
|
5000
5026
|
do {
|
|
5001
5027
|
if (!p) {
|
|
5002
|
-
u =
|
|
5003
|
-
var v =
|
|
5028
|
+
u = Pa(e, d, 1);
|
|
5029
|
+
var v = Pa(e, d + 1, 3);
|
|
5004
5030
|
if (d += 3, !v) {
|
|
5005
|
-
var y =
|
|
5031
|
+
var y = Ia(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
|
|
5006
5032
|
if (x > i) {
|
|
5007
|
-
c &&
|
|
5033
|
+
c && za(0);
|
|
5008
5034
|
break;
|
|
5009
5035
|
}
|
|
5010
5036
|
s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
|
|
5011
5037
|
continue;
|
|
5012
|
-
} else if (v == 1) p =
|
|
5038
|
+
} else if (v == 1) p = ja, m = Ma, h = 9, g = 5;
|
|
5013
5039
|
else if (v == 2) {
|
|
5014
|
-
var S =
|
|
5040
|
+
var S = Pa(e, d, 31) + 257, ee = Pa(e, d + 10, 15) + 4, te = S + Pa(e, d + 5, 31) + 1;
|
|
5015
5041
|
d += 14;
|
|
5016
|
-
for (var C = new
|
|
5042
|
+
for (var C = new ma(te), w = new ma(19), T = 0; T < ee; ++T) w[ya[T]] = Pa(e, d + T * 3, 7);
|
|
5017
5043
|
d += ee * 3;
|
|
5018
|
-
for (var ne =
|
|
5019
|
-
var E = ie[
|
|
5044
|
+
for (var ne = Na(w), re = (1 << ne) - 1, ie = Oa(w, ne, 1), T = 0; T < te;) {
|
|
5045
|
+
var E = ie[Pa(e, d, re)];
|
|
5020
5046
|
d += E & 15;
|
|
5021
5047
|
var y = E >> 4;
|
|
5022
5048
|
if (y < 16) C[T++] = y;
|
|
5023
5049
|
else {
|
|
5024
5050
|
var ae = 0, D = 0;
|
|
5025
|
-
for (y == 16 ? (D = 3 +
|
|
5051
|
+
for (y == 16 ? (D = 3 + Pa(e, d, 3), d += 2, ae = C[T - 1]) : y == 17 ? (D = 3 + Pa(e, d, 7), d += 3) : y == 18 && (D = 11 + Pa(e, d, 127), d += 7); D--;) C[T++] = ae;
|
|
5026
5052
|
}
|
|
5027
5053
|
}
|
|
5028
5054
|
var O = C.subarray(0, S), k = C.subarray(S);
|
|
5029
|
-
h =
|
|
5030
|
-
} else
|
|
5055
|
+
h = Na(O), g = Na(k), p = Oa(O, h, 1), m = Oa(k, g, 1);
|
|
5056
|
+
} else za(1);
|
|
5031
5057
|
if (d > _) {
|
|
5032
|
-
c &&
|
|
5058
|
+
c && za(0);
|
|
5033
5059
|
break;
|
|
5034
5060
|
}
|
|
5035
5061
|
}
|
|
5036
5062
|
s && l(f + 131072);
|
|
5037
5063
|
for (var oe = (1 << h) - 1, A = (1 << g) - 1, se = d;; se = d) {
|
|
5038
|
-
var ae = p[
|
|
5064
|
+
var ae = p[Fa(e, d) & oe], ce = ae >> 4;
|
|
5039
5065
|
if (d += ae & 15, d > _) {
|
|
5040
|
-
c &&
|
|
5066
|
+
c && za(0);
|
|
5041
5067
|
break;
|
|
5042
5068
|
}
|
|
5043
|
-
if (ae ||
|
|
5069
|
+
if (ae || za(2), ce < 256) n[f++] = ce;
|
|
5044
5070
|
else if (ce == 256) {
|
|
5045
5071
|
se = d, p = null;
|
|
5046
5072
|
break;
|
|
5047
5073
|
} else {
|
|
5048
5074
|
var le = ce - 254;
|
|
5049
5075
|
if (ce > 264) {
|
|
5050
|
-
var T = ce - 257, ue =
|
|
5051
|
-
le =
|
|
5076
|
+
var T = ce - 257, ue = _a[T];
|
|
5077
|
+
le = Pa(e, d, (1 << ue) - 1) + Sa[T], d += ue;
|
|
5052
5078
|
}
|
|
5053
|
-
var de = m[
|
|
5054
|
-
de ||
|
|
5055
|
-
var k =
|
|
5079
|
+
var de = m[Fa(e, d) & A], fe = de >> 4;
|
|
5080
|
+
de || za(3), d += de & 15;
|
|
5081
|
+
var k = Ta[fe];
|
|
5056
5082
|
if (fe > 3) {
|
|
5057
|
-
var ue =
|
|
5058
|
-
k +=
|
|
5083
|
+
var ue = va[fe];
|
|
5084
|
+
k += Fa(e, d) & (1 << ue) - 1, d += ue;
|
|
5059
5085
|
}
|
|
5060
5086
|
if (d > _) {
|
|
5061
|
-
c &&
|
|
5087
|
+
c && za(0);
|
|
5062
5088
|
break;
|
|
5063
5089
|
}
|
|
5064
5090
|
s && l(f + 131072);
|
|
5065
5091
|
var pe = f + le;
|
|
5066
5092
|
if (f < k) {
|
|
5067
5093
|
var me = a - k, he = Math.min(k, pe);
|
|
5068
|
-
for (me + f < 0 &&
|
|
5094
|
+
for (me + f < 0 && za(3); f < he; ++f) n[f] = r[me + f];
|
|
5069
5095
|
}
|
|
5070
5096
|
for (; f < pe; ++f) n[f] = n[f - k];
|
|
5071
5097
|
}
|
|
5072
5098
|
}
|
|
5073
5099
|
t.l = p, t.p = se, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
|
|
5074
5100
|
} while (!u);
|
|
5075
|
-
return f != n.length && o ?
|
|
5076
|
-
},
|
|
5077
|
-
return ((e[0] & 15) != 8 || e[0] >> 4 > 7 || (e[0] << 8 | e[1]) % 31) &&
|
|
5101
|
+
return f != n.length && o ? La(n, 0, f) : n.subarray(0, f);
|
|
5102
|
+
}, Va = /*#__PURE__*/ new ma(0), Ha = function(e, t) {
|
|
5103
|
+
return ((e[0] & 15) != 8 || e[0] >> 4 > 7 || (e[0] << 8 | e[1]) % 31) && za(6, "invalid zlib data"), (e[1] >> 5 & 1) == +!t && za(6, "invalid zlib data: " + (e[1] & 32 ? "need" : "unexpected") + " dictionary"), (e[1] >> 3 & 4) + 2;
|
|
5078
5104
|
};
|
|
5079
|
-
function
|
|
5080
|
-
return
|
|
5105
|
+
function Ua(e, t) {
|
|
5106
|
+
return Ba(e.subarray(Ha(e, t && t.dictionary), -4), { i: 2 }, t && t.out, t && t.dictionary);
|
|
5081
5107
|
}
|
|
5082
|
-
var
|
|
5108
|
+
var Wa = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
|
|
5083
5109
|
try {
|
|
5084
|
-
|
|
5110
|
+
Wa.decode(Va, { stream: !0 });
|
|
5085
5111
|
} catch {}
|
|
5086
5112
|
//#endregion
|
|
5087
5113
|
//#region node_modules/three/examples/jsm/loaders/EXRLoader.js
|
|
5088
|
-
var
|
|
5114
|
+
var Ga = class extends ve {
|
|
5089
5115
|
constructor(e) {
|
|
5090
5116
|
super(e), this.type = Te, this.outputFormat = st, this.part = 0;
|
|
5091
5117
|
}
|
|
@@ -5445,7 +5471,7 @@ var za = class extends ve {
|
|
|
5445
5471
|
return ae(n), D(n, r), new DataView(r.buffer);
|
|
5446
5472
|
}
|
|
5447
5473
|
function me(e) {
|
|
5448
|
-
let t =
|
|
5474
|
+
let t = Ua(e.array.slice(e.offset.value, e.offset.value + e.size)), n = new Uint8Array(t.length);
|
|
5449
5475
|
return ae(t), D(t, n), new DataView(n.buffer);
|
|
5450
5476
|
}
|
|
5451
5477
|
function he(e) {
|
|
@@ -5469,7 +5495,7 @@ var za = class extends ve {
|
|
|
5469
5495
|
return new DataView(g.buffer);
|
|
5470
5496
|
}
|
|
5471
5497
|
function ge(e) {
|
|
5472
|
-
let t =
|
|
5498
|
+
let t = Ua(e.array.slice(e.offset.value, e.offset.value + e.size)), n = e.inputChannels.length * e.lines * e.columns * e.totalBytes, r = new ArrayBuffer(n), i = new DataView(r), a = 0, o = 0, s = [
|
|
5473
5499
|
,
|
|
5474
5500
|
,
|
|
5475
5501
|
,
|
|
@@ -5616,7 +5642,7 @@ var za = class extends ve {
|
|
|
5616
5642
|
u = new Uint16Array(i.totalAcUncompressedCount), ie(e.array, t, n, i.acCompressedSize, u, i.totalAcUncompressedCount);
|
|
5617
5643
|
break;
|
|
5618
5644
|
case 1:
|
|
5619
|
-
let r =
|
|
5645
|
+
let r = Ua(e.array.slice(n.value, n.value + i.totalAcUncompressedCount));
|
|
5620
5646
|
u = new Uint16Array(r.buffer), n.value += i.totalAcUncompressedCount;
|
|
5621
5647
|
break;
|
|
5622
5648
|
}
|
|
@@ -5628,7 +5654,7 @@ var za = class extends ve {
|
|
|
5628
5654
|
};
|
|
5629
5655
|
d = new Uint16Array(me(t).buffer), n.value += i.dcCompressedSize;
|
|
5630
5656
|
}
|
|
5631
|
-
i.rleRawSize > 0 && (f = O(
|
|
5657
|
+
i.rleRawSize > 0 && (f = O(Ua(e.array.slice(n.value, n.value + i.rleCompressedSize)).buffer), n.value += i.rleCompressedSize);
|
|
5632
5658
|
let p = 0, m = Array(c.length);
|
|
5633
5659
|
for (let e = 0; e < m.length; ++e) m[e] = [];
|
|
5634
5660
|
for (let t = 0; t < e.lines; ++t) for (let t = 0; t < c.length; ++t) m[t].push(p), p += c[t].width * e.type * 2;
|
|
@@ -5917,7 +5943,7 @@ var za = class extends ve {
|
|
|
5917
5943
|
return ae(e), D(e, t), new DataView(t.buffer);
|
|
5918
5944
|
}
|
|
5919
5945
|
case "ZIPS_COMPRESSION": {
|
|
5920
|
-
let e =
|
|
5946
|
+
let e = Ua(i), t = new Uint8Array(e.length);
|
|
5921
5947
|
return ae(e), D(e, t), new DataView(t.buffer);
|
|
5922
5948
|
}
|
|
5923
5949
|
default: throw Error("THREE.EXRLoader: " + r + " is unsupported for deep data");
|
|
@@ -6200,7 +6226,7 @@ var za = class extends ve {
|
|
|
6200
6226
|
setPart(e) {
|
|
6201
6227
|
return this.part = e, this;
|
|
6202
6228
|
}
|
|
6203
|
-
},
|
|
6229
|
+
}, Ka = class extends ve {
|
|
6204
6230
|
constructor(e) {
|
|
6205
6231
|
super(e), this.type = Te;
|
|
6206
6232
|
}
|
|
@@ -6306,11 +6332,11 @@ var za = class extends ve {
|
|
|
6306
6332
|
setDataType(e) {
|
|
6307
6333
|
return this.type = e, this;
|
|
6308
6334
|
}
|
|
6309
|
-
},
|
|
6335
|
+
}, qa = class extends Ka {
|
|
6310
6336
|
constructor(e) {
|
|
6311
6337
|
console.warn("RGBELoader has been deprecated. Please use HDRLoader instead."), super(e);
|
|
6312
6338
|
}
|
|
6313
|
-
},
|
|
6339
|
+
}, Ja = class extends mt {
|
|
6314
6340
|
constructor() {
|
|
6315
6341
|
super(), this.name = "RoomEnvironment", this.position.y = -3.5;
|
|
6316
6342
|
let e = new de();
|
|
@@ -6321,17 +6347,17 @@ var za = class extends ve {
|
|
|
6321
6347
|
i.position.set(-.757, 13.219, .717), i.scale.set(31.713, 28.305, 28.591), this.add(i);
|
|
6322
6348
|
let a = new De(e, n, 6), o = new Qe();
|
|
6323
6349
|
o.position.set(-10.906, 2.009, 1.846), o.rotation.set(0, -.195, 0), o.scale.set(2.328, 7.905, 4.651), o.updateMatrix(), a.setMatrixAt(0, o.matrix), o.position.set(-5.607, -.754, -.758), o.rotation.set(0, .994, 0), o.scale.set(1.97, 1.534, 3.955), o.updateMatrix(), a.setMatrixAt(1, o.matrix), o.position.set(6.167, .857, 7.803), o.rotation.set(0, .561, 0), o.scale.set(3.927, 6.285, 3.687), o.updateMatrix(), a.setMatrixAt(2, o.matrix), o.position.set(-2.017, .018, 6.124), o.rotation.set(0, .333, 0), o.scale.set(2.002, 4.566, 2.064), o.updateMatrix(), a.setMatrixAt(3, o.matrix), o.position.set(2.291, -.756, -2.621), o.rotation.set(0, -.286, 0), o.scale.set(1.546, 1.552, 1.496), o.updateMatrix(), a.setMatrixAt(4, o.matrix), o.position.set(-2.193, -.369, -5.547), o.rotation.set(0, .516, 0), o.scale.set(3.875, 3.487, 2.986), o.updateMatrix(), a.setMatrixAt(5, o.matrix), this.add(a);
|
|
6324
|
-
let s = new He(e,
|
|
6350
|
+
let s = new He(e, Ya(50));
|
|
6325
6351
|
s.position.set(-16.116, 14.37, 8.208), s.scale.set(.1, 2.428, 2.739), this.add(s);
|
|
6326
|
-
let c = new He(e,
|
|
6352
|
+
let c = new He(e, Ya(50));
|
|
6327
6353
|
c.position.set(-16.109, 18.021, -8.207), c.scale.set(.1, 2.425, 2.751), this.add(c);
|
|
6328
|
-
let l = new He(e,
|
|
6354
|
+
let l = new He(e, Ya(17));
|
|
6329
6355
|
l.position.set(14.904, 12.198, -1.832), l.scale.set(.15, 4.265, 6.331), this.add(l);
|
|
6330
|
-
let u = new He(e,
|
|
6356
|
+
let u = new He(e, Ya(43));
|
|
6331
6357
|
u.position.set(-.462, 8.89, 14.52), u.scale.set(4.38, 5.441, .088), this.add(u);
|
|
6332
|
-
let d = new He(e,
|
|
6358
|
+
let d = new He(e, Ya(20));
|
|
6333
6359
|
d.position.set(3.235, 11.486, -12.541), d.scale.set(2.5, 2, .1), this.add(d);
|
|
6334
|
-
let f = new He(e,
|
|
6360
|
+
let f = new He(e, Ya(100));
|
|
6335
6361
|
f.position.set(0, 20, 0), f.scale.set(1, .1, 1), this.add(f);
|
|
6336
6362
|
}
|
|
6337
6363
|
dispose() {
|
|
@@ -6342,7 +6368,7 @@ var za = class extends ve {
|
|
|
6342
6368
|
for (let t of e) t.dispose();
|
|
6343
6369
|
}
|
|
6344
6370
|
};
|
|
6345
|
-
function
|
|
6371
|
+
function Ya(e) {
|
|
6346
6372
|
return new We({
|
|
6347
6373
|
color: 0,
|
|
6348
6374
|
emissive: 16777215,
|
|
@@ -6351,7 +6377,7 @@ function Ua(e) {
|
|
|
6351
6377
|
}
|
|
6352
6378
|
//#endregion
|
|
6353
6379
|
//#region node_modules/three/examples/jsm/objects/GroundedSkybox.js
|
|
6354
|
-
var
|
|
6380
|
+
var Xa = class extends He {
|
|
6355
6381
|
constructor(e, t, n, r = 128) {
|
|
6356
6382
|
if (t <= 0 || n <= 0 || r <= 0) throw Error("THREE.GroundedSkybox: height, radius, and resolution must be positive.");
|
|
6357
6383
|
let i = new vt(n, 2 * r, r);
|
|
@@ -6366,12 +6392,12 @@ var Wa = class extends He {
|
|
|
6366
6392
|
depthWrite: !1
|
|
6367
6393
|
}));
|
|
6368
6394
|
}
|
|
6369
|
-
},
|
|
6370
|
-
function
|
|
6395
|
+
}, Za = .42, Qa = 1.15, $a = .7, eo = 1;
|
|
6396
|
+
function to(e) {
|
|
6371
6397
|
e.traverse((e) => {
|
|
6372
6398
|
let t = e;
|
|
6373
6399
|
if (t.isPointLight) {
|
|
6374
|
-
t.intensity *=
|
|
6400
|
+
t.intensity *= $a;
|
|
6375
6401
|
return;
|
|
6376
6402
|
}
|
|
6377
6403
|
let n = e;
|
|
@@ -6380,15 +6406,15 @@ function Ya(e) {
|
|
|
6380
6406
|
for (let e of r) {
|
|
6381
6407
|
if (!e) continue;
|
|
6382
6408
|
let t = e;
|
|
6383
|
-
(t.emissiveIntensity ?? 0) >
|
|
6409
|
+
(t.emissiveIntensity ?? 0) > eo ? t.emissiveIntensity *= Qa : t.color && t.color.multiplyScalar(Za);
|
|
6384
6410
|
}
|
|
6385
6411
|
});
|
|
6386
6412
|
}
|
|
6387
6413
|
//#endregion
|
|
6388
6414
|
//#region src/types/options/ControlsOptions.ts
|
|
6389
|
-
var
|
|
6415
|
+
var no = /* @__PURE__ */ function(e) {
|
|
6390
6416
|
return e.MapControls = "MapControls", e.OrbitControls = "OrbitControls", e;
|
|
6391
|
-
}({}),
|
|
6417
|
+
}({}), ro = "crisp", io = 256, ao = .1, oo = 100, so = "softbox-grounded-skybox", co = class {
|
|
6392
6418
|
constructor() {
|
|
6393
6419
|
this.pmremGenerator = null, this.threeRenderer = null, this.loadedTextures = /* @__PURE__ */ new Map(), this.renderTargets = [], this.studioBakes = /* @__PURE__ */ new Map(), this.originalByPmrem = /* @__PURE__ */ new WeakMap(), this.disposed = !1;
|
|
6394
6420
|
}
|
|
@@ -6403,14 +6429,14 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6403
6429
|
async loadEnvironmentMap(e) {
|
|
6404
6430
|
try {
|
|
6405
6431
|
let n = this.loadedTextures.get(e);
|
|
6406
|
-
if (n) return r.ok(new
|
|
6432
|
+
if (n) return r.ok(new lo(n));
|
|
6407
6433
|
let a = e.split(".").pop()?.toLowerCase(), o;
|
|
6408
6434
|
switch (a) {
|
|
6409
6435
|
case "hdr":
|
|
6410
|
-
o = new
|
|
6436
|
+
o = new qa();
|
|
6411
6437
|
break;
|
|
6412
6438
|
case "exr":
|
|
6413
|
-
o = new
|
|
6439
|
+
o = new Ga();
|
|
6414
6440
|
break;
|
|
6415
6441
|
case "jpg":
|
|
6416
6442
|
case "jpeg":
|
|
@@ -6433,9 +6459,9 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6433
6459
|
let t = this.pmremGenerator.fromEquirectangular(s);
|
|
6434
6460
|
this.renderTargets.push(t);
|
|
6435
6461
|
let n = t.texture;
|
|
6436
|
-
return this.loadedTextures.set(e, n), this.loadedTextures.set(e + "_original", s), this.originalByPmrem.set(n, s), r.ok(new
|
|
6462
|
+
return this.loadedTextures.set(e, n), this.loadedTextures.set(e + "_original", s), this.originalByPmrem.set(n, s), r.ok(new lo(n));
|
|
6437
6463
|
}
|
|
6438
|
-
return this.loadedTextures.set(e, s), r.ok(new
|
|
6464
|
+
return this.loadedTextures.set(e, s), r.ok(new lo(s));
|
|
6439
6465
|
} catch (n) {
|
|
6440
6466
|
return r.err(new t("Failed to load environment map", i.TEXTURE_LOAD_FAILED, {
|
|
6441
6467
|
url: e,
|
|
@@ -6459,8 +6485,8 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6459
6485
|
}
|
|
6460
6486
|
}
|
|
6461
6487
|
addGroundedSkybox(e, t, n, r) {
|
|
6462
|
-
let i = new
|
|
6463
|
-
i.name =
|
|
6488
|
+
let i = new Xa(t, n.height, n.radius);
|
|
6489
|
+
i.name = so, i.userData[h] = !0, i.userData[g] = !0;
|
|
6464
6490
|
let a = Array.isArray(i.material) ? i.material : [i.material];
|
|
6465
6491
|
for (let e of a) e.userData[f] = !0, r !== void 0 && "color" in e && e.color.setScalar(r);
|
|
6466
6492
|
i.position.y = n.height - .01, e.add(i);
|
|
@@ -6470,19 +6496,19 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6470
6496
|
t && this.removeGroundedSkybox(t);
|
|
6471
6497
|
}
|
|
6472
6498
|
removeGroundedSkybox(e) {
|
|
6473
|
-
let t = e.getObjectByName(
|
|
6499
|
+
let t = e.getObjectByName(so);
|
|
6474
6500
|
t && (t.removeFromParent(), t.geometry.dispose(), (Array.isArray(t.material) ? t.material : [t.material]).forEach((e) => e.dispose()));
|
|
6475
6501
|
}
|
|
6476
6502
|
getOriginalEnvironmentTexture(e) {
|
|
6477
6503
|
let t = this.loadedTextures.get(e + "_original");
|
|
6478
|
-
return t ? new
|
|
6504
|
+
return t ? new lo(t) : null;
|
|
6479
6505
|
}
|
|
6480
6506
|
async setBackgroundImage(e, n) {
|
|
6481
6507
|
try {
|
|
6482
6508
|
let a = v(e);
|
|
6483
6509
|
if (!a) return r.err(new t("Scene must be ThreeSceneAdapter", i.INVALID_PARAMETER));
|
|
6484
6510
|
let o = await this.loadBackgroundTexture(n);
|
|
6485
|
-
return o.colorSpace = A.SRGBColorSpace, o.needsUpdate = !0, cn(o), ln(a), a.background = o, r.ok(void 0);
|
|
6511
|
+
return o.colorSpace = A.SRGBColorSpace, o.needsUpdate = !0, cn(o), _n(o), ln(a), a.background = o, r.ok(void 0);
|
|
6486
6512
|
} catch (e) {
|
|
6487
6513
|
return r.err(new t("Failed to set background image", i.TEXTURE_LOAD_FAILED, { originalError: e }));
|
|
6488
6514
|
}
|
|
@@ -6501,27 +6527,27 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6501
6527
|
});
|
|
6502
6528
|
});
|
|
6503
6529
|
}
|
|
6504
|
-
createStudioEnvironment(e =
|
|
6530
|
+
createStudioEnvironment(e = ro) {
|
|
6505
6531
|
try {
|
|
6506
6532
|
if (!this.pmremGenerator) return r.err(new t("Environment service not initialized", i.INITIALIZATION_FAILED));
|
|
6507
6533
|
let n = this.studioBakes.get(e);
|
|
6508
|
-
if (n) return r.ok(new
|
|
6509
|
-
let a = new
|
|
6510
|
-
e !== "soft" &&
|
|
6534
|
+
if (n) return r.ok(new lo(n.pmremTexture));
|
|
6535
|
+
let a = new Ja();
|
|
6536
|
+
e !== "soft" && to(a);
|
|
6511
6537
|
let o = this.pmremGenerator.fromScene(a);
|
|
6512
6538
|
this.renderTargets.push(o);
|
|
6513
6539
|
let s = o.texture;
|
|
6514
6540
|
return this.captureStudioCubeOriginal(e, a, s), this.studioBakes.has(e) || this.studioBakes.set(e, {
|
|
6515
6541
|
pmremTexture: s,
|
|
6516
6542
|
cubeTarget: null
|
|
6517
|
-
}), a.dispose(), r.ok(new
|
|
6543
|
+
}), a.dispose(), r.ok(new lo(s));
|
|
6518
6544
|
} catch (e) {
|
|
6519
6545
|
return r.err(new t("Failed to create studio environment", i.TEXTURE_LOAD_FAILED, { originalError: e }));
|
|
6520
6546
|
}
|
|
6521
6547
|
}
|
|
6522
6548
|
captureStudioCubeOriginal(e, t, n) {
|
|
6523
6549
|
if (this.threeRenderer) try {
|
|
6524
|
-
let r = new A.WebGLCubeRenderTarget(
|
|
6550
|
+
let r = new A.WebGLCubeRenderTarget(io, { type: A.HalfFloatType }), i = new A.CubeCamera(ao, oo, r), a = this.threeRenderer.toneMapping;
|
|
6525
6551
|
this.threeRenderer.toneMapping = A.NoToneMapping;
|
|
6526
6552
|
try {
|
|
6527
6553
|
i.update(this.threeRenderer, t);
|
|
@@ -6539,7 +6565,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6539
6565
|
dispose() {
|
|
6540
6566
|
this.disposed = !0, this.loadedTextures.forEach((e) => e.dispose()), this.loadedTextures.clear(), this.renderTargets.forEach((e) => e.dispose()), this.renderTargets = [], this.studioBakes.forEach((e) => e.cubeTarget?.dispose()), this.studioBakes.clear(), this.pmremGenerator &&= (this.pmremGenerator.dispose(), null), this.threeRenderer = null;
|
|
6541
6567
|
}
|
|
6542
|
-
},
|
|
6568
|
+
}, lo = class {
|
|
6543
6569
|
constructor(e) {
|
|
6544
6570
|
this.texture = e;
|
|
6545
6571
|
}
|
|
@@ -6561,7 +6587,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6561
6587
|
getThreeTexture() {
|
|
6562
6588
|
return this.texture;
|
|
6563
6589
|
}
|
|
6564
|
-
},
|
|
6590
|
+
}, uo = class {
|
|
6565
6591
|
constructor(e) {
|
|
6566
6592
|
this.object = e, this.boundingBox = new A.Box3().setFromObject(this.object);
|
|
6567
6593
|
}
|
|
@@ -6576,19 +6602,19 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6576
6602
|
applyOffset(e) {
|
|
6577
6603
|
this.object.position.add(e);
|
|
6578
6604
|
}
|
|
6579
|
-
},
|
|
6605
|
+
}, fo = class {
|
|
6580
6606
|
alignToFloor(e) {
|
|
6581
6607
|
try {
|
|
6582
6608
|
let n = null;
|
|
6583
|
-
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? n = e.getThreeObject() : e instanceof A.Object3D && (n = e), n ? (new
|
|
6609
|
+
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? n = e.getThreeObject() : e instanceof A.Object3D && (n = e), n ? (new uo(n).alignToFloor(), r.ok(void 0)) : r.err(new t("Could not get Three.js object for floor alignment", i.INVALID_PARAMETER));
|
|
6584
6610
|
} catch (e) {
|
|
6585
6611
|
return r.err(new t("Failed to align object to floor", i.OPERATION_FAILED, { originalError: e }));
|
|
6586
6612
|
}
|
|
6587
6613
|
}
|
|
6588
|
-
},
|
|
6614
|
+
}, po = {
|
|
6589
6615
|
touch: 10,
|
|
6590
6616
|
default: 5
|
|
6591
|
-
},
|
|
6617
|
+
}, mo = class {
|
|
6592
6618
|
constructor() {
|
|
6593
6619
|
this.raycaster = new A.Raycaster(), this.activePointers = /* @__PURE__ */ new Set(), this.options = null, this.pending = null, this.detach = null;
|
|
6594
6620
|
}
|
|
@@ -6607,7 +6633,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6607
6633
|
pointerId: e.pointerId,
|
|
6608
6634
|
x: e.clientX,
|
|
6609
6635
|
y: e.clientY,
|
|
6610
|
-
threshold: e.pointerType === "touch" ?
|
|
6636
|
+
threshold: e.pointerType === "touch" ? po.touch : po.default
|
|
6611
6637
|
};
|
|
6612
6638
|
}, r = (e) => {
|
|
6613
6639
|
this.activePointers.delete(e.pointerId);
|
|
@@ -6651,7 +6677,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6651
6677
|
dispose() {
|
|
6652
6678
|
this.detach?.(), this.detach = null, this.options = null, this.pending = null, this.activePointers.clear();
|
|
6653
6679
|
}
|
|
6654
|
-
},
|
|
6680
|
+
}, ho = .001, go = { visible: !1 }, _o = class {
|
|
6655
6681
|
constructor(e) {
|
|
6656
6682
|
this.sources = e, this.anchor = new A.Vector3(), this.projected = new A.Vector3(), this.cameraPosition = new A.Vector3(), this.toAnchor = new A.Vector3(), this.raycaster = new A.Raycaster(), this.lastCameraMatrix = new A.Matrix4(), this.lastWidth = -1, this.lastHeight = -1, this.hasProjected = !1;
|
|
6657
6683
|
}
|
|
@@ -6662,7 +6688,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6662
6688
|
let n = _(this.sources.camera), r = this.sources.getCanvas();
|
|
6663
6689
|
if (!n || !r) return null;
|
|
6664
6690
|
let i = r.clientWidth || r.width, a = r.clientHeight || r.height;
|
|
6665
|
-
return this.hasProjected && i === this.lastWidth && a === this.lastHeight && this.lastCameraMatrix.equals(n.matrixWorld) ? null : (this.lastCameraMatrix.copy(n.matrixWorld), this.lastWidth = i, this.lastHeight = a, this.hasProjected = !0, this.anchor.set(e.x, e.y, e.z), n.getWorldPosition(this.cameraPosition), this.projected.copy(this.anchor).applyMatrix4(n.matrixWorldInverse), this.projected.z >= 0 || t && this.isOccluded(n) ?
|
|
6691
|
+
return this.hasProjected && i === this.lastWidth && a === this.lastHeight && this.lastCameraMatrix.equals(n.matrixWorld) ? null : (this.lastCameraMatrix.copy(n.matrixWorld), this.lastWidth = i, this.lastHeight = a, this.hasProjected = !0, this.anchor.set(e.x, e.y, e.z), n.getWorldPosition(this.cameraPosition), this.projected.copy(this.anchor).applyMatrix4(n.matrixWorldInverse), this.projected.z >= 0 || t && this.isOccluded(n) ? go : (this.projected.copy(this.anchor).project(n), {
|
|
6666
6692
|
visible: !0,
|
|
6667
6693
|
left: (this.projected.x + 1) / 2 * i,
|
|
6668
6694
|
top: (1 - this.projected.y) / 2 * a
|
|
@@ -6675,13 +6701,13 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6675
6701
|
let n = this.toAnchor.length();
|
|
6676
6702
|
this.raycaster.set(this.cameraPosition, this.toAnchor.normalize()), this.raycaster.camera = e, this.raycaster.firstHitOnly = !0;
|
|
6677
6703
|
let r = this.raycaster.intersectObject(t, !0)[0];
|
|
6678
|
-
return !!(r && r.distance < n -
|
|
6704
|
+
return !!(r && r.distance < n - ho);
|
|
6679
6705
|
}
|
|
6680
|
-
},
|
|
6706
|
+
}, vo = class {
|
|
6681
6707
|
createProjector(e) {
|
|
6682
|
-
return new
|
|
6708
|
+
return new _o(e);
|
|
6683
6709
|
}
|
|
6684
|
-
},
|
|
6710
|
+
}, yo = class {
|
|
6685
6711
|
constructor() {
|
|
6686
6712
|
this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1, this.speed = 1;
|
|
6687
6713
|
}
|
|
@@ -6689,7 +6715,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6689
6715
|
this.detach();
|
|
6690
6716
|
let t = p(e);
|
|
6691
6717
|
if (!t) return;
|
|
6692
|
-
let n =
|
|
6718
|
+
let n = bo(t);
|
|
6693
6719
|
n && (this.clips = n.animations, this.mixer = new A.AnimationMixer(n), this.mixer.timeScale = this.speed);
|
|
6694
6720
|
}
|
|
6695
6721
|
getClipNames() {
|
|
@@ -6729,7 +6755,7 @@ var Xa = /* @__PURE__ */ function(e) {
|
|
|
6729
6755
|
this.mixer && (this.mixer.stopAllAction(), this.mixer.uncacheRoot(this.mixer.getRoot())), this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1;
|
|
6730
6756
|
}
|
|
6731
6757
|
};
|
|
6732
|
-
function
|
|
6758
|
+
function bo(e) {
|
|
6733
6759
|
let t = null;
|
|
6734
6760
|
return e.traverse((e) => {
|
|
6735
6761
|
!t && (e.animations?.length ?? 0) > 0 && (t = e);
|
|
@@ -6737,14 +6763,14 @@ function mo(e) {
|
|
|
6737
6763
|
}
|
|
6738
6764
|
//#endregion
|
|
6739
6765
|
//#region src/infrastructure/factories/ViewerFactory.ts
|
|
6740
|
-
var
|
|
6766
|
+
var xo = class {
|
|
6741
6767
|
static createViewer(e, t) {
|
|
6742
6768
|
kt(t.units);
|
|
6743
|
-
let n = new
|
|
6769
|
+
let n = new Nn(e), r = new un(), i = this.createCamera(t), a = this.createControls(i.getThreeCamera(), e, t), o = new So().createDefaultLoader({
|
|
6744
6770
|
renderer: n.getThreeRenderer() ?? void 0,
|
|
6745
6771
|
bvh: t.selection?.bvh,
|
|
6746
6772
|
...t.loaders
|
|
6747
|
-
}), s = new
|
|
6773
|
+
}), s = new fa(), c = new co(), l = new pa(), u = new fo(), d = new mo(), f = new vo(), p = new yo(), m = wn.convertRendererOptions(t.renderer || {});
|
|
6748
6774
|
return m.preserveDrawingBuffer = !0, new nn({
|
|
6749
6775
|
renderer: n,
|
|
6750
6776
|
scene: r,
|
|
@@ -6777,23 +6803,23 @@ var ho = class {
|
|
|
6777
6803
|
}), s;
|
|
6778
6804
|
}
|
|
6779
6805
|
static createControls(e, t, n) {
|
|
6780
|
-
let r = n.controls || {}, i = r.type ||
|
|
6781
|
-
a = i ===
|
|
6806
|
+
let r = n.controls || {}, i = r.type || no.OrbitControls, a;
|
|
6807
|
+
a = i === no.MapControls ? new Si(e, t) : new xi(e, t), a.enabled = r.enabled ?? !0, a.enableDamping = r.enableDamping ?? !0, a.dampingFactor = r.dampingFactor ?? .25, a.enableZoom = r.enableZoom ?? !0, a.enableRotate = r.enableRotate ?? !0, a.enablePan = r.enablePan ?? !0, a.autoRotate = r.autoRotate ?? !1, r.autoRotateSpeed !== void 0 && (a.autoRotateSpeed = r.autoRotateSpeed), r.minDistance !== void 0 && (a.minDistance = r.minDistance), r.maxDistance !== void 0 && (a.maxDistance = r.maxDistance), r.minPolarAngle !== void 0 && (a.minPolarAngle = r.minPolarAngle), r.maxPolarAngle !== void 0 && (a.maxPolarAngle = r.maxPolarAngle);
|
|
6782
6808
|
let o = n.camera || {}, s = o.target || o.cameraTarget;
|
|
6783
6809
|
return s && a.target && (a.target.set(s[0], s[1], s[2]), a.update()), a;
|
|
6784
6810
|
}
|
|
6785
|
-
},
|
|
6811
|
+
}, So = class extends Jr {
|
|
6786
6812
|
createDefaultLoader(e = {}) {
|
|
6787
|
-
return
|
|
6813
|
+
return Jr.createLoader("model.glb", e);
|
|
6788
6814
|
}
|
|
6789
|
-
},
|
|
6815
|
+
}, Co = [
|
|
6790
6816
|
"toneMappingExposure",
|
|
6791
6817
|
"bloom",
|
|
6792
6818
|
"vignette",
|
|
6793
6819
|
"filmGrain",
|
|
6794
6820
|
"colorGrade"
|
|
6795
|
-
],
|
|
6796
|
-
function
|
|
6821
|
+
], wo = ["environmentIntensity"], To = ["autoRotate", "autoRotateSpeed"], Eo = ["enabled"];
|
|
6822
|
+
function Do(e) {
|
|
6797
6823
|
let t = {
|
|
6798
6824
|
backgroundColor: e.backgroundColor,
|
|
6799
6825
|
backgroundColorEdge: e.backgroundColorEdge
|
|
@@ -6813,7 +6839,7 @@ function xo(e) {
|
|
|
6813
6839
|
}
|
|
6814
6840
|
//#endregion
|
|
6815
6841
|
//#region src/defaultOptions.ts
|
|
6816
|
-
var
|
|
6842
|
+
var Oo = {
|
|
6817
6843
|
staticScene: !1,
|
|
6818
6844
|
backgroundColor: "#f0f0f7",
|
|
6819
6845
|
replaceWithScreenshotOnComplete: !1,
|
|
@@ -6847,7 +6873,7 @@ var So = {
|
|
|
6847
6873
|
environment: {
|
|
6848
6874
|
backgroundIntensity: 1,
|
|
6849
6875
|
environmentIntensity: .5,
|
|
6850
|
-
studioLook:
|
|
6876
|
+
studioLook: ro
|
|
6851
6877
|
},
|
|
6852
6878
|
lighting: {
|
|
6853
6879
|
ambientLight: {
|
|
@@ -6914,7 +6940,7 @@ var So = {
|
|
|
6914
6940
|
toneMappingExposure: 1.15
|
|
6915
6941
|
},
|
|
6916
6942
|
controls: {
|
|
6917
|
-
type:
|
|
6943
|
+
type: no.OrbitControls,
|
|
6918
6944
|
enabled: !0,
|
|
6919
6945
|
enableDamping: !0,
|
|
6920
6946
|
dampingFactor: .25,
|
|
@@ -6943,11 +6969,11 @@ var So = {
|
|
|
6943
6969
|
studioEnvironment: !0,
|
|
6944
6970
|
darkStudioMode: !1
|
|
6945
6971
|
}
|
|
6946
|
-
},
|
|
6972
|
+
}, ko = "https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/2k/kloofendal_48d_partly_cloudy_puresky_2k.hdr", Ao = {
|
|
6947
6973
|
texture: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_diff_1k.jpg",
|
|
6948
6974
|
normalMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_nor_gl_1k.jpg",
|
|
6949
6975
|
roughnessMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_rough_1k.jpg"
|
|
6950
|
-
},
|
|
6976
|
+
}, jo = {
|
|
6951
6977
|
studio_dome: {
|
|
6952
6978
|
helpers: {
|
|
6953
6979
|
grid: { type: "shadow_floor" },
|
|
@@ -6976,12 +7002,12 @@ var So = {
|
|
|
6976
7002
|
helpers: {
|
|
6977
7003
|
grid: {
|
|
6978
7004
|
type: "concrete_disc",
|
|
6979
|
-
styleOptions: { ...
|
|
7005
|
+
styleOptions: { ...Ao }
|
|
6980
7006
|
},
|
|
6981
7007
|
studioEnvironment: !0
|
|
6982
7008
|
},
|
|
6983
7009
|
environment: {
|
|
6984
|
-
url:
|
|
7010
|
+
url: ko,
|
|
6985
7011
|
groundProjection: !0
|
|
6986
7012
|
},
|
|
6987
7013
|
lighting: {
|
|
@@ -7000,13 +7026,13 @@ var So = {
|
|
|
7000
7026
|
rimLight: { intensity: .25 }
|
|
7001
7027
|
}
|
|
7002
7028
|
}
|
|
7003
|
-
},
|
|
7004
|
-
function
|
|
7005
|
-
return e ?
|
|
7029
|
+
}, Mo = "studio_dome";
|
|
7030
|
+
function No(e) {
|
|
7031
|
+
return e ? jo[e] ?? {} : {};
|
|
7006
7032
|
}
|
|
7007
7033
|
//#endregion
|
|
7008
7034
|
//#region src/presets.ts
|
|
7009
|
-
var
|
|
7035
|
+
var Po = {
|
|
7010
7036
|
studio: {
|
|
7011
7037
|
backgroundColor: "#f0f0f7",
|
|
7012
7038
|
renderer: { toneMappingExposure: 1.15 },
|
|
@@ -7034,31 +7060,31 @@ var Oo = {
|
|
|
7034
7060
|
environment: { environmentIntensity: .6 }
|
|
7035
7061
|
}
|
|
7036
7062
|
};
|
|
7037
|
-
function
|
|
7038
|
-
return e ?
|
|
7063
|
+
function Fo(e) {
|
|
7064
|
+
return e ? Po[e] ?? {} : {};
|
|
7039
7065
|
}
|
|
7040
|
-
function
|
|
7041
|
-
return Vt(Vt(Vt(e,
|
|
7066
|
+
function Io(e, t) {
|
|
7067
|
+
return Vt(Vt(Vt(e, No(t.scene)), Fo(t.preset)), t);
|
|
7042
7068
|
}
|
|
7043
7069
|
//#endregion
|
|
7044
7070
|
//#region src/presentation/hooks/useStableOptions.ts
|
|
7045
|
-
var
|
|
7071
|
+
var Lo = (e, ...t) => {
|
|
7046
7072
|
if (!e) return;
|
|
7047
7073
|
let n = { ...e };
|
|
7048
7074
|
for (let e of t) delete n[e];
|
|
7049
7075
|
return Object.keys(n).length > 0 ? n : void 0;
|
|
7050
7076
|
};
|
|
7051
|
-
function
|
|
7077
|
+
function Ro(e) {
|
|
7052
7078
|
let t = D(() => JSON.stringify({
|
|
7053
|
-
pathTracing:
|
|
7079
|
+
pathTracing: Lo(e.pathTracing, ...Eo),
|
|
7054
7080
|
staticScene: e.staticScene,
|
|
7055
|
-
renderer:
|
|
7081
|
+
renderer: Lo(e.renderer, ...Co),
|
|
7056
7082
|
camera: e.camera,
|
|
7057
|
-
controls:
|
|
7058
|
-
environment:
|
|
7083
|
+
controls: Lo(e.controls, ...To),
|
|
7084
|
+
environment: Lo(e.environment, ...wo),
|
|
7059
7085
|
scene: e.scene ?? "studio_dome",
|
|
7060
7086
|
lighting: e.lighting,
|
|
7061
|
-
helpers:
|
|
7087
|
+
helpers: Lo(e.helpers, "gizmo"),
|
|
7062
7088
|
rendering: e.rendering,
|
|
7063
7089
|
replaceWithScreenshotOnComplete: e.replaceWithScreenshotOnComplete,
|
|
7064
7090
|
loaders: e.loaders,
|
|
@@ -7082,8 +7108,8 @@ function Mo(e) {
|
|
|
7082
7108
|
e.floorAlignment,
|
|
7083
7109
|
e.selection
|
|
7084
7110
|
]), n = D(() => {
|
|
7085
|
-
let t =
|
|
7086
|
-
return JSON.stringify(
|
|
7111
|
+
let t = Io(Oo, e);
|
|
7112
|
+
return JSON.stringify(Do(t));
|
|
7087
7113
|
}, [
|
|
7088
7114
|
e.preset,
|
|
7089
7115
|
e.backgroundColor,
|
|
@@ -7103,8 +7129,8 @@ function Mo(e) {
|
|
|
7103
7129
|
}
|
|
7104
7130
|
//#endregion
|
|
7105
7131
|
//#region src/presentation/hooks/useViewportGate.ts
|
|
7106
|
-
var
|
|
7107
|
-
function
|
|
7132
|
+
var zo = "200px";
|
|
7133
|
+
function Bo(e, t) {
|
|
7108
7134
|
let [n, r] = k(!t);
|
|
7109
7135
|
return E(() => {
|
|
7110
7136
|
if (n) return;
|
|
@@ -7119,7 +7145,7 @@ function Po(e, t) {
|
|
|
7119
7145
|
}
|
|
7120
7146
|
let a = new IntersectionObserver((e) => {
|
|
7121
7147
|
e.some((e) => e.isIntersecting) && r(!0);
|
|
7122
|
-
}, { rootMargin:
|
|
7148
|
+
}, { rootMargin: zo });
|
|
7123
7149
|
return a.observe(i), () => a.disconnect();
|
|
7124
7150
|
}, [
|
|
7125
7151
|
e,
|
|
@@ -7129,17 +7155,17 @@ function Po(e, t) {
|
|
|
7129
7155
|
}
|
|
7130
7156
|
//#endregion
|
|
7131
7157
|
//#region src/presentation/hooks/useViewerCore.ts
|
|
7132
|
-
function
|
|
7158
|
+
function Vo(e, t) {
|
|
7133
7159
|
let n = O(null), r = O({
|
|
7134
7160
|
width: 0,
|
|
7135
7161
|
height: 0
|
|
7136
|
-
}), [i, a] = k(null), o = i !== null, [s, c] = k(null), { options: l, structuralKey: u, runtimeKey: d } =
|
|
7162
|
+
}), [i, a] = k(null), o = i !== null, [s, c] = k(null), { options: l, structuralKey: u, runtimeKey: d } = Ro(t), f = Bo(e, (t.loading ?? "eager") === "lazy");
|
|
7137
7163
|
return E(() => {
|
|
7138
7164
|
if (!f || !e.current || n.current) return;
|
|
7139
7165
|
c(null);
|
|
7140
|
-
let t =
|
|
7166
|
+
let t = Io(Oo, l), i;
|
|
7141
7167
|
try {
|
|
7142
|
-
i =
|
|
7168
|
+
i = xo.createViewer(e.current, t);
|
|
7143
7169
|
} catch (e) {
|
|
7144
7170
|
console.error("Failed to create viewer:", e), c(e instanceof Error ? e : Error(String(e)));
|
|
7145
7171
|
return;
|
|
@@ -7160,8 +7186,8 @@ function Fo(e, t) {
|
|
|
7160
7186
|
f
|
|
7161
7187
|
]), E(() => {
|
|
7162
7188
|
if (!i) return;
|
|
7163
|
-
let e =
|
|
7164
|
-
i.updateOptions(
|
|
7189
|
+
let e = Io(Oo, l);
|
|
7190
|
+
i.updateOptions(Do(e));
|
|
7165
7191
|
}, [d, i]), E(() => {
|
|
7166
7192
|
if (!n.current || !e.current) return;
|
|
7167
7193
|
let t = null, i = (i) => {
|
|
@@ -7195,7 +7221,7 @@ function Fo(e, t) {
|
|
|
7195
7221
|
}
|
|
7196
7222
|
//#endregion
|
|
7197
7223
|
//#region src/presentation/hooks/useViewerEvents.ts
|
|
7198
|
-
function
|
|
7224
|
+
function Ho(e, t) {
|
|
7199
7225
|
let n = O(t);
|
|
7200
7226
|
n.current = t, E(() => {
|
|
7201
7227
|
if (!e) return;
|
|
@@ -7214,7 +7240,7 @@ function Io(e, t) {
|
|
|
7214
7240
|
}
|
|
7215
7241
|
//#endregion
|
|
7216
7242
|
//#region src/presentation/hooks/usePickedPreset.ts
|
|
7217
|
-
function
|
|
7243
|
+
function Uo(e, t) {
|
|
7218
7244
|
let [n, r] = k(null), i = O(/* @__PURE__ */ new Set());
|
|
7219
7245
|
E(() => {
|
|
7220
7246
|
if (e !== void 0 && i.current.has(e)) {
|
|
@@ -7238,7 +7264,7 @@ function Lo(e, t) {
|
|
|
7238
7264
|
}
|
|
7239
7265
|
//#endregion
|
|
7240
7266
|
//#region src/presentation/hooks/useResolvedOptions.ts
|
|
7241
|
-
function
|
|
7267
|
+
function Wo(e, t, n, r, i) {
|
|
7242
7268
|
return D(() => {
|
|
7243
7269
|
let a = e.preset !== t, o = n === !0 && e.pathTracing?.enabled === void 0, s = r !== void 0 && e.controls?.autoRotate === void 0, c = i !== void 0 && e.animations?.autoplay === void 0;
|
|
7244
7270
|
return !a && !o && !s && !c ? e : {
|
|
@@ -7267,7 +7293,7 @@ function Ro(e, t, n, r, i) {
|
|
|
7267
7293
|
}
|
|
7268
7294
|
//#endregion
|
|
7269
7295
|
//#region src/presentation/hooks/useModelLoader.ts
|
|
7270
|
-
function
|
|
7296
|
+
function Go(e, t, n) {
|
|
7271
7297
|
let r = D(() => {
|
|
7272
7298
|
if (typeof n == "string") return n;
|
|
7273
7299
|
if (n) return `object-${n.uuid || "no-uuid"}`;
|
|
@@ -7293,7 +7319,7 @@ function zo(e, t, n) {
|
|
|
7293
7319
|
}
|
|
7294
7320
|
//#endregion
|
|
7295
7321
|
//#region src/presentation/adapters/EventAdapter.ts
|
|
7296
|
-
var
|
|
7322
|
+
var Ko = class {
|
|
7297
7323
|
static toThreeObject(e) {
|
|
7298
7324
|
let t = p(e);
|
|
7299
7325
|
if (t) return t;
|
|
@@ -7334,24 +7360,24 @@ var Bo = class {
|
|
|
7334
7360
|
};
|
|
7335
7361
|
//#endregion
|
|
7336
7362
|
//#region src/presentation/hooks/useForwardedEvents.ts
|
|
7337
|
-
function
|
|
7363
|
+
function qo(e) {
|
|
7338
7364
|
let t = O(new n());
|
|
7339
|
-
return
|
|
7365
|
+
return Ho(e, D(() => ({
|
|
7340
7366
|
"model:loading": (e) => t.current.emit("model:loading", e),
|
|
7341
7367
|
"model:progress": (e) => t.current.emit("model:progress", e),
|
|
7342
|
-
"model:loaded": (e) => t.current.emit("model:loaded",
|
|
7368
|
+
"model:loaded": (e) => t.current.emit("model:loaded", Ko.convertModelLoaded(e)),
|
|
7343
7369
|
"model:error": (e) => t.current.emit("model:error", e),
|
|
7344
7370
|
"render:complete": (e) => t.current.emit("render:complete", e),
|
|
7345
|
-
"controls:change": (e) => t.current.emit("controls:change",
|
|
7346
|
-
"object:selected": (e) => t.current.emit("object:selected",
|
|
7371
|
+
"controls:change": (e) => t.current.emit("controls:change", Ko.convertControlsChange(e)),
|
|
7372
|
+
"object:selected": (e) => t.current.emit("object:selected", Ko.convertObjectSelected(e)),
|
|
7347
7373
|
error: (e) => t.current.emit("error", e)
|
|
7348
7374
|
}), [])), t.current;
|
|
7349
7375
|
}
|
|
7350
7376
|
//#endregion
|
|
7351
7377
|
//#region src/presentation/hooks/useOptionCallbacks.ts
|
|
7352
|
-
function
|
|
7378
|
+
function Jo(e, t, n) {
|
|
7353
7379
|
let r = O(n);
|
|
7354
|
-
r.current = n,
|
|
7380
|
+
r.current = n, Ho(e, D(() => ({
|
|
7355
7381
|
"model:loaded": () => r.current.onLoad?.(),
|
|
7356
7382
|
"model:progress": (e) => r.current.onProgress?.(Math.min(1, e.loaded / e.total)),
|
|
7357
7383
|
"model:error": (e) => r.current.onError?.(e.error)
|
|
@@ -7368,26 +7394,26 @@ function Ho(e, t, n) {
|
|
|
7368
7394
|
}
|
|
7369
7395
|
//#endregion
|
|
7370
7396
|
//#region src/presentation/components/ViewerContext.tsx
|
|
7371
|
-
var
|
|
7372
|
-
function
|
|
7397
|
+
var Yo = T(null);
|
|
7398
|
+
function Xo({ viewer: e, canvasRef: t, children: n }) {
|
|
7373
7399
|
let r = D(() => ({
|
|
7374
7400
|
viewer: e,
|
|
7375
7401
|
canvasRef: t
|
|
7376
7402
|
}), [e, t]);
|
|
7377
|
-
return /* @__PURE__ */ H(
|
|
7403
|
+
return /* @__PURE__ */ H(Yo.Provider, {
|
|
7378
7404
|
value: r,
|
|
7379
7405
|
children: n
|
|
7380
7406
|
});
|
|
7381
7407
|
}
|
|
7382
|
-
function
|
|
7383
|
-
let e = ie(
|
|
7408
|
+
function Zo() {
|
|
7409
|
+
let e = ie(Yo);
|
|
7384
7410
|
if (!e) throw Error("useViewerContext must be used within ViewerProvider");
|
|
7385
7411
|
return e;
|
|
7386
7412
|
}
|
|
7387
7413
|
//#endregion
|
|
7388
7414
|
//#region src/presentation/components/ViewerCanvas.tsx
|
|
7389
|
-
function
|
|
7390
|
-
let { canvasRef: e } =
|
|
7415
|
+
function Qo() {
|
|
7416
|
+
let { canvasRef: e } = Zo();
|
|
7391
7417
|
return /* @__PURE__ */ H("canvas", {
|
|
7392
7418
|
ref: e,
|
|
7393
7419
|
style: {
|
|
@@ -7411,13 +7437,13 @@ function Ko() {
|
|
|
7411
7437
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
7412
7438
|
}
|
|
7413
7439
|
})();
|
|
7414
|
-
var
|
|
7440
|
+
var $o = (e, t, n, r, i, a) => {
|
|
7415
7441
|
let o = performance.now(), s = () => {
|
|
7416
7442
|
let c = performance.now() - o, l = Math.min(c / i, 1);
|
|
7417
7443
|
e.position.lerpVectors(n, r, l), t?.update(), a(), l < 1 && requestAnimationFrame(s);
|
|
7418
7444
|
};
|
|
7419
7445
|
requestAnimationFrame(s);
|
|
7420
|
-
},
|
|
7446
|
+
}, es = { type: "change" }, ts = { type: "start" }, ns = { type: "end" }, rs = new lt(), is = new tt(), as = Math.cos(70 * Be.DEG2RAD), X = new V(), Z = 2 * Math.PI, Q = {
|
|
7421
7447
|
NONE: -1,
|
|
7422
7448
|
ROTATE: 0,
|
|
7423
7449
|
DOLLY: 1,
|
|
@@ -7426,7 +7452,7 @@ var qo = (e, t, n, r, i, a) => {
|
|
|
7426
7452
|
TOUCH_PAN: 4,
|
|
7427
7453
|
TOUCH_DOLLY_PAN: 5,
|
|
7428
7454
|
TOUCH_DOLLY_ROTATE: 6
|
|
7429
|
-
},
|
|
7455
|
+
}, os = 1e-6, ss = class extends _e {
|
|
7430
7456
|
constructor(e, t = null) {
|
|
7431
7457
|
super(e, t), this.state = Q.NONE, this.target = new V(), this.cursor = new V(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .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 = {
|
|
7432
7458
|
LEFT: "ArrowLeft",
|
|
@@ -7440,7 +7466,7 @@ var qo = (e, t, n, r, i, a) => {
|
|
|
7440
7466
|
}, this.touches = {
|
|
7441
7467
|
ONE: z.ROTATE,
|
|
7442
7468
|
TWO: z.DOLLY_PAN
|
|
7443
|
-
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new V(), this._lastQuaternion = new at(), this._lastTargetPosition = new V(), this._quat = new at().setFromUnitVectors(e.up, new V(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new yt(), this._sphericalDelta = new yt(), this._scale = 1, this._panOffset = new V(), this._rotateStart = new B(), this._rotateEnd = new B(), this._rotateDelta = new B(), this._panStart = new B(), this._panEnd = new B(), this._panDelta = new B(), this._dollyStart = new B(), this._dollyEnd = new B(), this._dollyDelta = new B(), this._dollyDirection = new V(), this._mouse = new B(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove =
|
|
7469
|
+
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new V(), this._lastQuaternion = new at(), this._lastTargetPosition = new V(), this._quat = new at().setFromUnitVectors(e.up, new V(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new yt(), this._sphericalDelta = new yt(), this._scale = 1, this._panOffset = new V(), this._rotateStart = new B(), this._rotateEnd = new B(), this._rotateDelta = new B(), this._panStart = new B(), this._panEnd = new B(), this._panDelta = new B(), this._dollyStart = new B(), this._dollyEnd = new B(), this._dollyDelta = new B(), this._dollyDirection = new V(), this._mouse = new B(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ls.bind(this), this._onPointerDown = cs.bind(this), this._onPointerUp = us.bind(this), this._onContextMenu = _s.bind(this), this._onMouseWheel = ps.bind(this), this._onKeyDown = ms.bind(this), this._onTouchStart = hs.bind(this), this._onTouchMove = gs.bind(this), this._onMouseDown = ds.bind(this), this._onMouseMove = fs.bind(this), this._interceptControlDown = vs.bind(this), this._interceptControlUp = ys.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
7444
7470
|
}
|
|
7445
7471
|
connect(e) {
|
|
7446
7472
|
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, {
|
|
@@ -7473,7 +7499,7 @@ var qo = (e, t, n, r, i, a) => {
|
|
|
7473
7499
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
7474
7500
|
}
|
|
7475
7501
|
reset() {
|
|
7476
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
7502
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(es), this.update(), this.state = Q.NONE;
|
|
7477
7503
|
}
|
|
7478
7504
|
update(e = null) {
|
|
7479
7505
|
let t = this.object.position;
|
|
@@ -7501,12 +7527,12 @@ var qo = (e, t, n, r, i, a) => {
|
|
|
7501
7527
|
let r = new V(this._mouse.x, this._mouse.y, 0);
|
|
7502
7528
|
r.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = X.length();
|
|
7503
7529
|
} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
7504
|
-
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (
|
|
7530
|
+
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (rs.origin.copy(this.object.position), rs.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(rs.direction)) < as ? this.object.lookAt(this.target) : (is.setFromNormalAndCoplanarPoint(this.object.up, this.target), rs.intersectPlane(is, this.target))));
|
|
7505
7531
|
} else if (this.object.isOrthographicCamera) {
|
|
7506
7532
|
let e = this.object.zoom;
|
|
7507
7533
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), e !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
7508
7534
|
}
|
|
7509
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) >
|
|
7535
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > os || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > os || this._lastTargetPosition.distanceToSquared(this.target) > os ? (this.dispatchEvent(es), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
7510
7536
|
}
|
|
7511
7537
|
_getAutoRotationAngle(e) {
|
|
7512
7538
|
return e === null ? Z / 60 / 60 * this.autoRotateSpeed : Z / 60 * this.autoRotateSpeed * e;
|
|
@@ -7685,16 +7711,16 @@ var qo = (e, t, n, r, i, a) => {
|
|
|
7685
7711
|
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
7686
7712
|
}
|
|
7687
7713
|
};
|
|
7688
|
-
function
|
|
7714
|
+
function cs(e) {
|
|
7689
7715
|
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(e.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(e) && (this._addPointer(e), e.pointerType === "touch" ? this._onTouchStart(e) : this._onMouseDown(e)));
|
|
7690
7716
|
}
|
|
7691
|
-
function
|
|
7717
|
+
function ls(e) {
|
|
7692
7718
|
this.enabled !== !1 && (e.pointerType === "touch" ? this._onTouchMove(e) : this._onMouseMove(e));
|
|
7693
7719
|
}
|
|
7694
|
-
function
|
|
7720
|
+
function us(e) {
|
|
7695
7721
|
switch (this._removePointer(e), this._pointers.length) {
|
|
7696
7722
|
case 0:
|
|
7697
|
-
this.domElement.releasePointerCapture(e.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
7723
|
+
this.domElement.releasePointerCapture(e.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ns), this.state = Q.NONE;
|
|
7698
7724
|
break;
|
|
7699
7725
|
case 1:
|
|
7700
7726
|
let t = this._pointers[0], n = this._pointerPositions[t];
|
|
@@ -7706,7 +7732,7 @@ function is(e) {
|
|
|
7706
7732
|
break;
|
|
7707
7733
|
}
|
|
7708
7734
|
}
|
|
7709
|
-
function
|
|
7735
|
+
function ds(e) {
|
|
7710
7736
|
let t;
|
|
7711
7737
|
switch (e.button) {
|
|
7712
7738
|
case 0:
|
|
@@ -7745,9 +7771,9 @@ function as(e) {
|
|
|
7745
7771
|
break;
|
|
7746
7772
|
default: this.state = Q.NONE;
|
|
7747
7773
|
}
|
|
7748
|
-
this.state !== Q.NONE && this.dispatchEvent(
|
|
7774
|
+
this.state !== Q.NONE && this.dispatchEvent(ts);
|
|
7749
7775
|
}
|
|
7750
|
-
function
|
|
7776
|
+
function fs(e) {
|
|
7751
7777
|
switch (this.state) {
|
|
7752
7778
|
case Q.ROTATE:
|
|
7753
7779
|
if (this.enableRotate === !1) return;
|
|
@@ -7763,13 +7789,13 @@ function os(e) {
|
|
|
7763
7789
|
break;
|
|
7764
7790
|
}
|
|
7765
7791
|
}
|
|
7766
|
-
function
|
|
7767
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== Q.NONE || (e.preventDefault(), this.dispatchEvent(
|
|
7792
|
+
function ps(e) {
|
|
7793
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== Q.NONE || (e.preventDefault(), this.dispatchEvent(ts), this._handleMouseWheel(this._customWheelEvent(e)), this.dispatchEvent(ns));
|
|
7768
7794
|
}
|
|
7769
|
-
function
|
|
7795
|
+
function ms(e) {
|
|
7770
7796
|
this.enabled !== !1 && this._handleKeyDown(e);
|
|
7771
7797
|
}
|
|
7772
|
-
function
|
|
7798
|
+
function hs(e) {
|
|
7773
7799
|
switch (this._trackPointer(e), this._pointers.length) {
|
|
7774
7800
|
case 1:
|
|
7775
7801
|
switch (this.touches.ONE) {
|
|
@@ -7799,9 +7825,9 @@ function ls(e) {
|
|
|
7799
7825
|
break;
|
|
7800
7826
|
default: this.state = Q.NONE;
|
|
7801
7827
|
}
|
|
7802
|
-
this.state !== Q.NONE && this.dispatchEvent(
|
|
7828
|
+
this.state !== Q.NONE && this.dispatchEvent(ts);
|
|
7803
7829
|
}
|
|
7804
|
-
function
|
|
7830
|
+
function gs(e) {
|
|
7805
7831
|
switch (this._trackPointer(e), this.state) {
|
|
7806
7832
|
case Q.TOUCH_ROTATE:
|
|
7807
7833
|
if (this.enableRotate === !1) return;
|
|
@@ -7822,22 +7848,22 @@ function us(e) {
|
|
|
7822
7848
|
default: this.state = Q.NONE;
|
|
7823
7849
|
}
|
|
7824
7850
|
}
|
|
7825
|
-
function
|
|
7851
|
+
function _s(e) {
|
|
7826
7852
|
this.enabled !== !1 && e.preventDefault();
|
|
7827
7853
|
}
|
|
7828
|
-
function
|
|
7854
|
+
function vs(e) {
|
|
7829
7855
|
e.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, {
|
|
7830
7856
|
passive: !0,
|
|
7831
7857
|
capture: !0
|
|
7832
7858
|
}));
|
|
7833
7859
|
}
|
|
7834
|
-
function
|
|
7860
|
+
function ys(e) {
|
|
7835
7861
|
e.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, {
|
|
7836
7862
|
passive: !0,
|
|
7837
7863
|
capture: !0
|
|
7838
7864
|
}));
|
|
7839
7865
|
}
|
|
7840
|
-
var
|
|
7866
|
+
var bs = class extends ss {
|
|
7841
7867
|
constructor(e, t) {
|
|
7842
7868
|
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = {
|
|
7843
7869
|
LEFT: L.PAN,
|
|
@@ -7862,39 +7888,39 @@ var ms = class extends ts {
|
|
|
7862
7888
|
EDGE_COLOR: "#EFF3F2",
|
|
7863
7889
|
CORNER_COLOR: "#EFF3F2",
|
|
7864
7890
|
LINE_COLOR: 0
|
|
7865
|
-
},
|
|
7891
|
+
}, xs = /* @__PURE__ */ ((e) => (e.FRONT = "FRONT", e.BACK = "BACK", e.RIGHT = "RIGHT", e.LEFT = "LEFT", e.TOP = "TOP", e.BOTTOM = "BOTTOM", e))(xs || {});
|
|
7866
7892
|
new A.Vector3(0, 1, 0);
|
|
7867
|
-
var
|
|
7893
|
+
var Ss = "rotation-arrows-name", Cs = "left-rotation-arrow-name", ws = "right-rotation-arrow-name", Ts = "gizmo-group-name", Es = [ws, Cs], Ds = {
|
|
7868
7894
|
GIZMO_DISTANCE: 8,
|
|
7869
7895
|
DEFAULT_UP: new A.Vector3(0, 1, 0),
|
|
7870
7896
|
FORWARD: new A.Vector3(0, 0, -1)
|
|
7871
|
-
},
|
|
7872
|
-
constructor(e, t =
|
|
7897
|
+
}, Os = (e) => Ds.FORWARD.clone().applyQuaternion(e), ks = (e, t, n = new A.Vector3()) => n.clone().add(e.multiplyScalar(-t)), As = class {
|
|
7898
|
+
constructor(e, t = Ss) {
|
|
7873
7899
|
this.gizmoScene = e, this.gizmoArrowsName = t;
|
|
7874
7900
|
}
|
|
7875
7901
|
syncGizmoWithMain(e, t) {
|
|
7876
7902
|
e.quaternion.copy(t.quaternion), e.up.copy(t.up);
|
|
7877
|
-
let n =
|
|
7878
|
-
e.position.copy(
|
|
7903
|
+
let n = Os(e.quaternion).normalize();
|
|
7904
|
+
e.position.copy(ks(n, Ds.GIZMO_DISTANCE)), e.camera.updateMatrixWorld(!0);
|
|
7879
7905
|
let r = this.gizmoScene.getObjectByName(this.gizmoArrowsName);
|
|
7880
7906
|
r && r.rotation.copy(e.camera.rotation);
|
|
7881
7907
|
}
|
|
7882
7908
|
syncMainWithGizmo(e, t, n) {
|
|
7883
7909
|
let r = n.target.clone(), i = e.position.distanceTo(r), a = e.camera instanceof A.PerspectiveCamera;
|
|
7884
|
-
n instanceof
|
|
7910
|
+
n instanceof bs && !a ? this.syncMapControls(e, t, r, i) : this.syncOrbitControls(e, t, r, i), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
|
|
7885
7911
|
}
|
|
7886
7912
|
syncMapControls(e, t, n, r) {
|
|
7887
|
-
let i = e.position.y - n.y, a =
|
|
7913
|
+
let i = e.position.y - n.y, a = Os(t.quaternion);
|
|
7888
7914
|
a.y = 0, a.normalize();
|
|
7889
7915
|
let o = n.clone();
|
|
7890
|
-
o.y += i, o.add(a.multiplyScalar(-r)), e.position.copy(o), e.up.copy(
|
|
7916
|
+
o.y += i, o.add(a.multiplyScalar(-r)), e.position.copy(o), e.up.copy(Ds.DEFAULT_UP), e.camera.lookAt(n);
|
|
7891
7917
|
}
|
|
7892
7918
|
syncOrbitControls(e, t, n, r) {
|
|
7893
|
-
let i =
|
|
7919
|
+
let i = Os(t.quaternion), a = Ds.DEFAULT_UP.clone().applyQuaternion(t.quaternion), o = ks(i, r, n);
|
|
7894
7920
|
e.position.copy(o), e.up.copy(a), e.camera.lookAt(n);
|
|
7895
7921
|
}
|
|
7896
|
-
},
|
|
7897
|
-
|
|
7922
|
+
}, js = (e) => new As(e), Ms = (e, t, n) => {
|
|
7923
|
+
js(n).syncGizmoWithMain({
|
|
7898
7924
|
camera: e,
|
|
7899
7925
|
position: e.position,
|
|
7900
7926
|
quaternion: e.quaternion,
|
|
@@ -7905,8 +7931,8 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
7905
7931
|
quaternion: t.quaternion,
|
|
7906
7932
|
up: t.up
|
|
7907
7933
|
});
|
|
7908
|
-
},
|
|
7909
|
-
|
|
7934
|
+
}, Ns = (e, t, n) => {
|
|
7935
|
+
js(t.userData.scene).syncMainWithGizmo({
|
|
7910
7936
|
camera: e,
|
|
7911
7937
|
position: e.position,
|
|
7912
7938
|
quaternion: e.quaternion,
|
|
@@ -7917,17 +7943,17 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
7917
7943
|
quaternion: t.quaternion,
|
|
7918
7944
|
up: t.up
|
|
7919
7945
|
}, n);
|
|
7920
|
-
},
|
|
7946
|
+
}, Ps = () => {
|
|
7921
7947
|
try {
|
|
7922
7948
|
let e = document.createElement("canvas");
|
|
7923
7949
|
return !!(window.WebGLRenderingContext && (e.getContext("webgl") || e.getContext("experimental-webgl")));
|
|
7924
7950
|
} catch {
|
|
7925
7951
|
return !1;
|
|
7926
7952
|
}
|
|
7927
|
-
},
|
|
7953
|
+
}, Fs = () => Ps() ? new A.WebGLRenderer({
|
|
7928
7954
|
alpha: !0,
|
|
7929
7955
|
antialias: !1
|
|
7930
|
-
}) : (console.error("WebGL is not supported in this environment."), null),
|
|
7956
|
+
}) : (console.error("WebGL is not supported in this environment."), null), Is = (e) => {
|
|
7931
7957
|
let t = new A.AmbientLight(16777215, 1);
|
|
7932
7958
|
e.add(t);
|
|
7933
7959
|
let n = new A.DirectionalLight(16777215, 1);
|
|
@@ -7936,14 +7962,14 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
7936
7962
|
r.position.set(-5, -10, 5), e.add(r);
|
|
7937
7963
|
let i = new A.PointLight(16777215, 1, 100);
|
|
7938
7964
|
i.position.set(0, 0, 5), e.add(i), n.castShadow = !1, r.castShadow = !1, i.castShadow = !1;
|
|
7939
|
-
},
|
|
7965
|
+
}, Ls = class {
|
|
7940
7966
|
static createTextTexture(e) {
|
|
7941
7967
|
let t = document.createElement("canvas"), n = t.getContext("2d");
|
|
7942
7968
|
t.width = $.CANVAS_SIZE, t.height = $.CANVAS_SIZE, n && (n.clearRect(0, 0, t.width, t.height), n.font = `${$.FONT_SIZE} Arial`, n.fillStyle = $.TEXT_COLOR, n.textAlign = $.TEXT_ALIGN, n.textBaseline = $.TEXT_BASELINE, n.fillText(e, t.width / 2, t.height / 2));
|
|
7943
7969
|
let r = new A.CanvasTexture(t);
|
|
7944
7970
|
return r.needsUpdate = !0, r;
|
|
7945
7971
|
}
|
|
7946
|
-
},
|
|
7972
|
+
}, Rs = class {
|
|
7947
7973
|
static createWireframe([e, t, n]) {
|
|
7948
7974
|
let r = new A.BoxGeometry(e, t, n), i = new A.EdgesGeometry(r), a = new A.LineBasicMaterial({ color: $.LINE_COLOR }), o = new A.LineSegments(i, a);
|
|
7949
7975
|
return o.name = "Wireframe", o;
|
|
@@ -7966,20 +7992,20 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
7966
7992
|
let r = new A.Group(), i = new A.BoxGeometry($.CUBE_SIZE - $.EDGE_SECTION_SIZE, $.CUBE_SIZE - $.EDGE_SECTION_SIZE, $.FACE_THICKNESS), a = new A.MeshStandardMaterial({ color: $.FACE_COLOR }), o = new A.Mesh(i, a);
|
|
7967
7993
|
o.name = `Face Box ${n}`, r.add(o);
|
|
7968
7994
|
let s = new A.PlaneGeometry($.CUBE_SIZE - $.EDGE_SECTION_SIZE, $.CUBE_SIZE - $.EDGE_SECTION_SIZE), c = new A.MeshStandardMaterial({
|
|
7969
|
-
map:
|
|
7995
|
+
map: Ls.createTextTexture(n),
|
|
7970
7996
|
transparent: !0,
|
|
7971
7997
|
depthWrite: !1
|
|
7972
7998
|
}), l = new A.Mesh(s, c);
|
|
7973
7999
|
return l.position.set(0, 0, $.FACE_THICKNESS / 2 + .01), r.add(l), r.position.copy(e), r.rotation.copy(t), r;
|
|
7974
8000
|
}
|
|
7975
|
-
},
|
|
8001
|
+
}, zs = (e, t) => {
|
|
7976
8002
|
let n = document.createElement("canvas");
|
|
7977
8003
|
n.width = 64, n.height = 64;
|
|
7978
8004
|
let r = n.getContext("2d");
|
|
7979
8005
|
r.fillStyle = "rgba(0, 0, 0, 0)", r.fillRect(0, 0, n.width, n.height), r.font = "Bold 48px Arial", r.fillStyle = `#${t.toString(16).padStart(6, "0")}`, r.textAlign = "center", r.textBaseline = "middle", r.fillText(e, n.width / 2, n.height / 2);
|
|
7980
8006
|
let i = new A.CanvasTexture(n), a = new A.SpriteMaterial({ map: i }), o = new A.Sprite(a);
|
|
7981
8007
|
return o.scale.set(.5, .5, .5), o;
|
|
7982
|
-
},
|
|
8008
|
+
}, Bs = class {
|
|
7983
8009
|
constructor(e) {
|
|
7984
8010
|
this.hoveredObject = null, this.originalColor = null, this.config = e;
|
|
7985
8011
|
}
|
|
@@ -7988,17 +8014,17 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
7988
8014
|
}
|
|
7989
8015
|
getInitialRotation() {
|
|
7990
8016
|
switch (this.config.initialFace) {
|
|
7991
|
-
case
|
|
7992
|
-
case
|
|
7993
|
-
case
|
|
7994
|
-
case
|
|
7995
|
-
case
|
|
7996
|
-
case
|
|
8017
|
+
case xs.BACK: return new A.Euler(0, Math.PI, 0);
|
|
8018
|
+
case xs.RIGHT: return new A.Euler(0, -Math.PI / 2, 0);
|
|
8019
|
+
case xs.LEFT: return new A.Euler(0, Math.PI / 2, 0);
|
|
8020
|
+
case xs.TOP: return new A.Euler(Math.PI / 2, 0, 0);
|
|
8021
|
+
case xs.BOTTOM: return new A.Euler(-Math.PI / 2, 0, 0);
|
|
8022
|
+
case xs.FRONT:
|
|
7997
8023
|
default: return new A.Euler(0, 0, 0);
|
|
7998
8024
|
}
|
|
7999
8025
|
}
|
|
8000
8026
|
createWireframe() {
|
|
8001
|
-
let e = $.CUBE_SIZE + $.EDGE_SECTION_SIZE, t =
|
|
8027
|
+
let e = $.CUBE_SIZE + $.EDGE_SECTION_SIZE, t = Rs.createWireframe([
|
|
8002
8028
|
e,
|
|
8003
8029
|
e,
|
|
8004
8030
|
e
|
|
@@ -8006,15 +8032,15 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8006
8032
|
return t.userData.gizmoCube = this, t;
|
|
8007
8033
|
}
|
|
8008
8034
|
createEdgeBox(e, t, n) {
|
|
8009
|
-
let r =
|
|
8035
|
+
let r = Rs.createEdgeBox(e, t, n);
|
|
8010
8036
|
return r.userData.gizmoCube = this, r;
|
|
8011
8037
|
}
|
|
8012
8038
|
createCornerCube(e, t) {
|
|
8013
|
-
let n =
|
|
8039
|
+
let n = Rs.createCornerCube(e, t);
|
|
8014
8040
|
return n.userData.gizmoCube = this, n;
|
|
8015
8041
|
}
|
|
8016
8042
|
createFace(e, t, n) {
|
|
8017
|
-
let r =
|
|
8043
|
+
let r = Rs.createFace(e, t, n), i = r.getObjectByName(`Face Box ${n}`);
|
|
8018
8044
|
return i.userData.gizmoCube = this, r;
|
|
8019
8045
|
}
|
|
8020
8046
|
createEdges(e) {
|
|
@@ -8134,7 +8160,7 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8134
8160
|
d.setRotationFromAxisAngle(e, t);
|
|
8135
8161
|
}
|
|
8136
8162
|
s.add(d);
|
|
8137
|
-
let f =
|
|
8163
|
+
let f = zs(o, t);
|
|
8138
8164
|
return f.position.copy(i).add(n.clone().multiplyScalar(r + .1)), s.add(f), s;
|
|
8139
8165
|
}
|
|
8140
8166
|
createCoordinateAxes() {
|
|
@@ -8174,7 +8200,7 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8174
8200
|
}
|
|
8175
8201
|
create() {
|
|
8176
8202
|
let e = new A.Group();
|
|
8177
|
-
e.name =
|
|
8203
|
+
e.name = Ts;
|
|
8178
8204
|
let t = this.createWireframe();
|
|
8179
8205
|
e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
|
|
8180
8206
|
let n = this.createCoordinateAxes();
|
|
@@ -8196,11 +8222,11 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8196
8222
|
this.hoveredObject.userData.vectorToCube = n;
|
|
8197
8223
|
}
|
|
8198
8224
|
}
|
|
8199
|
-
},
|
|
8225
|
+
}, Vs = class {
|
|
8200
8226
|
constructor(e) {
|
|
8201
8227
|
this.onChangeMainControlsListener = () => {}, this.onChangeGizmoControlsListener = () => {}, this.animationId = 0;
|
|
8202
8228
|
let { gizmoParams: t, mainParams: n, syncFunctions: r, options: i } = e;
|
|
8203
|
-
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 = r, this.options = i, this.gizmoControls = new
|
|
8229
|
+
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 = r, this.options = i, this.gizmoControls = new ss(this.gizmoCamera, this.gizmoRenderer.domElement), this.initializeRenderer(), this.initializeScene(), this.initializeControls(), this.startAnimationLoop();
|
|
8204
8230
|
}
|
|
8205
8231
|
initializeRenderer() {
|
|
8206
8232
|
var e;
|
|
@@ -8209,12 +8235,12 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8209
8235
|
this.gizmoCamera.aspect = t, this.gizmoCamera.updateProjectionMatrix(), (e = this.options) != null && e.up && this.gizmoCamera.up.copy(this.options.up), this.gizmoDiv.appendChild(this.gizmoRenderer.domElement);
|
|
8210
8236
|
}
|
|
8211
8237
|
initializeScene() {
|
|
8212
|
-
let e = new
|
|
8213
|
-
this.gizmoScene.add(e),
|
|
8238
|
+
let e = new Bs({ initialFace: this.options?.initialFace ?? xs.FRONT }).create();
|
|
8239
|
+
this.gizmoScene.add(e), Is(this.gizmoScene);
|
|
8214
8240
|
}
|
|
8215
8241
|
initializeControls() {
|
|
8216
8242
|
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(this.gizmoCamera, this.mainCamera, this.gizmoScene), this.mainControls.addEventListener("change", this.onChangeMainControlsListener), this.gizmoControls.enableZoom = !1, this.gizmoControls.enablePan = !1, this.gizmoControls.rotateSpeed = .5, this.gizmoControls.update(), this.onChangeGizmoControlsListener = () => {
|
|
8217
|
-
this.gizmoScene.getObjectByName(
|
|
8243
|
+
this.gizmoScene.getObjectByName(Ss)?.rotation.copy(this.gizmoCamera.rotation), this.syncFunctions.syncMainCameraWithGizmo(this.mainCamera, this.gizmoCamera, this.mainControls), this.renderGizmo();
|
|
8218
8244
|
}, this.gizmoControls.addEventListener("change", this.onChangeGizmoControlsListener);
|
|
8219
8245
|
}
|
|
8220
8246
|
startAnimationLoop() {
|
|
@@ -8228,25 +8254,25 @@ var gs = "rotation-arrows-name", _s = "left-rotation-arrow-name", vs = "right-ro
|
|
|
8228
8254
|
dispose() {
|
|
8229
8255
|
this.mainControls.removeEventListener("change", this.onChangeMainControlsListener), this.gizmoControls.removeEventListener("change", this.onChangeGizmoControlsListener), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
|
|
8230
8256
|
}
|
|
8231
|
-
},
|
|
8257
|
+
}, Hs = (e, t) => {
|
|
8232
8258
|
let n;
|
|
8233
8259
|
return function(...r) {
|
|
8234
8260
|
n || (e.apply(this, r), n = !0, setTimeout(() => n = !1, t));
|
|
8235
8261
|
};
|
|
8236
8262
|
};
|
|
8237
|
-
function
|
|
8263
|
+
function Us(e, t, n) {
|
|
8238
8264
|
if (!t) return;
|
|
8239
8265
|
let r = t.domElement.getBoundingClientRect();
|
|
8240
8266
|
n.x = (e.clientX - r.left) / r.width * 2 - 1, n.y = -((e.clientY - r.top) / r.height) * 2 + 1;
|
|
8241
8267
|
}
|
|
8242
|
-
var
|
|
8268
|
+
var Ws = (e, t, n, r) => (r.setFromCamera(e, t), r.intersectObjects(n.children, !0)), Gs = (e) => {
|
|
8243
8269
|
let t = ["Wireframe", ""];
|
|
8244
8270
|
return e.find((e) => !t.includes(e.object.name))?.object || null;
|
|
8245
8271
|
};
|
|
8246
|
-
function
|
|
8247
|
-
return !t || !n ? null :
|
|
8272
|
+
function Ks(e, t, n, r) {
|
|
8273
|
+
return !t || !n ? null : Gs(Ws(e, t, n, r));
|
|
8248
8274
|
}
|
|
8249
|
-
function
|
|
8275
|
+
function qs(e, t) {
|
|
8250
8276
|
let n = e?.userData.gizmoCube;
|
|
8251
8277
|
if (e && n) {
|
|
8252
8278
|
n.handleClick();
|
|
@@ -8254,28 +8280,28 @@ function Vs(e, t) {
|
|
|
8254
8280
|
e && t(e);
|
|
8255
8281
|
}
|
|
8256
8282
|
}
|
|
8257
|
-
var
|
|
8283
|
+
var Js = {
|
|
8258
8284
|
radius: 2.1,
|
|
8259
8285
|
color: 12369854,
|
|
8260
8286
|
tubeRadius: .1,
|
|
8261
8287
|
tubeSegments: 8,
|
|
8262
8288
|
numPoints: 64,
|
|
8263
8289
|
tubeOffset: 1.5
|
|
8264
|
-
},
|
|
8290
|
+
}, Ys = {
|
|
8265
8291
|
size: .2,
|
|
8266
8292
|
depth: .1,
|
|
8267
8293
|
heightRatio: 1.4,
|
|
8268
8294
|
segments: 1
|
|
8269
|
-
},
|
|
8295
|
+
}, Xs = class {
|
|
8270
8296
|
constructor(e = {}) {
|
|
8271
8297
|
this.config = {
|
|
8272
|
-
...
|
|
8298
|
+
...Js,
|
|
8273
8299
|
...e
|
|
8274
8300
|
}, this.material = new A.MeshBasicMaterial({ color: this.config.color });
|
|
8275
8301
|
}
|
|
8276
8302
|
create() {
|
|
8277
8303
|
let e = new A.Group(), t = this.createQuarterCircleCurves();
|
|
8278
|
-
return e.add(...this.createTubes(t), ...this.createArrowHeads(t)), e.name =
|
|
8304
|
+
return e.add(...this.createTubes(t), ...this.createArrowHeads(t)), e.name = Ss, e;
|
|
8279
8305
|
}
|
|
8280
8306
|
createQuarterCircleCurves() {
|
|
8281
8307
|
let e = this.generateQuarterCirclePoints(), t = Math.floor(e.length / 2);
|
|
@@ -8293,10 +8319,10 @@ var Hs = {
|
|
|
8293
8319
|
let n = new A.TubeGeometry(e, this.config.numPoints, this.config.tubeRadius, this.config.tubeSegments, !1), r = new A.Mesh(n, this.material);
|
|
8294
8320
|
return r.name = t, r;
|
|
8295
8321
|
};
|
|
8296
|
-
return [n(e,
|
|
8322
|
+
return [n(e, Cs), n(t, ws)];
|
|
8297
8323
|
}
|
|
8298
8324
|
createArrowHeads([e, t]) {
|
|
8299
|
-
let { size: n, depth: r, heightRatio: i, segments: a } =
|
|
8325
|
+
let { size: n, depth: r, heightRatio: i, segments: a } = Ys, o = this.createArrowShape(n, i), s = new A.ExtrudeGeometry(o, {
|
|
8300
8326
|
steps: a,
|
|
8301
8327
|
depth: r,
|
|
8302
8328
|
bevelEnabled: !1
|
|
@@ -8304,7 +8330,7 @@ var Hs = {
|
|
|
8304
8330
|
let r = new A.Mesh(s, this.material);
|
|
8305
8331
|
return r.position.copy(e), r.rotation.z = t, r.name = n, r;
|
|
8306
8332
|
};
|
|
8307
|
-
return [c(e.getPoint(0), this.calculateArrowRotation(e.getTangent(0)) + Math.PI / 2,
|
|
8333
|
+
return [c(e.getPoint(0), this.calculateArrowRotation(e.getTangent(0)) + Math.PI / 2, Cs), c(t.getPoint(1), this.calculateArrowRotation(t.getTangent(1)) - Math.PI / 2, ws)];
|
|
8308
8334
|
}
|
|
8309
8335
|
createArrowShape(e, t) {
|
|
8310
8336
|
return new A.Shape().moveTo(0, 0).lineTo(e, -e * t).lineTo(-e, -e * t).lineTo(0, 0);
|
|
@@ -8312,31 +8338,31 @@ var Hs = {
|
|
|
8312
8338
|
calculateArrowRotation(e) {
|
|
8313
8339
|
return Math.atan2(e.y, e.x);
|
|
8314
8340
|
}
|
|
8315
|
-
},
|
|
8341
|
+
}, Zs = (e) => {
|
|
8316
8342
|
let t = e.rotation, n = .01, r = Math.PI, i = (Math.abs(t.x) % (2 * r) + 2 * r) % (2 * r), a = (Math.abs(t.y) % (2 * r) + 2 * r) % (2 * r), o = Math.abs(i - r / 2) < n || Math.abs(i - 3 * r / 2) < n || Math.abs(a - r / 2) < n || Math.abs(a - 3 * r / 2) < n, s = (Math.abs(i) < n || Math.abs(i - r) < n) && (Math.abs(a) < n || Math.abs(a - r) < n);
|
|
8317
8343
|
return !(o || s);
|
|
8318
|
-
},
|
|
8319
|
-
function
|
|
8344
|
+
}, Qs = 25, $s = 200;
|
|
8345
|
+
function ec({ gizmoRenderer: e, gizmoScene: t, gizmoCamera: n, alignCameraWithVector: r, gizmoControlRef: i }) {
|
|
8320
8346
|
let a = O(null), o = O(null), s = O(new A.Raycaster()).current, c = O(new A.Vector2()).current, l = re(() => {
|
|
8321
|
-
let e = t.getObjectByName(
|
|
8347
|
+
let e = t.getObjectByName(Ss), r = Zs(n);
|
|
8322
8348
|
if (e && r) {
|
|
8323
8349
|
t.remove(e);
|
|
8324
8350
|
return;
|
|
8325
8351
|
}
|
|
8326
8352
|
if (e || r) return;
|
|
8327
|
-
let i = new
|
|
8353
|
+
let i = new Xs().create();
|
|
8328
8354
|
i.rotation.copy(n.rotation), t.add(i);
|
|
8329
8355
|
}, [t, n]), u = re(() => {
|
|
8330
|
-
let e = t.getObjectByName(
|
|
8356
|
+
let e = t.getObjectByName(Ss);
|
|
8331
8357
|
e && t.remove(e);
|
|
8332
|
-
}, [t]), d = re(
|
|
8358
|
+
}, [t]), d = re(Hs((r) => {
|
|
8333
8359
|
if (!i.current || !e) return;
|
|
8334
|
-
|
|
8335
|
-
let a =
|
|
8360
|
+
Us(r, e, c);
|
|
8361
|
+
let a = Ws(c, n, t, s), o = Gs(a);
|
|
8336
8362
|
o != null && o.userData.gizmoCube ? o.userData.gizmoCube.highlightObject(o) : t.traverse((e) => {
|
|
8337
8363
|
e.userData.gizmoCube && e.userData.gizmoCube.highlightObject(null);
|
|
8338
8364
|
}), a.length > 0 ? l() : u();
|
|
8339
|
-
}, 1e3 /
|
|
8365
|
+
}, 1e3 / Qs), [
|
|
8340
8366
|
i,
|
|
8341
8367
|
e,
|
|
8342
8368
|
n,
|
|
@@ -8352,17 +8378,17 @@ function Js({ gizmoRenderer: e, gizmoScene: t, gizmoCamera: n, alignCameraWithVe
|
|
|
8352
8378
|
};
|
|
8353
8379
|
}, []), p = re((e) => {
|
|
8354
8380
|
var t;
|
|
8355
|
-
let r = e.name ===
|
|
8381
|
+
let r = e.name === ws ? 1 : -1, a = 90 * Math.PI / 180, o = new A.Vector3(0, 0, 0), s = r * a, c = new A.Matrix4();
|
|
8356
8382
|
c.makeRotationZ(s), n.up.applyMatrix4(c), n.lookAt(o), (t = i.current) == null || t.gizmoControls.update();
|
|
8357
8383
|
}, [n, i]);
|
|
8358
8384
|
return {
|
|
8359
8385
|
onMouseDown: f,
|
|
8360
8386
|
onMouseMove: d,
|
|
8361
8387
|
onMouseUp: re((i) => {
|
|
8362
|
-
if ((a.current ? Date.now() - a.current : 0) <
|
|
8363
|
-
|
|
8364
|
-
let a =
|
|
8365
|
-
a != null && a.name &&
|
|
8388
|
+
if ((a.current ? Date.now() - a.current : 0) < $s) {
|
|
8389
|
+
Us(i, e, c);
|
|
8390
|
+
let a = Ks(c, n, t, s);
|
|
8391
|
+
a != null && a.name && Es.includes(a.name) ? p(a) : qs(a, r);
|
|
8366
8392
|
}
|
|
8367
8393
|
a.current = null, o.current = null;
|
|
8368
8394
|
}, [
|
|
@@ -8377,15 +8403,15 @@ function Js({ gizmoRenderer: e, gizmoScene: t, gizmoCamera: n, alignCameraWithVe
|
|
|
8377
8403
|
onMouseLeave: u
|
|
8378
8404
|
};
|
|
8379
8405
|
}
|
|
8380
|
-
var
|
|
8381
|
-
let a = O(null), o = O(new A.Scene()).current, [s] = k(() =>
|
|
8406
|
+
var tc = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
8407
|
+
let a = O(null), o = O(new A.Scene()).current, [s] = k(() => Fs()), c = O(new A.PerspectiveCamera(30, 1, .1, 10)).current, l = O(null), u = re(() => {
|
|
8382
8408
|
s && (r(), s.render(o, c));
|
|
8383
8409
|
}, [
|
|
8384
8410
|
r,
|
|
8385
8411
|
s,
|
|
8386
8412
|
o,
|
|
8387
8413
|
c
|
|
8388
|
-
]), { onMouseDown: d, onMouseMove: f, onMouseUp: p, onMouseLeave: m } =
|
|
8414
|
+
]), { onMouseDown: d, onMouseMove: f, onMouseUp: p, onMouseLeave: m } = ec({
|
|
8389
8415
|
gizmoRenderer: s,
|
|
8390
8416
|
gizmoScene: o,
|
|
8391
8417
|
gizmoCamera: c,
|
|
@@ -8394,7 +8420,7 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8394
8420
|
let r = e.position.length(), i = n.clone().multiplyScalar(r), a = new A.Matrix4();
|
|
8395
8421
|
a.lookAt(i, new A.Vector3(0, 0, 0), new A.Vector3(0, 1, 0));
|
|
8396
8422
|
let o = new A.Quaternion();
|
|
8397
|
-
o.setFromRotationMatrix(a), e.quaternion.copy(o),
|
|
8423
|
+
o.setFromRotationMatrix(a), e.quaternion.copy(o), $o(e, t, e.position.clone(), i, 400, u), e.up.set(0, 1, 0), e.lookAt(new A.Vector3(0, 0, 0)), t.target.set(0, 0, 0), t.update();
|
|
8398
8424
|
}, [
|
|
8399
8425
|
e,
|
|
8400
8426
|
t,
|
|
@@ -8405,7 +8431,7 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8405
8431
|
});
|
|
8406
8432
|
return E(() => {
|
|
8407
8433
|
let n = a.current;
|
|
8408
|
-
if (!(!n || !e || !t || !s)) return l.current && l.current.dispose(), l.current = new
|
|
8434
|
+
if (!(!n || !e || !t || !s)) return l.current && l.current.dispose(), l.current = new Vs({
|
|
8409
8435
|
gizmoParams: {
|
|
8410
8436
|
gizmoDiv: n,
|
|
8411
8437
|
gizmoScene: o,
|
|
@@ -8418,8 +8444,8 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8418
8444
|
renderGizmo: u
|
|
8419
8445
|
},
|
|
8420
8446
|
syncFunctions: {
|
|
8421
|
-
syncGizmoCameraWithMain:
|
|
8422
|
-
syncMainCameraWithGizmo:
|
|
8447
|
+
syncGizmoCameraWithMain: Ms,
|
|
8448
|
+
syncMainCameraWithGizmo: Ns
|
|
8423
8449
|
},
|
|
8424
8450
|
options: i
|
|
8425
8451
|
}), n.addEventListener("mousedown", d), n.addEventListener("mousemove", f), n.addEventListener("mouseup", p), n.addEventListener("mouseleave", m), () => {
|
|
@@ -8433,17 +8459,17 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8433
8459
|
d,
|
|
8434
8460
|
p
|
|
8435
8461
|
]), E(() => {
|
|
8436
|
-
e && (
|
|
8462
|
+
e && (Ms(c, e, o), u());
|
|
8437
8463
|
}, [e, u]), /* @__PURE__ */ H("div", {
|
|
8438
8464
|
className: n ? `${n}` : "gizmo-default",
|
|
8439
8465
|
ref: a
|
|
8440
8466
|
});
|
|
8441
|
-
},
|
|
8442
|
-
top: e.startsWith("top") ?
|
|
8443
|
-
bottom: e.startsWith("bottom") ?
|
|
8444
|
-
left: e.endsWith("left") ?
|
|
8445
|
-
right: e.endsWith("right") ?
|
|
8446
|
-
}),
|
|
8467
|
+
}, nc = 10, rc = (e) => ({
|
|
8468
|
+
top: e.startsWith("top") ? nc : "auto",
|
|
8469
|
+
bottom: e.startsWith("bottom") ? nc : "auto",
|
|
8470
|
+
left: e.endsWith("left") ? nc : "auto",
|
|
8471
|
+
right: e.endsWith("right") ? nc : "auto"
|
|
8472
|
+
}), ic = ({ camera: e, controls: t, render: n, placement: r = "top-right", size: i = 128 }) => {
|
|
8447
8473
|
if (!e || !t) return null;
|
|
8448
8474
|
let a = t;
|
|
8449
8475
|
return /* @__PURE__ */ H("div", {
|
|
@@ -8453,15 +8479,15 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8453
8479
|
width: i,
|
|
8454
8480
|
height: i,
|
|
8455
8481
|
zIndex: 10,
|
|
8456
|
-
...
|
|
8482
|
+
...rc(r)
|
|
8457
8483
|
},
|
|
8458
|
-
children: /* @__PURE__ */ H(
|
|
8484
|
+
children: /* @__PURE__ */ H(tc, {
|
|
8459
8485
|
camera: e,
|
|
8460
8486
|
controls: a,
|
|
8461
8487
|
render: n
|
|
8462
8488
|
})
|
|
8463
8489
|
});
|
|
8464
|
-
},
|
|
8490
|
+
}, ac = class extends w {
|
|
8465
8491
|
constructor(e) {
|
|
8466
8492
|
super(e), this.reset = () => {
|
|
8467
8493
|
this.setState({
|
|
@@ -8507,13 +8533,13 @@ var Ys = ({ camera: e, controls: t, className: n, render: r, options: i }) => {
|
|
|
8507
8533
|
] })
|
|
8508
8534
|
}) : this.props.children;
|
|
8509
8535
|
}
|
|
8510
|
-
},
|
|
8511
|
-
if (!
|
|
8512
|
-
let t = window.matchMedia(
|
|
8536
|
+
}, oc = "(prefers-reduced-motion: reduce)", sc = () => typeof window < "u" && typeof window.matchMedia == "function", cc = (e) => {
|
|
8537
|
+
if (!sc()) return () => {};
|
|
8538
|
+
let t = window.matchMedia(oc);
|
|
8513
8539
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
8514
|
-
},
|
|
8515
|
-
function
|
|
8516
|
-
let i = oe(
|
|
8540
|
+
}, lc = () => sc() && window.matchMedia(oc).matches;
|
|
8541
|
+
function uc({ status: e, label: t, color: n, backdrop: r }) {
|
|
8542
|
+
let i = oe(cc, lc, () => !1);
|
|
8517
8543
|
return /* @__PURE__ */ Dt("div", {
|
|
8518
8544
|
"data-testid": "viewer-loading-overlay",
|
|
8519
8545
|
role: "status",
|
|
@@ -8600,14 +8626,14 @@ function ic({ status: e, label: t, color: n, backdrop: r }) {
|
|
|
8600
8626
|
}
|
|
8601
8627
|
//#endregion
|
|
8602
8628
|
//#region src/presentation/components/theme.ts
|
|
8603
|
-
var
|
|
8629
|
+
var dc = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", fc = {
|
|
8604
8630
|
background: "rgba(255,255,255,0.78)",
|
|
8605
8631
|
backdropFilter: "blur(16px)",
|
|
8606
8632
|
WebkitBackdropFilter: "blur(16px)",
|
|
8607
8633
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
8608
8634
|
boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
|
|
8609
|
-
},
|
|
8610
|
-
function
|
|
8635
|
+
}, pc = Object.keys(Po);
|
|
8636
|
+
function mc({ active: e, onSelect: t }) {
|
|
8611
8637
|
return /* @__PURE__ */ H("div", {
|
|
8612
8638
|
"data-testid": "viewer-preset-picker",
|
|
8613
8639
|
role: "group",
|
|
@@ -8624,9 +8650,9 @@ function cc({ active: e, onSelect: t }) {
|
|
|
8624
8650
|
borderRadius: 999,
|
|
8625
8651
|
maxWidth: "calc(100% - 16px)",
|
|
8626
8652
|
overflowX: "auto",
|
|
8627
|
-
...
|
|
8653
|
+
...fc
|
|
8628
8654
|
},
|
|
8629
|
-
children:
|
|
8655
|
+
children: pc.map((n) => /* @__PURE__ */ H("button", {
|
|
8630
8656
|
type: "button",
|
|
8631
8657
|
"aria-pressed": n === e,
|
|
8632
8658
|
onClick: () => t(n),
|
|
@@ -8636,7 +8662,7 @@ function cc({ active: e, onSelect: t }) {
|
|
|
8636
8662
|
border: n === e ? "1px solid #111318" : "1px solid transparent",
|
|
8637
8663
|
background: n === e ? "#111318" : "transparent",
|
|
8638
8664
|
color: n === e ? "#fff" : "#3f3f4a",
|
|
8639
|
-
fontFamily:
|
|
8665
|
+
fontFamily: dc,
|
|
8640
8666
|
fontSize: 13,
|
|
8641
8667
|
fontWeight: 500,
|
|
8642
8668
|
lineHeight: 1,
|
|
@@ -8652,11 +8678,11 @@ function cc({ active: e, onSelect: t }) {
|
|
|
8652
8678
|
}
|
|
8653
8679
|
//#endregion
|
|
8654
8680
|
//#region src/presentation/components/arHandoff.ts
|
|
8655
|
-
var
|
|
8656
|
-
function
|
|
8681
|
+
var hc = "#softbox-ar-failed";
|
|
8682
|
+
function gc() {
|
|
8657
8683
|
return typeof document > "u" || typeof navigator > "u" ? null : document.createElement("a").relList?.supports?.("ar") ? "quick-look" : /android/i.test(navigator.userAgent) ? "scene-viewer" : null;
|
|
8658
8684
|
}
|
|
8659
|
-
function
|
|
8685
|
+
function _c(e) {
|
|
8660
8686
|
if (typeof window > "u" || typeof e != "string" || e.length === 0) return null;
|
|
8661
8687
|
try {
|
|
8662
8688
|
let t = new URL(e, window.location.href);
|
|
@@ -8665,23 +8691,23 @@ function dc(e) {
|
|
|
8665
8691
|
return null;
|
|
8666
8692
|
}
|
|
8667
8693
|
}
|
|
8668
|
-
function
|
|
8694
|
+
function vc(e, t) {
|
|
8669
8695
|
let n = `file=${encodeURIComponent(e)}&mode=ar_preferred`;
|
|
8670
8696
|
t && (n += `&title=${encodeURIComponent(t)}`);
|
|
8671
8697
|
let r = new URL(window.location.href);
|
|
8672
|
-
return r.hash =
|
|
8698
|
+
return r.hash = hc, `intent://arvr.google.com/scene-viewer/1.0?${n}#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(r.toString())};end;`;
|
|
8673
8699
|
}
|
|
8674
|
-
function
|
|
8700
|
+
function yc(e) {
|
|
8675
8701
|
let t = document.createElement("a");
|
|
8676
8702
|
t.rel = "ar", t.appendChild(document.createElement("img")), t.href = e, t.click();
|
|
8677
8703
|
}
|
|
8678
|
-
function
|
|
8704
|
+
function bc(e) {
|
|
8679
8705
|
let t = document.createElement("a");
|
|
8680
8706
|
t.href = e, t.click();
|
|
8681
8707
|
}
|
|
8682
8708
|
//#endregion
|
|
8683
8709
|
//#region src/presentation/components/ArButton.tsx
|
|
8684
|
-
var
|
|
8710
|
+
var xc = {
|
|
8685
8711
|
"top-left": {
|
|
8686
8712
|
top: 16,
|
|
8687
8713
|
left: 16
|
|
@@ -8699,10 +8725,10 @@ var hc = {
|
|
|
8699
8725
|
right: 16
|
|
8700
8726
|
}
|
|
8701
8727
|
};
|
|
8702
|
-
function
|
|
8728
|
+
function Sc({ source: e, options: t, clearPresetRow: n }) {
|
|
8703
8729
|
let [r, i] = k(null);
|
|
8704
8730
|
E(() => {
|
|
8705
|
-
i(
|
|
8731
|
+
i(gc());
|
|
8706
8732
|
}, []);
|
|
8707
8733
|
let [a, o] = k(!1);
|
|
8708
8734
|
E(() => {
|
|
@@ -8711,13 +8737,13 @@ function gc({ source: e, options: t, clearPresetRow: n }) {
|
|
|
8711
8737
|
};
|
|
8712
8738
|
return window.addEventListener("hashchange", e), () => window.removeEventListener("hashchange", e);
|
|
8713
8739
|
}, []);
|
|
8714
|
-
let s =
|
|
8740
|
+
let s = _c(e), c = D(() => {
|
|
8715
8741
|
if (a) return null;
|
|
8716
8742
|
if (r === "quick-look" && t.iosSrc) {
|
|
8717
8743
|
let e = t.iosSrc;
|
|
8718
|
-
return () =>
|
|
8744
|
+
return () => yc(e);
|
|
8719
8745
|
}
|
|
8720
|
-
return r === "scene-viewer" && s ? () =>
|
|
8746
|
+
return r === "scene-viewer" && s ? () => bc(vc(s, t.title)) : null;
|
|
8721
8747
|
}, [
|
|
8722
8748
|
a,
|
|
8723
8749
|
r,
|
|
@@ -8726,7 +8752,7 @@ function gc({ source: e, options: t, clearPresetRow: n }) {
|
|
|
8726
8752
|
s
|
|
8727
8753
|
]);
|
|
8728
8754
|
if (!c) return null;
|
|
8729
|
-
let l = { ...
|
|
8755
|
+
let l = { ...xc[t.placement ?? "bottom-left"] };
|
|
8730
8756
|
return n && l.bottom !== void 0 && (l.bottom = 64), /* @__PURE__ */ H("button", {
|
|
8731
8757
|
type: "button",
|
|
8732
8758
|
"data-testid": "viewer-ar-button",
|
|
@@ -8738,21 +8764,21 @@ function gc({ source: e, options: t, clearPresetRow: n }) {
|
|
|
8738
8764
|
padding: "8px 16px",
|
|
8739
8765
|
borderRadius: 999,
|
|
8740
8766
|
color: "#111318",
|
|
8741
|
-
fontFamily:
|
|
8767
|
+
fontFamily: dc,
|
|
8742
8768
|
fontSize: 13,
|
|
8743
8769
|
fontWeight: 600,
|
|
8744
8770
|
lineHeight: 1,
|
|
8745
8771
|
cursor: "pointer",
|
|
8746
8772
|
...l,
|
|
8747
|
-
...
|
|
8773
|
+
...fc
|
|
8748
8774
|
},
|
|
8749
8775
|
children: "AR"
|
|
8750
8776
|
});
|
|
8751
8777
|
}
|
|
8752
8778
|
//#endregion
|
|
8753
8779
|
//#region src/presentation/components/PosterOverlay.tsx
|
|
8754
|
-
var
|
|
8755
|
-
function
|
|
8780
|
+
var Cc = 400;
|
|
8781
|
+
function wc({ src: e, visible: t }) {
|
|
8756
8782
|
let [n, r] = k(!1);
|
|
8757
8783
|
return E(() => {
|
|
8758
8784
|
if (t) return;
|
|
@@ -8776,35 +8802,35 @@ function vc({ src: e, visible: t }) {
|
|
|
8776
8802
|
zIndex: 15,
|
|
8777
8803
|
pointerEvents: t ? "auto" : "none",
|
|
8778
8804
|
opacity: +!!t,
|
|
8779
|
-
transition: `opacity ${
|
|
8805
|
+
transition: `opacity ${Cc}ms ease`
|
|
8780
8806
|
}
|
|
8781
8807
|
});
|
|
8782
8808
|
}
|
|
8783
8809
|
//#endregion
|
|
8784
8810
|
//#region src/presentation/components/loadingIndicatorConfig.ts
|
|
8785
|
-
var
|
|
8811
|
+
var Tc = {
|
|
8786
8812
|
enabled: !0,
|
|
8787
8813
|
label: "Loading…",
|
|
8788
8814
|
color: "#ffffff",
|
|
8789
8815
|
backdrop: "rgba(15,16,20,0.6)"
|
|
8790
8816
|
};
|
|
8791
|
-
function
|
|
8792
|
-
return e === void 0 || e === !0 ?
|
|
8793
|
-
...
|
|
8817
|
+
function Ec(e) {
|
|
8818
|
+
return e === void 0 || e === !0 ? Tc : e === !1 ? {
|
|
8819
|
+
...Tc,
|
|
8794
8820
|
enabled: !1
|
|
8795
8821
|
} : {
|
|
8796
8822
|
enabled: e.enabled ?? !0,
|
|
8797
|
-
label: e.label ??
|
|
8823
|
+
label: e.label ?? Tc.label,
|
|
8798
8824
|
errorLabel: e.errorLabel,
|
|
8799
|
-
color: e.color ??
|
|
8800
|
-
backdrop: e.backdrop ??
|
|
8825
|
+
color: e.color ?? Tc.color,
|
|
8826
|
+
backdrop: e.backdrop ?? Tc.backdrop
|
|
8801
8827
|
};
|
|
8802
8828
|
}
|
|
8803
8829
|
//#endregion
|
|
8804
8830
|
//#region src/presentation/components/SimpleViewer.tsx
|
|
8805
|
-
var
|
|
8806
|
-
let l = O(null), { activePreset: u, pickerEnabled: d, selectPreset: f } =
|
|
8807
|
-
|
|
8831
|
+
var Dc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Oc = ne(({ object: e, options: t = {}, preset: n, pathTraced: r, turntable: i, animations: a, children: s }, c) => {
|
|
8832
|
+
let l = O(null), { activePreset: u, pickerEnabled: d, selectPreset: f } = Uo(t.preset ?? n, t.ui), { viewer: p, isInitialized: m, initError: h } = Vo(l, Wo(t, u, r, i, a)), g = Go(p, m, e), y = qo(p);
|
|
8833
|
+
Jo(p, h, t);
|
|
8808
8834
|
let x = p ? _(p.getCamera()) : null, S = p ? b(p.getControls()) : null, ee = p ? o(p.getRenderer()) : null, te = re(() => {
|
|
8809
8835
|
p?.requestRender();
|
|
8810
8836
|
}, [p]), C = t.helpers?.gizmo !== void 0 && t.helpers.gizmo !== !1, w = typeof t.helpers?.gizmo == "object" ? t.helpers.gizmo : {}, T = t.ar === !0 ? {} : t.ar || null, [ne, ie] = k(null);
|
|
@@ -8836,7 +8862,7 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8836
8862
|
se,
|
|
8837
8863
|
y
|
|
8838
8864
|
]);
|
|
8839
|
-
let le = D(() =>
|
|
8865
|
+
let le = D(() => Ec(t.loadingIndicator), [t.loadingIndicator]), ue = g.status === "error" || !!h, de = le.enabled && (g.status === "loading" || ue), fe = !se && !(ue && !le.enabled);
|
|
8840
8866
|
return ae(c, () => ({
|
|
8841
8867
|
scene: p ? v(p.getScene()) : null,
|
|
8842
8868
|
camera: x,
|
|
@@ -8844,18 +8870,18 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8844
8870
|
controls: S,
|
|
8845
8871
|
events: y,
|
|
8846
8872
|
loadModel: async (e) => {
|
|
8847
|
-
if (!p) throw
|
|
8873
|
+
if (!p) throw Dc();
|
|
8848
8874
|
let t = typeof e == "string" ? e : new on(e), n = await p.loadModel(t);
|
|
8849
8875
|
if (!n.ok) throw n.error;
|
|
8850
8876
|
},
|
|
8851
8877
|
captureStill: async (e) => {
|
|
8852
|
-
if (!p) throw
|
|
8878
|
+
if (!p) throw Dc();
|
|
8853
8879
|
let t = await p.captureStill(e);
|
|
8854
8880
|
if (!t.ok) throw t.error;
|
|
8855
8881
|
return t.value;
|
|
8856
8882
|
},
|
|
8857
8883
|
captureVideo: async (e) => {
|
|
8858
|
-
if (!p) throw
|
|
8884
|
+
if (!p) throw Dc();
|
|
8859
8885
|
let t = await p.captureVideo(e);
|
|
8860
8886
|
if (!t.ok) throw t.error;
|
|
8861
8887
|
return t.value;
|
|
@@ -8863,12 +8889,12 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8863
8889
|
getAnimationNames: () => p?.getAnimationNames() ?? [],
|
|
8864
8890
|
getVariantNames: () => p?.getVariantNames() ?? [],
|
|
8865
8891
|
setVariant: (e) => {
|
|
8866
|
-
if (!p) throw
|
|
8892
|
+
if (!p) throw Dc();
|
|
8867
8893
|
let t = p.setMaterialVariant(e);
|
|
8868
8894
|
if (!t.ok) throw t.error;
|
|
8869
8895
|
},
|
|
8870
8896
|
playAnimations: (e) => {
|
|
8871
|
-
if (!p) throw
|
|
8897
|
+
if (!p) throw Dc();
|
|
8872
8898
|
let t = p.playAnimations(e);
|
|
8873
8899
|
if (!t.ok) throw t.error;
|
|
8874
8900
|
},
|
|
@@ -8876,22 +8902,22 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8876
8902
|
p?.pauseAnimations();
|
|
8877
8903
|
},
|
|
8878
8904
|
setEnvironmentMap: async (e) => {
|
|
8879
|
-
if (!p) throw
|
|
8905
|
+
if (!p) throw Dc();
|
|
8880
8906
|
let t = await p.setEnvironmentMap(e);
|
|
8881
8907
|
if (!t.ok) throw t.error;
|
|
8882
8908
|
},
|
|
8883
8909
|
resetEnvironment: () => {
|
|
8884
|
-
if (!p) throw
|
|
8910
|
+
if (!p) throw Dc();
|
|
8885
8911
|
let e = p.resetEnvironment();
|
|
8886
8912
|
if (!e.ok) throw e.error;
|
|
8887
8913
|
},
|
|
8888
8914
|
setBackgroundImage: async (e) => {
|
|
8889
|
-
if (!p) throw
|
|
8915
|
+
if (!p) throw Dc();
|
|
8890
8916
|
let t = await p.setBackgroundImage(e);
|
|
8891
8917
|
if (!t.ok) throw t.error;
|
|
8892
8918
|
},
|
|
8893
8919
|
setBackgroundColor: (e) => {
|
|
8894
|
-
if (!p) throw
|
|
8920
|
+
if (!p) throw Dc();
|
|
8895
8921
|
let t = p.setBackgroundColor(e);
|
|
8896
8922
|
if (!t.ok) throw t.error;
|
|
8897
8923
|
},
|
|
@@ -8904,7 +8930,7 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8904
8930
|
ee,
|
|
8905
8931
|
S,
|
|
8906
8932
|
y
|
|
8907
|
-
]), /* @__PURE__ */ H(
|
|
8933
|
+
]), /* @__PURE__ */ H(ac, { children: /* @__PURE__ */ H(Xo, {
|
|
8908
8934
|
viewer: p,
|
|
8909
8935
|
canvasRef: l,
|
|
8910
8936
|
children: /* @__PURE__ */ Dt("div", {
|
|
@@ -8914,30 +8940,30 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8914
8940
|
height: "100%"
|
|
8915
8941
|
},
|
|
8916
8942
|
children: [
|
|
8917
|
-
/* @__PURE__ */ H(
|
|
8918
|
-
C && m && x && S && /* @__PURE__ */ H(
|
|
8943
|
+
/* @__PURE__ */ H(Qo, {}),
|
|
8944
|
+
C && m && x && S && /* @__PURE__ */ H(ic, {
|
|
8919
8945
|
camera: x,
|
|
8920
8946
|
controls: S,
|
|
8921
8947
|
render: te,
|
|
8922
8948
|
placement: w.placement,
|
|
8923
8949
|
size: w.size
|
|
8924
8950
|
}),
|
|
8925
|
-
de && /* @__PURE__ */ H(
|
|
8951
|
+
de && /* @__PURE__ */ H(uc, {
|
|
8926
8952
|
status: ue ? "error" : "loading",
|
|
8927
8953
|
label: ue ? le.errorLabel ?? h?.message ?? g.error ?? "Failed to load model" : le.label,
|
|
8928
8954
|
color: le.color,
|
|
8929
8955
|
backdrop: le.backdrop
|
|
8930
8956
|
}),
|
|
8931
|
-
d && /* @__PURE__ */ H(
|
|
8957
|
+
d && /* @__PURE__ */ H(mc, {
|
|
8932
8958
|
active: u ?? "studio",
|
|
8933
8959
|
onSelect: f
|
|
8934
8960
|
}),
|
|
8935
|
-
T && /* @__PURE__ */ H(
|
|
8961
|
+
T && /* @__PURE__ */ H(Sc, {
|
|
8936
8962
|
source: oe,
|
|
8937
8963
|
options: T,
|
|
8938
8964
|
clearPresetRow: d
|
|
8939
8965
|
}),
|
|
8940
|
-
A && /* @__PURE__ */ H(
|
|
8966
|
+
A && /* @__PURE__ */ H(wc, {
|
|
8941
8967
|
src: A,
|
|
8942
8968
|
visible: fe
|
|
8943
8969
|
}),
|
|
@@ -8946,17 +8972,17 @@ var xc = () => new t("Viewer is not ready yet", i.COMPONENT_NOT_MOUNTED), Sc = n
|
|
|
8946
8972
|
})
|
|
8947
8973
|
}) });
|
|
8948
8974
|
});
|
|
8949
|
-
|
|
8975
|
+
Oc.displayName = "SimpleViewer";
|
|
8950
8976
|
//#endregion
|
|
8951
8977
|
//#region src/SimpleViewerWrapper.tsx
|
|
8952
|
-
var
|
|
8978
|
+
var kc = ne((e, t) => /* @__PURE__ */ H(Oc, {
|
|
8953
8979
|
ref: t,
|
|
8954
8980
|
...e
|
|
8955
8981
|
}));
|
|
8956
|
-
|
|
8982
|
+
kc.displayName = "SimpleViewer";
|
|
8957
8983
|
//#endregion
|
|
8958
8984
|
//#region src/presentation/components/Hotspot.tsx
|
|
8959
|
-
var
|
|
8985
|
+
var Ac = () => /* @__PURE__ */ H("span", {
|
|
8960
8986
|
"aria-hidden": "true",
|
|
8961
8987
|
style: {
|
|
8962
8988
|
display: "block",
|
|
@@ -8968,8 +8994,8 @@ var wc = () => /* @__PURE__ */ H("span", {
|
|
|
8968
8994
|
boxShadow: "0 2px 8px rgba(0,0,0,0.35)"
|
|
8969
8995
|
}
|
|
8970
8996
|
});
|
|
8971
|
-
function
|
|
8972
|
-
let { viewer: r } =
|
|
8997
|
+
function jc({ position: e, occlude: t = !1, children: n }) {
|
|
8998
|
+
let { viewer: r } = Zo(), i = O(null), [a, o, s] = e;
|
|
8973
8999
|
E(() => {
|
|
8974
9000
|
if (!r) return;
|
|
8975
9001
|
let e = i.current;
|
|
@@ -9021,8 +9047,8 @@ function Tc({ position: e, occlude: t = !1, children: n }) {
|
|
|
9021
9047
|
zIndex: 5,
|
|
9022
9048
|
pointerEvents: c ? "auto" : "none"
|
|
9023
9049
|
},
|
|
9024
|
-
children: c ? n : /* @__PURE__ */ H(
|
|
9050
|
+
children: c ? n : /* @__PURE__ */ H(Ac, {})
|
|
9025
9051
|
});
|
|
9026
9052
|
}
|
|
9027
9053
|
//#endregion
|
|
9028
|
-
export {
|
|
9054
|
+
export { no as ControlType, Ao as DEFAULT_OUTDOOR_CONCRETE_TEXTURES, ko as DEFAULT_OUTDOOR_HDRI_URL, Mo as DEFAULT_SCENE, ro as DEFAULT_STUDIO_LOOK, i as ErrorCode, jc as Hotspot, kc as SimpleViewer, t as ThreeViewerError, n as TypedEventEmitter, Po as VIEWER_PRESETS, jo as VIEWER_SCENES, Oo as defaultOptions, Fo as resolvePreset, No as resolveScene };
|