endset_three_editor 0.10.13 → 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
|
}
|
|
@@ -5304,7 +5304,7 @@ function el(r) {
|
|
|
5304
5304
|
), n = new O.Raycaster();
|
|
5305
5305
|
n.setFromCamera(t, C.camera);
|
|
5306
5306
|
const s = [], i = (a) => {
|
|
5307
|
-
a.isTransformControlsRoot || ((a.userData.isMovable || a.userData.type === "lightHelper") && s.push(a), a.children.forEach(i));
|
|
5307
|
+
a.isTransformControlsRoot || a.isGridHelper || a.type === "Line" || a.type === "LineSegments" || ((a.userData.isMovable || a.userData.type === "lightHelper") && s.push(a), a.children.forEach(i));
|
|
5308
5308
|
};
|
|
5309
5309
|
i(C.scene);
|
|
5310
5310
|
const o = n.intersectObjects(s);
|
|
@@ -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,16 +5838,16 @@ 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
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),
|
|
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) {
|
|
@@ -5858,14 +5858,25 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5858
5858
|
const f = Jt(C.renderer);
|
|
5859
5859
|
f ? (C.scene.environment = f, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5860
5860
|
}
|
|
5861
|
-
bi(
|
|
5862
|
-
const w = (
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
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);
|
|
5867
5878
|
};
|
|
5868
|
-
|
|
5879
|
+
h(p);
|
|
5869
5880
|
} else {
|
|
5870
5881
|
const m = typeof r == "string" ? JSON.parse(r) : r, I = new O.ObjectLoader().parse(m);
|
|
5871
5882
|
if (I.type === "Scene") {
|
|
@@ -5873,14 +5884,14 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5873
5884
|
if (C.scene = I, w)
|
|
5874
5885
|
C.scene.environment = w, C.scene.environmentIntensity = 1;
|
|
5875
5886
|
else if (C.renderer) {
|
|
5876
|
-
const
|
|
5877
|
-
|
|
5887
|
+
const h = Jt(C.renderer);
|
|
5888
|
+
h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
|
|
5878
5889
|
}
|
|
5879
5890
|
} else
|
|
5880
5891
|
(u = C.scene) == null || u.add(I);
|
|
5881
5892
|
}
|
|
5882
5893
|
if (t && ((g = C.scene) == null || g.traverse((m) => {
|
|
5883
|
-
const
|
|
5894
|
+
const p = m.userData.id || m.userData._sourceUuid || m.uuid, I = t[p];
|
|
5884
5895
|
if (I && m.userData.isMovable) {
|
|
5885
5896
|
tl(m);
|
|
5886
5897
|
const w = new as({
|
|
@@ -5889,61 +5900,61 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5889
5900
|
});
|
|
5890
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);
|
|
5891
5902
|
}
|
|
5892
|
-
})), 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 }) => {
|
|
5893
5904
|
for (const I of n) {
|
|
5894
5905
|
const w = I.geometryType || "box";
|
|
5895
|
-
let
|
|
5896
|
-
w === "cylinder" ?
|
|
5906
|
+
let h;
|
|
5907
|
+
w === "cylinder" ? h = p({
|
|
5897
5908
|
radiusTop: I.cylinderRadiusTop ?? 5,
|
|
5898
5909
|
radiusBottom: I.cylinderRadiusBottom ?? 5,
|
|
5899
5910
|
radialSegments: I.cylinderRadialSegments ?? 32,
|
|
5900
5911
|
height: 0.8,
|
|
5901
5912
|
color: I.color,
|
|
5902
5913
|
scale: 4
|
|
5903
|
-
}) :
|
|
5914
|
+
}) : h = m({
|
|
5904
5915
|
width: I.boxWidth ?? 10,
|
|
5905
5916
|
height: I.boxDepth ?? 10,
|
|
5906
5917
|
color: I.color,
|
|
5907
5918
|
scale: 4
|
|
5908
|
-
}),
|
|
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;
|
|
5909
5920
|
}
|
|
5910
5921
|
Ci();
|
|
5911
5922
|
}), s) {
|
|
5912
5923
|
const m = new O.TextureLoader();
|
|
5913
|
-
(
|
|
5914
|
-
if (
|
|
5915
|
-
const I =
|
|
5916
|
-
for (const
|
|
5917
|
-
if (
|
|
5918
|
-
const
|
|
5919
|
-
if (
|
|
5920
|
-
const v = m.load(
|
|
5921
|
-
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;
|
|
5922
5933
|
}
|
|
5923
|
-
if (
|
|
5924
|
-
const v = m.load(
|
|
5925
|
-
v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1),
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
),
|
|
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;
|
|
5929
5940
|
}
|
|
5930
|
-
if (
|
|
5931
|
-
const v = m.load(
|
|
5932
|
-
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;
|
|
5933
5944
|
}
|
|
5934
|
-
|
|
5945
|
+
h.needsUpdate = !0;
|
|
5935
5946
|
}
|
|
5936
5947
|
}
|
|
5937
5948
|
});
|
|
5938
5949
|
}
|
|
5939
5950
|
o && ka(o), e === "edit" && ((b = C.scene) == null || b.traverse((m) => {
|
|
5940
|
-
var
|
|
5951
|
+
var p, I;
|
|
5941
5952
|
if (m.type === "DirectionalLight") {
|
|
5942
5953
|
const w = m;
|
|
5943
5954
|
if (!w.userData.helper) {
|
|
5944
|
-
w.target.parent !== C.scene && (w.target.parent && w.target.parent.remove(w.target), w.target.position.set(0, 0, 0), (
|
|
5945
|
-
const
|
|
5946
|
-
|
|
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);
|
|
5947
5958
|
}
|
|
5948
5959
|
}
|
|
5949
5960
|
}));
|
|
@@ -6093,15 +6104,15 @@ function Ol() {
|
|
|
6093
6104
|
},
|
|
6094
6105
|
addFace: function(e, t, n, s, i, o, a, l, c) {
|
|
6095
6106
|
const d = this.vertices.length;
|
|
6096
|
-
let u = this.parseVertexIndex(e, d), g = this.parseVertexIndex(t, d),
|
|
6097
|
-
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 !== "") {
|
|
6098
6109
|
const b = this.normals.length;
|
|
6099
|
-
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);
|
|
6100
6111
|
} else
|
|
6101
|
-
this.addFaceNormal(u, g,
|
|
6112
|
+
this.addFaceNormal(u, g, A);
|
|
6102
6113
|
if (s !== void 0 && s !== "") {
|
|
6103
6114
|
const b = this.uvs.length;
|
|
6104
|
-
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;
|
|
6105
6116
|
} else
|
|
6106
6117
|
this.addDefaultUV();
|
|
6107
6118
|
},
|
|
@@ -6211,17 +6222,17 @@ class Rl extends Xs {
|
|
|
6211
6222
|
break;
|
|
6212
6223
|
}
|
|
6213
6224
|
} else if (d === "f") {
|
|
6214
|
-
const g = c.slice(1).trim().split(Nn),
|
|
6215
|
-
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++) {
|
|
6216
6227
|
const I = g[m];
|
|
6217
6228
|
if (I.length > 0) {
|
|
6218
6229
|
const w = I.split("/");
|
|
6219
|
-
|
|
6230
|
+
A.push(w);
|
|
6220
6231
|
}
|
|
6221
6232
|
}
|
|
6222
|
-
const b =
|
|
6223
|
-
for (let m = 1,
|
|
6224
|
-
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];
|
|
6225
6236
|
t.addFace(
|
|
6226
6237
|
b[0],
|
|
6227
6238
|
I[0],
|
|
@@ -6237,15 +6248,15 @@ class Rl extends Xs {
|
|
|
6237
6248
|
} else if (d === "l") {
|
|
6238
6249
|
const u = c.substring(1).trim().split(" ");
|
|
6239
6250
|
let g = [];
|
|
6240
|
-
const
|
|
6251
|
+
const A = [];
|
|
6241
6252
|
if (c.indexOf("/") === -1)
|
|
6242
6253
|
g = u;
|
|
6243
6254
|
else
|
|
6244
6255
|
for (let b = 0, m = u.length; b < m; b++) {
|
|
6245
|
-
const
|
|
6246
|
-
|
|
6256
|
+
const p = u[b].split("/");
|
|
6257
|
+
p[0] !== "" && g.push(p[0]), p[1] !== "" && A.push(p[1]);
|
|
6247
6258
|
}
|
|
6248
|
-
t.addLineGeometry(g,
|
|
6259
|
+
t.addLineGeometry(g, A);
|
|
6249
6260
|
} else if (d === "p") {
|
|
6250
6261
|
const g = c.slice(1).trim().split(" ");
|
|
6251
6262
|
t.addPointGeometry(g);
|
|
@@ -6275,35 +6286,35 @@ class Rl extends Xs {
|
|
|
6275
6286
|
const i = new Zt();
|
|
6276
6287
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
6277
6288
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
6278
|
-
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";
|
|
6279
6290
|
let b = !1;
|
|
6280
6291
|
if (d.vertices.length === 0) continue;
|
|
6281
6292
|
const m = new rt();
|
|
6282
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));
|
|
6283
|
-
const
|
|
6284
|
-
for (let w = 0,
|
|
6285
|
-
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;
|
|
6286
6297
|
let D = t.materials[v];
|
|
6287
6298
|
if (this.materials !== null) {
|
|
6288
|
-
if (D = this.materials.create(
|
|
6299
|
+
if (D = this.materials.create(f.name), g && D && !(D instanceof Mt)) {
|
|
6289
6300
|
const R = new Mt();
|
|
6290
6301
|
Et.prototype.copy.call(R, D), R.color.copy(D.color), D = R;
|
|
6291
|
-
} else if (
|
|
6302
|
+
} else if (A && D && !(D instanceof It)) {
|
|
6292
6303
|
const R = new It({ size: 10, sizeAttenuation: !1 });
|
|
6293
6304
|
Et.prototype.copy.call(R, D), R.color.copy(D.color), R.map = D.map, D = R;
|
|
6294
6305
|
}
|
|
6295
6306
|
}
|
|
6296
|
-
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);
|
|
6297
6308
|
}
|
|
6298
6309
|
let I;
|
|
6299
|
-
if (
|
|
6300
|
-
for (let w = 0,
|
|
6301
|
-
const
|
|
6302
|
-
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);
|
|
6303
6314
|
}
|
|
6304
|
-
g ? I = new Ss(m,
|
|
6315
|
+
g ? I = new Ss(m, p) : A ? I = new Kt(m, p) : I = new L(m, p);
|
|
6305
6316
|
} else
|
|
6306
|
-
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]);
|
|
6307
6318
|
I.name = c.name, i.add(I);
|
|
6308
6319
|
}
|
|
6309
6320
|
else if (t.vertices.length > 0) {
|
|
@@ -6524,10 +6535,10 @@ function Sl() {
|
|
|
6524
6535
|
e.then((d) => {
|
|
6525
6536
|
const u = d.draco, g = new u.Decoder();
|
|
6526
6537
|
try {
|
|
6527
|
-
const
|
|
6528
|
-
|
|
6529
|
-
} catch (
|
|
6530
|
-
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 });
|
|
6531
6542
|
} finally {
|
|
6532
6543
|
u.destroy(g);
|
|
6533
6544
|
}
|
|
@@ -6537,57 +6548,57 @@ function Sl() {
|
|
|
6537
6548
|
};
|
|
6538
6549
|
function t(o, a, l, c) {
|
|
6539
6550
|
const d = c.attributeIDs, u = c.attributeTypes;
|
|
6540
|
-
let g,
|
|
6551
|
+
let g, A;
|
|
6541
6552
|
const b = a.GetEncodedGeometryType(l);
|
|
6542
6553
|
if (b === o.TRIANGULAR_MESH)
|
|
6543
|
-
g = new o.Mesh(),
|
|
6554
|
+
g = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, g);
|
|
6544
6555
|
else if (b === o.POINT_CLOUD)
|
|
6545
|
-
g = new o.PointCloud(),
|
|
6556
|
+
g = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, g);
|
|
6546
6557
|
else
|
|
6547
6558
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
6548
|
-
if (!
|
|
6549
|
-
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());
|
|
6550
6561
|
const m = { index: null, attributes: [] };
|
|
6551
|
-
for (const
|
|
6552
|
-
const I = self[u[
|
|
6553
|
-
let w,
|
|
6562
|
+
for (const p in d) {
|
|
6563
|
+
const I = self[u[p]];
|
|
6564
|
+
let w, h;
|
|
6554
6565
|
if (c.useUniqueIDs)
|
|
6555
|
-
|
|
6566
|
+
h = d[p], w = a.GetAttributeByUniqueId(g, h);
|
|
6556
6567
|
else {
|
|
6557
|
-
if (
|
|
6558
|
-
w = a.GetAttribute(g,
|
|
6568
|
+
if (h = a.GetAttributeId(g, o[d[p]]), h === -1) continue;
|
|
6569
|
+
w = a.GetAttribute(g, h);
|
|
6559
6570
|
}
|
|
6560
|
-
const
|
|
6561
|
-
|
|
6571
|
+
const f = s(o, a, g, p, I, w);
|
|
6572
|
+
p === "color" && (f.vertexColorSpace = c.vertexColorSpace), m.attributes.push(f);
|
|
6562
6573
|
}
|
|
6563
6574
|
return b === o.TRIANGULAR_MESH && (m.index = n(o, a, g)), o.destroy(g), m;
|
|
6564
6575
|
}
|
|
6565
6576
|
function n(o, a, l) {
|
|
6566
6577
|
const d = l.num_faces() * 3, u = d * 4, g = o._malloc(u);
|
|
6567
6578
|
a.GetTrianglesUInt32Array(l, u, g);
|
|
6568
|
-
const
|
|
6569
|
-
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 };
|
|
6570
6581
|
}
|
|
6571
6582
|
function s(o, a, l, c, d, u) {
|
|
6572
|
-
const g = l.num_points(),
|
|
6573
|
-
a.GetAttributeDataArrayForAllPoints(l, u, b, w,
|
|
6574
|
-
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);
|
|
6575
6586
|
let D;
|
|
6576
|
-
if (m ===
|
|
6587
|
+
if (m === p)
|
|
6577
6588
|
D = v.slice();
|
|
6578
6589
|
else {
|
|
6579
|
-
D = new d(
|
|
6590
|
+
D = new d(h / d.BYTES_PER_ELEMENT);
|
|
6580
6591
|
let R = 0;
|
|
6581
6592
|
for (let T = 0, Y = v.length; T < Y; T++) {
|
|
6582
|
-
for (let $ = 0; $ <
|
|
6583
|
-
D[R + $] = v[T *
|
|
6593
|
+
for (let $ = 0; $ < A; $++)
|
|
6594
|
+
D[R + $] = v[T * A + $];
|
|
6584
6595
|
R += I;
|
|
6585
6596
|
}
|
|
6586
6597
|
}
|
|
6587
|
-
return o._free(
|
|
6598
|
+
return o._free(f), {
|
|
6588
6599
|
name: c,
|
|
6589
6600
|
count: g,
|
|
6590
|
-
itemSize:
|
|
6601
|
+
itemSize: A,
|
|
6591
6602
|
array: D,
|
|
6592
6603
|
stride: I
|
|
6593
6604
|
};
|
|
@@ -6620,7 +6631,7 @@ class Ll extends L {
|
|
|
6620
6631
|
*/
|
|
6621
6632
|
constructor(e, t = {}) {
|
|
6622
6633
|
super(e), this.isWater = !0;
|
|
6623
|
-
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 = {
|
|
6624
6635
|
name: "MirrorShader",
|
|
6625
6636
|
uniforms: is.merge([
|
|
6626
6637
|
on.fog,
|
|
@@ -6750,11 +6761,11 @@ class Ll extends L {
|
|
|
6750
6761
|
fragmentShader: Z.fragmentShader,
|
|
6751
6762
|
lights: !0,
|
|
6752
6763
|
side: m,
|
|
6753
|
-
fog:
|
|
6764
|
+
fog: p
|
|
6754
6765
|
});
|
|
6755
|
-
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 =
|
|
6756
|
-
if (
|
|
6757
|
-
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(
|
|
6758
6769
|
0.5,
|
|
6759
6770
|
0,
|
|
6760
6771
|
0,
|
|
@@ -6771,9 +6782,9 @@ class Ll extends L {
|
|
|
6771
6782
|
0,
|
|
6772
6783
|
0,
|
|
6773
6784
|
1
|
|
6774
|
-
), 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);
|
|
6775
6786
|
const B = ne.projectionMatrix;
|
|
6776
|
-
$.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);
|
|
6777
6788
|
const be = U.getRenderTarget(), Oe = U.xr.enabled, Re = U.shadowMap.autoUpdate;
|
|
6778
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);
|
|
6779
6790
|
const Xe = _.viewport;
|
|
@@ -6847,13 +6858,13 @@ function Hi(r) {
|
|
|
6847
6858
|
repeatY: l = 4,
|
|
6848
6859
|
speedX: c = 5e-4,
|
|
6849
6860
|
speedY: d = 5e-4
|
|
6850
|
-
} = r || {}, u = new O.PlaneGeometry(e, t),
|
|
6851
|
-
|
|
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;
|
|
6852
6863
|
}), b = new O.MeshStandardMaterial({
|
|
6853
6864
|
color: n,
|
|
6854
6865
|
roughness: s,
|
|
6855
6866
|
metalness: i,
|
|
6856
|
-
normalMap:
|
|
6867
|
+
normalMap: A,
|
|
6857
6868
|
normalScale: new O.Vector2(o, o),
|
|
6858
6869
|
side: O.DoubleSide,
|
|
6859
6870
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
@@ -6990,8 +7001,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6990
7001
|
m.stopPropagation(), n("select", t.node);
|
|
6991
7002
|
}, g = (m) => {
|
|
6992
7003
|
m.stopPropagation(), n("delete", t.node);
|
|
6993
|
-
},
|
|
6994
|
-
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) => {
|
|
6995
7006
|
const I = qi("TreeItem", !0);
|
|
6996
7007
|
return H(), k("div", {
|
|
6997
7008
|
class: "tree-node",
|
|
@@ -7005,9 +7016,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7005
7016
|
l.value ? (H(), k("span", {
|
|
7006
7017
|
key: 0,
|
|
7007
7018
|
class: "toggle-icon",
|
|
7008
|
-
onClick:
|
|
7019
|
+
onClick: p[0] || (p[0] = ss((w) => ns(o)(m.node.uuid), ["stop"]))
|
|
7009
7020
|
}, fe(a.value ? "▼" : "▶"), 1)) : (H(), k("span", Hl)),
|
|
7010
|
-
y("span", kl, fe(
|
|
7021
|
+
y("span", kl, fe(A(m.node)), 1),
|
|
7011
7022
|
y("span", jl, fe(b(m.node)), 1),
|
|
7012
7023
|
y("button", {
|
|
7013
7024
|
class: "tree-delete",
|
|
@@ -7020,8 +7031,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7020
7031
|
node: w,
|
|
7021
7032
|
"selected-object": m.selectedObject,
|
|
7022
7033
|
version: m.version,
|
|
7023
|
-
onSelect:
|
|
7024
|
-
onDelete:
|
|
7034
|
+
onSelect: p[1] || (p[1] = (h) => n("select", h)),
|
|
7035
|
+
onDelete: p[2] || (p[2] = (h) => n("delete", h))
|
|
7025
7036
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
7026
7037
|
])) : re("", !0)
|
|
7027
7038
|
], 512);
|
|
@@ -7089,16 +7100,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7089
7100
|
}), o = G("#ffffff"), a = G(!1), l = G(!1), c = G("");
|
|
7090
7101
|
let d = null;
|
|
7091
7102
|
const u = G(!1), g = G("");
|
|
7092
|
-
let p = null;
|
|
7093
|
-
const b = G(!1), m = G("");
|
|
7094
7103
|
let A = null;
|
|
7104
|
+
const b = G(!1), m = G("");
|
|
7105
|
+
let p = null;
|
|
7095
7106
|
const I = ts({
|
|
7096
7107
|
intensity: 1
|
|
7097
7108
|
});
|
|
7098
7109
|
function w() {
|
|
7099
7110
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = I.intensity);
|
|
7100
7111
|
}
|
|
7101
|
-
function
|
|
7112
|
+
function h(E) {
|
|
7102
7113
|
let x = null;
|
|
7103
7114
|
return E.traverse((M) => {
|
|
7104
7115
|
if (M.type === "Mesh" && !x) {
|
|
@@ -7111,7 +7122,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7111
7122
|
}
|
|
7112
7123
|
}), x;
|
|
7113
7124
|
}
|
|
7114
|
-
function
|
|
7125
|
+
function f(E) {
|
|
7115
7126
|
let x = null;
|
|
7116
7127
|
return E.traverse((M) => {
|
|
7117
7128
|
if (M.type === "Mesh" && !x) {
|
|
@@ -7166,7 +7177,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7166
7177
|
}
|
|
7167
7178
|
function Y(E) {
|
|
7168
7179
|
var M, S;
|
|
7169
|
-
const x =
|
|
7180
|
+
const x = h(E);
|
|
7170
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);
|
|
7171
7182
|
}
|
|
7172
7183
|
function $(E) {
|
|
@@ -7212,8 +7223,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7212
7223
|
}
|
|
7213
7224
|
function Z(E) {
|
|
7214
7225
|
var M;
|
|
7215
|
-
const x =
|
|
7216
|
-
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 = "");
|
|
7217
7228
|
}
|
|
7218
7229
|
function N(E) {
|
|
7219
7230
|
var F;
|
|
@@ -7234,7 +7245,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7234
7245
|
for (const X of me)
|
|
7235
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);
|
|
7236
7247
|
}
|
|
7237
|
-
}),
|
|
7248
|
+
}), A = F, u.value = !0, g.value = M;
|
|
7238
7249
|
}
|
|
7239
7250
|
function z() {
|
|
7240
7251
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
@@ -7243,12 +7254,12 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7243
7254
|
for (const S of M)
|
|
7244
7255
|
S.map && (S.map = null, S.userData && (delete S.userData._mapDataUrl, delete S.userData._mapFileName), S.needsUpdate = !0);
|
|
7245
7256
|
}
|
|
7246
|
-
}),
|
|
7257
|
+
}), A && (A.dispose(), A = null), u.value = !1, g.value = "");
|
|
7247
7258
|
}
|
|
7248
7259
|
function _(E) {
|
|
7249
7260
|
var M;
|
|
7250
|
-
const x =
|
|
7251
|
-
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);
|
|
7252
7263
|
}
|
|
7253
7264
|
function B(E) {
|
|
7254
7265
|
var F;
|
|
@@ -7269,7 +7280,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7269
7280
|
for (const X of me)
|
|
7270
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);
|
|
7271
7282
|
}
|
|
7272
|
-
}),
|
|
7283
|
+
}), p = F, b.value = !0, m.value = M;
|
|
7273
7284
|
}
|
|
7274
7285
|
function Oe() {
|
|
7275
7286
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
@@ -7278,7 +7289,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7278
7289
|
for (const S of M)
|
|
7279
7290
|
S.aoMap && (S.aoMap = null, S.userData && (delete S.userData._aoMapDataUrl, delete S.userData._aoMapFileName), S.needsUpdate = !0);
|
|
7280
7291
|
}
|
|
7281
|
-
}),
|
|
7292
|
+
}), p && (p.dispose(), p = null), b.value = !1, m.value = "");
|
|
7282
7293
|
}
|
|
7283
7294
|
function Re() {
|
|
7284
7295
|
if (!t.selectedObject) return;
|
|
@@ -7353,7 +7364,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7353
7364
|
() => t.selectedObject,
|
|
7354
7365
|
(E) => {
|
|
7355
7366
|
if (E) {
|
|
7356
|
-
const x =
|
|
7367
|
+
const x = f(E);
|
|
7357
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);
|
|
7358
7369
|
} else
|
|
7359
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 = "";
|
|
@@ -7819,61 +7830,61 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7819
7830
|
},
|
|
7820
7831
|
setup(r) {
|
|
7821
7832
|
const e = r, t = G(""), n = G(""), s = G(null), i = G(""), o = G(null), a = G([]);
|
|
7822
|
-
function l(
|
|
7823
|
-
if (
|
|
7824
|
-
if (
|
|
7825
|
-
if (Array.isArray(
|
|
7826
|
-
const
|
|
7827
|
-
return
|
|
7828
|
-
}
|
|
7829
|
-
function c(
|
|
7830
|
-
const
|
|
7831
|
-
if (
|
|
7832
|
-
for (const [v, D] of Object.entries(
|
|
7833
|
-
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({
|
|
7834
7845
|
key: v,
|
|
7835
7846
|
value: typeof D == "object" ? JSON.stringify(D) : String(D),
|
|
7836
7847
|
rawType: l(D)
|
|
7837
7848
|
});
|
|
7838
|
-
a.value =
|
|
7839
|
-
}
|
|
7840
|
-
function d(
|
|
7841
|
-
const
|
|
7842
|
-
if (
|
|
7843
|
-
if (
|
|
7844
|
-
if (
|
|
7845
|
-
if (
|
|
7846
|
-
const v = Number(
|
|
7847
|
-
if (
|
|
7848
|
-
return String(v) !==
|
|
7849
|
-
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("]"))
|
|
7850
7861
|
try {
|
|
7851
|
-
return JSON.parse(
|
|
7862
|
+
return JSON.parse(f);
|
|
7852
7863
|
} catch {
|
|
7853
7864
|
}
|
|
7854
|
-
return
|
|
7865
|
+
return f;
|
|
7855
7866
|
}
|
|
7856
7867
|
function u() {
|
|
7857
7868
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
7858
|
-
const
|
|
7859
|
-
if (
|
|
7869
|
+
const h = t.value.trim();
|
|
7870
|
+
if (h === "isMovable") {
|
|
7860
7871
|
t.value = "";
|
|
7861
7872
|
return;
|
|
7862
7873
|
}
|
|
7863
|
-
const
|
|
7864
|
-
e.selectedObject.userData[
|
|
7874
|
+
const f = d(n.value);
|
|
7875
|
+
e.selectedObject.userData[h] = f, c(e.selectedObject), t.value = "", n.value = "";
|
|
7865
7876
|
}
|
|
7866
|
-
function g(
|
|
7867
|
-
e.selectedObject && (delete e.selectedObject.userData[
|
|
7877
|
+
function g(h, f) {
|
|
7878
|
+
e.selectedObject && (delete e.selectedObject.userData[h], c(e.selectedObject));
|
|
7868
7879
|
}
|
|
7869
|
-
function
|
|
7870
|
-
return
|
|
7880
|
+
function A(h) {
|
|
7881
|
+
return h.length <= 28 ? h : h.substring(0, 28) + "…";
|
|
7871
7882
|
}
|
|
7872
|
-
function b(
|
|
7873
|
-
s.value =
|
|
7874
|
-
const
|
|
7875
|
-
if (!
|
|
7876
|
-
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];
|
|
7877
7888
|
try {
|
|
7878
7889
|
i.value = JSON.stringify(v, null, 2);
|
|
7879
7890
|
} catch {
|
|
@@ -7882,58 +7893,58 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7882
7893
|
m();
|
|
7883
7894
|
}
|
|
7884
7895
|
function m() {
|
|
7885
|
-
const
|
|
7886
|
-
if (!
|
|
7896
|
+
const h = i.value.trim();
|
|
7897
|
+
if (!h) {
|
|
7887
7898
|
o.value = null;
|
|
7888
7899
|
return;
|
|
7889
7900
|
}
|
|
7890
|
-
if (!
|
|
7901
|
+
if (!h.startsWith("{") && !h.startsWith("[")) {
|
|
7891
7902
|
o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
|
|
7892
7903
|
return;
|
|
7893
7904
|
}
|
|
7894
7905
|
try {
|
|
7895
|
-
JSON.parse(
|
|
7896
|
-
} catch (
|
|
7897
|
-
o.value = "JSON 格式错误:" +
|
|
7906
|
+
JSON.parse(h), o.value = null;
|
|
7907
|
+
} catch (f) {
|
|
7908
|
+
o.value = "JSON 格式错误:" + f.message;
|
|
7898
7909
|
}
|
|
7899
7910
|
}
|
|
7900
|
-
function
|
|
7901
|
-
const
|
|
7902
|
-
if (!
|
|
7911
|
+
function p(h) {
|
|
7912
|
+
const f = e.selectedObject;
|
|
7913
|
+
if (!f) return;
|
|
7903
7914
|
const v = i.value.trim();
|
|
7904
7915
|
try {
|
|
7905
7916
|
const D = JSON.parse(v);
|
|
7906
|
-
|
|
7917
|
+
f.userData[h] = D, c(f), s.value = null, i.value = "";
|
|
7907
7918
|
} catch {
|
|
7908
|
-
|
|
7919
|
+
f.userData[h] = v, c(f), s.value = null, i.value = "";
|
|
7909
7920
|
}
|
|
7910
7921
|
}
|
|
7911
7922
|
function I() {
|
|
7912
7923
|
s.value = null, i.value = "";
|
|
7913
7924
|
}
|
|
7914
7925
|
function w() {
|
|
7915
|
-
const
|
|
7916
|
-
if (!
|
|
7917
|
-
const
|
|
7918
|
-
|
|
7919
|
-
x:
|
|
7920
|
-
y:
|
|
7921
|
-
z:
|
|
7922
|
-
}, 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));
|
|
7923
7934
|
}
|
|
7924
7935
|
return Me(
|
|
7925
7936
|
() => e.selectedObject,
|
|
7926
|
-
(
|
|
7927
|
-
|
|
7937
|
+
(h) => {
|
|
7938
|
+
h ? c(h) : a.value = [], s.value = null, i.value = "";
|
|
7928
7939
|
},
|
|
7929
7940
|
{ immediate: !0 }
|
|
7930
|
-
), (
|
|
7941
|
+
), (h, f) => (H(), k("div", Sc, [
|
|
7931
7942
|
y("div", Lc, [
|
|
7932
|
-
|
|
7943
|
+
f[3] || (f[3] = y("label", null, "userData 属性", -1)),
|
|
7933
7944
|
y("div", Nc, [
|
|
7934
7945
|
j(y("input", {
|
|
7935
7946
|
type: "text",
|
|
7936
|
-
"onUpdate:modelValue":
|
|
7947
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => t.value = v),
|
|
7937
7948
|
placeholder: "属性名",
|
|
7938
7949
|
class: "ud-input",
|
|
7939
7950
|
onKeyup: ut(u, ["enter"])
|
|
@@ -7941,7 +7952,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7941
7952
|
[W, t.value]
|
|
7942
7953
|
]),
|
|
7943
7954
|
j(y("textarea", {
|
|
7944
|
-
"onUpdate:modelValue":
|
|
7955
|
+
"onUpdate:modelValue": f[1] || (f[1] = (v) => n.value = v),
|
|
7945
7956
|
placeholder: "值",
|
|
7946
7957
|
class: "ud-input ud-textarea",
|
|
7947
7958
|
onKeyup: ut(ss(u, ["prevent"]), ["enter"])
|
|
@@ -7965,7 +7976,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7965
7976
|
y("span", jc, fe(v.key), 1),
|
|
7966
7977
|
v.key === "isMovable" ? (H(), k("span", Fc, fe(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (H(), k(Ee, { key: 1 }, [
|
|
7967
7978
|
s.value !== v.key ? (H(), k(Ee, { key: 0 }, [
|
|
7968
|
-
y("span", Uc, fe(
|
|
7979
|
+
y("span", Uc, fe(A(v.value)), 1),
|
|
7969
7980
|
y("button", {
|
|
7970
7981
|
class: "ud-btn edit-json-btn",
|
|
7971
7982
|
title: "编辑对象",
|
|
@@ -7974,7 +7985,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7974
7985
|
], 64)) : (H(), k(Ee, { key: 1 }, [
|
|
7975
7986
|
o.value ? (H(), k("div", Wc, " ⚠ " + fe(o.value), 1)) : re("", !0),
|
|
7976
7987
|
j(y("textarea", {
|
|
7977
|
-
"onUpdate:modelValue":
|
|
7988
|
+
"onUpdate:modelValue": f[2] || (f[2] = (R) => i.value = R),
|
|
7978
7989
|
class: Pe(["ud-json-textarea", { "has-error": o.value }]),
|
|
7979
7990
|
rows: "3",
|
|
7980
7991
|
onInput: m
|
|
@@ -7985,7 +7996,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7985
7996
|
y("button", {
|
|
7986
7997
|
class: "ud-btn apply-btn",
|
|
7987
7998
|
title: "应用修改",
|
|
7988
|
-
onClick: (R) =>
|
|
7999
|
+
onClick: (R) => p(v.key)
|
|
7989
8000
|
}, " ✓ ", 8, Bc),
|
|
7990
8001
|
y("button", {
|
|
7991
8002
|
class: "ud-btn cancel-btn",
|
|
@@ -8017,28 +8028,28 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8017
8028
|
},
|
|
8018
8029
|
setup(r) {
|
|
8019
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("");
|
|
8020
|
-
let
|
|
8031
|
+
let A = m(), b = !1;
|
|
8021
8032
|
function m() {
|
|
8022
|
-
const
|
|
8023
|
-
return
|
|
8024
|
-
}
|
|
8025
|
-
Me(s, (
|
|
8026
|
-
b || !
|
|
8027
|
-
}), Me(l, (
|
|
8028
|
-
b || !
|
|
8029
|
-
}), Me(o, (
|
|
8030
|
-
b || !
|
|
8031
|
-
}), Me(i, (
|
|
8032
|
-
b || !
|
|
8033
|
-
}), Me(a, (
|
|
8034
|
-
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);
|
|
8035
8046
|
});
|
|
8036
|
-
function
|
|
8037
|
-
b || !
|
|
8047
|
+
function p() {
|
|
8048
|
+
b || !A || (A.setTitle(t.value), A.setItems([...n.value]));
|
|
8038
8049
|
}
|
|
8039
|
-
Me(t, () =>
|
|
8040
|
-
function I(
|
|
8041
|
-
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();
|
|
8042
8053
|
}
|
|
8043
8054
|
function w() {
|
|
8044
8055
|
!c.value.trim() || !d.value.trim() || (n.value = [
|
|
@@ -8049,56 +8060,56 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8049
8060
|
unit: u.value.trim() || void 0,
|
|
8050
8061
|
code: g.value.trim() || void 0
|
|
8051
8062
|
}
|
|
8052
|
-
],
|
|
8063
|
+
], p(), c.value = "", d.value = "", u.value = "", g.value = "");
|
|
8053
8064
|
}
|
|
8054
8065
|
return Me(
|
|
8055
8066
|
() => e.selectedObject,
|
|
8056
8067
|
() => {
|
|
8057
|
-
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(() => {
|
|
8058
8069
|
b = !1;
|
|
8059
8070
|
}, 0);
|
|
8060
8071
|
},
|
|
8061
8072
|
{ immediate: !0 }
|
|
8062
|
-
), (
|
|
8073
|
+
), (h, f) => (H(), k("div", Kc, [
|
|
8063
8074
|
y("div", Zc, [
|
|
8064
|
-
|
|
8075
|
+
f[29] || (f[29] = y("label", null, "📊 数据面板", -1)),
|
|
8065
8076
|
y("div", Qc, [
|
|
8066
|
-
|
|
8077
|
+
f[14] || (f[14] = y("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
8067
8078
|
y("div", Jc, [
|
|
8068
8079
|
y("label", _c, [
|
|
8069
8080
|
j(y("input", {
|
|
8070
8081
|
type: "checkbox",
|
|
8071
|
-
"onUpdate:modelValue":
|
|
8082
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v)
|
|
8072
8083
|
}, null, 512), [
|
|
8073
8084
|
[Yi, s.value]
|
|
8074
8085
|
]),
|
|
8075
|
-
|
|
8086
|
+
f[13] || (f[13] = y("span", { class: "dp-toggle-slider" }, null, -1))
|
|
8076
8087
|
]),
|
|
8077
8088
|
y("span", $c, fe(s.value ? "显示中" : "已隐藏"), 1)
|
|
8078
8089
|
])
|
|
8079
8090
|
]),
|
|
8080
8091
|
y("div", eu, [
|
|
8081
|
-
|
|
8092
|
+
f[15] || (f[15] = y("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
8082
8093
|
j(y("input", {
|
|
8083
8094
|
type: "text",
|
|
8084
8095
|
class: "dp-input",
|
|
8085
|
-
"onUpdate:modelValue":
|
|
8096
|
+
"onUpdate:modelValue": f[1] || (f[1] = (v) => t.value = v),
|
|
8086
8097
|
placeholder: "面板标题"
|
|
8087
8098
|
}, null, 512), [
|
|
8088
8099
|
[W, t.value]
|
|
8089
8100
|
])
|
|
8090
8101
|
]),
|
|
8091
8102
|
y("div", tu, [
|
|
8092
|
-
|
|
8103
|
+
f[18] || (f[18] = y("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
8093
8104
|
y("div", su, [
|
|
8094
|
-
|
|
8105
|
+
f[16] || (f[16] = y("span", { class: "dp-range-label" }, "窄", -1)),
|
|
8095
8106
|
j(y("input", {
|
|
8096
8107
|
type: "range",
|
|
8097
8108
|
class: "dp-range",
|
|
8098
8109
|
min: "10",
|
|
8099
8110
|
max: "40",
|
|
8100
8111
|
step: "1",
|
|
8101
|
-
"onUpdate:modelValue":
|
|
8112
|
+
"onUpdate:modelValue": f[2] || (f[2] = (v) => l.value = v)
|
|
8102
8113
|
}, null, 512), [
|
|
8103
8114
|
[
|
|
8104
8115
|
W,
|
|
@@ -8107,21 +8118,21 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8107
8118
|
{ number: !0 }
|
|
8108
8119
|
]
|
|
8109
8120
|
]),
|
|
8110
|
-
|
|
8121
|
+
f[17] || (f[17] = y("span", { class: "dp-range-label" }, "宽", -1)),
|
|
8111
8122
|
y("span", nu, fe(l.value) + "em", 1)
|
|
8112
8123
|
])
|
|
8113
8124
|
]),
|
|
8114
8125
|
y("div", iu, [
|
|
8115
|
-
|
|
8126
|
+
f[21] || (f[21] = y("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
|
|
8116
8127
|
y("div", ou, [
|
|
8117
|
-
|
|
8128
|
+
f[19] || (f[19] = y("span", { class: "dp-range-label" }, "偏左", -1)),
|
|
8118
8129
|
j(y("input", {
|
|
8119
8130
|
type: "range",
|
|
8120
8131
|
class: "dp-range",
|
|
8121
8132
|
min: "-5",
|
|
8122
8133
|
max: "5",
|
|
8123
8134
|
step: "0.01",
|
|
8124
|
-
"onUpdate:modelValue":
|
|
8135
|
+
"onUpdate:modelValue": f[3] || (f[3] = (v) => o.value = v)
|
|
8125
8136
|
}, null, 512), [
|
|
8126
8137
|
[
|
|
8127
8138
|
W,
|
|
@@ -8130,11 +8141,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8130
8141
|
{ number: !0 }
|
|
8131
8142
|
]
|
|
8132
8143
|
]),
|
|
8133
|
-
|
|
8144
|
+
f[20] || (f[20] = y("span", { class: "dp-range-label" }, "偏右", -1)),
|
|
8134
8145
|
j(y("input", {
|
|
8135
8146
|
type: "number",
|
|
8136
8147
|
class: "dp-input dp-input-number",
|
|
8137
|
-
"onUpdate:modelValue":
|
|
8148
|
+
"onUpdate:modelValue": f[4] || (f[4] = (v) => o.value = v),
|
|
8138
8149
|
step: "0.01"
|
|
8139
8150
|
}, null, 512), [
|
|
8140
8151
|
[
|
|
@@ -8147,16 +8158,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8147
8158
|
])
|
|
8148
8159
|
]),
|
|
8149
8160
|
y("div", ru, [
|
|
8150
|
-
|
|
8161
|
+
f[24] || (f[24] = y("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
|
|
8151
8162
|
y("div", au, [
|
|
8152
|
-
|
|
8163
|
+
f[22] || (f[22] = y("span", { class: "dp-range-label" }, "偏下", -1)),
|
|
8153
8164
|
j(y("input", {
|
|
8154
8165
|
type: "range",
|
|
8155
8166
|
class: "dp-range",
|
|
8156
8167
|
min: "-5",
|
|
8157
8168
|
max: "5",
|
|
8158
8169
|
step: "0.01",
|
|
8159
|
-
"onUpdate:modelValue":
|
|
8170
|
+
"onUpdate:modelValue": f[5] || (f[5] = (v) => i.value = v)
|
|
8160
8171
|
}, null, 512), [
|
|
8161
8172
|
[
|
|
8162
8173
|
W,
|
|
@@ -8165,11 +8176,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8165
8176
|
{ number: !0 }
|
|
8166
8177
|
]
|
|
8167
8178
|
]),
|
|
8168
|
-
|
|
8179
|
+
f[23] || (f[23] = y("span", { class: "dp-range-label" }, "偏上", -1)),
|
|
8169
8180
|
j(y("input", {
|
|
8170
8181
|
type: "number",
|
|
8171
8182
|
class: "dp-input dp-input-number",
|
|
8172
|
-
"onUpdate:modelValue":
|
|
8183
|
+
"onUpdate:modelValue": f[6] || (f[6] = (v) => i.value = v),
|
|
8173
8184
|
step: "0.01"
|
|
8174
8185
|
}, null, 512), [
|
|
8175
8186
|
[
|
|
@@ -8182,16 +8193,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8182
8193
|
])
|
|
8183
8194
|
]),
|
|
8184
8195
|
y("div", lu, [
|
|
8185
|
-
|
|
8196
|
+
f[27] || (f[27] = y("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
|
|
8186
8197
|
y("div", cu, [
|
|
8187
|
-
|
|
8198
|
+
f[25] || (f[25] = y("span", { class: "dp-range-label" }, "近", -1)),
|
|
8188
8199
|
j(y("input", {
|
|
8189
8200
|
type: "range",
|
|
8190
8201
|
class: "dp-range",
|
|
8191
8202
|
min: "-5",
|
|
8192
8203
|
max: "5",
|
|
8193
8204
|
step: "0.01",
|
|
8194
|
-
"onUpdate:modelValue":
|
|
8205
|
+
"onUpdate:modelValue": f[7] || (f[7] = (v) => a.value = v)
|
|
8195
8206
|
}, null, 512), [
|
|
8196
8207
|
[
|
|
8197
8208
|
W,
|
|
@@ -8200,11 +8211,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8200
8211
|
{ number: !0 }
|
|
8201
8212
|
]
|
|
8202
8213
|
]),
|
|
8203
|
-
|
|
8214
|
+
f[26] || (f[26] = y("span", { class: "dp-range-label" }, "远", -1)),
|
|
8204
8215
|
j(y("input", {
|
|
8205
8216
|
type: "number",
|
|
8206
8217
|
class: "dp-input dp-input-number",
|
|
8207
|
-
"onUpdate:modelValue":
|
|
8218
|
+
"onUpdate:modelValue": f[8] || (f[8] = (v) => a.value = v),
|
|
8208
8219
|
step: "0.01"
|
|
8209
8220
|
}, null, 512), [
|
|
8210
8221
|
[
|
|
@@ -8217,7 +8228,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8217
8228
|
])
|
|
8218
8229
|
]),
|
|
8219
8230
|
y("div", uu, [
|
|
8220
|
-
|
|
8231
|
+
f[28] || (f[28] = y("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
8221
8232
|
y("div", du, [
|
|
8222
8233
|
(H(!0), k(Ee, null, At(n.value, (v, D) => (H(), k("div", {
|
|
8223
8234
|
key: D,
|
|
@@ -8266,7 +8277,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8266
8277
|
j(y("input", {
|
|
8267
8278
|
type: "text",
|
|
8268
8279
|
class: "dp-input dp-input-sm",
|
|
8269
|
-
"onUpdate:modelValue":
|
|
8280
|
+
"onUpdate:modelValue": f[9] || (f[9] = (v) => c.value = v),
|
|
8270
8281
|
placeholder: "标签",
|
|
8271
8282
|
onKeyup: ut(w, ["enter"])
|
|
8272
8283
|
}, null, 544), [
|
|
@@ -8275,7 +8286,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8275
8286
|
j(y("input", {
|
|
8276
8287
|
type: "text",
|
|
8277
8288
|
class: "dp-input dp-input-sm",
|
|
8278
|
-
"onUpdate:modelValue":
|
|
8289
|
+
"onUpdate:modelValue": f[10] || (f[10] = (v) => d.value = v),
|
|
8279
8290
|
placeholder: "值",
|
|
8280
8291
|
onKeyup: ut(w, ["enter"])
|
|
8281
8292
|
}, null, 544), [
|
|
@@ -8284,7 +8295,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8284
8295
|
j(y("input", {
|
|
8285
8296
|
type: "text",
|
|
8286
8297
|
class: "dp-input dp-input-xs",
|
|
8287
|
-
"onUpdate:modelValue":
|
|
8298
|
+
"onUpdate:modelValue": f[11] || (f[11] = (v) => u.value = v),
|
|
8288
8299
|
placeholder: "单位",
|
|
8289
8300
|
onKeyup: ut(w, ["enter"])
|
|
8290
8301
|
}, null, 544), [
|
|
@@ -8293,7 +8304,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8293
8304
|
j(y("input", {
|
|
8294
8305
|
type: "text",
|
|
8295
8306
|
class: "dp-input dp-input-xs",
|
|
8296
|
-
"onUpdate:modelValue":
|
|
8307
|
+
"onUpdate:modelValue": f[12] || (f[12] = (v) => g.value = v),
|
|
8297
8308
|
placeholder: "编码",
|
|
8298
8309
|
onKeyup: ut(w, ["enter"])
|
|
8299
8310
|
}, null, 544), [
|
|
@@ -8369,7 +8380,7 @@ const Iu = {
|
|
|
8369
8380
|
return !!(t.selectedObject && ((w = t.selectedObject.userData) != null && w._hasDataPanel));
|
|
8370
8381
|
}), c = G(0), d = Ki(t, "selectedObject"), { expandedSet: u, toggleExpand: g } = xu(d);
|
|
8371
8382
|
Zi("treeExpand", { expandedSet: u, toggleExpand: g });
|
|
8372
|
-
const
|
|
8383
|
+
const A = (w) => {
|
|
8373
8384
|
c.value++, n("treeDelete", w);
|
|
8374
8385
|
}, b = () => {
|
|
8375
8386
|
Na({
|
|
@@ -8380,83 +8391,83 @@ if (selectedObject) {
|
|
|
8380
8391
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
|
|
8381
8392
|
}`
|
|
8382
8393
|
});
|
|
8383
|
-
}, m = (w) => Ha(w),
|
|
8394
|
+
}, m = (w) => Ha(w), p = G("");
|
|
8384
8395
|
Me(
|
|
8385
8396
|
() => t.selectedObject,
|
|
8386
8397
|
(w) => {
|
|
8387
|
-
|
|
8398
|
+
p.value = (w == null ? void 0 : w.name) ?? "";
|
|
8388
8399
|
},
|
|
8389
8400
|
{ immediate: !0 }
|
|
8390
8401
|
);
|
|
8391
8402
|
const I = () => {
|
|
8392
8403
|
if (!t.selectedObject) return;
|
|
8393
|
-
const w =
|
|
8394
|
-
t.selectedObject.name = w || "未命名",
|
|
8404
|
+
const w = p.value.trim();
|
|
8405
|
+
t.selectedObject.name = w || "未命名", p.value = t.selectedObject.name, c.value++;
|
|
8395
8406
|
};
|
|
8396
|
-
return (w,
|
|
8407
|
+
return (w, h) => w.transform ? (H(), k("div", Iu, [
|
|
8397
8408
|
y("div", Cu, [
|
|
8398
|
-
|
|
8409
|
+
h[8] || (h[8] = y("label", null, "场景物体", -1)),
|
|
8399
8410
|
y("div", wu, [
|
|
8400
|
-
(H(!0), k(Ee, null, At(w.treeData, (
|
|
8401
|
-
key:
|
|
8402
|
-
node:
|
|
8411
|
+
(H(!0), k(Ee, null, At(w.treeData, (f) => (H(), vt(zl, {
|
|
8412
|
+
key: f.uuid,
|
|
8413
|
+
node: f,
|
|
8403
8414
|
"selected-object": w.selectedObject,
|
|
8404
8415
|
version: c.value,
|
|
8405
|
-
onSelect:
|
|
8406
|
-
onDelete:
|
|
8416
|
+
onSelect: h[0] || (h[0] = (v) => n("treeSelect", v)),
|
|
8417
|
+
onDelete: A
|
|
8407
8418
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
8408
8419
|
w.treeData.length === 0 ? (H(), k("div", vu, "暂无物体")) : re("", !0)
|
|
8409
8420
|
])
|
|
8410
8421
|
]),
|
|
8411
8422
|
y("div", Mu, [
|
|
8412
|
-
|
|
8423
|
+
h[10] || (h[10] = y("label", null, "全局属性", -1)),
|
|
8413
8424
|
y("div", Tu, [
|
|
8414
8425
|
y("button", {
|
|
8415
8426
|
class: Pe(["mode-btn", { active: s.value === "translate" }]),
|
|
8416
8427
|
title: "移动 (W)",
|
|
8417
|
-
onClick:
|
|
8428
|
+
onClick: h[1] || (h[1] = (f) => i("translate"))
|
|
8418
8429
|
}, " ↕ 移动 ", 2),
|
|
8419
8430
|
y("button", {
|
|
8420
8431
|
class: Pe(["mode-btn", { active: s.value === "rotate" }]),
|
|
8421
8432
|
title: "旋转 (E)",
|
|
8422
|
-
onClick:
|
|
8433
|
+
onClick: h[2] || (h[2] = (f) => i("rotate"))
|
|
8423
8434
|
}, " ↻ 旋转 ", 2),
|
|
8424
8435
|
y("button", {
|
|
8425
8436
|
class: Pe(["mode-btn", { active: s.value === "scale" }]),
|
|
8426
8437
|
title: "缩放 (R)",
|
|
8427
|
-
onClick:
|
|
8438
|
+
onClick: h[3] || (h[3] = (f) => i("scale"))
|
|
8428
8439
|
}, " ⤡ 缩放 ", 2)
|
|
8429
8440
|
]),
|
|
8430
8441
|
y("div", Eu, [
|
|
8431
8442
|
y("div", { class: "script-editor-header" }, [
|
|
8432
|
-
|
|
8443
|
+
h[9] || (h[9] = y("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
|
|
8433
8444
|
y("button", {
|
|
8434
8445
|
class: "add-script-btn",
|
|
8435
8446
|
onClick: b,
|
|
8436
8447
|
title: "新增一个脚本"
|
|
8437
8448
|
}, " + 添加脚本 ")
|
|
8438
8449
|
]),
|
|
8439
|
-
(H(!0), k(Ee, null, At(ns(Se).scripts, (
|
|
8440
|
-
key:
|
|
8450
|
+
(H(!0), k(Ee, null, At(ns(Se).scripts, (f) => (H(), k("div", {
|
|
8451
|
+
key: f.id,
|
|
8441
8452
|
class: "script-item"
|
|
8442
8453
|
}, [
|
|
8443
8454
|
y("div", Du, [
|
|
8444
8455
|
j(y("input", {
|
|
8445
|
-
"onUpdate:modelValue": (v) =>
|
|
8456
|
+
"onUpdate:modelValue": (v) => f.name = v,
|
|
8446
8457
|
class: "script-name-input",
|
|
8447
8458
|
placeholder: "函数名称(按钮显示文字)",
|
|
8448
8459
|
spellcheck: "false"
|
|
8449
8460
|
}, null, 8, Ou), [
|
|
8450
|
-
[W,
|
|
8461
|
+
[W, f.name]
|
|
8451
8462
|
]),
|
|
8452
8463
|
y("button", {
|
|
8453
8464
|
class: "script-del-btn",
|
|
8454
8465
|
title: "删除该脚本",
|
|
8455
|
-
onClick: (v) => m(
|
|
8466
|
+
onClick: (v) => m(f.id)
|
|
8456
8467
|
}, "✕", 8, Ru)
|
|
8457
8468
|
]),
|
|
8458
8469
|
j(y("textarea", {
|
|
8459
|
-
"onUpdate:modelValue": (v) =>
|
|
8470
|
+
"onUpdate:modelValue": (v) => f.code = v,
|
|
8460
8471
|
class: "script-code-input",
|
|
8461
8472
|
rows: "6",
|
|
8462
8473
|
spellcheck: "false",
|
|
@@ -8484,37 +8495,37 @@ function myFunc() {
|
|
|
8484
8495
|
动画 API:animateTo / moveTo / rotateTo / scaleTo / fadeTo / stopAnimations / degToRad
|
|
8485
8496
|
其他:addModel/removeModel/selectObject 等编辑器 API`
|
|
8486
8497
|
}, null, 8, Pu), [
|
|
8487
|
-
[W,
|
|
8498
|
+
[W, f.code]
|
|
8488
8499
|
])
|
|
8489
8500
|
]))), 128)),
|
|
8490
8501
|
ns(Se).scripts.length === 0 ? (H(), k("div", Su, " 暂无脚本,点击“+ 添加脚本”创建(画布底部会为每个脚本生成一个触发按钮) ")) : re("", !0)
|
|
8491
8502
|
])
|
|
8492
8503
|
]),
|
|
8493
8504
|
w.selectedObject ? (H(), k("div", Lu, [
|
|
8494
|
-
|
|
8505
|
+
h[11] || (h[11] = y("label", null, "物体名称", -1)),
|
|
8495
8506
|
j(y("input", {
|
|
8496
|
-
"onUpdate:modelValue":
|
|
8507
|
+
"onUpdate:modelValue": h[4] || (h[4] = (f) => p.value = f),
|
|
8497
8508
|
class: "object-name-input",
|
|
8498
8509
|
placeholder: "输入名称,脚本中可用 scene.getObjectByName() 查找",
|
|
8499
8510
|
spellcheck: "false",
|
|
8500
8511
|
onChange: I
|
|
8501
8512
|
}, null, 544), [
|
|
8502
|
-
[W,
|
|
8513
|
+
[W, p.value]
|
|
8503
8514
|
])
|
|
8504
8515
|
])) : re("", !0),
|
|
8505
8516
|
w.selectedObject ? (H(), k("div", Nu, [
|
|
8506
8517
|
y("button", {
|
|
8507
8518
|
class: Pe(["tab-btn", { active: a.value === "transform" }]),
|
|
8508
|
-
onClick:
|
|
8519
|
+
onClick: h[5] || (h[5] = (f) => a.value = "transform")
|
|
8509
8520
|
}, " 🔄 变换 ", 2),
|
|
8510
8521
|
y("button", {
|
|
8511
8522
|
class: Pe(["tab-btn", { active: a.value === "userdata" }]),
|
|
8512
|
-
onClick:
|
|
8523
|
+
onClick: h[6] || (h[6] = (f) => a.value = "userdata")
|
|
8513
8524
|
}, " 📋 自定义数据 ", 2),
|
|
8514
8525
|
l.value ? (H(), k("button", {
|
|
8515
8526
|
key: 0,
|
|
8516
8527
|
class: Pe(["tab-btn", { active: a.value === "datapanel" }]),
|
|
8517
|
-
onClick:
|
|
8528
|
+
onClick: h[7] || (h[7] = (f) => a.value = "datapanel")
|
|
8518
8529
|
}, " 📊 数据面板 ", 2)) : re("", !0)
|
|
8519
8530
|
])) : re("", !0),
|
|
8520
8531
|
w.selectedObject ? (H(), k("div", Hu, [
|
|
@@ -8532,7 +8543,7 @@ function myFunc() {
|
|
|
8532
8543
|
[st, a.value === "datapanel"]
|
|
8533
8544
|
])
|
|
8534
8545
|
])) : re("", !0)
|
|
8535
|
-
])) : (H(), k("div", ku,
|
|
8546
|
+
])) : (H(), k("div", ku, h[12] || (h[12] = [
|
|
8536
8547
|
y("p", null, "未选中任何模型", -1)
|
|
8537
8548
|
])));
|
|
8538
8549
|
}
|
|
@@ -8544,23 +8555,23 @@ function myFunc() {
|
|
|
8544
8555
|
var m;
|
|
8545
8556
|
return (m = a.value) == null ? void 0 : m.click();
|
|
8546
8557
|
}, c = (m) => {
|
|
8547
|
-
const
|
|
8548
|
-
|
|
8558
|
+
const p = m.target;
|
|
8559
|
+
p.files && p.files.length > 0 && (o("importModel", p.files[0]), p.value = "");
|
|
8549
8560
|
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), g = async () => {
|
|
8550
8561
|
const m = await Il();
|
|
8551
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);
|
|
8552
|
-
},
|
|
8563
|
+
}, A = () => {
|
|
8553
8564
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8554
8565
|
gi(localStorage.getItem("test_id"));
|
|
8555
8566
|
}, b = () => fi();
|
|
8556
|
-
return (m,
|
|
8567
|
+
return (m, p) => (H(), k("div", Uu, [
|
|
8557
8568
|
y("div", zu, [
|
|
8558
8569
|
y("div", {
|
|
8559
8570
|
class: "dropdown-wrapper",
|
|
8560
|
-
onMouseenter:
|
|
8561
|
-
onMouseleave:
|
|
8571
|
+
onMouseenter: p[11] || (p[11] = (I) => n.value = !0),
|
|
8572
|
+
onMouseleave: p[12] || (p[12] = (I) => n.value = !1)
|
|
8562
8573
|
}, [
|
|
8563
|
-
|
|
8574
|
+
p[17] || (p[17] = y("button", { class: "menu-btn" }, "添加", -1)),
|
|
8564
8575
|
j(y("div", Wu, [
|
|
8565
8576
|
y("div", {
|
|
8566
8577
|
class: "menu-item",
|
|
@@ -8568,30 +8579,30 @@ function myFunc() {
|
|
|
8568
8579
|
}, "组"),
|
|
8569
8580
|
y("div", {
|
|
8570
8581
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8571
|
-
onMouseenter:
|
|
8572
|
-
onMouseleave:
|
|
8582
|
+
onMouseenter: p[5] || (p[5] = (I) => s.value = !0),
|
|
8583
|
+
onMouseleave: p[6] || (p[6] = (I) => s.value = !1)
|
|
8573
8584
|
}, [
|
|
8574
|
-
|
|
8585
|
+
p[15] || (p[15] = y("span", null, "网格", -1)),
|
|
8575
8586
|
j(y("div", Gu, [
|
|
8576
8587
|
y("div", {
|
|
8577
8588
|
class: "menu-item",
|
|
8578
|
-
onClick:
|
|
8589
|
+
onClick: p[0] || (p[0] = (I) => o("addModel", "box"))
|
|
8579
8590
|
}, " 正方体 "),
|
|
8580
8591
|
y("div", {
|
|
8581
8592
|
class: "menu-item",
|
|
8582
|
-
onClick:
|
|
8593
|
+
onClick: p[1] || (p[1] = (I) => o("addModel", "sphere"))
|
|
8583
8594
|
}, " 球体 "),
|
|
8584
8595
|
y("div", {
|
|
8585
8596
|
class: "menu-item",
|
|
8586
|
-
onClick:
|
|
8597
|
+
onClick: p[2] || (p[2] = (I) => o("addModel", "water"))
|
|
8587
8598
|
}, " 水体(Water.js) "),
|
|
8588
8599
|
y("div", {
|
|
8589
8600
|
class: "menu-item",
|
|
8590
|
-
onClick:
|
|
8601
|
+
onClick: p[3] || (p[3] = (I) => o("addModel", "waterCylinder"))
|
|
8591
8602
|
}, " 水体(圆柱) "),
|
|
8592
8603
|
y("div", {
|
|
8593
8604
|
class: "menu-item",
|
|
8594
|
-
onClick:
|
|
8605
|
+
onClick: p[4] || (p[4] = (I) => o("addModel", "waterPlane"))
|
|
8595
8606
|
}, " 水面(标准材质) "),
|
|
8596
8607
|
y("div", {
|
|
8597
8608
|
class: "menu-item",
|
|
@@ -8603,14 +8614,14 @@ function myFunc() {
|
|
|
8603
8614
|
], 32),
|
|
8604
8615
|
y("div", {
|
|
8605
8616
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8606
|
-
onMouseenter:
|
|
8607
|
-
onMouseleave:
|
|
8617
|
+
onMouseenter: p[8] || (p[8] = (I) => i.value = !0),
|
|
8618
|
+
onMouseleave: p[9] || (p[9] = (I) => i.value = !1)
|
|
8608
8619
|
}, [
|
|
8609
|
-
|
|
8620
|
+
p[16] || (p[16] = y("span", null, "光源", -1)),
|
|
8610
8621
|
j(y("div", Bu, [
|
|
8611
8622
|
y("div", {
|
|
8612
8623
|
class: "menu-item",
|
|
8613
|
-
onClick:
|
|
8624
|
+
onClick: p[7] || (p[7] = (I) => o("addModel", "directionalLight"))
|
|
8614
8625
|
}, " 平行光 ")
|
|
8615
8626
|
], 512), [
|
|
8616
8627
|
[st, i.value]
|
|
@@ -8622,7 +8633,7 @@ function myFunc() {
|
|
|
8622
8633
|
}, "摄像机"),
|
|
8623
8634
|
y("div", {
|
|
8624
8635
|
class: "menu-item",
|
|
8625
|
-
onClick:
|
|
8636
|
+
onClick: p[10] || (p[10] = (I) => o("addModel", "dataPanel"))
|
|
8626
8637
|
}, " 数据面板 ")
|
|
8627
8638
|
], 512), [
|
|
8628
8639
|
[st, n.value]
|
|
@@ -8630,10 +8641,10 @@ function myFunc() {
|
|
|
8630
8641
|
], 32),
|
|
8631
8642
|
y("div", {
|
|
8632
8643
|
class: "dropdown-wrapper",
|
|
8633
|
-
onMouseenter:
|
|
8634
|
-
onMouseleave:
|
|
8644
|
+
onMouseenter: p[13] || (p[13] = (I) => t.value = !0),
|
|
8645
|
+
onMouseleave: p[14] || (p[14] = (I) => t.value = !1)
|
|
8635
8646
|
}, [
|
|
8636
|
-
|
|
8647
|
+
p[19] || (p[19] = y("button", { class: "menu-btn" }, "帮助", -1)),
|
|
8637
8648
|
j(y("div", Xu, [
|
|
8638
8649
|
y("div", {
|
|
8639
8650
|
class: "menu-item",
|
|
@@ -8641,19 +8652,19 @@ function myFunc() {
|
|
|
8641
8652
|
}, "获取场景"),
|
|
8642
8653
|
y("div", {
|
|
8643
8654
|
class: "menu-item",
|
|
8644
|
-
onClick:
|
|
8655
|
+
onClick: A
|
|
8645
8656
|
}, "镜头拉近"),
|
|
8646
8657
|
y("div", {
|
|
8647
8658
|
class: "menu-item",
|
|
8648
8659
|
onClick: b
|
|
8649
8660
|
}, " 重置相机位置 "),
|
|
8650
|
-
|
|
8661
|
+
p[18] || (p[18] = y("div", { class: "menu-divider" }, null, -1))
|
|
8651
8662
|
], 512), [
|
|
8652
8663
|
[st, t.value]
|
|
8653
8664
|
])
|
|
8654
8665
|
], 32)
|
|
8655
8666
|
]),
|
|
8656
|
-
|
|
8667
|
+
p[20] || (p[20] = y("div", { class: "right-section" }, [
|
|
8657
8668
|
y("span", { class: "app-title" }, "3D 模型编辑器")
|
|
8658
8669
|
], -1)),
|
|
8659
8670
|
y("input", {
|
|
@@ -8692,53 +8703,53 @@ function myFunc() {
|
|
|
8692
8703
|
},
|
|
8693
8704
|
setup(r) {
|
|
8694
8705
|
const e = r, t = G(!1);
|
|
8695
|
-
_a((
|
|
8696
|
-
t.value =
|
|
8706
|
+
_a((h) => {
|
|
8707
|
+
t.value = h;
|
|
8697
8708
|
});
|
|
8698
8709
|
const n = Qs(null), s = ts({
|
|
8699
8710
|
position: { x: 0, y: 0, z: 0 },
|
|
8700
8711
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8701
8712
|
scale: { x: 1, y: 1, z: 1 }
|
|
8702
|
-
}), i = (
|
|
8703
|
-
s.position.x = Number(
|
|
8704
|
-
}, o = (
|
|
8705
|
-
|
|
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(
|
|
8706
8717
|
s.position.x,
|
|
8707
8718
|
s.position.y,
|
|
8708
8719
|
s.position.z
|
|
8709
|
-
),
|
|
8720
|
+
), h.rotation.set(
|
|
8710
8721
|
s.rotation.x,
|
|
8711
8722
|
s.rotation.y,
|
|
8712
8723
|
s.rotation.z
|
|
8713
|
-
),
|
|
8724
|
+
), h.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
8714
8725
|
};
|
|
8715
|
-
al((
|
|
8716
|
-
n.value =
|
|
8717
|
-
}), ll((
|
|
8718
|
-
i(
|
|
8726
|
+
al((h) => {
|
|
8727
|
+
n.value = h, h && i(h);
|
|
8728
|
+
}), ll((h) => {
|
|
8729
|
+
i(h);
|
|
8719
8730
|
});
|
|
8720
8731
|
const a = () => {
|
|
8721
8732
|
if (n.value && (o(n.value), n.value.type === "DirectionalLight")) {
|
|
8722
|
-
const
|
|
8723
|
-
|
|
8733
|
+
const h = n.value.userData.helper;
|
|
8734
|
+
h && typeof h.update == "function" && h.update();
|
|
8724
8735
|
}
|
|
8725
|
-
}, l = (
|
|
8736
|
+
}, l = (h) => Fi(h), c = async (h) => {
|
|
8726
8737
|
try {
|
|
8727
|
-
await ji(
|
|
8728
|
-
} catch (
|
|
8729
|
-
console.error("导入失败:",
|
|
8738
|
+
await ji(h);
|
|
8739
|
+
} catch (f) {
|
|
8740
|
+
console.error("导入失败:", f), alert("导入失败:" + f.message);
|
|
8730
8741
|
}
|
|
8731
8742
|
}, d = Qs([]);
|
|
8732
|
-
cl((
|
|
8733
|
-
d.value =
|
|
8743
|
+
cl((h) => {
|
|
8744
|
+
d.value = h;
|
|
8734
8745
|
});
|
|
8735
8746
|
const u = () => {
|
|
8736
|
-
const
|
|
8737
|
-
|
|
8738
|
-
}, g = (
|
|
8739
|
-
Ai(
|
|
8740
|
-
}, m = (
|
|
8741
|
-
() => 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))
|
|
8742
8753
|
), I = G(null), w = async () => {
|
|
8743
8754
|
I.value && await Wa(I.value, e.mode, e.sceneData), u();
|
|
8744
8755
|
};
|
|
@@ -8746,26 +8757,26 @@ function myFunc() {
|
|
|
8746
8757
|
w(), I.value && vr(I.value);
|
|
8747
8758
|
}), Ji(() => {
|
|
8748
8759
|
console.log("endset_three_editor destroy"), vl();
|
|
8749
|
-
}), (
|
|
8750
|
-
t.value ? (H(), k("div", Ju,
|
|
8760
|
+
}), (h, f) => (H(), k("div", Qu, [
|
|
8761
|
+
t.value ? (H(), k("div", Ju, f[0] || (f[0] = [
|
|
8751
8762
|
y("div", { class: "loading-spinner" }, null, -1),
|
|
8752
8763
|
y("div", { class: "loading-text" }, "加载中...", -1)
|
|
8753
8764
|
]))) : re("", !0),
|
|
8754
|
-
|
|
8765
|
+
h.mode === "edit" ? (H(), vt(qu, {
|
|
8755
8766
|
key: 1,
|
|
8756
8767
|
onAddModel: l,
|
|
8757
8768
|
onImportModel: c
|
|
8758
8769
|
})) : re("", !0),
|
|
8759
8770
|
y("div", {
|
|
8760
|
-
class: Pe(`editor-container editor-container-mode-${
|
|
8771
|
+
class: Pe(`editor-container editor-container-mode-${h.mode}`)
|
|
8761
8772
|
}, [
|
|
8762
8773
|
y("div", {
|
|
8763
|
-
class: Pe(`canvas canvas-mode-${
|
|
8774
|
+
class: Pe(`canvas canvas-mode-${h.mode}`),
|
|
8764
8775
|
ref_key: "containerRef",
|
|
8765
8776
|
ref: I
|
|
8766
8777
|
}, [
|
|
8767
|
-
|
|
8768
|
-
(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", {
|
|
8769
8780
|
key: v.id,
|
|
8770
8781
|
class: "script-trigger-btn",
|
|
8771
8782
|
title: v.code,
|
|
@@ -8773,18 +8784,18 @@ function myFunc() {
|
|
|
8773
8784
|
}, " ▶ " + fe(ns(Ua)(v, D)), 9, $u))), 128))
|
|
8774
8785
|
])) : re("", !0)
|
|
8775
8786
|
], 2),
|
|
8776
|
-
|
|
8787
|
+
h.mode === "edit" ? (H(), vt(Fu, {
|
|
8777
8788
|
key: 0,
|
|
8778
8789
|
transform: s,
|
|
8779
8790
|
"tree-data": d.value,
|
|
8780
8791
|
"selected-object": n.value,
|
|
8781
8792
|
onPropertyChange: a,
|
|
8782
8793
|
onTreeSelect: g,
|
|
8783
|
-
onTreeDelete:
|
|
8794
|
+
onTreeDelete: A,
|
|
8784
8795
|
onTransformModeChange: b
|
|
8785
8796
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : re("", !0)
|
|
8786
8797
|
], 2),
|
|
8787
|
-
|
|
8798
|
+
h.mode === "edit" ? (H(), vt(Zu, { key: 2 })) : re("", !0)
|
|
8788
8799
|
]));
|
|
8789
8800
|
}
|
|
8790
8801
|
}), bd = /* @__PURE__ */ Qe(ed, [["__scopeId", "data-v-1237aaa7"]]);
|