endset_three_editor 0.2.0 → 0.2.2
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 Rt, 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 An, onMounted as Rn, 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 Ae, 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 R = S;
|
|
535
535
|
Object.defineProperty(o, x, {
|
|
536
536
|
get: function() {
|
|
537
|
-
return
|
|
537
|
+
return R !== void 0 ? R : S;
|
|
538
538
|
},
|
|
539
539
|
set: function(v) {
|
|
540
|
-
|
|
540
|
+
R !== v && (R = 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 = As.bind(this), this._onPointerDown = Ps.bind(this), this._onPointerHover = Rs.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 As(r) {
|
|
709
709
|
if (this.domElement.ownerDocument.pointerLockElement)
|
|
710
710
|
return {
|
|
711
711
|
x: 0,
|
|
@@ -721,7 +721,7 @@ function Rs(r) {
|
|
|
721
721
|
};
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Rs(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 R = {
|
|
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 At = X.geometry.clone();
|
|
1008
|
+
At.applyMatrix4(X.matrix), X.geometry = At, 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(R)), 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,9 +1095,14 @@ const w = {
|
|
|
1095
1095
|
/** 当前选中的物体 */
|
|
1096
1096
|
selectedObject: null
|
|
1097
1097
|
};
|
|
1098
|
-
let ht = !1,
|
|
1098
|
+
let ht = !1, Re = !1, be = null, bt = null, it = null, we = [];
|
|
1099
1099
|
function Ns(r, e = "edit", t) {
|
|
1100
|
-
w.container = r, w.mode = e, ks(), js(),
|
|
1100
|
+
if (w.container = r, w.mode = e, ks(), js(), Hs(), t) {
|
|
1101
|
+
ei(t.scene, e);
|
|
1102
|
+
const s = t.camera;
|
|
1103
|
+
w.camera.position.fromArray(s.position), w.camera.rotation.fromArray(s.rotation);
|
|
1104
|
+
}
|
|
1105
|
+
zs(), Us(), Qs(), mn(), e === "edit" && r.addEventListener("click", Ys), window.addEventListener("resize", Xs), t || Gs(), e === "edit" && Fs();
|
|
1101
1106
|
}
|
|
1102
1107
|
function ks() {
|
|
1103
1108
|
const r = new F.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
@@ -1121,8 +1126,8 @@ function Us() {
|
|
|
1121
1126
|
}), r.addEventListener("change", () => {
|
|
1122
1127
|
ht = !0;
|
|
1123
1128
|
}), r.addEventListener("end", () => {
|
|
1124
|
-
ht && (
|
|
1125
|
-
|
|
1129
|
+
ht && (Re = !0, setTimeout(() => {
|
|
1130
|
+
Re = !1;
|
|
1126
1131
|
}, 200));
|
|
1127
1132
|
}), w.orbitControls = r;
|
|
1128
1133
|
}
|
|
@@ -1132,8 +1137,8 @@ function zs() {
|
|
|
1132
1137
|
w.renderer.domElement
|
|
1133
1138
|
);
|
|
1134
1139
|
r.addEventListener("dragging-changed", (e) => {
|
|
1135
|
-
w.orbitControls.enabled = !e.value, e.value || (
|
|
1136
|
-
|
|
1140
|
+
w.orbitControls.enabled = !e.value, e.value || (Re = !0, setTimeout(() => {
|
|
1141
|
+
Re = !1;
|
|
1137
1142
|
}, 200));
|
|
1138
1143
|
}), r.addEventListener("objectChange", () => {
|
|
1139
1144
|
bt && w.selectedObject && bt(w.selectedObject);
|
|
@@ -1161,8 +1166,8 @@ function gn() {
|
|
|
1161
1166
|
w.selectedObject && (w.transformControls.detach(), w.selectedObject = null, be == null || be(null));
|
|
1162
1167
|
}
|
|
1163
1168
|
function Ys(r) {
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1169
|
+
if (Re) {
|
|
1170
|
+
Re = !1;
|
|
1166
1171
|
return;
|
|
1167
1172
|
}
|
|
1168
1173
|
const e = w.renderer.domElement.getBoundingClientRect(), t = new F.Vector2(
|
|
@@ -1225,14 +1230,18 @@ function Yo() {
|
|
|
1225
1230
|
return w.renderer;
|
|
1226
1231
|
}
|
|
1227
1232
|
function Bo() {
|
|
1233
|
+
var n, i;
|
|
1228
1234
|
const r = w.scene;
|
|
1229
1235
|
if (!r) return "{}";
|
|
1230
1236
|
let e = r;
|
|
1231
1237
|
e = r.clone(), e.children = e.children.filter(
|
|
1232
|
-
(
|
|
1238
|
+
(o) => o.userData.type !== "initFloor"
|
|
1233
1239
|
);
|
|
1234
|
-
const t = e.toJSON()
|
|
1235
|
-
|
|
1240
|
+
const t = e.toJSON(), s = {
|
|
1241
|
+
position: (n = w.camera) == null ? void 0 : n.position,
|
|
1242
|
+
rotation: (i = w.camera) == null ? void 0 : i.rotation
|
|
1243
|
+
};
|
|
1244
|
+
return JSON.stringify({ scene: t, camera: s });
|
|
1236
1245
|
}
|
|
1237
1246
|
function ei(r, e = "edit") {
|
|
1238
1247
|
var i;
|
|
@@ -1469,7 +1478,7 @@ class ri extends ln {
|
|
|
1469
1478
|
parseFloat(c[4]),
|
|
1470
1479
|
parseFloat(c[5]),
|
|
1471
1480
|
parseFloat(c[6]),
|
|
1472
|
-
|
|
1481
|
+
Ae
|
|
1473
1482
|
), t.colors.push(et.r, et.g, et.b)) : t.colors.push(void 0, void 0, void 0);
|
|
1474
1483
|
break;
|
|
1475
1484
|
case "vn":
|
|
@@ -1558,8 +1567,8 @@ class ri extends ln {
|
|
|
1558
1567
|
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));
|
|
1559
1568
|
const y = [];
|
|
1560
1569
|
for (let _ = 0, x = c.length; _ < x; _++) {
|
|
1561
|
-
const S = c[_],
|
|
1562
|
-
let v = t.materials[
|
|
1570
|
+
const S = c[_], R = S.name + "_" + S.smooth + "_" + b;
|
|
1571
|
+
let v = t.materials[R];
|
|
1563
1572
|
if (this.materials !== null) {
|
|
1564
1573
|
if (v = this.materials.create(S.name), p && v && !(v instanceof ke)) {
|
|
1565
1574
|
const I = new ke();
|
|
@@ -1569,7 +1578,7 @@ class ri extends ln {
|
|
|
1569
1578
|
je.prototype.copy.call(I, v), I.color.copy(v.color), I.map = v.map, v = I;
|
|
1570
1579
|
}
|
|
1571
1580
|
}
|
|
1572
|
-
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[
|
|
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[R] = v), y.push(v);
|
|
1573
1582
|
}
|
|
1574
1583
|
let d;
|
|
1575
1584
|
if (y.length > 1) {
|
|
@@ -1673,9 +1682,9 @@ class li extends ln {
|
|
|
1673
1682
|
}), this.register(function(t) {
|
|
1674
1683
|
return new hi(t);
|
|
1675
1684
|
}), this.register(function(t) {
|
|
1676
|
-
return new Qt(t,
|
|
1685
|
+
return new Qt(t, A.EXT_MESHOPT_COMPRESSION);
|
|
1677
1686
|
}), this.register(function(t) {
|
|
1678
|
-
return new Qt(t,
|
|
1687
|
+
return new Qt(t, A.KHR_MESHOPT_COMPRESSION);
|
|
1679
1688
|
}), this.register(function(t) {
|
|
1680
1689
|
return new Si(t);
|
|
1681
1690
|
});
|
|
@@ -1779,12 +1788,12 @@ class li extends ln {
|
|
|
1779
1788
|
else if (e instanceof ArrayBuffer)
|
|
1780
1789
|
if (l.decode(new Uint8Array(e, 0, 4)) === _n) {
|
|
1781
1790
|
try {
|
|
1782
|
-
o[
|
|
1791
|
+
o[A.KHR_BINARY_GLTF] = new Ai(e);
|
|
1783
1792
|
} catch (c) {
|
|
1784
1793
|
n && n(c);
|
|
1785
1794
|
return;
|
|
1786
1795
|
}
|
|
1787
|
-
i = JSON.parse(o[
|
|
1796
|
+
i = JSON.parse(o[A.KHR_BINARY_GLTF].content);
|
|
1788
1797
|
} else
|
|
1789
1798
|
i = JSON.parse(l.decode(e));
|
|
1790
1799
|
else
|
|
@@ -1810,16 +1819,16 @@ class li extends ln {
|
|
|
1810
1819
|
for (let u = 0; u < i.extensionsUsed.length; ++u) {
|
|
1811
1820
|
const c = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
1812
1821
|
switch (c) {
|
|
1813
|
-
case
|
|
1822
|
+
case A.KHR_MATERIALS_UNLIT:
|
|
1814
1823
|
o[c] = new ui();
|
|
1815
1824
|
break;
|
|
1816
|
-
case
|
|
1817
|
-
o[c] = new
|
|
1825
|
+
case A.KHR_DRACO_MESH_COMPRESSION:
|
|
1826
|
+
o[c] = new Ri(i, this.dracoLoader);
|
|
1818
1827
|
break;
|
|
1819
|
-
case
|
|
1828
|
+
case A.KHR_TEXTURE_TRANSFORM:
|
|
1820
1829
|
o[c] = new Pi();
|
|
1821
1830
|
break;
|
|
1822
|
-
case
|
|
1831
|
+
case A.KHR_MESH_QUANTIZATION:
|
|
1823
1832
|
o[c] = new Li();
|
|
1824
1833
|
break;
|
|
1825
1834
|
default:
|
|
@@ -1864,7 +1873,7 @@ function C(r, e, t) {
|
|
|
1864
1873
|
const s = r.json.materials[e];
|
|
1865
1874
|
return s.extensions && s.extensions[t] ? s.extensions[t] : null;
|
|
1866
1875
|
}
|
|
1867
|
-
const
|
|
1876
|
+
const A = {
|
|
1868
1877
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
1869
1878
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
1870
1879
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -1891,7 +1900,7 @@ const R = {
|
|
|
1891
1900
|
};
|
|
1892
1901
|
class hi {
|
|
1893
1902
|
constructor(e) {
|
|
1894
|
-
this.parser = e, this.name =
|
|
1903
|
+
this.parser = e, this.name = A.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1895
1904
|
}
|
|
1896
1905
|
_markDefs() {
|
|
1897
1906
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
@@ -1937,7 +1946,7 @@ class hi {
|
|
|
1937
1946
|
}
|
|
1938
1947
|
class ui {
|
|
1939
1948
|
constructor() {
|
|
1940
|
-
this.name =
|
|
1949
|
+
this.name = A.KHR_MATERIALS_UNLIT;
|
|
1941
1950
|
}
|
|
1942
1951
|
getMaterialType() {
|
|
1943
1952
|
return _e;
|
|
@@ -1951,14 +1960,14 @@ class ui {
|
|
|
1951
1960
|
const o = i.baseColorFactor;
|
|
1952
1961
|
e.color.setRGB(o[0], o[1], o[2], ae), e.opacity = o[3];
|
|
1953
1962
|
}
|
|
1954
|
-
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture,
|
|
1963
|
+
i.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", i.baseColorTexture, Ae));
|
|
1955
1964
|
}
|
|
1956
1965
|
return Promise.all(n);
|
|
1957
1966
|
}
|
|
1958
1967
|
}
|
|
1959
1968
|
class di {
|
|
1960
1969
|
constructor(e) {
|
|
1961
|
-
this.parser = e, this.name =
|
|
1970
|
+
this.parser = e, this.name = A.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1962
1971
|
}
|
|
1963
1972
|
extendMaterialParams(e, t) {
|
|
1964
1973
|
const s = C(this.parser, e, this.name);
|
|
@@ -1967,7 +1976,7 @@ class di {
|
|
|
1967
1976
|
}
|
|
1968
1977
|
class pi {
|
|
1969
1978
|
constructor(e) {
|
|
1970
|
-
this.parser = e, this.name =
|
|
1979
|
+
this.parser = e, this.name = A.KHR_MATERIALS_CLEARCOAT;
|
|
1971
1980
|
}
|
|
1972
1981
|
getMaterialType(e) {
|
|
1973
1982
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -1985,7 +1994,7 @@ class pi {
|
|
|
1985
1994
|
}
|
|
1986
1995
|
class fi {
|
|
1987
1996
|
constructor(e) {
|
|
1988
|
-
this.parser = e, this.name =
|
|
1997
|
+
this.parser = e, this.name = A.KHR_MATERIALS_DISPERSION;
|
|
1989
1998
|
}
|
|
1990
1999
|
getMaterialType(e) {
|
|
1991
2000
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -1997,7 +2006,7 @@ class fi {
|
|
|
1997
2006
|
}
|
|
1998
2007
|
class mi {
|
|
1999
2008
|
constructor(e) {
|
|
2000
|
-
this.parser = e, this.name =
|
|
2009
|
+
this.parser = e, this.name = A.KHR_MATERIALS_IRIDESCENCE;
|
|
2001
2010
|
}
|
|
2002
2011
|
getMaterialType(e) {
|
|
2003
2012
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2011,7 +2020,7 @@ class mi {
|
|
|
2011
2020
|
}
|
|
2012
2021
|
class gi {
|
|
2013
2022
|
constructor(e) {
|
|
2014
|
-
this.parser = e, this.name =
|
|
2023
|
+
this.parser = e, this.name = A.KHR_MATERIALS_SHEEN;
|
|
2015
2024
|
}
|
|
2016
2025
|
getMaterialType(e) {
|
|
2017
2026
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2024,12 +2033,12 @@ class gi {
|
|
|
2024
2033
|
const i = s.sheenColorFactor;
|
|
2025
2034
|
t.sheenColor.setRGB(i[0], i[1], i[2], ae);
|
|
2026
2035
|
}
|
|
2027
|
-
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture,
|
|
2036
|
+
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenColorMap", s.sheenColorTexture, Ae)), s.sheenRoughnessTexture !== void 0 && n.push(this.parser.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(n);
|
|
2028
2037
|
}
|
|
2029
2038
|
}
|
|
2030
2039
|
class yi {
|
|
2031
2040
|
constructor(e) {
|
|
2032
|
-
this.parser = e, this.name =
|
|
2041
|
+
this.parser = e, this.name = A.KHR_MATERIALS_TRANSMISSION;
|
|
2033
2042
|
}
|
|
2034
2043
|
getMaterialType(e) {
|
|
2035
2044
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2043,7 +2052,7 @@ class yi {
|
|
|
2043
2052
|
}
|
|
2044
2053
|
class _i {
|
|
2045
2054
|
constructor(e) {
|
|
2046
|
-
this.parser = e, this.name =
|
|
2055
|
+
this.parser = e, this.name = A.KHR_MATERIALS_VOLUME;
|
|
2047
2056
|
}
|
|
2048
2057
|
getMaterialType(e) {
|
|
2049
2058
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2059,7 +2068,7 @@ class _i {
|
|
|
2059
2068
|
}
|
|
2060
2069
|
class bi {
|
|
2061
2070
|
constructor(e) {
|
|
2062
|
-
this.parser = e, this.name =
|
|
2071
|
+
this.parser = e, this.name = A.KHR_MATERIALS_IOR;
|
|
2063
2072
|
}
|
|
2064
2073
|
getMaterialType(e) {
|
|
2065
2074
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2071,7 +2080,7 @@ class bi {
|
|
|
2071
2080
|
}
|
|
2072
2081
|
class wi {
|
|
2073
2082
|
constructor(e) {
|
|
2074
|
-
this.parser = e, this.name =
|
|
2083
|
+
this.parser = e, this.name = A.KHR_MATERIALS_SPECULAR;
|
|
2075
2084
|
}
|
|
2076
2085
|
getMaterialType(e) {
|
|
2077
2086
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2082,12 +2091,12 @@ class wi {
|
|
|
2082
2091
|
const n = [];
|
|
2083
2092
|
t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
|
|
2084
2093
|
const i = s.specularColorFactor || [1, 1, 1];
|
|
2085
|
-
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,
|
|
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, Ae)), Promise.all(n);
|
|
2086
2095
|
}
|
|
2087
2096
|
}
|
|
2088
2097
|
class Ti {
|
|
2089
2098
|
constructor(e) {
|
|
2090
|
-
this.parser = e, this.name =
|
|
2099
|
+
this.parser = e, this.name = A.EXT_MATERIALS_BUMP;
|
|
2091
2100
|
}
|
|
2092
2101
|
getMaterialType(e) {
|
|
2093
2102
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2101,7 +2110,7 @@ class Ti {
|
|
|
2101
2110
|
}
|
|
2102
2111
|
class xi {
|
|
2103
2112
|
constructor(e) {
|
|
2104
|
-
this.parser = e, this.name =
|
|
2113
|
+
this.parser = e, this.name = A.KHR_MATERIALS_ANISOTROPY;
|
|
2105
2114
|
}
|
|
2106
2115
|
getMaterialType(e) {
|
|
2107
2116
|
return C(this.parser, e, this.name) !== null ? se : null;
|
|
@@ -2115,7 +2124,7 @@ class xi {
|
|
|
2115
2124
|
}
|
|
2116
2125
|
class Ei {
|
|
2117
2126
|
constructor(e) {
|
|
2118
|
-
this.parser = e, this.name =
|
|
2127
|
+
this.parser = e, this.name = A.KHR_TEXTURE_BASISU;
|
|
2119
2128
|
}
|
|
2120
2129
|
loadTexture(e) {
|
|
2121
2130
|
const t = this.parser, s = t.json, n = s.textures[e];
|
|
@@ -2132,7 +2141,7 @@ class Ei {
|
|
|
2132
2141
|
}
|
|
2133
2142
|
class Mi {
|
|
2134
2143
|
constructor(e) {
|
|
2135
|
-
this.parser = e, this.name =
|
|
2144
|
+
this.parser = e, this.name = A.EXT_TEXTURE_WEBP;
|
|
2136
2145
|
}
|
|
2137
2146
|
loadTexture(e) {
|
|
2138
2147
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2149,7 +2158,7 @@ class Mi {
|
|
|
2149
2158
|
}
|
|
2150
2159
|
class vi {
|
|
2151
2160
|
constructor(e) {
|
|
2152
|
-
this.parser = e, this.name =
|
|
2161
|
+
this.parser = e, this.name = A.EXT_TEXTURE_AVIF;
|
|
2153
2162
|
}
|
|
2154
2163
|
loadTexture(e) {
|
|
2155
2164
|
const t = this.name, s = this.parser, n = s.json, i = n.textures[e];
|
|
@@ -2192,7 +2201,7 @@ class Qt {
|
|
|
2192
2201
|
}
|
|
2193
2202
|
class Si {
|
|
2194
2203
|
constructor(e) {
|
|
2195
|
-
this.name =
|
|
2204
|
+
this.name = A.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
2196
2205
|
}
|
|
2197
2206
|
createNodeMesh(e) {
|
|
2198
2207
|
const t = this.parser.json, s = t.nodes[e];
|
|
@@ -2213,8 +2222,8 @@ class Si {
|
|
|
2213
2222
|
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, _));
|
|
2214
2223
|
for (const S in l)
|
|
2215
2224
|
if (S === "_COLOR_0") {
|
|
2216
|
-
const
|
|
2217
|
-
x.instanceColor = new Gn(
|
|
2225
|
+
const R = l[S];
|
|
2226
|
+
x.instanceColor = new Gn(R.array, R.itemSize, R.normalized);
|
|
2218
2227
|
} else S !== "TRANSLATION" && S !== "ROTATION" && S !== "SCALE" && b.geometry.setAttribute(S, l[S]);
|
|
2219
2228
|
Ue.prototype.copy.call(x, b), this.parser.assignFinalMaterial(x), m.push(x);
|
|
2220
2229
|
}
|
|
@@ -2223,9 +2232,9 @@ class Si {
|
|
|
2223
2232
|
}
|
|
2224
2233
|
}
|
|
2225
2234
|
const _n = "glTF", Oe = 12, qt = { JSON: 1313821514, BIN: 5130562 };
|
|
2226
|
-
class
|
|
2235
|
+
class Ai {
|
|
2227
2236
|
constructor(e) {
|
|
2228
|
-
this.name =
|
|
2237
|
+
this.name = A.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
2229
2238
|
const t = new DataView(e, 0, Oe), s = new TextDecoder();
|
|
2230
2239
|
if (this.header = {
|
|
2231
2240
|
magic: s.decode(new Uint8Array(e.slice(0, 4))),
|
|
@@ -2254,11 +2263,11 @@ class Ri {
|
|
|
2254
2263
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
2255
2264
|
}
|
|
2256
2265
|
}
|
|
2257
|
-
class
|
|
2266
|
+
class Ri {
|
|
2258
2267
|
constructor(e, t) {
|
|
2259
2268
|
if (!t)
|
|
2260
2269
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
2261
|
-
this.name =
|
|
2270
|
+
this.name = A.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
2262
2271
|
}
|
|
2263
2272
|
decodePrimitive(e, t) {
|
|
2264
2273
|
const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, h = {};
|
|
@@ -2288,7 +2297,7 @@ class Ai {
|
|
|
2288
2297
|
}
|
|
2289
2298
|
class Pi {
|
|
2290
2299
|
constructor() {
|
|
2291
|
-
this.name =
|
|
2300
|
+
this.name = A.KHR_TEXTURE_TRANSFORM;
|
|
2292
2301
|
}
|
|
2293
2302
|
extendTexture(e, t) {
|
|
2294
2303
|
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;
|
|
@@ -2296,7 +2305,7 @@ class Pi {
|
|
|
2296
2305
|
}
|
|
2297
2306
|
class Li {
|
|
2298
2307
|
constructor() {
|
|
2299
|
-
this.name =
|
|
2308
|
+
this.name = A.KHR_MESH_QUANTIZATION;
|
|
2300
2309
|
}
|
|
2301
2310
|
}
|
|
2302
2311
|
class bn extends ls {
|
|
@@ -2312,8 +2321,8 @@ class bn extends ls {
|
|
|
2312
2321
|
interpolate_(e, t, s, n) {
|
|
2313
2322
|
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;
|
|
2314
2323
|
for (let S = 0; S !== a; S++) {
|
|
2315
|
-
const
|
|
2316
|
-
i[S] = _ *
|
|
2324
|
+
const R = o[f + S + a], v = o[f + S + l] * u, I = o[b + S + a], ie = o[b + S] * u;
|
|
2325
|
+
i[S] = _ * R + x * v + y * I + d * ie;
|
|
2317
2326
|
}
|
|
2318
2327
|
return i;
|
|
2319
2328
|
}
|
|
@@ -2452,7 +2461,7 @@ function ki(r, e) {
|
|
|
2452
2461
|
}
|
|
2453
2462
|
function ji(r) {
|
|
2454
2463
|
let e;
|
|
2455
|
-
const t = r.extensions && r.extensions[
|
|
2464
|
+
const t = r.extensions && r.extensions[A.KHR_DRACO_MESH_COMPRESSION];
|
|
2456
2465
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ft(t.attributes) : e = r.indices + ":" + ft(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
2457
2466
|
for (let s = 0, n = r.targets.length; s < n; s++)
|
|
2458
2467
|
e += ":" + ft(r.targets[s]);
|
|
@@ -2701,7 +2710,7 @@ class Ui {
|
|
|
2701
2710
|
if (t.type && t.type !== "arraybuffer")
|
|
2702
2711
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
2703
2712
|
if (t.uri === void 0 && e === 0)
|
|
2704
|
-
return Promise.resolve(this.extensions[
|
|
2713
|
+
return Promise.resolve(this.extensions[A.KHR_BINARY_GLTF].body);
|
|
2705
2714
|
const n = this.options;
|
|
2706
2715
|
return new Promise(function(i, o) {
|
|
2707
2716
|
s.load(Fe.resolveURL(t.uri, n.path), i, void 0, function() {
|
|
@@ -2747,10 +2756,10 @@ class Ui {
|
|
|
2747
2756
|
} else
|
|
2748
2757
|
a === null ? f = new h(n.count * l) : f = new h(a, p, n.count * l), y = new rt(f, l, b);
|
|
2749
2758
|
if (n.sparse !== void 0) {
|
|
2750
|
-
const d = dt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0,
|
|
2759
|
+
const d = dt.SCALAR, _ = ve[n.sparse.indices.componentType], x = n.sparse.indices.byteOffset || 0, S = n.sparse.values.byteOffset || 0, R = new _(o[1], x, n.sparse.count * d), v = new h(o[2], S, n.sparse.count * l);
|
|
2751
2760
|
a !== null && (y = new rt(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
|
|
2752
|
-
for (let I = 0, ie =
|
|
2753
|
-
const ee =
|
|
2761
|
+
for (let I = 0, ie = R.length; I < ie; I++) {
|
|
2762
|
+
const ee = R[I];
|
|
2754
2763
|
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.");
|
|
2755
2764
|
}
|
|
2756
2765
|
y.normalized = b;
|
|
@@ -2830,11 +2839,11 @@ class Ui {
|
|
|
2830
2839
|
const i = this;
|
|
2831
2840
|
return this.getDependency("texture", s.index).then(function(o) {
|
|
2832
2841
|
if (!o) return null;
|
|
2833
|
-
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[
|
|
2834
|
-
const a = s.extensions !== void 0 ? s.extensions[
|
|
2842
|
+
if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), i.extensions[A.KHR_TEXTURE_TRANSFORM]) {
|
|
2843
|
+
const a = s.extensions !== void 0 ? s.extensions[A.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
2835
2844
|
if (a) {
|
|
2836
2845
|
const l = i.associations.get(o);
|
|
2837
|
-
o = i.extensions[
|
|
2846
|
+
o = i.extensions[A.KHR_TEXTURE_TRANSFORM].extendTexture(o, a), i.associations.set(o, l);
|
|
2838
2847
|
}
|
|
2839
2848
|
}
|
|
2840
2849
|
return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
|
|
@@ -2885,8 +2894,8 @@ class Ui {
|
|
|
2885
2894
|
const t = this, s = this.json, n = this.extensions, i = s.materials[e];
|
|
2886
2895
|
let o;
|
|
2887
2896
|
const a = {}, l = i.extensions || {}, h = [];
|
|
2888
|
-
if (l[
|
|
2889
|
-
const c = n[
|
|
2897
|
+
if (l[A.KHR_MATERIALS_UNLIT]) {
|
|
2898
|
+
const c = n[A.KHR_MATERIALS_UNLIT];
|
|
2890
2899
|
o = c.getMaterialType(), h.push(c.extendParams(a, i, t));
|
|
2891
2900
|
} else {
|
|
2892
2901
|
const c = i.pbrMetallicRoughness || {};
|
|
@@ -2894,7 +2903,7 @@ class Ui {
|
|
|
2894
2903
|
const p = c.baseColorFactor;
|
|
2895
2904
|
a.color.setRGB(p[0], p[1], p[2], ae), a.opacity = p[3];
|
|
2896
2905
|
}
|
|
2897
|
-
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture,
|
|
2906
|
+
c.baseColorTexture !== void 0 && h.push(t.assignTexture(a, "map", c.baseColorTexture, Ae)), 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) {
|
|
2898
2907
|
return p.getMaterialType && p.getMaterialType(e);
|
|
2899
2908
|
}), h.push(Promise.all(this._invokeAll(function(p) {
|
|
2900
2909
|
return p.extendMaterialParams && p.extendMaterialParams(e, a);
|
|
@@ -2910,7 +2919,7 @@ class Ui {
|
|
|
2910
2919
|
const c = i.emissiveFactor;
|
|
2911
2920
|
a.emissive = new pe().setRGB(c[0], c[1], c[2], ae);
|
|
2912
2921
|
}
|
|
2913
|
-
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture,
|
|
2922
|
+
return i.emissiveTexture !== void 0 && o !== _e && h.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(h).then(function() {
|
|
2914
2923
|
const c = new o(a);
|
|
2915
2924
|
return i.name && (c.name = i.name), ne(c, i), t.associations.set(c, { materials: e }), i.extensions && ge(n, c, i), c;
|
|
2916
2925
|
});
|
|
@@ -2938,7 +2947,7 @@ class Ui {
|
|
|
2938
2947
|
loadGeometries(e) {
|
|
2939
2948
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
2940
2949
|
function i(a) {
|
|
2941
|
-
return s[
|
|
2950
|
+
return s[A.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
2942
2951
|
return Jt(l, a, t);
|
|
2943
2952
|
});
|
|
2944
2953
|
}
|
|
@@ -2949,7 +2958,7 @@ class Ui {
|
|
|
2949
2958
|
o.push(c.promise);
|
|
2950
2959
|
else {
|
|
2951
2960
|
let p;
|
|
2952
|
-
h.extensions && h.extensions[
|
|
2961
|
+
h.extensions && h.extensions[A.KHR_DRACO_MESH_COMPRESSION] ? p = i(h) : p = Jt(new ze(), h, t), n[u] = { primitive: h, promise: p }, o.push(p);
|
|
2953
2962
|
}
|
|
2954
2963
|
}
|
|
2955
2964
|
return Promise.all(o);
|
|
@@ -3064,10 +3073,10 @@ class Ui {
|
|
|
3064
3073
|
]).then(function(c) {
|
|
3065
3074
|
const p = c[0], m = c[1], b = c[2], f = c[3], y = c[4], d = [];
|
|
3066
3075
|
for (let x = 0, S = p.length; x < S; x++) {
|
|
3067
|
-
const
|
|
3068
|
-
if (
|
|
3069
|
-
|
|
3070
|
-
const fe = s._createAnimationTracks(
|
|
3076
|
+
const R = p[x], v = m[x], I = b[x], ie = f[x], ee = y[x];
|
|
3077
|
+
if (R === void 0) continue;
|
|
3078
|
+
R.updateMatrix && R.updateMatrix();
|
|
3079
|
+
const fe = s._createAnimationTracks(R, v, I, ie, ee);
|
|
3071
3080
|
if (fe)
|
|
3072
3081
|
for (let $ = 0; $ < fe.length; $++)
|
|
3073
3082
|
d.push(fe[$]);
|
|
@@ -3401,13 +3410,13 @@ const Ki = {
|
|
|
3401
3410
|
l.value ? (N(), U("span", {
|
|
3402
3411
|
key: 0,
|
|
3403
3412
|
class: "toggle-icon",
|
|
3404
|
-
onClick: y[0] || (y[0] =
|
|
3413
|
+
onClick: y[0] || (y[0] = Rt((_) => Mn(o)(r.node.uuid), ["stop"]))
|
|
3405
3414
|
}, Ee(a.value ? "▼" : "▶"), 1)) : (N(), U("span", Ki)),
|
|
3406
3415
|
g("span", Vi, Ee(m(r.node)), 1),
|
|
3407
3416
|
g("span", Zi, Ee(b(r.node)), 1),
|
|
3408
3417
|
g("button", {
|
|
3409
3418
|
class: "tree-delete",
|
|
3410
|
-
onClick:
|
|
3419
|
+
onClick: Rt(p, ["stop"])
|
|
3411
3420
|
}, "×")
|
|
3412
3421
|
], 2),
|
|
3413
3422
|
a.value && l.value ? (N(), U("div", Qi, [
|
|
@@ -3493,13 +3502,13 @@ const Ji = {
|
|
|
3493
3502
|
return y.traverse((_) => {
|
|
3494
3503
|
if (_.type === "Mesh" && !d) {
|
|
3495
3504
|
const x = _, S = Array.isArray(x.material) ? x.material : [x.material];
|
|
3496
|
-
for (const
|
|
3497
|
-
if (
|
|
3498
|
-
const v =
|
|
3505
|
+
for (const R of S)
|
|
3506
|
+
if (R && (R.type === "MeshStandardMaterial" || R.type === "MeshPhongMaterial")) {
|
|
3507
|
+
const v = R;
|
|
3499
3508
|
d = {
|
|
3500
3509
|
metalness: v.metalness ?? 0,
|
|
3501
3510
|
roughness: v.roughness ?? 0.5,
|
|
3502
|
-
opacity:
|
|
3511
|
+
opacity: R.opacity ?? 1
|
|
3503
3512
|
};
|
|
3504
3513
|
break;
|
|
3505
3514
|
}
|
|
@@ -3510,8 +3519,8 @@ const Ji = {
|
|
|
3510
3519
|
let _ = !1;
|
|
3511
3520
|
return y.traverse((x) => {
|
|
3512
3521
|
if (x.type === "Mesh") {
|
|
3513
|
-
const S = x,
|
|
3514
|
-
for (const v of
|
|
3522
|
+
const S = x, R = Array.isArray(S.material) ? S.material : [S.material];
|
|
3523
|
+
for (const v of R)
|
|
3515
3524
|
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);
|
|
3516
3525
|
}
|
|
3517
3526
|
}), _;
|
|
@@ -3778,7 +3787,7 @@ const Ji = {
|
|
|
3778
3787
|
g("p", null, "未选中任何模型", -1)
|
|
3779
3788
|
])]));
|
|
3780
3789
|
}
|
|
3781
|
-
}), 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" },
|
|
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" }, Ao = { class: "dropdown-menu" }, Ro = { class: "dropdown-menu sub-menu" }, Po = { class: "dropdown-menu" }, Lo = { class: "dropdown-menu" }, Io = { class: "dropdown-menu" }, Oo = /* @__PURE__ */ Ge({
|
|
3782
3791
|
__name: "TopBar",
|
|
3783
3792
|
emits: ["addModel", "importModel"],
|
|
3784
3793
|
setup(r, { emit: e }) {
|
|
@@ -3788,7 +3797,7 @@ const Ji = {
|
|
|
3788
3797
|
}, p = ($) => {
|
|
3789
3798
|
const E = $.target;
|
|
3790
3799
|
E.files && E.files.length > 0 && (h("importModel", E.files[0]), E.value = "");
|
|
3791
|
-
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"),
|
|
3800
|
+
}, m = () => console.log("新建项目"), b = () => console.log("保存场景"), f = () => console.log("导出模型"), y = () => console.log("撤销"), d = () => console.log("重做"), _ = () => console.log("复制物体"), x = () => console.log("删除物体"), S = () => console.log("重置相机"), R = () => console.log("切换网格"), v = () => console.log("打开帮助"), I = () => console.log("关于编辑器"), ie = () => console.log("打开项目"), ee = () => console.log("打开模型"), fe = () => console.log("打开场景");
|
|
3792
3801
|
return ($, E) => (N(), U("div", Eo, [
|
|
3793
3802
|
g("div", Mo, [
|
|
3794
3803
|
g("div", {
|
|
@@ -3843,7 +3852,7 @@ const Ji = {
|
|
|
3843
3852
|
onMouseleave: E[9] || (E[9] = (j) => o.value = !1)
|
|
3844
3853
|
}, [
|
|
3845
3854
|
E[19] || (E[19] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
3846
|
-
D(g("div",
|
|
3855
|
+
D(g("div", Ao, [
|
|
3847
3856
|
g("div", {
|
|
3848
3857
|
class: "menu-item",
|
|
3849
3858
|
onClick: y
|
|
@@ -3854,7 +3863,7 @@ const Ji = {
|
|
|
3854
3863
|
onMouseleave: E[7] || (E[7] = (j) => l.value = !1)
|
|
3855
3864
|
}, [
|
|
3856
3865
|
E[18] || (E[18] = g("span", null, "网格", -1)),
|
|
3857
|
-
D(g("div",
|
|
3866
|
+
D(g("div", Ro, [
|
|
3858
3867
|
g("div", {
|
|
3859
3868
|
class: "menu-item",
|
|
3860
3869
|
onClick: E[4] || (E[4] = (j) => h("addModel", "box"))
|
|
@@ -3923,7 +3932,7 @@ const Ji = {
|
|
|
3923
3932
|
}, "重置相机"),
|
|
3924
3933
|
g("div", {
|
|
3925
3934
|
class: "menu-item",
|
|
3926
|
-
onClick:
|
|
3935
|
+
onClick: R
|
|
3927
3936
|
}, "显示网格")
|
|
3928
3937
|
], 512), [
|
|
3929
3938
|
[he, n.value]
|
|
@@ -4011,7 +4020,7 @@ const Ji = {
|
|
|
4011
4020
|
} catch (y) {
|
|
4012
4021
|
console.error("导入失败:", y), alert("导入失败:" + y.message);
|
|
4013
4022
|
}
|
|
4014
|
-
}, h =
|
|
4023
|
+
}, h = An([]);
|
|
4015
4024
|
$s((f) => {
|
|
4016
4025
|
h.value = f;
|
|
4017
4026
|
});
|
|
@@ -4019,7 +4028,7 @@ const Ji = {
|
|
|
4019
4028
|
const f = Js();
|
|
4020
4029
|
f && (h.value = f);
|
|
4021
4030
|
}, c = (f) => Mt(f), p = (f) => Ks(f.uuid), m = G(null);
|
|
4022
|
-
return
|
|
4031
|
+
return Rn(() => {
|
|
4023
4032
|
m.value && Ns(m.value, e.mode, e.sceneData), u();
|
|
4024
4033
|
}), (f, y) => (N(), U("div", jo, [
|
|
4025
4034
|
r.mode === "edit" ? (N(), ot(Co, {
|