endset_three_editor 0.2.2 → 0.2.3
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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as Ge, ref as G, inject as Tn, computed as Ze, watchEffect as xn, resolveComponent as En, openBlock as N, createElementBlock as U, createElementVNode as g, normalizeClass as He, withModifiers as
|
|
1
|
+
import { defineComponent as Ge, ref as G, inject as Tn, computed as Ze, watchEffect as xn, resolveComponent as En, openBlock as N, createElementBlock as U, createElementVNode as g, normalizeClass as He, withModifiers as At, unref as Mn, toDisplayString as Ee, Fragment as en, renderList as tn, createBlock as ot, createCommentVNode as de, watch as nn, toRef as vn, provide as Sn, reactive as sn, withDirectives as D, vModelText as Q, vShow as he, shallowRef as Rn, onMounted as An, createVNode as Pn } from "vue";
|
|
2
2
|
import * as F from "three";
|
|
3
|
-
import { Controls as on, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as Pt, Vector2 as V, Ray as Ln, Plane as In, MathUtils as rn, Raycaster as On, Object3D as Ue, MeshBasicMaterial as _e, LineBasicMaterial as ke, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as ze, Float32BufferAttribute as ue, Mesh as T, OctahedronGeometry as Qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as an, Loader as ln, FileLoader as xt, Color as pe, SRGBColorSpace as
|
|
3
|
+
import { Controls as on, Vector3 as M, MOUSE as Me, TOUCH as xe, Quaternion as K, Spherical as Pt, Vector2 as V, Ray as Ln, Plane as In, MathUtils as rn, Raycaster as On, Object3D as Ue, MeshBasicMaterial as _e, LineBasicMaterial as ke, CylinderGeometry as Y, BoxGeometry as z, BufferGeometry as ze, Float32BufferAttribute as ue, Mesh as T, OctahedronGeometry as Qe, Line as re, TorusGeometry as Pe, SphereGeometry as Cn, Euler as Dn, Matrix4 as Se, PlaneGeometry as Nn, DoubleSide as an, Loader as ln, FileLoader as xt, Color as pe, SRGBColorSpace as Re, Group as tt, Material as je, PointsMaterial as Ce, MeshPhongMaterial as kn, LineSegments as mt, Points as nt, TrianglesDrawMode as jn, TriangleFanDrawMode as gt, TriangleStripDrawMode as cn, LoaderUtils as Fe, MeshPhysicalMaterial as se, LinearSRGBColorSpace as ae, SpotLight as Fn, PointLight as Hn, DirectionalLight as Un, InstancedMesh as zn, InstancedBufferAttribute as Gn, TextureLoader as Xn, ImageBitmapLoader as Yn, BufferAttribute as rt, InterleavedBuffer as Bn, InterleavedBufferAttribute as Kn, LinearMipmapLinearFilter as hn, NearestMipmapLinearFilter as Vn, LinearMipmapNearestFilter as Zn, NearestMipmapNearestFilter as Qn, LinearFilter as yt, NearestFilter as un, RepeatWrapping as _t, MirroredRepeatWrapping as qn, ClampToEdgeWrapping as Wn, MeshStandardMaterial as dn, PropertyBinding as $n, SkinnedMesh as Jn, LineLoop as es, PerspectiveCamera as ts, OrthographicCamera as ns, Skeleton as ss, AnimationClip as is, Bone as os, InterpolateDiscrete as rs, InterpolateLinear as pn, Texture as Lt, VectorKeyframeTrack as It, NumberKeyframeTrack as Ot, QuaternionKeyframeTrack as Ct, ColorManagement as Dt, FrontSide as as, Interpolant as ls, Box3 as cs, Sphere as hs } from "three";
|
|
4
4
|
import us from "@tweenjs/tween.js";
|
|
5
5
|
const Nt = { type: "change" }, Et = { type: "start" }, fn = { type: "end" }, qe = new Ln(), kt = new In(), ds = Math.cos(70 * rn.DEG2RAD), k = new M(), B = 2 * Math.PI, P = {
|
|
6
6
|
NONE: -1,
|
|
@@ -531,19 +531,19 @@ class Ss extends on {
|
|
|
531
531
|
this._plane = i, s.add(i);
|
|
532
532
|
const o = this;
|
|
533
533
|
function a(x, S) {
|
|
534
|
-
let
|
|
534
|
+
let A = S;
|
|
535
535
|
Object.defineProperty(o, x, {
|
|
536
536
|
get: function() {
|
|
537
|
-
return
|
|
537
|
+
return A !== void 0 ? A : S;
|
|
538
538
|
},
|
|
539
539
|
set: function(v) {
|
|
540
|
-
|
|
540
|
+
A !== v && (A = v, i[x] = v, n[x] = v, o.dispatchEvent({ type: x + "-changed", value: v }), o.dispatchEvent(lt));
|
|
541
541
|
}
|
|
542
542
|
}), o[x] = S, i[x] = S, n[x] = S;
|
|
543
543
|
}
|
|
544
544
|
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);
|
|
545
545
|
const l = new M(), h = new M(), u = new K(), c = new K(), p = new M(), m = new K(), b = new M(), f = new M(), y = new M(), d = 0, _ = new M();
|
|
546
|
-
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer =
|
|
546
|
+
a("worldPosition", l), a("worldPositionStart", h), a("worldQuaternion", u), a("worldQuaternionStart", c), a("cameraPosition", p), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", f), a("rotationAxis", y), a("rotationAngle", d), a("eye", _), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = Rs.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = As.bind(this), this._onPointerMove = Ls.bind(this), this._onPointerUp = Is.bind(this), t !== null && this.connect(t);
|
|
547
547
|
}
|
|
548
548
|
connect(e) {
|
|
549
549
|
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";
|
|
@@ -705,7 +705,7 @@ class Ss extends on {
|
|
|
705
705
|
i.xAxis.color.set(e), i.yAxis.color.set(t), i.zAxis.color.set(s), i.active.color.set(n), i.xAxisTransparent.color.set(e), i.yAxisTransparent.color.set(t), i.zAxisTransparent.color.set(s), i.activeTransparent.color.set(n), i.xAxis._color && i.xAxis._color.set(e), i.yAxis._color && i.yAxis._color.set(t), i.zAxis._color && i.zAxis._color.set(s), i.active._color && i.active._color.set(n), i.xAxisTransparent._color && i.xAxisTransparent._color.set(e), i.yAxisTransparent._color && i.yAxisTransparent._color.set(t), i.zAxisTransparent._color && i.zAxisTransparent._color.set(s), i.activeTransparent._color && i.activeTransparent._color.set(n);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Rs(r) {
|
|
709
709
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
710
710
|
return {
|
|
711
711
|
x: 0,
|
|
@@ -721,7 +721,7 @@ function As(r) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function As(r) {
|
|
725
725
|
if (this.enabled)
|
|
726
726
|
switch (r.pointerType) {
|
|
727
727
|
case "mouse":
|
|
@@ -826,7 +826,7 @@ class Cs extends Ue {
|
|
|
826
826
|
const Z = new ze();
|
|
827
827
|
return Z.setAttribute("position", new ue([0, 0, 0, 1, 1, 1], 3)), Z;
|
|
828
828
|
}
|
|
829
|
-
const
|
|
829
|
+
const A = {
|
|
830
830
|
X: [
|
|
831
831
|
[new T(f, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
832
832
|
[new T(f, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
@@ -1004,12 +1004,12 @@ class Cs extends Ue {
|
|
|
1004
1004
|
for (let Te = Z[J].length; Te--; ) {
|
|
1005
1005
|
const X = Z[J][Te][0].clone(), Be = Z[J][Te][1], Ke = Z[J][Te][2], Ve = Z[J][Te][3], wn = Z[J][Te][4];
|
|
1006
1006
|
X.name = J, X.tag = wn, Be && X.position.set(Be[0], Be[1], Be[2]), Ke && X.rotation.set(Ke[0], Ke[1], Ke[2]), Ve && X.scale.set(Ve[0], Ve[1], Ve[2]), X.updateMatrix();
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1007
|
+
const Rt = X.geometry.clone();
|
|
1008
|
+
Rt.applyMatrix4(X.matrix), X.geometry = Rt, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), Ye.add(X);
|
|
1009
1009
|
}
|
|
1010
1010
|
return Ye;
|
|
1011
1011
|
}
|
|
1012
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(
|
|
1012
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = oe(A)), this.add(this.gizmo.rotate = oe(ie)), this.add(this.gizmo.scale = oe($)), this.add(this.picker.translate = oe(v)), this.add(this.picker.rotate = oe(fe)), this.add(this.picker.scale = oe(E)), this.add(this.helper.translate = oe(I)), this.add(this.helper.rotate = oe(ee)), this.add(this.helper.scale = oe(j)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1013
1013
|
}
|
|
1014
1014
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1015
1015
|
updateMatrixWorld(e) {
|
|
@@ -1095,12 +1095,20 @@ const w = {
|
|
|
1095
1095
|
/** 当前选中的物体 */
|
|
1096
1096
|
selectedObject: null
|
|
1097
1097
|
};
|
|
1098
|
-
let ht = !1,
|
|
1098
|
+
let ht = !1, Ae = !1, be = null, bt = null, it = null, we = [];
|
|
1099
1099
|
function Ns(r, e = "edit", t) {
|
|
1100
1100
|
if (w.container = r, w.mode = e, ks(), js(), Hs(), t) {
|
|
1101
1101
|
ei(t.scene, e);
|
|
1102
1102
|
const s = t.camera;
|
|
1103
|
-
w.camera.position.
|
|
1103
|
+
w.camera.position.set(
|
|
1104
|
+
s.position.x,
|
|
1105
|
+
s.position.y,
|
|
1106
|
+
s.position.z
|
|
1107
|
+
), w.camera.rotation.set(
|
|
1108
|
+
s.rotation._x,
|
|
1109
|
+
s.rotation._y,
|
|
1110
|
+
s.rotation._z
|
|
1111
|
+
);
|
|
1104
1112
|
}
|
|
1105
1113
|
zs(), Us(), Qs(), mn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
|
|
1106
1114
|
}
|
|
@@ -1126,8 +1134,8 @@ function Us() {
|
|
|
1126
1134
|
}), r.addEventListener("change", () => {
|
|
1127
1135
|
ht = !0;
|
|
1128
1136
|
}), r.addEventListener("end", () => {
|
|
1129
|
-
ht && (
|
|
1130
|
-
|
|
1137
|
+
ht && (Ae = !0, setTimeout(() => {
|
|
1138
|
+
Ae = !1;
|
|
1131
1139
|
}, 200));
|
|
1132
1140
|
}), w.orbitControls = r;
|
|
1133
1141
|
}
|
|
@@ -1137,8 +1145,8 @@ function zs() {
|
|
|
1137
1145
|
w.renderer.domElement
|
|
1138
1146
|
);
|
|
1139
1147
|
r.addEventListener("dragging-changed", (e) => {
|
|
1140
|
-
w.orbitControls.enabled = !e.value, e.value || (
|
|
1141
|
-
|
|
1148
|
+
w.orbitControls.enabled = !e.value, e.value || (Ae = !0, setTimeout(() => {
|
|
1149
|
+
Ae = !1;
|
|
1142
1150
|
}, 200));
|
|
1143
1151
|
}), r.addEventListener("objectChange", () => {
|
|
1144
1152
|
bt && w.selectedObject && bt(w.selectedObject);
|
|
@@ -1166,8 +1174,8 @@ function gn() {
|
|
|
1166
1174
|
w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
|
|
1167
1175
|
}
|
|
1168
1176
|
function Ys(r) {
|
|
1169
|
-
if (
|
|
1170
|
-
|
|
1177
|
+
if (Ae) {
|
|
1178
|
+
Ae = !1;
|
|
1171
1179
|
return;
|
|
1172
1180
|
}
|
|
1173
1181
|
const e = w.renderer.domElement.getBoundingClientRect(), t = new F.Vector2(
|
|
@@ -1478,7 +1486,7 @@ class ri extends ln {
|
|
|
1478
1486
|
parseFloat(c[4]),
|
|
1479
1487
|
parseFloat(c[5]),
|
|
1480
1488
|
parseFloat(c[6]),
|
|
1481
|
-
|
|
1489
|
+
Re
|
|
1482
1490
|
), t.colors.push(et.r, et.g, et.b)) : t.colors.push(void 0, void 0, void 0);
|
|
1483
1491
|
break;
|
|
1484
1492
|
case "vn":
|
|
@@ -1567,8 +1575,8 @@ class ri extends ln {
|
|
|
1567
1575
|
f.setAttribute("position", new ue(u.vertices, 3)), u.normals.length > 0 && f.setAttribute("normal", new ue(u.normals, 3)), u.colors.length > 0 && (b = !0, f.setAttribute("color", new ue(u.colors, 3))), u.hasUVIndices === !0 && f.setAttribute("uv", new ue(u.uvs, 2));
|
|
1568
1576
|
const y = [];
|
|
1569
1577
|
for (let _ = 0, x = c.length; _ < x; _++) {
|
|
1570
|
-
const S = c[_],
|
|
1571
|
-
let v = t.materials[
|
|
1578
|
+
const S = c[_], A = S.name + "_" + S.smooth + "_" + b;
|
|
1579
|
+
let v = t.materials[A];
|
|
1572
1580
|
if (this.materials !== null) {
|
|
1573
1581
|
if (v = this.materials.create(S.name), p && v && !(v instanceof ke)) {
|
|
1574
1582
|
const I = new ke();
|
|
@@ -1578,7 +1586,7 @@ class ri extends ln {
|
|
|
1578
1586
|
je.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
|
|
1579
1587
|
}
|
|
1580
1588
|
}
|
|
1581
|
-
v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[
|
|
1589
|
+
v === void 0 && (p ? v = new ke() : m ? v = new Ce({ size: 1, sizeAttenuation: !1 }) : v = new kn(), v.name = S.name, v.flatShading = !S.smooth, v.vertexColors = b, t.materials[A] = v), y.push(v);
|
|
1582
1590
|
}
|
|
1583
1591
|
let d;
|
|
1584
1592
|
if (y.length > 1) {
|
|
@@ -1682,9 +1690,9 @@ class li extends ln {
|
|
|
1682
1690
|
}), this.register(function(t) {
|
|
1683
1691
|
return new hi(t);
|
|
1684
1692
|
}), this.register(function(t) {
|
|
1685
|
-
return new Qt(t,
|
|
1693
|
+
return new Qt(t, R.EXT_MESHOPT_COMPRESSION);
|
|
1686
1694
|
}), this.register(function(t) {
|
|
1687
|
-
return new Qt(t,
|
|
1695
|
+
return new Qt(t, R.KHR_MESHOPT_COMPRESSION);
|
|
1688
1696
|
}), this.register(function(t) {
|
|
1689
1697
|
return new Si(t);
|
|
1690
1698
|
});
|
|
@@ -1788,12 +1796,12 @@ class li extends ln {
|
|
|
1788
1796
|
else if (e instanceof ArrayBuffer)
|
|
1789
1797
|
if (l.decode(new Uint8Array(e, 0, 4)) === _n) {
|
|
1790
1798
|
try {
|
|
1791
|
-
o[
|
|
1799
|
+
o[R.KHR_BINARY_GLTF] = new Ri(e);
|
|
1792
1800
|
} catch (c) {
|
|
1793
1801
|
n && n(c);
|
|
1794
1802
|
return;
|
|
1795
1803
|
}
|
|
1796
|
-
i = JSON.parse(o[
|
|
1804
|
+
i = JSON.parse(o[R.KHR_BINARY_GLTF].content);
|
|
1797
1805
|
} else
|
|
1798
1806
|
i = JSON.parse(l.decode(e));
|
|
1799
1807
|
else
|
|
@@ -1819,16 +1827,16 @@ class li extends ln {
|
|
|
1819
1827
|
for (let u = 0; u < i.extensionsUsed.length; ++u) {
|
|
1820
1828
|
const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
1821
1829
|
switch (c) {
|
|
1822
|
-
case
|
|
1830
|
+
case R.KHR_MATERIALS_UNLIT:
|
|
1823
1831
|
o[c] = new ui();
|
|
1824
1832
|
break;
|
|
1825
|
-
case
|
|
1826
|
-
o[c] = new
|
|
1833
|
+
case R.KHR_DRACO_MESH_COMPRESSION:
|
|
1834
|
+
o[c] = new Ai(i, this.dracoLoader);
|
|
1827
1835
|
break;
|
|
1828
|
-
case
|
|
1836
|
+
case R.KHR_TEXTURE_TRANSFORM:
|
|
1829
1837
|
o[c] = new Pi();
|
|
1830
1838
|
break;
|
|
1831
|
-
case
|
|
1839
|
+
case R.KHR_MESH_QUANTIZATION:
|
|
1832
1840
|
o[c] = new Li();
|
|
1833
1841
|
break;
|
|
1834
1842
|
default:
|
|
@@ -1873,7 +1881,7 @@ function C(r, e, t) {
|
|
|
1873
1881
|
const s = r.json.materials[e];
|
|
1874
1882
|
return s.extensions && s.extensions[t] ? s.extensions[t] : null;
|
|
1875
1883
|
}
|
|
1876
|
-
const
|
|
1884
|
+
const R = {
|
|
1877
1885
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
1878
1886
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
1879
1887
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -1900,7 +1908,7 @@ const A = {
|
|
|
1900
1908
|
};
|
|
1901
1909
|
class hi {
|
|
1902
1910
|
constructor(e) {
|
|
1903
|
-
this.parser = e, this.name =
|
|
1911
|
+
this.parser = e, this.name = R.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1904
1912
|
}
|
|
1905
1913
|
_markDefs() {
|
|
1906
1914
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
@@ -1946,7 +1954,7 @@ class hi {
|
|
|
1946
1954
|
}
|
|
1947
1955
|
class ui {
|
|
1948
1956
|
constructor() {
|
|
1949
|
-
this.name =
|
|
1957
|
+
this.name = R.KHR_MATERIALS_UNLIT;
|
|
1950
1958
|
}
|
|
1951
1959
|
getMaterialType() {
|
|
1952
1960
|
return _e;
|
|
@@ -1960,14 +1968,14 @@ class ui {
|
|
|
1960
1968
|
const o = i.baseColorFactor;
|
|
1961
1969
|
e.color.setRGB(o[0], o[1], o[2], ae), e.opacity = o[3];
|
|
1962
1970
|
}
|
|
1963
|
-
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture,
|
|
1971
|
+
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Re));
|
|
1964
1972
|
}
|
|
1965
1973
|
return Promise.all(n);
|
|
1966
1974
|
}
|
|
1967
1975
|
}
|
|
1968
1976
|
class di {
|
|
1969
1977
|
constructor(e) {
|
|
1970
|
-
this.parser = e, this.name =
|
|
1978
|
+
this.parser = e, this.name = R.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1971
1979
|
}
|
|
1972
1980
|
extendMaterialParams(e, t) {
|
|
1973
1981
|
const s = C(this.parser, e, this.name);
|
|
@@ -1976,7 +1984,7 @@ class di {
|
|
|
1976
1984
|
}
|
|
1977
1985
|
class pi {
|
|
1978
1986
|
constructor(e) {
|
|
1979
|
-
this.parser = e, this.name =
|
|
1987
|
+
this.parser = e, this.name = R.KHR_MATERIALS_CLEARCOAT;
|
|
1980
1988
|
}
|
|
1981
1989
|
getMaterialType(e) {
|
|
1982
1990
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -1994,7 +2002,7 @@ class pi {
|
|
|
1994
2002
|
}
|
|
1995
2003
|
class fi {
|
|
1996
2004
|
constructor(e) {
|
|
1997
|
-
this.parser = e, this.name =
|
|
2005
|
+
this.parser = e, this.name = R.KHR_MATERIALS_DISPERSION;
|
|
1998
2006
|
}
|
|
1999
2007
|
getMaterialType(e) {
|
|
2000
2008
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2006,7 +2014,7 @@ class fi {
|
|
|
2006
2014
|
}
|
|
2007
2015
|
class mi {
|
|
2008
2016
|
constructor(e) {
|
|
2009
|
-
this.parser = e, this.name =
|
|
2017
|
+
this.parser = e, this.name = R.KHR_MATERIALS_IRIDESCENCE;
|
|
2010
2018
|
}
|
|
2011
2019
|
getMaterialType(e) {
|
|
2012
2020
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2020,7 +2028,7 @@ class mi {
|
|
|
2020
2028
|
}
|
|
2021
2029
|
class gi {
|
|
2022
2030
|
constructor(e) {
|
|
2023
|
-
this.parser = e, this.name =
|
|
2031
|
+
this.parser = e, this.name = R.KHR_MATERIALS_SHEEN;
|
|
2024
2032
|
}
|
|
2025
2033
|
getMaterialType(e) {
|
|
2026
2034
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2033,12 +2041,12 @@ class gi {
|
|
|
2033
2041
|
const i = s.sheenColorFactor;
|
|
2034
2042
|
t.sheenColor.setRGB(i[0], i[1], i[2], ae);
|
|
2035
2043
|
}
|
|
2036
|
-
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture,
|
|
2044
|
+
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Re)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
|
|
2037
2045
|
}
|
|
2038
2046
|
}
|
|
2039
2047
|
class yi {
|
|
2040
2048
|
constructor(e) {
|
|
2041
|
-
this.parser = e, this.name =
|
|
2049
|
+
this.parser = e, this.name = R.KHR_MATERIALS_TRANSMISSION;
|
|
2042
2050
|
}
|
|
2043
2051
|
getMaterialType(e) {
|
|
2044
2052
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2052,7 +2060,7 @@ class yi {
|
|
|
2052
2060
|
}
|
|
2053
2061
|
class _i {
|
|
2054
2062
|
constructor(e) {
|
|
2055
|
-
this.parser = e, this.name =
|
|
2063
|
+
this.parser = e, this.name = R.KHR_MATERIALS_VOLUME;
|
|
2056
2064
|
}
|
|
2057
2065
|
getMaterialType(e) {
|
|
2058
2066
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2068,7 +2076,7 @@ class _i {
|
|
|
2068
2076
|
}
|
|
2069
2077
|
class bi {
|
|
2070
2078
|
constructor(e) {
|
|
2071
|
-
this.parser = e, this.name =
|
|
2079
|
+
this.parser = e, this.name = R.KHR_MATERIALS_IOR;
|
|
2072
2080
|
}
|
|
2073
2081
|
getMaterialType(e) {
|
|
2074
2082
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2080,7 +2088,7 @@ class bi {
|
|
|
2080
2088
|
}
|
|
2081
2089
|
class wi {
|
|
2082
2090
|
constructor(e) {
|
|
2083
|
-
this.parser = e, this.name =
|
|
2091
|
+
this.parser = e, this.name = R.KHR_MATERIALS_SPECULAR;
|
|
2084
2092
|
}
|
|
2085
2093
|
getMaterialType(e) {
|
|
2086
2094
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2091,12 +2099,12 @@ class wi {
|
|
|
2091
2099
|
const n = [];
|
|
2092
2100
|
t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
|
|
2093
2101
|
const i = s.specularColorFactor || [1, 1, 1];
|
|
2094
|
-
return t.specularColor = new pe().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture,
|
|
2102
|
+
return t.specularColor = new pe().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Re)), Promise.all(n);
|
|
2095
2103
|
}
|
|
2096
2104
|
}
|
|
2097
2105
|
class Ti {
|
|
2098
2106
|
constructor(e) {
|
|
2099
|
-
this.parser = e, this.name =
|
|
2107
|
+
this.parser = e, this.name = R.EXT_MATERIALS_BUMP;
|
|
2100
2108
|
}
|
|
2101
2109
|
getMaterialType(e) {
|
|
2102
2110
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2110,7 +2118,7 @@ class Ti {
|
|
|
2110
2118
|
}
|
|
2111
2119
|
class xi {
|
|
2112
2120
|
constructor(e) {
|
|
2113
|
-
this.parser = e, this.name =
|
|
2121
|
+
this.parser = e, this.name = R.KHR_MATERIALS_ANISOTROPY;
|
|
2114
2122
|
}
|
|
2115
2123
|
getMaterialType(e) {
|
|
2116
2124
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2124,7 +2132,7 @@ class xi {
|
|
|
2124
2132
|
}
|
|
2125
2133
|
class Ei {
|
|
2126
2134
|
constructor(e) {
|
|
2127
|
-
this.parser = e, this.name =
|
|
2135
|
+
this.parser = e, this.name = R.KHR_TEXTURE_BASISU;
|
|
2128
2136
|
}
|
|
2129
2137
|
loadTexture(e) {
|
|
2130
2138
|
const t = this.parser, s = t.json, n = s.textures[e];
|
|
@@ -2141,7 +2149,7 @@ class Ei {
|
|
|
2141
2149
|
}
|
|
2142
2150
|
class Mi {
|
|
2143
2151
|
constructor(e) {
|
|
2144
|
-
this.parser = e, this.name =
|
|
2152
|
+
this.parser = e, this.name = R.EXT_TEXTURE_WEBP;
|
|
2145
2153
|
}
|
|
2146
2154
|
loadTexture(e) {
|
|
2147
2155
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2158,7 +2166,7 @@ class Mi {
|
|
|
2158
2166
|
}
|
|
2159
2167
|
class vi {
|
|
2160
2168
|
constructor(e) {
|
|
2161
|
-
this.parser = e, this.name =
|
|
2169
|
+
this.parser = e, this.name = R.EXT_TEXTURE_AVIF;
|
|
2162
2170
|
}
|
|
2163
2171
|
loadTexture(e) {
|
|
2164
2172
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2201,7 +2209,7 @@ class Qt {
|
|
|
2201
2209
|
}
|
|
2202
2210
|
class Si {
|
|
2203
2211
|
constructor(e) {
|
|
2204
|
-
this.name =
|
|
2212
|
+
this.name = R.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2205
2213
|
}
|
|
2206
2214
|
createNodeMesh(e) {
|
|
2207
2215
|
const t = this.parser.json, s = t.nodes[e];
|
|
@@ -2222,8 +2230,8 @@ class Si {
|
|
|
2222
2230
|
l.TRANSLATION && y.fromBufferAttribute(l.TRANSLATION, S), l.ROTATION && d.fromBufferAttribute(l.ROTATION, S), l.SCALE && _.fromBufferAttribute(l.SCALE, S), x.setMatrixAt(S, f.compose(y, d, _));
|
|
2223
2231
|
for (const S in l)
|
|
2224
2232
|
if (S === "_COLOR_0") {
|
|
2225
|
-
const
|
|
2226
|
-
x.instanceColor = new Gn(
|
|
2233
|
+
const A = l[S];
|
|
2234
|
+
x.instanceColor = new Gn(A.array, A.itemSize, A.normalized);
|
|
2227
2235
|
} else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
|
|
2228
2236
|
Ue.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
|
|
2229
2237
|
}
|
|
@@ -2232,9 +2240,9 @@ class Si {
|
|
|
2232
2240
|
}
|
|
2233
2241
|
}
|
|
2234
2242
|
const _n = "glTF", Oe = 12, qt = { JSON: 1313821514, BIN: 5130562 };
|
|
2235
|
-
class
|
|
2243
|
+
class Ri {
|
|
2236
2244
|
constructor(e) {
|
|
2237
|
-
this.name =
|
|
2245
|
+
this.name = R.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2238
2246
|
const t = new DataView(e, 0, Oe), s = new TextDecoder();
|
|
2239
2247
|
if (this.header = {
|
|
2240
2248
|
magic: s.decode(new Uint8Array(e.slice(0, 4))),
|
|
@@ -2263,11 +2271,11 @@ class Ai {
|
|
|
2263
2271
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
2264
2272
|
}
|
|
2265
2273
|
}
|
|
2266
|
-
class
|
|
2274
|
+
class Ai {
|
|
2267
2275
|
constructor(e, t) {
|
|
2268
2276
|
if (!t)
|
|
2269
2277
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
2270
|
-
this.name =
|
|
2278
|
+
this.name = R.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
2271
2279
|
}
|
|
2272
2280
|
decodePrimitive(e, t) {
|
|
2273
2281
|
const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
|
|
@@ -2297,7 +2305,7 @@ class Ri {
|
|
|
2297
2305
|
}
|
|
2298
2306
|
class Pi {
|
|
2299
2307
|
constructor() {
|
|
2300
|
-
this.name =
|
|
2308
|
+
this.name = R.KHR_TEXTURE_TRANSFORM;
|
|
2301
2309
|
}
|
|
2302
2310
|
extendTexture(e, t) {
|
|
2303
2311
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
@@ -2305,7 +2313,7 @@ class Pi {
|
|
|
2305
2313
|
}
|
|
2306
2314
|
class Li {
|
|
2307
2315
|
constructor() {
|
|
2308
|
-
this.name =
|
|
2316
|
+
this.name = R.KHR_MESH_QUANTIZATION;
|
|
2309
2317
|
}
|
|
2310
2318
|
}
|
|
2311
2319
|
class bn extends ls {
|
|
@@ -2321,8 +2329,8 @@ class bn extends ls {
|
|
|
2321
2329
|
interpolate_(e, t, s, n) {
|
|
2322
2330
|
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, h = a * 3, u = n - t, c = (s - t) / u, p = c * c, m = p * c, b = e * h, f = b - h, y = -2 * m + 3 * p, d = m - p, _ = 1 - y, x = d - p + c;
|
|
2323
2331
|
for (let S = 0; S !== a; S++) {
|
|
2324
|
-
const
|
|
2325
|
-
i[S] = _ *
|
|
2332
|
+
const A = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
|
|
2333
|
+
i[S] = _ * A + x * v + y * I + d * ie;
|
|
2326
2334
|
}
|
|
2327
2335
|
return i;
|
|
2328
2336
|
}
|
|
@@ -2461,7 +2469,7 @@ function ki(r, e) {
|
|
|
2461
2469
|
}
|
|
2462
2470
|
function ji(r) {
|
|
2463
2471
|
let e;
|
|
2464
|
-
const t = r.extensions && r.extensions[
|
|
2472
|
+
const t = r.extensions && r.extensions[R.KHR_DRACO_MESH_COMPRESSION];
|
|
2465
2473
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ft(t.attributes) : e = r.indices + ":" + ft(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
2466
2474
|
for (let s = 0, n = r.targets.length; s < n; s++)
|
|
2467
2475
|
e += ":" + ft(r.targets[s]);
|
|
@@ -2710,7 +2718,7 @@ class Ui {
|
|
|
2710
2718
|
if (t.type && t.type !== "arraybuffer")
|
|
2711
2719
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
2712
2720
|
if (t.uri === void 0 && e === 0)
|
|
2713
|
-
return Promise.resolve(this.extensions[
|
|
2721
|
+
return Promise.resolve(this.extensions[R.KHR_BINARY_GLTF].body);
|
|
2714
2722
|
const n = this.options;
|
|
2715
2723
|
return new Promise(function(i, o) {
|
|
2716
2724
|
s.load(Fe.resolveURL(t.uri, n.path), i, void 0, function() {
|
|
@@ -2756,10 +2764,10 @@ class Ui {
|
|
|
2756
2764
|
} else
|
|
2757
2765
|
a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
|
|
2758
2766
|
if (n.sparse !== void 0) {
|
|
2759
|
-
const d = dt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0,
|
|
2767
|
+
const d = dt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, A = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
|
|
2760
2768
|
a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
|
|
2761
|
-
for (let I = 0, ie =
|
|
2762
|
-
const ee =
|
|
2769
|
+
for (let I = 0, ie = A.length; I < ie; I++) {
|
|
2770
|
+
const ee = A[I];
|
|
2763
2771
|
if (y.setX(ee, v[I * l]), l >= 2 && y.setY(ee, v[I * l + 1]), l >= 3 && y.setZ(ee, v[I * l + 2]), l >= 4 && y.setW(ee, v[I * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
2764
2772
|
}
|
|
2765
2773
|
y.normalized = b;
|
|
@@ -2839,11 +2847,11 @@ class Ui {
|
|
|
2839
2847
|
const i = this;
|
|
2840
2848
|
return this.getDependency("texture", s.index).then(function(o) {
|
|
2841
2849
|
if (!o) return null;
|
|
2842
|
-
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[
|
|
2843
|
-
const a = s.extensions !== void 0 ? s.extensions[
|
|
2850
|
+
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[R.KHR_TEXTURE_TRANSFORM]) {
|
|
2851
|
+
const a = s.extensions !== void 0 ? s.extensions[R.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
2844
2852
|
if (a) {
|
|
2845
2853
|
const l = i.associations.get(o);
|
|
2846
|
-
o = i.extensions[
|
|
2854
|
+
o = i.extensions[R.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
|
|
2847
2855
|
}
|
|
2848
2856
|
}
|
|
2849
2857
|
return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
|
|
@@ -2894,8 +2902,8 @@ class Ui {
|
|
|
2894
2902
|
const t = this, s = this.json, n = this.extensions, i = s.materials[e];
|
|
2895
2903
|
let o;
|
|
2896
2904
|
const a = {}, l = i.extensions || {}, h = [];
|
|
2897
|
-
if (l[
|
|
2898
|
-
const c = n[
|
|
2905
|
+
if (l[R.KHR_MATERIALS_UNLIT]) {
|
|
2906
|
+
const c = n[R.KHR_MATERIALS_UNLIT];
|
|
2899
2907
|
o = c.getMaterialType(), h.push(c.extendParams(a, i, t));
|
|
2900
2908
|
} else {
|
|
2901
2909
|
const c = i.pbrMetallicRoughness || {};
|
|
@@ -2903,7 +2911,7 @@ class Ui {
|
|
|
2903
2911
|
const p = c.baseColorFactor;
|
|
2904
2912
|
a.color.setRGB(p[0], p[1], p[2], ae), a.opacity = p[3];
|
|
2905
2913
|
}
|
|
2906
|
-
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture,
|
|
2914
|
+
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Re)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (h.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), h.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(p) {
|
|
2907
2915
|
return p.getMaterialType && p.getMaterialType(e);
|
|
2908
2916
|
}), h.push(Promise.all(this._invokeAll(function(p) {
|
|
2909
2917
|
return p.extendMaterialParams && p.extendMaterialParams(e, a);
|
|
@@ -2919,7 +2927,7 @@ class Ui {
|
|
|
2919
2927
|
const c = i.emissiveFactor;
|
|
2920
2928
|
a.emissive = new pe().setRGB(c[0], c[1], c[2], ae);
|
|
2921
2929
|
}
|
|
2922
|
-
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture,
|
|
2930
|
+
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Re)), Promise.all(h).then(function() {
|
|
2923
2931
|
const c = new o(a);
|
|
2924
2932
|
return i.name && (c.name = i.name), ne(c, i), t.associations.set(c, { materials: e }), i.extensions && ge(n, c, i), c;
|
|
2925
2933
|
});
|
|
@@ -2947,7 +2955,7 @@ class Ui {
|
|
|
2947
2955
|
loadGeometries(e) {
|
|
2948
2956
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
2949
2957
|
function i(a) {
|
|
2950
|
-
return s[
|
|
2958
|
+
return s[R.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
2951
2959
|
return Jt(l, a, t);
|
|
2952
2960
|
});
|
|
2953
2961
|
}
|
|
@@ -2958,7 +2966,7 @@ class Ui {
|
|
|
2958
2966
|
o.push(c.promise);
|
|
2959
2967
|
else {
|
|
2960
2968
|
let p;
|
|
2961
|
-
h.extensions && h.extensions[
|
|
2969
|
+
h.extensions && h.extensions[R.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = Jt(new ze(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
|
|
2962
2970
|
}
|
|
2963
2971
|
}
|
|
2964
2972
|
return Promise.all(o);
|
|
@@ -3073,10 +3081,10 @@ class Ui {
|
|
|
3073
3081
|
]).then(function(c) {
|
|
3074
3082
|
const p = c[0], m = c[1], b = c[2], f = c[3], y = c[4], d = [];
|
|
3075
3083
|
for (let x = 0, S = p.length; x < S; x++) {
|
|
3076
|
-
const
|
|
3077
|
-
if (
|
|
3078
|
-
|
|
3079
|
-
const fe = s._createAnimationTracks(
|
|
3084
|
+
const A = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
|
|
3085
|
+
if (A === void 0) continue;
|
|
3086
|
+
A.updateMatrix && A.updateMatrix();
|
|
3087
|
+
const fe = s._createAnimationTracks(A, v, I, ie, ee);
|
|
3080
3088
|
if (fe)
|
|
3081
3089
|
for (let $ = 0; $ < fe.length; $++)
|
|
3082
3090
|
d.push(fe[$]);
|
|
@@ -3410,13 +3418,13 @@ const Ki = {
|
|
|
3410
3418
|
l.value ? (N(), U("span", {
|
|
3411
3419
|
key: 0,
|
|
3412
3420
|
class: "toggle-icon",
|
|
3413
|
-
onClick: y[0] || (y[0] =
|
|
3421
|
+
onClick: y[0] || (y[0] = At((_) => Mn(o)(r.node.uuid), ["stop"]))
|
|
3414
3422
|
}, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span", Ki)),
|
|
3415
3423
|
g("span", Vi, Ee(m(r.node)), 1),
|
|
3416
3424
|
g("span", Zi, Ee(b(r.node)), 1),
|
|
3417
3425
|
g("button", {
|
|
3418
3426
|
class: "tree-delete",
|
|
3419
|
-
onClick:
|
|
3427
|
+
onClick: At(p, ["stop"])
|
|
3420
3428
|
}, "×")
|
|
3421
3429
|
], 2),
|
|
3422
3430
|
a.value && l.value ? (N(), U("div", Qi, [
|
|
@@ -3502,13 +3510,13 @@ const Ji = {
|
|
|
3502
3510
|
return y.traverse((_) => {
|
|
3503
3511
|
if (_.type === "Mesh" && !d) {
|
|
3504
3512
|
const x = _, S = Array.isArray(x.material) ? x.material : [x.material];
|
|
3505
|
-
for (const
|
|
3506
|
-
if (
|
|
3507
|
-
const v =
|
|
3513
|
+
for (const A of S)
|
|
3514
|
+
if (A && (A.type === "MeshStandardMaterial" || A.type === "MeshPhongMaterial")) {
|
|
3515
|
+
const v = A;
|
|
3508
3516
|
d = {
|
|
3509
3517
|
metalness: v.metalness ?? 0,
|
|
3510
3518
|
roughness: v.roughness ?? 0.5,
|
|
3511
|
-
opacity:
|
|
3519
|
+
opacity: A.opacity ?? 1
|
|
3512
3520
|
};
|
|
3513
3521
|
break;
|
|
3514
3522
|
}
|
|
@@ -3519,8 +3527,8 @@ const Ji = {
|
|
|
3519
3527
|
let _ = !1;
|
|
3520
3528
|
return y.traverse((x) => {
|
|
3521
3529
|
if (x.type === "Mesh") {
|
|
3522
|
-
const S = x,
|
|
3523
|
-
for (const v of
|
|
3530
|
+
const S = x, A = Array.isArray(S.material) ? S.material : [S.material];
|
|
3531
|
+
for (const v of A)
|
|
3524
3532
|
v && (v.type === "MeshStandardMaterial" || v.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (v.metalness = d.metalness), d.roughness !== void 0 && (v.roughness = d.roughness), d.opacity !== void 0 && (v.opacity = d.opacity, v.transparent = d.opacity < 1), v.needsUpdate = !0, _ = !0);
|
|
3525
3533
|
}
|
|
3526
3534
|
}), _;
|
|
@@ -3787,7 +3795,7 @@ const Ji = {
|
|
|
3787
3795
|
g("p", null, "未选中任何模型", -1)
|
|
3788
3796
|
])]));
|
|
3789
3797
|
}
|
|
3790
|
-
}), xo = /* @__PURE__ */ Xe(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" },
|
|
3798
|
+
}), xo = /* @__PURE__ */ Xe(To, [["__scopeId", "data-v-d75c643f"]]), Eo = { class: "top-bar" }, Mo = { class: "left-section" }, vo = { class: "dropdown-menu" }, So = { class: "dropdown-menu sub-menu" }, Ro = { class: "dropdown-menu" }, Ao = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Ge({
|
|
3791
3799
|
__name: "TopBar",
|
|
3792
3800
|
emits: ["addModel", "importModel"],
|
|
3793
3801
|
setup(r, { emit: e }) {
|
|
@@ -3797,7 +3805,7 @@ const Ji = {
|
|
|
3797
3805
|
}, p = ($) => {
|
|
3798
3806
|
const E = $.target;
|
|
3799
3807
|
E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
|
|
3800
|
-
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"),
|
|
3808
|
+
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), A = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
|
|
3801
3809
|
return ($, E) => (N(), U("div", Eo, [
|
|
3802
3810
|
g("div", Mo, [
|
|
3803
3811
|
g("div", {
|
|
@@ -3852,7 +3860,7 @@ const Ji = {
|
|
|
3852
3860
|
onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
|
|
3853
3861
|
}, [
|
|
3854
3862
|
E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
3855
|
-
D(g("div",
|
|
3863
|
+
D(g("div", Ro, [
|
|
3856
3864
|
g("div", {
|
|
3857
3865
|
class: "menu-item",
|
|
3858
3866
|
onClick: y
|
|
@@ -3863,7 +3871,7 @@ const Ji = {
|
|
|
3863
3871
|
onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
|
|
3864
3872
|
}, [
|
|
3865
3873
|
E[18] || (E[18] = g("span", null, "网格", -1)),
|
|
3866
|
-
D(g("div",
|
|
3874
|
+
D(g("div", Ao, [
|
|
3867
3875
|
g("div", {
|
|
3868
3876
|
class: "menu-item",
|
|
3869
3877
|
onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
|
|
@@ -3932,7 +3940,7 @@ const Ji = {
|
|
|
3932
3940
|
}, "重置相机"),
|
|
3933
3941
|
g("div", {
|
|
3934
3942
|
class: "menu-item",
|
|
3935
|
-
onClick:
|
|
3943
|
+
onClick: A
|
|
3936
3944
|
}, "显示网格")
|
|
3937
3945
|
], 512), [
|
|
3938
3946
|
[he, n.value]
|
|
@@ -4020,7 +4028,7 @@ const Ji = {
|
|
|
4020
4028
|
} catch (y) {
|
|
4021
4029
|
console.error("导入失败:", y), alert("导入失败:" + y.message);
|
|
4022
4030
|
}
|
|
4023
|
-
}, h =
|
|
4031
|
+
}, h = Rn([]);
|
|
4024
4032
|
$s((f) => {
|
|
4025
4033
|
h.value = f;
|
|
4026
4034
|
});
|
|
@@ -4028,7 +4036,7 @@ const Ji = {
|
|
|
4028
4036
|
const f = Js();
|
|
4029
4037
|
f && (h.value = f);
|
|
4030
4038
|
}, c = (f) => Mt(f), p = (f) => Ks(f.uuid), m = G(null);
|
|
4031
|
-
return
|
|
4039
|
+
return An(() => {
|
|
4032
4040
|
m.value && Ns(m.value, e.mode, e.sceneData), u();
|
|
4033
4041
|
}), (f, y) => (N(), U("div", jo, [
|
|
4034
4042
|
r.mode === "edit" ? (N(), ot(Co, {
|