endset_three_editor 0.10.23 → 0.10.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -545,8 +545,8 @@ class tr extends zn {
|
|
|
545
545
|
}), o[A] = f, i[A] = f, s[A] = 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 S(), c = new S(), d = new Ae(), u = new Ae(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition",
|
|
548
|
+
const l = new S(), c = new S(), d = new Ae(), u = new Ae(), m = new S(), g = new Ae(), b = new S(), p = new S(), h = new S(), w = 0, C = new S();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", m), a("cameraQuaternion", g), a("pointStart", b), a("pointEnd", p), a("rotationAxis", h), a("rotationAngle", w), a("eye", C), this._offset = new S(), this._startNorm = new S(), this._endNorm = new S(), this._cameraScale = new S(), this._parentPosition = new S(), this._parentQuaternion = new Ae(), this._parentQuaternionInv = new Ae(), this._parentScale = new S(), this._worldScaleStart = new S(), this._worldQuaternionInv = new Ae(), this._worldScale = new S(), this._positionStart = new S(), this._quaternionStart = new Ae(), this._scaleStart = new S(), this._getPointer = sr.bind(this), this._onPointerDown = ir.bind(this), this._onPointerHover = nr.bind(this), this._onPointerMove = or.bind(this), this._onPointerUp = rr.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";
|
|
@@ -798,23 +798,23 @@ class lr extends gt {
|
|
|
798
798
|
d.color.setHex(255), d.opacity = 0.5;
|
|
799
799
|
const u = e.clone();
|
|
800
800
|
u.opacity = 0.25;
|
|
801
|
+
const m = e.clone();
|
|
802
|
+
m.color.setHex(16776960), m.opacity = 0.25;
|
|
801
803
|
const g = e.clone();
|
|
802
|
-
g.color.setHex(16776960)
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
const x = e.clone();
|
|
806
|
-
x.color.setHex(7895160), this.materialLib = {
|
|
804
|
+
g.color.setHex(16776960);
|
|
805
|
+
const b = e.clone();
|
|
806
|
+
b.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
810
|
-
active:
|
|
810
|
+
active: g,
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: c,
|
|
813
813
|
zAxisTransparent: d,
|
|
814
|
-
activeTransparent:
|
|
814
|
+
activeTransparent: m
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const p = new ge(0, 0.04, 0.1, 12);
|
|
817
|
+
p.translate(0, 0.05, 0);
|
|
818
818
|
const h = new pe(0.08, 0.08, 0.08);
|
|
819
819
|
h.translate(0, 0.04, 0);
|
|
820
820
|
const w = new rt();
|
|
@@ -831,18 +831,18 @@ class lr extends gt {
|
|
|
831
831
|
}
|
|
832
832
|
const v = {
|
|
833
833
|
X: [
|
|
834
|
-
[new L(
|
|
835
|
-
[new L(
|
|
834
|
+
[new L(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new L(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
836
|
[new L(C, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new L(
|
|
840
|
-
[new L(
|
|
839
|
+
[new L(p, o), [0, 0.5, 0]],
|
|
840
|
+
[new L(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
841
|
[new L(C, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new L(
|
|
845
|
-
[new L(
|
|
844
|
+
[new L(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new L(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
846
|
[new L(C, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
@@ -903,7 +903,7 @@ class lr extends gt {
|
|
|
903
903
|
]
|
|
904
904
|
}, T = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new L(A(0.5, 1),
|
|
906
|
+
[new L(A(0.5, 1), b), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
909
|
[new L(A(0.5, 0.5), i)]
|
|
@@ -915,7 +915,7 @@ class lr extends gt {
|
|
|
915
915
|
[new L(A(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
|
|
916
916
|
],
|
|
917
917
|
E: [
|
|
918
|
-
[new L(A(0.75, 1),
|
|
918
|
+
[new L(A(0.75, 1), m), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
920
|
}, Y = {
|
|
921
921
|
AXIS: [
|
|
@@ -1608,51 +1608,51 @@ class xr {
|
|
|
1608
1608
|
width: n,
|
|
1609
1609
|
height: s
|
|
1610
1610
|
};
|
|
1611
|
-
}, this.render = function(
|
|
1612
|
-
|
|
1613
|
-
}, this.setSize = function(
|
|
1614
|
-
n =
|
|
1611
|
+
}, this.render = function(b, p) {
|
|
1612
|
+
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), gn.copy(p.matrixWorldInverse), yn.multiplyMatrices(p.projectionMatrix, gn), d(b, b, p), this.sortObjects && g(b);
|
|
1613
|
+
}, this.setSize = function(b, p) {
|
|
1614
|
+
n = b, s = p, i = n / 2, o = s / 2, l.style.width = b + "px", l.style.height = p + "px";
|
|
1615
1615
|
};
|
|
1616
|
-
function c(
|
|
1617
|
-
|
|
1618
|
-
for (let
|
|
1619
|
-
c(
|
|
1620
|
-
}
|
|
1621
|
-
function d(
|
|
1622
|
-
if (
|
|
1623
|
-
c(
|
|
1616
|
+
function c(b) {
|
|
1617
|
+
b.isCSS2DObject && (b.element.style.display = "none");
|
|
1618
|
+
for (let p = 0, h = b.children.length; p < h; p++)
|
|
1619
|
+
c(b.children[p]);
|
|
1620
|
+
}
|
|
1621
|
+
function d(b, p, h) {
|
|
1622
|
+
if (b.visible === !1) {
|
|
1623
|
+
c(b);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
ut.setFromMatrixPosition(
|
|
1628
|
-
const w = ut.z >= -1 && ut.z <= 1 &&
|
|
1629
|
-
C.style.display = w === !0 ? "" : "none", w === !0 && (
|
|
1626
|
+
if (b.isCSS2DObject) {
|
|
1627
|
+
ut.setFromMatrixPosition(b.matrixWorld), ut.applyMatrix4(yn);
|
|
1628
|
+
const w = ut.z >= -1 && ut.z <= 1 && b.layers.test(h.layers) === !0, C = b.element;
|
|
1629
|
+
C.style.display = w === !0 ? "" : "none", w === !0 && (b.onBeforeRender(t, p, h), C.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ut.x * i + i) + "px," + (-ut.y * o + o) + "px)", C.parentNode !== l && l.appendChild(C), b.onAfterRender(t, p, h));
|
|
1630
1630
|
const A = {
|
|
1631
|
-
distanceToCameraSquared: u(h,
|
|
1631
|
+
distanceToCameraSquared: u(h, b)
|
|
1632
1632
|
};
|
|
1633
|
-
a.objects.set(
|
|
1633
|
+
a.objects.set(b, A);
|
|
1634
1634
|
}
|
|
1635
|
-
for (let w = 0, C =
|
|
1636
|
-
d(
|
|
1635
|
+
for (let w = 0, C = b.children.length; w < C; w++)
|
|
1636
|
+
d(b.children[w], p, h);
|
|
1637
1637
|
}
|
|
1638
|
-
function u(
|
|
1639
|
-
return bn.setFromMatrixPosition(
|
|
1638
|
+
function u(b, p) {
|
|
1639
|
+
return bn.setFromMatrixPosition(b.matrixWorld), xn.setFromMatrixPosition(p.matrixWorld), bn.distanceToSquared(xn);
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
const
|
|
1643
|
-
return
|
|
1644
|
-
h.isCSS2DObject &&
|
|
1645
|
-
}),
|
|
1641
|
+
function m(b) {
|
|
1642
|
+
const p = [];
|
|
1643
|
+
return b.traverseVisible(function(h) {
|
|
1644
|
+
h.isCSS2DObject && p.push(h);
|
|
1645
|
+
}), p;
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1648
|
-
const
|
|
1647
|
+
function g(b) {
|
|
1648
|
+
const p = m(b).sort(function(w, C) {
|
|
1649
1649
|
if (w.renderOrder !== C.renderOrder)
|
|
1650
1650
|
return C.renderOrder - w.renderOrder;
|
|
1651
1651
|
const A = a.objects.get(w).distanceToCameraSquared, f = a.objects.get(C).distanceToCameraSquared;
|
|
1652
1652
|
return A - f;
|
|
1653
|
-
}), h =
|
|
1654
|
-
for (let w = 0, C =
|
|
1655
|
-
|
|
1653
|
+
}), h = p.length;
|
|
1654
|
+
for (let w = 0, C = p.length; w < C; w++)
|
|
1655
|
+
p[w].element.style.zIndex = h - w;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
@@ -1951,11 +1951,11 @@ function Lr() {
|
|
|
1951
1951
|
s.position.set(-0.757, 13.219, 0.717), s.scale.set(31.713, 28.305, 28.591), r.add(s);
|
|
1952
1952
|
const i = new R.MeshStandardMaterial(), o = new R.InstancedMesh(e, i, 6), a = new R.Object3D();
|
|
1953
1953
|
a.position.set(-10.906, 2.009, 1.846), a.rotation.set(0, -0.195, 0), a.scale.set(2.328, 7.905, 4.651), a.updateMatrix(), o.setMatrixAt(0, a.matrix), a.position.set(-5.607, -0.754, -0.758), a.rotation.set(0, 0.994, 0), a.scale.set(1.97, 1.534, 3.955), a.updateMatrix(), o.setMatrixAt(1, a.matrix), a.position.set(6.167, 0.857, 7.803), a.rotation.set(0, 0.561, 0), a.scale.set(3.927, 6.285, 3.687), a.updateMatrix(), o.setMatrixAt(2, a.matrix), a.position.set(-2.017, 0.018, 6.124), a.rotation.set(0, 0.333, 0), a.scale.set(2.002, 4.566, 2.064), a.updateMatrix(), o.setMatrixAt(3, a.matrix), a.position.set(2.291, -0.756, -2.621), a.rotation.set(0, -0.286, 0), a.scale.set(1.546, 1.552, 1.496), a.updateMatrix(), o.setMatrixAt(4, a.matrix), a.position.set(-2.193, -0.369, -5.547), a.rotation.set(0, 0.516, 0), a.scale.set(3.875, 3.487, 2.986), a.updateMatrix(), o.setMatrixAt(5, a.matrix), o.instanceMatrix.needsUpdate = !0, r.add(o);
|
|
1954
|
-
function l(
|
|
1954
|
+
function l(p) {
|
|
1955
1955
|
return new R.MeshLambertMaterial({
|
|
1956
1956
|
color: 0,
|
|
1957
1957
|
emissive: 16777215,
|
|
1958
|
-
emissiveIntensity:
|
|
1958
|
+
emissiveIntensity: p
|
|
1959
1959
|
});
|
|
1960
1960
|
}
|
|
1961
1961
|
const c = new R.Mesh(e, l(50));
|
|
@@ -1964,12 +1964,12 @@ function Lr() {
|
|
|
1964
1964
|
d.position.set(-16.109, 18.021, -8.207), d.scale.set(0.1, 2.425, 2.751), r.add(d);
|
|
1965
1965
|
const u = new R.Mesh(e, l(17));
|
|
1966
1966
|
u.position.set(14.904, 12.198, -1.832), u.scale.set(0.15, 4.265, 6.331), r.add(u);
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
const
|
|
1972
|
-
return
|
|
1967
|
+
const m = new R.Mesh(e, l(43));
|
|
1968
|
+
m.position.set(-0.462, 8.89, 14.52), m.scale.set(4.38, 5.441, 0.088), r.add(m);
|
|
1969
|
+
const g = new R.Mesh(e, l(20));
|
|
1970
|
+
g.position.set(3.235, 11.486, -12.541), g.scale.set(2.5, 2, 0.1), r.add(g);
|
|
1971
|
+
const b = new R.Mesh(e, l(100));
|
|
1972
|
+
return b.position.set(0, 20, 0), b.scale.set(1, 0.1, 1), r.add(b), r;
|
|
1973
1973
|
}
|
|
1974
1974
|
function _t(r) {
|
|
1975
1975
|
try {
|
|
@@ -2241,32 +2241,32 @@ class Br {
|
|
|
2241
2241
|
n = s.options;
|
|
2242
2242
|
const a = s.extensionsUsed, l = s.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }), d = Object.keys(a), u = Object.keys(l);
|
|
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
|
-
const
|
|
2245
|
-
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
const
|
|
2249
|
-
h.setUint32(0,
|
|
2244
|
+
const m = new FileReader();
|
|
2245
|
+
m.readAsArrayBuffer(c), m.onloadend = function() {
|
|
2246
|
+
const g = ws(m.result), b = new DataView(new ArrayBuffer(vn));
|
|
2247
|
+
b.setUint32(0, g.byteLength, !0), b.setUint32(4, Fr, !0);
|
|
2248
|
+
const p = ws(Ur(JSON.stringify(o)), 32), h = new DataView(new ArrayBuffer(vn));
|
|
2249
|
+
h.setUint32(0, p.byteLength, !0), h.setUint32(4, jr, !0);
|
|
2250
2250
|
const w = new ArrayBuffer(wn), C = new DataView(w);
|
|
2251
2251
|
C.setUint32(0, Hr, !0), C.setUint32(4, kr, !0);
|
|
2252
|
-
const A = wn + h.byteLength +
|
|
2252
|
+
const A = wn + h.byteLength + p.byteLength + b.byteLength + g.byteLength;
|
|
2253
2253
|
C.setUint32(8, A, !0);
|
|
2254
2254
|
const f = new Blob([
|
|
2255
2255
|
w,
|
|
2256
2256
|
h,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2257
|
+
p,
|
|
2258
|
+
b,
|
|
2259
|
+
g
|
|
2260
2260
|
], { type: "application/octet-stream" }), v = new FileReader();
|
|
2261
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
|
-
const
|
|
2267
|
-
|
|
2268
|
-
const
|
|
2269
|
-
o.buffers[0].uri =
|
|
2266
|
+
const m = new FileReader();
|
|
2267
|
+
m.readAsDataURL(c), m.onloadend = function() {
|
|
2268
|
+
const g = m.result;
|
|
2269
|
+
o.buffers[0].uri = g, t(o);
|
|
2270
2270
|
};
|
|
2271
2271
|
} else
|
|
2272
2272
|
t(o);
|
|
@@ -2349,11 +2349,11 @@ class Br {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
async buildMetalRoughTextureAsync(e, t) {
|
|
2351
2351
|
if (e === t) return e;
|
|
2352
|
-
function n(
|
|
2353
|
-
return
|
|
2354
|
-
return
|
|
2355
|
-
} : function(
|
|
2356
|
-
return
|
|
2352
|
+
function n(g) {
|
|
2353
|
+
return g.colorSpace === je ? function(p) {
|
|
2354
|
+
return p < 0.04045 ? p * 0.0773993808 : Math.pow(p * 0.9478672986 + 0.0521327014, 2.4);
|
|
2355
|
+
} : function(p) {
|
|
2356
|
+
return p;
|
|
2357
2357
|
};
|
|
2358
2358
|
}
|
|
2359
2359
|
e instanceof ys && (e = await this.decompressTextureAsync(e)), t instanceof ys && (t = await this.decompressTextureAsync(t));
|
|
@@ -2366,19 +2366,19 @@ class Br {
|
|
|
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
|
|
2370
|
-
for (let
|
|
2371
|
-
d.data[
|
|
2369
|
+
const g = n(e), b = c.getImageData(0, 0, o, a).data;
|
|
2370
|
+
for (let p = 2; p < b.length; p += 4)
|
|
2371
|
+
d.data[p] = g(b[p] / 256) * 256;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (i) {
|
|
2374
2374
|
c.drawImage(i, 0, 0, o, a);
|
|
2375
|
-
const
|
|
2376
|
-
for (let
|
|
2377
|
-
d.data[
|
|
2375
|
+
const g = n(t), b = c.getImageData(0, 0, o, a).data;
|
|
2376
|
+
for (let p = 1; p < b.length; p += 4)
|
|
2377
|
+
d.data[p] = g(b[p] / 256) * 256;
|
|
2378
2378
|
}
|
|
2379
2379
|
c.putImageData(d, 0, 0);
|
|
2380
|
-
const
|
|
2381
|
-
return
|
|
2380
|
+
const m = (e || t).clone();
|
|
2381
|
+
return m.source = new Io(l), m.colorSpace = Co, m.channel = (e || t).channel, e && t && e.channel !== t.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), m;
|
|
2382
2382
|
}
|
|
2383
2383
|
async decompressTextureAsync(e, t = 1 / 0) {
|
|
2384
2384
|
if (this.textureUtils === null)
|
|
@@ -2423,19 +2423,19 @@ class Br {
|
|
|
2423
2423
|
i === q.ARRAY_BUFFER && (l = Math.ceil(l / 4) * 4);
|
|
2424
2424
|
const c = ai(s * l), d = new DataView(new ArrayBuffer(c));
|
|
2425
2425
|
let u = 0;
|
|
2426
|
-
for (let
|
|
2427
|
-
for (let
|
|
2426
|
+
for (let b = n; b < n + s; b++) {
|
|
2427
|
+
for (let p = 0; p < e.itemSize; p++) {
|
|
2428
2428
|
let h;
|
|
2429
|
-
e.itemSize > 4 ? h = e.array[
|
|
2429
|
+
e.itemSize > 4 ? h = e.array[b * e.itemSize + p] : (p === 0 ? h = e.getX(b) : p === 1 ? h = e.getY(b) : p === 2 ? h = e.getZ(b) : p === 3 && (h = e.getW(b)), e.normalized === !0 && (h = St.normalize(h, e.array))), t === q.FLOAT ? d.setFloat32(u, h, !0) : t === q.INT ? d.setInt32(u, h, !0) : t === q.UNSIGNED_INT ? d.setUint32(u, h, !0) : t === q.SHORT ? d.setInt16(u, h, !0) : t === q.UNSIGNED_SHORT ? d.setUint16(u, h, !0) : t === q.BYTE ? d.setInt8(u, h) : t === q.UNSIGNED_BYTE && d.setUint8(u, h), u += a;
|
|
2430
2430
|
}
|
|
2431
2431
|
u % l !== 0 && (u += l - u % l);
|
|
2432
2432
|
}
|
|
2433
|
-
const
|
|
2433
|
+
const m = {
|
|
2434
2434
|
buffer: this.processBuffer(d.buffer),
|
|
2435
2435
|
byteOffset: this.byteOffset,
|
|
2436
2436
|
byteLength: c
|
|
2437
2437
|
};
|
|
2438
|
-
return i !== void 0 && (
|
|
2438
|
+
return i !== void 0 && (m.target = i), i === q.ARRAY_BUFFER && (m.byteStride = l), this.byteOffset += c, o.bufferViews.push(m), {
|
|
2439
2439
|
id: o.bufferViews.length - 1,
|
|
2440
2440
|
byteLength: 0
|
|
2441
2441
|
};
|
|
@@ -2523,28 +2523,28 @@ class Br {
|
|
|
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
|
|
2527
|
-
|
|
2528
|
-
const
|
|
2526
|
+
const m = { mimeType: s }, g = Mn();
|
|
2527
|
+
g.width = Math.min(e.width, l.maxTextureSize), g.height = Math.min(e.height, l.maxTextureSize);
|
|
2528
|
+
const b = g.getContext("2d", {
|
|
2529
2529
|
willReadFrequently: !0
|
|
2530
2530
|
});
|
|
2531
|
-
if (n === !0 && (
|
|
2531
|
+
if (n === !0 && (b.translate(0, g.height), b.scale(1, -1)), e.data !== void 0) {
|
|
2532
2532
|
t !== wo && 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
2533
|
const h = new Uint8ClampedArray(e.height * e.width * 4);
|
|
2534
2534
|
for (let w = 0; w < h.length; w += 4)
|
|
2535
2535
|
h[w + 0] = e.data[w + 0], h[w + 1] = e.data[w + 1], h[w + 2] = e.data[w + 2], h[w + 3] = e.data[w + 3];
|
|
2536
|
-
|
|
2536
|
+
b.putImageData(new ImageData(h, 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
|
-
|
|
2538
|
+
b.drawImage(e, 0, 0, g.width, g.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
|
-
Gr(
|
|
2543
|
-
|
|
2542
|
+
Gr(g, s).then((h) => i.processBufferViewImage(h)).then((h) => {
|
|
2543
|
+
m.bufferView = h;
|
|
2544
2544
|
})
|
|
2545
|
-
) :
|
|
2546
|
-
const
|
|
2547
|
-
return d[u] =
|
|
2545
|
+
) : m.uri = vo.getDataURL(g, s);
|
|
2546
|
+
const p = a.images.push(m) - 1;
|
|
2547
|
+
return d[u] = p, p;
|
|
2548
2548
|
} else
|
|
2549
2549
|
throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
|
|
2550
2550
|
}
|
|
@@ -2659,7 +2659,7 @@ class Br {
|
|
|
2659
2659
|
const o = e.geometry;
|
|
2660
2660
|
let a;
|
|
2661
2661
|
e.isLineSegments ? a = q.LINES : e.isLineLoop ? a = q.LINE_LOOP : e.isLine ? a = q.LINE_STRIP : e.isPoints ? a = q.POINTS : a = e.material.wireframe ? q.LINES : q.TRIANGLES;
|
|
2662
|
-
const l = {}, c = {}, d = [], u = [],
|
|
2662
|
+
const l = {}, c = {}, d = [], u = [], m = {
|
|
2663
2663
|
uv: "TEXCOORD_0",
|
|
2664
2664
|
uv1: "TEXCOORD_1",
|
|
2665
2665
|
uv2: "TEXCOORD_2",
|
|
@@ -2667,23 +2667,23 @@ class Br {
|
|
|
2667
2667
|
color: "COLOR_0",
|
|
2668
2668
|
skinWeight: "WEIGHTS_0",
|
|
2669
2669
|
skinIndex: "JOINTS_0"
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
let
|
|
2670
|
+
}, g = o.getAttribute("normal");
|
|
2671
|
+
g !== void 0 && !this.isNormalizedNormalAttribute(g) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(g)));
|
|
2672
|
+
let b = null;
|
|
2673
2673
|
for (let f in o.attributes) {
|
|
2674
2674
|
if (f.slice(0, 5) === "morph") continue;
|
|
2675
2675
|
const v = o.attributes[f];
|
|
2676
|
-
if (f =
|
|
2676
|
+
if (f = m[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
2677
|
c[f] = t.attributes.get(this.getUID(v));
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
|
-
|
|
2680
|
+
b = null;
|
|
2681
2681
|
const O = v.array;
|
|
2682
|
-
f === "JOINTS_0" && !(O instanceof Uint16Array) && !(O instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),
|
|
2683
|
-
const T = this.processAccessor(
|
|
2682
|
+
f === "JOINTS_0" && !(O instanceof Uint16Array) && !(O instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Rt.Utils.toTypedBufferAttribute(v, Uint16Array)) : (O instanceof Uint32Array || O instanceof Int32Array) && !f.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${f}" converted to type FLOAT.`), b = Rt.Utils.toTypedBufferAttribute(v, Float32Array));
|
|
2683
|
+
const T = this.processAccessor(b || v, o);
|
|
2684
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 (g !== void 0 && o.setAttribute("normal", g), Object.keys(c).length === 0) return null;
|
|
2687
2687
|
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
2688
2688
|
const f = [], v = [], D = {};
|
|
2689
2689
|
if (e.morphTargetDictionary !== void 0)
|
|
@@ -2713,16 +2713,16 @@ class Br {
|
|
|
2713
2713
|
}
|
|
2714
2714
|
l.weights = f, v.length > 0 && (l.extras = {}, l.extras.targetNames = v);
|
|
2715
2715
|
}
|
|
2716
|
-
const
|
|
2717
|
-
if (
|
|
2716
|
+
const p = Array.isArray(e.material);
|
|
2717
|
+
if (p && o.groups.length === 0) return null;
|
|
2718
2718
|
let h = !1;
|
|
2719
|
-
if (
|
|
2719
|
+
if (p && o.index === null) {
|
|
2720
2720
|
const f = [];
|
|
2721
2721
|
for (let v = 0, D = o.attributes.position.count; v < D; v++)
|
|
2722
2722
|
f[v] = v;
|
|
2723
2723
|
o.setIndex(f), h = !0;
|
|
2724
2724
|
}
|
|
2725
|
-
const w =
|
|
2725
|
+
const w = p ? e.material : [e.material], C = p ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
2726
2726
|
for (let f = 0, v = C.length; f < v; f++) {
|
|
2727
2727
|
const D = {
|
|
2728
2728
|
mode: a,
|
|
@@ -2814,25 +2814,25 @@ class Br {
|
|
|
2814
2814
|
const i = e.tracks, o = [], a = [];
|
|
2815
2815
|
for (let c = 0; c < i.length; ++c) {
|
|
2816
2816
|
const d = i[c], u = Lt.parseTrackName(d.name);
|
|
2817
|
-
let
|
|
2818
|
-
const
|
|
2819
|
-
if (u.objectName === "bones" && (
|
|
2817
|
+
let m = Lt.findNode(t, u.nodeName);
|
|
2818
|
+
const g = Cn[u.propertyName];
|
|
2819
|
+
if (u.objectName === "bones" && (m.isSkinnedMesh === !0 ? m = m.skeleton.getBoneByName(u.objectIndex) : m = void 0), !m || !g) {
|
|
2820
2820
|
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', d.name);
|
|
2821
2821
|
continue;
|
|
2822
2822
|
}
|
|
2823
|
-
const
|
|
2824
|
-
let
|
|
2825
|
-
|
|
2823
|
+
const b = 1;
|
|
2824
|
+
let p = d.values.length / d.times.length;
|
|
2825
|
+
g === Cn.morphTargetInfluences && (p /= m.morphTargetInfluences.length);
|
|
2826
2826
|
let h;
|
|
2827
|
-
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (h = "CUBICSPLINE",
|
|
2828
|
-
input: this.processAccessor(new De(d.times,
|
|
2829
|
-
output: this.processAccessor(new De(d.values,
|
|
2827
|
+
d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (h = "CUBICSPLINE", p /= 3) : d.getInterpolation() === Vn ? h = "STEP" : h = "LINEAR", a.push({
|
|
2828
|
+
input: this.processAccessor(new De(d.times, b)),
|
|
2829
|
+
output: this.processAccessor(new De(d.values, p)),
|
|
2830
2830
|
interpolation: h
|
|
2831
2831
|
}), o.push({
|
|
2832
2832
|
sampler: a.length - 1,
|
|
2833
2833
|
target: {
|
|
2834
|
-
node: s.get(
|
|
2835
|
-
path:
|
|
2834
|
+
node: s.get(m),
|
|
2835
|
+
path: g
|
|
2836
2836
|
}
|
|
2837
2837
|
});
|
|
2838
2838
|
}
|
|
@@ -2911,26 +2911,26 @@ class Br {
|
|
|
2911
2911
|
Ge(a, [0, 0, 0, 1]) || (o.rotation = a), Ge(l, [0, 0, 0]) || (o.translation = l), Ge(c, [1, 1, 1]) || (o.scale = c), o.extras = { pivot: i.toArray() }, e.name !== "" && (o.name = String(e.name)), this.serializeUserData(e, o);
|
|
2912
2912
|
const d = t.nodes.push(o) - 1;
|
|
2913
2913
|
s.set(e, d);
|
|
2914
|
-
const u = {},
|
|
2915
|
-
if (Ge(
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2914
|
+
const u = {}, m = [-i.x, -i.y, -i.z];
|
|
2915
|
+
if (Ge(m, [0, 0, 0]) || (u.translation = m), e.isMesh || e.isLine || e.isPoints) {
|
|
2916
|
+
const p = await this.processMeshAsync(e);
|
|
2917
|
+
p !== null && (u.mesh = p);
|
|
2918
2918
|
} else e.isCamera && (u.camera = this.processCamera(e));
|
|
2919
2919
|
e.isSkinnedMesh && this.skins.push(e);
|
|
2920
|
-
const
|
|
2920
|
+
const b = [t.nodes.push(u) - 1];
|
|
2921
2921
|
if (e.children.length > 0) {
|
|
2922
|
-
const
|
|
2922
|
+
const p = [];
|
|
2923
2923
|
for (let h = 0, w = e.children.length; h < w; h++) {
|
|
2924
2924
|
const C = e.children[h];
|
|
2925
2925
|
if (C.visible || n.onlyVisible === !1) {
|
|
2926
2926
|
const A = await this.processNodeAsync(C);
|
|
2927
|
-
A !== null &&
|
|
2927
|
+
A !== null && p.push(A);
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
|
-
|
|
2930
|
+
p.length > 0 && (u.children = p);
|
|
2931
2931
|
}
|
|
2932
|
-
return o.children =
|
|
2933
|
-
|
|
2932
|
+
return o.children = b, await this._invokeAllAsync(function(p) {
|
|
2933
|
+
p.writeNode && p.writeNode(e, o);
|
|
2934
2934
|
}), d;
|
|
2935
2935
|
}
|
|
2936
2936
|
/**
|
|
@@ -3207,14 +3207,14 @@ let Vr = 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 S(), d = new Ae(), u = new S();
|
|
3210
|
-
for (let
|
|
3211
|
-
s.getMatrixAt(
|
|
3212
|
-
const
|
|
3210
|
+
for (let g = 0; g < s.count; g++)
|
|
3211
|
+
s.getMatrixAt(g, l), l.decompose(c, d, u), c.toArray(i, g * 3), d.toArray(o, g * 4), u.toArray(a, g * 3);
|
|
3212
|
+
const m = {
|
|
3213
3213
|
TRANSLATION: n.processAccessor(new De(i, 3)),
|
|
3214
3214
|
ROTATION: n.processAccessor(new De(o, 4)),
|
|
3215
3215
|
SCALE: n.processAccessor(new De(a, 3))
|
|
3216
3216
|
};
|
|
3217
|
-
s.instanceColor && (
|
|
3217
|
+
s.instanceColor && (m._COLOR_0 = n.processAccessor(s.instanceColor)), t.extensions = t.extensions || {}, t.extensions[this.name] = { attributes: m }, n.extensionsUsed[this.name] = !0, n.extensionsRequired[this.name] = !0;
|
|
3218
3218
|
}
|
|
3219
3219
|
};
|
|
3220
3220
|
Rt.Utils = {
|
|
@@ -3263,19 +3263,19 @@ Rt.Utils = {
|
|
|
3263
3263
|
let u;
|
|
3264
3264
|
if (n[l.uuid] === void 0) {
|
|
3265
3265
|
u = o.clone();
|
|
3266
|
-
const
|
|
3267
|
-
for (let
|
|
3268
|
-
|
|
3269
|
-
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values =
|
|
3266
|
+
const g = new u.ValueBufferType(c * u.times.length);
|
|
3267
|
+
for (let b = 0; b < u.times.length; b++)
|
|
3268
|
+
g[b * c + d] = u.values[b];
|
|
3269
|
+
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = g, n[l.uuid] = u, t.push(u);
|
|
3270
3270
|
continue;
|
|
3271
3271
|
}
|
|
3272
|
-
const
|
|
3272
|
+
const m = o.createInterpolant(new o.ValueBufferType(1));
|
|
3273
3273
|
u = n[l.uuid];
|
|
3274
|
-
for (let
|
|
3275
|
-
u.values[
|
|
3276
|
-
for (let
|
|
3277
|
-
const
|
|
3278
|
-
u.values[
|
|
3274
|
+
for (let g = 0; g < u.times.length; g++)
|
|
3275
|
+
u.values[g * c + d] = m.evaluate(u.times[g]);
|
|
3276
|
+
for (let g = 0; g < o.times.length; g++) {
|
|
3277
|
+
const b = this.insertKeyframe(u, o.times[g]);
|
|
3278
|
+
u.values[b * c + d] = o.values[g];
|
|
3279
3279
|
}
|
|
3280
3280
|
}
|
|
3281
3281
|
return r.tracks = t, r;
|
|
@@ -3507,7 +3507,7 @@ class ci extends Vs {
|
|
|
3507
3507
|
}
|
|
3508
3508
|
if (i.extensionsUsed)
|
|
3509
3509
|
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
3510
|
-
const u = i.extensionsUsed[d],
|
|
3510
|
+
const u = i.extensionsUsed[d], m = i.extensionsRequired || [];
|
|
3511
3511
|
switch (u) {
|
|
3512
3512
|
case V.KHR_MATERIALS_UNLIT:
|
|
3513
3513
|
o[u] = new aa();
|
|
@@ -3522,7 +3522,7 @@ class ci extends Vs {
|
|
|
3522
3522
|
o[u] = new Ta();
|
|
3523
3523
|
break;
|
|
3524
3524
|
default:
|
|
3525
|
-
|
|
3525
|
+
m.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
3526
3526
|
}
|
|
3527
3527
|
}
|
|
3528
3528
|
c.setExtensions(o), c.setPlugins(a), c.parse(n, s);
|
|
@@ -3877,12 +3877,12 @@ class En {
|
|
|
3877
3877
|
return null;
|
|
3878
3878
|
}
|
|
3879
3879
|
return i.then(function(a) {
|
|
3880
|
-
const l = s.byteOffset || 0, c = s.byteLength || 0, d = s.count, u = s.byteStride,
|
|
3881
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u,
|
|
3882
|
-
return
|
|
3880
|
+
const l = s.byteOffset || 0, c = s.byteLength || 0, d = s.count, u = s.byteStride, m = new Uint8Array(a, l, c);
|
|
3881
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, m, s.mode, s.filter).then(function(g) {
|
|
3882
|
+
return g.buffer;
|
|
3883
3883
|
}) : o.ready.then(function() {
|
|
3884
|
-
const
|
|
3885
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
3884
|
+
const g = new ArrayBuffer(d * u);
|
|
3885
|
+
return o.decodeGltfBuffer(new Uint8Array(g), d, u, m, s.mode, s.filter), g;
|
|
3886
3886
|
});
|
|
3887
3887
|
});
|
|
3888
3888
|
} else
|
|
@@ -3905,19 +3905,19 @@ class Ca {
|
|
|
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],
|
|
3909
|
-
for (const
|
|
3910
|
-
const
|
|
3911
|
-
for (let f = 0; f <
|
|
3912
|
-
l.TRANSLATION && h.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && w.fromBufferAttribute(l.ROTATION, f), l.SCALE && C.fromBufferAttribute(l.SCALE, f), A.setMatrixAt(f,
|
|
3908
|
+
const d = c.pop(), u = d.isGroup ? d.children : [d], m = c[0].count, g = [];
|
|
3909
|
+
for (const b of u) {
|
|
3910
|
+
const p = new Ce(), h = new S(), w = new Ae(), C = new S(1, 1, 1), A = new Ro(b.geometry, b.material, m);
|
|
3911
|
+
for (let f = 0; f < m; f++)
|
|
3912
|
+
l.TRANSLATION && h.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && w.fromBufferAttribute(l.ROTATION, f), l.SCALE && C.fromBufferAttribute(l.SCALE, f), A.setMatrixAt(f, p.compose(h, w, C));
|
|
3913
3913
|
for (const f in l)
|
|
3914
3914
|
if (f === "_COLOR_0") {
|
|
3915
3915
|
const v = l[f];
|
|
3916
3916
|
A.instanceColor = new Oo(v.array, v.itemSize, v.normalized);
|
|
3917
|
-
} else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" &&
|
|
3918
|
-
gt.prototype.copy.call(A,
|
|
3917
|
+
} else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" && b.geometry.setAttribute(f, l[f]);
|
|
3918
|
+
gt.prototype.copy.call(A, b), this.parser.assignFinalMaterial(A), g.push(A);
|
|
3919
3919
|
}
|
|
3920
|
-
return d.isGroup ? (d.clear(), d.add(...
|
|
3920
|
+
return d.isGroup ? (d.clear(), d.add(...g), d) : g[0];
|
|
3921
3921
|
}));
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
@@ -3968,19 +3968,19 @@ class va {
|
|
|
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
|
|
3972
|
-
c[u] =
|
|
3971
|
+
const m = n.accessors[e.attributes[d]], g = At[m.componentType];
|
|
3972
|
+
c[u] = g.name, l[u] = m.normalized === !0;
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
3975
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
3976
|
-
return new Promise(function(u,
|
|
3977
|
-
s.decodeDracoFile(d, function(
|
|
3978
|
-
for (const
|
|
3979
|
-
const
|
|
3980
|
-
h !== void 0 && (
|
|
3976
|
+
return new Promise(function(u, m) {
|
|
3977
|
+
s.decodeDracoFile(d, function(g) {
|
|
3978
|
+
for (const b in g.attributes) {
|
|
3979
|
+
const p = g.attributes[b], h = l[b];
|
|
3980
|
+
h !== void 0 && (p.normalized = h);
|
|
3981
3981
|
}
|
|
3982
|
-
u(
|
|
3983
|
-
}, a, c, Fe,
|
|
3982
|
+
u(g);
|
|
3983
|
+
}, a, c, Fe, m);
|
|
3984
3984
|
});
|
|
3985
3985
|
});
|
|
3986
3986
|
}
|
|
@@ -4009,9 +4009,9 @@ class di extends jo {
|
|
|
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,
|
|
4012
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, m = u * u, g = m * u, b = e * c, p = b - c, h = -2 * g + 3 * m, w = g - m, C = 1 - h, A = w - m + u;
|
|
4013
4013
|
for (let f = 0; f !== a; f++) {
|
|
4014
|
-
const v = o[
|
|
4014
|
+
const v = o[p + f + a], D = o[p + f + l] * d, O = o[b + f + a], T = o[b + f] * d;
|
|
4015
4015
|
i[f] = C * v + A * D + h * O + w * T;
|
|
4016
4016
|
}
|
|
4017
4017
|
return i;
|
|
@@ -4114,16 +4114,16 @@ function Pa(r, e, t) {
|
|
|
4114
4114
|
for (let c = 0, d = e.length; c < d; c++) {
|
|
4115
4115
|
const u = e[c];
|
|
4116
4116
|
if (n) {
|
|
4117
|
-
const
|
|
4118
|
-
o.push(
|
|
4117
|
+
const m = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
|
|
4118
|
+
o.push(m);
|
|
4119
4119
|
}
|
|
4120
4120
|
if (s) {
|
|
4121
|
-
const
|
|
4122
|
-
a.push(
|
|
4121
|
+
const m = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : r.attributes.normal;
|
|
4122
|
+
a.push(m);
|
|
4123
4123
|
}
|
|
4124
4124
|
if (i) {
|
|
4125
|
-
const
|
|
4126
|
-
l.push(
|
|
4125
|
+
const m = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : r.attributes.color;
|
|
4126
|
+
l.push(m);
|
|
4127
4127
|
}
|
|
4128
4128
|
}
|
|
4129
4129
|
return Promise.all([
|
|
@@ -4131,8 +4131,8 @@ function Pa(r, e, t) {
|
|
|
4131
4131
|
Promise.all(a),
|
|
4132
4132
|
Promise.all(l)
|
|
4133
4133
|
]).then(function(c) {
|
|
4134
|
-
const d = c[0], u = c[1],
|
|
4135
|
-
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color =
|
|
4134
|
+
const d = c[0], u = c[1], m = c[2];
|
|
4135
|
+
return n && (r.morphAttributes.position = d), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = m), r.morphTargetsRelative = !0, r;
|
|
4136
4136
|
});
|
|
4137
4137
|
}
|
|
4138
4138
|
function Sa(r, e) {
|
|
@@ -4437,14 +4437,14 @@ class ka {
|
|
|
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 = At[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l,
|
|
4441
|
-
let
|
|
4442
|
-
if (
|
|
4443
|
-
const w = Math.floor(
|
|
4440
|
+
const a = o[0], l = vs[s.type], c = At[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, m = s.byteOffset || 0, g = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
|
|
4441
|
+
let p, h;
|
|
4442
|
+
if (g && g !== u) {
|
|
4443
|
+
const w = Math.floor(m / g), C = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + w + ":" + s.count;
|
|
4444
4444
|
let A = t.cache.get(C);
|
|
4445
|
-
A || (
|
|
4445
|
+
A || (p = new c(a, w * g, s.count * g / d), A = new _n(p, g / d), t.cache.add(C, A)), h = new $n(A, l, m % g / d, b);
|
|
4446
4446
|
} else
|
|
4447
|
-
a === null ?
|
|
4447
|
+
a === null ? p = new c(s.count * l) : p = new c(a, m, s.count * l), h = new De(p, l, b);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
4449
|
const w = vs.SCALAR, C = At[s.sparse.indices.componentType], A = s.sparse.indices.byteOffset || 0, f = s.sparse.values.byteOffset || 0, v = new C(o[1], A, s.sparse.count * w), D = new c(o[2], f, s.sparse.count * l);
|
|
4450
4450
|
a !== null && (h = new De(h.array.slice(), h.itemSize, h.normalized)), h.normalized = !1;
|
|
@@ -4452,7 +4452,7 @@ class ka {
|
|
|
4452
4452
|
const Y = v[O];
|
|
4453
4453
|
if (h.setX(Y, D[O * l]), l >= 2 && h.setY(Y, D[O * l + 1]), l >= 3 && h.setZ(Y, D[O * l + 2]), l >= 4 && h.setW(Y, D[O * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4454
4454
|
}
|
|
4455
|
-
h.normalized =
|
|
4455
|
+
h.normalized = b;
|
|
4456
4456
|
}
|
|
4457
4457
|
return h;
|
|
4458
4458
|
});
|
|
@@ -4479,8 +4479,8 @@ class ka {
|
|
|
4479
4479
|
return this.textureCache[l];
|
|
4480
4480
|
const c = this.loadImageSource(t, n).then(function(d) {
|
|
4481
4481
|
d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
|
|
4482
|
-
const
|
|
4483
|
-
return d.magFilter = Rn[
|
|
4482
|
+
const m = (i.samplers || {})[o.sampler] || {};
|
|
4483
|
+
return d.magFilter = Rn[m.magFilter] || as, d.minFilter = Rn[m.minFilter] || Bs, d.wrapS = On[m.wrapS] || it, d.wrapT = On[m.wrapT] || it, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== Gs && d.minFilter !== as, s.associations.set(d, { textures: e }), d;
|
|
4484
4484
|
}).catch(function() {
|
|
4485
4485
|
return null;
|
|
4486
4486
|
});
|
|
@@ -4495,18 +4495,18 @@ class ka {
|
|
|
4495
4495
|
if (o.bufferView !== void 0)
|
|
4496
4496
|
l = n.getDependency("bufferView", o.bufferView).then(function(u) {
|
|
4497
4497
|
c = !0;
|
|
4498
|
-
const
|
|
4499
|
-
return l = a.createObjectURL(
|
|
4498
|
+
const m = new Blob([u], { type: o.mimeType });
|
|
4499
|
+
return l = a.createObjectURL(m), l;
|
|
4500
4500
|
});
|
|
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(
|
|
4505
|
-
let
|
|
4506
|
-
t.isImageBitmapLoader === !0 && (
|
|
4507
|
-
const h = new en(
|
|
4508
|
-
h.needsUpdate = !0,
|
|
4509
|
-
}), t.load(Et.resolveURL(u, i.path),
|
|
4504
|
+
return new Promise(function(m, g) {
|
|
4505
|
+
let b = m;
|
|
4506
|
+
t.isImageBitmapLoader === !0 && (b = function(p) {
|
|
4507
|
+
const h = new en(p);
|
|
4508
|
+
h.needsUpdate = !0, m(h);
|
|
4509
|
+
}), t.load(Et.resolveURL(u, i.path), b, void 0, g);
|
|
4510
4510
|
});
|
|
4511
4511
|
}).then(function(u) {
|
|
4512
4512
|
return c === !0 && a.revokeObjectURL(l), He(u, o), u.userData.mimeType = o.mimeType || Na(o.uri), u;
|
|
@@ -4590,13 +4590,13 @@ class ka {
|
|
|
4590
4590
|
} else {
|
|
4591
4591
|
const u = i.pbrMetallicRoughness || {};
|
|
4592
4592
|
if (a.color = new le(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
4593
|
-
const
|
|
4594
|
-
a.color.setRGB(
|
|
4593
|
+
const m = u.baseColorFactor;
|
|
4594
|
+
a.color.setRGB(m[0], m[1], m[2], Fe), a.opacity = m[3];
|
|
4595
4595
|
}
|
|
4596
|
-
u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, je)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(
|
|
4597
|
-
return
|
|
4598
|
-
}), c.push(Promise.all(this._invokeAll(function(
|
|
4599
|
-
return
|
|
4596
|
+
u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, je)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), o = this._invokeOne(function(m) {
|
|
4597
|
+
return m.getMaterialType && m.getMaterialType(e);
|
|
4598
|
+
}), c.push(Promise.all(this._invokeAll(function(m) {
|
|
4599
|
+
return m.extendMaterialParams && m.extendMaterialParams(e, a);
|
|
4600
4600
|
})));
|
|
4601
4601
|
}
|
|
4602
4602
|
i.doubleSided === !0 && (a.side = Ws);
|
|
@@ -4647,8 +4647,8 @@ class ka {
|
|
|
4647
4647
|
if (u)
|
|
4648
4648
|
o.push(u.promise);
|
|
4649
4649
|
else {
|
|
4650
|
-
let
|
|
4651
|
-
c.extensions && c.extensions[V.KHR_DRACO_MESH_COMPRESSION] ?
|
|
4650
|
+
let m;
|
|
4651
|
+
c.extensions && c.extensions[V.KHR_DRACO_MESH_COMPRESSION] ? m = i(c) : m = Pn(new rt(), c, t), s[d] = { primitive: c, promise: m }, o.push(m);
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
4654
|
return Promise.all(o);
|
|
@@ -4668,36 +4668,36 @@ class ka {
|
|
|
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
|
|
4671
|
+
for (let g = 0, b = d.length; g < b; g++) {
|
|
4672
|
+
const p = d[g], h = o[g];
|
|
4673
4673
|
let w;
|
|
4674
|
-
const C = c[
|
|
4674
|
+
const C = c[g];
|
|
4675
4675
|
if (h.mode === ve.TRIANGLES || h.mode === ve.TRIANGLE_STRIP || h.mode === ve.TRIANGLE_FAN || h.mode === void 0)
|
|
4676
|
-
w = i.isSkinnedMesh === !0 ? new So(
|
|
4676
|
+
w = i.isSkinnedMesh === !0 ? new So(p, C) : new L(p, C), w.isSkinnedMesh === !0 && w.normalizeSkinWeights(), h.mode === ve.TRIANGLE_STRIP ? w.geometry = Tn(w.geometry, Jn) : h.mode === ve.TRIANGLE_FAN && (w.geometry = Tn(w.geometry, Ps));
|
|
4677
4677
|
else if (h.mode === ve.LINES)
|
|
4678
|
-
w = new Ss(
|
|
4678
|
+
w = new Ss(p, C);
|
|
4679
4679
|
else if (h.mode === ve.LINE_STRIP)
|
|
4680
|
-
w = new We(
|
|
4680
|
+
w = new We(p, C);
|
|
4681
4681
|
else if (h.mode === ve.LINE_LOOP)
|
|
4682
|
-
w = new Lo(
|
|
4682
|
+
w = new Lo(p, C);
|
|
4683
4683
|
else if (h.mode === ve.POINTS)
|
|
4684
|
-
w = new Zt(
|
|
4684
|
+
w = new Zt(p, C);
|
|
4685
4685
|
else
|
|
4686
4686
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + h.mode);
|
|
4687
4687
|
Object.keys(w.geometry.morphAttributes).length > 0 && Sa(w, i), w.name = t.createUniqueName(i.name || "mesh_" + e), He(w, i), h.extensions && $e(s, w, h), t.assignFinalMaterial(w), u.push(w);
|
|
4688
4688
|
}
|
|
4689
|
-
for (let
|
|
4690
|
-
t.associations.set(u[
|
|
4689
|
+
for (let g = 0, b = u.length; g < b; g++)
|
|
4690
|
+
t.associations.set(u[g], {
|
|
4691
4691
|
meshes: e,
|
|
4692
|
-
primitives:
|
|
4692
|
+
primitives: g
|
|
4693
4693
|
});
|
|
4694
4694
|
if (u.length === 1)
|
|
4695
4695
|
return i.extensions && $e(s, u[0], i), u[0];
|
|
4696
|
-
const
|
|
4697
|
-
i.extensions && $e(s,
|
|
4698
|
-
for (let
|
|
4699
|
-
|
|
4700
|
-
return
|
|
4696
|
+
const m = new Qt();
|
|
4697
|
+
i.extensions && $e(s, m, i), t.associations.set(m, { meshes: e });
|
|
4698
|
+
for (let g = 0, b = u.length; g < b; g++)
|
|
4699
|
+
m.add(u[g]);
|
|
4700
|
+
return m;
|
|
4701
4701
|
});
|
|
4702
4702
|
}
|
|
4703
4703
|
/**
|
|
@@ -4733,8 +4733,8 @@ class ka {
|
|
|
4733
4733
|
const u = o[c];
|
|
4734
4734
|
if (u) {
|
|
4735
4735
|
a.push(u);
|
|
4736
|
-
const
|
|
4737
|
-
i !== null &&
|
|
4736
|
+
const m = new Ce();
|
|
4737
|
+
i !== null && m.fromArray(i.array, c * 16), l.push(m);
|
|
4738
4738
|
} else
|
|
4739
4739
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
|
|
4740
4740
|
}
|
|
@@ -4750,9 +4750,9 @@ class ka {
|
|
|
4750
4750
|
*/
|
|
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
|
-
for (let u = 0,
|
|
4754
|
-
const
|
|
4755
|
-
|
|
4753
|
+
for (let u = 0, m = s.channels.length; u < m; u++) {
|
|
4754
|
+
const g = s.channels[u], b = s.samplers[g.sampler], p = g.target, h = p.node, w = s.parameters !== void 0 ? s.parameters[b.input] : b.input, C = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
|
|
4755
|
+
p.node !== void 0 && (o.push(this.getDependency("node", h)), a.push(this.getDependency("accessor", w)), l.push(this.getDependency("accessor", C)), c.push(b), d.push(p));
|
|
4756
4756
|
}
|
|
4757
4757
|
return Promise.all([
|
|
4758
4758
|
Promise.all(o),
|
|
@@ -4761,9 +4761,9 @@ class ka {
|
|
|
4761
4761
|
Promise.all(c),
|
|
4762
4762
|
Promise.all(d)
|
|
4763
4763
|
]).then(function(u) {
|
|
4764
|
-
const
|
|
4765
|
-
for (let A = 0, f =
|
|
4766
|
-
const v =
|
|
4764
|
+
const m = u[0], g = u[1], b = u[2], p = u[3], h = u[4], w = [];
|
|
4765
|
+
for (let A = 0, f = m.length; A < f; A++) {
|
|
4766
|
+
const v = m[A], D = g[A], O = b[A], T = p[A], Y = h[A];
|
|
4767
4767
|
if (v === void 0) continue;
|
|
4768
4768
|
v.updateMatrix && v.updateMatrix();
|
|
4769
4769
|
const $ = n._createAnimationTracks(v, D, O, T, Y);
|
|
@@ -4803,15 +4803,15 @@ class ka {
|
|
|
4803
4803
|
Promise.all(o),
|
|
4804
4804
|
l
|
|
4805
4805
|
]).then(function(c) {
|
|
4806
|
-
const d = c[0], u = c[1],
|
|
4807
|
-
|
|
4808
|
-
|
|
4806
|
+
const d = c[0], u = c[1], m = c[2];
|
|
4807
|
+
m !== null && d.traverse(function(g) {
|
|
4808
|
+
g.isSkinnedMesh && g.bind(m, Ha);
|
|
4809
4809
|
});
|
|
4810
|
-
for (let
|
|
4811
|
-
d.add(u[
|
|
4810
|
+
for (let g = 0, b = u.length; g < b; g++)
|
|
4811
|
+
d.add(u[g]);
|
|
4812
4812
|
if (d.userData.pivot !== void 0 && u.length > 0) {
|
|
4813
|
-
const
|
|
4814
|
-
d.pivot = new S().fromArray(
|
|
4813
|
+
const g = d.userData.pivot, b = u[0];
|
|
4814
|
+
d.pivot = new S().fromArray(g), d.position.x -= g[0], d.position.y -= g[1], d.position.z -= g[2], b.position.set(0, 0, 0), delete d.userData.pivot;
|
|
4815
4815
|
}
|
|
4816
4816
|
return d;
|
|
4817
4817
|
});
|
|
@@ -4834,7 +4834,7 @@ class ka {
|
|
|
4834
4834
|
}), this.nodeCache[e] = Promise.all(a).then(function(c) {
|
|
4835
4835
|
let d;
|
|
4836
4836
|
if (i.isBone === !0 ? d = new ko() : c.length > 1 ? d = new Qt() : c.length === 1 ? d = c[0] : d = new gt(), d !== c[0])
|
|
4837
|
-
for (let u = 0,
|
|
4837
|
+
for (let u = 0, m = c.length; u < m; u++)
|
|
4838
4838
|
d.add(c[u]);
|
|
4839
4839
|
if (i.name && (d.userData.name = i.name, d.name = o), He(d, i), i.extensions && $e(n, d, i), i.matrix !== void 0) {
|
|
4840
4840
|
const u = new Ce();
|
|
@@ -4865,16 +4865,16 @@ class ka {
|
|
|
4865
4865
|
a.push(s.getDependency("node", o[l]));
|
|
4866
4866
|
return Promise.all(a).then(function(l) {
|
|
4867
4867
|
for (let d = 0, u = l.length; d < u; d++) {
|
|
4868
|
-
const
|
|
4869
|
-
|
|
4868
|
+
const m = l[d];
|
|
4869
|
+
m.parent !== null ? i.add(ia(m)) : i.add(m);
|
|
4870
4870
|
}
|
|
4871
4871
|
const c = (d) => {
|
|
4872
4872
|
const u = /* @__PURE__ */ new Map();
|
|
4873
|
-
for (const [
|
|
4874
|
-
(
|
|
4875
|
-
return d.traverse((
|
|
4876
|
-
const
|
|
4877
|
-
|
|
4873
|
+
for (const [m, g] of s.associations)
|
|
4874
|
+
(m instanceof Dt || m instanceof en) && u.set(m, g);
|
|
4875
|
+
return d.traverse((m) => {
|
|
4876
|
+
const g = s.associations.get(m);
|
|
4877
|
+
g != null && u.set(m, g);
|
|
4878
4878
|
}), u;
|
|
4879
4879
|
};
|
|
4880
4880
|
return s.associations = c(i), i;
|
|
@@ -4882,8 +4882,8 @@ class ka {
|
|
|
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(g) {
|
|
4886
|
+
g.morphTargetInfluences && l.push(g.name ? g.name : g.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;
|
|
@@ -4911,15 +4911,15 @@ class ka {
|
|
|
4911
4911
|
}
|
|
4912
4912
|
break;
|
|
4913
4913
|
}
|
|
4914
|
-
const u = s.interpolation !== void 0 ? Ra[s.interpolation] : Xs,
|
|
4915
|
-
for (let
|
|
4916
|
-
const
|
|
4917
|
-
l[
|
|
4914
|
+
const u = s.interpolation !== void 0 ? Ra[s.interpolation] : Xs, m = this._getArrayFromAccessor(n);
|
|
4915
|
+
for (let g = 0, b = l.length; g < b; g++) {
|
|
4916
|
+
const p = new d(
|
|
4917
|
+
l[g] + "." + qe[i.path],
|
|
4918
4918
|
t.array,
|
|
4919
|
-
|
|
4919
|
+
m,
|
|
4920
4920
|
u
|
|
4921
4921
|
);
|
|
4922
|
-
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
4922
|
+
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
|
|
4923
4923
|
}
|
|
4924
4924
|
return o;
|
|
4925
4925
|
}
|
|
@@ -4964,11 +4964,11 @@ function ja(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
|
|
4968
|
-
if (
|
|
4969
|
-
if (l.setX(Math.max(Math.abs(
|
|
4970
|
-
const
|
|
4971
|
-
l.multiplyScalar(
|
|
4967
|
+
const m = t.json.accessors[u.POSITION], g = m.min, b = m.max;
|
|
4968
|
+
if (g !== void 0 && b !== void 0) {
|
|
4969
|
+
if (l.setX(Math.max(Math.abs(g[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(g[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(g[2]), Math.abs(b[2]))), m.normalized) {
|
|
4970
|
+
const p = Ns(At[m.componentType]);
|
|
4971
|
+
l.multiplyScalar(p);
|
|
4972
4972
|
}
|
|
4973
4973
|
a.max(l);
|
|
4974
4974
|
} else
|
|
@@ -5375,13 +5375,13 @@ function xi(r, e = 500) {
|
|
|
5375
5375
|
tz: n.z
|
|
5376
5376
|
},
|
|
5377
5377
|
e
|
|
5378
|
-
).easing(de.Easing.Quadratic.InOut).onUpdate((
|
|
5379
|
-
I.camera.position.set(
|
|
5378
|
+
).easing(de.Easing.Quadratic.InOut).onUpdate((m) => {
|
|
5379
|
+
I.camera.position.set(m.x, m.y, m.z), I.orbitControls.target.set(m.tx, m.ty, m.tz), I.orbitControls.update();
|
|
5380
5380
|
}).start();
|
|
5381
|
-
} catch (
|
|
5381
|
+
} catch (m) {
|
|
5382
5382
|
console.error(
|
|
5383
5383
|
"[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
|
|
5384
|
-
|
|
5384
|
+
m
|
|
5385
5385
|
);
|
|
5386
5386
|
}
|
|
5387
5387
|
}
|
|
@@ -5549,26 +5549,28 @@ function Il(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
|
|
5554
|
-
if (!
|
|
5555
|
-
(Array.isArray(
|
|
5552
|
+
if (r.traverse((b) => {
|
|
5553
|
+
const p = b.material;
|
|
5554
|
+
if (!p) return;
|
|
5555
|
+
(Array.isArray(p) ? p : [p]).forEach((w) => w && i.add(w));
|
|
5556
5556
|
}), i.size === 0)
|
|
5557
5557
|
return console.warn("[脚本动画] 目标及其子节点没有材质,无法执行透明度动画:", r.name), null;
|
|
5558
5558
|
const o = t ?? 1e3, a = Mi[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), Ks(r, ["opacity"]);
|
|
5560
|
-
const d = [...i];
|
|
5561
|
-
d.forEach((
|
|
5562
|
-
|
|
5560
|
+
const d = [...i], u = /* @__PURE__ */ new Map();
|
|
5561
|
+
d.forEach((b) => u.set(b, b.transparent)), d.forEach((b) => {
|
|
5562
|
+
b.transparent = !0, b.needsUpdate = !0;
|
|
5563
5563
|
}), I.renderer && I.scene && I.camera && I.renderer.render(I.scene, I.camera);
|
|
5564
|
-
const
|
|
5565
|
-
const
|
|
5566
|
-
return
|
|
5564
|
+
const m = Ti(r), g = d.map((b) => {
|
|
5565
|
+
const p = new de.Tween(b).to({ opacity: l }, o).easing(a).start();
|
|
5566
|
+
return m.opacity.add(p), p;
|
|
5567
5567
|
});
|
|
5568
|
-
return g.forEach((
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5568
|
+
return g.forEach((b, p) => {
|
|
5569
|
+
p === 0 ? b.onComplete(() => {
|
|
5570
|
+
m.opacity.delete(b), !c && l >= 0.999 && d.forEach((h) => {
|
|
5571
|
+
u.get(h) === !1 && (h.transparent = !1, h.needsUpdate = !0);
|
|
5572
|
+
}), c && (r.visible = !1), s == null || s(), r === I.selectedObject && (Te == null || Te(r));
|
|
5573
|
+
}) : b.onComplete(() => m.opacity.delete(b)), b.onStop(() => m.opacity.delete(b));
|
|
5572
5574
|
}), g[0] ?? null;
|
|
5573
5575
|
}
|
|
5574
5576
|
function Cl() {
|
|
@@ -5753,25 +5755,25 @@ async function Tl() {
|
|
|
5753
5755
|
const u = /* @__PURE__ */ new Map();
|
|
5754
5756
|
for (const T of l)
|
|
5755
5757
|
u.set(T, T.parent), T.parent && T.parent.remove(T);
|
|
5756
|
-
const
|
|
5758
|
+
const m = [];
|
|
5757
5759
|
r.traverse((T) => {
|
|
5758
5760
|
if (T.type === "DirectionalLight") {
|
|
5759
5761
|
const Y = T;
|
|
5760
|
-
Y.target.parent === r &&
|
|
5762
|
+
Y.target.parent === r && m.push(Y.target);
|
|
5761
5763
|
}
|
|
5762
5764
|
});
|
|
5763
|
-
for (const T of
|
|
5765
|
+
for (const T of m)
|
|
5764
5766
|
r.remove(T);
|
|
5765
|
-
const
|
|
5767
|
+
const g = /* @__PURE__ */ new Map();
|
|
5766
5768
|
for (const T of o)
|
|
5767
|
-
|
|
5768
|
-
const
|
|
5769
|
-
|
|
5769
|
+
g.set(T, T.parent), T.parent && T.parent.remove(T);
|
|
5770
|
+
const b = r.clone();
|
|
5771
|
+
b.children = b.children.filter(
|
|
5770
5772
|
(T) => T.userData.type !== "initFloor"
|
|
5771
|
-
),
|
|
5773
|
+
), b.traverse((T) => {
|
|
5772
5774
|
T.name && T.name.startsWith("DataPanel_") && T.parent && T.parent.remove(T);
|
|
5773
5775
|
});
|
|
5774
|
-
const h = await new Rt().parseAsync(
|
|
5776
|
+
const h = await new Rt().parseAsync(b, {
|
|
5775
5777
|
binary: !0,
|
|
5776
5778
|
onlyVisible: !1,
|
|
5777
5779
|
embedImages: !0
|
|
@@ -5781,10 +5783,10 @@ async function Tl() {
|
|
|
5781
5783
|
const Y = u.get(T);
|
|
5782
5784
|
Y ? Y.add(T) : r.add(T);
|
|
5783
5785
|
}
|
|
5784
|
-
for (const T of
|
|
5786
|
+
for (const T of m)
|
|
5785
5787
|
r.add(T);
|
|
5786
5788
|
for (const T of o) {
|
|
5787
|
-
const Y =
|
|
5789
|
+
const Y = g.get(T);
|
|
5788
5790
|
Y ? Y.add(T) : r.add(T);
|
|
5789
5791
|
}
|
|
5790
5792
|
t.forEach((T, Y) => {
|
|
@@ -5839,10 +5841,10 @@ function El(r) {
|
|
|
5839
5841
|
return r && typeof r == "object" && r.type === "Buffer" && Array.isArray(r.data) ? new Uint8Array(r.data).buffer : null;
|
|
5840
5842
|
}
|
|
5841
5843
|
async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
5842
|
-
var l, c, d, u,
|
|
5844
|
+
var l, c, d, u, m, g, b;
|
|
5843
5845
|
const a = El(r);
|
|
5844
5846
|
if (a) {
|
|
5845
|
-
const
|
|
5847
|
+
const p = await new ci().parseAsync(a, ""), h = p.scene || ((l = p.scenes) == null ? void 0 : l[0]), w = (c = I.scene) == null ? void 0 : c.environment;
|
|
5846
5848
|
if (I.scene = h, !h.children.some((f) => f.type === "AmbientLight"))
|
|
5847
5849
|
if (i) {
|
|
5848
5850
|
const f = new R.AmbientLight(i.color, i.intensity);
|
|
@@ -5883,7 +5885,7 @@ async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
|
5883
5885
|
};
|
|
5884
5886
|
A(h), js();
|
|
5885
5887
|
} else {
|
|
5886
|
-
const
|
|
5888
|
+
const p = typeof r == "string" ? JSON.parse(r) : r, w = new R.ObjectLoader().parse(p);
|
|
5887
5889
|
if (w.type === "Scene") {
|
|
5888
5890
|
const C = (d = I.scene) == null ? void 0 : d.environment;
|
|
5889
5891
|
if (I.scene = w, C)
|
|
@@ -5895,17 +5897,17 @@ async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
|
5895
5897
|
} else
|
|
5896
5898
|
(u = I.scene) == null || u.add(w);
|
|
5897
5899
|
}
|
|
5898
|
-
if (t && ((
|
|
5899
|
-
const h =
|
|
5900
|
-
if (w &&
|
|
5901
|
-
rl(
|
|
5900
|
+
if (t && ((m = I.scene) == null || m.traverse((p) => {
|
|
5901
|
+
const h = p.userData.id || p.userData._sourceUuid || p.uuid, w = t[h];
|
|
5902
|
+
if (w && p.userData.isMovable) {
|
|
5903
|
+
rl(p);
|
|
5902
5904
|
const C = new ls({
|
|
5903
5905
|
title: w.title,
|
|
5904
5906
|
items: w.items
|
|
5905
5907
|
});
|
|
5906
|
-
C.attachTo(
|
|
5908
|
+
C.attachTo(p), C.visible = !1, w.width && C.setWidth(w.width), w.fontSize && C.setFontSize(w.fontSize), w.offsetY !== void 0 && C.setOffsetY(w.offsetY), w.offsetX !== void 0 && C.setOffsetX(w.offsetX), w.offsetZ !== void 0 && C.setOffsetZ(w.offsetZ), oi(p, C);
|
|
5907
5909
|
}
|
|
5908
|
-
})), n && n.length > 0 && Promise.resolve().then(() => Ul).then(({ addWater:
|
|
5910
|
+
})), n && n.length > 0 && Promise.resolve().then(() => Ul).then(({ addWater: p, addWaterCylinder: h, setWaterReflection: w }) => {
|
|
5909
5911
|
for (const C of n) {
|
|
5910
5912
|
const A = C.geometryType || "box";
|
|
5911
5913
|
let f;
|
|
@@ -5916,7 +5918,7 @@ async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
|
5916
5918
|
height: 0.8,
|
|
5917
5919
|
color: C.color,
|
|
5918
5920
|
scale: 4
|
|
5919
|
-
}) : f =
|
|
5921
|
+
}) : f = p({
|
|
5920
5922
|
width: C.boxWidth ?? 10,
|
|
5921
5923
|
height: C.boxDepth ?? 10,
|
|
5922
5924
|
color: C.color,
|
|
@@ -5925,26 +5927,26 @@ async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
|
5925
5927
|
}
|
|
5926
5928
|
js();
|
|
5927
5929
|
}), s) {
|
|
5928
|
-
const
|
|
5929
|
-
(
|
|
5930
|
+
const p = new R.TextureLoader();
|
|
5931
|
+
(g = I.scene) == null || g.traverse((h) => {
|
|
5930
5932
|
if (h.type === "Mesh") {
|
|
5931
5933
|
const w = h, C = Array.isArray(w.material) ? w.material : [w.material];
|
|
5932
5934
|
for (const A of C)
|
|
5933
5935
|
if (A && A.uuid && s[A.uuid]) {
|
|
5934
5936
|
const f = s[A.uuid];
|
|
5935
5937
|
if (f.mapDataUrl) {
|
|
5936
|
-
const v =
|
|
5938
|
+
const v = p.load(f.mapDataUrl);
|
|
5937
5939
|
v.wrapS = v.wrapT = R.RepeatWrapping, v.repeat.set(1, 1), A.map = v, A.userData = A.userData || {}, A.userData._mapDataUrl = f.mapDataUrl, A.userData._mapFileName = f.mapFileName;
|
|
5938
5940
|
}
|
|
5939
5941
|
if (f.normalMapDataUrl) {
|
|
5940
|
-
const v =
|
|
5942
|
+
const v = p.load(f.normalMapDataUrl);
|
|
5941
5943
|
v.wrapS = v.wrapT = R.RepeatWrapping, v.repeat.set(1, 1), A.normalMap = v, A.normalScale = new R.Vector2(
|
|
5942
5944
|
f.normalScale ?? 1,
|
|
5943
5945
|
f.normalScale ?? 1
|
|
5944
5946
|
), A.userData = A.userData || {}, A.userData._normalMapDataUrl = f.normalMapDataUrl, A.userData._normalMapFileName = f.normalMapFileName;
|
|
5945
5947
|
}
|
|
5946
5948
|
if (f.aoMapDataUrl) {
|
|
5947
|
-
const v =
|
|
5949
|
+
const v = p.load(f.aoMapDataUrl);
|
|
5948
5950
|
v.wrapS = v.wrapT = R.RepeatWrapping, v.repeat.set(1, 1), A.aoMap = v, A.aoMapIntensity = f.aoMapIntensity ?? 1, A.userData = A.userData || {}, A.userData._aoMapDataUrl = f.aoMapDataUrl, A.userData._aoMapFileName = f.aoMapFileName;
|
|
5949
5951
|
}
|
|
5950
5952
|
A.needsUpdate = !0;
|
|
@@ -5952,10 +5954,10 @@ async function Dl(r, e = "edit", t, n, s, i, o) {
|
|
|
5952
5954
|
}
|
|
5953
5955
|
});
|
|
5954
5956
|
}
|
|
5955
|
-
o && Wa(o), e === "edit" && ((
|
|
5957
|
+
o && Wa(o), e === "edit" && ((b = I.scene) == null || b.traverse((p) => {
|
|
5956
5958
|
var h, w;
|
|
5957
|
-
if (
|
|
5958
|
-
const C =
|
|
5959
|
+
if (p.type === "DirectionalLight") {
|
|
5960
|
+
const C = p;
|
|
5959
5961
|
if (!C.userData.helper) {
|
|
5960
5962
|
C.target.parent !== I.scene && (C.target.parent && C.target.parent.remove(C.target), C.target.position.set(0, 0, 0), (h = I.scene) == null || h.add(C.target));
|
|
5961
5963
|
const A = new R.DirectionalLightHelper(C, 1);
|
|
@@ -6109,15 +6111,15 @@ function Nl() {
|
|
|
6109
6111
|
},
|
|
6110
6112
|
addFace: function(e, t, n, s, i, o, a, l, c) {
|
|
6111
6113
|
const d = this.vertices.length;
|
|
6112
|
-
let u = this.parseVertexIndex(e, d),
|
|
6113
|
-
if (this.addVertex(u,
|
|
6114
|
-
const
|
|
6115
|
-
u = this.parseNormalIndex(a,
|
|
6114
|
+
let u = this.parseVertexIndex(e, d), m = this.parseVertexIndex(t, d), g = this.parseVertexIndex(n, d);
|
|
6115
|
+
if (this.addVertex(u, m, g), this.addColor(u, m, g), a !== void 0 && a !== "") {
|
|
6116
|
+
const b = this.normals.length;
|
|
6117
|
+
u = this.parseNormalIndex(a, b), m = this.parseNormalIndex(l, b), g = this.parseNormalIndex(c, b), this.addNormal(u, m, g);
|
|
6116
6118
|
} else
|
|
6117
|
-
this.addFaceNormal(u,
|
|
6119
|
+
this.addFaceNormal(u, m, g);
|
|
6118
6120
|
if (s !== void 0 && s !== "") {
|
|
6119
|
-
const
|
|
6120
|
-
u = this.parseUVIndex(s,
|
|
6121
|
+
const b = this.uvs.length;
|
|
6122
|
+
u = this.parseUVIndex(s, b), m = this.parseUVIndex(i, b), g = this.parseUVIndex(o, b), this.addUV(u, m, g), this.object.geometry.hasUVIndices = !0;
|
|
6121
6123
|
} else
|
|
6122
6124
|
this.addDefaultUV();
|
|
6123
6125
|
},
|
|
@@ -6227,44 +6229,44 @@ class Hl extends Vs {
|
|
|
6227
6229
|
break;
|
|
6228
6230
|
}
|
|
6229
6231
|
} else if (d === "f") {
|
|
6230
|
-
const
|
|
6231
|
-
for (let
|
|
6232
|
-
const w =
|
|
6232
|
+
const m = c.slice(1).trim().split(Hn), g = [];
|
|
6233
|
+
for (let p = 0, h = m.length; p < h; p++) {
|
|
6234
|
+
const w = m[p];
|
|
6233
6235
|
if (w.length > 0) {
|
|
6234
6236
|
const C = w.split("/");
|
|
6235
|
-
|
|
6237
|
+
g.push(C);
|
|
6236
6238
|
}
|
|
6237
6239
|
}
|
|
6238
|
-
const
|
|
6239
|
-
for (let
|
|
6240
|
-
const w = p
|
|
6240
|
+
const b = g[0];
|
|
6241
|
+
for (let p = 1, h = g.length - 1; p < h; p++) {
|
|
6242
|
+
const w = g[p], C = g[p + 1];
|
|
6241
6243
|
t.addFace(
|
|
6242
|
-
|
|
6244
|
+
b[0],
|
|
6243
6245
|
w[0],
|
|
6244
6246
|
C[0],
|
|
6245
|
-
|
|
6247
|
+
b[1],
|
|
6246
6248
|
w[1],
|
|
6247
6249
|
C[1],
|
|
6248
|
-
|
|
6250
|
+
b[2],
|
|
6249
6251
|
w[2],
|
|
6250
6252
|
C[2]
|
|
6251
6253
|
);
|
|
6252
6254
|
}
|
|
6253
6255
|
} else if (d === "l") {
|
|
6254
6256
|
const u = c.substring(1).trim().split(" ");
|
|
6255
|
-
let
|
|
6256
|
-
const
|
|
6257
|
+
let m = [];
|
|
6258
|
+
const g = [];
|
|
6257
6259
|
if (c.indexOf("/") === -1)
|
|
6258
|
-
|
|
6260
|
+
m = u;
|
|
6259
6261
|
else
|
|
6260
|
-
for (let
|
|
6261
|
-
const h = u[
|
|
6262
|
-
h[0] !== "" &&
|
|
6262
|
+
for (let b = 0, p = u.length; b < p; b++) {
|
|
6263
|
+
const h = u[b].split("/");
|
|
6264
|
+
h[0] !== "" && m.push(h[0]), h[1] !== "" && g.push(h[1]);
|
|
6263
6265
|
}
|
|
6264
|
-
t.addLineGeometry(
|
|
6266
|
+
t.addLineGeometry(m, g);
|
|
6265
6267
|
} else if (d === "p") {
|
|
6266
|
-
const
|
|
6267
|
-
t.addPointGeometry(
|
|
6268
|
+
const m = c.slice(1).trim().split(" ");
|
|
6269
|
+
t.addPointGeometry(m);
|
|
6268
6270
|
} else if ((s = Ol.exec(c)) !== null) {
|
|
6269
6271
|
const u = (" " + s[0].slice(1).trim()).slice(1);
|
|
6270
6272
|
t.startObject(u);
|
|
@@ -6276,8 +6278,8 @@ class Hl extends Vs {
|
|
|
6276
6278
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
6277
6279
|
else if (d === "s") {
|
|
6278
6280
|
if (s = c.split(" "), s.length > 1) {
|
|
6279
|
-
const
|
|
6280
|
-
t.object.smooth =
|
|
6281
|
+
const m = s[1].trim().toLowerCase();
|
|
6282
|
+
t.object.smooth = m !== "0" && m !== "off";
|
|
6281
6283
|
} else
|
|
6282
6284
|
t.object.smooth = !0;
|
|
6283
6285
|
const u = t.object.currentMaterial();
|
|
@@ -6291,35 +6293,35 @@ class Hl extends Vs {
|
|
|
6291
6293
|
const i = new Qt();
|
|
6292
6294
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
6293
6295
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
6294
|
-
const c = t.objects[a], d = c.geometry, u = c.materials,
|
|
6295
|
-
let
|
|
6296
|
+
const c = t.objects[a], d = c.geometry, u = c.materials, m = d.type === "Line", g = d.type === "Points";
|
|
6297
|
+
let b = !1;
|
|
6296
6298
|
if (d.vertices.length === 0) continue;
|
|
6297
|
-
const
|
|
6298
|
-
|
|
6299
|
+
const p = new rt();
|
|
6300
|
+
p.setAttribute("position", new ke(d.vertices, 3)), d.normals.length > 0 && p.setAttribute("normal", new ke(d.normals, 3)), d.colors.length > 0 && (b = !0, p.setAttribute("color", new ke(d.colors, 3))), d.hasUVIndices === !0 && p.setAttribute("uv", new ke(d.uvs, 2));
|
|
6299
6301
|
const h = [];
|
|
6300
6302
|
for (let C = 0, A = u.length; C < A; C++) {
|
|
6301
|
-
const f = u[C], v = f.name + "_" + f.smooth + "_" +
|
|
6303
|
+
const f = u[C], v = f.name + "_" + f.smooth + "_" + b;
|
|
6302
6304
|
let D = t.materials[v];
|
|
6303
6305
|
if (this.materials !== null) {
|
|
6304
|
-
if (D = this.materials.create(f.name),
|
|
6306
|
+
if (D = this.materials.create(f.name), m && D && !(D instanceof Tt)) {
|
|
6305
6307
|
const O = new Tt();
|
|
6306
6308
|
Dt.prototype.copy.call(O, D), O.color.copy(D.color), D = O;
|
|
6307
|
-
} else if (
|
|
6309
|
+
} else if (g && D && !(D instanceof Ct)) {
|
|
6308
6310
|
const O = new Ct({ size: 10, sizeAttenuation: !1 });
|
|
6309
6311
|
Dt.prototype.copy.call(O, D), O.color.copy(D.color), O.map = D.map, D = O;
|
|
6310
6312
|
}
|
|
6311
6313
|
}
|
|
6312
|
-
D === void 0 && (
|
|
6314
|
+
D === void 0 && (m ? D = new Tt() : g ? D = new Ct({ size: 1, sizeAttenuation: !1 }) : D = new zo(), D.name = f.name, D.flatShading = !f.smooth, D.vertexColors = b, t.materials[v] = D), h.push(D);
|
|
6313
6315
|
}
|
|
6314
6316
|
let w;
|
|
6315
6317
|
if (h.length > 1) {
|
|
6316
6318
|
for (let C = 0, A = u.length; C < A; C++) {
|
|
6317
6319
|
const f = u[C];
|
|
6318
|
-
|
|
6320
|
+
p.addGroup(f.groupStart, f.groupCount, C);
|
|
6319
6321
|
}
|
|
6320
|
-
|
|
6322
|
+
m ? w = new Ss(p, h) : g ? w = new Zt(p, h) : w = new L(p, h);
|
|
6321
6323
|
} else
|
|
6322
|
-
|
|
6324
|
+
m ? w = new Ss(p, h[0]) : g ? w = new Zt(p, h[0]) : w = new L(p, h[0]);
|
|
6323
6325
|
w.name = c.name, i.add(w);
|
|
6324
6326
|
}
|
|
6325
6327
|
else if (t.vertices.length > 0) {
|
|
@@ -6538,14 +6540,14 @@ function jl() {
|
|
|
6538
6540
|
case "decode":
|
|
6539
6541
|
const l = a.buffer, c = a.taskConfig;
|
|
6540
6542
|
e.then((d) => {
|
|
6541
|
-
const u = d.draco,
|
|
6543
|
+
const u = d.draco, m = new u.Decoder();
|
|
6542
6544
|
try {
|
|
6543
|
-
const
|
|
6544
|
-
|
|
6545
|
-
} catch (
|
|
6546
|
-
console.error(
|
|
6545
|
+
const g = t(u, m, new Int8Array(l), c), b = g.attributes.map((p) => p.array.buffer);
|
|
6546
|
+
g.index && b.push(g.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: g }, b);
|
|
6547
|
+
} catch (g) {
|
|
6548
|
+
console.error(g), self.postMessage({ type: "error", id: a.id, error: g.message });
|
|
6547
6549
|
} finally {
|
|
6548
|
-
u.destroy(
|
|
6550
|
+
u.destroy(m);
|
|
6549
6551
|
}
|
|
6550
6552
|
});
|
|
6551
6553
|
break;
|
|
@@ -6553,57 +6555,57 @@ function jl() {
|
|
|
6553
6555
|
};
|
|
6554
6556
|
function t(o, a, l, c) {
|
|
6555
6557
|
const d = c.attributeIDs, u = c.attributeTypes;
|
|
6556
|
-
let
|
|
6557
|
-
const
|
|
6558
|
-
if (
|
|
6559
|
-
|
|
6560
|
-
else if (
|
|
6561
|
-
|
|
6558
|
+
let m, g;
|
|
6559
|
+
const b = a.GetEncodedGeometryType(l);
|
|
6560
|
+
if (b === o.TRIANGULAR_MESH)
|
|
6561
|
+
m = new o.Mesh(), g = a.DecodeArrayToMesh(l, l.byteLength, m);
|
|
6562
|
+
else if (b === o.POINT_CLOUD)
|
|
6563
|
+
m = new o.PointCloud(), g = a.DecodeArrayToPointCloud(l, l.byteLength, m);
|
|
6562
6564
|
else
|
|
6563
6565
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
6564
|
-
if (!
|
|
6565
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
6566
|
-
const
|
|
6566
|
+
if (!g.ok() || m.ptr === 0)
|
|
6567
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + g.error_msg());
|
|
6568
|
+
const p = { index: null, attributes: [] };
|
|
6567
6569
|
for (const h in d) {
|
|
6568
6570
|
const w = self[u[h]];
|
|
6569
6571
|
let C, A;
|
|
6570
6572
|
if (c.useUniqueIDs)
|
|
6571
|
-
A = d[h], C = a.GetAttributeByUniqueId(
|
|
6573
|
+
A = d[h], C = a.GetAttributeByUniqueId(m, A);
|
|
6572
6574
|
else {
|
|
6573
|
-
if (A = a.GetAttributeId(
|
|
6574
|
-
C = a.GetAttribute(
|
|
6575
|
+
if (A = a.GetAttributeId(m, o[d[h]]), A === -1) continue;
|
|
6576
|
+
C = a.GetAttribute(m, A);
|
|
6575
6577
|
}
|
|
6576
|
-
const f = s(o, a,
|
|
6577
|
-
h === "color" && (f.vertexColorSpace = c.vertexColorSpace),
|
|
6578
|
+
const f = s(o, a, m, h, w, C);
|
|
6579
|
+
h === "color" && (f.vertexColorSpace = c.vertexColorSpace), p.attributes.push(f);
|
|
6578
6580
|
}
|
|
6579
|
-
return
|
|
6581
|
+
return b === o.TRIANGULAR_MESH && (p.index = n(o, a, m)), o.destroy(m), p;
|
|
6580
6582
|
}
|
|
6581
6583
|
function n(o, a, l) {
|
|
6582
|
-
const d = l.num_faces() * 3, u = d * 4,
|
|
6583
|
-
a.GetTrianglesUInt32Array(l, u,
|
|
6584
|
-
const
|
|
6585
|
-
return o._free(
|
|
6584
|
+
const d = l.num_faces() * 3, u = d * 4, m = o._malloc(u);
|
|
6585
|
+
a.GetTrianglesUInt32Array(l, u, m);
|
|
6586
|
+
const g = new Uint32Array(o.HEAPF32.buffer, m, d).slice();
|
|
6587
|
+
return o._free(m), { array: g, itemSize: 1 };
|
|
6586
6588
|
}
|
|
6587
6589
|
function s(o, a, l, c, d, u) {
|
|
6588
|
-
const
|
|
6589
|
-
a.GetAttributeDataArrayForAllPoints(l, u,
|
|
6590
|
+
const m = l.num_points(), g = u.num_components(), b = i(o, d), p = g * d.BYTES_PER_ELEMENT, h = Math.ceil(p / 4) * 4, w = h / d.BYTES_PER_ELEMENT, C = m * p, A = m * h, f = o._malloc(C);
|
|
6591
|
+
a.GetAttributeDataArrayForAllPoints(l, u, b, C, f);
|
|
6590
6592
|
const v = new d(o.HEAPF32.buffer, f, C / d.BYTES_PER_ELEMENT);
|
|
6591
6593
|
let D;
|
|
6592
|
-
if (
|
|
6594
|
+
if (p === h)
|
|
6593
6595
|
D = v.slice();
|
|
6594
6596
|
else {
|
|
6595
6597
|
D = new d(A / d.BYTES_PER_ELEMENT);
|
|
6596
6598
|
let O = 0;
|
|
6597
6599
|
for (let T = 0, Y = v.length; T < Y; T++) {
|
|
6598
|
-
for (let $ = 0; $ <
|
|
6599
|
-
D[O + $] = v[T *
|
|
6600
|
+
for (let $ = 0; $ < g; $++)
|
|
6601
|
+
D[O + $] = v[T * g + $];
|
|
6600
6602
|
O += w;
|
|
6601
6603
|
}
|
|
6602
6604
|
}
|
|
6603
6605
|
return o._free(f), {
|
|
6604
6606
|
name: c,
|
|
6605
|
-
count:
|
|
6606
|
-
itemSize:
|
|
6607
|
+
count: m,
|
|
6608
|
+
itemSize: g,
|
|
6607
6609
|
array: D,
|
|
6608
6610
|
stride: w
|
|
6609
6611
|
};
|
|
@@ -6636,7 +6638,7 @@ class Fl extends L {
|
|
|
6636
6638
|
*/
|
|
6637
6639
|
constructor(e, t = {}) {
|
|
6638
6640
|
super(e), this.isWater = !0;
|
|
6639
|
-
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 S(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215),
|
|
6641
|
+
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 S(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), m = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), g = t.eye !== void 0 ? t.eye : new S(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, p = t.side !== void 0 ? t.side : si, h = t.fog !== void 0 ? t.fog : !1, w = new Wn(), C = new S(), A = new S(), f = new S(), v = new Ce(), D = new S(0, 0, -1), O = new on(), T = new S(), Y = new S(), $ = new on(), se = new Ce(), ne = new ti(), J = new Bn(s, i, { type: Xn }), Z = {
|
|
6640
6642
|
name: "MirrorShader",
|
|
6641
6643
|
uniforms: os.merge([
|
|
6642
6644
|
rn.fog,
|
|
@@ -6765,10 +6767,10 @@ class Fl extends L {
|
|
|
6765
6767
|
vertexShader: Z.vertexShader,
|
|
6766
6768
|
fragmentShader: Z.fragmentShader,
|
|
6767
6769
|
lights: !0,
|
|
6768
|
-
side:
|
|
6770
|
+
side: p,
|
|
6769
6771
|
fog: h
|
|
6770
6772
|
});
|
|
6771
|
-
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 =
|
|
6773
|
+
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 = m, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = g, n.material = N, n.onBeforeRender = function(U, W, _) {
|
|
6772
6774
|
if (A.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(_.matrixWorld), v.extractRotation(n.matrixWorld), C.set(0, 0, 1), C.applyMatrix4(v), T.subVectors(A, f), T.dot(C) > 0) return;
|
|
6773
6775
|
T.reflect(C).negate(), T.add(A), v.extractRotation(_.matrixWorld), D.set(0, 0, -1), D.applyMatrix4(v), D.add(f), Y.subVectors(A, D), Y.reflect(C).negate(), Y.add(A), ne.position.copy(T), ne.up.set(0, 1, 0), ne.up.applyMatrix4(v), ne.up.reflect(C), ne.lookAt(Y), ne.far = _.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(_.projectionMatrix), se.set(
|
|
6774
6776
|
0.5,
|
|
@@ -6789,7 +6791,7 @@ class Fl extends L {
|
|
|
6789
6791
|
1
|
|
6790
6792
|
), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), w.setFromNormalAndCoplanarPoint(C, A), w.applyMatrix4(ne.matrixWorldInverse), O.set(w.normal.x, w.normal.y, w.normal.z, w.constant);
|
|
6791
6793
|
const B = ne.projectionMatrix;
|
|
6792
|
-
$.x = (Math.sign(O.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(O.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], O.multiplyScalar(2 / O.dot($)), B.elements[2] = O.x, B.elements[6] = O.y, B.elements[10] = O.z + 1 - o, B.elements[14] = O.w,
|
|
6794
|
+
$.x = (Math.sign(O.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(O.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], O.multiplyScalar(2 / O.dot($)), B.elements[2] = O.x, B.elements[6] = O.y, B.elements[10] = O.z + 1 - o, B.elements[14] = O.w, g.setFromMatrixPosition(_.matrixWorld);
|
|
6793
6795
|
const be = U.getRenderTarget(), Re = U.xr.enabled, Oe = U.shadowMap.autoUpdate;
|
|
6794
6796
|
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(W, ne), n.visible = !0, U.xr.enabled = Re, U.shadowMap.autoUpdate = Oe, U.setRenderTarget(be);
|
|
6795
6797
|
const Xe = _.viewport;
|
|
@@ -6880,20 +6882,20 @@ function ji(r) {
|
|
|
6880
6882
|
repeatY: l = 4,
|
|
6881
6883
|
speedX: c = 5e-4,
|
|
6882
6884
|
speedY: d = 5e-4
|
|
6883
|
-
} = r || {}, u = new R.PlaneGeometry(e, t),
|
|
6885
|
+
} = r || {}, u = new R.PlaneGeometry(e, t), g = new R.TextureLoader().load(Ri, (h) => {
|
|
6884
6886
|
h.wrapS = h.wrapT = R.RepeatWrapping, h.repeat.set(a, l), h.generateMipmaps = !1, h.minFilter = R.LinearFilter, h.magFilter = R.LinearFilter;
|
|
6885
|
-
}),
|
|
6887
|
+
}), b = new R.MeshStandardMaterial({
|
|
6886
6888
|
color: n,
|
|
6887
6889
|
roughness: s,
|
|
6888
6890
|
metalness: i,
|
|
6889
|
-
normalMap:
|
|
6891
|
+
normalMap: g,
|
|
6890
6892
|
normalScale: new R.Vector2(o, o),
|
|
6891
6893
|
side: R.DoubleSide,
|
|
6892
6894
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
6893
6895
|
transparent: !0,
|
|
6894
6896
|
opacity: 0.6
|
|
6895
|
-
}),
|
|
6896
|
-
|
|
6897
|
+
}), p = new R.Mesh(u, b);
|
|
6898
|
+
p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: c, y: d }, Be(p);
|
|
6897
6899
|
}
|
|
6898
6900
|
function Fi(r) {
|
|
6899
6901
|
const e = Fs();
|
|
@@ -7001,12 +7003,12 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7001
7003
|
},
|
|
7002
7004
|
emits: ["select", "delete"],
|
|
7003
7005
|
setup(r, { emit: e }) {
|
|
7004
|
-
const t = r, n = e, s = z(null), { expandedSet: i, toggleExpand: o } = Qi("treeExpand"), a = tt(() => i.value.has(t.node.uuid)), l = tt(() => (t.version, t.node.children.some((
|
|
7005
|
-
(
|
|
7006
|
+
const t = r, n = e, s = z(null), { expandedSet: i, toggleExpand: o } = Qi("treeExpand"), a = tt(() => i.value.has(t.node.uuid)), l = tt(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), c = tt(() => (t.version, t.node.children.filter(
|
|
7007
|
+
(p) => p.userData.isMovable === !0
|
|
7006
7008
|
))), d = tt(
|
|
7007
7009
|
() => {
|
|
7008
|
-
var
|
|
7009
|
-
return ((
|
|
7010
|
+
var p;
|
|
7011
|
+
return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
|
|
7010
7012
|
}
|
|
7011
7013
|
);
|
|
7012
7014
|
Ji(
|
|
@@ -7020,12 +7022,12 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7020
7022
|
},
|
|
7021
7023
|
{ flush: "post" }
|
|
7022
7024
|
);
|
|
7023
|
-
const u = (
|
|
7024
|
-
|
|
7025
|
-
},
|
|
7026
|
-
|
|
7027
|
-
},
|
|
7028
|
-
return (
|
|
7025
|
+
const u = (p) => {
|
|
7026
|
+
p.stopPropagation(), n("select", t.node);
|
|
7027
|
+
}, m = (p) => {
|
|
7028
|
+
p.stopPropagation(), n("delete", t.node);
|
|
7029
|
+
}, g = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", b = (p) => p.name || `${p.type} (${p.id})`;
|
|
7030
|
+
return (p, h) => {
|
|
7029
7031
|
const w = _i("TreeItem", !0);
|
|
7030
7032
|
return H(), k("div", {
|
|
7031
7033
|
class: "tree-node",
|
|
@@ -7039,21 +7041,21 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7039
7041
|
l.value ? (H(), k("span", {
|
|
7040
7042
|
key: 0,
|
|
7041
7043
|
class: "toggle-icon",
|
|
7042
|
-
onClick: h[0] || (h[0] = ns((C) => is(o)(
|
|
7044
|
+
onClick: h[0] || (h[0] = ns((C) => is(o)(p.node.uuid), ["stop"]))
|
|
7043
7045
|
}, fe(a.value ? "▼" : "▶"), 1)) : (H(), k("span", zl)),
|
|
7044
|
-
y("span", Wl, fe(p
|
|
7045
|
-
y("span", Gl, fe(
|
|
7046
|
+
y("span", Wl, fe(g(p.node)), 1),
|
|
7047
|
+
y("span", Gl, fe(b(p.node)), 1),
|
|
7046
7048
|
y("button", {
|
|
7047
7049
|
class: "tree-delete",
|
|
7048
|
-
onClick: ns(
|
|
7050
|
+
onClick: ns(m, ["stop"])
|
|
7049
7051
|
}, "×")
|
|
7050
7052
|
], 2),
|
|
7051
7053
|
a.value && l.value ? (H(), k("div", Bl, [
|
|
7052
7054
|
(H(!0), k(Ee, null, mt(c.value, (C) => (H(), Mt(w, {
|
|
7053
7055
|
key: C.uuid,
|
|
7054
7056
|
node: C,
|
|
7055
|
-
"selected-object":
|
|
7056
|
-
version:
|
|
7057
|
+
"selected-object": p.selectedObject,
|
|
7058
|
+
version: p.version,
|
|
7057
7059
|
onSelect: h[1] || (h[1] = (A) => n("select", A)),
|
|
7058
7060
|
onDelete: h[2] || (h[2] = (A) => n("delete", A))
|
|
7059
7061
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
@@ -7122,9 +7124,9 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7122
7124
|
aoIntensity: 1
|
|
7123
7125
|
}), o = z("#ffffff"), a = z(!1), l = z(!1), c = z("");
|
|
7124
7126
|
let d = null;
|
|
7125
|
-
const u = z(!1),
|
|
7126
|
-
let
|
|
7127
|
-
const
|
|
7127
|
+
const u = z(!1), m = z("");
|
|
7128
|
+
let g = null;
|
|
7129
|
+
const b = z(!1), p = z("");
|
|
7128
7130
|
let h = null;
|
|
7129
7131
|
const w = ss({
|
|
7130
7132
|
intensity: 1
|
|
@@ -7133,27 +7135,27 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7133
7135
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = w.intensity);
|
|
7134
7136
|
}
|
|
7135
7137
|
function A(E) {
|
|
7136
|
-
let
|
|
7138
|
+
let x = null;
|
|
7137
7139
|
return E.traverse((M) => {
|
|
7138
|
-
if (M.type === "Mesh" && !
|
|
7140
|
+
if (M.type === "Mesh" && !x) {
|
|
7139
7141
|
const P = M, F = Array.isArray(P.material) ? P.material : [P.material];
|
|
7140
7142
|
for (const Q of F)
|
|
7141
7143
|
if (Q && (Q.type === "MeshStandardMaterial" || Q.type === "MeshPhongMaterial" || Q.type === "MeshBasicMaterial" || Q.type === "MeshLambertMaterial" || Q.type === "MeshToonMaterial" || Q.type === "MeshPhysicalMaterial")) {
|
|
7142
|
-
|
|
7144
|
+
x = Q;
|
|
7143
7145
|
break;
|
|
7144
7146
|
}
|
|
7145
7147
|
}
|
|
7146
|
-
}),
|
|
7148
|
+
}), x;
|
|
7147
7149
|
}
|
|
7148
7150
|
function f(E) {
|
|
7149
|
-
let
|
|
7151
|
+
let x = null;
|
|
7150
7152
|
return E.traverse((M) => {
|
|
7151
|
-
if (M.type === "Mesh" && !
|
|
7153
|
+
if (M.type === "Mesh" && !x) {
|
|
7152
7154
|
const P = M, F = Array.isArray(P.material) ? P.material : [P.material];
|
|
7153
7155
|
for (const Q of F)
|
|
7154
7156
|
if (Q && (Q.type === "MeshStandardMaterial" || Q.type === "MeshPhongMaterial" || Q.type === "MeshBasicMaterial" || Q.type === "MeshLambertMaterial" || Q.type === "MeshToonMaterial" || Q.type === "MeshPhysicalMaterial")) {
|
|
7155
7157
|
const K = Q;
|
|
7156
|
-
|
|
7158
|
+
x = {
|
|
7157
7159
|
color: K.color ? K.color.getHex() : 16777215,
|
|
7158
7160
|
metalness: K.metalness ?? 0,
|
|
7159
7161
|
roughness: K.roughness ?? 0.5,
|
|
@@ -7162,15 +7164,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7162
7164
|
break;
|
|
7163
7165
|
}
|
|
7164
7166
|
}
|
|
7165
|
-
}),
|
|
7167
|
+
}), x;
|
|
7166
7168
|
}
|
|
7167
|
-
function v(E,
|
|
7169
|
+
function v(E, x) {
|
|
7168
7170
|
let M = !1;
|
|
7169
7171
|
return E.traverse((P) => {
|
|
7170
7172
|
if (P.type === "Mesh") {
|
|
7171
7173
|
const F = P, Q = Array.isArray(F.material) ? F.material : [F.material];
|
|
7172
7174
|
for (const K of Q)
|
|
7173
|
-
K && (K.type === "MeshStandardMaterial" || K.type === "MeshPhongMaterial" || K.type === "MeshBasicMaterial" || K.type === "MeshLambertMaterial" || K.type === "MeshToonMaterial" || K.type === "MeshPhysicalMaterial") && (
|
|
7175
|
+
K && (K.type === "MeshStandardMaterial" || K.type === "MeshPhongMaterial" || K.type === "MeshBasicMaterial" || K.type === "MeshLambertMaterial" || K.type === "MeshToonMaterial" || K.type === "MeshPhysicalMaterial") && (x.color !== void 0 && (K.color = new le(x.color)), x.metalness !== void 0 && (K.metalness = x.metalness), x.roughness !== void 0 && (K.roughness = x.roughness), x.opacity !== void 0 && (K.opacity = x.opacity, K.transparent = x.opacity < 1), K.needsUpdate = !0, M = !0);
|
|
7174
7176
|
}
|
|
7175
7177
|
}), M;
|
|
7176
7178
|
}
|
|
@@ -7200,34 +7202,34 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7200
7202
|
}
|
|
7201
7203
|
function Y(E) {
|
|
7202
7204
|
var M, P;
|
|
7203
|
-
const
|
|
7204
|
-
|
|
7205
|
+
const x = A(E);
|
|
7206
|
+
x && x.normalMap ? (l.value = !0, d = x.normalMap, c.value = ((M = x.userData) == null ? void 0 : M._normalMapFileName) || "法线贴图", i.normalScale = ((P = x.normalScale) == null ? void 0 : P.x) ?? 1) : (l.value = !1, d = null, c.value = "", i.normalScale = 1);
|
|
7205
7207
|
}
|
|
7206
7208
|
function $(E) {
|
|
7207
7209
|
var F;
|
|
7208
|
-
const
|
|
7210
|
+
const x = E.target, M = (F = x.files) == null ? void 0 : F[0];
|
|
7209
7211
|
if (!M || !t.selectedObject) return;
|
|
7210
7212
|
const P = new FileReader();
|
|
7211
7213
|
P.onload = (Q) => {
|
|
7212
7214
|
var me;
|
|
7213
7215
|
const K = (me = Q.target) == null ? void 0 : me.result;
|
|
7214
7216
|
se(t.selectedObject, K, M.name);
|
|
7215
|
-
}, P.readAsDataURL(M),
|
|
7217
|
+
}, P.readAsDataURL(M), x.value = "";
|
|
7216
7218
|
}
|
|
7217
|
-
function se(E,
|
|
7218
|
-
const F = new Kt().load(
|
|
7219
|
+
function se(E, x, M) {
|
|
7220
|
+
const F = new Kt().load(x);
|
|
7219
7221
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), E.traverse((Q) => {
|
|
7220
7222
|
if (Q.type === "Mesh") {
|
|
7221
7223
|
const K = Q, me = Array.isArray(K.material) ? K.material : [K.material];
|
|
7222
7224
|
for (const X of me)
|
|
7223
|
-
X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.normalMap = F, X.normalScale = new ue(i.normalScale, i.normalScale), X.userData = X.userData || {}, X.userData._normalMapDataUrl =
|
|
7225
|
+
X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.normalMap = F, X.normalScale = new ue(i.normalScale, i.normalScale), X.userData = X.userData || {}, X.userData._normalMapDataUrl = x, X.userData._normalMapFileName = M, X.needsUpdate = !0);
|
|
7224
7226
|
}
|
|
7225
7227
|
}), d = F, l.value = !0, c.value = M;
|
|
7226
7228
|
}
|
|
7227
7229
|
function ne() {
|
|
7228
7230
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
7229
7231
|
if (E.type === "Mesh") {
|
|
7230
|
-
const
|
|
7232
|
+
const x = E, M = Array.isArray(x.material) ? x.material : [x.material];
|
|
7231
7233
|
for (const P of M)
|
|
7232
7234
|
P.normalMap && (P.normalMap = null, P.userData && (delete P.userData._normalMapDataUrl, delete P.userData._normalMapFileName), P.needsUpdate = !0);
|
|
7233
7235
|
}
|
|
@@ -7236,9 +7238,9 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7236
7238
|
function J() {
|
|
7237
7239
|
if (!t.selectedObject) return;
|
|
7238
7240
|
const E = i.normalScale;
|
|
7239
|
-
t.selectedObject.traverse((
|
|
7240
|
-
if (
|
|
7241
|
-
const M =
|
|
7241
|
+
t.selectedObject.traverse((x) => {
|
|
7242
|
+
if (x.type === "Mesh") {
|
|
7243
|
+
const M = x, P = Array.isArray(M.material) ? M.material : [M.material];
|
|
7242
7244
|
for (const F of P)
|
|
7243
7245
|
F.normalMap && (F.normalScale = new ue(E, E), F.needsUpdate = !0);
|
|
7244
7246
|
}
|
|
@@ -7246,80 +7248,80 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7246
7248
|
}
|
|
7247
7249
|
function Z(E) {
|
|
7248
7250
|
var M;
|
|
7249
|
-
const
|
|
7250
|
-
|
|
7251
|
+
const x = A(E);
|
|
7252
|
+
x && x.map ? (u.value = !0, g = x.map, m.value = ((M = x.userData) == null ? void 0 : M._mapFileName) || "模型贴图") : (u.value = !1, g = null, m.value = "");
|
|
7251
7253
|
}
|
|
7252
7254
|
function N(E) {
|
|
7253
7255
|
var F;
|
|
7254
|
-
const
|
|
7256
|
+
const x = E.target, M = (F = x.files) == null ? void 0 : F[0];
|
|
7255
7257
|
if (!M || !t.selectedObject) return;
|
|
7256
7258
|
const P = new FileReader();
|
|
7257
7259
|
P.onload = (Q) => {
|
|
7258
7260
|
var me;
|
|
7259
7261
|
const K = (me = Q.target) == null ? void 0 : me.result;
|
|
7260
7262
|
U(t.selectedObject, K, M.name);
|
|
7261
|
-
}, P.readAsDataURL(M),
|
|
7263
|
+
}, P.readAsDataURL(M), x.value = "";
|
|
7262
7264
|
}
|
|
7263
|
-
function U(E,
|
|
7264
|
-
const F = new Kt().load(
|
|
7265
|
+
function U(E, x, M) {
|
|
7266
|
+
const F = new Kt().load(x);
|
|
7265
7267
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), E.traverse((Q) => {
|
|
7266
7268
|
if (Q.type === "Mesh") {
|
|
7267
7269
|
const K = Q, me = Array.isArray(K.material) ? K.material : [K.material];
|
|
7268
7270
|
for (const X of me)
|
|
7269
|
-
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 =
|
|
7271
|
+
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);
|
|
7270
7272
|
}
|
|
7271
|
-
}),
|
|
7273
|
+
}), g = F, u.value = !0, m.value = M;
|
|
7272
7274
|
}
|
|
7273
7275
|
function W() {
|
|
7274
7276
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
7275
7277
|
if (E.type === "Mesh") {
|
|
7276
|
-
const
|
|
7278
|
+
const x = E, M = Array.isArray(x.material) ? x.material : [x.material];
|
|
7277
7279
|
for (const P of M)
|
|
7278
7280
|
P.map && (P.map = null, P.userData && (delete P.userData._mapDataUrl, delete P.userData._mapFileName), P.needsUpdate = !0);
|
|
7279
7281
|
}
|
|
7280
|
-
}),
|
|
7282
|
+
}), g && (g.dispose(), g = null), u.value = !1, m.value = "");
|
|
7281
7283
|
}
|
|
7282
7284
|
function _(E) {
|
|
7283
7285
|
var M;
|
|
7284
|
-
const
|
|
7285
|
-
|
|
7286
|
+
const x = A(E);
|
|
7287
|
+
x && x.aoMap ? (b.value = !0, h = x.aoMap, p.value = ((M = x.userData) == null ? void 0 : M._aoMapFileName) || "AO 贴图", i.aoIntensity = x.aoMapIntensity ?? 1) : (b.value = !1, h = null, p.value = "", i.aoIntensity = 1);
|
|
7286
7288
|
}
|
|
7287
7289
|
function B(E) {
|
|
7288
7290
|
var F;
|
|
7289
|
-
const
|
|
7291
|
+
const x = E.target, M = (F = x.files) == null ? void 0 : F[0];
|
|
7290
7292
|
if (!M || !t.selectedObject) return;
|
|
7291
7293
|
const P = new FileReader();
|
|
7292
7294
|
P.onload = (Q) => {
|
|
7293
7295
|
var me;
|
|
7294
7296
|
const K = (me = Q.target) == null ? void 0 : me.result;
|
|
7295
7297
|
be(t.selectedObject, K, M.name);
|
|
7296
|
-
}, P.readAsDataURL(M),
|
|
7298
|
+
}, P.readAsDataURL(M), x.value = "";
|
|
7297
7299
|
}
|
|
7298
|
-
function be(E,
|
|
7299
|
-
const F = new Kt().load(
|
|
7300
|
+
function be(E, x, M) {
|
|
7301
|
+
const F = new Kt().load(x);
|
|
7300
7302
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), E.traverse((Q) => {
|
|
7301
7303
|
if (Q.type === "Mesh") {
|
|
7302
7304
|
const K = Q, me = Array.isArray(K.material) ? K.material : [K.material];
|
|
7303
7305
|
for (const X of me)
|
|
7304
|
-
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 =
|
|
7306
|
+
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);
|
|
7305
7307
|
}
|
|
7306
|
-
}), h = F,
|
|
7308
|
+
}), h = F, b.value = !0, p.value = M;
|
|
7307
7309
|
}
|
|
7308
7310
|
function Re() {
|
|
7309
7311
|
t.selectedObject && (t.selectedObject.traverse((E) => {
|
|
7310
7312
|
if (E.type === "Mesh") {
|
|
7311
|
-
const
|
|
7313
|
+
const x = E, M = Array.isArray(x.material) ? x.material : [x.material];
|
|
7312
7314
|
for (const P of M)
|
|
7313
7315
|
P.aoMap && (P.aoMap = null, P.userData && (delete P.userData._aoMapDataUrl, delete P.userData._aoMapFileName), P.needsUpdate = !0);
|
|
7314
7316
|
}
|
|
7315
|
-
}), h && (h.dispose(), h = null),
|
|
7317
|
+
}), h && (h.dispose(), h = null), b.value = !1, p.value = "");
|
|
7316
7318
|
}
|
|
7317
7319
|
function Oe() {
|
|
7318
7320
|
if (!t.selectedObject) return;
|
|
7319
7321
|
const E = i.aoIntensity;
|
|
7320
|
-
t.selectedObject.traverse((
|
|
7321
|
-
if (
|
|
7322
|
-
const M =
|
|
7322
|
+
t.selectedObject.traverse((x) => {
|
|
7323
|
+
if (x.type === "Mesh") {
|
|
7324
|
+
const M = x, P = Array.isArray(M.material) ? M.material : [M.material];
|
|
7323
7325
|
for (const F of P)
|
|
7324
7326
|
F.aoMap && (F.aoMapIntensity = E, F.needsUpdate = !0);
|
|
7325
7327
|
}
|
|
@@ -7328,18 +7330,18 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7328
7330
|
const Xe = tt(() => {
|
|
7329
7331
|
const E = t.selectedObject;
|
|
7330
7332
|
if (!E) return !1;
|
|
7331
|
-
let
|
|
7333
|
+
let x = !1;
|
|
7332
7334
|
return E.traverse((M) => {
|
|
7333
|
-
if (!
|
|
7335
|
+
if (!x && M.type === "Mesh") {
|
|
7334
7336
|
const P = M.material;
|
|
7335
|
-
P.uniforms && P.uniforms.waterColor && (
|
|
7337
|
+
P.uniforms && P.uniforms.waterColor && (x = !0);
|
|
7336
7338
|
}
|
|
7337
|
-
}),
|
|
7339
|
+
}), x;
|
|
7338
7340
|
}), Le = z("#4fc3f7"), ze = z(0.3), ct = z(!0);
|
|
7339
7341
|
function As(E) {
|
|
7340
|
-
E.traverse((
|
|
7341
|
-
if (
|
|
7342
|
-
const M =
|
|
7342
|
+
E.traverse((x) => {
|
|
7343
|
+
if (x.type === "Mesh") {
|
|
7344
|
+
const M = x.material;
|
|
7343
7345
|
if (M.uniforms && M.uniforms.waterColor) {
|
|
7344
7346
|
const P = M.uniforms.waterColor.value;
|
|
7345
7347
|
Le.value = "#" + P.getHexString();
|
|
@@ -7348,15 +7350,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7348
7350
|
});
|
|
7349
7351
|
}
|
|
7350
7352
|
function Wi(E) {
|
|
7351
|
-
E.traverse((
|
|
7352
|
-
if (
|
|
7353
|
-
const M =
|
|
7353
|
+
E.traverse((x) => {
|
|
7354
|
+
if (x.type === "Mesh") {
|
|
7355
|
+
const M = x.material;
|
|
7354
7356
|
M.uniforms && M.uniforms.alpha && (ze.value = M.uniforms.alpha.value ?? 0.3);
|
|
7355
7357
|
}
|
|
7356
7358
|
});
|
|
7357
7359
|
}
|
|
7358
|
-
function Zs(E,
|
|
7359
|
-
const M = new le(
|
|
7360
|
+
function Zs(E, x) {
|
|
7361
|
+
const M = new le(x);
|
|
7360
7362
|
E.traverse((P) => {
|
|
7361
7363
|
if (P.type === "Mesh") {
|
|
7362
7364
|
const F = P.material;
|
|
@@ -7364,11 +7366,11 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7364
7366
|
}
|
|
7365
7367
|
});
|
|
7366
7368
|
}
|
|
7367
|
-
function Gi(E,
|
|
7369
|
+
function Gi(E, x) {
|
|
7368
7370
|
E.traverse((M) => {
|
|
7369
7371
|
if (M.type === "Mesh") {
|
|
7370
7372
|
const P = M.material;
|
|
7371
|
-
P.uniforms && P.uniforms.alpha && (P.uniforms.alpha.value =
|
|
7373
|
+
P.uniforms && P.uniforms.alpha && (P.uniforms.alpha.value = x);
|
|
7372
7374
|
}
|
|
7373
7375
|
});
|
|
7374
7376
|
}
|
|
@@ -7376,15 +7378,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7376
7378
|
t.selectedObject && Gi(t.selectedObject, ze.value);
|
|
7377
7379
|
}
|
|
7378
7380
|
function Bi(E) {
|
|
7379
|
-
E.traverse((
|
|
7380
|
-
const M =
|
|
7381
|
-
M && M.uniforms && M.uniforms.mirrorSampler && (ct.value =
|
|
7381
|
+
E.traverse((x) => {
|
|
7382
|
+
const M = x.material;
|
|
7383
|
+
M && M.uniforms && M.uniforms.mirrorSampler && (ct.value = x.userData.reflectionEnabled !== !1);
|
|
7382
7384
|
});
|
|
7383
7385
|
}
|
|
7384
|
-
function Xi(E,
|
|
7386
|
+
function Xi(E, x) {
|
|
7385
7387
|
E.traverse((M) => {
|
|
7386
7388
|
const P = M.material;
|
|
7387
|
-
P && P.uniforms && P.uniforms.mirrorSampler && ki(M,
|
|
7389
|
+
P && P.uniforms && P.uniforms.mirrorSampler && ki(M, x);
|
|
7388
7390
|
});
|
|
7389
7391
|
}
|
|
7390
7392
|
function Vi() {
|
|
@@ -7402,20 +7404,20 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7402
7404
|
() => t.selectedObject,
|
|
7403
7405
|
(E) => {
|
|
7404
7406
|
if (E) {
|
|
7405
|
-
const
|
|
7406
|
-
|
|
7407
|
+
const x = f(E);
|
|
7408
|
+
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" && (w.intensity = E.intensity ?? 1), As(E), Wi(E), Bi(E);
|
|
7407
7409
|
} else
|
|
7408
|
-
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,
|
|
7410
|
+
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, m.value = "", b.value = !1, p.value = "";
|
|
7409
7411
|
},
|
|
7410
7412
|
{ immediate: !0 }
|
|
7411
|
-
), (E,
|
|
7413
|
+
), (E, x) => (H(), k("div", null, [
|
|
7412
7414
|
y("div", ql, [
|
|
7413
|
-
|
|
7415
|
+
x[22] || (x[22] = y("label", null, "位置", -1)),
|
|
7414
7416
|
y("div", Yl, [
|
|
7415
|
-
|
|
7417
|
+
x[19] || (x[19] = y("span", null, "X:", -1)),
|
|
7416
7418
|
j(y("input", {
|
|
7417
7419
|
type: "number",
|
|
7418
|
-
"onUpdate:modelValue":
|
|
7420
|
+
"onUpdate:modelValue": x[0] || (x[0] = (M) => E.transform.position.x = M),
|
|
7419
7421
|
step: "0.01",
|
|
7420
7422
|
onInput: s
|
|
7421
7423
|
}, null, 544), [
|
|
@@ -7426,10 +7428,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7426
7428
|
{ number: !0 }
|
|
7427
7429
|
]
|
|
7428
7430
|
]),
|
|
7429
|
-
|
|
7431
|
+
x[20] || (x[20] = y("span", null, "Y:", -1)),
|
|
7430
7432
|
j(y("input", {
|
|
7431
7433
|
type: "number",
|
|
7432
|
-
"onUpdate:modelValue":
|
|
7434
|
+
"onUpdate:modelValue": x[1] || (x[1] = (M) => E.transform.position.y = M),
|
|
7433
7435
|
step: "0.01",
|
|
7434
7436
|
onInput: s
|
|
7435
7437
|
}, null, 544), [
|
|
@@ -7440,10 +7442,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7440
7442
|
{ number: !0 }
|
|
7441
7443
|
]
|
|
7442
7444
|
]),
|
|
7443
|
-
|
|
7445
|
+
x[21] || (x[21] = y("span", null, "Z:", -1)),
|
|
7444
7446
|
j(y("input", {
|
|
7445
7447
|
type: "number",
|
|
7446
|
-
"onUpdate:modelValue":
|
|
7448
|
+
"onUpdate:modelValue": x[2] || (x[2] = (M) => E.transform.position.z = M),
|
|
7447
7449
|
step: "0.01",
|
|
7448
7450
|
onInput: s
|
|
7449
7451
|
}, null, 544), [
|
|
@@ -7457,12 +7459,12 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7457
7459
|
])
|
|
7458
7460
|
]),
|
|
7459
7461
|
y("div", Kl, [
|
|
7460
|
-
|
|
7462
|
+
x[26] || (x[26] = y("label", null, "旋转 (弧度)", -1)),
|
|
7461
7463
|
y("div", Zl, [
|
|
7462
|
-
|
|
7464
|
+
x[23] || (x[23] = y("span", null, "X:", -1)),
|
|
7463
7465
|
j(y("input", {
|
|
7464
7466
|
type: "number",
|
|
7465
|
-
"onUpdate:modelValue":
|
|
7467
|
+
"onUpdate:modelValue": x[3] || (x[3] = (M) => E.transform.rotation.x = M),
|
|
7466
7468
|
step: "0.01",
|
|
7467
7469
|
onInput: s
|
|
7468
7470
|
}, null, 544), [
|
|
@@ -7473,10 +7475,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7473
7475
|
{ number: !0 }
|
|
7474
7476
|
]
|
|
7475
7477
|
]),
|
|
7476
|
-
|
|
7478
|
+
x[24] || (x[24] = y("span", null, "Y:", -1)),
|
|
7477
7479
|
j(y("input", {
|
|
7478
7480
|
type: "number",
|
|
7479
|
-
"onUpdate:modelValue":
|
|
7481
|
+
"onUpdate:modelValue": x[4] || (x[4] = (M) => E.transform.rotation.y = M),
|
|
7480
7482
|
step: "0.01",
|
|
7481
7483
|
onInput: s
|
|
7482
7484
|
}, null, 544), [
|
|
@@ -7487,10 +7489,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7487
7489
|
{ number: !0 }
|
|
7488
7490
|
]
|
|
7489
7491
|
]),
|
|
7490
|
-
|
|
7492
|
+
x[25] || (x[25] = y("span", null, "Z:", -1)),
|
|
7491
7493
|
j(y("input", {
|
|
7492
7494
|
type: "number",
|
|
7493
|
-
"onUpdate:modelValue":
|
|
7495
|
+
"onUpdate:modelValue": x[5] || (x[5] = (M) => E.transform.rotation.z = M),
|
|
7494
7496
|
step: "0.01",
|
|
7495
7497
|
onInput: s
|
|
7496
7498
|
}, null, 544), [
|
|
@@ -7504,12 +7506,12 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7504
7506
|
])
|
|
7505
7507
|
]),
|
|
7506
7508
|
y("div", Ql, [
|
|
7507
|
-
|
|
7509
|
+
x[30] || (x[30] = y("label", null, "缩放", -1)),
|
|
7508
7510
|
y("div", Jl, [
|
|
7509
|
-
|
|
7511
|
+
x[27] || (x[27] = y("span", null, "X:", -1)),
|
|
7510
7512
|
j(y("input", {
|
|
7511
7513
|
type: "number",
|
|
7512
|
-
"onUpdate:modelValue":
|
|
7514
|
+
"onUpdate:modelValue": x[6] || (x[6] = (M) => E.transform.scale.x = M),
|
|
7513
7515
|
step: "0.01",
|
|
7514
7516
|
onInput: s
|
|
7515
7517
|
}, null, 544), [
|
|
@@ -7520,10 +7522,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7520
7522
|
{ number: !0 }
|
|
7521
7523
|
]
|
|
7522
7524
|
]),
|
|
7523
|
-
|
|
7525
|
+
x[28] || (x[28] = y("span", null, "Y:", -1)),
|
|
7524
7526
|
j(y("input", {
|
|
7525
7527
|
type: "number",
|
|
7526
|
-
"onUpdate:modelValue":
|
|
7528
|
+
"onUpdate:modelValue": x[7] || (x[7] = (M) => E.transform.scale.y = M),
|
|
7527
7529
|
step: "0.01",
|
|
7528
7530
|
onInput: s
|
|
7529
7531
|
}, null, 544), [
|
|
@@ -7534,10 +7536,10 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7534
7536
|
{ number: !0 }
|
|
7535
7537
|
]
|
|
7536
7538
|
]),
|
|
7537
|
-
|
|
7539
|
+
x[29] || (x[29] = y("span", null, "Z:", -1)),
|
|
7538
7540
|
j(y("input", {
|
|
7539
7541
|
type: "number",
|
|
7540
|
-
"onUpdate:modelValue":
|
|
7542
|
+
"onUpdate:modelValue": x[8] || (x[8] = (M) => E.transform.scale.z = M),
|
|
7541
7543
|
step: "0.01",
|
|
7542
7544
|
onInput: s
|
|
7543
7545
|
}, null, 544), [
|
|
@@ -7551,15 +7553,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7551
7553
|
])
|
|
7552
7554
|
]),
|
|
7553
7555
|
E.selectedObject && E.selectedObject.type === "DirectionalLight" ? (H(), k("div", _l, [
|
|
7554
|
-
|
|
7556
|
+
x[32] || (x[32] = y("label", null, "光源属性", -1)),
|
|
7555
7557
|
y("div", $l, [
|
|
7556
|
-
|
|
7558
|
+
x[31] || (x[31] = y("span", { class: "slider-label" }, "强度", -1)),
|
|
7557
7559
|
j(y("input", {
|
|
7558
7560
|
type: "range",
|
|
7559
7561
|
min: "0",
|
|
7560
7562
|
max: "10",
|
|
7561
7563
|
step: "0.1",
|
|
7562
|
-
"onUpdate:modelValue":
|
|
7564
|
+
"onUpdate:modelValue": x[9] || (x[9] = (M) => w.intensity = M),
|
|
7563
7565
|
onInput: C
|
|
7564
7566
|
}, null, 544), [
|
|
7565
7567
|
[
|
|
@@ -7574,7 +7576,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7574
7576
|
min: "0",
|
|
7575
7577
|
max: "100",
|
|
7576
7578
|
step: "0.1",
|
|
7577
|
-
"onUpdate:modelValue":
|
|
7579
|
+
"onUpdate:modelValue": x[10] || (x[10] = (M) => w.intensity = M),
|
|
7578
7580
|
class: "intensity-input",
|
|
7579
7581
|
onInput: C
|
|
7580
7582
|
}, null, 544), [
|
|
@@ -7588,9 +7590,9 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7588
7590
|
])
|
|
7589
7591
|
])) : re("", !0),
|
|
7590
7592
|
E.selectedObject ? (H(), k("div", ec, [
|
|
7591
|
-
|
|
7593
|
+
x[48] || (x[48] = y("label", null, "材质", -1)),
|
|
7592
7594
|
y("div", tc, [
|
|
7593
|
-
|
|
7595
|
+
x[33] || (x[33] = y("span", { class: "slider-label" }, "颜色", -1)),
|
|
7594
7596
|
y("input", {
|
|
7595
7597
|
type: "color",
|
|
7596
7598
|
value: o.value,
|
|
@@ -7606,13 +7608,13 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7606
7608
|
}, null, 40, nc)
|
|
7607
7609
|
]),
|
|
7608
7610
|
y("div", ic, [
|
|
7609
|
-
|
|
7611
|
+
x[34] || (x[34] = y("span", { class: "slider-label" }, "金属度", -1)),
|
|
7610
7612
|
j(y("input", {
|
|
7611
7613
|
type: "range",
|
|
7612
7614
|
min: "0",
|
|
7613
7615
|
max: "1",
|
|
7614
7616
|
step: "0.01",
|
|
7615
|
-
"onUpdate:modelValue":
|
|
7617
|
+
"onUpdate:modelValue": x[11] || (x[11] = (M) => i.metalness = M),
|
|
7616
7618
|
onInput: D
|
|
7617
7619
|
}, null, 544), [
|
|
7618
7620
|
[
|
|
@@ -7625,13 +7627,13 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7625
7627
|
y("span", oc, fe(i.metalness.toFixed(2)), 1)
|
|
7626
7628
|
]),
|
|
7627
7629
|
y("div", rc, [
|
|
7628
|
-
|
|
7630
|
+
x[35] || (x[35] = y("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
7629
7631
|
j(y("input", {
|
|
7630
7632
|
type: "range",
|
|
7631
7633
|
min: "0",
|
|
7632
7634
|
max: "1",
|
|
7633
7635
|
step: "0.01",
|
|
7634
|
-
"onUpdate:modelValue":
|
|
7636
|
+
"onUpdate:modelValue": x[12] || (x[12] = (M) => i.roughness = M),
|
|
7635
7637
|
onInput: D
|
|
7636
7638
|
}, null, 544), [
|
|
7637
7639
|
[
|
|
@@ -7644,13 +7646,13 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7644
7646
|
y("span", ac, fe(i.roughness.toFixed(2)), 1)
|
|
7645
7647
|
]),
|
|
7646
7648
|
y("div", lc, [
|
|
7647
|
-
|
|
7649
|
+
x[36] || (x[36] = y("span", { class: "slider-label" }, "透明度", -1)),
|
|
7648
7650
|
j(y("input", {
|
|
7649
7651
|
type: "range",
|
|
7650
7652
|
min: "0",
|
|
7651
7653
|
max: "1",
|
|
7652
7654
|
step: "0.01",
|
|
7653
|
-
"onUpdate:modelValue":
|
|
7655
|
+
"onUpdate:modelValue": x[13] || (x[13] = (M) => i.opacity = M),
|
|
7654
7656
|
onInput: D
|
|
7655
7657
|
}, null, 544), [
|
|
7656
7658
|
[
|
|
@@ -7663,7 +7665,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7663
7665
|
y("span", cc, fe(i.opacity.toFixed(2)), 1)
|
|
7664
7666
|
]),
|
|
7665
7667
|
y("div", uc, [
|
|
7666
|
-
|
|
7668
|
+
x[39] || (x[39] = y("span", { class: "slider-label" }, "法线贴图", -1)),
|
|
7667
7669
|
y("div", dc, [
|
|
7668
7670
|
l.value ? (H(), k(Ee, { key: 1 }, [
|
|
7669
7671
|
y("label", hc, [
|
|
@@ -7674,7 +7676,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7674
7676
|
class: "texture-file-input"
|
|
7675
7677
|
}, null, 32),
|
|
7676
7678
|
y("span", pc, fe(c.value), 1),
|
|
7677
|
-
|
|
7679
|
+
x[38] || (x[38] = y("span", { class: "modify-hint" }, "修改", -1))
|
|
7678
7680
|
]),
|
|
7679
7681
|
y("button", {
|
|
7680
7682
|
class: "texture-remove-btn",
|
|
@@ -7688,18 +7690,18 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7688
7690
|
onChange: $,
|
|
7689
7691
|
class: "texture-file-input"
|
|
7690
7692
|
}, null, 32),
|
|
7691
|
-
|
|
7693
|
+
x[37] || (x[37] = ms(" + 选择 "))
|
|
7692
7694
|
]))
|
|
7693
7695
|
])
|
|
7694
7696
|
]),
|
|
7695
7697
|
l.value ? (H(), k("div", Ac, [
|
|
7696
|
-
|
|
7698
|
+
x[40] || (x[40] = y("span", { class: "slider-label" }, "法线强度", -1)),
|
|
7697
7699
|
j(y("input", {
|
|
7698
7700
|
type: "range",
|
|
7699
7701
|
min: "0",
|
|
7700
7702
|
max: "5",
|
|
7701
7703
|
step: "0.01",
|
|
7702
|
-
"onUpdate:modelValue":
|
|
7704
|
+
"onUpdate:modelValue": x[14] || (x[14] = (M) => i.normalScale = M),
|
|
7703
7705
|
onInput: J
|
|
7704
7706
|
}, null, 544), [
|
|
7705
7707
|
[
|
|
@@ -7712,9 +7714,9 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7712
7714
|
y("span", mc, fe(i.normalScale.toFixed(2)), 1)
|
|
7713
7715
|
])) : re("", !0),
|
|
7714
7716
|
y("div", gc, [
|
|
7715
|
-
|
|
7717
|
+
x[43] || (x[43] = y("span", { class: "slider-label" }, "AO 贴图", -1)),
|
|
7716
7718
|
y("div", yc, [
|
|
7717
|
-
|
|
7719
|
+
b.value ? (H(), k(Ee, { key: 1 }, [
|
|
7718
7720
|
y("label", xc, [
|
|
7719
7721
|
y("input", {
|
|
7720
7722
|
type: "file",
|
|
@@ -7722,8 +7724,8 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7722
7724
|
onChange: B,
|
|
7723
7725
|
class: "texture-file-input"
|
|
7724
7726
|
}, null, 32),
|
|
7725
|
-
y("span", Ic, fe(
|
|
7726
|
-
|
|
7727
|
+
y("span", Ic, fe(p.value), 1),
|
|
7728
|
+
x[42] || (x[42] = y("span", { class: "modify-hint" }, "修改", -1))
|
|
7727
7729
|
]),
|
|
7728
7730
|
y("button", {
|
|
7729
7731
|
class: "texture-remove-btn",
|
|
@@ -7737,18 +7739,18 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7737
7739
|
onChange: B,
|
|
7738
7740
|
class: "texture-file-input"
|
|
7739
7741
|
}, null, 32),
|
|
7740
|
-
|
|
7742
|
+
x[41] || (x[41] = ms(" + 选择 "))
|
|
7741
7743
|
]))
|
|
7742
7744
|
])
|
|
7743
7745
|
]),
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
+
b.value ? (H(), k("div", Cc, [
|
|
7747
|
+
x[44] || (x[44] = y("span", { class: "slider-label" }, "AO 强度", -1)),
|
|
7746
7748
|
j(y("input", {
|
|
7747
7749
|
type: "range",
|
|
7748
7750
|
min: "0",
|
|
7749
7751
|
max: "1",
|
|
7750
7752
|
step: "0.01",
|
|
7751
|
-
"onUpdate:modelValue":
|
|
7753
|
+
"onUpdate:modelValue": x[15] || (x[15] = (M) => i.aoIntensity = M),
|
|
7752
7754
|
onInput: Oe
|
|
7753
7755
|
}, null, 544), [
|
|
7754
7756
|
[
|
|
@@ -7761,7 +7763,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7761
7763
|
y("span", wc, fe(i.aoIntensity.toFixed(2)), 1)
|
|
7762
7764
|
])) : re("", !0),
|
|
7763
7765
|
y("div", vc, [
|
|
7764
|
-
|
|
7766
|
+
x[47] || (x[47] = y("span", { class: "slider-label" }, "模型贴图", -1)),
|
|
7765
7767
|
y("div", Mc, [
|
|
7766
7768
|
u.value ? (H(), k(Ee, { key: 1 }, [
|
|
7767
7769
|
y("label", Ec, [
|
|
@@ -7771,8 +7773,8 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7771
7773
|
onChange: N,
|
|
7772
7774
|
class: "texture-file-input"
|
|
7773
7775
|
}, null, 32),
|
|
7774
|
-
y("span", Dc, fe(
|
|
7775
|
-
|
|
7776
|
+
y("span", Dc, fe(m.value), 1),
|
|
7777
|
+
x[46] || (x[46] = y("span", { class: "modify-hint" }, "修改", -1))
|
|
7776
7778
|
]),
|
|
7777
7779
|
y("button", {
|
|
7778
7780
|
class: "texture-remove-btn",
|
|
@@ -7786,16 +7788,16 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7786
7788
|
onChange: N,
|
|
7787
7789
|
class: "texture-file-input"
|
|
7788
7790
|
}, null, 32),
|
|
7789
|
-
|
|
7791
|
+
x[45] || (x[45] = ms(" + 选择 "))
|
|
7790
7792
|
]))
|
|
7791
7793
|
])
|
|
7792
7794
|
]),
|
|
7793
7795
|
a.value ? re("", !0) : (H(), k("div", Rc, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
7794
7796
|
])) : re("", !0),
|
|
7795
7797
|
Xe.value ? (H(), k("div", Oc, [
|
|
7796
|
-
|
|
7798
|
+
x[54] || (x[54] = y("label", null, "水体属性", -1)),
|
|
7797
7799
|
y("div", Pc, [
|
|
7798
|
-
|
|
7800
|
+
x[49] || (x[49] = y("span", { class: "slider-label" }, "水体颜色", -1)),
|
|
7799
7801
|
y("input", {
|
|
7800
7802
|
type: "color",
|
|
7801
7803
|
value: Le.value,
|
|
@@ -7811,13 +7813,13 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7811
7813
|
}, null, 40, Lc)
|
|
7812
7814
|
]),
|
|
7813
7815
|
y("div", Nc, [
|
|
7814
|
-
|
|
7816
|
+
x[50] || (x[50] = y("span", { class: "slider-label" }, "浑浊度", -1)),
|
|
7815
7817
|
j(y("input", {
|
|
7816
7818
|
type: "range",
|
|
7817
7819
|
min: "0",
|
|
7818
7820
|
max: "1",
|
|
7819
7821
|
step: "0.01",
|
|
7820
|
-
"onUpdate:modelValue":
|
|
7822
|
+
"onUpdate:modelValue": x[16] || (x[16] = (M) => ze.value = M),
|
|
7821
7823
|
onInput: Qs
|
|
7822
7824
|
}, null, 544), [
|
|
7823
7825
|
[
|
|
@@ -7832,7 +7834,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7832
7834
|
min: "0",
|
|
7833
7835
|
max: "1",
|
|
7834
7836
|
step: "0.01",
|
|
7835
|
-
"onUpdate:modelValue":
|
|
7837
|
+
"onUpdate:modelValue": x[17] || (x[17] = (M) => ze.value = M),
|
|
7836
7838
|
onInput: Qs,
|
|
7837
7839
|
class: "intensity-input"
|
|
7838
7840
|
}, null, 544), [
|
|
@@ -7845,20 +7847,20 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7845
7847
|
])
|
|
7846
7848
|
]),
|
|
7847
7849
|
y("div", Hc, [
|
|
7848
|
-
|
|
7850
|
+
x[52] || (x[52] = y("span", { class: "slider-label" }, "实时反射", -1)),
|
|
7849
7851
|
y("label", kc, [
|
|
7850
7852
|
j(y("input", {
|
|
7851
7853
|
type: "checkbox",
|
|
7852
|
-
"onUpdate:modelValue":
|
|
7854
|
+
"onUpdate:modelValue": x[18] || (x[18] = (M) => ct.value = M),
|
|
7853
7855
|
onChange: Vi
|
|
7854
7856
|
}, null, 544), [
|
|
7855
7857
|
[Un, ct.value]
|
|
7856
7858
|
]),
|
|
7857
|
-
|
|
7859
|
+
x[51] || (x[51] = y("span", { class: "slider" }, null, -1))
|
|
7858
7860
|
]),
|
|
7859
|
-
|
|
7861
|
+
x[53] || (x[53] = y("span", { class: "toggle-hint" }, "关闭可降低性能消耗(无镜面倒影)", -1))
|
|
7860
7862
|
]),
|
|
7861
|
-
|
|
7863
|
+
x[55] || (x[55] = y("div", { class: "material-hint" }, "值越大水体越浑浊(不透明),越小越清澈(透明)", -1))
|
|
7862
7864
|
])) : re("", !0)
|
|
7863
7865
|
]));
|
|
7864
7866
|
}
|
|
@@ -7926,13 +7928,13 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7926
7928
|
const f = d(n.value);
|
|
7927
7929
|
e.selectedObject.userData[A] = f, c(e.selectedObject), t.value = "", n.value = "";
|
|
7928
7930
|
}
|
|
7929
|
-
function
|
|
7931
|
+
function m(A, f) {
|
|
7930
7932
|
e.selectedObject && (delete e.selectedObject.userData[A], c(e.selectedObject));
|
|
7931
7933
|
}
|
|
7932
|
-
function
|
|
7934
|
+
function g(A) {
|
|
7933
7935
|
return A.length <= 28 ? A : A.substring(0, 28) + "…";
|
|
7934
7936
|
}
|
|
7935
|
-
function
|
|
7937
|
+
function b(A) {
|
|
7936
7938
|
s.value = A;
|
|
7937
7939
|
const f = e.selectedObject;
|
|
7938
7940
|
if (!f) return;
|
|
@@ -7942,9 +7944,9 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7942
7944
|
} catch {
|
|
7943
7945
|
i.value = String(v);
|
|
7944
7946
|
}
|
|
7945
|
-
|
|
7947
|
+
p();
|
|
7946
7948
|
}
|
|
7947
|
-
function
|
|
7949
|
+
function p() {
|
|
7948
7950
|
const A = i.value.trim();
|
|
7949
7951
|
if (!A) {
|
|
7950
7952
|
o.value = null;
|
|
@@ -8028,11 +8030,11 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8028
8030
|
y("span", Xc, fe(v.key), 1),
|
|
8029
8031
|
v.key === "isMovable" ? (H(), k("span", Vc, fe(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (H(), k(Ee, { key: 1 }, [
|
|
8030
8032
|
s.value !== v.key ? (H(), k(Ee, { key: 0 }, [
|
|
8031
|
-
y("span", qc, fe(
|
|
8033
|
+
y("span", qc, fe(g(v.value)), 1),
|
|
8032
8034
|
y("button", {
|
|
8033
8035
|
class: "ud-btn edit-json-btn",
|
|
8034
8036
|
title: "编辑对象",
|
|
8035
|
-
onClick: (O) =>
|
|
8037
|
+
onClick: (O) => b(v.key)
|
|
8036
8038
|
}, " ✎ ", 8, Yc)
|
|
8037
8039
|
], 64)) : (H(), k(Ee, { key: 1 }, [
|
|
8038
8040
|
o.value ? (H(), k("div", Kc, " ⚠ " + fe(o.value), 1)) : re("", !0),
|
|
@@ -8040,7 +8042,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8040
8042
|
"onUpdate:modelValue": f[2] || (f[2] = (O) => i.value = O),
|
|
8041
8043
|
class: Pe(["ud-json-textarea", { "has-error": o.value }]),
|
|
8042
8044
|
rows: "3",
|
|
8043
|
-
onInput:
|
|
8045
|
+
onInput: p
|
|
8044
8046
|
}, null, 34), [
|
|
8045
8047
|
[G, i.value]
|
|
8046
8048
|
]),
|
|
@@ -8061,7 +8063,7 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8061
8063
|
key: 2,
|
|
8062
8064
|
class: "ud-btn del-btn",
|
|
8063
8065
|
title: "删除",
|
|
8064
|
-
onClick: (O) =>
|
|
8066
|
+
onClick: (O) => m(v.key)
|
|
8065
8067
|
}, " ✕ ", 8, Jc)) : re("", !0)
|
|
8066
8068
|
], 64)) : re("", !0)
|
|
8067
8069
|
], 2))), 128))
|
|
@@ -8079,25 +8081,25 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8079
8081
|
selectedObject: {}
|
|
8080
8082
|
},
|
|
8081
8083
|
setup(r) {
|
|
8082
|
-
const e = r, t = z(""), n = z([]), s = z(!0), i = z(0.1), o = z(0), a = z(0), l = z(20), c = z(""), d = z(""), u = z(""),
|
|
8083
|
-
let
|
|
8084
|
-
function
|
|
8084
|
+
const e = r, t = z(""), n = z([]), s = z(!0), i = z(0.1), o = z(0), a = z(0), l = z(20), c = z(""), d = z(""), u = z(""), m = z("");
|
|
8085
|
+
let g = p(), b = !1;
|
|
8086
|
+
function p() {
|
|
8085
8087
|
const A = e.selectedObject;
|
|
8086
8088
|
return A ? Ft(ds(A)) : null;
|
|
8087
8089
|
}
|
|
8088
8090
|
Me(s, (A) => {
|
|
8089
|
-
|
|
8091
|
+
b || !g || (g.visible = A);
|
|
8090
8092
|
}), Me(l, (A) => {
|
|
8091
|
-
|
|
8093
|
+
b || !g || g.setWidth(`${A}em`);
|
|
8092
8094
|
}), Me(o, (A) => {
|
|
8093
|
-
|
|
8095
|
+
b || !g || g.setOffsetX(A);
|
|
8094
8096
|
}), Me(i, (A) => {
|
|
8095
|
-
|
|
8097
|
+
b || !g || g.setOffsetY(A);
|
|
8096
8098
|
}), Me(a, (A) => {
|
|
8097
|
-
|
|
8099
|
+
b || !g || g.setOffsetZ(A);
|
|
8098
8100
|
});
|
|
8099
8101
|
function h() {
|
|
8100
|
-
|
|
8102
|
+
b || !g || (g.setTitle(t.value), g.setItems([...n.value]));
|
|
8101
8103
|
}
|
|
8102
8104
|
Me(t, () => h()), Me(n, () => h(), { deep: !0 });
|
|
8103
8105
|
function w(A) {
|
|
@@ -8110,15 +8112,15 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8110
8112
|
label: c.value.trim(),
|
|
8111
8113
|
value: d.value.trim(),
|
|
8112
8114
|
unit: u.value.trim() || void 0,
|
|
8113
|
-
code:
|
|
8115
|
+
code: m.value.trim() || void 0
|
|
8114
8116
|
}
|
|
8115
|
-
], h(), c.value = "", d.value = "", u.value = "",
|
|
8117
|
+
], h(), c.value = "", d.value = "", u.value = "", m.value = "");
|
|
8116
8118
|
}
|
|
8117
8119
|
return Me(
|
|
8118
8120
|
() => e.selectedObject,
|
|
8119
8121
|
() => {
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
+
b = !0, g = p(), g ? (t.value = g.getTitle(), n.value = g.getItems(), s.value = g.visible, i.value = g.getOffsetY(), o.value = g.getOffsetX(), a.value = g.getOffsetZ(), l.value = parseFloat(g.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 = "", m.value = "", setTimeout(() => {
|
|
8123
|
+
b = !1;
|
|
8122
8124
|
}, 0);
|
|
8123
8125
|
},
|
|
8124
8126
|
{ immediate: !0 }
|
|
@@ -8356,11 +8358,11 @@ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8356
8358
|
j(y("input", {
|
|
8357
8359
|
type: "text",
|
|
8358
8360
|
class: "dp-input dp-input-xs",
|
|
8359
|
-
"onUpdate:modelValue": f[12] || (f[12] = (v) =>
|
|
8361
|
+
"onUpdate:modelValue": f[12] || (f[12] = (v) => m.value = v),
|
|
8360
8362
|
placeholder: "编码",
|
|
8361
8363
|
onKeyup: dt(C, ["enter"])
|
|
8362
8364
|
}, null, 544), [
|
|
8363
|
-
[G,
|
|
8365
|
+
[G, m.value]
|
|
8364
8366
|
]),
|
|
8365
8367
|
y("button", {
|
|
8366
8368
|
class: "dp-btn dp-btn-add",
|
|
@@ -8430,11 +8432,11 @@ const Du = {
|
|
|
8430
8432
|
const o = () => n("propertyChange"), a = z("transform"), l = tt(() => {
|
|
8431
8433
|
var C;
|
|
8432
8434
|
return !!(t.selectedObject && ((C = t.selectedObject.userData) != null && C._hasDataPanel));
|
|
8433
|
-
}), c = z(0), d = $i(t, "selectedObject"), { expandedSet: u, toggleExpand:
|
|
8434
|
-
eo("treeExpand", { expandedSet: u, toggleExpand:
|
|
8435
|
-
const
|
|
8435
|
+
}), c = z(0), d = $i(t, "selectedObject"), { expandedSet: u, toggleExpand: m } = Eu(d);
|
|
8436
|
+
eo("treeExpand", { expandedSet: u, toggleExpand: m });
|
|
8437
|
+
const g = (C) => {
|
|
8436
8438
|
c.value++, n("treeDelete", C);
|
|
8437
|
-
},
|
|
8439
|
+
}, b = () => {
|
|
8438
8440
|
Ua({
|
|
8439
8441
|
name: "",
|
|
8440
8442
|
code: `// 示例:旋转 + 移动动画(注意:可选链 ?. 不能与赋值连用)
|
|
@@ -8443,7 +8445,7 @@ if (selectedObject) {
|
|
|
8443
8445
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
|
|
8444
8446
|
}`
|
|
8445
8447
|
});
|
|
8446
|
-
},
|
|
8448
|
+
}, p = (C) => za(C), h = z("");
|
|
8447
8449
|
Me(
|
|
8448
8450
|
() => t.selectedObject,
|
|
8449
8451
|
(C) => {
|
|
@@ -8466,7 +8468,7 @@ if (selectedObject) {
|
|
|
8466
8468
|
"selected-object": C.selectedObject,
|
|
8467
8469
|
version: c.value,
|
|
8468
8470
|
onSelect: A[0] || (A[0] = (v) => n("treeSelect", v)),
|
|
8469
|
-
onDelete:
|
|
8471
|
+
onDelete: g
|
|
8470
8472
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
8471
8473
|
C.treeData.length === 0 ? (H(), k("div", Pu, "暂无物体")) : re("", !0)
|
|
8472
8474
|
])
|
|
@@ -8495,7 +8497,7 @@ if (selectedObject) {
|
|
|
8495
8497
|
A[9] || (A[9] = y("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
|
|
8496
8498
|
y("button", {
|
|
8497
8499
|
class: "add-script-btn",
|
|
8498
|
-
onClick:
|
|
8500
|
+
onClick: b,
|
|
8499
8501
|
title: "新增一个脚本"
|
|
8500
8502
|
}, " + 添加脚本 ")
|
|
8501
8503
|
]),
|
|
@@ -8515,7 +8517,7 @@ if (selectedObject) {
|
|
|
8515
8517
|
y("button", {
|
|
8516
8518
|
class: "script-del-btn",
|
|
8517
8519
|
title: "删除该脚本",
|
|
8518
|
-
onClick: (v) =>
|
|
8520
|
+
onClick: (v) => p(f.id)
|
|
8519
8521
|
}, "✕", 8, ju)
|
|
8520
8522
|
]),
|
|
8521
8523
|
j(y("textarea", {
|
|
@@ -8604,19 +8606,19 @@ function myFunc() {
|
|
|
8604
8606
|
emits: ["addModel", "importModel"],
|
|
8605
8607
|
setup(r, { emit: e }) {
|
|
8606
8608
|
const t = z(!1), n = z(!1), s = z(!1), i = z(!1), o = e, a = z(null), l = () => {
|
|
8607
|
-
var
|
|
8608
|
-
return (
|
|
8609
|
-
}, c = (
|
|
8610
|
-
const h =
|
|
8609
|
+
var p;
|
|
8610
|
+
return (p = a.value) == null ? void 0 : p.click();
|
|
8611
|
+
}, c = (p) => {
|
|
8612
|
+
const h = p.target;
|
|
8611
8613
|
h.files && h.files.length > 0 && (o("importModel", h.files[0]), h.value = "");
|
|
8612
|
-
}, d = () => console.log("撤销"), u = () => console.log("删除物体"),
|
|
8613
|
-
const
|
|
8614
|
-
console.log("scene GLB 字节数:",
|
|
8615
|
-
},
|
|
8614
|
+
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), m = async () => {
|
|
8615
|
+
const p = await Tl();
|
|
8616
|
+
console.log("scene GLB 字节数:", p.scene.byteLength), console.log("camera:", p.camera), console.log("dataPanels:", p.dataPanels), console.log("waters:", p.waters), console.log("textures:", p.textures), console.log("ambientLight:", p.ambientLight);
|
|
8617
|
+
}, g = () => {
|
|
8616
8618
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8617
8619
|
bi(localStorage.getItem("test_id"));
|
|
8618
|
-
},
|
|
8619
|
-
return (
|
|
8620
|
+
}, b = () => pi();
|
|
8621
|
+
return (p, h) => (H(), k("div", qu, [
|
|
8620
8622
|
y("div", Yu, [
|
|
8621
8623
|
y("div", {
|
|
8622
8624
|
class: "dropdown-wrapper",
|
|
@@ -8700,15 +8702,15 @@ function myFunc() {
|
|
|
8700
8702
|
j(y("div", Ju, [
|
|
8701
8703
|
y("div", {
|
|
8702
8704
|
class: "menu-item",
|
|
8703
|
-
onClick:
|
|
8705
|
+
onClick: m
|
|
8704
8706
|
}, "获取场景"),
|
|
8705
8707
|
y("div", {
|
|
8706
8708
|
class: "menu-item",
|
|
8707
|
-
onClick:
|
|
8709
|
+
onClick: g
|
|
8708
8710
|
}, "镜头拉近"),
|
|
8709
8711
|
y("div", {
|
|
8710
8712
|
class: "menu-item",
|
|
8711
|
-
onClick:
|
|
8713
|
+
onClick: b
|
|
8712
8714
|
}, " 重置相机位置 "),
|
|
8713
8715
|
h[18] || (h[18] = y("div", { class: "menu-divider" }, null, -1))
|
|
8714
8716
|
], 512), [
|
|
@@ -8798,9 +8800,9 @@ function myFunc() {
|
|
|
8798
8800
|
const u = () => {
|
|
8799
8801
|
const A = vi();
|
|
8800
8802
|
A && (d.value = A);
|
|
8801
|
-
},
|
|
8803
|
+
}, m = (A) => fs(A), g = (A) => wi(A.uuid), b = (A) => {
|
|
8802
8804
|
gi(A);
|
|
8803
|
-
},
|
|
8805
|
+
}, p = (A) => Ba(A), h = tt(
|
|
8804
8806
|
() => Se.scripts.filter((A) => !hi(A))
|
|
8805
8807
|
), w = z(null), C = async () => {
|
|
8806
8808
|
w.value && await qa(w.value, e.mode, e.sceneData), u();
|
|
@@ -8832,7 +8834,7 @@ function myFunc() {
|
|
|
8832
8834
|
key: v.id,
|
|
8833
8835
|
class: "script-trigger-btn",
|
|
8834
8836
|
title: v.code,
|
|
8835
|
-
onClick: ns((O) =>
|
|
8837
|
+
onClick: ns((O) => p(v.id), ["stop"])
|
|
8836
8838
|
}, " ▶ " + fe(is(Xa)(v, D)), 9, rd))), 128))
|
|
8837
8839
|
])) : re("", !0)
|
|
8838
8840
|
], 2),
|
|
@@ -8842,9 +8844,9 @@ function myFunc() {
|
|
|
8842
8844
|
"tree-data": d.value,
|
|
8843
8845
|
"selected-object": n.value,
|
|
8844
8846
|
onPropertyChange: a,
|
|
8845
|
-
onTreeSelect:
|
|
8846
|
-
onTreeDelete:
|
|
8847
|
-
onTransformModeChange:
|
|
8847
|
+
onTreeSelect: m,
|
|
8848
|
+
onTreeDelete: g,
|
|
8849
|
+
onTransformModeChange: b
|
|
8848
8850
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : re("", !0)
|
|
8849
8851
|
], 2),
|
|
8850
8852
|
A.mode === "edit" ? (H(), Mt(sd, { key: 2 })) : re("", !0)
|