endset_three_editor 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -545,8 +545,8 @@ class ni extends On {
|
|
|
545
545
|
}), o[C] = y, i[C] = y, n[C] = y;
|
|
546
546
|
}
|
|
547
547
|
a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
|
|
548
|
-
const l = new M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart",
|
|
548
|
+
const l = new M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(), m = new M(), p = new M(), f = new M(), g = 0, x = new M();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart", m), a("pointEnd", p), a("rotationAxis", f), a("rotationAngle", g), a("eye", x), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.bind(this), t !== null && this.connect(t);
|
|
550
550
|
}
|
|
551
551
|
connect(e) {
|
|
552
552
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -802,8 +802,8 @@ class ci extends ke {
|
|
|
802
802
|
h.color.setHex(16776960), h.opacity = 0.25;
|
|
803
803
|
const d = e.clone();
|
|
804
804
|
d.color.setHex(16776960);
|
|
805
|
-
const
|
|
806
|
-
|
|
805
|
+
const m = e.clone();
|
|
806
|
+
m.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
@@ -813,8 +813,8 @@ class ci extends ke {
|
|
|
813
813
|
zAxisTransparent: A,
|
|
814
814
|
activeTransparent: h
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const p = new U(0, 0.04, 0.1, 12);
|
|
817
|
+
p.translate(0, 0.05, 0);
|
|
818
818
|
const f = new q(0.08, 0.08, 0.08);
|
|
819
819
|
f.translate(0, 0.04, 0);
|
|
820
820
|
const g = new We();
|
|
@@ -831,18 +831,18 @@ class ci extends ke {
|
|
|
831
831
|
}
|
|
832
832
|
const w = {
|
|
833
833
|
X: [
|
|
834
|
-
[new v(
|
|
835
|
-
[new v(
|
|
834
|
+
[new v(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new v(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
836
|
[new v(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new v(
|
|
840
|
-
[new v(
|
|
839
|
+
[new v(p, o), [0, 0.5, 0]],
|
|
840
|
+
[new v(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
841
|
[new v(x, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new v(
|
|
845
|
-
[new v(
|
|
844
|
+
[new v(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new v(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
846
|
[new v(x, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
@@ -903,7 +903,7 @@ class ci extends ke {
|
|
|
903
903
|
]
|
|
904
904
|
}, Z = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new v(C(0.5, 1),
|
|
906
|
+
[new v(C(0.5, 1), m), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
909
|
[new v(C(0.5, 0.5), i)]
|
|
@@ -1114,51 +1114,51 @@ class di {
|
|
|
1114
1114
|
width: s,
|
|
1115
1115
|
height: n
|
|
1116
1116
|
};
|
|
1117
|
-
}, this.render = function(
|
|
1118
|
-
|
|
1119
|
-
}, this.setSize = function(
|
|
1120
|
-
s =
|
|
1117
|
+
}, this.render = function(m, p) {
|
|
1118
|
+
m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), pn.copy(p.matrixWorldInverse), mn.multiplyMatrices(p.projectionMatrix, pn), A(m, m, p), this.sortObjects && d(m);
|
|
1119
|
+
}, this.setSize = function(m, p) {
|
|
1120
|
+
s = m, n = p, i = s / 2, o = n / 2, l.style.width = m + "px", l.style.height = p + "px";
|
|
1121
1121
|
};
|
|
1122
|
-
function c(
|
|
1123
|
-
|
|
1124
|
-
for (let
|
|
1125
|
-
c(
|
|
1122
|
+
function c(m) {
|
|
1123
|
+
m.isCSS2DObject && (m.element.style.display = "none");
|
|
1124
|
+
for (let p = 0, f = m.children.length; p < f; p++)
|
|
1125
|
+
c(m.children[p]);
|
|
1126
1126
|
}
|
|
1127
|
-
function A(
|
|
1128
|
-
if (
|
|
1129
|
-
c(
|
|
1127
|
+
function A(m, p, f) {
|
|
1128
|
+
if (m.visible === !1) {
|
|
1129
|
+
c(m);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
|
-
if (
|
|
1133
|
-
Se.setFromMatrixPosition(
|
|
1134
|
-
const g = Se.z >= -1 && Se.z <= 1 &&
|
|
1135
|
-
x.style.display = g === !0 ? "" : "none", g === !0 && (
|
|
1132
|
+
if (m.isCSS2DObject) {
|
|
1133
|
+
Se.setFromMatrixPosition(m.matrixWorld), Se.applyMatrix4(mn);
|
|
1134
|
+
const g = Se.z >= -1 && Se.z <= 1 && m.layers.test(f.layers) === !0, x = m.element;
|
|
1135
|
+
x.style.display = g === !0 ? "" : "none", g === !0 && (m.onBeforeRender(t, p, f), x.style.transform = "translate(" + -100 * m.center.x + "%," + -100 * m.center.y + "%)translate(" + (Se.x * i + i) + "px," + (-Se.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), m.onAfterRender(t, p, f));
|
|
1136
1136
|
const C = {
|
|
1137
|
-
distanceToCameraSquared: u(f,
|
|
1137
|
+
distanceToCameraSquared: u(f, m)
|
|
1138
1138
|
};
|
|
1139
|
-
a.objects.set(
|
|
1139
|
+
a.objects.set(m, C);
|
|
1140
1140
|
}
|
|
1141
|
-
for (let g = 0, x =
|
|
1142
|
-
A(
|
|
1141
|
+
for (let g = 0, x = m.children.length; g < x; g++)
|
|
1142
|
+
A(m.children[g], p, f);
|
|
1143
1143
|
}
|
|
1144
|
-
function u(
|
|
1145
|
-
return gn.setFromMatrixPosition(
|
|
1144
|
+
function u(m, p) {
|
|
1145
|
+
return gn.setFromMatrixPosition(m.matrixWorld), bn.setFromMatrixPosition(p.matrixWorld), gn.distanceToSquared(bn);
|
|
1146
1146
|
}
|
|
1147
|
-
function h(
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1150
|
-
f.isCSS2DObject &&
|
|
1151
|
-
}),
|
|
1147
|
+
function h(m) {
|
|
1148
|
+
const p = [];
|
|
1149
|
+
return m.traverseVisible(function(f) {
|
|
1150
|
+
f.isCSS2DObject && p.push(f);
|
|
1151
|
+
}), p;
|
|
1152
1152
|
}
|
|
1153
|
-
function d(
|
|
1154
|
-
const
|
|
1153
|
+
function d(m) {
|
|
1154
|
+
const p = h(m).sort(function(g, x) {
|
|
1155
1155
|
if (g.renderOrder !== x.renderOrder)
|
|
1156
1156
|
return x.renderOrder - g.renderOrder;
|
|
1157
1157
|
const C = a.objects.get(g).distanceToCameraSquared, y = a.objects.get(x).distanceToCameraSquared;
|
|
1158
1158
|
return C - y;
|
|
1159
|
-
}), f =
|
|
1160
|
-
for (let g = 0, x =
|
|
1161
|
-
|
|
1159
|
+
}), f = p.length;
|
|
1160
|
+
for (let g = 0, x = p.length; g < x; g++)
|
|
1161
|
+
p[g].element.style.zIndex = f - g;
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
@@ -1639,8 +1639,8 @@ function Hi(r, e = 500) {
|
|
|
1639
1639
|
return;
|
|
1640
1640
|
}
|
|
1641
1641
|
let t = null;
|
|
1642
|
-
if ((d = I.scene) == null || d.traverse((
|
|
1643
|
-
|
|
1642
|
+
if ((d = I.scene) == null || d.traverse((m) => {
|
|
1643
|
+
m.userData.id == r && (t = m);
|
|
1644
1644
|
}), !t) {
|
|
1645
1645
|
console.warn(
|
|
1646
1646
|
`[focusOnObject] 在场景中未找到 userData.id 为 "${r}" 的物体。请确认:1) 物体已被正确添加到场景(addModel);2) 物体的 userData.id 与传入的 objectId 一致;3) 传入的 objectId 不为空`
|
|
@@ -1672,13 +1672,13 @@ function Hi(r, e = 500) {
|
|
|
1672
1672
|
tz: n.z
|
|
1673
1673
|
},
|
|
1674
1674
|
e
|
|
1675
|
-
).easing(nt.Easing.Quadratic.InOut).onUpdate((
|
|
1676
|
-
I.camera.position.set(
|
|
1675
|
+
).easing(nt.Easing.Quadratic.InOut).onUpdate((m) => {
|
|
1676
|
+
I.camera.position.set(m.x, m.y, m.z), I.orbitControls.target.set(m.tx, m.ty, m.tz), I.orbitControls.update();
|
|
1677
1677
|
}).start();
|
|
1678
|
-
} catch (
|
|
1678
|
+
} catch (m) {
|
|
1679
1679
|
console.error(
|
|
1680
1680
|
"[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
|
|
1681
|
-
|
|
1681
|
+
m
|
|
1682
1682
|
);
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
@@ -1764,12 +1764,12 @@ async function Ki() {
|
|
|
1764
1764
|
r.traverse((h) => {
|
|
1765
1765
|
var d;
|
|
1766
1766
|
if (h.userData.type === "lightHelper" && e.push(h), h.type === "DirectionalLight" && h.userData.helper && (t.set(h, h.userData.helper), h.userData.helper = void 0), h.name && h.name.startsWith("DataPanel_")) {
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1769
|
-
const
|
|
1767
|
+
const m = h;
|
|
1768
|
+
if (m.element) {
|
|
1769
|
+
const p = m.element.querySelector(
|
|
1770
1770
|
"[data-panel-title]"
|
|
1771
1771
|
), f = [];
|
|
1772
|
-
|
|
1772
|
+
m.element.querySelectorAll(
|
|
1773
1773
|
".css2d-data-panel-item"
|
|
1774
1774
|
).forEach((x) => {
|
|
1775
1775
|
var w, D, S;
|
|
@@ -1783,7 +1783,7 @@ async function Ki() {
|
|
|
1783
1783
|
}), h.parent && s.set(
|
|
1784
1784
|
h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
|
|
1785
1785
|
{
|
|
1786
|
-
title: ((d =
|
|
1786
|
+
title: ((d = p == null ? void 0 : p.textContent) == null ? void 0 : d.trim()) || "",
|
|
1787
1787
|
items: f
|
|
1788
1788
|
}
|
|
1789
1789
|
);
|
|
@@ -1819,17 +1819,32 @@ async function Ki() {
|
|
|
1819
1819
|
function Zi(r, e = "edit", t) {
|
|
1820
1820
|
var o, a, l;
|
|
1821
1821
|
const s = typeof r == "string" ? JSON.parse(r) : r, i = new P.ObjectLoader().parse(s);
|
|
1822
|
-
i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1822
|
+
if (i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t) {
|
|
1823
|
+
const c = Math.min(window.innerWidth, 7e3), A = 1920, u = 200, h = Math.max(
|
|
1824
|
+
150,
|
|
1825
|
+
Math.round(c / A * u)
|
|
1826
|
+
), m = Math.max(
|
|
1827
|
+
12,
|
|
1828
|
+
Math.min(
|
|
1829
|
+
20,
|
|
1830
|
+
Math.round(h / u * 13)
|
|
1831
|
+
)
|
|
1832
|
+
);
|
|
1833
|
+
(a = I.scene) == null || a.traverse((p) => {
|
|
1834
|
+
const f = p.userData.id || p.uuid, g = t[f];
|
|
1835
|
+
if (g && p.userData.isMovable) {
|
|
1836
|
+
Li(p);
|
|
1837
|
+
const x = new Gn({
|
|
1838
|
+
title: g.title,
|
|
1839
|
+
items: g.items,
|
|
1840
|
+
width: `${h}px`,
|
|
1841
|
+
fontSize: `${m}px`
|
|
1842
|
+
});
|
|
1843
|
+
x.attachTo(p), x.visible = !1, Fn(p, x);
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
|
|
1833
1848
|
var A;
|
|
1834
1849
|
if (c.type === "DirectionalLight") {
|
|
1835
1850
|
const u = c;
|
|
@@ -1987,13 +2002,13 @@ function to() {
|
|
|
1987
2002
|
const A = this.vertices.length;
|
|
1988
2003
|
let u = this.parseVertexIndex(e, A), h = this.parseVertexIndex(t, A), d = this.parseVertexIndex(s, A);
|
|
1989
2004
|
if (this.addVertex(u, h, d), this.addColor(u, h, d), a !== void 0 && a !== "") {
|
|
1990
|
-
const
|
|
1991
|
-
u = this.parseNormalIndex(a,
|
|
2005
|
+
const m = this.normals.length;
|
|
2006
|
+
u = this.parseNormalIndex(a, m), h = this.parseNormalIndex(l, m), d = this.parseNormalIndex(c, m), this.addNormal(u, h, d);
|
|
1992
2007
|
} else
|
|
1993
2008
|
this.addFaceNormal(u, h, d);
|
|
1994
2009
|
if (n !== void 0 && n !== "") {
|
|
1995
|
-
const
|
|
1996
|
-
u = this.parseUVIndex(n,
|
|
2010
|
+
const m = this.uvs.length;
|
|
2011
|
+
u = this.parseUVIndex(n, m), h = this.parseUVIndex(i, m), d = this.parseUVIndex(o, m), this.addUV(u, h, d), this.object.geometry.hasUVIndices = !0;
|
|
1997
2012
|
} else
|
|
1998
2013
|
this.addDefaultUV();
|
|
1999
2014
|
},
|
|
@@ -2104,24 +2119,24 @@ class no extends Yt {
|
|
|
2104
2119
|
}
|
|
2105
2120
|
} else if (A === "f") {
|
|
2106
2121
|
const h = c.slice(1).trim().split(In), d = [];
|
|
2107
|
-
for (let
|
|
2108
|
-
const g = h[
|
|
2122
|
+
for (let p = 0, f = h.length; p < f; p++) {
|
|
2123
|
+
const g = h[p];
|
|
2109
2124
|
if (g.length > 0) {
|
|
2110
2125
|
const x = g.split("/");
|
|
2111
2126
|
d.push(x);
|
|
2112
2127
|
}
|
|
2113
2128
|
}
|
|
2114
|
-
const
|
|
2115
|
-
for (let
|
|
2116
|
-
const g = d[
|
|
2129
|
+
const m = d[0];
|
|
2130
|
+
for (let p = 1, f = d.length - 1; p < f; p++) {
|
|
2131
|
+
const g = d[p], x = d[p + 1];
|
|
2117
2132
|
t.addFace(
|
|
2118
|
-
|
|
2133
|
+
m[0],
|
|
2119
2134
|
g[0],
|
|
2120
2135
|
x[0],
|
|
2121
|
-
|
|
2136
|
+
m[1],
|
|
2122
2137
|
g[1],
|
|
2123
2138
|
x[1],
|
|
2124
|
-
|
|
2139
|
+
m[2],
|
|
2125
2140
|
g[2],
|
|
2126
2141
|
x[2]
|
|
2127
2142
|
);
|
|
@@ -2133,8 +2148,8 @@ class no extends Yt {
|
|
|
2133
2148
|
if (c.indexOf("/") === -1)
|
|
2134
2149
|
h = u;
|
|
2135
2150
|
else
|
|
2136
|
-
for (let
|
|
2137
|
-
const f = u[
|
|
2151
|
+
for (let m = 0, p = u.length; m < p; m++) {
|
|
2152
|
+
const f = u[m].split("/");
|
|
2138
2153
|
f[0] !== "" && h.push(f[0]), f[1] !== "" && d.push(f[1]);
|
|
2139
2154
|
}
|
|
2140
2155
|
t.addLineGeometry(h, d);
|
|
@@ -2168,13 +2183,13 @@ class no extends Yt {
|
|
|
2168
2183
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
2169
2184
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
2170
2185
|
const c = t.objects[a], A = c.geometry, u = c.materials, h = A.type === "Line", d = A.type === "Points";
|
|
2171
|
-
let
|
|
2186
|
+
let m = !1;
|
|
2172
2187
|
if (A.vertices.length === 0) continue;
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2188
|
+
const p = new We();
|
|
2189
|
+
p.setAttribute("position", new pe(A.vertices, 3)), A.normals.length > 0 && p.setAttribute("normal", new pe(A.normals, 3)), A.colors.length > 0 && (m = !0, p.setAttribute("color", new pe(A.colors, 3))), A.hasUVIndices === !0 && p.setAttribute("uv", new pe(A.uvs, 2));
|
|
2175
2190
|
const f = [];
|
|
2176
2191
|
for (let x = 0, C = u.length; x < C; x++) {
|
|
2177
|
-
const y = u[x], w = y.name + "_" + y.smooth + "_" +
|
|
2192
|
+
const y = u[x], w = y.name + "_" + y.smooth + "_" + m;
|
|
2178
2193
|
let D = t.materials[w];
|
|
2179
2194
|
if (this.materials !== null) {
|
|
2180
2195
|
if (D = this.materials.create(y.name), h && D && !(D instanceof Ze)) {
|
|
@@ -2185,17 +2200,17 @@ class no extends Yt {
|
|
|
2185
2200
|
Qe.prototype.copy.call(S, D), S.color.copy(D.color), S.map = D.map, D = S;
|
|
2186
2201
|
}
|
|
2187
2202
|
}
|
|
2188
|
-
D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors =
|
|
2203
|
+
D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors = m, t.materials[w] = D), f.push(D);
|
|
2189
2204
|
}
|
|
2190
2205
|
let g;
|
|
2191
2206
|
if (f.length > 1) {
|
|
2192
2207
|
for (let x = 0, C = u.length; x < C; x++) {
|
|
2193
2208
|
const y = u[x];
|
|
2194
|
-
|
|
2209
|
+
p.addGroup(y.groupStart, y.groupCount, x);
|
|
2195
2210
|
}
|
|
2196
|
-
h ? g = new Wt(
|
|
2211
|
+
h ? g = new Wt(p, f) : d ? g = new pt(p, f) : g = new v(p, f);
|
|
2197
2212
|
} else
|
|
2198
|
-
h ? g = new Wt(
|
|
2213
|
+
h ? g = new Wt(p, f[0]) : d ? g = new pt(p, f[0]) : g = new v(p, f[0]);
|
|
2199
2214
|
g.name = c.name, i.add(g);
|
|
2200
2215
|
}
|
|
2201
2216
|
else if (t.vertices.length > 0) {
|
|
@@ -2823,16 +2838,16 @@ class wo {
|
|
|
2823
2838
|
a.push(this.parser.getDependency("accessor", o[c]).then((A) => (l[c] = A, l[c])));
|
|
2824
2839
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
2825
2840
|
const A = c.pop(), u = A.isGroup ? A.children : [A], h = c[0].count, d = [];
|
|
2826
|
-
for (const
|
|
2827
|
-
const
|
|
2841
|
+
for (const m of u) {
|
|
2842
|
+
const p = new me(), f = new M(), g = new K(), x = new M(1, 1, 1), C = new ys(m.geometry, m.material, h);
|
|
2828
2843
|
for (let y = 0; y < h; y++)
|
|
2829
|
-
l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y,
|
|
2844
|
+
l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y, p.compose(f, g, x));
|
|
2830
2845
|
for (const y in l)
|
|
2831
2846
|
if (y === "_COLOR_0") {
|
|
2832
2847
|
const w = l[y];
|
|
2833
2848
|
C.instanceColor = new Cs(w.array, w.itemSize, w.normalized);
|
|
2834
|
-
} else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" &&
|
|
2835
|
-
ke.prototype.copy.call(C,
|
|
2849
|
+
} else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && m.geometry.setAttribute(y, l[y]);
|
|
2850
|
+
ke.prototype.copy.call(C, m), this.parser.assignFinalMaterial(C), d.push(C);
|
|
2836
2851
|
}
|
|
2837
2852
|
return A.isGroup ? (A.clear(), A.add(...d), A) : d[0];
|
|
2838
2853
|
}));
|
|
@@ -2892,9 +2907,9 @@ class Mo {
|
|
|
2892
2907
|
return t.getDependency("bufferView", i).then(function(A) {
|
|
2893
2908
|
return new Promise(function(u, h) {
|
|
2894
2909
|
n.decodeDracoFile(A, function(d) {
|
|
2895
|
-
for (const
|
|
2896
|
-
const
|
|
2897
|
-
f !== void 0 && (
|
|
2910
|
+
for (const m in d.attributes) {
|
|
2911
|
+
const p = d.attributes[m], f = l[m];
|
|
2912
|
+
f !== void 0 && (p.normalized = f);
|
|
2898
2913
|
}
|
|
2899
2914
|
u(d);
|
|
2900
2915
|
}, a, c, ae, h);
|
|
@@ -2926,9 +2941,9 @@ class Zn extends zs {
|
|
|
2926
2941
|
return t;
|
|
2927
2942
|
}
|
|
2928
2943
|
interpolate_(e, t, s, n) {
|
|
2929
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u,
|
|
2944
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u, m = e * c, p = m - c, f = -2 * d + 3 * h, g = d - h, x = 1 - f, C = g - h + u;
|
|
2930
2945
|
for (let y = 0; y !== a; y++) {
|
|
2931
|
-
const w = o[
|
|
2946
|
+
const w = o[p + y + a], D = o[p + y + l] * A, S = o[m + y + a], Z = o[m + y] * A;
|
|
2932
2947
|
i[y] = x * w + C * D + f * S + g * Z;
|
|
2933
2948
|
}
|
|
2934
2949
|
return i;
|
|
@@ -3354,14 +3369,14 @@ class ko {
|
|
|
3354
3369
|
}
|
|
3355
3370
|
const i = [];
|
|
3356
3371
|
return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
3357
|
-
const a = o[0], l = St[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0,
|
|
3358
|
-
let
|
|
3372
|
+
const a = o[0], l = St[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, m = n.normalized === !0;
|
|
3373
|
+
let p, f;
|
|
3359
3374
|
if (d && d !== u) {
|
|
3360
3375
|
const g = Math.floor(h / d), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
|
|
3361
3376
|
let C = t.cache.get(x);
|
|
3362
|
-
C || (
|
|
3377
|
+
C || (p = new c(a, g * d, n.count * d / A), C = new Hn(p, d / A), t.cache.add(x, C)), f = new Ln(C, l, h % d / A, m);
|
|
3363
3378
|
} else
|
|
3364
|
-
a === null ?
|
|
3379
|
+
a === null ? p = new c(n.count * l) : p = new c(a, h, n.count * l), f = new _e(p, l, m);
|
|
3365
3380
|
if (n.sparse !== void 0) {
|
|
3366
3381
|
const g = St.SCALAR, x = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, y = n.sparse.values.byteOffset || 0, w = new x(o[1], C, n.sparse.count * g), D = new c(o[2], y, n.sparse.count * l);
|
|
3367
3382
|
a !== null && (f = new _e(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
|
|
@@ -3369,7 +3384,7 @@ class ko {
|
|
|
3369
3384
|
const _ = w[S];
|
|
3370
3385
|
if (f.setX(_, D[S * l]), l >= 2 && f.setY(_, D[S * l + 1]), l >= 3 && f.setZ(_, D[S * l + 2]), l >= 4 && f.setW(_, D[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
3371
3386
|
}
|
|
3372
|
-
f.normalized =
|
|
3387
|
+
f.normalized = m;
|
|
3373
3388
|
}
|
|
3374
3389
|
return f;
|
|
3375
3390
|
});
|
|
@@ -3419,11 +3434,11 @@ class ko {
|
|
|
3419
3434
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
3420
3435
|
const A = Promise.resolve(l).then(function(u) {
|
|
3421
3436
|
return new Promise(function(h, d) {
|
|
3422
|
-
let
|
|
3423
|
-
t.isImageBitmapLoader === !0 && (
|
|
3424
|
-
const f = new tn(
|
|
3437
|
+
let m = h;
|
|
3438
|
+
t.isImageBitmapLoader === !0 && (m = function(p) {
|
|
3439
|
+
const f = new tn(p);
|
|
3425
3440
|
f.needsUpdate = !0, h(f);
|
|
3426
|
-
}), t.load(Je.resolveURL(u, i.path),
|
|
3441
|
+
}), t.load(Je.resolveURL(u, i.path), m, void 0, d);
|
|
3427
3442
|
});
|
|
3428
3443
|
}).then(function(u) {
|
|
3429
3444
|
return c === !0 && a.revokeObjectURL(l), re(u, o), u.userData.mimeType = o.mimeType || No(o.uri), u;
|
|
@@ -3585,25 +3600,25 @@ class ko {
|
|
|
3585
3600
|
}
|
|
3586
3601
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
3587
3602
|
const c = l.slice(0, l.length - 1), A = l[l.length - 1], u = [];
|
|
3588
|
-
for (let d = 0,
|
|
3589
|
-
const
|
|
3603
|
+
for (let d = 0, m = A.length; d < m; d++) {
|
|
3604
|
+
const p = A[d], f = o[d];
|
|
3590
3605
|
let g;
|
|
3591
3606
|
const x = c[d];
|
|
3592
3607
|
if (f.mode === te.TRIANGLES || f.mode === te.TRIANGLE_STRIP || f.mode === te.TRIANGLE_FAN || f.mode === void 0)
|
|
3593
|
-
g = i.isSkinnedMesh === !0 ? new Es(
|
|
3608
|
+
g = i.isSkinnedMesh === !0 ? new Es(p, x) : new v(p, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), f.mode === te.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Sn) : f.mode === te.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
|
|
3594
3609
|
else if (f.mode === te.LINES)
|
|
3595
|
-
g = new Wt(
|
|
3610
|
+
g = new Wt(p, x);
|
|
3596
3611
|
else if (f.mode === te.LINE_STRIP)
|
|
3597
|
-
g = new ue(
|
|
3612
|
+
g = new ue(p, x);
|
|
3598
3613
|
else if (f.mode === te.LINE_LOOP)
|
|
3599
|
-
g = new Rs(
|
|
3614
|
+
g = new Rs(p, x);
|
|
3600
3615
|
else if (f.mode === te.POINTS)
|
|
3601
|
-
g = new pt(
|
|
3616
|
+
g = new pt(p, x);
|
|
3602
3617
|
else
|
|
3603
3618
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + f.mode);
|
|
3604
3619
|
Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), f.extensions && xe(n, g, f), t.assignFinalMaterial(g), u.push(g);
|
|
3605
3620
|
}
|
|
3606
|
-
for (let d = 0,
|
|
3621
|
+
for (let d = 0, m = u.length; d < m; d++)
|
|
3607
3622
|
t.associations.set(u[d], {
|
|
3608
3623
|
meshes: e,
|
|
3609
3624
|
primitives: d
|
|
@@ -3612,7 +3627,7 @@ class ko {
|
|
|
3612
3627
|
return i.extensions && xe(n, u[0], i), u[0];
|
|
3613
3628
|
const h = new ft();
|
|
3614
3629
|
i.extensions && xe(n, h, i), t.associations.set(h, { meshes: e });
|
|
3615
|
-
for (let d = 0,
|
|
3630
|
+
for (let d = 0, m = u.length; d < m; d++)
|
|
3616
3631
|
h.add(u[d]);
|
|
3617
3632
|
return h;
|
|
3618
3633
|
});
|
|
@@ -3668,8 +3683,8 @@ class ko {
|
|
|
3668
3683
|
loadAnimation(e) {
|
|
3669
3684
|
const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], A = [];
|
|
3670
3685
|
for (let u = 0, h = n.channels.length; u < h; u++) {
|
|
3671
|
-
const d = n.channels[u],
|
|
3672
|
-
|
|
3686
|
+
const d = n.channels[u], m = n.samplers[d.sampler], p = d.target, f = p.node, g = n.parameters !== void 0 ? n.parameters[m.input] : m.input, x = n.parameters !== void 0 ? n.parameters[m.output] : m.output;
|
|
3687
|
+
p.node !== void 0 && (o.push(this.getDependency("node", f)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), c.push(m), A.push(p));
|
|
3673
3688
|
}
|
|
3674
3689
|
return Promise.all([
|
|
3675
3690
|
Promise.all(o),
|
|
@@ -3678,9 +3693,9 @@ class ko {
|
|
|
3678
3693
|
Promise.all(c),
|
|
3679
3694
|
Promise.all(A)
|
|
3680
3695
|
]).then(function(u) {
|
|
3681
|
-
const h = u[0], d = u[1],
|
|
3696
|
+
const h = u[0], d = u[1], m = u[2], p = u[3], f = u[4], g = [];
|
|
3682
3697
|
for (let C = 0, y = h.length; C < y; C++) {
|
|
3683
|
-
const w = h[C], D = d[C], S =
|
|
3698
|
+
const w = h[C], D = d[C], S = m[C], Z = p[C], _ = f[C];
|
|
3684
3699
|
if (w === void 0) continue;
|
|
3685
3700
|
w.updateMatrix && w.updateMatrix();
|
|
3686
3701
|
const Q = s._createAnimationTracks(w, D, S, Z, _);
|
|
@@ -3724,11 +3739,11 @@ class ko {
|
|
|
3724
3739
|
h !== null && A.traverse(function(d) {
|
|
3725
3740
|
d.isSkinnedMesh && d.bind(h, jo);
|
|
3726
3741
|
});
|
|
3727
|
-
for (let d = 0,
|
|
3742
|
+
for (let d = 0, m = u.length; d < m; d++)
|
|
3728
3743
|
A.add(u[d]);
|
|
3729
3744
|
if (A.userData.pivot !== void 0 && u.length > 0) {
|
|
3730
|
-
const d = A.userData.pivot,
|
|
3731
|
-
A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2],
|
|
3745
|
+
const d = A.userData.pivot, m = u[0];
|
|
3746
|
+
A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2], m.position.set(0, 0, 0), delete A.userData.pivot;
|
|
3732
3747
|
}
|
|
3733
3748
|
return A;
|
|
3734
3749
|
});
|
|
@@ -3829,14 +3844,14 @@ class ko {
|
|
|
3829
3844
|
break;
|
|
3830
3845
|
}
|
|
3831
3846
|
const u = n.interpolation !== void 0 ? Eo[n.interpolation] : Wn, h = this._getArrayFromAccessor(s);
|
|
3832
|
-
for (let d = 0,
|
|
3833
|
-
const
|
|
3847
|
+
for (let d = 0, m = l.length; d < m; d++) {
|
|
3848
|
+
const p = new A(
|
|
3834
3849
|
l[d] + "." + fe[i.path],
|
|
3835
3850
|
t.array,
|
|
3836
3851
|
h,
|
|
3837
3852
|
u
|
|
3838
3853
|
);
|
|
3839
|
-
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
3854
|
+
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
|
|
3840
3855
|
}
|
|
3841
3856
|
return o;
|
|
3842
3857
|
}
|
|
@@ -3881,11 +3896,11 @@ function Wo(r, e, t) {
|
|
|
3881
3896
|
for (let c = 0, A = i.length; c < A; c++) {
|
|
3882
3897
|
const u = i[c];
|
|
3883
3898
|
if (u.POSITION !== void 0) {
|
|
3884
|
-
const h = t.json.accessors[u.POSITION], d = h.min,
|
|
3885
|
-
if (d !== void 0 &&
|
|
3886
|
-
if (l.setX(Math.max(Math.abs(d[0]), Math.abs(
|
|
3887
|
-
const
|
|
3888
|
-
l.multiplyScalar(
|
|
3899
|
+
const h = t.json.accessors[u.POSITION], d = h.min, m = h.max;
|
|
3900
|
+
if (d !== void 0 && m !== void 0) {
|
|
3901
|
+
if (l.setX(Math.max(Math.abs(d[0]), Math.abs(m[0]))), l.setY(Math.max(Math.abs(d[1]), Math.abs(m[1]))), l.setZ(Math.max(Math.abs(d[2]), Math.abs(m[2]))), h.normalized) {
|
|
3902
|
+
const p = Vt(je[h.componentType]);
|
|
3903
|
+
l.multiplyScalar(p);
|
|
3889
3904
|
}
|
|
3890
3905
|
a.max(l);
|
|
3891
3906
|
} else
|
|
@@ -4128,8 +4143,8 @@ function Go() {
|
|
|
4128
4143
|
e.then((A) => {
|
|
4129
4144
|
const u = A.draco, h = new u.Decoder();
|
|
4130
4145
|
try {
|
|
4131
|
-
const d = t(u, h, new Int8Array(l), c),
|
|
4132
|
-
d.index &&
|
|
4146
|
+
const d = t(u, h, new Int8Array(l), c), m = d.attributes.map((p) => p.array.buffer);
|
|
4147
|
+
d.index && m.push(d.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: d }, m);
|
|
4133
4148
|
} catch (d) {
|
|
4134
4149
|
console.error(d), self.postMessage({ type: "error", id: a.id, error: d.message });
|
|
4135
4150
|
} finally {
|
|
@@ -4142,16 +4157,16 @@ function Go() {
|
|
|
4142
4157
|
function t(o, a, l, c) {
|
|
4143
4158
|
const A = c.attributeIDs, u = c.attributeTypes;
|
|
4144
4159
|
let h, d;
|
|
4145
|
-
const
|
|
4146
|
-
if (
|
|
4160
|
+
const m = a.GetEncodedGeometryType(l);
|
|
4161
|
+
if (m === o.TRIANGULAR_MESH)
|
|
4147
4162
|
h = new o.Mesh(), d = a.DecodeArrayToMesh(l, l.byteLength, h);
|
|
4148
|
-
else if (
|
|
4163
|
+
else if (m === o.POINT_CLOUD)
|
|
4149
4164
|
h = new o.PointCloud(), d = a.DecodeArrayToPointCloud(l, l.byteLength, h);
|
|
4150
4165
|
else
|
|
4151
4166
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
4152
4167
|
if (!d.ok() || h.ptr === 0)
|
|
4153
4168
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + d.error_msg());
|
|
4154
|
-
const
|
|
4169
|
+
const p = { index: null, attributes: [] };
|
|
4155
4170
|
for (const f in A) {
|
|
4156
4171
|
const g = self[u[f]];
|
|
4157
4172
|
let x, C;
|
|
@@ -4162,9 +4177,9 @@ function Go() {
|
|
|
4162
4177
|
x = a.GetAttribute(h, C);
|
|
4163
4178
|
}
|
|
4164
4179
|
const y = n(o, a, h, f, g, x);
|
|
4165
|
-
f === "color" && (y.vertexColorSpace = c.vertexColorSpace),
|
|
4180
|
+
f === "color" && (y.vertexColorSpace = c.vertexColorSpace), p.attributes.push(y);
|
|
4166
4181
|
}
|
|
4167
|
-
return
|
|
4182
|
+
return m === o.TRIANGULAR_MESH && (p.index = s(o, a, h)), o.destroy(h), p;
|
|
4168
4183
|
}
|
|
4169
4184
|
function s(o, a, l) {
|
|
4170
4185
|
const A = l.num_faces() * 3, u = A * 4, h = o._malloc(u);
|
|
@@ -4173,11 +4188,11 @@ function Go() {
|
|
|
4173
4188
|
return o._free(h), { array: d, itemSize: 1 };
|
|
4174
4189
|
}
|
|
4175
4190
|
function n(o, a, l, c, A, u) {
|
|
4176
|
-
const h = l.num_points(), d = u.num_components(),
|
|
4177
|
-
a.GetAttributeDataArrayForAllPoints(l, u,
|
|
4191
|
+
const h = l.num_points(), d = u.num_components(), m = i(o, A), p = d * A.BYTES_PER_ELEMENT, f = Math.ceil(p / 4) * 4, g = f / A.BYTES_PER_ELEMENT, x = h * p, C = h * f, y = o._malloc(x);
|
|
4192
|
+
a.GetAttributeDataArrayForAllPoints(l, u, m, x, y);
|
|
4178
4193
|
const w = new A(o.HEAPF32.buffer, y, x / A.BYTES_PER_ELEMENT);
|
|
4179
4194
|
let D;
|
|
4180
|
-
if (
|
|
4195
|
+
if (p === f)
|
|
4181
4196
|
D = w.slice();
|
|
4182
4197
|
else {
|
|
4183
4198
|
D = new A(C / A.BYTES_PER_ELEMENT);
|
|
@@ -4246,7 +4261,7 @@ function Uo(r) {
|
|
|
4246
4261
|
speedY: A = 5e-4
|
|
4247
4262
|
} = r || {}, u = new P.PlaneGeometry(e, t), d = new P.TextureLoader().load(Fo, (f) => {
|
|
4248
4263
|
f.wrapS = f.wrapT = P.RepeatWrapping, f.repeat.set(a, l), f.generateMipmaps = !1, f.minFilter = P.LinearFilter, f.magFilter = P.LinearFilter;
|
|
4249
|
-
}),
|
|
4264
|
+
}), m = new P.MeshStandardMaterial({
|
|
4250
4265
|
color: s,
|
|
4251
4266
|
roughness: n,
|
|
4252
4267
|
metalness: i,
|
|
@@ -4256,8 +4271,8 @@ function Uo(r) {
|
|
|
4256
4271
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
4257
4272
|
transparent: !0,
|
|
4258
4273
|
opacity: 0.6
|
|
4259
|
-
}),
|
|
4260
|
-
|
|
4274
|
+
}), p = new P.Mesh(u, m);
|
|
4275
|
+
p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: c, y: A }, ze(p);
|
|
4261
4276
|
}
|
|
4262
4277
|
function Vo(r) {
|
|
4263
4278
|
return Et(!0), new Promise((e, t) => {
|
|
@@ -4358,12 +4373,12 @@ const Zo = {
|
|
|
4358
4373
|
},
|
|
4359
4374
|
emits: ["select", "delete"],
|
|
4360
4375
|
setup(r, { emit: e }) {
|
|
4361
|
-
const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((
|
|
4362
|
-
(
|
|
4376
|
+
const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
|
|
4377
|
+
(p) => p.userData.isMovable === !0
|
|
4363
4378
|
))), A = Be(
|
|
4364
4379
|
() => {
|
|
4365
|
-
var
|
|
4366
|
-
return ((
|
|
4380
|
+
var p;
|
|
4381
|
+
return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
|
|
4367
4382
|
}
|
|
4368
4383
|
);
|
|
4369
4384
|
ts(
|
|
@@ -4377,12 +4392,12 @@ const Zo = {
|
|
|
4377
4392
|
},
|
|
4378
4393
|
{ flush: "post" }
|
|
4379
4394
|
);
|
|
4380
|
-
const u = (
|
|
4381
|
-
|
|
4382
|
-
}, h = (
|
|
4383
|
-
|
|
4384
|
-
}, d = (
|
|
4385
|
-
return (
|
|
4395
|
+
const u = (p) => {
|
|
4396
|
+
p.stopPropagation(), s("select", t.node);
|
|
4397
|
+
}, h = (p) => {
|
|
4398
|
+
p.stopPropagation(), s("delete", t.node);
|
|
4399
|
+
}, d = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", m = (p) => p.name || `${p.type} (${p.id})`;
|
|
4400
|
+
return (p, f) => {
|
|
4386
4401
|
const g = ns("TreeItem", !0);
|
|
4387
4402
|
return T(), R("div", {
|
|
4388
4403
|
class: "tree-node",
|
|
@@ -4399,7 +4414,7 @@ const Zo = {
|
|
|
4399
4414
|
onClick: f[0] || (f[0] = jt((x) => ss(o)(r.node.uuid), ["stop"]))
|
|
4400
4415
|
}, ie(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
|
|
4401
4416
|
b("span", Qo, ie(d(r.node)), 1),
|
|
4402
|
-
b("span", Jo, ie(
|
|
4417
|
+
b("span", Jo, ie(m(r.node)), 1),
|
|
4403
4418
|
b("button", {
|
|
4404
4419
|
class: "tree-delete",
|
|
4405
4420
|
onClick: jt(h, ["stop"])
|
|
@@ -4452,9 +4467,9 @@ const Zo = {
|
|
|
4452
4467
|
}
|
|
4453
4468
|
function c(h) {
|
|
4454
4469
|
let d = null;
|
|
4455
|
-
return h.traverse((
|
|
4456
|
-
if (
|
|
4457
|
-
const
|
|
4470
|
+
return h.traverse((m) => {
|
|
4471
|
+
if (m.type === "Mesh" && !d) {
|
|
4472
|
+
const p = m, f = Array.isArray(p.material) ? p.material : [p.material];
|
|
4458
4473
|
for (const g of f)
|
|
4459
4474
|
if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
|
|
4460
4475
|
const x = g;
|
|
@@ -4469,14 +4484,14 @@ const Zo = {
|
|
|
4469
4484
|
}), d;
|
|
4470
4485
|
}
|
|
4471
4486
|
function A(h, d) {
|
|
4472
|
-
let
|
|
4473
|
-
return h.traverse((
|
|
4474
|
-
if (
|
|
4475
|
-
const f =
|
|
4487
|
+
let m = !1;
|
|
4488
|
+
return h.traverse((p) => {
|
|
4489
|
+
if (p.type === "Mesh") {
|
|
4490
|
+
const f = p, g = Array.isArray(f.material) ? f.material : [f.material];
|
|
4476
4491
|
for (const x of g)
|
|
4477
|
-
x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0,
|
|
4492
|
+
x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0, m = !0);
|
|
4478
4493
|
}
|
|
4479
|
-
}),
|
|
4494
|
+
}), m;
|
|
4480
4495
|
}
|
|
4481
4496
|
function u() {
|
|
4482
4497
|
if (t.selectedObject) {
|
|
@@ -4505,7 +4520,7 @@ const Zo = {
|
|
|
4505
4520
|
d[14] || (d[14] = b("span", null, "X:", -1)),
|
|
4506
4521
|
E(b("input", {
|
|
4507
4522
|
type: "number",
|
|
4508
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
4523
|
+
"onUpdate:modelValue": d[0] || (d[0] = (m) => r.transform.position.x = m),
|
|
4509
4524
|
step: "0.01",
|
|
4510
4525
|
onInput: n
|
|
4511
4526
|
}, null, 544), [
|
|
@@ -4519,7 +4534,7 @@ const Zo = {
|
|
|
4519
4534
|
d[15] || (d[15] = b("span", null, "Y:", -1)),
|
|
4520
4535
|
E(b("input", {
|
|
4521
4536
|
type: "number",
|
|
4522
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
4537
|
+
"onUpdate:modelValue": d[1] || (d[1] = (m) => r.transform.position.y = m),
|
|
4523
4538
|
step: "0.01",
|
|
4524
4539
|
onInput: n
|
|
4525
4540
|
}, null, 544), [
|
|
@@ -4533,7 +4548,7 @@ const Zo = {
|
|
|
4533
4548
|
d[16] || (d[16] = b("span", null, "Z:", -1)),
|
|
4534
4549
|
E(b("input", {
|
|
4535
4550
|
type: "number",
|
|
4536
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
4551
|
+
"onUpdate:modelValue": d[2] || (d[2] = (m) => r.transform.position.z = m),
|
|
4537
4552
|
step: "0.01",
|
|
4538
4553
|
onInput: n
|
|
4539
4554
|
}, null, 544), [
|
|
@@ -4552,7 +4567,7 @@ const Zo = {
|
|
|
4552
4567
|
d[18] || (d[18] = b("span", null, "X:", -1)),
|
|
4553
4568
|
E(b("input", {
|
|
4554
4569
|
type: "number",
|
|
4555
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
4570
|
+
"onUpdate:modelValue": d[3] || (d[3] = (m) => r.transform.rotation.x = m),
|
|
4556
4571
|
step: "0.01",
|
|
4557
4572
|
onInput: n
|
|
4558
4573
|
}, null, 544), [
|
|
@@ -4566,7 +4581,7 @@ const Zo = {
|
|
|
4566
4581
|
d[19] || (d[19] = b("span", null, "Y:", -1)),
|
|
4567
4582
|
E(b("input", {
|
|
4568
4583
|
type: "number",
|
|
4569
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
4584
|
+
"onUpdate:modelValue": d[4] || (d[4] = (m) => r.transform.rotation.y = m),
|
|
4570
4585
|
step: "0.01",
|
|
4571
4586
|
onInput: n
|
|
4572
4587
|
}, null, 544), [
|
|
@@ -4580,7 +4595,7 @@ const Zo = {
|
|
|
4580
4595
|
d[20] || (d[20] = b("span", null, "Z:", -1)),
|
|
4581
4596
|
E(b("input", {
|
|
4582
4597
|
type: "number",
|
|
4583
|
-
"onUpdate:modelValue": d[5] || (d[5] = (
|
|
4598
|
+
"onUpdate:modelValue": d[5] || (d[5] = (m) => r.transform.rotation.z = m),
|
|
4584
4599
|
step: "0.01",
|
|
4585
4600
|
onInput: n
|
|
4586
4601
|
}, null, 544), [
|
|
@@ -4599,7 +4614,7 @@ const Zo = {
|
|
|
4599
4614
|
d[22] || (d[22] = b("span", null, "X:", -1)),
|
|
4600
4615
|
E(b("input", {
|
|
4601
4616
|
type: "number",
|
|
4602
|
-
"onUpdate:modelValue": d[6] || (d[6] = (
|
|
4617
|
+
"onUpdate:modelValue": d[6] || (d[6] = (m) => r.transform.scale.x = m),
|
|
4603
4618
|
step: "0.01",
|
|
4604
4619
|
onInput: n
|
|
4605
4620
|
}, null, 544), [
|
|
@@ -4613,7 +4628,7 @@ const Zo = {
|
|
|
4613
4628
|
d[23] || (d[23] = b("span", null, "Y:", -1)),
|
|
4614
4629
|
E(b("input", {
|
|
4615
4630
|
type: "number",
|
|
4616
|
-
"onUpdate:modelValue": d[7] || (d[7] = (
|
|
4631
|
+
"onUpdate:modelValue": d[7] || (d[7] = (m) => r.transform.scale.y = m),
|
|
4617
4632
|
step: "0.01",
|
|
4618
4633
|
onInput: n
|
|
4619
4634
|
}, null, 544), [
|
|
@@ -4627,7 +4642,7 @@ const Zo = {
|
|
|
4627
4642
|
d[24] || (d[24] = b("span", null, "Z:", -1)),
|
|
4628
4643
|
E(b("input", {
|
|
4629
4644
|
type: "number",
|
|
4630
|
-
"onUpdate:modelValue": d[8] || (d[8] = (
|
|
4645
|
+
"onUpdate:modelValue": d[8] || (d[8] = (m) => r.transform.scale.z = m),
|
|
4631
4646
|
step: "0.01",
|
|
4632
4647
|
onInput: n
|
|
4633
4648
|
}, null, 544), [
|
|
@@ -4649,7 +4664,7 @@ const Zo = {
|
|
|
4649
4664
|
min: "0",
|
|
4650
4665
|
max: "10",
|
|
4651
4666
|
step: "0.1",
|
|
4652
|
-
"onUpdate:modelValue": d[9] || (d[9] = (
|
|
4667
|
+
"onUpdate:modelValue": d[9] || (d[9] = (m) => a.intensity = m),
|
|
4653
4668
|
onInput: l
|
|
4654
4669
|
}, null, 544), [
|
|
4655
4670
|
[
|
|
@@ -4664,7 +4679,7 @@ const Zo = {
|
|
|
4664
4679
|
min: "0",
|
|
4665
4680
|
max: "100",
|
|
4666
4681
|
step: "0.1",
|
|
4667
|
-
"onUpdate:modelValue": d[10] || (d[10] = (
|
|
4682
|
+
"onUpdate:modelValue": d[10] || (d[10] = (m) => a.intensity = m),
|
|
4668
4683
|
class: "intensity-input",
|
|
4669
4684
|
onInput: l
|
|
4670
4685
|
}, null, 544), [
|
|
@@ -4686,7 +4701,7 @@ const Zo = {
|
|
|
4686
4701
|
min: "0",
|
|
4687
4702
|
max: "1",
|
|
4688
4703
|
step: "0.01",
|
|
4689
|
-
"onUpdate:modelValue": d[11] || (d[11] = (
|
|
4704
|
+
"onUpdate:modelValue": d[11] || (d[11] = (m) => i.metalness = m),
|
|
4690
4705
|
onInput: u
|
|
4691
4706
|
}, null, 544), [
|
|
4692
4707
|
[
|
|
@@ -4705,7 +4720,7 @@ const Zo = {
|
|
|
4705
4720
|
min: "0",
|
|
4706
4721
|
max: "1",
|
|
4707
4722
|
step: "0.01",
|
|
4708
|
-
"onUpdate:modelValue": d[12] || (d[12] = (
|
|
4723
|
+
"onUpdate:modelValue": d[12] || (d[12] = (m) => i.roughness = m),
|
|
4709
4724
|
onInput: u
|
|
4710
4725
|
}, null, 544), [
|
|
4711
4726
|
[
|
|
@@ -4724,7 +4739,7 @@ const Zo = {
|
|
|
4724
4739
|
min: "0",
|
|
4725
4740
|
max: "1",
|
|
4726
4741
|
step: "0.01",
|
|
4727
|
-
"onUpdate:modelValue": d[13] || (d[13] = (
|
|
4742
|
+
"onUpdate:modelValue": d[13] || (d[13] = (m) => i.opacity = m),
|
|
4728
4743
|
onInput: u
|
|
4729
4744
|
}, null, 544), [
|
|
4730
4745
|
[
|
|
@@ -4810,7 +4825,7 @@ const Zo = {
|
|
|
4810
4825
|
function d(C) {
|
|
4811
4826
|
return C.length <= 28 ? C : C.substring(0, 28) + "…";
|
|
4812
4827
|
}
|
|
4813
|
-
function
|
|
4828
|
+
function m(C) {
|
|
4814
4829
|
n.value = C;
|
|
4815
4830
|
const y = e.selectedObject;
|
|
4816
4831
|
if (!y) return;
|
|
@@ -4820,9 +4835,9 @@ const Zo = {
|
|
|
4820
4835
|
} catch {
|
|
4821
4836
|
i.value = String(w);
|
|
4822
4837
|
}
|
|
4823
|
-
|
|
4838
|
+
p();
|
|
4824
4839
|
}
|
|
4825
|
-
function
|
|
4840
|
+
function p() {
|
|
4826
4841
|
const C = i.value.trim();
|
|
4827
4842
|
if (!C) {
|
|
4828
4843
|
o.value = null;
|
|
@@ -4910,7 +4925,7 @@ const Zo = {
|
|
|
4910
4925
|
b("button", {
|
|
4911
4926
|
class: "ud-btn edit-json-btn",
|
|
4912
4927
|
title: "编辑对象",
|
|
4913
|
-
onClick: (S) =>
|
|
4928
|
+
onClick: (S) => m(w.key)
|
|
4914
4929
|
}, " ✎ ", 8, Pr)
|
|
4915
4930
|
], 64)) : (T(), R(ve, { key: 1 }, [
|
|
4916
4931
|
o.value ? (T(), R("div", Tr, " ⚠ " + ie(o.value), 1)) : X("", !0),
|
|
@@ -4918,7 +4933,7 @@ const Zo = {
|
|
|
4918
4933
|
"onUpdate:modelValue": y[2] || (y[2] = (S) => i.value = S),
|
|
4919
4934
|
class: se(["ud-json-textarea", { "has-error": o.value }]),
|
|
4920
4935
|
rows: "3",
|
|
4921
|
-
onInput:
|
|
4936
|
+
onInput: p
|
|
4922
4937
|
}, null, 34), [
|
|
4923
4938
|
[N, i.value]
|
|
4924
4939
|
]),
|
|
@@ -4960,20 +4975,20 @@ const Zo = {
|
|
|
4960
4975
|
const e = r, t = j(""), s = j([]), n = j(!0), i = j(""), o = j(""), a = j(""), l = j("");
|
|
4961
4976
|
let c = u(), A = !1;
|
|
4962
4977
|
function u() {
|
|
4963
|
-
const
|
|
4964
|
-
return
|
|
4978
|
+
const p = e.selectedObject;
|
|
4979
|
+
return p ? Zt(xt(p)) : null;
|
|
4965
4980
|
}
|
|
4966
|
-
Me(n, (
|
|
4967
|
-
A || !c || (c.visible =
|
|
4981
|
+
Me(n, (p) => {
|
|
4982
|
+
A || !c || (c.visible = p);
|
|
4968
4983
|
});
|
|
4969
4984
|
function h() {
|
|
4970
4985
|
A || !c || (c.setTitle(t.value), c.setItems([...s.value]));
|
|
4971
4986
|
}
|
|
4972
4987
|
Me(t, () => h()), Me(s, () => h(), { deep: !0 });
|
|
4973
|
-
function d(
|
|
4974
|
-
s.value = s.value.filter((f, g) => g !==
|
|
4988
|
+
function d(p) {
|
|
4989
|
+
s.value = s.value.filter((f, g) => g !== p), h();
|
|
4975
4990
|
}
|
|
4976
|
-
function
|
|
4991
|
+
function m() {
|
|
4977
4992
|
!i.value.trim() || !o.value.trim() || (s.value = [
|
|
4978
4993
|
...s.value,
|
|
4979
4994
|
{
|
|
@@ -4992,7 +5007,7 @@ const Zo = {
|
|
|
4992
5007
|
}, 0);
|
|
4993
5008
|
},
|
|
4994
5009
|
{ immediate: !0 }
|
|
4995
|
-
), (
|
|
5010
|
+
), (p, f) => (T(), R("div", Nr, [
|
|
4996
5011
|
b("div", jr, [
|
|
4997
5012
|
f[10] || (f[10] = b("label", null, "📊 数据面板", -1)),
|
|
4998
5013
|
b("div", kr, [
|
|
@@ -5073,7 +5088,7 @@ const Zo = {
|
|
|
5073
5088
|
class: "dp-input dp-input-sm",
|
|
5074
5089
|
"onUpdate:modelValue": f[2] || (f[2] = (g) => i.value = g),
|
|
5075
5090
|
placeholder: "标签",
|
|
5076
|
-
onKeyup: He(
|
|
5091
|
+
onKeyup: He(m, ["enter"])
|
|
5077
5092
|
}, null, 544), [
|
|
5078
5093
|
[N, i.value]
|
|
5079
5094
|
]),
|
|
@@ -5082,7 +5097,7 @@ const Zo = {
|
|
|
5082
5097
|
class: "dp-input dp-input-sm",
|
|
5083
5098
|
"onUpdate:modelValue": f[3] || (f[3] = (g) => o.value = g),
|
|
5084
5099
|
placeholder: "值",
|
|
5085
|
-
onKeyup: He(
|
|
5100
|
+
onKeyup: He(m, ["enter"])
|
|
5086
5101
|
}, null, 544), [
|
|
5087
5102
|
[N, o.value]
|
|
5088
5103
|
]),
|
|
@@ -5091,7 +5106,7 @@ const Zo = {
|
|
|
5091
5106
|
class: "dp-input dp-input-xs",
|
|
5092
5107
|
"onUpdate:modelValue": f[4] || (f[4] = (g) => a.value = g),
|
|
5093
5108
|
placeholder: "单位",
|
|
5094
|
-
onKeyup: He(
|
|
5109
|
+
onKeyup: He(m, ["enter"])
|
|
5095
5110
|
}, null, 544), [
|
|
5096
5111
|
[N, a.value]
|
|
5097
5112
|
]),
|
|
@@ -5100,13 +5115,13 @@ const Zo = {
|
|
|
5100
5115
|
class: "dp-input dp-input-xs",
|
|
5101
5116
|
"onUpdate:modelValue": f[5] || (f[5] = (g) => l.value = g),
|
|
5102
5117
|
placeholder: "编码",
|
|
5103
|
-
onKeyup: He(
|
|
5118
|
+
onKeyup: He(m, ["enter"])
|
|
5104
5119
|
}, null, 544), [
|
|
5105
5120
|
[N, l.value]
|
|
5106
5121
|
]),
|
|
5107
5122
|
b("button", {
|
|
5108
5123
|
class: "dp-btn dp-btn-add",
|
|
5109
|
-
onClick:
|
|
5124
|
+
onClick: m,
|
|
5110
5125
|
title: "添加"
|
|
5111
5126
|
}, "+")
|
|
5112
5127
|
])
|
|
@@ -5160,65 +5175,65 @@ const $r = {
|
|
|
5160
5175
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
5161
5176
|
setup(r, { emit: e }) {
|
|
5162
5177
|
const t = r, s = e, n = j("translate");
|
|
5163
|
-
function i(
|
|
5164
|
-
n.value =
|
|
5178
|
+
function i(m) {
|
|
5179
|
+
n.value = m, s("transformModeChange", m);
|
|
5165
5180
|
}
|
|
5166
5181
|
const o = () => s("propertyChange"), a = j("transform"), l = Be(() => {
|
|
5167
|
-
var
|
|
5168
|
-
return !!(t.selectedObject && ((
|
|
5182
|
+
var m;
|
|
5183
|
+
return !!(t.selectedObject && ((m = t.selectedObject.userData) != null && m._hasDataPanel));
|
|
5169
5184
|
}), c = j(0), A = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = _r(A);
|
|
5170
5185
|
rs("treeExpand", { expandedSet: u, toggleExpand: h });
|
|
5171
|
-
const d = (
|
|
5172
|
-
c.value++, s("treeDelete",
|
|
5186
|
+
const d = (m) => {
|
|
5187
|
+
c.value++, s("treeDelete", m);
|
|
5173
5188
|
};
|
|
5174
|
-
return (
|
|
5189
|
+
return (m, p) => r.transform ? (T(), R("div", $r, [
|
|
5175
5190
|
b("div", ea, [
|
|
5176
|
-
|
|
5191
|
+
p[7] || (p[7] = b("label", null, "场景物体", -1)),
|
|
5177
5192
|
b("div", ta, [
|
|
5178
5193
|
(T(!0), R(ve, null, wt(r.treeData, (f) => (T(), Ke(er, {
|
|
5179
5194
|
key: f.uuid,
|
|
5180
5195
|
node: f,
|
|
5181
5196
|
"selected-object": r.selectedObject,
|
|
5182
5197
|
version: c.value,
|
|
5183
|
-
onSelect:
|
|
5198
|
+
onSelect: p[0] || (p[0] = (g) => s("treeSelect", g)),
|
|
5184
5199
|
onDelete: d
|
|
5185
5200
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
5186
5201
|
r.treeData.length === 0 ? (T(), R("div", na, "暂无物体")) : X("", !0)
|
|
5187
5202
|
])
|
|
5188
5203
|
]),
|
|
5189
5204
|
b("div", sa, [
|
|
5190
|
-
|
|
5205
|
+
p[8] || (p[8] = b("label", null, "全局属性", -1)),
|
|
5191
5206
|
b("div", ia, [
|
|
5192
5207
|
b("button", {
|
|
5193
5208
|
class: se(["mode-btn", { active: n.value === "translate" }]),
|
|
5194
5209
|
title: "移动 (W)",
|
|
5195
|
-
onClick:
|
|
5210
|
+
onClick: p[1] || (p[1] = (f) => i("translate"))
|
|
5196
5211
|
}, " ↕ 移动 ", 2),
|
|
5197
5212
|
b("button", {
|
|
5198
5213
|
class: se(["mode-btn", { active: n.value === "rotate" }]),
|
|
5199
5214
|
title: "旋转 (E)",
|
|
5200
|
-
onClick:
|
|
5215
|
+
onClick: p[2] || (p[2] = (f) => i("rotate"))
|
|
5201
5216
|
}, " ↻ 旋转 ", 2),
|
|
5202
5217
|
b("button", {
|
|
5203
5218
|
class: se(["mode-btn", { active: n.value === "scale" }]),
|
|
5204
5219
|
title: "缩放 (R)",
|
|
5205
|
-
onClick:
|
|
5220
|
+
onClick: p[3] || (p[3] = (f) => i("scale"))
|
|
5206
5221
|
}, " ⤡ 缩放 ", 2)
|
|
5207
5222
|
])
|
|
5208
5223
|
]),
|
|
5209
5224
|
r.selectedObject ? (T(), R("div", oa, [
|
|
5210
5225
|
b("button", {
|
|
5211
5226
|
class: se(["tab-btn", { active: a.value === "transform" }]),
|
|
5212
|
-
onClick:
|
|
5227
|
+
onClick: p[4] || (p[4] = (f) => a.value = "transform")
|
|
5213
5228
|
}, " 🔄 变换 ", 2),
|
|
5214
5229
|
b("button", {
|
|
5215
5230
|
class: se(["tab-btn", { active: a.value === "userdata" }]),
|
|
5216
|
-
onClick:
|
|
5231
|
+
onClick: p[5] || (p[5] = (f) => a.value = "userdata")
|
|
5217
5232
|
}, " 📋 自定义数据 ", 2),
|
|
5218
5233
|
l.value ? (T(), R("button", {
|
|
5219
5234
|
key: 0,
|
|
5220
5235
|
class: se(["tab-btn", { active: a.value === "datapanel" }]),
|
|
5221
|
-
onClick:
|
|
5236
|
+
onClick: p[6] || (p[6] = (f) => a.value = "datapanel")
|
|
5222
5237
|
}, " 📊 数据面板 ", 2)) : X("", !0)
|
|
5223
5238
|
])) : X("", !0),
|
|
5224
5239
|
r.selectedObject ? (T(), R("div", ra, [
|
|
@@ -5236,7 +5251,7 @@ const $r = {
|
|
|
5236
5251
|
[De, a.value === "datapanel"]
|
|
5237
5252
|
])
|
|
5238
5253
|
])) : X("", !0)
|
|
5239
|
-
])) : (T(), R("div", aa, [...
|
|
5254
|
+
])) : (T(), R("div", aa, [...p[9] || (p[9] = [
|
|
5240
5255
|
b("p", null, "未选中任何模型", -1)
|
|
5241
5256
|
])]));
|
|
5242
5257
|
}
|
|
@@ -5245,19 +5260,19 @@ const $r = {
|
|
|
5245
5260
|
emits: ["addModel", "importModel"],
|
|
5246
5261
|
setup(r, { emit: e }) {
|
|
5247
5262
|
const t = j(!1), s = j(!1), n = j(!1), i = j(!1), o = e, a = j(null), l = () => {
|
|
5248
|
-
var
|
|
5249
|
-
return (
|
|
5250
|
-
}, c = (
|
|
5251
|
-
const f =
|
|
5263
|
+
var p;
|
|
5264
|
+
return (p = a.value) == null ? void 0 : p.click();
|
|
5265
|
+
}, c = (p) => {
|
|
5266
|
+
const f = p.target;
|
|
5252
5267
|
f.files && f.files.length > 0 && (o("importModel", f.files[0]), f.value = "");
|
|
5253
5268
|
}, A = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
|
|
5254
|
-
const
|
|
5255
|
-
console.log(JSON.parse(await
|
|
5269
|
+
const p = Ki();
|
|
5270
|
+
console.log(JSON.parse(await p));
|
|
5256
5271
|
}, d = () => {
|
|
5257
5272
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
5258
5273
|
Ei(localStorage.getItem("test_id"));
|
|
5259
|
-
},
|
|
5260
|
-
return (
|
|
5274
|
+
}, m = () => qn();
|
|
5275
|
+
return (p, f) => (T(), R("div", ua, [
|
|
5261
5276
|
b("div", Aa, [
|
|
5262
5277
|
b("div", {
|
|
5263
5278
|
class: "dropdown-wrapper",
|
|
@@ -5341,7 +5356,7 @@ const $r = {
|
|
|
5341
5356
|
}, "镜头拉近"),
|
|
5342
5357
|
b("div", {
|
|
5343
5358
|
class: "menu-item",
|
|
5344
|
-
onClick:
|
|
5359
|
+
onClick: m
|
|
5345
5360
|
}, " 重置相机位置 ")
|
|
5346
5361
|
], 512), [
|
|
5347
5362
|
[De, t.value]
|
|
@@ -5427,13 +5442,13 @@ const $r = {
|
|
|
5427
5442
|
const u = () => {
|
|
5428
5443
|
const g = Ui();
|
|
5429
5444
|
g && (A.value = g);
|
|
5430
|
-
}, h = (g) => Qt(g), d = (g) => Wi(g.uuid),
|
|
5445
|
+
}, h = (g) => Qt(g), d = (g) => Wi(g.uuid), m = (g) => {
|
|
5431
5446
|
Oi(g);
|
|
5432
|
-
},
|
|
5433
|
-
|
|
5447
|
+
}, p = j(null), f = () => {
|
|
5448
|
+
p.value && Ii(p.value, e.mode, e.sceneData), u();
|
|
5434
5449
|
};
|
|
5435
5450
|
return as(() => {
|
|
5436
|
-
f(),
|
|
5451
|
+
f(), p.value && fi(p.value);
|
|
5437
5452
|
}), ls(() => {
|
|
5438
5453
|
console.log("endset_three_editor destroy"), Qi();
|
|
5439
5454
|
}), (g, x) => (T(), R("div", Ca, [
|
|
@@ -5452,7 +5467,7 @@ const $r = {
|
|
|
5452
5467
|
b("div", {
|
|
5453
5468
|
class: se(`canvas canvas-mode-${r.mode}`),
|
|
5454
5469
|
ref_key: "containerRef",
|
|
5455
|
-
ref:
|
|
5470
|
+
ref: p
|
|
5456
5471
|
}, null, 2),
|
|
5457
5472
|
r.mode === "edit" ? (T(), Ke(ca, {
|
|
5458
5473
|
key: 0,
|
|
@@ -5462,7 +5477,7 @@ const $r = {
|
|
|
5462
5477
|
onPropertyChange: a,
|
|
5463
5478
|
onTreeSelect: h,
|
|
5464
5479
|
onTreeDelete: d,
|
|
5465
|
-
onTransformModeChange:
|
|
5480
|
+
onTransformModeChange: m
|
|
5466
5481
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
|
|
5467
5482
|
], 2),
|
|
5468
5483
|
r.mode === "edit" ? (T(), Ke(ya, { key: 2 })) : X("", !0)
|