endset_three_editor 0.8.5 → 0.8.7
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,11 +1,11 @@
|
|
|
1
1
|
var Yn = Object.defineProperty;
|
|
2
2
|
var Kn = (a, e, t) => e in a ? Yn(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var Ge = (a, e, t) => Kn(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as
|
|
4
|
+
import { toRaw as Zt, defineComponent as Fe, ref as F, inject as Zn, computed as et, watchEffect as Qn, resolveComponent as Jn, openBlock as L, createElementBlock as H, createElementVNode as m, normalizeClass as ye, withModifiers as cs, unref as _n, toDisplayString as re, Fragment as Me, renderList as Qt, createBlock as At, createCommentVNode as oe, reactive as us, watch as ve, withDirectives as j, vModelText as B, createTextVNode as _t, withKeys as tt, vModelCheckbox as $n, toRef as ei, provide as ti, createVNode as $t, vShow as qe, shallowRef as ws, onMounted as si, onBeforeUnmount as ni } from "vue";
|
|
5
5
|
import * as P from "three";
|
|
6
|
-
import { Controls as sn, Vector3 as O, MOUSE as it, TOUCH as st, Quaternion as Ae, Spherical as Ms, Vector2 as ie, Ray as ii, Plane as nn, MathUtils as on, Raycaster as oi, Object3D as rt, MeshBasicMaterial as Ve, LineBasicMaterial as mt, CylinderGeometry as fe, BoxGeometry as de, BufferGeometry as Ke, Float32BufferAttribute as we, Mesh as R, OctahedronGeometry as Tt, Line as Pe, TorusGeometry as lt, SphereGeometry as ai, Euler as ri, Matrix4 as Ie, PlaneGeometry as li, DoubleSide as an, OrthographicCamera as rn, ShaderMaterial as
|
|
6
|
+
import { Controls as sn, Vector3 as O, MOUSE as it, TOUCH as st, Quaternion as Ae, Spherical as Ms, Vector2 as ie, Ray as ii, Plane as nn, MathUtils as on, Raycaster as oi, Object3D as rt, MeshBasicMaterial as Ve, LineBasicMaterial as mt, CylinderGeometry as fe, BoxGeometry as de, BufferGeometry as Ke, Float32BufferAttribute as we, Mesh as R, OctahedronGeometry as Tt, Line as Pe, TorusGeometry as lt, SphereGeometry as ai, Euler as ri, Matrix4 as Ie, PlaneGeometry as li, DoubleSide as an, OrthographicCamera as rn, ShaderMaterial as ds, UniformsUtils as Bt, WebGLRenderTarget as ln, HalfFloatType as cn, NoBlending as ci, Timer as ui, Color as se, RawShaderMaterial as di, ColorManagement as Xt, SRGBTransfer as hi, LinearToneMapping as fi, ReinhardToneMapping as pi, CineonToneMapping as Ai, ACESFilmicToneMapping as mi, AgXToneMapping as gi, NeutralToneMapping as bi, CustomToneMapping as yi, Loader as ys, FileLoader as xt, SRGBColorSpace as Oe, Group as jt, Material as gt, PointsMaterial as ht, MeshPhongMaterial as Ii, LineSegments as hs, Points as kt, TrianglesDrawMode as Ci, TriangleFanDrawMode as fs, TriangleStripDrawMode as un, LoaderUtils as bt, MeshPhysicalMaterial as Te, LinearSRGBColorSpace as De, SpotLight as xi, PointLight as vi, DirectionalLight as wi, InstancedMesh as Mi, InstancedBufferAttribute as Di, TextureLoader as Wt, ImageBitmapLoader as Ti, BufferAttribute as yt, InterleavedBuffer as dn, InterleavedBufferAttribute as hn, LinearMipmapLinearFilter as fn, NearestMipmapLinearFilter as Pi, LinearMipmapNearestFilter as Oi, NearestMipmapNearestFilter as Ei, LinearFilter as ps, NearestFilter as pn, RepeatWrapping as ot, MirroredRepeatWrapping as Ri, ClampToEdgeWrapping as Si, MeshStandardMaterial as An, PropertyBinding as Li, SkinnedMesh as Ni, LineLoop as Hi, PerspectiveCamera as mn, Skeleton as ji, AnimationClip as ki, Bone as Wi, InterpolateDiscrete as Fi, InterpolateLinear as gn, Texture as Ds, VectorKeyframeTrack as Ts, NumberKeyframeTrack as Ps, QuaternionKeyframeTrack as Os, FrontSide as bn, Interpolant as zi, Box3 as Gi, Sphere as Ui, Vector4 as Es, UniformsLib as Rs } from "three";
|
|
7
7
|
import vt from "@tweenjs/tween.js";
|
|
8
|
-
const Ss = { type: "change" },
|
|
8
|
+
const Ss = { type: "change" }, Is = { type: "start" }, yn = { type: "end" }, Pt = new ii(), Ls = new nn(), Bi = Math.cos(70 * on.DEG2RAD), te = new O(), pe = 2 * Math.PI, V = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -14,7 +14,7 @@ const Ss = { type: "change" }, ys = { type: "start" }, yn = { type: "end" }, Pt
|
|
|
14
14
|
TOUCH_PAN: 4,
|
|
15
15
|
TOUCH_DOLLY_PAN: 5,
|
|
16
16
|
TOUCH_DOLLY_ROTATE: 6
|
|
17
|
-
},
|
|
17
|
+
}, es = 1e-6;
|
|
18
18
|
class Xi extends sn {
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a new controls instance.
|
|
@@ -172,7 +172,7 @@ class Xi extends sn {
|
|
|
172
172
|
const o = this.object.zoom;
|
|
173
173
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
174
174
|
}
|
|
175
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) >
|
|
175
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > es || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > es || this._lastTargetPosition.distanceToSquared(this.target) > es ? (this.dispatchEvent(Ss), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
176
176
|
}
|
|
177
177
|
_getAutoRotationAngle(e) {
|
|
178
178
|
return e !== null ? pe / 60 * this.autoRotateSpeed * e : pe / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -422,7 +422,7 @@ function Ki(a) {
|
|
|
422
422
|
default:
|
|
423
423
|
this.state = V.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !== V.NONE && this.dispatchEvent(
|
|
425
|
+
this.state !== V.NONE && this.dispatchEvent(Is);
|
|
426
426
|
}
|
|
427
427
|
function Zi(a) {
|
|
428
428
|
switch (this.state) {
|
|
@@ -441,7 +441,7 @@ function Zi(a) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function Qi(a) {
|
|
444
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (a.preventDefault(), this.dispatchEvent(
|
|
444
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== V.NONE || (a.preventDefault(), this.dispatchEvent(Is), this._handleMouseWheel(this._customWheelEvent(a)), this.dispatchEvent(yn));
|
|
445
445
|
}
|
|
446
446
|
function Ji(a) {
|
|
447
447
|
this.enabled !== !1 && this._handleKeyDown(a);
|
|
@@ -479,7 +479,7 @@ function _i(a) {
|
|
|
479
479
|
default:
|
|
480
480
|
this.state = V.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !== V.NONE && this.dispatchEvent(
|
|
482
|
+
this.state !== V.NONE && this.dispatchEvent(Is);
|
|
483
483
|
}
|
|
484
484
|
function $i(a) {
|
|
485
485
|
switch (this._trackPointer(a), this.state) {
|
|
@@ -516,7 +516,7 @@ const Ue = new oi(), le = new O(), He = new O(), Q = new Ae(), Ns = {
|
|
|
516
516
|
X: new O(1, 0, 0),
|
|
517
517
|
Y: new O(0, 1, 0),
|
|
518
518
|
Z: new O(0, 0, 1)
|
|
519
|
-
},
|
|
519
|
+
}, ts = { type: "change" }, Hs = { type: "mouseDown", mode: null }, js = { type: "mouseUp", mode: null }, ks = { type: "objectChange" };
|
|
520
520
|
class no extends sn {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
@@ -540,7 +540,7 @@ class no extends sn {
|
|
|
540
540
|
return D !== void 0 ? D : x;
|
|
541
541
|
},
|
|
542
542
|
set: function(M) {
|
|
543
|
-
D !== M && (D = M, i[b] = M, s[b] = M, o.dispatchEvent({ type: b + "-changed", value: M }), o.dispatchEvent(
|
|
543
|
+
D !== M && (D = M, i[b] = M, s[b] = M, o.dispatchEvent({ type: b + "-changed", value: M }), o.dispatchEvent(ts));
|
|
544
544
|
}
|
|
545
545
|
}), o[b] = x, i[b] = x, s[b] = x;
|
|
546
546
|
}
|
|
@@ -566,13 +566,13 @@ class no extends sn {
|
|
|
566
566
|
pointerHover(e) {
|
|
567
567
|
if (this.object === void 0 || this.dragging === !0) return;
|
|
568
568
|
e !== null && Ue.setFromCamera(e, this.camera);
|
|
569
|
-
const t =
|
|
569
|
+
const t = ss(this._gizmo.picker[this.mode], Ue);
|
|
570
570
|
t ? this.axis = t.object.name : this.axis = null;
|
|
571
571
|
}
|
|
572
572
|
pointerDown(e) {
|
|
573
573
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
574
574
|
e !== null && Ue.setFromCamera(e, this.camera);
|
|
575
|
-
const t =
|
|
575
|
+
const t = ss(this._plane, Ue, !0);
|
|
576
576
|
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, Hs.mode = this.mode, this.dispatchEvent(Hs);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -581,7 +581,7 @@ class no extends sn {
|
|
|
581
581
|
let i = this.space;
|
|
582
582
|
if (n === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), s === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
|
|
583
583
|
e !== null && Ue.setFromCamera(e, this.camera);
|
|
584
|
-
const o =
|
|
584
|
+
const o = ss(this._plane, Ue, !0);
|
|
585
585
|
if (o) {
|
|
586
586
|
if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), n === "translate")
|
|
587
587
|
this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), s.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (s.position.applyQuaternion(Q.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.position.applyQuaternion(this._quaternionStart)), i === "world" && (s.parent && s.position.add(le.setFromMatrixPosition(s.parent.matrixWorld)), t.search("X") !== -1 && (s.position.x = Math.round(s.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (s.position.y = Math.round(s.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (s.position.z = Math.round(s.position.z / this.translationSnap) * this.translationSnap), s.parent && s.position.sub(le.setFromMatrixPosition(s.parent.matrixWorld)))), s.position.x = Math.max(this.minX, Math.min(this.maxX, s.position.x)), s.position.y = Math.max(this.minY, Math.min(this.maxY, s.position.y)), s.position.z = Math.max(this.minZ, Math.min(this.maxZ, s.position.z));
|
|
@@ -598,7 +598,7 @@ class no extends sn {
|
|
|
598
598
|
let l = !1;
|
|
599
599
|
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(le.copy(this.rotationAxis).cross(this.eye)) * r) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(Ns[t]), le.copy(Ns[t]), i === "local" && le.applyQuaternion(this.worldQuaternion), le.cross(this.eye), le.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(le.normalize()) * r), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (s.quaternion.copy(this._quaternionStart), s.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), s.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), s.quaternion.multiply(this._quaternionStart).normalize());
|
|
600
600
|
}
|
|
601
|
-
this.dispatchEvent(
|
|
601
|
+
this.dispatchEvent(ts), this.dispatchEvent(ks);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
pointerUp(e) {
|
|
@@ -628,7 +628,7 @@ class no extends sn {
|
|
|
628
628
|
* Resets the object's position, rotation and scale to when the current transform began.
|
|
629
629
|
*/
|
|
630
630
|
reset() {
|
|
631
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(
|
|
631
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ts), this.dispatchEvent(ks), this.pointStart.copy(this.pointEnd));
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Returns the raycaster that is used for user interaction. This object is shared between all
|
|
@@ -742,7 +742,7 @@ function ro(a) {
|
|
|
742
742
|
function lo(a) {
|
|
743
743
|
this.enabled && (this.domElement.releasePointerCapture(a.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(a)));
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function ss(a, e, t) {
|
|
746
746
|
const n = e.intersectObject(a, !0);
|
|
747
747
|
for (let s = 0; s < n.length; s++)
|
|
748
748
|
if (n[s].object.visible || t)
|
|
@@ -1210,7 +1210,7 @@ class go extends Mt {
|
|
|
1210
1210
|
* the read buffer.
|
|
1211
1211
|
*/
|
|
1212
1212
|
constructor(e, t = "tDiffuse") {
|
|
1213
|
-
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof
|
|
1213
|
+
super(), this.textureID = t, this.uniforms = null, this.material = null, e instanceof ds ? (this.uniforms = e.uniforms, this.material = e) : e && (this.uniforms = Bt.clone(e.uniforms), this.material = new ds({
|
|
1214
1214
|
name: e.name !== void 0 ? e.name : "unspecified",
|
|
1215
1215
|
defines: Object.assign({}, e.defines),
|
|
1216
1216
|
uniforms: this.uniforms,
|
|
@@ -1907,14 +1907,14 @@ Ge(nt, "_breathInjected", !1);
|
|
|
1907
1907
|
let qt = nt;
|
|
1908
1908
|
const Vt = /* @__PURE__ */ new WeakMap();
|
|
1909
1909
|
function Cn(a, e) {
|
|
1910
|
-
const t =
|
|
1910
|
+
const t = Zt(a);
|
|
1911
1911
|
Vt.set(t, e), t.userData._hasDataPanel = !0;
|
|
1912
1912
|
}
|
|
1913
1913
|
function Dt(a) {
|
|
1914
|
-
return Vt.get(
|
|
1914
|
+
return Vt.get(Zt(a)) || null;
|
|
1915
1915
|
}
|
|
1916
1916
|
function xn(a) {
|
|
1917
|
-
const e =
|
|
1917
|
+
const e = Zt(a), t = Vt.get(e);
|
|
1918
1918
|
t && (t.dispose(), Vt.delete(e)), e.userData._hasDataPanel = void 0;
|
|
1919
1919
|
}
|
|
1920
1920
|
let _ = null;
|
|
@@ -1938,7 +1938,7 @@ function jo() {
|
|
|
1938
1938
|
a.position.y = -3.5;
|
|
1939
1939
|
const e = new P.BoxGeometry();
|
|
1940
1940
|
e.deleteAttribute("uv");
|
|
1941
|
-
const t = new P.MeshStandardMaterial({ side: P.BackSide }), n = new P.PointLight(16777215,
|
|
1941
|
+
const t = new P.MeshStandardMaterial({ side: P.BackSide }), n = new P.PointLight(16777215, 1300, 28, 2);
|
|
1942
1942
|
n.position.set(0.418, 16.199, 0.3), a.add(n);
|
|
1943
1943
|
const s = new P.Mesh(e, t);
|
|
1944
1944
|
s.position.set(-0.757, 13.219, 0.717), s.scale.set(31.713, 28.305, 28.591), a.add(s);
|
|
@@ -1951,17 +1951,17 @@ function jo() {
|
|
|
1951
1951
|
emissiveIntensity: f
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
|
-
const c = new P.Mesh(e, l(
|
|
1954
|
+
const c = new P.Mesh(e, l(75));
|
|
1955
1955
|
c.position.set(-16.116, 14.37, 8.208), c.scale.set(0.1, 2.428, 2.739), a.add(c);
|
|
1956
|
-
const h = new P.Mesh(e, l(
|
|
1956
|
+
const h = new P.Mesh(e, l(75));
|
|
1957
1957
|
h.position.set(-16.109, 18.021, -8.207), h.scale.set(0.1, 2.425, 2.751), a.add(h);
|
|
1958
|
-
const d = new P.Mesh(e, l(
|
|
1958
|
+
const d = new P.Mesh(e, l(26));
|
|
1959
1959
|
d.position.set(14.904, 12.198, -1.832), d.scale.set(0.15, 4.265, 6.331), a.add(d);
|
|
1960
|
-
const A = new P.Mesh(e, l(
|
|
1960
|
+
const A = new P.Mesh(e, l(65));
|
|
1961
1961
|
A.position.set(-0.462, 8.89, 14.52), A.scale.set(4.38, 5.441, 0.088), a.add(A);
|
|
1962
|
-
const y = new P.Mesh(e, l(
|
|
1962
|
+
const y = new P.Mesh(e, l(30));
|
|
1963
1963
|
y.position.set(3.235, 11.486, -12.541), y.scale.set(2.5, 2, 0.1), a.add(y);
|
|
1964
|
-
const I = new P.Mesh(e, l(
|
|
1964
|
+
const I = new P.Mesh(e, l(150));
|
|
1965
1965
|
return I.position.set(0, 20, 0), I.scale.set(1, 0.1, 1), a.add(I), a;
|
|
1966
1966
|
}
|
|
1967
1967
|
function vn(a) {
|
|
@@ -2004,7 +2004,7 @@ const C = {
|
|
|
2004
2004
|
};
|
|
2005
2005
|
let zt = !1, Ze = !1, ke = null;
|
|
2006
2006
|
const ko = 16755200;
|
|
2007
|
-
let
|
|
2007
|
+
let As = [], Nt = [], wt = !0, Ye = null, ms = null, Gt = null, We = [];
|
|
2008
2008
|
const Qe = /* @__PURE__ */ new Map();
|
|
2009
2009
|
let Yt, Ut = null, It = null, Ct = null;
|
|
2010
2010
|
function Wo(a, e = "edit", t) {
|
|
@@ -2058,7 +2058,7 @@ function wn(a = !1) {
|
|
|
2058
2058
|
), C.camera.updateProjectionMatrix(), Yt = e.target;
|
|
2059
2059
|
return;
|
|
2060
2060
|
} else
|
|
2061
|
-
Tn(""),
|
|
2061
|
+
Tn(""), Kt();
|
|
2062
2062
|
if (!C.camera || !C.orbitControls) return;
|
|
2063
2063
|
const t = C.camera.position.clone(), n = C.orbitControls.target.clone(), s = new P.Vector3(
|
|
2064
2064
|
e.position[0],
|
|
@@ -2111,7 +2111,7 @@ function Vo() {
|
|
|
2111
2111
|
}, 200));
|
|
2112
2112
|
}), a.addEventListener("objectChange", () => {
|
|
2113
2113
|
const e = C.selectedObject;
|
|
2114
|
-
if (
|
|
2114
|
+
if (ms && e && ms(e), e && e.type === "DirectionalLight") {
|
|
2115
2115
|
const t = e.userData.helper;
|
|
2116
2116
|
t && t.update && t.update();
|
|
2117
2117
|
}
|
|
@@ -2144,37 +2144,41 @@ function Ko() {
|
|
|
2144
2144
|
const a = C.container.clientWidth, e = C.container.clientHeight;
|
|
2145
2145
|
a === 0 || e === 0 || (C.camera.aspect = a / e, C.camera.updateProjectionMatrix(), C.renderer.setSize(a, e), ke && ke.setSize(a, e), No(a, e));
|
|
2146
2146
|
}
|
|
2147
|
-
function
|
|
2147
|
+
function Cs(a) {
|
|
2148
2148
|
C.selectedObject !== a && (C.selectedObject && C.transformControls.detach(), C.selectedObject = a, C.transformControls.attach(a), C.transformControls.setMode(C.transformControlsMode), C.transformControls.showX = !0, C.transformControls.showY = !0, C.transformControls.showZ = !0, Dn(a), Ye == null || Ye(a));
|
|
2149
2149
|
}
|
|
2150
2150
|
let me = null;
|
|
2151
2151
|
function Zo(a) {
|
|
2152
2152
|
me = a;
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2154
|
+
function ns(a) {
|
|
2155
2155
|
me == null || me(a);
|
|
2156
2156
|
}
|
|
2157
2157
|
function Qo(a) {
|
|
2158
2158
|
C.transformControlsMode = a, C.transformControls && C.transformControls.setMode(C.transformControlsMode);
|
|
2159
2159
|
}
|
|
2160
2160
|
function Dn(a) {
|
|
2161
|
-
|
|
2161
|
+
if (C.mode !== "edit") {
|
|
2162
|
+
Kt();
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2165
|
+
Kt(), a.traverse((e) => {
|
|
2162
2166
|
if (e.isMesh) {
|
|
2163
2167
|
const t = e, n = new P.EdgesGeometry(t.geometry), s = new P.LineBasicMaterial({
|
|
2164
2168
|
color: ko,
|
|
2165
2169
|
depthTest: !0
|
|
2166
2170
|
}), i = new P.LineSegments(n, s);
|
|
2167
|
-
e.add(i),
|
|
2171
|
+
e.add(i), As.push(i);
|
|
2168
2172
|
}
|
|
2169
2173
|
});
|
|
2170
2174
|
}
|
|
2171
|
-
function
|
|
2172
|
-
for (const a of
|
|
2175
|
+
function Kt() {
|
|
2176
|
+
for (const a of As)
|
|
2173
2177
|
a.parent && a.parent.remove(a), a.geometry.dispose(), a.material.dispose();
|
|
2174
|
-
|
|
2178
|
+
As = [];
|
|
2175
2179
|
}
|
|
2176
2180
|
function xs() {
|
|
2177
|
-
C.selectedObject && (
|
|
2181
|
+
C.selectedObject && (Kt(), C.transformControls.detach(), C.selectedObject = null, Ye == null || Ye(null));
|
|
2178
2182
|
}
|
|
2179
2183
|
function Tn(a) {
|
|
2180
2184
|
let e = null;
|
|
@@ -2205,7 +2209,7 @@ function Jo(a) {
|
|
|
2205
2209
|
const i = n.intersectObjects(s);
|
|
2206
2210
|
if (i.length > 0) {
|
|
2207
2211
|
let o = _o(i[0].object);
|
|
2208
|
-
|
|
2212
|
+
Cs(o);
|
|
2209
2213
|
} else
|
|
2210
2214
|
xs();
|
|
2211
2215
|
}
|
|
@@ -2293,10 +2297,10 @@ function na(a) {
|
|
|
2293
2297
|
});
|
|
2294
2298
|
}
|
|
2295
2299
|
function Je(a, e = !1) {
|
|
2296
|
-
C.scene.add(a), wt = !0, a.userData.isMovable && (aa(a),
|
|
2300
|
+
C.scene.add(a), wt = !0, a.userData.isMovable && (aa(a), Jt()), e && C.mode === "edit" && Cs(a);
|
|
2297
2301
|
}
|
|
2298
2302
|
function ia(a) {
|
|
2299
|
-
C.selectedObject === a && xs(), wt = !0, na(a), ta(a), a.userData.helper && C.scene.remove(a.userData.helper), a.parent ? a.parent.remove(a) : C.scene.remove(a), ra(a),
|
|
2303
|
+
C.selectedObject === a && xs(), wt = !0, na(a), ta(a), a.userData.helper && C.scene.remove(a.userData.helper), a.parent ? a.parent.remove(a) : C.scene.remove(a), ra(a), Jt();
|
|
2300
2304
|
}
|
|
2301
2305
|
function oa(a) {
|
|
2302
2306
|
const e = C.scene.getObjectByProperty("uuid", a);
|
|
@@ -2313,16 +2317,16 @@ function Pn() {
|
|
|
2313
2317
|
const a = [];
|
|
2314
2318
|
C.scene.children.forEach((e) => {
|
|
2315
2319
|
e.userData.isMovable && a.push(e);
|
|
2316
|
-
}), We = a,
|
|
2320
|
+
}), We = a, Jt();
|
|
2317
2321
|
}
|
|
2318
|
-
function
|
|
2322
|
+
function Jt() {
|
|
2319
2323
|
Gt == null || Gt([...We]);
|
|
2320
2324
|
}
|
|
2321
2325
|
function la(a) {
|
|
2322
2326
|
Ye = a;
|
|
2323
2327
|
}
|
|
2324
2328
|
function ca(a) {
|
|
2325
|
-
|
|
2329
|
+
ms = a;
|
|
2326
2330
|
}
|
|
2327
2331
|
function ua(a) {
|
|
2328
2332
|
Gt = a;
|
|
@@ -2554,9 +2558,9 @@ function On(a) {
|
|
|
2554
2558
|
On(t);
|
|
2555
2559
|
}
|
|
2556
2560
|
function ma() {
|
|
2557
|
-
Ut !== null && (cancelAnimationFrame(Ut), Ut = null), It && C.container && (C.container.removeEventListener("click", It), It = null), Ct && (window.removeEventListener("resize", Ct), Ct = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), ke && (ke.dispose(), ke = null), C.scene && (On(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), Ho(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", We = [], Qe.clear(),
|
|
2561
|
+
Ut !== null && (cancelAnimationFrame(Ut), Ut = null), It && C.container && (C.container.removeEventListener("click", It), It = null), Ct && (window.removeEventListener("resize", Ct), Ct = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), ke && (ke.dispose(), ke = null), C.scene && (On(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), Ho(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", We = [], Qe.clear(), Jt(), zt = !1, Ze = !1;
|
|
2558
2562
|
}
|
|
2559
|
-
const ga = /^[og]\s*(.+)?/, ba = /^mtllib /, ya = /^usemtl /, Ia = /^usemap /, Vs = /\s+/, Ys = new O(),
|
|
2563
|
+
const ga = /^[og]\s*(.+)?/, ba = /^mtllib /, ya = /^usemtl /, Ia = /^usemap /, Vs = /\s+/, Ys = new O(), is = new O(), Ks = new O(), Zs = new O(), ge = new O(), Ht = new se();
|
|
2560
2564
|
function Ca() {
|
|
2561
2565
|
const a = {
|
|
2562
2566
|
objects: [],
|
|
@@ -2666,7 +2670,7 @@ function Ca() {
|
|
|
2666
2670
|
},
|
|
2667
2671
|
addFaceNormal: function(e, t, n) {
|
|
2668
2672
|
const s = this.vertices, i = this.object.geometry.normals;
|
|
2669
|
-
Ys.fromArray(s, e),
|
|
2673
|
+
Ys.fromArray(s, e), is.fromArray(s, t), Ks.fromArray(s, n), ge.subVectors(Ks, is), Zs.subVectors(Ys, is), ge.cross(Zs), ge.normalize(), i.push(ge.x, ge.y, ge.z), i.push(ge.x, ge.y, ge.z), i.push(ge.x, ge.y, ge.z);
|
|
2670
2674
|
},
|
|
2671
2675
|
addColor: function(e, t, n) {
|
|
2672
2676
|
const s = this.colors, i = this.object.geometry.colors;
|
|
@@ -2717,7 +2721,7 @@ function Ca() {
|
|
|
2717
2721
|
};
|
|
2718
2722
|
return a.startObject("", !1), a;
|
|
2719
2723
|
}
|
|
2720
|
-
class xa extends
|
|
2724
|
+
class xa extends ys {
|
|
2721
2725
|
/**
|
|
2722
2726
|
* Constructs a new OBJ loader.
|
|
2723
2727
|
*
|
|
@@ -2894,9 +2898,9 @@ class xa extends bs {
|
|
|
2894
2898
|
const x = d[v];
|
|
2895
2899
|
f.addGroup(x.groupStart, x.groupCount, v);
|
|
2896
2900
|
}
|
|
2897
|
-
A ? p = new
|
|
2901
|
+
A ? p = new hs(f, u) : y ? p = new kt(f, u) : p = new R(f, u);
|
|
2898
2902
|
} else
|
|
2899
|
-
A ? p = new
|
|
2903
|
+
A ? p = new hs(f, u[0]) : y ? p = new kt(f, u[0]) : p = new R(f, u[0]);
|
|
2900
2904
|
p.name = c.name, i.add(p);
|
|
2901
2905
|
}
|
|
2902
2906
|
else if (t.vertices.length > 0) {
|
|
@@ -2911,7 +2915,7 @@ class xa extends bs {
|
|
|
2911
2915
|
function Qs(a, e) {
|
|
2912
2916
|
if (e === Ci)
|
|
2913
2917
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), a;
|
|
2914
|
-
if (e ===
|
|
2918
|
+
if (e === fs || e === un) {
|
|
2915
2919
|
let t = a.getIndex();
|
|
2916
2920
|
if (t === null) {
|
|
2917
2921
|
const o = [], r = a.getAttribute("position");
|
|
@@ -2923,7 +2927,7 @@ function Qs(a, e) {
|
|
|
2923
2927
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), a;
|
|
2924
2928
|
}
|
|
2925
2929
|
const n = t.count - 2, s = [];
|
|
2926
|
-
if (e ===
|
|
2930
|
+
if (e === fs)
|
|
2927
2931
|
for (let o = 1; o <= n; o++)
|
|
2928
2932
|
s.push(t.getX(0)), s.push(t.getX(o)), s.push(t.getX(o + 1));
|
|
2929
2933
|
else
|
|
@@ -2952,7 +2956,7 @@ function En(a, e, t) {
|
|
|
2952
2956
|
for (let n = 0; n < a.children.length; n++)
|
|
2953
2957
|
En(a.children[n], e.children[n], t);
|
|
2954
2958
|
}
|
|
2955
|
-
class wa extends
|
|
2959
|
+
class wa extends ys {
|
|
2956
2960
|
/**
|
|
2957
2961
|
* Constructs a new glTF loader.
|
|
2958
2962
|
*
|
|
@@ -3580,11 +3584,11 @@ class Xa {
|
|
|
3580
3584
|
decodePrimitive(e, t) {
|
|
3581
3585
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, r = {}, l = {}, c = {};
|
|
3582
3586
|
for (const h in o) {
|
|
3583
|
-
const d =
|
|
3587
|
+
const d = gs[h] || h.toLowerCase();
|
|
3584
3588
|
r[d] = o[h];
|
|
3585
3589
|
}
|
|
3586
3590
|
for (const h in e.attributes) {
|
|
3587
|
-
const d =
|
|
3591
|
+
const d = gs[h] || h.toLowerCase();
|
|
3588
3592
|
if (o[h] !== void 0) {
|
|
3589
3593
|
const A = n.accessors[e.attributes[h]], y = at[A.componentType];
|
|
3590
3594
|
c[d] = y.name, l[d] = A.normalized === !0;
|
|
@@ -3659,7 +3663,7 @@ const be = {
|
|
|
3659
3663
|
5126: Float32Array
|
|
3660
3664
|
}, $s = {
|
|
3661
3665
|
9728: pn,
|
|
3662
|
-
9729:
|
|
3666
|
+
9729: ps,
|
|
3663
3667
|
9984: Ei,
|
|
3664
3668
|
9985: Oi,
|
|
3665
3669
|
9986: Pi,
|
|
@@ -3668,7 +3672,7 @@ const be = {
|
|
|
3668
3672
|
33071: Si,
|
|
3669
3673
|
33648: Ri,
|
|
3670
3674
|
10497: ot
|
|
3671
|
-
},
|
|
3675
|
+
}, os = {
|
|
3672
3676
|
SCALAR: 1,
|
|
3673
3677
|
VEC2: 2,
|
|
3674
3678
|
VEC3: 3,
|
|
@@ -3676,7 +3680,7 @@ const be = {
|
|
|
3676
3680
|
MAT2: 4,
|
|
3677
3681
|
MAT3: 9,
|
|
3678
3682
|
MAT4: 16
|
|
3679
|
-
},
|
|
3683
|
+
}, gs = {
|
|
3680
3684
|
POSITION: "position",
|
|
3681
3685
|
NORMAL: "normal",
|
|
3682
3686
|
TANGENT: "tangent",
|
|
@@ -3698,7 +3702,7 @@ const be = {
|
|
|
3698
3702
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
3699
3703
|
LINEAR: gn,
|
|
3700
3704
|
STEP: Fi
|
|
3701
|
-
},
|
|
3705
|
+
}, as = {
|
|
3702
3706
|
OPAQUE: "OPAQUE",
|
|
3703
3707
|
MASK: "MASK",
|
|
3704
3708
|
BLEND: "BLEND"
|
|
@@ -3770,19 +3774,19 @@ function _a(a, e) {
|
|
|
3770
3774
|
function $a(a) {
|
|
3771
3775
|
let e;
|
|
3772
3776
|
const t = a.extensions && a.extensions[W.KHR_DRACO_MESH_COMPRESSION];
|
|
3773
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
3777
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + rs(t.attributes) : e = a.indices + ":" + rs(a.attributes) + ":" + a.mode, a.targets !== void 0)
|
|
3774
3778
|
for (let n = 0, s = a.targets.length; n < s; n++)
|
|
3775
|
-
e += ":" +
|
|
3779
|
+
e += ":" + rs(a.targets[n]);
|
|
3776
3780
|
return e;
|
|
3777
3781
|
}
|
|
3778
|
-
function
|
|
3782
|
+
function rs(a) {
|
|
3779
3783
|
let e = "";
|
|
3780
3784
|
const t = Object.keys(a).sort();
|
|
3781
3785
|
for (let n = 0, s = t.length; n < s; n++)
|
|
3782
3786
|
e += t[n] + ":" + a[t[n]] + ";";
|
|
3783
3787
|
return e;
|
|
3784
3788
|
}
|
|
3785
|
-
function
|
|
3789
|
+
function bs(a) {
|
|
3786
3790
|
switch (a) {
|
|
3787
3791
|
case Int8Array:
|
|
3788
3792
|
return 1 / 127;
|
|
@@ -4050,12 +4054,12 @@ class sr {
|
|
|
4050
4054
|
loadAccessor(e) {
|
|
4051
4055
|
const t = this, n = this.json, s = this.json.accessors[e];
|
|
4052
4056
|
if (s.bufferView === void 0 && s.sparse === void 0) {
|
|
4053
|
-
const o =
|
|
4057
|
+
const o = os[s.type], r = at[s.componentType], l = s.normalized === !0, c = new r(s.count * o);
|
|
4054
4058
|
return Promise.resolve(new yt(c, o, l));
|
|
4055
4059
|
}
|
|
4056
4060
|
const i = [];
|
|
4057
4061
|
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) {
|
|
4058
|
-
const r = o[0], l =
|
|
4062
|
+
const r = o[0], l = os[s.type], c = at[s.componentType], h = c.BYTES_PER_ELEMENT, d = h * l, A = s.byteOffset || 0, y = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, I = s.normalized === !0;
|
|
4059
4063
|
let f, u;
|
|
4060
4064
|
if (y && y !== d) {
|
|
4061
4065
|
const p = Math.floor(A / y), v = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + p + ":" + s.count;
|
|
@@ -4064,7 +4068,7 @@ class sr {
|
|
|
4064
4068
|
} else
|
|
4065
4069
|
r === null ? f = new c(s.count * l) : f = new c(r, A, s.count * l), u = new yt(f, l, I);
|
|
4066
4070
|
if (s.sparse !== void 0) {
|
|
4067
|
-
const p =
|
|
4071
|
+
const p = os.SCALAR, v = at[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, x = s.sparse.values.byteOffset || 0, D = new v(o[1], b, s.sparse.count * p), M = new c(o[2], x, s.sparse.count * l);
|
|
4068
4072
|
r !== null && (u = new yt(u.array.slice(), u.itemSize, u.normalized)), u.normalized = !1;
|
|
4069
4073
|
for (let S = 0, U = D.length; S < U; S++) {
|
|
4070
4074
|
const K = D[S];
|
|
@@ -4098,7 +4102,7 @@ class sr {
|
|
|
4098
4102
|
const c = this.loadImageSource(t, n).then(function(h) {
|
|
4099
4103
|
h.flipY = !1, h.name = o.name || r.name || "", h.name === "" && typeof r.uri == "string" && r.uri.startsWith("data:image/") === !1 && (h.name = r.uri);
|
|
4100
4104
|
const A = (i.samplers || {})[o.sampler] || {};
|
|
4101
|
-
return h.magFilter = $s[A.magFilter] ||
|
|
4105
|
+
return h.magFilter = $s[A.magFilter] || ps, h.minFilter = $s[A.minFilter] || fn, h.wrapS = en[A.wrapS] || ot, h.wrapT = en[A.wrapT] || ot, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== pn && h.minFilter !== ps, s.associations.set(h, { textures: e }), h;
|
|
4102
4106
|
}).catch(function() {
|
|
4103
4107
|
return null;
|
|
4104
4108
|
});
|
|
@@ -4218,8 +4222,8 @@ class sr {
|
|
|
4218
4222
|
})));
|
|
4219
4223
|
}
|
|
4220
4224
|
i.doubleSided === !0 && (r.side = an);
|
|
4221
|
-
const h = i.alphaMode ||
|
|
4222
|
-
if (h ===
|
|
4225
|
+
const h = i.alphaMode || as.OPAQUE;
|
|
4226
|
+
if (h === as.BLEND ? (r.transparent = !0, r.depthWrite = !1) : (r.transparent = !1, h === as.MASK && (r.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Ve && (c.push(t.assignTexture(r, "normalMap", i.normalTexture)), r.normalScale = new ie(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4223
4227
|
const d = i.normalTexture.scale;
|
|
4224
4228
|
r.normalScale.set(d, d);
|
|
4225
4229
|
}
|
|
@@ -4291,9 +4295,9 @@ class sr {
|
|
|
4291
4295
|
let p;
|
|
4292
4296
|
const v = c[y];
|
|
4293
4297
|
if (u.mode === be.TRIANGLES || u.mode === be.TRIANGLE_STRIP || u.mode === be.TRIANGLE_FAN || u.mode === void 0)
|
|
4294
|
-
p = i.isSkinnedMesh === !0 ? new Ni(f, v) : new R(f, v), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), u.mode === be.TRIANGLE_STRIP ? p.geometry = Qs(p.geometry, un) : u.mode === be.TRIANGLE_FAN && (p.geometry = Qs(p.geometry,
|
|
4298
|
+
p = i.isSkinnedMesh === !0 ? new Ni(f, v) : new R(f, v), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), u.mode === be.TRIANGLE_STRIP ? p.geometry = Qs(p.geometry, un) : u.mode === be.TRIANGLE_FAN && (p.geometry = Qs(p.geometry, fs));
|
|
4295
4299
|
else if (u.mode === be.LINES)
|
|
4296
|
-
p = new
|
|
4300
|
+
p = new hs(f, v);
|
|
4297
4301
|
else if (u.mode === be.LINE_STRIP)
|
|
4298
4302
|
p = new Pe(f, v);
|
|
4299
4303
|
else if (u.mode === be.LINE_LOOP)
|
|
@@ -4544,7 +4548,7 @@ class sr {
|
|
|
4544
4548
|
_getArrayFromAccessor(e) {
|
|
4545
4549
|
let t = e.array;
|
|
4546
4550
|
if (e.normalized) {
|
|
4547
|
-
const n =
|
|
4551
|
+
const n = bs(t.constructor), s = new Float32Array(t.length);
|
|
4548
4552
|
for (let i = 0, o = t.length; i < o; i++)
|
|
4549
4553
|
s[i] = t[i] * n;
|
|
4550
4554
|
t = s;
|
|
@@ -4567,7 +4571,7 @@ function nr(a, e, t) {
|
|
|
4567
4571
|
new O(l[0], l[1], l[2]),
|
|
4568
4572
|
new O(c[0], c[1], c[2])
|
|
4569
4573
|
), r.normalized) {
|
|
4570
|
-
const h =
|
|
4574
|
+
const h = bs(at[r.componentType]);
|
|
4571
4575
|
s.min.multiplyScalar(h), s.max.multiplyScalar(h);
|
|
4572
4576
|
}
|
|
4573
4577
|
} else {
|
|
@@ -4585,7 +4589,7 @@ function nr(a, e, t) {
|
|
|
4585
4589
|
const A = t.json.accessors[d.POSITION], y = A.min, I = A.max;
|
|
4586
4590
|
if (y !== void 0 && I !== void 0) {
|
|
4587
4591
|
if (l.setX(Math.max(Math.abs(y[0]), Math.abs(I[0]))), l.setY(Math.max(Math.abs(y[1]), Math.abs(I[1]))), l.setZ(Math.max(Math.abs(y[2]), Math.abs(I[2]))), A.normalized) {
|
|
4588
|
-
const f =
|
|
4592
|
+
const f = bs(at[A.componentType]);
|
|
4589
4593
|
l.multiplyScalar(f);
|
|
4590
4594
|
}
|
|
4591
4595
|
r.max(l);
|
|
@@ -4607,7 +4611,7 @@ function tn(a, e, t) {
|
|
|
4607
4611
|
});
|
|
4608
4612
|
}
|
|
4609
4613
|
for (const o in n) {
|
|
4610
|
-
const r =
|
|
4614
|
+
const r = gs[o] || o.toLowerCase();
|
|
4611
4615
|
r in a.attributes || s.push(i(n[o], r));
|
|
4612
4616
|
}
|
|
4613
4617
|
if (e.indices !== void 0 && !a.index) {
|
|
@@ -4620,8 +4624,8 @@ function tn(a, e, t) {
|
|
|
4620
4624
|
return e.targets !== void 0 ? Ja(a, e.targets, t) : a;
|
|
4621
4625
|
});
|
|
4622
4626
|
}
|
|
4623
|
-
const
|
|
4624
|
-
class ir extends
|
|
4627
|
+
const ls = /* @__PURE__ */ new WeakMap();
|
|
4628
|
+
class ir extends ys {
|
|
4625
4629
|
/**
|
|
4626
4630
|
* Constructs a new Draco loader.
|
|
4627
4631
|
*
|
|
@@ -4707,8 +4711,8 @@ class ir extends bs {
|
|
|
4707
4711
|
}
|
|
4708
4712
|
decodeGeometry(e, t) {
|
|
4709
4713
|
const n = JSON.stringify(t);
|
|
4710
|
-
if (
|
|
4711
|
-
const l =
|
|
4714
|
+
if (ls.has(e)) {
|
|
4715
|
+
const l = ls.get(e);
|
|
4712
4716
|
if (l.key === n)
|
|
4713
4717
|
return l.promise;
|
|
4714
4718
|
if (e.byteLength === 0)
|
|
@@ -4722,7 +4726,7 @@ class ir extends bs {
|
|
|
4722
4726
|
}))).then((l) => this._createGeometry(l.geometry));
|
|
4723
4727
|
return r.catch(() => !0).then(() => {
|
|
4724
4728
|
s && i && this._releaseTask(s, i);
|
|
4725
|
-
}),
|
|
4729
|
+
}), ls.set(e, {
|
|
4726
4730
|
key: n,
|
|
4727
4731
|
promise: r
|
|
4728
4732
|
}), r;
|
|
@@ -5048,7 +5052,7 @@ class ar extends R {
|
|
|
5048
5052
|
#include <fog_fragment>
|
|
5049
5053
|
}`
|
|
5050
5054
|
)
|
|
5051
|
-
}, X = new
|
|
5055
|
+
}, X = new ds({
|
|
5052
5056
|
name: ne.name,
|
|
5053
5057
|
uniforms: Bt.clone(ne.uniforms),
|
|
5054
5058
|
vertexShader: ne.vertexShader,
|
|
@@ -5185,7 +5189,7 @@ function Gn(a) {
|
|
|
5185
5189
|
return s.attachTo(e), Cn(e, s), sa(e), s;
|
|
5186
5190
|
}
|
|
5187
5191
|
function Un(a) {
|
|
5188
|
-
return
|
|
5192
|
+
return ns(!0), new Promise((e, t) => {
|
|
5189
5193
|
var o;
|
|
5190
5194
|
const n = (o = a.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), s = URL.createObjectURL(a);
|
|
5191
5195
|
let i;
|
|
@@ -5210,11 +5214,11 @@ function Un(a) {
|
|
|
5210
5214
|
d.userData.isMovable = !0, d.name || (d.name = d.type), d.type === "Mesh" && (d.frustumCulled = !0, d.castShadow = !0, d.receiveShadow = !0);
|
|
5211
5215
|
});
|
|
5212
5216
|
const h = new P.Box3().setFromObject(l).getCenter(new P.Vector3());
|
|
5213
|
-
l.position.sub(h), Je(l, !0),
|
|
5217
|
+
l.position.sub(h), Je(l, !0), ns(!1), e(l);
|
|
5214
5218
|
},
|
|
5215
5219
|
void 0,
|
|
5216
5220
|
(r) => {
|
|
5217
|
-
|
|
5221
|
+
ns(!1), t(r);
|
|
5218
5222
|
}
|
|
5219
5223
|
);
|
|
5220
5224
|
});
|
|
@@ -5310,17 +5314,17 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5310
5314
|
l.value ? (L(), H("span", {
|
|
5311
5315
|
key: 0,
|
|
5312
5316
|
class: "toggle-icon",
|
|
5313
|
-
onClick: u[0] || (u[0] =
|
|
5317
|
+
onClick: u[0] || (u[0] = cs((v) => _n(o)(f.node.uuid), ["stop"]))
|
|
5314
5318
|
}, re(r.value ? "▼" : "▶"), 1)) : (L(), H("span", lr)),
|
|
5315
5319
|
m("span", cr, re(y(f.node)), 1),
|
|
5316
5320
|
m("span", ur, re(I(f.node)), 1),
|
|
5317
5321
|
m("button", {
|
|
5318
5322
|
class: "tree-delete",
|
|
5319
|
-
onClick:
|
|
5323
|
+
onClick: cs(A, ["stop"])
|
|
5320
5324
|
}, "×")
|
|
5321
5325
|
], 2),
|
|
5322
5326
|
r.value && l.value ? (L(), H("div", dr, [
|
|
5323
|
-
(L(!0), H(Me, null,
|
|
5327
|
+
(L(!0), H(Me, null, Qt(c.value, (v) => (L(), At(p, {
|
|
5324
5328
|
key: v.uuid,
|
|
5325
5329
|
node: v,
|
|
5326
5330
|
"selected-object": f.selectedObject,
|
|
@@ -5384,7 +5388,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5384
5388
|
},
|
|
5385
5389
|
emits: ["propertyChange"],
|
|
5386
5390
|
setup(a, { emit: e }) {
|
|
5387
|
-
const t = a, n = e, s = () => n("propertyChange"), i =
|
|
5391
|
+
const t = a, n = e, s = () => n("propertyChange"), i = us({
|
|
5388
5392
|
color: 16777215,
|
|
5389
5393
|
metalness: 0,
|
|
5390
5394
|
roughness: 0.5,
|
|
@@ -5397,7 +5401,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5397
5401
|
let y = null;
|
|
5398
5402
|
const I = F(!1), f = F("");
|
|
5399
5403
|
let u = null;
|
|
5400
|
-
const p =
|
|
5404
|
+
const p = us({
|
|
5401
5405
|
intensity: 1
|
|
5402
5406
|
});
|
|
5403
5407
|
function v() {
|
|
@@ -5925,7 +5929,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5925
5929
|
onChange: Z,
|
|
5926
5930
|
class: "texture-file-input"
|
|
5927
5931
|
}, null, 32),
|
|
5928
|
-
g[34] || (g[34] =
|
|
5932
|
+
g[34] || (g[34] = _t(" + 选择 "))
|
|
5929
5933
|
]))
|
|
5930
5934
|
])
|
|
5931
5935
|
]),
|
|
@@ -5974,7 +5978,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5974
5978
|
onChange: q,
|
|
5975
5979
|
class: "texture-file-input"
|
|
5976
5980
|
}, null, 32),
|
|
5977
|
-
g[38] || (g[38] =
|
|
5981
|
+
g[38] || (g[38] = _t(" + 选择 "))
|
|
5978
5982
|
]))
|
|
5979
5983
|
])
|
|
5980
5984
|
]),
|
|
@@ -6023,7 +6027,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6023
6027
|
onChange: X,
|
|
6024
6028
|
class: "texture-file-input"
|
|
6025
6029
|
}, null, 32),
|
|
6026
|
-
g[42] || (g[42] =
|
|
6030
|
+
g[42] || (g[42] = _t(" + 选择 "))
|
|
6027
6031
|
]))
|
|
6028
6032
|
])
|
|
6029
6033
|
]),
|
|
@@ -6195,7 +6199,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6195
6199
|
"onUpdate:modelValue": x[1] || (x[1] = (D) => n.value = D),
|
|
6196
6200
|
placeholder: "值",
|
|
6197
6201
|
class: "ud-input ud-textarea",
|
|
6198
|
-
onKeyup: tt(
|
|
6202
|
+
onKeyup: tt(cs(d, ["prevent"]), ["enter"])
|
|
6199
6203
|
}, null, 40, rl), [
|
|
6200
6204
|
[B, n.value]
|
|
6201
6205
|
]),
|
|
@@ -6206,7 +6210,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6206
6210
|
}, " + ")
|
|
6207
6211
|
]),
|
|
6208
6212
|
r.value.length > 0 ? (L(), H("div", ll, [
|
|
6209
|
-
(L(!0), H(Me, null,
|
|
6213
|
+
(L(!0), H(Me, null, Qt(r.value, (D, M) => (L(), H("div", {
|
|
6210
6214
|
key: D.key,
|
|
6211
6215
|
class: ye(["userdata-item", {
|
|
6212
6216
|
readonly: D.key === "isMovable",
|
|
@@ -6271,7 +6275,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6271
6275
|
let A = I(), y = !1;
|
|
6272
6276
|
function I() {
|
|
6273
6277
|
const v = e.selectedObject;
|
|
6274
|
-
return v ? Dt(
|
|
6278
|
+
return v ? Dt(Zt(v)) : null;
|
|
6275
6279
|
}
|
|
6276
6280
|
ve(s, (v) => {
|
|
6277
6281
|
y || !A || (A.visible = v);
|
|
@@ -6433,7 +6437,7 @@ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6433
6437
|
m("div", Nl, [
|
|
6434
6438
|
b[23] || (b[23] = m("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
6435
6439
|
m("div", Hl, [
|
|
6436
|
-
(L(!0), H(Me, null,
|
|
6440
|
+
(L(!0), H(Me, null, Qt(n.value, (x, D) => (L(), H("div", {
|
|
6437
6441
|
key: D,
|
|
6438
6442
|
class: "dp-item"
|
|
6439
6443
|
}, [
|
|
@@ -6584,7 +6588,7 @@ const ql = {
|
|
|
6584
6588
|
m("div", Vl, [
|
|
6585
6589
|
f[7] || (f[7] = m("label", null, "场景物体", -1)),
|
|
6586
6590
|
m("div", Yl, [
|
|
6587
|
-
(L(!0), H(Me, null,
|
|
6591
|
+
(L(!0), H(Me, null, Qt(I.treeData, (u) => (L(), At(fr, {
|
|
6588
6592
|
key: u.uuid,
|
|
6589
6593
|
node: u,
|
|
6590
6594
|
"selected-object": I.selectedObject,
|
|
@@ -6631,17 +6635,17 @@ const ql = {
|
|
|
6631
6635
|
}, " 📊 数据面板 ", 2)) : oe("", !0)
|
|
6632
6636
|
])) : oe("", !0),
|
|
6633
6637
|
I.selectedObject ? (L(), H("div", _l, [
|
|
6634
|
-
j(
|
|
6638
|
+
j($t(nl, {
|
|
6635
6639
|
transform: I.transform,
|
|
6636
6640
|
"selected-object": I.selectedObject,
|
|
6637
6641
|
onPropertyChange: o
|
|
6638
6642
|
}, null, 8, ["transform", "selected-object"]), [
|
|
6639
6643
|
[qe, r.value === "transform"]
|
|
6640
6644
|
]),
|
|
6641
|
-
j(
|
|
6645
|
+
j($t(yl, { "selected-object": I.selectedObject }, null, 8, ["selected-object"]), [
|
|
6642
6646
|
[qe, r.value === "userdata"]
|
|
6643
6647
|
]),
|
|
6644
|
-
j(
|
|
6648
|
+
j($t(Bl, { "selected-object": I.selectedObject }, null, 8, ["selected-object"]), [
|
|
6645
6649
|
[qe, r.value === "datapanel"]
|
|
6646
6650
|
])
|
|
6647
6651
|
])) : oe("", !0)
|
|
@@ -6805,7 +6809,7 @@ const ql = {
|
|
|
6805
6809
|
Zo((p) => {
|
|
6806
6810
|
t.value = p;
|
|
6807
6811
|
});
|
|
6808
|
-
const n = ws(null), s =
|
|
6812
|
+
const n = ws(null), s = us({
|
|
6809
6813
|
position: { x: 0, y: 0, z: 0 },
|
|
6810
6814
|
rotation: { x: 0, y: 0, z: 0 },
|
|
6811
6815
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -6845,7 +6849,7 @@ const ql = {
|
|
|
6845
6849
|
const d = () => {
|
|
6846
6850
|
const p = da();
|
|
6847
6851
|
p && (h.value = p);
|
|
6848
|
-
}, A = (p) =>
|
|
6852
|
+
}, A = (p) => Cs(p), y = (p) => oa(p.uuid), I = (p) => {
|
|
6849
6853
|
Qo(p);
|
|
6850
6854
|
}, f = F(null), u = () => {
|
|
6851
6855
|
f.value && Wo(f.value, e.mode, e.sceneData), d();
|
|
@@ -6927,8 +6931,8 @@ export {
|
|
|
6927
6931
|
Lo as renderCSS2D,
|
|
6928
6932
|
No as resizeCSS2DRenderer,
|
|
6929
6933
|
Tn as selectModelHandle,
|
|
6930
|
-
|
|
6931
|
-
|
|
6934
|
+
Cs as selectObject,
|
|
6935
|
+
ns as setLoading,
|
|
6932
6936
|
Zo as setLoadingCallback,
|
|
6933
6937
|
la as setSelectedObjectCallback,
|
|
6934
6938
|
ca as setTransformChangeCallback,
|