endset_three_editor 0.10.14 → 0.10.15
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
|
@@ -533,20 +533,20 @@ class Qo extends Fn {
|
|
|
533
533
|
const i = new ir();
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(
|
|
537
|
-
let v =
|
|
538
|
-
Object.defineProperty(o,
|
|
536
|
+
function a(h, f) {
|
|
537
|
+
let v = f;
|
|
538
|
+
Object.defineProperty(o, h, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return v !== void 0 ? v :
|
|
540
|
+
return v !== void 0 ? v : f;
|
|
541
541
|
},
|
|
542
542
|
set: function(D) {
|
|
543
|
-
v !== D && (v = D, i[
|
|
543
|
+
v !== D && (v = D, i[h] = D, s[h] = D, o.dispatchEvent({ type: h + "-changed", value: D }), o.dispatchEvent(xs));
|
|
544
544
|
}
|
|
545
|
-
}), o[
|
|
545
|
+
}), o[h] = f, i[h] = f, s[h] = f;
|
|
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 P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion",
|
|
548
|
+
const l = new P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(), A = new Ae(), b = new P(), m = new P(), p = new P(), I = 0, w = new P();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion", A), a("pointStart", b), a("pointEnd", m), a("rotationAxis", p), a("rotationAngle", I), a("eye", w), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ae(), this._parentQuaternionInv = new Ae(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ae(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ae(), this._scaleStart = new P(), this._getPointer = Jo.bind(this), this._onPointerDown = $o.bind(this), this._onPointerHover = _o.bind(this), this._onPointerMove = er.bind(this), this._onPointerUp = tr.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";
|
|
@@ -800,14 +800,14 @@ class nr extends mt {
|
|
|
800
800
|
u.opacity = 0.25;
|
|
801
801
|
const g = e.clone();
|
|
802
802
|
g.color.setHex(16776960), g.opacity = 0.25;
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const A = e.clone();
|
|
804
|
+
A.color.setHex(16776960);
|
|
805
805
|
const b = e.clone();
|
|
806
806
|
b.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
810
|
-
active:
|
|
810
|
+
active: A,
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: c,
|
|
813
813
|
zAxisTransparent: d,
|
|
@@ -815,17 +815,17 @@ class nr extends mt {
|
|
|
815
815
|
};
|
|
816
816
|
const m = new ge(0, 0.04, 0.1, 12);
|
|
817
817
|
m.translate(0, 0.05, 0);
|
|
818
|
-
const
|
|
819
|
-
|
|
818
|
+
const p = new pe(0.08, 0.08, 0.08);
|
|
819
|
+
p.translate(0, 0.04, 0);
|
|
820
820
|
const I = new rt();
|
|
821
821
|
I.setAttribute("position", new ke([0, 0, 0, 1, 0, 0], 3));
|
|
822
822
|
const w = new ge(75e-4, 75e-4, 0.5, 3);
|
|
823
823
|
w.translate(0, 0.25, 0);
|
|
824
|
-
function
|
|
824
|
+
function h(N, U) {
|
|
825
825
|
const z = new gt(N, 75e-4, 3, 64, U * Math.PI * 2);
|
|
826
826
|
return z.rotateY(Math.PI / 2), z.rotateX(Math.PI / 2), z;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function f() {
|
|
829
829
|
const N = new rt();
|
|
830
830
|
return N.setAttribute("position", new ke([0, 0, 0, 1, 1, 1], 3)), N;
|
|
831
831
|
}
|
|
@@ -890,7 +890,7 @@ class nr extends mt {
|
|
|
890
890
|
[new L(new Ft(0.01, 2), s), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new We(
|
|
893
|
+
[new We(f(), s), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
896
|
[new We(I, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
@@ -903,19 +903,19 @@ class nr extends mt {
|
|
|
903
903
|
]
|
|
904
904
|
}, T = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new L(
|
|
906
|
+
[new L(h(0.5, 1), b), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
|
-
[new L(
|
|
909
|
+
[new L(h(0.5, 0.5), i)]
|
|
910
910
|
],
|
|
911
911
|
Y: [
|
|
912
|
-
[new L(
|
|
912
|
+
[new L(h(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
|
|
913
913
|
],
|
|
914
914
|
Z: [
|
|
915
|
-
[new L(
|
|
915
|
+
[new L(h(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
|
|
916
916
|
],
|
|
917
917
|
E: [
|
|
918
|
-
[new L(
|
|
918
|
+
[new L(h(0.75, 1), g), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
920
|
}, Y = {
|
|
921
921
|
AXIS: [
|
|
@@ -939,19 +939,19 @@ class nr extends mt {
|
|
|
939
939
|
]
|
|
940
940
|
}, se = {
|
|
941
941
|
X: [
|
|
942
|
-
[new L(
|
|
942
|
+
[new L(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
943
|
[new L(w, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
|
-
[new L(
|
|
944
|
+
[new L(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
|
-
[new L(
|
|
947
|
+
[new L(p, o), [0, 0.5, 0]],
|
|
948
948
|
[new L(w, o)],
|
|
949
|
-
[new L(
|
|
949
|
+
[new L(p, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
|
-
[new L(
|
|
952
|
+
[new L(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
953
|
[new L(w, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
|
-
[new L(
|
|
954
|
+
[new L(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
957
|
[new L(new pe(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
@@ -1609,50 +1609,50 @@ class Ar {
|
|
|
1609
1609
|
height: s
|
|
1610
1610
|
};
|
|
1611
1611
|
}, this.render = function(b, m) {
|
|
1612
|
-
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), mn.copy(m.matrixWorldInverse), gn.multiplyMatrices(m.projectionMatrix, mn), d(b, b, m), this.sortObjects &&
|
|
1612
|
+
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), mn.copy(m.matrixWorldInverse), gn.multiplyMatrices(m.projectionMatrix, mn), d(b, b, m), this.sortObjects && A(b);
|
|
1613
1613
|
}, this.setSize = function(b, m) {
|
|
1614
1614
|
n = b, s = m, i = n / 2, o = s / 2, l.style.width = b + "px", l.style.height = m + "px";
|
|
1615
1615
|
};
|
|
1616
1616
|
function c(b) {
|
|
1617
1617
|
b.isCSS2DObject && (b.element.style.display = "none");
|
|
1618
|
-
for (let m = 0,
|
|
1618
|
+
for (let m = 0, p = b.children.length; m < p; m++)
|
|
1619
1619
|
c(b.children[m]);
|
|
1620
1620
|
}
|
|
1621
|
-
function d(b, m,
|
|
1621
|
+
function d(b, m, p) {
|
|
1622
1622
|
if (b.visible === !1) {
|
|
1623
1623
|
c(b);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
1626
|
if (b.isCSS2DObject) {
|
|
1627
1627
|
ct.setFromMatrixPosition(b.matrixWorld), ct.applyMatrix4(gn);
|
|
1628
|
-
const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(
|
|
1629
|
-
w.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m,
|
|
1630
|
-
const
|
|
1631
|
-
distanceToCameraSquared: u(
|
|
1628
|
+
const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(p.layers) === !0, w = b.element;
|
|
1629
|
+
w.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m, p), w.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ct.x * i + i) + "px," + (-ct.y * o + o) + "px)", w.parentNode !== l && l.appendChild(w), b.onAfterRender(t, m, p));
|
|
1630
|
+
const h = {
|
|
1631
|
+
distanceToCameraSquared: u(p, b)
|
|
1632
1632
|
};
|
|
1633
|
-
a.objects.set(b,
|
|
1633
|
+
a.objects.set(b, h);
|
|
1634
1634
|
}
|
|
1635
1635
|
for (let I = 0, w = b.children.length; I < w; I++)
|
|
1636
|
-
d(b.children[I], m,
|
|
1636
|
+
d(b.children[I], m, p);
|
|
1637
1637
|
}
|
|
1638
1638
|
function u(b, m) {
|
|
1639
1639
|
return yn.setFromMatrixPosition(b.matrixWorld), bn.setFromMatrixPosition(m.matrixWorld), yn.distanceToSquared(bn);
|
|
1640
1640
|
}
|
|
1641
1641
|
function g(b) {
|
|
1642
1642
|
const m = [];
|
|
1643
|
-
return b.traverseVisible(function(
|
|
1644
|
-
|
|
1643
|
+
return b.traverseVisible(function(p) {
|
|
1644
|
+
p.isCSS2DObject && m.push(p);
|
|
1645
1645
|
}), m;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function A(b) {
|
|
1648
1648
|
const m = g(b).sort(function(I, w) {
|
|
1649
1649
|
if (I.renderOrder !== w.renderOrder)
|
|
1650
1650
|
return w.renderOrder - I.renderOrder;
|
|
1651
|
-
const
|
|
1652
|
-
return
|
|
1653
|
-
}),
|
|
1651
|
+
const h = a.objects.get(I).distanceToCameraSquared, f = a.objects.get(w).distanceToCameraSquared;
|
|
1652
|
+
return h - f;
|
|
1653
|
+
}), p = m.length;
|
|
1654
1654
|
for (let I = 0, w = m.length; I < w; I++)
|
|
1655
|
-
m[I].element.style.zIndex =
|
|
1655
|
+
m[I].element.style.zIndex = p - I;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
@@ -1966,8 +1966,8 @@ function Dr() {
|
|
|
1966
1966
|
u.position.set(14.904, 12.198, -1.832), u.scale.set(0.15, 4.265, 6.331), r.add(u);
|
|
1967
1967
|
const g = new O.Mesh(e, l(43));
|
|
1968
1968
|
g.position.set(-0.462, 8.89, 14.52), g.scale.set(4.38, 5.441, 0.088), r.add(g);
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1969
|
+
const A = new O.Mesh(e, l(20));
|
|
1970
|
+
A.position.set(3.235, 11.486, -12.541), A.scale.set(2.5, 2, 0.1), r.add(A);
|
|
1971
1971
|
const b = new O.Mesh(e, l(100));
|
|
1972
1972
|
return b.position.set(0, 20, 0), b.scale.set(1, 0.1, 1), r.add(b), r;
|
|
1973
1973
|
}
|
|
@@ -2243,30 +2243,30 @@ class Fr {
|
|
|
2243
2243
|
if (d.length > 0 && (o.extensionsUsed = d), u.length > 0 && (o.extensionsRequired = u), o.buffers && o.buffers.length > 0 && (o.buffers[0].byteLength = c.size), n.binary === !0) {
|
|
2244
2244
|
const g = new FileReader();
|
|
2245
2245
|
g.readAsArrayBuffer(c), g.onloadend = function() {
|
|
2246
|
-
const
|
|
2247
|
-
b.setUint32(0,
|
|
2248
|
-
const m = ws(Nr(JSON.stringify(o)), 32),
|
|
2249
|
-
|
|
2246
|
+
const A = ws(g.result), b = new DataView(new ArrayBuffer(wn));
|
|
2247
|
+
b.setUint32(0, A.byteLength, !0), b.setUint32(4, Lr, !0);
|
|
2248
|
+
const m = ws(Nr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(wn));
|
|
2249
|
+
p.setUint32(0, m.byteLength, !0), p.setUint32(4, Sr, !0);
|
|
2250
2250
|
const I = new ArrayBuffer(Cn), w = new DataView(I);
|
|
2251
2251
|
w.setUint32(0, Rr, !0), w.setUint32(4, Pr, !0);
|
|
2252
|
-
const
|
|
2253
|
-
w.setUint32(8,
|
|
2254
|
-
const
|
|
2252
|
+
const h = Cn + p.byteLength + m.byteLength + b.byteLength + A.byteLength;
|
|
2253
|
+
w.setUint32(8, h, !0);
|
|
2254
|
+
const f = new Blob([
|
|
2255
2255
|
I,
|
|
2256
|
-
|
|
2256
|
+
p,
|
|
2257
2257
|
m,
|
|
2258
2258
|
b,
|
|
2259
|
-
|
|
2259
|
+
A
|
|
2260
2260
|
], { type: "application/octet-stream" }), v = new FileReader();
|
|
2261
|
-
v.readAsArrayBuffer(
|
|
2261
|
+
v.readAsArrayBuffer(f), v.onloadend = function() {
|
|
2262
2262
|
t(v.result);
|
|
2263
2263
|
};
|
|
2264
2264
|
};
|
|
2265
2265
|
} else if (o.buffers && o.buffers.length > 0) {
|
|
2266
2266
|
const g = new FileReader();
|
|
2267
2267
|
g.readAsDataURL(c), g.onloadend = function() {
|
|
2268
|
-
const
|
|
2269
|
-
o.buffers[0].uri =
|
|
2268
|
+
const A = g.result;
|
|
2269
|
+
o.buffers[0].uri = A, t(o);
|
|
2270
2270
|
};
|
|
2271
2271
|
} else
|
|
2272
2272
|
t(o);
|
|
@@ -2349,8 +2349,8 @@ class Fr {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
async buildMetalRoughTextureAsync(e, t) {
|
|
2351
2351
|
if (e === t) return e;
|
|
2352
|
-
function n(
|
|
2353
|
-
return
|
|
2352
|
+
function n(A) {
|
|
2353
|
+
return A.colorSpace === je ? function(m) {
|
|
2354
2354
|
return m < 0.04045 ? m * 0.0773993808 : Math.pow(m * 0.9478672986 + 0.0521327014, 2.4);
|
|
2355
2355
|
} : function(m) {
|
|
2356
2356
|
return m;
|
|
@@ -2366,15 +2366,15 @@ class Fr {
|
|
|
2366
2366
|
const d = c.getImageData(0, 0, o, a);
|
|
2367
2367
|
if (s) {
|
|
2368
2368
|
c.drawImage(s, 0, 0, o, a);
|
|
2369
|
-
const
|
|
2369
|
+
const A = n(e), b = c.getImageData(0, 0, o, a).data;
|
|
2370
2370
|
for (let m = 2; m < b.length; m += 4)
|
|
2371
|
-
d.data[m] =
|
|
2371
|
+
d.data[m] = A(b[m] / 256) * 256;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (i) {
|
|
2374
2374
|
c.drawImage(i, 0, 0, o, a);
|
|
2375
|
-
const
|
|
2375
|
+
const A = n(t), b = c.getImageData(0, 0, o, a).data;
|
|
2376
2376
|
for (let m = 1; m < b.length; m += 4)
|
|
2377
|
-
d.data[m] =
|
|
2377
|
+
d.data[m] = A(b[m] / 256) * 256;
|
|
2378
2378
|
}
|
|
2379
2379
|
c.putImageData(d, 0, 0);
|
|
2380
2380
|
const g = (e || t).clone();
|
|
@@ -2425,8 +2425,8 @@ class Fr {
|
|
|
2425
2425
|
let u = 0;
|
|
2426
2426
|
for (let b = n; b < n + s; b++) {
|
|
2427
2427
|
for (let m = 0; m < e.itemSize; m++) {
|
|
2428
|
-
let
|
|
2429
|
-
e.itemSize > 4 ?
|
|
2428
|
+
let p;
|
|
2429
|
+
e.itemSize > 4 ? p = e.array[b * e.itemSize + m] : (m === 0 ? p = e.getX(b) : m === 1 ? p = e.getY(b) : m === 2 ? p = e.getZ(b) : m === 3 && (p = e.getW(b)), e.normalized === !0 && (p = Pt.normalize(p, e.array))), t === q.FLOAT ? d.setFloat32(u, p, !0) : t === q.INT ? d.setInt32(u, p, !0) : t === q.UNSIGNED_INT ? d.setUint32(u, p, !0) : t === q.SHORT ? d.setInt16(u, p, !0) : t === q.UNSIGNED_SHORT ? d.setUint16(u, p, !0) : t === q.BYTE ? d.setInt8(u, p) : t === q.UNSIGNED_BYTE && d.setUint8(u, p), u += a;
|
|
2430
2430
|
}
|
|
2431
2431
|
u % l !== 0 && (u += l - u % l);
|
|
2432
2432
|
}
|
|
@@ -2523,26 +2523,26 @@ class Fr {
|
|
|
2523
2523
|
const d = o.images.get(e), u = s + ":flipY/" + n.toString();
|
|
2524
2524
|
if (d[u] !== void 0) return d[u];
|
|
2525
2525
|
a.images || (a.images = []);
|
|
2526
|
-
const g = { mimeType: s },
|
|
2527
|
-
|
|
2528
|
-
const b =
|
|
2526
|
+
const g = { mimeType: s }, A = vn();
|
|
2527
|
+
A.width = Math.min(e.width, l.maxTextureSize), A.height = Math.min(e.height, l.maxTextureSize);
|
|
2528
|
+
const b = A.getContext("2d", {
|
|
2529
2529
|
willReadFrequently: !0
|
|
2530
2530
|
});
|
|
2531
|
-
if (n === !0 && (b.translate(0,
|
|
2531
|
+
if (n === !0 && (b.translate(0, A.height), b.scale(1, -1)), e.data !== void 0) {
|
|
2532
2532
|
t !== yo && console.error("GLTFExporter: Only RGBAFormat is supported.", t), (e.width > l.maxTextureSize || e.height > l.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
|
|
2533
|
-
const
|
|
2534
|
-
for (let I = 0; I <
|
|
2535
|
-
|
|
2536
|
-
b.putImageData(new ImageData(
|
|
2533
|
+
const p = new Uint8ClampedArray(e.height * e.width * 4);
|
|
2534
|
+
for (let I = 0; I < p.length; I += 4)
|
|
2535
|
+
p[I + 0] = e.data[I + 0], p[I + 1] = e.data[I + 1], p[I + 2] = e.data[I + 2], p[I + 3] = e.data[I + 3];
|
|
2536
|
+
b.putImageData(new ImageData(p, e.width, e.height), 0, 0);
|
|
2537
2537
|
} else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
|
|
2538
|
-
b.drawImage(e, 0, 0,
|
|
2538
|
+
b.drawImage(e, 0, 0, A.width, A.height);
|
|
2539
2539
|
else
|
|
2540
2540
|
throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
|
|
2541
2541
|
l.binary === !0 ? c.push(
|
|
2542
|
-
jr(
|
|
2543
|
-
g.bufferView =
|
|
2542
|
+
jr(A, s).then((p) => i.processBufferViewImage(p)).then((p) => {
|
|
2543
|
+
g.bufferView = p;
|
|
2544
2544
|
})
|
|
2545
|
-
) : g.uri = bo.getDataURL(
|
|
2545
|
+
) : g.uri = bo.getDataURL(A, s);
|
|
2546
2546
|
const m = a.images.push(g) - 1;
|
|
2547
2547
|
return d[u] = m, m;
|
|
2548
2548
|
} else
|
|
@@ -2650,8 +2650,8 @@ class Fr {
|
|
|
2650
2650
|
async processMeshAsync(e) {
|
|
2651
2651
|
const t = this.cache, n = this.json, s = [e.geometry.uuid];
|
|
2652
2652
|
if (Array.isArray(e.material))
|
|
2653
|
-
for (let
|
|
2654
|
-
s.push(e.material[
|
|
2653
|
+
for (let f = 0, v = e.material.length; f < v; f++)
|
|
2654
|
+
s.push(e.material[f].uuid);
|
|
2655
2655
|
else
|
|
2656
2656
|
s.push(e.material.uuid);
|
|
2657
2657
|
const i = s.join(":");
|
|
@@ -2667,25 +2667,25 @@ class Fr {
|
|
|
2667
2667
|
color: "COLOR_0",
|
|
2668
2668
|
skinWeight: "WEIGHTS_0",
|
|
2669
2669
|
skinIndex: "JOINTS_0"
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2670
|
+
}, A = o.getAttribute("normal");
|
|
2671
|
+
A !== void 0 && !this.isNormalizedNormalAttribute(A) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(A)));
|
|
2672
2672
|
let b = null;
|
|
2673
|
-
for (let
|
|
2674
|
-
if (
|
|
2675
|
-
const v = o.attributes[
|
|
2676
|
-
if (
|
|
2677
|
-
c[
|
|
2673
|
+
for (let f in o.attributes) {
|
|
2674
|
+
if (f.slice(0, 5) === "morph") continue;
|
|
2675
|
+
const v = o.attributes[f];
|
|
2676
|
+
if (f = g[f] || f.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f) && !f.startsWith("_") && (f = "_" + f), t.attributes.has(this.getUID(v))) {
|
|
2677
|
+
c[f] = t.attributes.get(this.getUID(v));
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
2680
|
b = null;
|
|
2681
2681
|
const R = v.array;
|
|
2682
|
-
|
|
2682
|
+
f === "JOINTS_0" && !(R instanceof Uint16Array) && !(R instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Dt.Utils.toTypedBufferAttribute(v, Uint16Array)) : (R instanceof Uint32Array || R instanceof Int32Array) && !f.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${f}" converted to type FLOAT.`), b = Dt.Utils.toTypedBufferAttribute(v, Float32Array));
|
|
2683
2683
|
const T = this.processAccessor(b || v, o);
|
|
2684
|
-
T !== null && (
|
|
2684
|
+
T !== null && (f.startsWith("_") || this.detectMeshQuantization(f, v), c[f] = T, t.attributes.set(this.getUID(v), T));
|
|
2685
2685
|
}
|
|
2686
|
-
if (
|
|
2686
|
+
if (A !== void 0 && o.setAttribute("normal", A), Object.keys(c).length === 0) return null;
|
|
2687
2687
|
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
2688
|
-
const
|
|
2688
|
+
const f = [], v = [], D = {};
|
|
2689
2689
|
if (e.morphTargetDictionary !== void 0)
|
|
2690
2690
|
for (const R in e.morphTargetDictionary)
|
|
2691
2691
|
D[e.morphTargetDictionary[R]] = R;
|
|
@@ -2709,37 +2709,37 @@ class Fr {
|
|
|
2709
2709
|
z === 0 && Z.setX(N, se.getX(N) - J.getX(N)), z === 1 && Z.setY(N, se.getY(N) - J.getY(N)), z === 2 && Z.setZ(N, se.getZ(N) - J.getZ(N)), z === 3 && Z.setW(N, se.getW(N) - J.getW(N));
|
|
2710
2710
|
T[ne] = this.processAccessor(Z, o), t.attributes.set(this.getUID(J, !0), T[ne]);
|
|
2711
2711
|
}
|
|
2712
|
-
u.push(T),
|
|
2712
|
+
u.push(T), f.push(e.morphTargetInfluences[R]), e.morphTargetDictionary !== void 0 && v.push(D[R]);
|
|
2713
2713
|
}
|
|
2714
|
-
l.weights =
|
|
2714
|
+
l.weights = f, v.length > 0 && (l.extras = {}, l.extras.targetNames = v);
|
|
2715
2715
|
}
|
|
2716
2716
|
const m = Array.isArray(e.material);
|
|
2717
2717
|
if (m && o.groups.length === 0) return null;
|
|
2718
|
-
let
|
|
2718
|
+
let p = !1;
|
|
2719
2719
|
if (m && o.index === null) {
|
|
2720
|
-
const
|
|
2720
|
+
const f = [];
|
|
2721
2721
|
for (let v = 0, D = o.attributes.position.count; v < D; v++)
|
|
2722
|
-
|
|
2723
|
-
o.setIndex(
|
|
2722
|
+
f[v] = v;
|
|
2723
|
+
o.setIndex(f), p = !0;
|
|
2724
2724
|
}
|
|
2725
2725
|
const I = m ? e.material : [e.material], w = m ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
2726
|
-
for (let
|
|
2726
|
+
for (let f = 0, v = w.length; f < v; f++) {
|
|
2727
2727
|
const D = {
|
|
2728
2728
|
mode: a,
|
|
2729
2729
|
attributes: c
|
|
2730
2730
|
};
|
|
2731
2731
|
if (this.serializeUserData(o, D), u.length > 0 && (D.targets = u), o.index !== null) {
|
|
2732
2732
|
let T = this.getUID(o.index);
|
|
2733
|
-
(w[
|
|
2733
|
+
(w[f].start !== void 0 || w[f].count !== void 0) && (T += ":" + w[f].start + ":" + w[f].count), t.attributes.has(T) ? D.indices = t.attributes.get(T) : (D.indices = this.processAccessor(o.index, o, w[f].start, w[f].count), t.attributes.set(T, D.indices)), D.indices === null && delete D.indices;
|
|
2734
2734
|
}
|
|
2735
|
-
const R = await this.processMaterialAsync(I[w[
|
|
2735
|
+
const R = await this.processMaterialAsync(I[w[f].materialIndex]);
|
|
2736
2736
|
R !== null && (D.material = R), d.push(D);
|
|
2737
2737
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2738
|
+
p === !0 && o.setIndex(null), l.primitives = d, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(f) {
|
|
2739
|
+
f.writeMesh && f.writeMesh(e, l);
|
|
2740
2740
|
});
|
|
2741
|
-
const
|
|
2742
|
-
return t.meshes.set(i,
|
|
2741
|
+
const h = n.meshes.push(l) - 1;
|
|
2742
|
+
return t.meshes.set(i, h), h;
|
|
2743
2743
|
}
|
|
2744
2744
|
/**
|
|
2745
2745
|
* If a vertex attribute with a
|
|
@@ -2815,24 +2815,24 @@ class Fr {
|
|
|
2815
2815
|
for (let c = 0; c < i.length; ++c) {
|
|
2816
2816
|
const d = i[c], u = St.parseTrackName(d.name);
|
|
2817
2817
|
let g = St.findNode(t, u.nodeName);
|
|
2818
|
-
const
|
|
2819
|
-
if (u.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(u.objectIndex) : g = void 0), !g || !
|
|
2818
|
+
const A = In[u.propertyName];
|
|
2819
|
+
if (u.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(u.objectIndex) : g = void 0), !g || !A) {
|
|
2820
2820
|
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', d.name);
|
|
2821
2821
|
continue;
|
|
2822
2822
|
}
|
|
2823
2823
|
const b = 1;
|
|
2824
2824
|
let m = d.values.length / d.times.length;
|
|
2825
|
-
|
|
2826
|
-
let
|
|
2827
|
-
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (
|
|
2825
|
+
A === In.morphTargetInfluences && (m /= g.morphTargetInfluences.length);
|
|
2826
|
+
let p;
|
|
2827
|
+
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", m /= 3) : d.getInterpolation() === Bn ? p = "STEP" : p = "LINEAR", a.push({
|
|
2828
2828
|
input: this.processAccessor(new De(d.times, b)),
|
|
2829
2829
|
output: this.processAccessor(new De(d.values, m)),
|
|
2830
|
-
interpolation:
|
|
2830
|
+
interpolation: p
|
|
2831
2831
|
}), o.push({
|
|
2832
2832
|
sampler: a.length - 1,
|
|
2833
2833
|
target: {
|
|
2834
2834
|
node: s.get(g),
|
|
2835
|
-
path:
|
|
2835
|
+
path: A
|
|
2836
2836
|
}
|
|
2837
2837
|
});
|
|
2838
2838
|
}
|
|
@@ -2920,11 +2920,11 @@ class Fr {
|
|
|
2920
2920
|
const b = [t.nodes.push(u) - 1];
|
|
2921
2921
|
if (e.children.length > 0) {
|
|
2922
2922
|
const m = [];
|
|
2923
|
-
for (let
|
|
2924
|
-
const w = e.children[
|
|
2923
|
+
for (let p = 0, I = e.children.length; p < I; p++) {
|
|
2924
|
+
const w = e.children[p];
|
|
2925
2925
|
if (w.visible || n.onlyVisible === !1) {
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2926
|
+
const h = await this.processNodeAsync(w);
|
|
2927
|
+
h !== null && m.push(h);
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
m.length > 0 && (u.children = m);
|
|
@@ -3207,8 +3207,8 @@ let zr = class {
|
|
|
3207
3207
|
writeNode(e, t) {
|
|
3208
3208
|
if (!e.isInstancedMesh) return;
|
|
3209
3209
|
const n = this.writer, s = e, i = new Float32Array(s.count * 3), o = new Float32Array(s.count * 4), a = new Float32Array(s.count * 3), l = new Ce(), c = new P(), d = new Ae(), u = new P();
|
|
3210
|
-
for (let
|
|
3211
|
-
s.getMatrixAt(
|
|
3210
|
+
for (let A = 0; A < s.count; A++)
|
|
3211
|
+
s.getMatrixAt(A, l), l.decompose(c, d, u), c.toArray(i, A * 3), d.toArray(o, A * 4), u.toArray(a, A * 3);
|
|
3212
3212
|
const g = {
|
|
3213
3213
|
TRANSLATION: n.processAccessor(new De(i, 3)),
|
|
3214
3214
|
ROTATION: n.processAccessor(new De(o, 4)),
|
|
@@ -3263,19 +3263,19 @@ Dt.Utils = {
|
|
|
3263
3263
|
let u;
|
|
3264
3264
|
if (n[l.uuid] === void 0) {
|
|
3265
3265
|
u = o.clone();
|
|
3266
|
-
const
|
|
3266
|
+
const A = new u.ValueBufferType(c * u.times.length);
|
|
3267
3267
|
for (let b = 0; b < u.times.length; b++)
|
|
3268
|
-
|
|
3269
|
-
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values =
|
|
3268
|
+
A[b * c + d] = u.values[b];
|
|
3269
|
+
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = A, n[l.uuid] = u, t.push(u);
|
|
3270
3270
|
continue;
|
|
3271
3271
|
}
|
|
3272
3272
|
const g = o.createInterpolant(new o.ValueBufferType(1));
|
|
3273
3273
|
u = n[l.uuid];
|
|
3274
|
-
for (let
|
|
3275
|
-
u.values[
|
|
3276
|
-
for (let
|
|
3277
|
-
const b = this.insertKeyframe(u, o.times[
|
|
3278
|
-
u.values[b * c + d] = o.values[
|
|
3274
|
+
for (let A = 0; A < u.times.length; A++)
|
|
3275
|
+
u.values[A * c + d] = g.evaluate(u.times[A]);
|
|
3276
|
+
for (let A = 0; A < o.times.length; A++) {
|
|
3277
|
+
const b = this.insertKeyframe(u, o.times[A]);
|
|
3278
|
+
u.values[b * c + d] = o.values[A];
|
|
3279
3279
|
}
|
|
3280
3280
|
}
|
|
3281
3281
|
return r.tracks = t, r;
|
|
@@ -3878,11 +3878,11 @@ class Tn {
|
|
|
3878
3878
|
}
|
|
3879
3879
|
return i.then(function(a) {
|
|
3880
3880
|
const l = s.byteOffset || 0, c = s.byteLength || 0, d = s.count, u = s.byteStride, g = new Uint8Array(a, l, c);
|
|
3881
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, g, s.mode, s.filter).then(function(
|
|
3882
|
-
return
|
|
3881
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, g, s.mode, s.filter).then(function(A) {
|
|
3882
|
+
return A.buffer;
|
|
3883
3883
|
}) : o.ready.then(function() {
|
|
3884
|
-
const
|
|
3885
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
3884
|
+
const A = new ArrayBuffer(d * u);
|
|
3885
|
+
return o.decodeGltfBuffer(new Uint8Array(A), d, u, g, s.mode, s.filter), A;
|
|
3886
3886
|
});
|
|
3887
3887
|
});
|
|
3888
3888
|
} else
|
|
@@ -3905,19 +3905,19 @@ class ga {
|
|
|
3905
3905
|
for (const c in o)
|
|
3906
3906
|
a.push(this.parser.getDependency("accessor", o[c]).then((d) => (l[c] = d, l[c])));
|
|
3907
3907
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
3908
|
-
const d = c.pop(), u = d.isGroup ? d.children : [d], g = c[0].count,
|
|
3908
|
+
const d = c.pop(), u = d.isGroup ? d.children : [d], g = c[0].count, A = [];
|
|
3909
3909
|
for (const b of u) {
|
|
3910
|
-
const m = new Ce(),
|
|
3911
|
-
for (let
|
|
3912
|
-
l.TRANSLATION &&
|
|
3913
|
-
for (const
|
|
3914
|
-
if (
|
|
3915
|
-
const v = l[
|
|
3916
|
-
|
|
3917
|
-
} else
|
|
3918
|
-
mt.prototype.copy.call(
|
|
3910
|
+
const m = new Ce(), p = new P(), I = new Ae(), w = new P(1, 1, 1), h = new vo(b.geometry, b.material, g);
|
|
3911
|
+
for (let f = 0; f < g; f++)
|
|
3912
|
+
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && I.fromBufferAttribute(l.ROTATION, f), l.SCALE && w.fromBufferAttribute(l.SCALE, f), h.setMatrixAt(f, m.compose(p, I, w));
|
|
3913
|
+
for (const f in l)
|
|
3914
|
+
if (f === "_COLOR_0") {
|
|
3915
|
+
const v = l[f];
|
|
3916
|
+
h.instanceColor = new Mo(v.array, v.itemSize, v.normalized);
|
|
3917
|
+
} else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" && b.geometry.setAttribute(f, l[f]);
|
|
3918
|
+
mt.prototype.copy.call(h, b), this.parser.assignFinalMaterial(h), A.push(h);
|
|
3919
3919
|
}
|
|
3920
|
-
return d.isGroup ? (d.clear(), d.add(...
|
|
3920
|
+
return d.isGroup ? (d.clear(), d.add(...A), d) : A[0];
|
|
3921
3921
|
}));
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
@@ -3968,18 +3968,18 @@ class ba {
|
|
|
3968
3968
|
for (const d in e.attributes) {
|
|
3969
3969
|
const u = Ls[d] || d.toLowerCase();
|
|
3970
3970
|
if (o[d] !== void 0) {
|
|
3971
|
-
const g = n.accessors[e.attributes[d]],
|
|
3972
|
-
c[u] =
|
|
3971
|
+
const g = n.accessors[e.attributes[d]], A = pt[g.componentType];
|
|
3972
|
+
c[u] = A.name, l[u] = g.normalized === !0;
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
3975
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
3976
3976
|
return new Promise(function(u, g) {
|
|
3977
|
-
s.decodeDracoFile(d, function(
|
|
3978
|
-
for (const b in
|
|
3979
|
-
const m =
|
|
3980
|
-
|
|
3977
|
+
s.decodeDracoFile(d, function(A) {
|
|
3978
|
+
for (const b in A.attributes) {
|
|
3979
|
+
const m = A.attributes[b], p = l[b];
|
|
3980
|
+
p !== void 0 && (m.normalized = p);
|
|
3981
3981
|
}
|
|
3982
|
-
u(
|
|
3982
|
+
u(A);
|
|
3983
3983
|
}, a, c, Fe, g);
|
|
3984
3984
|
});
|
|
3985
3985
|
});
|
|
@@ -4009,10 +4009,10 @@ class ci extends So {
|
|
|
4009
4009
|
return t;
|
|
4010
4010
|
}
|
|
4011
4011
|
interpolate_(e, t, n, s) {
|
|
4012
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u,
|
|
4013
|
-
for (let
|
|
4014
|
-
const v = o[m +
|
|
4015
|
-
i[
|
|
4012
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u, A = g * u, b = e * c, m = b - c, p = -2 * A + 3 * g, I = A - g, w = 1 - p, h = I - g + u;
|
|
4013
|
+
for (let f = 0; f !== a; f++) {
|
|
4014
|
+
const v = o[m + f + a], D = o[m + f + l] * d, R = o[b + f + a], T = o[b + f] * d;
|
|
4015
|
+
i[f] = w * v + h * D + p * R + I * T;
|
|
4016
4016
|
}
|
|
4017
4017
|
return i;
|
|
4018
4018
|
}
|
|
@@ -4437,24 +4437,24 @@ class Pa {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
const i = [];
|
|
4439
4439
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
4440
|
-
const a = o[0], l = vs[s.type], c = pt[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, g = s.byteOffset || 0,
|
|
4441
|
-
let m,
|
|
4442
|
-
if (
|
|
4443
|
-
const I = Math.floor(g /
|
|
4444
|
-
let
|
|
4445
|
-
|
|
4440
|
+
const a = o[0], l = vs[s.type], c = pt[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, g = s.byteOffset || 0, A = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
|
|
4441
|
+
let m, p;
|
|
4442
|
+
if (A && A !== u) {
|
|
4443
|
+
const I = Math.floor(g / A), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + I + ":" + s.count;
|
|
4444
|
+
let h = t.cache.get(w);
|
|
4445
|
+
h || (m = new c(a, I * A, s.count * A / d), h = new Qn(m, A / d), t.cache.add(w, h)), p = new Jn(h, l, g % A / d, b);
|
|
4446
4446
|
} else
|
|
4447
|
-
a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l),
|
|
4447
|
+
a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l), p = new De(m, l, b);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
|
-
const I = vs.SCALAR, w = pt[s.sparse.indices.componentType],
|
|
4450
|
-
a !== null && (
|
|
4449
|
+
const I = vs.SCALAR, w = pt[s.sparse.indices.componentType], h = s.sparse.indices.byteOffset || 0, f = s.sparse.values.byteOffset || 0, v = new w(o[1], h, s.sparse.count * I), D = new c(o[2], f, s.sparse.count * l);
|
|
4450
|
+
a !== null && (p = new De(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
4451
4451
|
for (let R = 0, T = v.length; R < T; R++) {
|
|
4452
4452
|
const Y = v[R];
|
|
4453
|
-
if (
|
|
4453
|
+
if (p.setX(Y, D[R * l]), l >= 2 && p.setY(Y, D[R * l + 1]), l >= 3 && p.setZ(Y, D[R * l + 2]), l >= 4 && p.setW(Y, D[R * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4454
4454
|
}
|
|
4455
|
-
|
|
4455
|
+
p.normalized = b;
|
|
4456
4456
|
}
|
|
4457
|
-
return
|
|
4457
|
+
return p;
|
|
4458
4458
|
});
|
|
4459
4459
|
}
|
|
4460
4460
|
/**
|
|
@@ -4501,12 +4501,12 @@ class Pa {
|
|
|
4501
4501
|
else if (o.uri === void 0)
|
|
4502
4502
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4503
4503
|
const d = Promise.resolve(l).then(function(u) {
|
|
4504
|
-
return new Promise(function(g,
|
|
4504
|
+
return new Promise(function(g, A) {
|
|
4505
4505
|
let b = g;
|
|
4506
4506
|
t.isImageBitmapLoader === !0 && (b = function(m) {
|
|
4507
|
-
const
|
|
4508
|
-
|
|
4509
|
-
}), t.load(Tt.resolveURL(u, i.path), b, void 0,
|
|
4507
|
+
const p = new $s(m);
|
|
4508
|
+
p.needsUpdate = !0, g(p);
|
|
4509
|
+
}), t.load(Tt.resolveURL(u, i.path), b, void 0, A);
|
|
4510
4510
|
});
|
|
4511
4511
|
}).then(function(u) {
|
|
4512
4512
|
return c === !0 && a.revokeObjectURL(l), He(u, o), u.userData.mimeType = o.mimeType || Oa(o.uri), u;
|
|
@@ -4668,35 +4668,35 @@ class Pa {
|
|
|
4668
4668
|
}
|
|
4669
4669
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
4670
4670
|
const c = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
|
|
4671
|
-
for (let
|
|
4672
|
-
const m = d[
|
|
4671
|
+
for (let A = 0, b = d.length; A < b; A++) {
|
|
4672
|
+
const m = d[A], p = o[A];
|
|
4673
4673
|
let I;
|
|
4674
|
-
const w = c[
|
|
4675
|
-
if (
|
|
4676
|
-
I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(),
|
|
4677
|
-
else if (
|
|
4674
|
+
const w = c[A];
|
|
4675
|
+
if (p.mode === ve.TRIANGLES || p.mode === ve.TRIANGLE_STRIP || p.mode === ve.TRIANGLE_FAN || p.mode === void 0)
|
|
4676
|
+
I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? I.geometry = Mn(I.geometry, Zn) : p.mode === ve.TRIANGLE_FAN && (I.geometry = Mn(I.geometry, Ps));
|
|
4677
|
+
else if (p.mode === ve.LINES)
|
|
4678
4678
|
I = new Ss(m, w);
|
|
4679
|
-
else if (
|
|
4679
|
+
else if (p.mode === ve.LINE_STRIP)
|
|
4680
4680
|
I = new We(m, w);
|
|
4681
|
-
else if (
|
|
4681
|
+
else if (p.mode === ve.LINE_LOOP)
|
|
4682
4682
|
I = new Do(m, w);
|
|
4683
|
-
else if (
|
|
4683
|
+
else if (p.mode === ve.POINTS)
|
|
4684
4684
|
I = new Kt(m, w);
|
|
4685
4685
|
else
|
|
4686
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
4687
|
-
Object.keys(I.geometry.morphAttributes).length > 0 && Ea(I, i), I.name = t.createUniqueName(i.name || "mesh_" + e), He(I, i),
|
|
4686
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
4687
|
+
Object.keys(I.geometry.morphAttributes).length > 0 && Ea(I, i), I.name = t.createUniqueName(i.name || "mesh_" + e), He(I, i), p.extensions && $e(s, I, p), t.assignFinalMaterial(I), u.push(I);
|
|
4688
4688
|
}
|
|
4689
|
-
for (let
|
|
4690
|
-
t.associations.set(u[
|
|
4689
|
+
for (let A = 0, b = u.length; A < b; A++)
|
|
4690
|
+
t.associations.set(u[A], {
|
|
4691
4691
|
meshes: e,
|
|
4692
|
-
primitives:
|
|
4692
|
+
primitives: A
|
|
4693
4693
|
});
|
|
4694
4694
|
if (u.length === 1)
|
|
4695
4695
|
return i.extensions && $e(s, u[0], i), u[0];
|
|
4696
4696
|
const g = new Zt();
|
|
4697
4697
|
i.extensions && $e(s, g, i), t.associations.set(g, { meshes: e });
|
|
4698
|
-
for (let
|
|
4699
|
-
g.add(u[
|
|
4698
|
+
for (let A = 0, b = u.length; A < b; A++)
|
|
4699
|
+
g.add(u[A]);
|
|
4700
4700
|
return g;
|
|
4701
4701
|
});
|
|
4702
4702
|
}
|
|
@@ -4751,8 +4751,8 @@ class Pa {
|
|
|
4751
4751
|
loadAnimation(e) {
|
|
4752
4752
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
|
|
4753
4753
|
for (let u = 0, g = s.channels.length; u < g; u++) {
|
|
4754
|
-
const
|
|
4755
|
-
m.node !== void 0 && (o.push(this.getDependency("node",
|
|
4754
|
+
const A = s.channels[u], b = s.samplers[A.sampler], m = A.target, p = m.node, I = s.parameters !== void 0 ? s.parameters[b.input] : b.input, w = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
|
|
4755
|
+
m.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", I)), l.push(this.getDependency("accessor", w)), c.push(b), d.push(m));
|
|
4756
4756
|
}
|
|
4757
4757
|
return Promise.all([
|
|
4758
4758
|
Promise.all(o),
|
|
@@ -4761,9 +4761,9 @@ class Pa {
|
|
|
4761
4761
|
Promise.all(c),
|
|
4762
4762
|
Promise.all(d)
|
|
4763
4763
|
]).then(function(u) {
|
|
4764
|
-
const g = u[0],
|
|
4765
|
-
for (let
|
|
4766
|
-
const v = g[
|
|
4764
|
+
const g = u[0], A = u[1], b = u[2], m = u[3], p = u[4], I = [];
|
|
4765
|
+
for (let h = 0, f = g.length; h < f; h++) {
|
|
4766
|
+
const v = g[h], D = A[h], R = b[h], T = m[h], Y = p[h];
|
|
4767
4767
|
if (v === void 0) continue;
|
|
4768
4768
|
v.updateMatrix && v.updateMatrix();
|
|
4769
4769
|
const $ = n._createAnimationTracks(v, D, R, T, Y);
|
|
@@ -4804,14 +4804,14 @@ class Pa {
|
|
|
4804
4804
|
l
|
|
4805
4805
|
]).then(function(c) {
|
|
4806
4806
|
const d = c[0], u = c[1], g = c[2];
|
|
4807
|
-
g !== null && d.traverse(function(
|
|
4808
|
-
|
|
4807
|
+
g !== null && d.traverse(function(A) {
|
|
4808
|
+
A.isSkinnedMesh && A.bind(g, Ra);
|
|
4809
4809
|
});
|
|
4810
|
-
for (let
|
|
4811
|
-
d.add(u[
|
|
4810
|
+
for (let A = 0, b = u.length; A < b; A++)
|
|
4811
|
+
d.add(u[A]);
|
|
4812
4812
|
if (d.userData.pivot !== void 0 && u.length > 0) {
|
|
4813
|
-
const
|
|
4814
|
-
d.pivot = new P().fromArray(
|
|
4813
|
+
const A = d.userData.pivot, b = u[0];
|
|
4814
|
+
d.pivot = new P().fromArray(A), d.position.x -= A[0], d.position.y -= A[1], d.position.z -= A[2], b.position.set(0, 0, 0), delete d.userData.pivot;
|
|
4815
4815
|
}
|
|
4816
4816
|
return d;
|
|
4817
4817
|
});
|
|
@@ -4870,11 +4870,11 @@ class Pa {
|
|
|
4870
4870
|
}
|
|
4871
4871
|
const c = (d) => {
|
|
4872
4872
|
const u = /* @__PURE__ */ new Map();
|
|
4873
|
-
for (const [g,
|
|
4874
|
-
(g instanceof Et || g instanceof $s) && u.set(g,
|
|
4873
|
+
for (const [g, A] of s.associations)
|
|
4874
|
+
(g instanceof Et || g instanceof $s) && u.set(g, A);
|
|
4875
4875
|
return d.traverse((g) => {
|
|
4876
|
-
const
|
|
4877
|
-
|
|
4876
|
+
const A = s.associations.get(g);
|
|
4877
|
+
A != null && u.set(g, A);
|
|
4878
4878
|
}), u;
|
|
4879
4879
|
};
|
|
4880
4880
|
return s.associations = c(i), i;
|
|
@@ -4882,8 +4882,8 @@ class Pa {
|
|
|
4882
4882
|
}
|
|
4883
4883
|
_createAnimationTracks(e, t, n, s, i) {
|
|
4884
4884
|
const o = [], a = e.name ? e.name : e.uuid, l = [];
|
|
4885
|
-
function c(
|
|
4886
|
-
|
|
4885
|
+
function c(A) {
|
|
4886
|
+
A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
|
|
4887
4887
|
}
|
|
4888
4888
|
qe[i.path] === qe.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
|
|
4889
4889
|
let d;
|
|
@@ -4912,9 +4912,9 @@ class Pa {
|
|
|
4912
4912
|
break;
|
|
4913
4913
|
}
|
|
4914
4914
|
const u = s.interpolation !== void 0 ? va[s.interpolation] : Bs, g = this._getArrayFromAccessor(n);
|
|
4915
|
-
for (let
|
|
4915
|
+
for (let A = 0, b = l.length; A < b; A++) {
|
|
4916
4916
|
const m = new d(
|
|
4917
|
-
l[
|
|
4917
|
+
l[A] + "." + qe[i.path],
|
|
4918
4918
|
t.array,
|
|
4919
4919
|
g,
|
|
4920
4920
|
u
|
|
@@ -4964,9 +4964,9 @@ function Sa(r, e, t) {
|
|
|
4964
4964
|
for (let c = 0, d = i.length; c < d; c++) {
|
|
4965
4965
|
const u = i[c];
|
|
4966
4966
|
if (u.POSITION !== void 0) {
|
|
4967
|
-
const g = t.json.accessors[u.POSITION],
|
|
4968
|
-
if (
|
|
4969
|
-
if (l.setX(Math.max(Math.abs(
|
|
4967
|
+
const g = t.json.accessors[u.POSITION], A = g.min, b = g.max;
|
|
4968
|
+
if (A !== void 0 && b !== void 0) {
|
|
4969
|
+
if (l.setX(Math.max(Math.abs(A[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(A[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(A[2]), Math.abs(b[2]))), g.normalized) {
|
|
4970
4970
|
const m = Ns(pt[g.componentType]);
|
|
4971
4971
|
l.multiplyScalar(m);
|
|
4972
4972
|
}
|
|
@@ -5549,26 +5549,26 @@ function ml(r, e, t = 1e3, n, s) {
|
|
|
5549
5549
|
if (!r)
|
|
5550
5550
|
return console.warn("[脚本动画] 目标对象为空,无法执行透明度动画"), null;
|
|
5551
5551
|
const i = /* @__PURE__ */ new Set();
|
|
5552
|
-
if (r.traverse((
|
|
5553
|
-
const b =
|
|
5552
|
+
if (r.traverse((A) => {
|
|
5553
|
+
const b = A.material;
|
|
5554
5554
|
if (!b) return;
|
|
5555
|
-
(Array.isArray(b) ? b : [b]).forEach((
|
|
5555
|
+
(Array.isArray(b) ? b : [b]).forEach((p) => p && i.add(p));
|
|
5556
5556
|
}), i.size === 0)
|
|
5557
5557
|
return console.warn("[脚本动画] 目标及其子节点没有材质,无法执行透明度动画:", r.name), null;
|
|
5558
5558
|
const o = t ?? 1e3, a = vi[n ?? "quad.inout"] ?? de.Easing.Quadratic.InOut, l = Math.min(1, Math.max(0, e)), c = l <= 0.01;
|
|
5559
5559
|
c || (r.visible = !0), Ys(r, ["opacity"]);
|
|
5560
5560
|
const d = [...i];
|
|
5561
|
-
d.forEach((
|
|
5562
|
-
|
|
5561
|
+
d.forEach((A) => {
|
|
5562
|
+
A.transparent = !0, A.needsUpdate = !0;
|
|
5563
5563
|
}), C.renderer && C.scene && C.camera && C.renderer.render(C.scene, C.camera);
|
|
5564
|
-
const u = Mi(r), g = d.map((
|
|
5565
|
-
const b = new de.Tween(
|
|
5564
|
+
const u = Mi(r), g = d.map((A) => {
|
|
5565
|
+
const b = new de.Tween(A).to({ opacity: l }, o).easing(a).start();
|
|
5566
5566
|
return u.opacity.add(b), b;
|
|
5567
5567
|
});
|
|
5568
|
-
return g.forEach((
|
|
5569
|
-
b === 0 ?
|
|
5570
|
-
u.opacity.delete(
|
|
5571
|
-
}) :
|
|
5568
|
+
return g.forEach((A, b) => {
|
|
5569
|
+
b === 0 ? A.onComplete(() => {
|
|
5570
|
+
u.opacity.delete(A), c && (r.visible = !1), s == null || s(), r === C.selectedObject && (Te == null || Te(r));
|
|
5571
|
+
}) : A.onComplete(() => u.opacity.delete(A)), A.onStop(() => u.opacity.delete(A));
|
|
5572
5572
|
}), g[0] ?? null;
|
|
5573
5573
|
}
|
|
5574
5574
|
function gl() {
|
|
@@ -5651,7 +5651,7 @@ function yl() {
|
|
|
5651
5651
|
}
|
|
5652
5652
|
const bl = 16777215, xl = 1;
|
|
5653
5653
|
async function Il() {
|
|
5654
|
-
var
|
|
5654
|
+
var f, v, D, R;
|
|
5655
5655
|
xe == null || xe(!0), await new Promise((T) => setTimeout(T, 50)), qs();
|
|
5656
5656
|
const r = C.scene;
|
|
5657
5657
|
if (!r)
|
|
@@ -5747,7 +5747,7 @@ async function Il() {
|
|
|
5747
5747
|
}
|
|
5748
5748
|
}
|
|
5749
5749
|
}), e.forEach((T) => r.remove(T));
|
|
5750
|
-
const c = (
|
|
5750
|
+
const c = (f = C.transformControls) == null ? void 0 : f.getHelper(), d = (c == null ? void 0 : c.parent) ?? null;
|
|
5751
5751
|
c && c.parent && c.parent.remove(c);
|
|
5752
5752
|
const u = /* @__PURE__ */ new Map();
|
|
5753
5753
|
for (const T of l)
|
|
@@ -5761,16 +5761,16 @@ async function Il() {
|
|
|
5761
5761
|
});
|
|
5762
5762
|
for (const T of g)
|
|
5763
5763
|
r.remove(T);
|
|
5764
|
-
const
|
|
5764
|
+
const A = /* @__PURE__ */ new Map();
|
|
5765
5765
|
for (const T of o)
|
|
5766
|
-
|
|
5766
|
+
A.set(T, T.parent), T.parent && T.parent.remove(T);
|
|
5767
5767
|
const b = r.clone();
|
|
5768
5768
|
b.children = b.children.filter(
|
|
5769
5769
|
(T) => T.userData.type !== "initFloor"
|
|
5770
5770
|
), b.traverse((T) => {
|
|
5771
5771
|
T.name && T.name.startsWith("DataPanel_") && T.parent && T.parent.remove(T);
|
|
5772
5772
|
});
|
|
5773
|
-
const
|
|
5773
|
+
const p = await new Dt().parseAsync(b, {
|
|
5774
5774
|
binary: !0,
|
|
5775
5775
|
onlyVisible: !1,
|
|
5776
5776
|
embedImages: !0
|
|
@@ -5783,7 +5783,7 @@ async function Il() {
|
|
|
5783
5783
|
for (const T of g)
|
|
5784
5784
|
r.add(T);
|
|
5785
5785
|
for (const T of o) {
|
|
5786
|
-
const Y =
|
|
5786
|
+
const Y = A.get(T);
|
|
5787
5787
|
Y ? Y.add(T) : r.add(T);
|
|
5788
5788
|
}
|
|
5789
5789
|
t.forEach((T, Y) => {
|
|
@@ -5799,8 +5799,8 @@ async function Il() {
|
|
|
5799
5799
|
n.forEach((T, Y) => {
|
|
5800
5800
|
w[Y] = T;
|
|
5801
5801
|
});
|
|
5802
|
-
const
|
|
5803
|
-
scene:
|
|
5802
|
+
const h = {
|
|
5803
|
+
scene: p,
|
|
5804
5804
|
camera: I,
|
|
5805
5805
|
dataPanels: w,
|
|
5806
5806
|
waters: i,
|
|
@@ -5812,7 +5812,7 @@ async function Il() {
|
|
|
5812
5812
|
code: T.code
|
|
5813
5813
|
}))
|
|
5814
5814
|
};
|
|
5815
|
-
return xe == null || xe(!1),
|
|
5815
|
+
return xe == null || xe(!1), h;
|
|
5816
5816
|
}
|
|
5817
5817
|
function Cl(r) {
|
|
5818
5818
|
if (r instanceof ArrayBuffer || ArrayBuffer.isView(r)) {
|
|
@@ -5838,30 +5838,45 @@ function Cl(r) {
|
|
|
5838
5838
|
return r && typeof r == "object" && r.type === "Buffer" && Array.isArray(r.data) ? new Uint8Array(r.data).buffer : null;
|
|
5839
5839
|
}
|
|
5840
5840
|
async function wl(r, e = "edit", t, n, s, i, o) {
|
|
5841
|
-
var l, c, d, u, g,
|
|
5841
|
+
var l, c, d, u, g, A, b;
|
|
5842
5842
|
const a = Cl(r);
|
|
5843
5843
|
if (a) {
|
|
5844
|
-
const m = await new ai().parseAsync(a, ""),
|
|
5845
|
-
if (C.scene =
|
|
5844
|
+
const m = await new ai().parseAsync(a, ""), p = m.scene || ((l = m.scenes) == null ? void 0 : l[0]), I = (c = C.scene) == null ? void 0 : c.environment;
|
|
5845
|
+
if (C.scene = p, !p.children.some((f) => f.type === "AmbientLight"))
|
|
5846
5846
|
if (i) {
|
|
5847
|
-
const
|
|
5848
|
-
|
|
5847
|
+
const f = new O.AmbientLight(i.color, i.intensity);
|
|
5848
|
+
f.name = i.name || "环境光", f.visible = i.visible ?? !0, i.position && f.position.fromArray(i.position), p.add(f);
|
|
5849
5849
|
} else
|
|
5850
|
-
hi(
|
|
5850
|
+
hi(p);
|
|
5851
5851
|
if (I)
|
|
5852
5852
|
C.scene.environment = I, C.scene.environmentIntensity = 1;
|
|
5853
5853
|
else if (C.renderer) {
|
|
5854
|
-
const
|
|
5855
|
-
|
|
5854
|
+
const f = Jt(C.renderer);
|
|
5855
|
+
f && (C.scene.environment = f, C.scene.environmentIntensity = 1);
|
|
5856
5856
|
}
|
|
5857
5857
|
if (!C.scene.environment && C.renderer) {
|
|
5858
|
-
const
|
|
5859
|
-
|
|
5858
|
+
const f = Jt(C.renderer);
|
|
5859
|
+
f ? (C.scene.environment = f, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5860
5860
|
}
|
|
5861
|
-
bi(
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5861
|
+
bi(p);
|
|
5862
|
+
const w = p.children.find(
|
|
5863
|
+
(f) => f.type === "Group" && f.name === "sl_scene"
|
|
5864
|
+
);
|
|
5865
|
+
if (w) {
|
|
5866
|
+
w.updateMatrixWorld();
|
|
5867
|
+
const f = w.matrixWorld.clone();
|
|
5868
|
+
[...w.children].forEach((v) => {
|
|
5869
|
+
w.remove(v), v.applyMatrix4(f), p.add(v);
|
|
5870
|
+
}), p.remove(w);
|
|
5871
|
+
}
|
|
5872
|
+
const h = (f) => {
|
|
5873
|
+
if (f.isTransformControlsRoot || f.isGridHelper || f.type === "Line" || f.type === "LineSegments" || f.type === "AmbientLight" || f.userData.type === "lightHelper" || f.userData.type === "initFloor")
|
|
5874
|
+
return;
|
|
5875
|
+
f.userData.isMovable = !0;
|
|
5876
|
+
const v = f.material;
|
|
5877
|
+
f.userData.isWater && v && !v.uniforms && !f.userData.waterSpeed && (f.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), f.children.forEach(h);
|
|
5878
|
+
};
|
|
5879
|
+
h(p);
|
|
5865
5880
|
} else {
|
|
5866
5881
|
const m = typeof r == "string" ? JSON.parse(r) : r, I = new O.ObjectLoader().parse(m);
|
|
5867
5882
|
if (I.type === "Scene") {
|
|
@@ -5869,14 +5884,14 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5869
5884
|
if (C.scene = I, w)
|
|
5870
5885
|
C.scene.environment = w, C.scene.environmentIntensity = 1;
|
|
5871
5886
|
else if (C.renderer) {
|
|
5872
|
-
const
|
|
5873
|
-
|
|
5887
|
+
const h = Jt(C.renderer);
|
|
5888
|
+
h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
|
|
5874
5889
|
}
|
|
5875
5890
|
} else
|
|
5876
5891
|
(u = C.scene) == null || u.add(I);
|
|
5877
5892
|
}
|
|
5878
5893
|
if (t && ((g = C.scene) == null || g.traverse((m) => {
|
|
5879
|
-
const
|
|
5894
|
+
const p = m.userData.id || m.userData._sourceUuid || m.uuid, I = t[p];
|
|
5880
5895
|
if (I && m.userData.isMovable) {
|
|
5881
5896
|
tl(m);
|
|
5882
5897
|
const w = new as({
|
|
@@ -5885,61 +5900,61 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5885
5900
|
});
|
|
5886
5901
|
w.attachTo(m), w.visible = !1, I.width && w.setWidth(I.width), I.fontSize && w.setFontSize(I.fontSize), I.offsetY !== void 0 && w.setOffsetY(I.offsetY), I.offsetX !== void 0 && w.setOffsetX(I.offsetX), I.offsetZ !== void 0 && w.setOffsetZ(I.offsetZ), ni(m, w);
|
|
5887
5902
|
}
|
|
5888
|
-
})), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder:
|
|
5903
|
+
})), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder: p }) => {
|
|
5889
5904
|
for (const I of n) {
|
|
5890
5905
|
const w = I.geometryType || "box";
|
|
5891
|
-
let
|
|
5892
|
-
w === "cylinder" ?
|
|
5906
|
+
let h;
|
|
5907
|
+
w === "cylinder" ? h = p({
|
|
5893
5908
|
radiusTop: I.cylinderRadiusTop ?? 5,
|
|
5894
5909
|
radiusBottom: I.cylinderRadiusBottom ?? 5,
|
|
5895
5910
|
radialSegments: I.cylinderRadialSegments ?? 32,
|
|
5896
5911
|
height: 0.8,
|
|
5897
5912
|
color: I.color,
|
|
5898
5913
|
scale: 4
|
|
5899
|
-
}) :
|
|
5914
|
+
}) : h = m({
|
|
5900
5915
|
width: I.boxWidth ?? 10,
|
|
5901
5916
|
height: I.boxDepth ?? 10,
|
|
5902
5917
|
color: I.color,
|
|
5903
5918
|
scale: 4
|
|
5904
|
-
}),
|
|
5919
|
+
}), h.position.fromArray(I.position), h.rotation.set(I.rotation[0], I.rotation[1], I.rotation[2]), h.scale.fromArray(I.scale), h.name = I.name, h.userData.waterTimeScale = I.timeScale ?? 0.05, h.userData.isWater = !0, h.userData.isMovable = !0, I.alpha !== void 0 && h.material.uniforms && h.material.uniforms.alpha && (h.material.uniforms.alpha.value = I.alpha), Nt = !0;
|
|
5905
5920
|
}
|
|
5906
5921
|
Ci();
|
|
5907
5922
|
}), s) {
|
|
5908
5923
|
const m = new O.TextureLoader();
|
|
5909
|
-
(
|
|
5910
|
-
if (
|
|
5911
|
-
const I =
|
|
5912
|
-
for (const
|
|
5913
|
-
if (
|
|
5914
|
-
const
|
|
5915
|
-
if (
|
|
5916
|
-
const v = m.load(
|
|
5917
|
-
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1),
|
|
5924
|
+
(A = C.scene) == null || A.traverse((p) => {
|
|
5925
|
+
if (p.type === "Mesh") {
|
|
5926
|
+
const I = p, w = Array.isArray(I.material) ? I.material : [I.material];
|
|
5927
|
+
for (const h of w)
|
|
5928
|
+
if (h && h.uuid && s[h.uuid]) {
|
|
5929
|
+
const f = s[h.uuid];
|
|
5930
|
+
if (f.mapDataUrl) {
|
|
5931
|
+
const v = m.load(f.mapDataUrl);
|
|
5932
|
+
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.map = v, h.userData = h.userData || {}, h.userData._mapDataUrl = f.mapDataUrl, h.userData._mapFileName = f.mapFileName;
|
|
5918
5933
|
}
|
|
5919
|
-
if (
|
|
5920
|
-
const v = m.load(
|
|
5921
|
-
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1),
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
),
|
|
5934
|
+
if (f.normalMapDataUrl) {
|
|
5935
|
+
const v = m.load(f.normalMapDataUrl);
|
|
5936
|
+
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.normalMap = v, h.normalScale = new O.Vector2(
|
|
5937
|
+
f.normalScale ?? 1,
|
|
5938
|
+
f.normalScale ?? 1
|
|
5939
|
+
), h.userData = h.userData || {}, h.userData._normalMapDataUrl = f.normalMapDataUrl, h.userData._normalMapFileName = f.normalMapFileName;
|
|
5925
5940
|
}
|
|
5926
|
-
if (
|
|
5927
|
-
const v = m.load(
|
|
5928
|
-
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1),
|
|
5941
|
+
if (f.aoMapDataUrl) {
|
|
5942
|
+
const v = m.load(f.aoMapDataUrl);
|
|
5943
|
+
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.aoMap = v, h.aoMapIntensity = f.aoMapIntensity ?? 1, h.userData = h.userData || {}, h.userData._aoMapDataUrl = f.aoMapDataUrl, h.userData._aoMapFileName = f.aoMapFileName;
|
|
5929
5944
|
}
|
|
5930
|
-
|
|
5945
|
+
h.needsUpdate = !0;
|
|
5931
5946
|
}
|
|
5932
5947
|
}
|
|
5933
5948
|
});
|
|
5934
5949
|
}
|
|
5935
5950
|
o && ka(o), e === "edit" && ((b = C.scene) == null || b.traverse((m) => {
|
|
5936
|
-
var
|
|
5951
|
+
var p, I;
|
|
5937
5952
|
if (m.type === "DirectionalLight") {
|
|
5938
5953
|
const w = m;
|
|
5939
5954
|
if (!w.userData.helper) {
|
|
5940
|
-
w.target.parent !== C.scene && (w.target.parent && w.target.parent.remove(w.target), w.target.position.set(0, 0, 0), (
|
|
5941
|
-
const
|
|
5942
|
-
|
|
5955
|
+
w.target.parent !== C.scene && (w.target.parent && w.target.parent.remove(w.target), w.target.position.set(0, 0, 0), (p = C.scene) == null || p.add(w.target));
|
|
5956
|
+
const h = new O.DirectionalLightHelper(w, 1);
|
|
5957
|
+
h.userData.type = "lightHelper", w.userData.helper = h, h.update(), (I = C.scene) == null || I.add(h);
|
|
5943
5958
|
}
|
|
5944
5959
|
}
|
|
5945
5960
|
}));
|
|
@@ -6089,15 +6104,15 @@ function Ol() {
|
|
|
6089
6104
|
},
|
|
6090
6105
|
addFace: function(e, t, n, s, i, o, a, l, c) {
|
|
6091
6106
|
const d = this.vertices.length;
|
|
6092
|
-
let u = this.parseVertexIndex(e, d), g = this.parseVertexIndex(t, d),
|
|
6093
|
-
if (this.addVertex(u, g,
|
|
6107
|
+
let u = this.parseVertexIndex(e, d), g = this.parseVertexIndex(t, d), A = this.parseVertexIndex(n, d);
|
|
6108
|
+
if (this.addVertex(u, g, A), this.addColor(u, g, A), a !== void 0 && a !== "") {
|
|
6094
6109
|
const b = this.normals.length;
|
|
6095
|
-
u = this.parseNormalIndex(a, b), g = this.parseNormalIndex(l, b),
|
|
6110
|
+
u = this.parseNormalIndex(a, b), g = this.parseNormalIndex(l, b), A = this.parseNormalIndex(c, b), this.addNormal(u, g, A);
|
|
6096
6111
|
} else
|
|
6097
|
-
this.addFaceNormal(u, g,
|
|
6112
|
+
this.addFaceNormal(u, g, A);
|
|
6098
6113
|
if (s !== void 0 && s !== "") {
|
|
6099
6114
|
const b = this.uvs.length;
|
|
6100
|
-
u = this.parseUVIndex(s, b), g = this.parseUVIndex(i, b),
|
|
6115
|
+
u = this.parseUVIndex(s, b), g = this.parseUVIndex(i, b), A = this.parseUVIndex(o, b), this.addUV(u, g, A), this.object.geometry.hasUVIndices = !0;
|
|
6101
6116
|
} else
|
|
6102
6117
|
this.addDefaultUV();
|
|
6103
6118
|
},
|
|
@@ -6207,17 +6222,17 @@ class Rl extends Xs {
|
|
|
6207
6222
|
break;
|
|
6208
6223
|
}
|
|
6209
6224
|
} else if (d === "f") {
|
|
6210
|
-
const g = c.slice(1).trim().split(Nn),
|
|
6211
|
-
for (let m = 0,
|
|
6225
|
+
const g = c.slice(1).trim().split(Nn), A = [];
|
|
6226
|
+
for (let m = 0, p = g.length; m < p; m++) {
|
|
6212
6227
|
const I = g[m];
|
|
6213
6228
|
if (I.length > 0) {
|
|
6214
6229
|
const w = I.split("/");
|
|
6215
|
-
|
|
6230
|
+
A.push(w);
|
|
6216
6231
|
}
|
|
6217
6232
|
}
|
|
6218
|
-
const b =
|
|
6219
|
-
for (let m = 1,
|
|
6220
|
-
const I =
|
|
6233
|
+
const b = A[0];
|
|
6234
|
+
for (let m = 1, p = A.length - 1; m < p; m++) {
|
|
6235
|
+
const I = A[m], w = A[m + 1];
|
|
6221
6236
|
t.addFace(
|
|
6222
6237
|
b[0],
|
|
6223
6238
|
I[0],
|
|
@@ -6233,15 +6248,15 @@ class Rl extends Xs {
|
|
|
6233
6248
|
} else if (d === "l") {
|
|
6234
6249
|
const u = c.substring(1).trim().split(" ");
|
|
6235
6250
|
let g = [];
|
|
6236
|
-
const
|
|
6251
|
+
const A = [];
|
|
6237
6252
|
if (c.indexOf("/") === -1)
|
|
6238
6253
|
g = u;
|
|
6239
6254
|
else
|
|
6240
6255
|
for (let b = 0, m = u.length; b < m; b++) {
|
|
6241
|
-
const
|
|
6242
|
-
|
|
6256
|
+
const p = u[b].split("/");
|
|
6257
|
+
p[0] !== "" && g.push(p[0]), p[1] !== "" && A.push(p[1]);
|
|
6243
6258
|
}
|
|
6244
|
-
t.addLineGeometry(g,
|
|
6259
|
+
t.addLineGeometry(g, A);
|
|
6245
6260
|
} else if (d === "p") {
|
|
6246
6261
|
const g = c.slice(1).trim().split(" ");
|
|
6247
6262
|
t.addPointGeometry(g);
|
|
@@ -6271,35 +6286,35 @@ class Rl extends Xs {
|
|
|
6271
6286
|
const i = new Zt();
|
|
6272
6287
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
6273
6288
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
6274
|
-
const c = t.objects[a], d = c.geometry, u = c.materials, g = d.type === "Line",
|
|
6289
|
+
const c = t.objects[a], d = c.geometry, u = c.materials, g = d.type === "Line", A = d.type === "Points";
|
|
6275
6290
|
let b = !1;
|
|
6276
6291
|
if (d.vertices.length === 0) continue;
|
|
6277
6292
|
const m = new rt();
|
|
6278
6293
|
m.setAttribute("position", new ke(d.vertices, 3)), d.normals.length > 0 && m.setAttribute("normal", new ke(d.normals, 3)), d.colors.length > 0 && (b = !0, m.setAttribute("color", new ke(d.colors, 3))), d.hasUVIndices === !0 && m.setAttribute("uv", new ke(d.uvs, 2));
|
|
6279
|
-
const
|
|
6280
|
-
for (let w = 0,
|
|
6281
|
-
const
|
|
6294
|
+
const p = [];
|
|
6295
|
+
for (let w = 0, h = u.length; w < h; w++) {
|
|
6296
|
+
const f = u[w], v = f.name + "_" + f.smooth + "_" + b;
|
|
6282
6297
|
let D = t.materials[v];
|
|
6283
6298
|
if (this.materials !== null) {
|
|
6284
|
-
if (D = this.materials.create(
|
|
6299
|
+
if (D = this.materials.create(f.name), g && D && !(D instanceof Mt)) {
|
|
6285
6300
|
const R = new Mt();
|
|
6286
6301
|
Et.prototype.copy.call(R, D), R.color.copy(D.color), D = R;
|
|
6287
|
-
} else if (
|
|
6302
|
+
} else if (A && D && !(D instanceof It)) {
|
|
6288
6303
|
const R = new It({ size: 10, sizeAttenuation: !1 });
|
|
6289
6304
|
Et.prototype.copy.call(R, D), R.color.copy(D.color), R.map = D.map, D = R;
|
|
6290
6305
|
}
|
|
6291
6306
|
}
|
|
6292
|
-
D === void 0 && (g ? D = new Mt() :
|
|
6307
|
+
D === void 0 && (g ? D = new Mt() : A ? D = new It({ size: 1, sizeAttenuation: !1 }) : D = new Ho(), D.name = f.name, D.flatShading = !f.smooth, D.vertexColors = b, t.materials[v] = D), p.push(D);
|
|
6293
6308
|
}
|
|
6294
6309
|
let I;
|
|
6295
|
-
if (
|
|
6296
|
-
for (let w = 0,
|
|
6297
|
-
const
|
|
6298
|
-
m.addGroup(
|
|
6310
|
+
if (p.length > 1) {
|
|
6311
|
+
for (let w = 0, h = u.length; w < h; w++) {
|
|
6312
|
+
const f = u[w];
|
|
6313
|
+
m.addGroup(f.groupStart, f.groupCount, w);
|
|
6299
6314
|
}
|
|
6300
|
-
g ? I = new Ss(m,
|
|
6315
|
+
g ? I = new Ss(m, p) : A ? I = new Kt(m, p) : I = new L(m, p);
|
|
6301
6316
|
} else
|
|
6302
|
-
g ? I = new Ss(m,
|
|
6317
|
+
g ? I = new Ss(m, p[0]) : A ? I = new Kt(m, p[0]) : I = new L(m, p[0]);
|
|
6303
6318
|
I.name = c.name, i.add(I);
|
|
6304
6319
|
}
|
|
6305
6320
|
else if (t.vertices.length > 0) {
|
|
@@ -6520,10 +6535,10 @@ function Sl() {
|
|
|
6520
6535
|
e.then((d) => {
|
|
6521
6536
|
const u = d.draco, g = new u.Decoder();
|
|
6522
6537
|
try {
|
|
6523
|
-
const
|
|
6524
|
-
|
|
6525
|
-
} catch (
|
|
6526
|
-
console.error(
|
|
6538
|
+
const A = t(u, g, new Int8Array(l), c), b = A.attributes.map((m) => m.array.buffer);
|
|
6539
|
+
A.index && b.push(A.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: A }, b);
|
|
6540
|
+
} catch (A) {
|
|
6541
|
+
console.error(A), self.postMessage({ type: "error", id: a.id, error: A.message });
|
|
6527
6542
|
} finally {
|
|
6528
6543
|
u.destroy(g);
|
|
6529
6544
|
}
|
|
@@ -6533,57 +6548,57 @@ function Sl() {
|
|
|
6533
6548
|
};
|
|
6534
6549
|
function t(o, a, l, c) {
|
|
6535
6550
|
const d = c.attributeIDs, u = c.attributeTypes;
|
|
6536
|
-
let g,
|
|
6551
|
+
let g, A;
|
|
6537
6552
|
const b = a.GetEncodedGeometryType(l);
|
|
6538
6553
|
if (b === o.TRIANGULAR_MESH)
|
|
6539
|
-
g = new o.Mesh(),
|
|
6554
|
+
g = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, g);
|
|
6540
6555
|
else if (b === o.POINT_CLOUD)
|
|
6541
|
-
g = new o.PointCloud(),
|
|
6556
|
+
g = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, g);
|
|
6542
6557
|
else
|
|
6543
6558
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
6544
|
-
if (!
|
|
6545
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
6559
|
+
if (!A.ok() || g.ptr === 0)
|
|
6560
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + A.error_msg());
|
|
6546
6561
|
const m = { index: null, attributes: [] };
|
|
6547
|
-
for (const
|
|
6548
|
-
const I = self[u[
|
|
6549
|
-
let w,
|
|
6562
|
+
for (const p in d) {
|
|
6563
|
+
const I = self[u[p]];
|
|
6564
|
+
let w, h;
|
|
6550
6565
|
if (c.useUniqueIDs)
|
|
6551
|
-
|
|
6566
|
+
h = d[p], w = a.GetAttributeByUniqueId(g, h);
|
|
6552
6567
|
else {
|
|
6553
|
-
if (
|
|
6554
|
-
w = a.GetAttribute(g,
|
|
6568
|
+
if (h = a.GetAttributeId(g, o[d[p]]), h === -1) continue;
|
|
6569
|
+
w = a.GetAttribute(g, h);
|
|
6555
6570
|
}
|
|
6556
|
-
const
|
|
6557
|
-
|
|
6571
|
+
const f = s(o, a, g, p, I, w);
|
|
6572
|
+
p === "color" && (f.vertexColorSpace = c.vertexColorSpace), m.attributes.push(f);
|
|
6558
6573
|
}
|
|
6559
6574
|
return b === o.TRIANGULAR_MESH && (m.index = n(o, a, g)), o.destroy(g), m;
|
|
6560
6575
|
}
|
|
6561
6576
|
function n(o, a, l) {
|
|
6562
6577
|
const d = l.num_faces() * 3, u = d * 4, g = o._malloc(u);
|
|
6563
6578
|
a.GetTrianglesUInt32Array(l, u, g);
|
|
6564
|
-
const
|
|
6565
|
-
return o._free(g), { array:
|
|
6579
|
+
const A = new Uint32Array(o.HEAPF32.buffer, g, d).slice();
|
|
6580
|
+
return o._free(g), { array: A, itemSize: 1 };
|
|
6566
6581
|
}
|
|
6567
6582
|
function s(o, a, l, c, d, u) {
|
|
6568
|
-
const g = l.num_points(),
|
|
6569
|
-
a.GetAttributeDataArrayForAllPoints(l, u, b, w,
|
|
6570
|
-
const v = new d(o.HEAPF32.buffer,
|
|
6583
|
+
const g = l.num_points(), A = u.num_components(), b = i(o, d), m = A * d.BYTES_PER_ELEMENT, p = Math.ceil(m / 4) * 4, I = p / d.BYTES_PER_ELEMENT, w = g * m, h = g * p, f = o._malloc(w);
|
|
6584
|
+
a.GetAttributeDataArrayForAllPoints(l, u, b, w, f);
|
|
6585
|
+
const v = new d(o.HEAPF32.buffer, f, w / d.BYTES_PER_ELEMENT);
|
|
6571
6586
|
let D;
|
|
6572
|
-
if (m ===
|
|
6587
|
+
if (m === p)
|
|
6573
6588
|
D = v.slice();
|
|
6574
6589
|
else {
|
|
6575
|
-
D = new d(
|
|
6590
|
+
D = new d(h / d.BYTES_PER_ELEMENT);
|
|
6576
6591
|
let R = 0;
|
|
6577
6592
|
for (let T = 0, Y = v.length; T < Y; T++) {
|
|
6578
|
-
for (let $ = 0; $ <
|
|
6579
|
-
D[R + $] = v[T *
|
|
6593
|
+
for (let $ = 0; $ < A; $++)
|
|
6594
|
+
D[R + $] = v[T * A + $];
|
|
6580
6595
|
R += I;
|
|
6581
6596
|
}
|
|
6582
6597
|
}
|
|
6583
|
-
return o._free(
|
|
6598
|
+
return o._free(f), {
|
|
6584
6599
|
name: c,
|
|
6585
6600
|
count: g,
|
|
6586
|
-
itemSize:
|
|
6601
|
+
itemSize: A,
|
|
6587
6602
|
array: D,
|
|
6588
6603
|
stride: I
|
|
6589
6604
|
};
|
|
@@ -6616,7 +6631,7 @@ class Ll extends L {
|
|
|
6616
6631
|
*/
|
|
6617
6632
|
constructor(e, t = {}) {
|
|
6618
6633
|
super(e), this.isWater = !0;
|
|
6619
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711),
|
|
6634
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ei, p = t.fog !== void 0 ? t.fog : !1, I = new Un(), w = new P(), h = new P(), f = new P(), v = new Ce(), D = new P(0, 0, -1), R = new nn(), T = new P(), Y = new P(), $ = new nn(), se = new Ce(), ne = new $n(), J = new Wn(s, i, { type: Gn }), Z = {
|
|
6620
6635
|
name: "MirrorShader",
|
|
6621
6636
|
uniforms: is.merge([
|
|
6622
6637
|
on.fog,
|
|
@@ -6746,11 +6761,11 @@ class Ll extends L {
|
|
|
6746
6761
|
fragmentShader: Z.fragmentShader,
|
|
6747
6762
|
lights: !0,
|
|
6748
6763
|
side: m,
|
|
6749
|
-
fog:
|
|
6764
|
+
fog: p
|
|
6750
6765
|
});
|
|
6751
|
-
N.uniforms.mirrorSampler.value = J.texture, N.uniforms.textureMatrix.value = se, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = g, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value =
|
|
6752
|
-
if (
|
|
6753
|
-
T.reflect(w).negate(), T.add(
|
|
6766
|
+
N.uniforms.mirrorSampler.value = J.texture, N.uniforms.textureMatrix.value = se, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = g, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = A, n.material = N, n.onBeforeRender = function(U, z, _) {
|
|
6767
|
+
if (h.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(_.matrixWorld), v.extractRotation(n.matrixWorld), w.set(0, 0, 1), w.applyMatrix4(v), T.subVectors(h, f), T.dot(w) > 0) return;
|
|
6768
|
+
T.reflect(w).negate(), T.add(h), v.extractRotation(_.matrixWorld), D.set(0, 0, -1), D.applyMatrix4(v), D.add(f), Y.subVectors(h, D), Y.reflect(w).negate(), Y.add(h), ne.position.copy(T), ne.up.set(0, 1, 0), ne.up.applyMatrix4(v), ne.up.reflect(w), ne.lookAt(Y), ne.far = _.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(_.projectionMatrix), se.set(
|
|
6754
6769
|
0.5,
|
|
6755
6770
|
0,
|
|
6756
6771
|
0,
|
|
@@ -6767,9 +6782,9 @@ class Ll extends L {
|
|
|
6767
6782
|
0,
|
|
6768
6783
|
0,
|
|
6769
6784
|
1
|
|
6770
|
-
), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(w,
|
|
6785
|
+
), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(w, h), I.applyMatrix4(ne.matrixWorldInverse), R.set(I.normal.x, I.normal.y, I.normal.z, I.constant);
|
|
6771
6786
|
const B = ne.projectionMatrix;
|
|
6772
|
-
$.x = (Math.sign(R.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(R.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], R.multiplyScalar(2 / R.dot($)), B.elements[2] = R.x, B.elements[6] = R.y, B.elements[10] = R.z + 1 - o, B.elements[14] = R.w,
|
|
6787
|
+
$.x = (Math.sign(R.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(R.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], R.multiplyScalar(2 / R.dot($)), B.elements[2] = R.x, B.elements[6] = R.y, B.elements[10] = R.z + 1 - o, B.elements[14] = R.w, A.setFromMatrixPosition(_.matrixWorld);
|
|
6773
6788
|
const be = U.getRenderTarget(), Oe = U.xr.enabled, Re = U.shadowMap.autoUpdate;
|
|
6774
6789
|
n.visible = !1, U.xr.enabled = !1, U.shadowMap.autoUpdate = !1, U.setRenderTarget(J), U.state.buffers.depth.setMask(!0), U.autoClear === !1 && U.clear(), U.render(z, ne), n.visible = !0, U.xr.enabled = Oe, U.shadowMap.autoUpdate = Re, U.setRenderTarget(be);
|
|
6775
6790
|
const Xe = _.viewport;
|
|
@@ -6843,13 +6858,13 @@ function Hi(r) {
|
|
|
6843
6858
|
repeatY: l = 4,
|
|
6844
6859
|
speedX: c = 5e-4,
|
|
6845
6860
|
speedY: d = 5e-4
|
|
6846
|
-
} = r || {}, u = new O.PlaneGeometry(e, t),
|
|
6847
|
-
|
|
6861
|
+
} = r || {}, u = new O.PlaneGeometry(e, t), A = new O.TextureLoader().load(Di, (p) => {
|
|
6862
|
+
p.wrapS = p.wrapT = O.RepeatWrapping, p.repeat.set(a, l), p.generateMipmaps = !1, p.minFilter = O.LinearFilter, p.magFilter = O.LinearFilter;
|
|
6848
6863
|
}), b = new O.MeshStandardMaterial({
|
|
6849
6864
|
color: n,
|
|
6850
6865
|
roughness: s,
|
|
6851
6866
|
metalness: i,
|
|
6852
|
-
normalMap:
|
|
6867
|
+
normalMap: A,
|
|
6853
6868
|
normalScale: new O.Vector2(o, o),
|
|
6854
6869
|
side: O.DoubleSide,
|
|
6855
6870
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
@@ -6986,8 +7001,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6986
7001
|
m.stopPropagation(), n("select", t.node);
|
|
6987
7002
|
}, g = (m) => {
|
|
6988
7003
|
m.stopPropagation(), n("delete", t.node);
|
|
6989
|
-
},
|
|
6990
|
-
return (m,
|
|
7004
|
+
}, A = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", b = (m) => m.name || `${m.type} (${m.id})`;
|
|
7005
|
+
return (m, p) => {
|
|
6991
7006
|
const I = qi("TreeItem", !0);
|
|
6992
7007
|
return H(), k("div", {
|
|
6993
7008
|
class: "tree-node",
|
|
@@ -7001,9 +7016,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7001
7016
|
l.value ? (H(), k("span", {
|
|
7002
7017
|
key: 0,
|
|
7003
7018
|
class: "toggle-icon",
|
|
7004
|
-
onClick:
|
|
7019
|
+
onClick: p[0] || (p[0] = ss((w) => ns(o)(m.node.uuid), ["stop"]))
|
|
7005
7020
|
}, fe(a.value ? "▼" : "▶"), 1)) : (H(), k("span", Hl)),
|
|
7006
|
-
y("span", kl, fe(
|
|
7021
|
+
y("span", kl, fe(A(m.node)), 1),
|
|
7007
7022
|
y("span", jl, fe(b(m.node)), 1),
|
|
7008
7023
|
y("button", {
|
|
7009
7024
|
class: "tree-delete",
|
|
@@ -7016,8 +7031,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7016
7031
|
node: w,
|
|
7017
7032
|
"selected-object": m.selectedObject,
|
|
7018
7033
|
version: m.version,
|
|
7019
|
-
onSelect:
|
|
7020
|
-
onDelete:
|
|
7034
|
+
onSelect: p[1] || (p[1] = (h) => n("select", h)),
|
|
7035
|
+
onDelete: p[2] || (p[2] = (h) => n("delete", h))
|
|
7021
7036
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
7022
7037
|
])) : re("", !0)
|
|
7023
7038
|
], 512);
|
|
@@ -7085,16 +7100,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7085
7100
|
}), o = G("#ffffff"), a = G(!1), l = G(!1), c = G("");
|
|
7086
7101
|
let d = null;
|
|
7087
7102
|
const u = G(!1), g = G("");
|
|
7088
|
-
let p = null;
|
|
7089
|
-
const b = G(!1), m = G("");
|
|
7090
7103
|
let A = null;
|
|
7104
|
+
const b = G(!1), m = G("");
|
|
7105
|
+
let p = null;
|
|
7091
7106
|
const I = ts({
|
|
7092
7107
|
intensity: 1
|
|
7093
7108
|
});
|
|
7094
7109
|
function w() {
|
|
7095
7110
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = I.intensity);
|
|
7096
7111
|
}
|
|
7097
|
-
function
|
|
7112
|
+
function h(E) {
|
|
7098
7113
|
let x = null;
|
|
7099
7114
|
return E.traverse((M) => {
|
|
7100
7115
|
if (M.type === "Mesh" && !x) {
|
|
@@ -7107,7 +7122,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7107
7122
|
}
|
|
7108
7123
|
}), x;
|
|
7109
7124
|
}
|
|
7110
|
-
function
|
|
7125
|
+
function f(E) {
|
|
7111
7126
|
let x = null;
|
|
7112
7127
|
return E.traverse((M) => {
|
|
7113
7128
|
if (M.type === "Mesh" && !x) {
|
|
@@ -7162,7 +7177,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7162
7177
|
}
|
|
7163
7178
|
function Y(E) {
|
|
7164
7179
|
var M, S;
|
|
7165
|
-
const x =
|
|
7180
|
+
const x = h(E);
|
|
7166
7181
|
x && x.normalMap ? (l.value = !0, d = x.normalMap, c.value = ((M = x.userData) == null ? void 0 : M._normalMapFileName) || "法线贴图", i.normalScale = ((S = x.normalScale) == null ? void 0 : S.x) ?? 1) : (l.value = !1, d = null, c.value = "", i.normalScale = 1);
|
|
7167
7182
|
}
|
|
7168
7183
|
function $(E) {
|
|
@@ -7208,8 +7223,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7208
7223
|
}
|
|
7209
7224
|
function Z(E) {
|
|
7210
7225
|
var M;
|
|
7211
|
-
const x =
|
|
7212
|
-
x && x.map ? (u.value = !0,
|
|
7226
|
+
const x = h(E);
|
|
7227
|
+
x && x.map ? (u.value = !0, A = x.map, g.value = ((M = x.userData) == null ? void 0 : M._mapFileName) || "模型贴图") : (u.value = !1, A = null, g.value = "");
|
|
7213
7228
|
}
|
|
7214
7229
|
function N(E) {
|
|
7215
7230
|
var F;
|
|
@@ -7230,7 +7245,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7230
7245
|
for (const X of me)
|
|
7231
7246
|
X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshBasicMaterial" || X.type === "MeshLambertMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.map = F, X.userData = X.userData || {}, X.userData._mapDataUrl = x, X.userData._mapFileName = M, X.needsUpdate = !0);
|
|
7232
7247
|
}
|
|
7233
|
-
}),
|
|
7248
|
+
}), A = F, u.value = !0, g.value = M;
|
|
7234
7249
|
}
|
|
7235
7250
|
function z() {
|
|
7236
7251
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
@@ -7239,12 +7254,12 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7239
7254
|
for (const S of M)
|
|
7240
7255
|
S.map && (S.map = null, S.userData && (delete S.userData._mapDataUrl, delete S.userData._mapFileName), S.needsUpdate = !0);
|
|
7241
7256
|
}
|
|
7242
|
-
}),
|
|
7257
|
+
}), A && (A.dispose(), A = null), u.value = !1, g.value = "");
|
|
7243
7258
|
}
|
|
7244
7259
|
function _(E) {
|
|
7245
7260
|
var M;
|
|
7246
|
-
const x =
|
|
7247
|
-
x && x.aoMap ? (b.value = !0,
|
|
7261
|
+
const x = h(E);
|
|
7262
|
+
x && x.aoMap ? (b.value = !0, p = x.aoMap, m.value = ((M = x.userData) == null ? void 0 : M._aoMapFileName) || "AO 贴图", i.aoIntensity = x.aoMapIntensity ?? 1) : (b.value = !1, p = null, m.value = "", i.aoIntensity = 1);
|
|
7248
7263
|
}
|
|
7249
7264
|
function B(E) {
|
|
7250
7265
|
var F;
|
|
@@ -7265,7 +7280,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7265
7280
|
for (const X of me)
|
|
7266
7281
|
X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.aoMap = F, X.aoMapIntensity = i.aoIntensity, X.userData = X.userData || {}, X.userData._aoMapDataUrl = x, X.userData._aoMapFileName = M, X.needsUpdate = !0);
|
|
7267
7282
|
}
|
|
7268
|
-
}),
|
|
7283
|
+
}), p = F, b.value = !0, m.value = M;
|
|
7269
7284
|
}
|
|
7270
7285
|
function Oe() {
|
|
7271
7286
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
@@ -7274,7 +7289,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7274
7289
|
for (const S of M)
|
|
7275
7290
|
S.aoMap && (S.aoMap = null, S.userData && (delete S.userData._aoMapDataUrl, delete S.userData._aoMapFileName), S.needsUpdate = !0);
|
|
7276
7291
|
}
|
|
7277
|
-
}),
|
|
7292
|
+
}), p && (p.dispose(), p = null), b.value = !1, m.value = "");
|
|
7278
7293
|
}
|
|
7279
7294
|
function Re() {
|
|
7280
7295
|
if (!t.selectedObject) return;
|
|
@@ -7349,7 +7364,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7349
7364
|
() => t.selectedObject,
|
|
7350
7365
|
(E) => {
|
|
7351
7366
|
if (E) {
|
|
7352
|
-
const x =
|
|
7367
|
+
const x = f(E);
|
|
7353
7368
|
x ? (i.color = x.color, i.metalness = x.metalness, i.roughness = x.roughness, i.opacity = x.opacity, o.value = "#" + new le(x.color).getHexString(), a.value = !0) : (i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1), Y(E), Z(E), _(E), E.type === "DirectionalLight" && (I.intensity = E.intensity ?? 1), ps(E), As(E);
|
|
7354
7369
|
} else
|
|
7355
7370
|
i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1, l.value = !1, c.value = "", u.value = !1, g.value = "", b.value = !1, m.value = "";
|
|
@@ -7815,61 +7830,61 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7815
7830
|
},
|
|
7816
7831
|
setup(r) {
|
|
7817
7832
|
const e = r, t = G(""), n = G(""), s = G(null), i = G(""), o = G(null), a = G([]);
|
|
7818
|
-
function l(
|
|
7819
|
-
if (
|
|
7820
|
-
if (
|
|
7821
|
-
if (Array.isArray(
|
|
7822
|
-
const
|
|
7823
|
-
return
|
|
7824
|
-
}
|
|
7825
|
-
function c(
|
|
7826
|
-
const
|
|
7827
|
-
if (
|
|
7828
|
-
for (const [v, D] of Object.entries(
|
|
7829
|
-
typeof v == "string" && !v.startsWith("_") &&
|
|
7833
|
+
function l(h) {
|
|
7834
|
+
if (h === null) return "null";
|
|
7835
|
+
if (h === void 0) return "undefined";
|
|
7836
|
+
if (Array.isArray(h)) return "array";
|
|
7837
|
+
const f = typeof h;
|
|
7838
|
+
return f === "object" ? "object" : f === "number" ? "number" : f === "boolean" ? "boolean" : "string";
|
|
7839
|
+
}
|
|
7840
|
+
function c(h) {
|
|
7841
|
+
const f = [];
|
|
7842
|
+
if (h.userData)
|
|
7843
|
+
for (const [v, D] of Object.entries(h.userData))
|
|
7844
|
+
typeof v == "string" && !v.startsWith("_") && f.push({
|
|
7830
7845
|
key: v,
|
|
7831
7846
|
value: typeof D == "object" ? JSON.stringify(D) : String(D),
|
|
7832
7847
|
rawType: l(D)
|
|
7833
7848
|
});
|
|
7834
|
-
a.value =
|
|
7835
|
-
}
|
|
7836
|
-
function d(
|
|
7837
|
-
const
|
|
7838
|
-
if (
|
|
7839
|
-
if (
|
|
7840
|
-
if (
|
|
7841
|
-
if (
|
|
7842
|
-
const v = Number(
|
|
7843
|
-
if (
|
|
7844
|
-
return String(v) !==
|
|
7845
|
-
if (
|
|
7849
|
+
a.value = f;
|
|
7850
|
+
}
|
|
7851
|
+
function d(h) {
|
|
7852
|
+
const f = h.trim();
|
|
7853
|
+
if (f === "true") return !0;
|
|
7854
|
+
if (f === "false") return !1;
|
|
7855
|
+
if (f === "null") return null;
|
|
7856
|
+
if (f === "undefined") return;
|
|
7857
|
+
const v = Number(f);
|
|
7858
|
+
if (f !== "" && !isNaN(v))
|
|
7859
|
+
return String(v) !== f ? f : v;
|
|
7860
|
+
if (f.startsWith("{") && f.endsWith("}") || f.startsWith("[") && f.endsWith("]"))
|
|
7846
7861
|
try {
|
|
7847
|
-
return JSON.parse(
|
|
7862
|
+
return JSON.parse(f);
|
|
7848
7863
|
} catch {
|
|
7849
7864
|
}
|
|
7850
|
-
return
|
|
7865
|
+
return f;
|
|
7851
7866
|
}
|
|
7852
7867
|
function u() {
|
|
7853
7868
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
7854
|
-
const
|
|
7855
|
-
if (
|
|
7869
|
+
const h = t.value.trim();
|
|
7870
|
+
if (h === "isMovable") {
|
|
7856
7871
|
t.value = "";
|
|
7857
7872
|
return;
|
|
7858
7873
|
}
|
|
7859
|
-
const
|
|
7860
|
-
e.selectedObject.userData[
|
|
7874
|
+
const f = d(n.value);
|
|
7875
|
+
e.selectedObject.userData[h] = f, c(e.selectedObject), t.value = "", n.value = "";
|
|
7861
7876
|
}
|
|
7862
|
-
function g(
|
|
7863
|
-
e.selectedObject && (delete e.selectedObject.userData[
|
|
7877
|
+
function g(h, f) {
|
|
7878
|
+
e.selectedObject && (delete e.selectedObject.userData[h], c(e.selectedObject));
|
|
7864
7879
|
}
|
|
7865
|
-
function
|
|
7866
|
-
return
|
|
7880
|
+
function A(h) {
|
|
7881
|
+
return h.length <= 28 ? h : h.substring(0, 28) + "…";
|
|
7867
7882
|
}
|
|
7868
|
-
function b(
|
|
7869
|
-
s.value =
|
|
7870
|
-
const
|
|
7871
|
-
if (!
|
|
7872
|
-
const v =
|
|
7883
|
+
function b(h) {
|
|
7884
|
+
s.value = h;
|
|
7885
|
+
const f = e.selectedObject;
|
|
7886
|
+
if (!f) return;
|
|
7887
|
+
const v = f.userData[h];
|
|
7873
7888
|
try {
|
|
7874
7889
|
i.value = JSON.stringify(v, null, 2);
|
|
7875
7890
|
} catch {
|
|
@@ -7878,58 +7893,58 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7878
7893
|
m();
|
|
7879
7894
|
}
|
|
7880
7895
|
function m() {
|
|
7881
|
-
const
|
|
7882
|
-
if (!
|
|
7896
|
+
const h = i.value.trim();
|
|
7897
|
+
if (!h) {
|
|
7883
7898
|
o.value = null;
|
|
7884
7899
|
return;
|
|
7885
7900
|
}
|
|
7886
|
-
if (!
|
|
7901
|
+
if (!h.startsWith("{") && !h.startsWith("[")) {
|
|
7887
7902
|
o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
|
|
7888
7903
|
return;
|
|
7889
7904
|
}
|
|
7890
7905
|
try {
|
|
7891
|
-
JSON.parse(
|
|
7892
|
-
} catch (
|
|
7893
|
-
o.value = "JSON 格式错误:" +
|
|
7906
|
+
JSON.parse(h), o.value = null;
|
|
7907
|
+
} catch (f) {
|
|
7908
|
+
o.value = "JSON 格式错误:" + f.message;
|
|
7894
7909
|
}
|
|
7895
7910
|
}
|
|
7896
|
-
function
|
|
7897
|
-
const
|
|
7898
|
-
if (!
|
|
7911
|
+
function p(h) {
|
|
7912
|
+
const f = e.selectedObject;
|
|
7913
|
+
if (!f) return;
|
|
7899
7914
|
const v = i.value.trim();
|
|
7900
7915
|
try {
|
|
7901
7916
|
const D = JSON.parse(v);
|
|
7902
|
-
|
|
7917
|
+
f.userData[h] = D, c(f), s.value = null, i.value = "";
|
|
7903
7918
|
} catch {
|
|
7904
|
-
|
|
7919
|
+
f.userData[h] = v, c(f), s.value = null, i.value = "";
|
|
7905
7920
|
}
|
|
7906
7921
|
}
|
|
7907
7922
|
function I() {
|
|
7908
7923
|
s.value = null, i.value = "";
|
|
7909
7924
|
}
|
|
7910
7925
|
function w() {
|
|
7911
|
-
const
|
|
7912
|
-
if (!
|
|
7913
|
-
const
|
|
7914
|
-
|
|
7915
|
-
x:
|
|
7916
|
-
y:
|
|
7917
|
-
z:
|
|
7918
|
-
}, c(
|
|
7926
|
+
const h = e.selectedObject;
|
|
7927
|
+
if (!h) return;
|
|
7928
|
+
const f = Fs();
|
|
7929
|
+
f && (h.userData.closeUpView = {
|
|
7930
|
+
x: f.position.x,
|
|
7931
|
+
y: f.position.y,
|
|
7932
|
+
z: f.position.z
|
|
7933
|
+
}, c(h));
|
|
7919
7934
|
}
|
|
7920
7935
|
return Me(
|
|
7921
7936
|
() => e.selectedObject,
|
|
7922
|
-
(
|
|
7923
|
-
|
|
7937
|
+
(h) => {
|
|
7938
|
+
h ? c(h) : a.value = [], s.value = null, i.value = "";
|
|
7924
7939
|
},
|
|
7925
7940
|
{ immediate: !0 }
|
|
7926
|
-
), (
|
|
7941
|
+
), (h, f) => (H(), k("div", Sc, [
|
|
7927
7942
|
y("div", Lc, [
|
|
7928
|
-
|
|
7943
|
+
f[3] || (f[3] = y("label", null, "userData 属性", -1)),
|
|
7929
7944
|
y("div", Nc, [
|
|
7930
7945
|
j(y("input", {
|
|
7931
7946
|
type: "text",
|
|
7932
|
-
"onUpdate:modelValue":
|
|
7947
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => t.value = v),
|
|
7933
7948
|
placeholder: "属性名",
|
|
7934
7949
|
class: "ud-input",
|
|
7935
7950
|
onKeyup: ut(u, ["enter"])
|
|
@@ -7937,7 +7952,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7937
7952
|
[W, t.value]
|
|
7938
7953
|
]),
|
|
7939
7954
|
j(y("textarea", {
|
|
7940
|
-
"onUpdate:modelValue":
|
|
7955
|
+
"onUpdate:modelValue": f[1] || (f[1] = (v) => n.value = v),
|
|
7941
7956
|
placeholder: "值",
|
|
7942
7957
|
class: "ud-input ud-textarea",
|
|
7943
7958
|
onKeyup: ut(ss(u, ["prevent"]), ["enter"])
|
|
@@ -7961,7 +7976,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7961
7976
|
y("span", jc, fe(v.key), 1),
|
|
7962
7977
|
v.key === "isMovable" ? (H(), k("span", Fc, fe(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (H(), k(Ee, { key: 1 }, [
|
|
7963
7978
|
s.value !== v.key ? (H(), k(Ee, { key: 0 }, [
|
|
7964
|
-
y("span", Uc, fe(
|
|
7979
|
+
y("span", Uc, fe(A(v.value)), 1),
|
|
7965
7980
|
y("button", {
|
|
7966
7981
|
class: "ud-btn edit-json-btn",
|
|
7967
7982
|
title: "编辑对象",
|
|
@@ -7970,7 +7985,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7970
7985
|
], 64)) : (H(), k(Ee, { key: 1 }, [
|
|
7971
7986
|
o.value ? (H(), k("div", Wc, " ⚠ " + fe(o.value), 1)) : re("", !0),
|
|
7972
7987
|
j(y("textarea", {
|
|
7973
|
-
"onUpdate:modelValue":
|
|
7988
|
+
"onUpdate:modelValue": f[2] || (f[2] = (R) => i.value = R),
|
|
7974
7989
|
class: Pe(["ud-json-textarea", { "has-error": o.value }]),
|
|
7975
7990
|
rows: "3",
|
|
7976
7991
|
onInput: m
|
|
@@ -7981,7 +7996,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7981
7996
|
y("button", {
|
|
7982
7997
|
class: "ud-btn apply-btn",
|
|
7983
7998
|
title: "应用修改",
|
|
7984
|
-
onClick: (R) =>
|
|
7999
|
+
onClick: (R) => p(v.key)
|
|
7985
8000
|
}, " ✓ ", 8, Bc),
|
|
7986
8001
|
y("button", {
|
|
7987
8002
|
class: "ud-btn cancel-btn",
|
|
@@ -8013,28 +8028,28 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8013
8028
|
},
|
|
8014
8029
|
setup(r) {
|
|
8015
8030
|
const e = r, t = G(""), n = G([]), s = G(!0), i = G(0.1), o = G(0), a = G(0), l = G(20), c = G(""), d = G(""), u = G(""), g = G("");
|
|
8016
|
-
let
|
|
8031
|
+
let A = m(), b = !1;
|
|
8017
8032
|
function m() {
|
|
8018
|
-
const
|
|
8019
|
-
return
|
|
8020
|
-
}
|
|
8021
|
-
Me(s, (
|
|
8022
|
-
b || !
|
|
8023
|
-
}), Me(l, (
|
|
8024
|
-
b || !
|
|
8025
|
-
}), Me(o, (
|
|
8026
|
-
b || !
|
|
8027
|
-
}), Me(i, (
|
|
8028
|
-
b || !
|
|
8029
|
-
}), Me(a, (
|
|
8030
|
-
b || !
|
|
8033
|
+
const h = e.selectedObject;
|
|
8034
|
+
return h ? jt(us(h)) : null;
|
|
8035
|
+
}
|
|
8036
|
+
Me(s, (h) => {
|
|
8037
|
+
b || !A || (A.visible = h);
|
|
8038
|
+
}), Me(l, (h) => {
|
|
8039
|
+
b || !A || A.setWidth(`${h}em`);
|
|
8040
|
+
}), Me(o, (h) => {
|
|
8041
|
+
b || !A || A.setOffsetX(h);
|
|
8042
|
+
}), Me(i, (h) => {
|
|
8043
|
+
b || !A || A.setOffsetY(h);
|
|
8044
|
+
}), Me(a, (h) => {
|
|
8045
|
+
b || !A || A.setOffsetZ(h);
|
|
8031
8046
|
});
|
|
8032
|
-
function
|
|
8033
|
-
b || !
|
|
8047
|
+
function p() {
|
|
8048
|
+
b || !A || (A.setTitle(t.value), A.setItems([...n.value]));
|
|
8034
8049
|
}
|
|
8035
|
-
Me(t, () =>
|
|
8036
|
-
function I(
|
|
8037
|
-
n.value = n.value.filter((
|
|
8050
|
+
Me(t, () => p()), Me(n, () => p(), { deep: !0 });
|
|
8051
|
+
function I(h) {
|
|
8052
|
+
n.value = n.value.filter((f, v) => v !== h), p();
|
|
8038
8053
|
}
|
|
8039
8054
|
function w() {
|
|
8040
8055
|
!c.value.trim() || !d.value.trim() || (n.value = [
|
|
@@ -8045,56 +8060,56 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8045
8060
|
unit: u.value.trim() || void 0,
|
|
8046
8061
|
code: g.value.trim() || void 0
|
|
8047
8062
|
}
|
|
8048
|
-
],
|
|
8063
|
+
], p(), c.value = "", d.value = "", u.value = "", g.value = "");
|
|
8049
8064
|
}
|
|
8050
8065
|
return Me(
|
|
8051
8066
|
() => e.selectedObject,
|
|
8052
8067
|
() => {
|
|
8053
|
-
b = !0,
|
|
8068
|
+
b = !0, A = m(), A ? (t.value = A.getTitle(), n.value = A.getItems(), s.value = A.visible, i.value = A.getOffsetY(), o.value = A.getOffsetX(), a.value = A.getOffsetZ(), l.value = parseFloat(A.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "", d.value = "", u.value = "", g.value = "", setTimeout(() => {
|
|
8054
8069
|
b = !1;
|
|
8055
8070
|
}, 0);
|
|
8056
8071
|
},
|
|
8057
8072
|
{ immediate: !0 }
|
|
8058
|
-
), (
|
|
8073
|
+
), (h, f) => (H(), k("div", Kc, [
|
|
8059
8074
|
y("div", Zc, [
|
|
8060
|
-
|
|
8075
|
+
f[29] || (f[29] = y("label", null, "📊 数据面板", -1)),
|
|
8061
8076
|
y("div", Qc, [
|
|
8062
|
-
|
|
8077
|
+
f[14] || (f[14] = y("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
8063
8078
|
y("div", Jc, [
|
|
8064
8079
|
y("label", _c, [
|
|
8065
8080
|
j(y("input", {
|
|
8066
8081
|
type: "checkbox",
|
|
8067
|
-
"onUpdate:modelValue":
|
|
8082
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v)
|
|
8068
8083
|
}, null, 512), [
|
|
8069
8084
|
[Yi, s.value]
|
|
8070
8085
|
]),
|
|
8071
|
-
|
|
8086
|
+
f[13] || (f[13] = y("span", { class: "dp-toggle-slider" }, null, -1))
|
|
8072
8087
|
]),
|
|
8073
8088
|
y("span", $c, fe(s.value ? "显示中" : "已隐藏"), 1)
|
|
8074
8089
|
])
|
|
8075
8090
|
]),
|
|
8076
8091
|
y("div", eu, [
|
|
8077
|
-
|
|
8092
|
+
f[15] || (f[15] = y("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
8078
8093
|
j(y("input", {
|
|
8079
8094
|
type: "text",
|
|
8080
8095
|
class: "dp-input",
|
|
8081
|
-
"onUpdate:modelValue":
|
|
8096
|
+
"onUpdate:modelValue": f[1] || (f[1] = (v) => t.value = v),
|
|
8082
8097
|
placeholder: "面板标题"
|
|
8083
8098
|
}, null, 512), [
|
|
8084
8099
|
[W, t.value]
|
|
8085
8100
|
])
|
|
8086
8101
|
]),
|
|
8087
8102
|
y("div", tu, [
|
|
8088
|
-
|
|
8103
|
+
f[18] || (f[18] = y("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
8089
8104
|
y("div", su, [
|
|
8090
|
-
|
|
8105
|
+
f[16] || (f[16] = y("span", { class: "dp-range-label" }, "窄", -1)),
|
|
8091
8106
|
j(y("input", {
|
|
8092
8107
|
type: "range",
|
|
8093
8108
|
class: "dp-range",
|
|
8094
8109
|
min: "10",
|
|
8095
8110
|
max: "40",
|
|
8096
8111
|
step: "1",
|
|
8097
|
-
"onUpdate:modelValue":
|
|
8112
|
+
"onUpdate:modelValue": f[2] || (f[2] = (v) => l.value = v)
|
|
8098
8113
|
}, null, 512), [
|
|
8099
8114
|
[
|
|
8100
8115
|
W,
|
|
@@ -8103,21 +8118,21 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8103
8118
|
{ number: !0 }
|
|
8104
8119
|
]
|
|
8105
8120
|
]),
|
|
8106
|
-
|
|
8121
|
+
f[17] || (f[17] = y("span", { class: "dp-range-label" }, "宽", -1)),
|
|
8107
8122
|
y("span", nu, fe(l.value) + "em", 1)
|
|
8108
8123
|
])
|
|
8109
8124
|
]),
|
|
8110
8125
|
y("div", iu, [
|
|
8111
|
-
|
|
8126
|
+
f[21] || (f[21] = y("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
|
|
8112
8127
|
y("div", ou, [
|
|
8113
|
-
|
|
8128
|
+
f[19] || (f[19] = y("span", { class: "dp-range-label" }, "偏左", -1)),
|
|
8114
8129
|
j(y("input", {
|
|
8115
8130
|
type: "range",
|
|
8116
8131
|
class: "dp-range",
|
|
8117
8132
|
min: "-5",
|
|
8118
8133
|
max: "5",
|
|
8119
8134
|
step: "0.01",
|
|
8120
|
-
"onUpdate:modelValue":
|
|
8135
|
+
"onUpdate:modelValue": f[3] || (f[3] = (v) => o.value = v)
|
|
8121
8136
|
}, null, 512), [
|
|
8122
8137
|
[
|
|
8123
8138
|
W,
|
|
@@ -8126,11 +8141,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8126
8141
|
{ number: !0 }
|
|
8127
8142
|
]
|
|
8128
8143
|
]),
|
|
8129
|
-
|
|
8144
|
+
f[20] || (f[20] = y("span", { class: "dp-range-label" }, "偏右", -1)),
|
|
8130
8145
|
j(y("input", {
|
|
8131
8146
|
type: "number",
|
|
8132
8147
|
class: "dp-input dp-input-number",
|
|
8133
|
-
"onUpdate:modelValue":
|
|
8148
|
+
"onUpdate:modelValue": f[4] || (f[4] = (v) => o.value = v),
|
|
8134
8149
|
step: "0.01"
|
|
8135
8150
|
}, null, 512), [
|
|
8136
8151
|
[
|
|
@@ -8143,16 +8158,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8143
8158
|
])
|
|
8144
8159
|
]),
|
|
8145
8160
|
y("div", ru, [
|
|
8146
|
-
|
|
8161
|
+
f[24] || (f[24] = y("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
|
|
8147
8162
|
y("div", au, [
|
|
8148
|
-
|
|
8163
|
+
f[22] || (f[22] = y("span", { class: "dp-range-label" }, "偏下", -1)),
|
|
8149
8164
|
j(y("input", {
|
|
8150
8165
|
type: "range",
|
|
8151
8166
|
class: "dp-range",
|
|
8152
8167
|
min: "-5",
|
|
8153
8168
|
max: "5",
|
|
8154
8169
|
step: "0.01",
|
|
8155
|
-
"onUpdate:modelValue":
|
|
8170
|
+
"onUpdate:modelValue": f[5] || (f[5] = (v) => i.value = v)
|
|
8156
8171
|
}, null, 512), [
|
|
8157
8172
|
[
|
|
8158
8173
|
W,
|
|
@@ -8161,11 +8176,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8161
8176
|
{ number: !0 }
|
|
8162
8177
|
]
|
|
8163
8178
|
]),
|
|
8164
|
-
|
|
8179
|
+
f[23] || (f[23] = y("span", { class: "dp-range-label" }, "偏上", -1)),
|
|
8165
8180
|
j(y("input", {
|
|
8166
8181
|
type: "number",
|
|
8167
8182
|
class: "dp-input dp-input-number",
|
|
8168
|
-
"onUpdate:modelValue":
|
|
8183
|
+
"onUpdate:modelValue": f[6] || (f[6] = (v) => i.value = v),
|
|
8169
8184
|
step: "0.01"
|
|
8170
8185
|
}, null, 512), [
|
|
8171
8186
|
[
|
|
@@ -8178,16 +8193,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8178
8193
|
])
|
|
8179
8194
|
]),
|
|
8180
8195
|
y("div", lu, [
|
|
8181
|
-
|
|
8196
|
+
f[27] || (f[27] = y("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
|
|
8182
8197
|
y("div", cu, [
|
|
8183
|
-
|
|
8198
|
+
f[25] || (f[25] = y("span", { class: "dp-range-label" }, "近", -1)),
|
|
8184
8199
|
j(y("input", {
|
|
8185
8200
|
type: "range",
|
|
8186
8201
|
class: "dp-range",
|
|
8187
8202
|
min: "-5",
|
|
8188
8203
|
max: "5",
|
|
8189
8204
|
step: "0.01",
|
|
8190
|
-
"onUpdate:modelValue":
|
|
8205
|
+
"onUpdate:modelValue": f[7] || (f[7] = (v) => a.value = v)
|
|
8191
8206
|
}, null, 512), [
|
|
8192
8207
|
[
|
|
8193
8208
|
W,
|
|
@@ -8196,11 +8211,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8196
8211
|
{ number: !0 }
|
|
8197
8212
|
]
|
|
8198
8213
|
]),
|
|
8199
|
-
|
|
8214
|
+
f[26] || (f[26] = y("span", { class: "dp-range-label" }, "远", -1)),
|
|
8200
8215
|
j(y("input", {
|
|
8201
8216
|
type: "number",
|
|
8202
8217
|
class: "dp-input dp-input-number",
|
|
8203
|
-
"onUpdate:modelValue":
|
|
8218
|
+
"onUpdate:modelValue": f[8] || (f[8] = (v) => a.value = v),
|
|
8204
8219
|
step: "0.01"
|
|
8205
8220
|
}, null, 512), [
|
|
8206
8221
|
[
|
|
@@ -8213,7 +8228,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8213
8228
|
])
|
|
8214
8229
|
]),
|
|
8215
8230
|
y("div", uu, [
|
|
8216
|
-
|
|
8231
|
+
f[28] || (f[28] = y("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
8217
8232
|
y("div", du, [
|
|
8218
8233
|
(H(!0), k(Ee, null, At(n.value, (v, D) => (H(), k("div", {
|
|
8219
8234
|
key: D,
|
|
@@ -8262,7 +8277,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8262
8277
|
j(y("input", {
|
|
8263
8278
|
type: "text",
|
|
8264
8279
|
class: "dp-input dp-input-sm",
|
|
8265
|
-
"onUpdate:modelValue":
|
|
8280
|
+
"onUpdate:modelValue": f[9] || (f[9] = (v) => c.value = v),
|
|
8266
8281
|
placeholder: "标签",
|
|
8267
8282
|
onKeyup: ut(w, ["enter"])
|
|
8268
8283
|
}, null, 544), [
|
|
@@ -8271,7 +8286,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8271
8286
|
j(y("input", {
|
|
8272
8287
|
type: "text",
|
|
8273
8288
|
class: "dp-input dp-input-sm",
|
|
8274
|
-
"onUpdate:modelValue":
|
|
8289
|
+
"onUpdate:modelValue": f[10] || (f[10] = (v) => d.value = v),
|
|
8275
8290
|
placeholder: "值",
|
|
8276
8291
|
onKeyup: ut(w, ["enter"])
|
|
8277
8292
|
}, null, 544), [
|
|
@@ -8280,7 +8295,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8280
8295
|
j(y("input", {
|
|
8281
8296
|
type: "text",
|
|
8282
8297
|
class: "dp-input dp-input-xs",
|
|
8283
|
-
"onUpdate:modelValue":
|
|
8298
|
+
"onUpdate:modelValue": f[11] || (f[11] = (v) => u.value = v),
|
|
8284
8299
|
placeholder: "单位",
|
|
8285
8300
|
onKeyup: ut(w, ["enter"])
|
|
8286
8301
|
}, null, 544), [
|
|
@@ -8289,7 +8304,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8289
8304
|
j(y("input", {
|
|
8290
8305
|
type: "text",
|
|
8291
8306
|
class: "dp-input dp-input-xs",
|
|
8292
|
-
"onUpdate:modelValue":
|
|
8307
|
+
"onUpdate:modelValue": f[12] || (f[12] = (v) => g.value = v),
|
|
8293
8308
|
placeholder: "编码",
|
|
8294
8309
|
onKeyup: ut(w, ["enter"])
|
|
8295
8310
|
}, null, 544), [
|
|
@@ -8365,7 +8380,7 @@ const Iu = {
|
|
|
8365
8380
|
return !!(t.selectedObject && ((w = t.selectedObject.userData) != null && w._hasDataPanel));
|
|
8366
8381
|
}), c = G(0), d = Ki(t, "selectedObject"), { expandedSet: u, toggleExpand: g } = xu(d);
|
|
8367
8382
|
Zi("treeExpand", { expandedSet: u, toggleExpand: g });
|
|
8368
|
-
const
|
|
8383
|
+
const A = (w) => {
|
|
8369
8384
|
c.value++, n("treeDelete", w);
|
|
8370
8385
|
}, b = () => {
|
|
8371
8386
|
Na({
|
|
@@ -8376,83 +8391,83 @@ if (selectedObject) {
|
|
|
8376
8391
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
|
|
8377
8392
|
}`
|
|
8378
8393
|
});
|
|
8379
|
-
}, m = (w) => Ha(w),
|
|
8394
|
+
}, m = (w) => Ha(w), p = G("");
|
|
8380
8395
|
Me(
|
|
8381
8396
|
() => t.selectedObject,
|
|
8382
8397
|
(w) => {
|
|
8383
|
-
|
|
8398
|
+
p.value = (w == null ? void 0 : w.name) ?? "";
|
|
8384
8399
|
},
|
|
8385
8400
|
{ immediate: !0 }
|
|
8386
8401
|
);
|
|
8387
8402
|
const I = () => {
|
|
8388
8403
|
if (!t.selectedObject) return;
|
|
8389
|
-
const w =
|
|
8390
|
-
t.selectedObject.name = w || "未命名",
|
|
8404
|
+
const w = p.value.trim();
|
|
8405
|
+
t.selectedObject.name = w || "未命名", p.value = t.selectedObject.name, c.value++;
|
|
8391
8406
|
};
|
|
8392
|
-
return (w,
|
|
8407
|
+
return (w, h) => w.transform ? (H(), k("div", Iu, [
|
|
8393
8408
|
y("div", Cu, [
|
|
8394
|
-
|
|
8409
|
+
h[8] || (h[8] = y("label", null, "场景物体", -1)),
|
|
8395
8410
|
y("div", wu, [
|
|
8396
|
-
(H(!0), k(Ee, null, At(w.treeData, (
|
|
8397
|
-
key:
|
|
8398
|
-
node:
|
|
8411
|
+
(H(!0), k(Ee, null, At(w.treeData, (f) => (H(), vt(zl, {
|
|
8412
|
+
key: f.uuid,
|
|
8413
|
+
node: f,
|
|
8399
8414
|
"selected-object": w.selectedObject,
|
|
8400
8415
|
version: c.value,
|
|
8401
|
-
onSelect:
|
|
8402
|
-
onDelete:
|
|
8416
|
+
onSelect: h[0] || (h[0] = (v) => n("treeSelect", v)),
|
|
8417
|
+
onDelete: A
|
|
8403
8418
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
8404
8419
|
w.treeData.length === 0 ? (H(), k("div", vu, "暂无物体")) : re("", !0)
|
|
8405
8420
|
])
|
|
8406
8421
|
]),
|
|
8407
8422
|
y("div", Mu, [
|
|
8408
|
-
|
|
8423
|
+
h[10] || (h[10] = y("label", null, "全局属性", -1)),
|
|
8409
8424
|
y("div", Tu, [
|
|
8410
8425
|
y("button", {
|
|
8411
8426
|
class: Pe(["mode-btn", { active: s.value === "translate" }]),
|
|
8412
8427
|
title: "移动 (W)",
|
|
8413
|
-
onClick:
|
|
8428
|
+
onClick: h[1] || (h[1] = (f) => i("translate"))
|
|
8414
8429
|
}, " ↕ 移动 ", 2),
|
|
8415
8430
|
y("button", {
|
|
8416
8431
|
class: Pe(["mode-btn", { active: s.value === "rotate" }]),
|
|
8417
8432
|
title: "旋转 (E)",
|
|
8418
|
-
onClick:
|
|
8433
|
+
onClick: h[2] || (h[2] = (f) => i("rotate"))
|
|
8419
8434
|
}, " ↻ 旋转 ", 2),
|
|
8420
8435
|
y("button", {
|
|
8421
8436
|
class: Pe(["mode-btn", { active: s.value === "scale" }]),
|
|
8422
8437
|
title: "缩放 (R)",
|
|
8423
|
-
onClick:
|
|
8438
|
+
onClick: h[3] || (h[3] = (f) => i("scale"))
|
|
8424
8439
|
}, " ⤡ 缩放 ", 2)
|
|
8425
8440
|
]),
|
|
8426
8441
|
y("div", Eu, [
|
|
8427
8442
|
y("div", { class: "script-editor-header" }, [
|
|
8428
|
-
|
|
8443
|
+
h[9] || (h[9] = y("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
|
|
8429
8444
|
y("button", {
|
|
8430
8445
|
class: "add-script-btn",
|
|
8431
8446
|
onClick: b,
|
|
8432
8447
|
title: "新增一个脚本"
|
|
8433
8448
|
}, " + 添加脚本 ")
|
|
8434
8449
|
]),
|
|
8435
|
-
(H(!0), k(Ee, null, At(ns(Se).scripts, (
|
|
8436
|
-
key:
|
|
8450
|
+
(H(!0), k(Ee, null, At(ns(Se).scripts, (f) => (H(), k("div", {
|
|
8451
|
+
key: f.id,
|
|
8437
8452
|
class: "script-item"
|
|
8438
8453
|
}, [
|
|
8439
8454
|
y("div", Du, [
|
|
8440
8455
|
j(y("input", {
|
|
8441
|
-
"onUpdate:modelValue": (v) =>
|
|
8456
|
+
"onUpdate:modelValue": (v) => f.name = v,
|
|
8442
8457
|
class: "script-name-input",
|
|
8443
8458
|
placeholder: "函数名称(按钮显示文字)",
|
|
8444
8459
|
spellcheck: "false"
|
|
8445
8460
|
}, null, 8, Ou), [
|
|
8446
|
-
[W,
|
|
8461
|
+
[W, f.name]
|
|
8447
8462
|
]),
|
|
8448
8463
|
y("button", {
|
|
8449
8464
|
class: "script-del-btn",
|
|
8450
8465
|
title: "删除该脚本",
|
|
8451
|
-
onClick: (v) => m(
|
|
8466
|
+
onClick: (v) => m(f.id)
|
|
8452
8467
|
}, "✕", 8, Ru)
|
|
8453
8468
|
]),
|
|
8454
8469
|
j(y("textarea", {
|
|
8455
|
-
"onUpdate:modelValue": (v) =>
|
|
8470
|
+
"onUpdate:modelValue": (v) => f.code = v,
|
|
8456
8471
|
class: "script-code-input",
|
|
8457
8472
|
rows: "6",
|
|
8458
8473
|
spellcheck: "false",
|
|
@@ -8480,37 +8495,37 @@ function myFunc() {
|
|
|
8480
8495
|
动画 API:animateTo / moveTo / rotateTo / scaleTo / fadeTo / stopAnimations / degToRad
|
|
8481
8496
|
其他:addModel/removeModel/selectObject 等编辑器 API`
|
|
8482
8497
|
}, null, 8, Pu), [
|
|
8483
|
-
[W,
|
|
8498
|
+
[W, f.code]
|
|
8484
8499
|
])
|
|
8485
8500
|
]))), 128)),
|
|
8486
8501
|
ns(Se).scripts.length === 0 ? (H(), k("div", Su, " 暂无脚本,点击“+ 添加脚本”创建(画布底部会为每个脚本生成一个触发按钮) ")) : re("", !0)
|
|
8487
8502
|
])
|
|
8488
8503
|
]),
|
|
8489
8504
|
w.selectedObject ? (H(), k("div", Lu, [
|
|
8490
|
-
|
|
8505
|
+
h[11] || (h[11] = y("label", null, "物体名称", -1)),
|
|
8491
8506
|
j(y("input", {
|
|
8492
|
-
"onUpdate:modelValue":
|
|
8507
|
+
"onUpdate:modelValue": h[4] || (h[4] = (f) => p.value = f),
|
|
8493
8508
|
class: "object-name-input",
|
|
8494
8509
|
placeholder: "输入名称,脚本中可用 scene.getObjectByName() 查找",
|
|
8495
8510
|
spellcheck: "false",
|
|
8496
8511
|
onChange: I
|
|
8497
8512
|
}, null, 544), [
|
|
8498
|
-
[W,
|
|
8513
|
+
[W, p.value]
|
|
8499
8514
|
])
|
|
8500
8515
|
])) : re("", !0),
|
|
8501
8516
|
w.selectedObject ? (H(), k("div", Nu, [
|
|
8502
8517
|
y("button", {
|
|
8503
8518
|
class: Pe(["tab-btn", { active: a.value === "transform" }]),
|
|
8504
|
-
onClick:
|
|
8519
|
+
onClick: h[5] || (h[5] = (f) => a.value = "transform")
|
|
8505
8520
|
}, " 🔄 变换 ", 2),
|
|
8506
8521
|
y("button", {
|
|
8507
8522
|
class: Pe(["tab-btn", { active: a.value === "userdata" }]),
|
|
8508
|
-
onClick:
|
|
8523
|
+
onClick: h[6] || (h[6] = (f) => a.value = "userdata")
|
|
8509
8524
|
}, " 📋 自定义数据 ", 2),
|
|
8510
8525
|
l.value ? (H(), k("button", {
|
|
8511
8526
|
key: 0,
|
|
8512
8527
|
class: Pe(["tab-btn", { active: a.value === "datapanel" }]),
|
|
8513
|
-
onClick:
|
|
8528
|
+
onClick: h[7] || (h[7] = (f) => a.value = "datapanel")
|
|
8514
8529
|
}, " 📊 数据面板 ", 2)) : re("", !0)
|
|
8515
8530
|
])) : re("", !0),
|
|
8516
8531
|
w.selectedObject ? (H(), k("div", Hu, [
|
|
@@ -8528,7 +8543,7 @@ function myFunc() {
|
|
|
8528
8543
|
[st, a.value === "datapanel"]
|
|
8529
8544
|
])
|
|
8530
8545
|
])) : re("", !0)
|
|
8531
|
-
])) : (H(), k("div", ku,
|
|
8546
|
+
])) : (H(), k("div", ku, h[12] || (h[12] = [
|
|
8532
8547
|
y("p", null, "未选中任何模型", -1)
|
|
8533
8548
|
])));
|
|
8534
8549
|
}
|
|
@@ -8540,23 +8555,23 @@ function myFunc() {
|
|
|
8540
8555
|
var m;
|
|
8541
8556
|
return (m = a.value) == null ? void 0 : m.click();
|
|
8542
8557
|
}, c = (m) => {
|
|
8543
|
-
const
|
|
8544
|
-
|
|
8558
|
+
const p = m.target;
|
|
8559
|
+
p.files && p.files.length > 0 && (o("importModel", p.files[0]), p.value = "");
|
|
8545
8560
|
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), g = async () => {
|
|
8546
8561
|
const m = await Il();
|
|
8547
8562
|
console.log("scene GLB 字节数:", m.scene.byteLength), console.log("camera:", m.camera), console.log("dataPanels:", m.dataPanels), console.log("waters:", m.waters), console.log("textures:", m.textures), console.log("ambientLight:", m.ambientLight);
|
|
8548
|
-
},
|
|
8563
|
+
}, A = () => {
|
|
8549
8564
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8550
8565
|
gi(localStorage.getItem("test_id"));
|
|
8551
8566
|
}, b = () => fi();
|
|
8552
|
-
return (m,
|
|
8567
|
+
return (m, p) => (H(), k("div", Uu, [
|
|
8553
8568
|
y("div", zu, [
|
|
8554
8569
|
y("div", {
|
|
8555
8570
|
class: "dropdown-wrapper",
|
|
8556
|
-
onMouseenter:
|
|
8557
|
-
onMouseleave:
|
|
8571
|
+
onMouseenter: p[11] || (p[11] = (I) => n.value = !0),
|
|
8572
|
+
onMouseleave: p[12] || (p[12] = (I) => n.value = !1)
|
|
8558
8573
|
}, [
|
|
8559
|
-
|
|
8574
|
+
p[17] || (p[17] = y("button", { class: "menu-btn" }, "添加", -1)),
|
|
8560
8575
|
j(y("div", Wu, [
|
|
8561
8576
|
y("div", {
|
|
8562
8577
|
class: "menu-item",
|
|
@@ -8564,30 +8579,30 @@ function myFunc() {
|
|
|
8564
8579
|
}, "组"),
|
|
8565
8580
|
y("div", {
|
|
8566
8581
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8567
|
-
onMouseenter:
|
|
8568
|
-
onMouseleave:
|
|
8582
|
+
onMouseenter: p[5] || (p[5] = (I) => s.value = !0),
|
|
8583
|
+
onMouseleave: p[6] || (p[6] = (I) => s.value = !1)
|
|
8569
8584
|
}, [
|
|
8570
|
-
|
|
8585
|
+
p[15] || (p[15] = y("span", null, "网格", -1)),
|
|
8571
8586
|
j(y("div", Gu, [
|
|
8572
8587
|
y("div", {
|
|
8573
8588
|
class: "menu-item",
|
|
8574
|
-
onClick:
|
|
8589
|
+
onClick: p[0] || (p[0] = (I) => o("addModel", "box"))
|
|
8575
8590
|
}, " 正方体 "),
|
|
8576
8591
|
y("div", {
|
|
8577
8592
|
class: "menu-item",
|
|
8578
|
-
onClick:
|
|
8593
|
+
onClick: p[1] || (p[1] = (I) => o("addModel", "sphere"))
|
|
8579
8594
|
}, " 球体 "),
|
|
8580
8595
|
y("div", {
|
|
8581
8596
|
class: "menu-item",
|
|
8582
|
-
onClick:
|
|
8597
|
+
onClick: p[2] || (p[2] = (I) => o("addModel", "water"))
|
|
8583
8598
|
}, " 水体(Water.js) "),
|
|
8584
8599
|
y("div", {
|
|
8585
8600
|
class: "menu-item",
|
|
8586
|
-
onClick:
|
|
8601
|
+
onClick: p[3] || (p[3] = (I) => o("addModel", "waterCylinder"))
|
|
8587
8602
|
}, " 水体(圆柱) "),
|
|
8588
8603
|
y("div", {
|
|
8589
8604
|
class: "menu-item",
|
|
8590
|
-
onClick:
|
|
8605
|
+
onClick: p[4] || (p[4] = (I) => o("addModel", "waterPlane"))
|
|
8591
8606
|
}, " 水面(标准材质) "),
|
|
8592
8607
|
y("div", {
|
|
8593
8608
|
class: "menu-item",
|
|
@@ -8599,14 +8614,14 @@ function myFunc() {
|
|
|
8599
8614
|
], 32),
|
|
8600
8615
|
y("div", {
|
|
8601
8616
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8602
|
-
onMouseenter:
|
|
8603
|
-
onMouseleave:
|
|
8617
|
+
onMouseenter: p[8] || (p[8] = (I) => i.value = !0),
|
|
8618
|
+
onMouseleave: p[9] || (p[9] = (I) => i.value = !1)
|
|
8604
8619
|
}, [
|
|
8605
|
-
|
|
8620
|
+
p[16] || (p[16] = y("span", null, "光源", -1)),
|
|
8606
8621
|
j(y("div", Bu, [
|
|
8607
8622
|
y("div", {
|
|
8608
8623
|
class: "menu-item",
|
|
8609
|
-
onClick:
|
|
8624
|
+
onClick: p[7] || (p[7] = (I) => o("addModel", "directionalLight"))
|
|
8610
8625
|
}, " 平行光 ")
|
|
8611
8626
|
], 512), [
|
|
8612
8627
|
[st, i.value]
|
|
@@ -8618,7 +8633,7 @@ function myFunc() {
|
|
|
8618
8633
|
}, "摄像机"),
|
|
8619
8634
|
y("div", {
|
|
8620
8635
|
class: "menu-item",
|
|
8621
|
-
onClick:
|
|
8636
|
+
onClick: p[10] || (p[10] = (I) => o("addModel", "dataPanel"))
|
|
8622
8637
|
}, " 数据面板 ")
|
|
8623
8638
|
], 512), [
|
|
8624
8639
|
[st, n.value]
|
|
@@ -8626,10 +8641,10 @@ function myFunc() {
|
|
|
8626
8641
|
], 32),
|
|
8627
8642
|
y("div", {
|
|
8628
8643
|
class: "dropdown-wrapper",
|
|
8629
|
-
onMouseenter:
|
|
8630
|
-
onMouseleave:
|
|
8644
|
+
onMouseenter: p[13] || (p[13] = (I) => t.value = !0),
|
|
8645
|
+
onMouseleave: p[14] || (p[14] = (I) => t.value = !1)
|
|
8631
8646
|
}, [
|
|
8632
|
-
|
|
8647
|
+
p[19] || (p[19] = y("button", { class: "menu-btn" }, "帮助", -1)),
|
|
8633
8648
|
j(y("div", Xu, [
|
|
8634
8649
|
y("div", {
|
|
8635
8650
|
class: "menu-item",
|
|
@@ -8637,19 +8652,19 @@ function myFunc() {
|
|
|
8637
8652
|
}, "获取场景"),
|
|
8638
8653
|
y("div", {
|
|
8639
8654
|
class: "menu-item",
|
|
8640
|
-
onClick:
|
|
8655
|
+
onClick: A
|
|
8641
8656
|
}, "镜头拉近"),
|
|
8642
8657
|
y("div", {
|
|
8643
8658
|
class: "menu-item",
|
|
8644
8659
|
onClick: b
|
|
8645
8660
|
}, " 重置相机位置 "),
|
|
8646
|
-
|
|
8661
|
+
p[18] || (p[18] = y("div", { class: "menu-divider" }, null, -1))
|
|
8647
8662
|
], 512), [
|
|
8648
8663
|
[st, t.value]
|
|
8649
8664
|
])
|
|
8650
8665
|
], 32)
|
|
8651
8666
|
]),
|
|
8652
|
-
|
|
8667
|
+
p[20] || (p[20] = y("div", { class: "right-section" }, [
|
|
8653
8668
|
y("span", { class: "app-title" }, "3D 模型编辑器")
|
|
8654
8669
|
], -1)),
|
|
8655
8670
|
y("input", {
|
|
@@ -8688,53 +8703,53 @@ function myFunc() {
|
|
|
8688
8703
|
},
|
|
8689
8704
|
setup(r) {
|
|
8690
8705
|
const e = r, t = G(!1);
|
|
8691
|
-
_a((
|
|
8692
|
-
t.value =
|
|
8706
|
+
_a((h) => {
|
|
8707
|
+
t.value = h;
|
|
8693
8708
|
});
|
|
8694
8709
|
const n = Qs(null), s = ts({
|
|
8695
8710
|
position: { x: 0, y: 0, z: 0 },
|
|
8696
8711
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8697
8712
|
scale: { x: 1, y: 1, z: 1 }
|
|
8698
|
-
}), i = (
|
|
8699
|
-
s.position.x = Number(
|
|
8700
|
-
}, o = (
|
|
8701
|
-
|
|
8713
|
+
}), i = (h) => {
|
|
8714
|
+
s.position.x = Number(h.position.x.toFixed(3)), s.position.y = Number(h.position.y.toFixed(3)), s.position.z = Number(h.position.z.toFixed(3)), s.rotation.x = Number(h.rotation.x.toFixed(3)), s.rotation.y = Number(h.rotation.y.toFixed(3)), s.rotation.z = Number(h.rotation.z.toFixed(3)), s.scale.x = Number(h.scale.x.toFixed(3)), s.scale.y = Number(h.scale.y.toFixed(3)), s.scale.z = Number(h.scale.z.toFixed(3));
|
|
8715
|
+
}, o = (h) => {
|
|
8716
|
+
h.position.set(
|
|
8702
8717
|
s.position.x,
|
|
8703
8718
|
s.position.y,
|
|
8704
8719
|
s.position.z
|
|
8705
|
-
),
|
|
8720
|
+
), h.rotation.set(
|
|
8706
8721
|
s.rotation.x,
|
|
8707
8722
|
s.rotation.y,
|
|
8708
8723
|
s.rotation.z
|
|
8709
|
-
),
|
|
8724
|
+
), h.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
8710
8725
|
};
|
|
8711
|
-
al((
|
|
8712
|
-
n.value =
|
|
8713
|
-
}), ll((
|
|
8714
|
-
i(
|
|
8726
|
+
al((h) => {
|
|
8727
|
+
n.value = h, h && i(h);
|
|
8728
|
+
}), ll((h) => {
|
|
8729
|
+
i(h);
|
|
8715
8730
|
});
|
|
8716
8731
|
const a = () => {
|
|
8717
8732
|
if (n.value && (o(n.value), n.value.type === "DirectionalLight")) {
|
|
8718
|
-
const
|
|
8719
|
-
|
|
8733
|
+
const h = n.value.userData.helper;
|
|
8734
|
+
h && typeof h.update == "function" && h.update();
|
|
8720
8735
|
}
|
|
8721
|
-
}, l = (
|
|
8736
|
+
}, l = (h) => Fi(h), c = async (h) => {
|
|
8722
8737
|
try {
|
|
8723
|
-
await ji(
|
|
8724
|
-
} catch (
|
|
8725
|
-
console.error("导入失败:",
|
|
8738
|
+
await ji(h);
|
|
8739
|
+
} catch (f) {
|
|
8740
|
+
console.error("导入失败:", f), alert("导入失败:" + f.message);
|
|
8726
8741
|
}
|
|
8727
8742
|
}, d = Qs([]);
|
|
8728
|
-
cl((
|
|
8729
|
-
d.value =
|
|
8743
|
+
cl((h) => {
|
|
8744
|
+
d.value = h;
|
|
8730
8745
|
});
|
|
8731
8746
|
const u = () => {
|
|
8732
|
-
const
|
|
8733
|
-
|
|
8734
|
-
}, g = (
|
|
8735
|
-
Ai(
|
|
8736
|
-
}, m = (
|
|
8737
|
-
() => Se.scripts.filter((
|
|
8747
|
+
const h = wi();
|
|
8748
|
+
h && (d.value = h);
|
|
8749
|
+
}, g = (h) => ds(h), A = (h) => Ii(h.uuid), b = (h) => {
|
|
8750
|
+
Ai(h);
|
|
8751
|
+
}, m = (h) => Fa(h), p = tt(
|
|
8752
|
+
() => Se.scripts.filter((h) => !di(h))
|
|
8738
8753
|
), I = G(null), w = async () => {
|
|
8739
8754
|
I.value && await Wa(I.value, e.mode, e.sceneData), u();
|
|
8740
8755
|
};
|
|
@@ -8742,26 +8757,26 @@ function myFunc() {
|
|
|
8742
8757
|
w(), I.value && vr(I.value);
|
|
8743
8758
|
}), Ji(() => {
|
|
8744
8759
|
console.log("endset_three_editor destroy"), vl();
|
|
8745
|
-
}), (
|
|
8746
|
-
t.value ? (H(), k("div", Ju,
|
|
8760
|
+
}), (h, f) => (H(), k("div", Qu, [
|
|
8761
|
+
t.value ? (H(), k("div", Ju, f[0] || (f[0] = [
|
|
8747
8762
|
y("div", { class: "loading-spinner" }, null, -1),
|
|
8748
8763
|
y("div", { class: "loading-text" }, "加载中...", -1)
|
|
8749
8764
|
]))) : re("", !0),
|
|
8750
|
-
|
|
8765
|
+
h.mode === "edit" ? (H(), vt(qu, {
|
|
8751
8766
|
key: 1,
|
|
8752
8767
|
onAddModel: l,
|
|
8753
8768
|
onImportModel: c
|
|
8754
8769
|
})) : re("", !0),
|
|
8755
8770
|
y("div", {
|
|
8756
|
-
class: Pe(`editor-container editor-container-mode-${
|
|
8771
|
+
class: Pe(`editor-container editor-container-mode-${h.mode}`)
|
|
8757
8772
|
}, [
|
|
8758
8773
|
y("div", {
|
|
8759
|
-
class: Pe(`canvas canvas-mode-${
|
|
8774
|
+
class: Pe(`canvas canvas-mode-${h.mode}`),
|
|
8760
8775
|
ref_key: "containerRef",
|
|
8761
8776
|
ref: I
|
|
8762
8777
|
}, [
|
|
8763
|
-
|
|
8764
|
-
(H(!0), k(Ee, null, At(
|
|
8778
|
+
p.value.length > 0 ? (H(), k("div", _u, [
|
|
8779
|
+
(H(!0), k(Ee, null, At(p.value, (v, D) => (H(), k("button", {
|
|
8765
8780
|
key: v.id,
|
|
8766
8781
|
class: "script-trigger-btn",
|
|
8767
8782
|
title: v.code,
|
|
@@ -8769,18 +8784,18 @@ function myFunc() {
|
|
|
8769
8784
|
}, " ▶ " + fe(ns(Ua)(v, D)), 9, $u))), 128))
|
|
8770
8785
|
])) : re("", !0)
|
|
8771
8786
|
], 2),
|
|
8772
|
-
|
|
8787
|
+
h.mode === "edit" ? (H(), vt(Fu, {
|
|
8773
8788
|
key: 0,
|
|
8774
8789
|
transform: s,
|
|
8775
8790
|
"tree-data": d.value,
|
|
8776
8791
|
"selected-object": n.value,
|
|
8777
8792
|
onPropertyChange: a,
|
|
8778
8793
|
onTreeSelect: g,
|
|
8779
|
-
onTreeDelete:
|
|
8794
|
+
onTreeDelete: A,
|
|
8780
8795
|
onTransformModeChange: b
|
|
8781
8796
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : re("", !0)
|
|
8782
8797
|
], 2),
|
|
8783
|
-
|
|
8798
|
+
h.mode === "edit" ? (H(), vt(Zu, { key: 2 })) : re("", !0)
|
|
8784
8799
|
]));
|
|
8785
8800
|
}
|
|
8786
8801
|
}), bd = /* @__PURE__ */ Qe(ed, [["__scopeId", "data-v-1237aaa7"]]);
|