endset_three_editor 0.10.30 → 0.10.31
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 _i = Object.defineProperty;
|
|
2
2
|
var $i = (r, e, t) => e in r ? _i(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { toRaw as hs, reactive as
|
|
3
|
+
var _e = (r, e, t) => $i(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { toRaw as hs, reactive as os, defineComponent as Qe, ref as W, inject as eo, computed as st, watchEffect as to, resolveComponent as so, openBlock as H, createElementBlock as j, createElementVNode as g, normalizeClass as Pe, withModifiers as St, unref as rs, toDisplayString as ue, Fragment as Ee, renderList as mt, createBlock as Mt, createCommentVNode as re, watch as Me, withDirectives as k, vModelText as B, createTextVNode as ys, vModelCheckbox as Gn, withKeys as dt, toRef as no, provide as io, vShow as Ye, createVNode as bs, shallowRef as en, onMounted as oo, onBeforeUnmount as ro, normalizeStyle as ao } from "vue";
|
|
5
5
|
import * as R from "three";
|
|
6
|
-
import { Controls as Bn, Vector3 as S, MOUSE as pt, TOUCH as ft, Quaternion as me, Spherical as tn, Vector2 as
|
|
7
|
-
import
|
|
8
|
-
const un = { type: "change" }, Zs = { type: "start" }, ri = { type: "end" },
|
|
6
|
+
import { Controls as Bn, Vector3 as S, MOUSE as pt, TOUCH as ft, Quaternion as me, Spherical as tn, Vector2 as fe, Ray as lo, Plane as Xn, MathUtils as Lt, Raycaster as co, Object3D as gt, MeshBasicMaterial as nt, LineBasicMaterial as Tt, CylinderGeometry as ge, BoxGeometry as Ae, BufferGeometry as rt, Float32BufferAttribute as ke, Mesh as L, OctahedronGeometry as zt, Line as We, TorusGeometry as yt, SphereGeometry as uo, Euler as fo, Matrix4 as Ce, PlaneGeometry as ho, DoubleSide as Xs, OrthographicCamera as qn, ShaderMaterial as Ls, UniformsUtils as as, WebGLRenderTarget as Vn, HalfFloatType as Yn, NoBlending as po, Timer as Ao, Color as le, RawShaderMaterial as mo, ColorManagement as ls, SRGBTransfer as go, LinearToneMapping as yo, ReinhardToneMapping as bo, CineonToneMapping as xo, ACESFilmicToneMapping as Io, AgXToneMapping as Co, NeutralToneMapping as wo, CustomToneMapping as vo, BufferAttribute as De, REVISION as Mo, CompressedTexture as xs, Source as To, NoColorSpace as Eo, RGBAFormat as Do, ImageUtils as Oo, PropertyBinding as Nt, InterpolateDiscrete as Kn, Scene as sn, SRGBColorSpace as je, NearestFilter as qs, NearestMipmapNearestFilter as Zn, NearestMipmapLinearFilter as Qn, LinearFilter as cs, LinearMipmapNearestFilter as Jn, LinearMipmapLinearFilter as Vs, ClampToEdgeWrapping as _n, RepeatWrapping as it, MirroredRepeatWrapping as $n, InterpolateLinear as Ys, TrianglesDrawMode as Ro, TriangleFanDrawMode as Ns, TriangleStripDrawMode as ei, Loader as Ks, LoaderUtils as Et, FileLoader as Ht, MeshPhysicalMaterial as Ue, LinearSRGBColorSpace as Fe, SpotLight as Po, PointLight as So, DirectionalLight as Lo, InstancedMesh as No, InstancedBufferAttribute as Ho, TextureLoader as Jt, ImageBitmapLoader as ko, InterleavedBuffer as ti, InterleavedBufferAttribute as si, PointsMaterial as Ct, Material as Dt, MeshStandardMaterial as ni, SkinnedMesh as jo, LineSegments as Hs, LineLoop as Fo, Points as _t, Group as $t, PerspectiveCamera as ii, Skeleton as Uo, AnimationClip as zo, Bone as Wo, Texture as nn, VectorKeyframeTrack as on, NumberKeyframeTrack as rn, QuaternionKeyframeTrack as an, FrontSide as oi, Interpolant as Go, Box3 as Bo, Sphere as Xo, MeshPhongMaterial as qo, Vector4 as ln, UniformsLib as cn } from "three";
|
|
7
|
+
import he from "@tweenjs/tween.js";
|
|
8
|
+
const un = { type: "change" }, Zs = { type: "start" }, ri = { type: "end" }, Wt = new lo(), dn = new Xn(), Vo = Math.cos(70 * Lt.DEG2RAD), ce = new S(), ye = 2 * Math.PI, te = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -23,7 +23,7 @@ class Yo extends Bn {
|
|
|
23
23
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
24
24
|
*/
|
|
25
25
|
constructor(e, t = null) {
|
|
26
|
-
super(e, t), this.state = te.NONE, this.target = new S(), this.cursor = new S(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: pt.ROTATE, MIDDLE: pt.DOLLY, RIGHT: pt.PAN }, this.touches = { ONE: ft.ROTATE, TWO: ft.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new S(), this._lastQuaternion = new me(), this._lastTargetPosition = new S(), this._quat = new me().setFromUnitVectors(e.up, new S(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new tn(), this._sphericalDelta = new tn(), this._scale = 1, this._panOffset = new S(), this._rotateStart = new
|
|
26
|
+
super(e, t), this.state = te.NONE, this.target = new S(), this.cursor = new S(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: pt.ROTATE, MIDDLE: pt.DOLLY, RIGHT: pt.PAN }, this.touches = { ONE: ft.ROTATE, TWO: ft.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new S(), this._lastQuaternion = new me(), this._lastTargetPosition = new S(), this._quat = new me().setFromUnitVectors(e.up, new S(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new tn(), this._sphericalDelta = new tn(), this._scale = 1, this._panOffset = new S(), this._rotateStart = new fe(), this._rotateEnd = new fe(), this._rotateDelta = new fe(), this._panStart = new fe(), this._panEnd = new fe(), this._panDelta = new fe(), this._dollyStart = new fe(), this._dollyEnd = new fe(), this._dollyDelta = new fe(), this._dollyDirection = new S(), this._mouse = new fe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Zo.bind(this), this._onPointerDown = Ko.bind(this), this._onPointerUp = Qo.bind(this), this._onContextMenu = nr.bind(this), this._onMouseWheel = $o.bind(this), this._onKeyDown = er.bind(this), this._onTouchStart = tr.bind(this), this._onTouchMove = sr.bind(this), this._onMouseDown = Jo.bind(this), this._onMouseMove = _o.bind(this), this._interceptControlDown = ir.bind(this), this._interceptControlUp = or.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Defines the visual representation of the cursor.
|
|
@@ -167,7 +167,7 @@ class Yo extends Bn {
|
|
|
167
167
|
c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o = ce.length();
|
|
168
168
|
} else
|
|
169
169
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
170
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (
|
|
170
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Wt.origin.copy(this.object.position), Wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Wt.direction)) < Vo ? this.object.lookAt(this.target) : (dn.setFromNormalAndCoplanarPoint(this.object.up, this.target), Wt.intersectPlane(dn, this.target))));
|
|
171
171
|
} else if (this.object.isOrthographicCamera) {
|
|
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);
|
|
@@ -340,7 +340,7 @@ class Yo extends Bn {
|
|
|
340
340
|
}
|
|
341
341
|
_trackPointer(e) {
|
|
342
342
|
let t = this._pointerPositions[e.pointerId];
|
|
343
|
-
t === void 0 && (t = new
|
|
343
|
+
t === void 0 && (t = new fe(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
344
344
|
}
|
|
345
345
|
_getSecondPointerPosition(e) {
|
|
346
346
|
const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -512,7 +512,7 @@ function ir(r) {
|
|
|
512
512
|
function or(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const
|
|
515
|
+
const $e = new co(), pe = new S(), qe = new S(), ie = new me(), fn = {
|
|
516
516
|
X: new S(1, 0, 0),
|
|
517
517
|
Y: new S(0, 1, 0),
|
|
518
518
|
Z: new S(0, 0, 1)
|
|
@@ -533,20 +533,20 @@ class rr extends Bn {
|
|
|
533
533
|
const i = new pr();
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(
|
|
537
|
-
let
|
|
538
|
-
Object.defineProperty(o,
|
|
536
|
+
function a(w, d) {
|
|
537
|
+
let x = d;
|
|
538
|
+
Object.defineProperty(o, w, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return
|
|
540
|
+
return x !== void 0 ? x : d;
|
|
541
541
|
},
|
|
542
542
|
set: function(M) {
|
|
543
|
-
|
|
543
|
+
x !== M && (x = M, i[w] = M, s[w] = M, o.dispatchEvent({ type: w + "-changed", value: M }), o.dispatchEvent(Cs));
|
|
544
544
|
}
|
|
545
|
-
}), o[
|
|
545
|
+
}), o[w] = d, i[w] = d, s[w] = d;
|
|
546
546
|
}
|
|
547
547
|
a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
|
|
548
|
-
const l = new S(), c = new S(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion",
|
|
548
|
+
const l = new S(), c = new S(), f = new me(), u = new me(), A = new S(), m = new me(), b = new S(), h = new S(), p = new S(), C = 0, v = new S();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", f), a("worldQuaternionStart", u), a("cameraPosition", A), a("cameraQuaternion", m), a("pointStart", b), a("pointEnd", h), a("rotationAxis", p), a("rotationAngle", C), a("eye", v), this._offset = new S(), this._startNorm = new S(), this._endNorm = new S(), this._cameraScale = new S(), this._parentPosition = new S(), this._parentQuaternion = new me(), this._parentQuaternionInv = new me(), this._parentScale = new S(), this._worldScaleStart = new S(), this._worldQuaternionInv = new me(), this._worldScale = new S(), this._positionStart = new S(), this._quaternionStart = new me(), this._scaleStart = new S(), this._getPointer = ar.bind(this), this._onPointerDown = cr.bind(this), this._onPointerHover = lr.bind(this), this._onPointerMove = ur.bind(this), this._onPointerUp = dr.bind(this), t !== null && this.connect(t);
|
|
550
550
|
}
|
|
551
551
|
connect(e) {
|
|
552
552
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -565,14 +565,14 @@ class rr extends Bn {
|
|
|
565
565
|
}
|
|
566
566
|
pointerHover(e) {
|
|
567
567
|
if (this.object === void 0 || this.dragging === !0) return;
|
|
568
|
-
e !== null &&
|
|
569
|
-
const t = ws(this._gizmo.picker[this.mode],
|
|
568
|
+
e !== null && $e.setFromCamera(e, this.camera);
|
|
569
|
+
const t = ws(this._gizmo.picker[this.mode], $e);
|
|
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
|
-
e !== null &&
|
|
575
|
-
const t = ws(this._plane,
|
|
574
|
+
e !== null && $e.setFromCamera(e, this.camera);
|
|
575
|
+
const t = ws(this._plane, $e, !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, hn.mode = this.mode, this.dispatchEvent(hn);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -580,8 +580,8 @@ class rr extends Bn {
|
|
|
580
580
|
const t = this.axis, n = this.mode, s = this.object;
|
|
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
|
-
e !== null &&
|
|
584
|
-
const o = ws(this._plane,
|
|
583
|
+
e !== null && $e.setFromCamera(e, this.camera);
|
|
584
|
+
const o = ws(this._plane, $e, !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(ie.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(pe.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(pe.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));
|
|
@@ -637,7 +637,7 @@ class rr extends Bn {
|
|
|
637
637
|
* @returns {Raycaster} The internal raycaster.
|
|
638
638
|
*/
|
|
639
639
|
getRaycaster() {
|
|
640
|
-
return
|
|
640
|
+
return $e;
|
|
641
641
|
}
|
|
642
642
|
/**
|
|
643
643
|
* Returns the transformation mode.
|
|
@@ -749,7 +749,7 @@ function ws(r, e, t) {
|
|
|
749
749
|
return n[s];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const
|
|
752
|
+
const Gt = new fo(), se = new S(0, 1, 0), mn = new S(0, 0, 0), gn = new Ce(), Bt = new me(), es = new me(), Ne = new S(), yn = new Ce(), wt = new S(1, 0, 0), tt = new S(0, 1, 0), vt = new S(0, 0, 1), Xt = new S(), bt = new S(), xt = new S();
|
|
753
753
|
class fr extends gt {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -794,8 +794,8 @@ class hr extends gt {
|
|
|
794
794
|
l.color.setHex(16711680), l.opacity = 0.5;
|
|
795
795
|
const c = e.clone();
|
|
796
796
|
c.color.setHex(65280), c.opacity = 0.5;
|
|
797
|
-
const
|
|
798
|
-
|
|
797
|
+
const f = e.clone();
|
|
798
|
+
f.color.setHex(255), f.opacity = 0.5;
|
|
799
799
|
const u = e.clone();
|
|
800
800
|
u.opacity = 0.25;
|
|
801
801
|
const A = e.clone();
|
|
@@ -810,46 +810,46 @@ class hr extends gt {
|
|
|
810
810
|
active: m,
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: c,
|
|
813
|
-
zAxisTransparent:
|
|
813
|
+
zAxisTransparent: f,
|
|
814
814
|
activeTransparent: A
|
|
815
815
|
};
|
|
816
816
|
const h = new ge(0, 0.04, 0.1, 12);
|
|
817
817
|
h.translate(0, 0.05, 0);
|
|
818
818
|
const p = new Ae(0.08, 0.08, 0.08);
|
|
819
819
|
p.translate(0, 0.04, 0);
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
function
|
|
820
|
+
const C = new rt();
|
|
821
|
+
C.setAttribute("position", new ke([0, 0, 0, 1, 0, 0], 3));
|
|
822
|
+
const v = new ge(75e-4, 75e-4, 0.5, 3);
|
|
823
|
+
v.translate(0, 0.25, 0);
|
|
824
|
+
function w(N, z) {
|
|
825
825
|
const G = new yt(N, 75e-4, 3, 64, z * Math.PI * 2);
|
|
826
826
|
return G.rotateY(Math.PI / 2), G.rotateX(Math.PI / 2), G;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function d() {
|
|
829
829
|
const N = new rt();
|
|
830
830
|
return N.setAttribute("position", new ke([0, 0, 0, 1, 1, 1], 3)), N;
|
|
831
831
|
}
|
|
832
|
-
const
|
|
832
|
+
const x = {
|
|
833
833
|
X: [
|
|
834
834
|
[new L(h, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
835
|
[new L(h, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
|
-
[new L(
|
|
836
|
+
[new L(v, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
839
|
[new L(h, o), [0, 0.5, 0]],
|
|
840
840
|
[new L(h, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
|
-
[new L(
|
|
841
|
+
[new L(v, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
844
|
[new L(h, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
845
|
[new L(h, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
|
-
[new L(
|
|
846
|
+
[new L(v, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
849
|
-
[new L(new
|
|
849
|
+
[new L(new zt(0.1, 0), u), [0, 0, 0]]
|
|
850
850
|
],
|
|
851
851
|
XY: [
|
|
852
|
-
[new L(new Ae(0.15, 0.15, 0.01),
|
|
852
|
+
[new L(new Ae(0.15, 0.15, 0.01), f), [0.15, 0.15, 0]]
|
|
853
853
|
],
|
|
854
854
|
YZ: [
|
|
855
855
|
[new L(new Ae(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
@@ -871,7 +871,7 @@ class hr extends gt {
|
|
|
871
871
|
[new L(new ge(0.2, 0, 0.6, 4), n), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
|
|
872
872
|
],
|
|
873
873
|
XYZ: [
|
|
874
|
-
[new L(new
|
|
874
|
+
[new L(new zt(0.2, 0), n)]
|
|
875
875
|
],
|
|
876
876
|
XY: [
|
|
877
877
|
[new L(new Ae(0.2, 0.2, 0.01), n), [0.15, 0.15, 0]]
|
|
@@ -884,42 +884,42 @@ class hr extends gt {
|
|
|
884
884
|
]
|
|
885
885
|
}, D = {
|
|
886
886
|
START: [
|
|
887
|
-
[new L(new
|
|
887
|
+
[new L(new zt(0.01, 2), s), null, null, null, "helper"]
|
|
888
888
|
],
|
|
889
889
|
END: [
|
|
890
|
-
[new L(new
|
|
890
|
+
[new L(new zt(0.01, 2), s), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new We(
|
|
893
|
+
[new We(d(), s), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
|
-
[new We(
|
|
896
|
+
[new We(C, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
897
897
|
],
|
|
898
898
|
Y: [
|
|
899
|
-
[new We(
|
|
899
|
+
[new We(C, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
900
900
|
],
|
|
901
901
|
Z: [
|
|
902
|
-
[new We(
|
|
902
|
+
[new We(C, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
903
903
|
]
|
|
904
904
|
}, E = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new L(
|
|
906
|
+
[new L(w(0.5, 1), b), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
|
-
[new L(
|
|
909
|
+
[new L(w(0.5, 0.5), i)]
|
|
910
910
|
],
|
|
911
911
|
Y: [
|
|
912
|
-
[new L(
|
|
912
|
+
[new L(w(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
|
|
913
913
|
],
|
|
914
914
|
Z: [
|
|
915
|
-
[new L(
|
|
915
|
+
[new L(w(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
|
|
916
916
|
],
|
|
917
917
|
E: [
|
|
918
|
-
[new L(
|
|
918
|
+
[new L(w(0.75, 1), A), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
920
|
}, U = {
|
|
921
921
|
AXIS: [
|
|
922
|
-
[new We(
|
|
922
|
+
[new We(C, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
923
923
|
]
|
|
924
924
|
}, Z = {
|
|
925
925
|
XYZE: [
|
|
@@ -940,21 +940,21 @@ class hr extends gt {
|
|
|
940
940
|
}, _ = {
|
|
941
941
|
X: [
|
|
942
942
|
[new L(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
|
-
[new L(
|
|
943
|
+
[new L(v, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
944
|
[new L(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
947
|
[new L(p, o), [0, 0.5, 0]],
|
|
948
|
-
[new L(
|
|
948
|
+
[new L(v, o)],
|
|
949
949
|
[new L(p, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
952
|
[new L(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
|
-
[new L(
|
|
953
|
+
[new L(v, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
954
|
[new L(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
|
-
[new L(new Ae(0.15, 0.15, 0.01),
|
|
957
|
+
[new L(new Ae(0.15, 0.15, 0.01), f), [0.15, 0.15, 0]]
|
|
958
958
|
],
|
|
959
959
|
YZ: [
|
|
960
960
|
[new L(new Ae(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
@@ -992,13 +992,13 @@ class hr extends gt {
|
|
|
992
992
|
]
|
|
993
993
|
}, $ = {
|
|
994
994
|
X: [
|
|
995
|
-
[new We(
|
|
995
|
+
[new We(C, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
996
996
|
],
|
|
997
997
|
Y: [
|
|
998
|
-
[new We(
|
|
998
|
+
[new We(C, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
999
999
|
],
|
|
1000
1000
|
Z: [
|
|
1001
|
-
[new We(
|
|
1001
|
+
[new We(C, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1002
1002
|
]
|
|
1003
1003
|
};
|
|
1004
1004
|
function Q(N) {
|
|
@@ -1012,11 +1012,11 @@ class hr extends gt {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
return z;
|
|
1014
1014
|
}
|
|
1015
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(
|
|
1015
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(x)), this.add(this.gizmo.rotate = Q(E)), this.add(this.gizmo.scale = Q(_)), this.add(this.picker.translate = Q(M)), this.add(this.picker.rotate = Q(Z)), this.add(this.picker.scale = Q(ne)), this.add(this.helper.translate = Q(D)), this.add(this.helper.rotate = Q(U)), this.add(this.helper.scale = Q($)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1016
1016
|
}
|
|
1017
1017
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1018
1018
|
updateMatrixWorld(e) {
|
|
1019
|
-
const n = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion :
|
|
1019
|
+
const n = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : es;
|
|
1020
1020
|
this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
|
|
1021
1021
|
let s = [];
|
|
1022
1022
|
s = s.concat(this.picker[this.mode].children), s = s.concat(this.gizmo[this.mode].children), s = s.concat(this.helper[this.mode].children);
|
|
@@ -1025,10 +1025,10 @@ class hr extends gt {
|
|
|
1025
1025
|
o.visible = !0, o.rotation.set(0, 0, 0), o.position.copy(this.worldPosition);
|
|
1026
1026
|
let a;
|
|
1027
1027
|
if (this.camera.isOrthographicCamera ? a = (this.camera.top - this.camera.bottom) / this.camera.zoom : a = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), o.scale.set(1, 1, 1).multiplyScalar(a * this.size / 4), o.tag === "helper") {
|
|
1028
|
-
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (ie.setFromEuler(
|
|
1028
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (ie.setFromEuler(Gt.set(0, 0, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(se.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (ie.setFromEuler(Gt.set(0, 0, Math.PI / 2)), o.quaternion.copy(n).multiply(ie), Math.abs(se.copy(tt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (ie.setFromEuler(Gt.set(0, Math.PI / 2, 0)), o.quaternion.copy(n).multiply(ie), Math.abs(se.copy(vt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (ie.setFromEuler(Gt.set(0, Math.PI / 2, 0)), se.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(gn.lookAt(mn, se, tt)), o.quaternion.multiply(ie), o.visible = this.dragging), this.axis === "E" && (o.visible = !1)) : o.name === "START" ? (o.position.copy(this.worldPositionStart), o.visible = this.dragging) : o.name === "END" ? (o.position.copy(this.worldPosition), o.visible = this.dragging) : o.name === "DELTA" ? (o.position.copy(this.worldPositionStart), o.quaternion.copy(this.worldQuaternionStart), pe.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), pe.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(pe), o.visible = this.dragging) : (o.quaternion.copy(n), this.dragging ? o.position.copy(this.worldPositionStart) : o.position.copy(this.worldPosition), this.axis && (o.visible = this.axis.search(o.name) !== -1));
|
|
1029
1029
|
continue;
|
|
1030
1030
|
}
|
|
1031
|
-
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(se.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(se.copy(
|
|
1031
|
+
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(se.copy(wt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(se.copy(tt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(se.copy(vt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(se.copy(vt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(se.copy(wt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(se.copy(tt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (Bt.copy(n), se.copy(this.eye).applyQuaternion(ie.copy(n).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(gn.lookAt(this.eye, mn, tt)), o.name === "X" && (ie.setFromAxisAngle(wt, Math.atan2(-se.y, se.z)), ie.multiplyQuaternions(Bt, ie), o.quaternion.copy(ie)), o.name === "Y" && (ie.setFromAxisAngle(tt, Math.atan2(se.x, se.z)), ie.multiplyQuaternions(Bt, ie), o.quaternion.copy(ie)), o.name === "Z" && (ie.setFromAxisAngle(vt, Math.atan2(se.y, se.x)), ie.multiplyQuaternions(Bt, ie), o.quaternion.copy(ie))), o.visible = o.visible && (o.name.indexOf("X") === -1 || this.showX), o.visible = o.visible && (o.name.indexOf("Y") === -1 || this.showY), o.visible = o.visible && (o.name.indexOf("Z") === -1 || this.showZ), o.visible = o.visible && (o.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), o.visible = o.visible && (o.name.indexOf("XY") === -1 || this.showXY), o.visible = o.visible && (o.name.indexOf("YZ") === -1 || this.showYZ), o.visible = o.visible && (o.name.indexOf("XZ") === -1 || this.showXZ), o.material._color = o.material._color || o.material.color.clone(), o.material._opacity = o.material._opacity || o.material.opacity, o.material.color.copy(o.material._color), o.material.opacity = o.material._opacity, this.enabled && this.axis && (o.name === this.axis ? (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1) : this.axis.split("").some(function(l) {
|
|
1032
1032
|
return o.name === l;
|
|
1033
1033
|
}) && (o.material.color.copy(this.materialLib.active.color), o.material.opacity = 1));
|
|
1034
1034
|
}
|
|
@@ -1044,12 +1044,12 @@ class pr extends L {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
1046
1046
|
let t = this.space;
|
|
1047
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
|
1047
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Xt.copy(wt).applyQuaternion(t === "local" ? this.worldQuaternion : es), bt.copy(tt).applyQuaternion(t === "local" ? this.worldQuaternion : es), xt.copy(vt).applyQuaternion(t === "local" ? this.worldQuaternion : es), se.copy(bt), this.mode) {
|
|
1048
1048
|
case "translate":
|
|
1049
1049
|
case "scale":
|
|
1050
1050
|
switch (this.axis) {
|
|
1051
1051
|
case "X":
|
|
1052
|
-
se.copy(this.eye).cross(
|
|
1052
|
+
se.copy(this.eye).cross(Xt), Ne.copy(Xt).cross(se);
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "Y":
|
|
1055
1055
|
se.copy(this.eye).cross(bt), Ne.copy(bt).cross(se);
|
|
@@ -1061,7 +1061,7 @@ class pr extends L {
|
|
|
1061
1061
|
Ne.copy(xt);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "YZ":
|
|
1064
|
-
Ne.copy(
|
|
1064
|
+
Ne.copy(Xt);
|
|
1065
1065
|
break;
|
|
1066
1066
|
case "XZ":
|
|
1067
1067
|
se.copy(xt), Ne.copy(bt);
|
|
@@ -1117,7 +1117,7 @@ const Ar = {
|
|
|
1117
1117
|
}`
|
|
1118
1118
|
)
|
|
1119
1119
|
};
|
|
1120
|
-
class
|
|
1120
|
+
class Ft {
|
|
1121
1121
|
/**
|
|
1122
1122
|
* Constructs a new pass.
|
|
1123
1123
|
*/
|
|
@@ -1200,7 +1200,7 @@ class ai {
|
|
|
1200
1200
|
this._mesh.material = e;
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
class br extends
|
|
1203
|
+
class br extends Ft {
|
|
1204
1204
|
/**
|
|
1205
1205
|
* Constructs a new shader pass.
|
|
1206
1206
|
*
|
|
@@ -1240,7 +1240,7 @@ class br extends jt {
|
|
|
1240
1240
|
this.material.dispose(), this._fsQuad.dispose();
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
|
-
class bn extends
|
|
1243
|
+
class bn extends Ft {
|
|
1244
1244
|
/**
|
|
1245
1245
|
* Constructs a new mask pass.
|
|
1246
1246
|
*
|
|
@@ -1268,7 +1268,7 @@ class bn extends jt {
|
|
|
1268
1268
|
this.inverse ? (o = 0, a = 1) : (o = 1, a = 0), i.buffers.stencil.setTest(!0), i.buffers.stencil.setOp(s.REPLACE, s.REPLACE, s.REPLACE), i.buffers.stencil.setFunc(s.ALWAYS, o, 4294967295), i.buffers.stencil.setClear(a), i.buffers.stencil.setLocked(!0), e.setRenderTarget(n), this.clear && e.clear(), e.render(this.scene, this.camera), e.setRenderTarget(t), this.clear && e.clear(), e.render(this.scene, this.camera), i.buffers.color.setLocked(!1), i.buffers.depth.setLocked(!1), i.buffers.color.setMask(!0), i.buffers.depth.setMask(!0), i.buffers.stencil.setLocked(!1), i.buffers.stencil.setFunc(s.EQUAL, 1, 4294967295), i.buffers.stencil.setOp(s.KEEP, s.KEEP, s.KEEP), i.buffers.stencil.setLocked(!0);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
class xr extends
|
|
1271
|
+
class xr extends Ft {
|
|
1272
1272
|
/**
|
|
1273
1273
|
* Constructs a new clear mask pass.
|
|
1274
1274
|
*/
|
|
@@ -1301,7 +1301,7 @@ class Ir {
|
|
|
1301
1301
|
*/
|
|
1302
1302
|
constructor(e, t) {
|
|
1303
1303
|
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
|
|
1304
|
-
const n = e.getSize(new
|
|
1304
|
+
const n = e.getSize(new fe());
|
|
1305
1305
|
this._width = n.width, this._height = n.height, t = new Vn(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Yn }), t.texture.name = "EffectComposer.rt1";
|
|
1306
1306
|
} else
|
|
1307
1307
|
this._width = t.width, this._height = t.height;
|
|
@@ -1385,7 +1385,7 @@ class Ir {
|
|
|
1385
1385
|
*/
|
|
1386
1386
|
reset(e) {
|
|
1387
1387
|
if (e === void 0) {
|
|
1388
|
-
const t = this.renderer.getSize(new
|
|
1388
|
+
const t = this.renderer.getSize(new fe());
|
|
1389
1389
|
this._pixelRatio = this.renderer.getPixelRatio(), this._width = t.width, this._height = t.height, e = this.renderTarget1.clone(), e.setSize(this._width * this._pixelRatio, this._height * this._pixelRatio);
|
|
1390
1390
|
}
|
|
1391
1391
|
this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.renderTarget1 = e, this.renderTarget2 = e.clone(), this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2;
|
|
@@ -1421,7 +1421,7 @@ class Ir {
|
|
|
1421
1421
|
this.renderTarget1.dispose(), this.renderTarget2.dispose(), this.copyPass.dispose();
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
class Cr extends
|
|
1424
|
+
class Cr extends Ft {
|
|
1425
1425
|
/**
|
|
1426
1426
|
* Constructs a new render pass.
|
|
1427
1427
|
*
|
|
@@ -1453,7 +1453,7 @@ class Cr extends jt {
|
|
|
1453
1453
|
this.overrideMaterial !== null && (o = this.scene.overrideMaterial, this.scene.overrideMaterial = this.overrideMaterial), this.clearColor !== null && (e.getClearColor(this._oldClearColor), e.setClearColor(this.clearColor, e.getClearAlpha())), this.clearAlpha !== null && (i = e.getClearAlpha(), e.setClearAlpha(this.clearAlpha)), this.clearDepth == !0 && e.clearDepth(), e.setRenderTarget(this.renderToScreen ? null : n), this.clear === !0 && e.clear(e.autoClearColor, e.autoClearDepth, e.autoClearStencil), e.render(this.scene, this.camera), this.clearColor !== null && e.setClearColor(this._oldClearColor), this.clearAlpha !== null && e.setClearAlpha(i), this.overrideMaterial !== null && (this.scene.overrideMaterial = o), e.autoClear = s;
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
const
|
|
1456
|
+
const qt = {
|
|
1457
1457
|
name: "OutputShader",
|
|
1458
1458
|
uniforms: {
|
|
1459
1459
|
tDiffuse: { value: null },
|
|
@@ -1539,16 +1539,16 @@ const Xt = {
|
|
|
1539
1539
|
}`
|
|
1540
1540
|
)
|
|
1541
1541
|
};
|
|
1542
|
-
class wr extends
|
|
1542
|
+
class wr extends Ft {
|
|
1543
1543
|
/**
|
|
1544
1544
|
* Constructs a new output pass.
|
|
1545
1545
|
*/
|
|
1546
1546
|
constructor() {
|
|
1547
|
-
super(), this.isOutputPass = !0, this.uniforms = as.clone(
|
|
1548
|
-
name:
|
|
1547
|
+
super(), this.isOutputPass = !0, this.uniforms = as.clone(qt.uniforms), this.material = new mo({
|
|
1548
|
+
name: qt.name,
|
|
1549
1549
|
uniforms: this.uniforms,
|
|
1550
|
-
vertexShader:
|
|
1551
|
-
fragmentShader:
|
|
1550
|
+
vertexShader: qt.vertexShader,
|
|
1551
|
+
fragmentShader: qt.fragmentShader
|
|
1552
1552
|
}), this._fsQuad = new ai(this.material), this._outputColorSpace = null, this._toneMapping = null;
|
|
1553
1553
|
}
|
|
1554
1554
|
/**
|
|
@@ -1580,7 +1580,7 @@ class vr extends gt {
|
|
|
1580
1580
|
* @param {HTMLElement} [element] - The DOM element.
|
|
1581
1581
|
*/
|
|
1582
1582
|
constructor(e = document.createElement("div")) {
|
|
1583
|
-
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new
|
|
1583
|
+
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new fe(0.5, 0.5), this.addEventListener("removed", function() {
|
|
1584
1584
|
this.traverse(function(t) {
|
|
1585
1585
|
t.element && t.element instanceof t.element.ownerDocument.defaultView.Element && t.element.parentNode !== null && t.element.remove();
|
|
1586
1586
|
});
|
|
@@ -1609,7 +1609,7 @@ class Mr {
|
|
|
1609
1609
|
height: s
|
|
1610
1610
|
};
|
|
1611
1611
|
}, this.render = function(b, h) {
|
|
1612
|
-
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), h.parent === null && h.matrixWorldAutoUpdate === !0 && h.updateMatrixWorld(), xn.copy(h.matrixWorldInverse), In.multiplyMatrices(h.projectionMatrix, xn),
|
|
1612
|
+
b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), h.parent === null && h.matrixWorldAutoUpdate === !0 && h.updateMatrixWorld(), xn.copy(h.matrixWorldInverse), In.multiplyMatrices(h.projectionMatrix, xn), f(b, b, h), this.sortObjects && m(b);
|
|
1613
1613
|
}, this.setSize = function(b, h) {
|
|
1614
1614
|
n = b, s = h, i = n / 2, o = s / 2, l.style.width = b + "px", l.style.height = h + "px";
|
|
1615
1615
|
};
|
|
@@ -1618,22 +1618,22 @@ class Mr {
|
|
|
1618
1618
|
for (let h = 0, p = b.children.length; h < p; h++)
|
|
1619
1619
|
c(b.children[h]);
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1621
|
+
function f(b, h, p) {
|
|
1622
1622
|
if (b.visible === !1) {
|
|
1623
1623
|
c(b);
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
1626
|
if (b.isCSS2DObject) {
|
|
1627
1627
|
ut.setFromMatrixPosition(b.matrixWorld), ut.applyMatrix4(In);
|
|
1628
|
-
const
|
|
1629
|
-
|
|
1630
|
-
const
|
|
1628
|
+
const C = ut.z >= -1 && ut.z <= 1 && b.layers.test(p.layers) === !0, v = b.element;
|
|
1629
|
+
v.style.display = C === !0 ? "" : "none", C === !0 && (b.onBeforeRender(t, h, p), v.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ut.x * i + i) + "px," + (-ut.y * o + o) + "px)", v.parentNode !== l && l.appendChild(v), b.onAfterRender(t, h, p));
|
|
1630
|
+
const w = {
|
|
1631
1631
|
distanceToCameraSquared: u(p, b)
|
|
1632
1632
|
};
|
|
1633
|
-
a.objects.set(b,
|
|
1633
|
+
a.objects.set(b, w);
|
|
1634
1634
|
}
|
|
1635
|
-
for (let
|
|
1636
|
-
|
|
1635
|
+
for (let C = 0, v = b.children.length; C < v; C++)
|
|
1636
|
+
f(b.children[C], h, p);
|
|
1637
1637
|
}
|
|
1638
1638
|
function u(b, h) {
|
|
1639
1639
|
return Cn.setFromMatrixPosition(b.matrixWorld), wn.setFromMatrixPosition(h.matrixWorld), Cn.distanceToSquared(wn);
|
|
@@ -1645,31 +1645,31 @@ class Mr {
|
|
|
1645
1645
|
}), h;
|
|
1646
1646
|
}
|
|
1647
1647
|
function m(b) {
|
|
1648
|
-
const h = A(b).sort(function(
|
|
1649
|
-
if (
|
|
1650
|
-
return
|
|
1651
|
-
const
|
|
1652
|
-
return
|
|
1648
|
+
const h = A(b).sort(function(C, v) {
|
|
1649
|
+
if (C.renderOrder !== v.renderOrder)
|
|
1650
|
+
return v.renderOrder - C.renderOrder;
|
|
1651
|
+
const w = a.objects.get(C).distanceToCameraSquared, d = a.objects.get(v).distanceToCameraSquared;
|
|
1652
|
+
return w - d;
|
|
1653
1653
|
}), p = h.length;
|
|
1654
|
-
for (let
|
|
1655
|
-
h[
|
|
1654
|
+
for (let C = 0, v = h.length; C < v; C++)
|
|
1655
|
+
h[C].element.style.zIndex = p - C;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
1659
1659
|
const Tr = 1920, Er = 13, Dr = 0.6, Or = 4, Rr = window.innerWidth / Tr, Pr = Math.min(Math.max(Rr, Dr), Or), Sr = Math.round(Er * Pr);
|
|
1660
1660
|
document.documentElement.style.setProperty("--sl-css2d-base-font-size", Sr + "px");
|
|
1661
|
-
const
|
|
1661
|
+
const Vt = {
|
|
1662
1662
|
panel: "sl-css2d-data-panel",
|
|
1663
1663
|
title: "sl-css2d-data-panel-title",
|
|
1664
1664
|
list: "sl-css2d-data-panel-list",
|
|
1665
1665
|
item: "sl-css2d-data-panel-item"
|
|
1666
|
-
}, Lr = "--sl-css2d-base-font-size", Nr = 15,
|
|
1666
|
+
}, Lr = "--sl-css2d-base-font-size", Nr = 15, Yt = { top: 0, right: 2.7, bottom: 1.8, left: 0.9 }, Kt = (r) => `animation:sl-breath ${Nr}s ease-in-out ${r}s infinite backwards;`, ht = class ht {
|
|
1667
1667
|
constructor(e = {}) {
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1668
|
+
_e(this, "css2dObject", null);
|
|
1669
|
+
_e(this, "container", null);
|
|
1670
|
+
_e(this, "options");
|
|
1671
|
+
_e(this, "attachedObject", null);
|
|
1672
|
+
_e(this, "_visible", !0);
|
|
1673
1673
|
this.options = {
|
|
1674
1674
|
title: e.title || "",
|
|
1675
1675
|
items: e.items || [],
|
|
@@ -1703,7 +1703,7 @@ const qt = {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
buildPanel() {
|
|
1705
1705
|
const e = this.options, t = document.createElement("div");
|
|
1706
|
-
t.className = `${
|
|
1706
|
+
t.className = `${Vt.panel} ${e.className}`.trim();
|
|
1707
1707
|
let n = e.backgroundColor || "rgba(0, 12, 30, 0.55)";
|
|
1708
1708
|
if (n.includes("gradient")) {
|
|
1709
1709
|
const c = n.match(/rgba?\([^)]+\)/);
|
|
@@ -1732,21 +1732,21 @@ const qt = {
|
|
|
1732
1732
|
const s = "0.23em", i = "#00e5ff", o = `0 0 0.46em ${i}, 0 0 1.08em ${i}`;
|
|
1733
1733
|
t.appendChild(this.createEl(
|
|
1734
1734
|
"div",
|
|
1735
|
-
`position:absolute; top:0.92em; left:3.08em; right:3.08em; height:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Yt
|
|
1735
|
+
`position:absolute; top:0.92em; left:3.08em; right:3.08em; height:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Kt(Yt.top)}`
|
|
1736
1736
|
)), t.appendChild(this.createEl(
|
|
1737
1737
|
"div",
|
|
1738
|
-
`position:absolute; bottom:0.92em; left:3.08em; right:3.08em; height:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Yt
|
|
1738
|
+
`position:absolute; bottom:0.92em; left:3.08em; right:3.08em; height:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Kt(Yt.bottom)}`
|
|
1739
1739
|
)), t.appendChild(this.createEl(
|
|
1740
1740
|
"div",
|
|
1741
|
-
`position:absolute; left:0.92em; top:3.08em; bottom:3.08em; width:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Yt
|
|
1741
|
+
`position:absolute; left:0.92em; top:3.08em; bottom:3.08em; width:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Kt(Yt.left)}`
|
|
1742
1742
|
)), t.appendChild(this.createEl(
|
|
1743
1743
|
"div",
|
|
1744
|
-
`position:absolute; right:0.92em; top:3.08em; bottom:3.08em; width:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Yt
|
|
1744
|
+
`position:absolute; right:0.92em; top:3.08em; bottom:3.08em; width:${s}; background:${i}; box-shadow:${o}; border-radius:0.15em; pointer-events:none; z-index:1; ${Kt(Yt.right)}`
|
|
1745
1745
|
));
|
|
1746
1746
|
const a = `position:absolute; width:0.62em; height:0.62em; border-radius:50%; background:#ffffff; box-shadow:0 0 0.46em ${i}, 0 0 0.92em ${i}; pointer-events:none; z-index:2;`;
|
|
1747
1747
|
if (t.appendChild(this.createEl("div", `${a} top:0.69em; left:0.69em;`)), t.appendChild(this.createEl("div", `${a} top:0.69em; right:0.69em;`)), t.appendChild(this.createEl("div", `${a} bottom:0.69em; left:0.69em;`)), t.appendChild(this.createEl("div", `${a} bottom:0.69em; right:0.69em;`)), e.title) {
|
|
1748
1748
|
const c = document.createElement("div");
|
|
1749
|
-
c.className =
|
|
1749
|
+
c.className = Vt.title, c.style.cssText = `
|
|
1750
1750
|
font-weight: 700;
|
|
1751
1751
|
font-size: 1.15em;
|
|
1752
1752
|
color: #c8f4ff;
|
|
@@ -1759,12 +1759,12 @@ const qt = {
|
|
|
1759
1759
|
`, c.textContent = e.title, c.setAttribute("data-panel-title", ""), t.appendChild(c);
|
|
1760
1760
|
}
|
|
1761
1761
|
const l = document.createElement("div");
|
|
1762
|
-
l.className =
|
|
1762
|
+
l.className = Vt.list, l.setAttribute("data-panel-list", ""), t.appendChild(l), this.renderItems(l, e.items), this.container = t, this.css2dObject && (this.css2dObject.element = t);
|
|
1763
1763
|
}
|
|
1764
1764
|
renderItems(e, t) {
|
|
1765
1765
|
e.innerHTML = "", t.forEach((n, s) => {
|
|
1766
1766
|
const i = document.createElement("div");
|
|
1767
|
-
i.className = `${
|
|
1767
|
+
i.className = `${Vt.item} ${n.className || ""}`.trim(), i.style.cssText = `
|
|
1768
1768
|
display: flex;
|
|
1769
1769
|
justify-content: space-between;
|
|
1770
1770
|
align-items: center;
|
|
@@ -1910,14 +1910,14 @@ const qt = {
|
|
|
1910
1910
|
this.detach(), (e = this.container) != null && e.parentNode && this.container.parentNode.removeChild(this.container), this.css2dObject = null, this.container = null, this.attachedObject = null;
|
|
1911
1911
|
}
|
|
1912
1912
|
};
|
|
1913
|
-
|
|
1913
|
+
_e(ht, "_breathInjected", !1);
|
|
1914
1914
|
let us = ht;
|
|
1915
1915
|
const ds = /* @__PURE__ */ new WeakMap();
|
|
1916
1916
|
function li(r, e) {
|
|
1917
1917
|
const t = hs(r);
|
|
1918
1918
|
ds.set(t, e), t.userData._hasDataPanel = !0;
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function Ut(r) {
|
|
1921
1921
|
return ds.get(hs(r)) || null;
|
|
1922
1922
|
}
|
|
1923
1923
|
function ci(r) {
|
|
@@ -1928,7 +1928,7 @@ let oe = null;
|
|
|
1928
1928
|
function Hr(r) {
|
|
1929
1929
|
return oe ? (oe.domElement.parentNode !== r && r.appendChild(oe.domElement), oe) : (oe = new Mr(), oe.setSize(r.clientWidth, r.clientHeight), oe.domElement.style.position = "absolute", oe.domElement.style.top = "0", oe.domElement.style.left = "0", oe.domElement.style.pointerEvents = "none", r.appendChild(oe.domElement), oe);
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1931
|
+
function bd() {
|
|
1932
1932
|
return oe;
|
|
1933
1933
|
}
|
|
1934
1934
|
function kr(r, e) {
|
|
@@ -1960,8 +1960,8 @@ function Ur() {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
const c = new R.Mesh(e, l(50));
|
|
1962
1962
|
c.position.set(-16.116, 14.37, 8.208), c.scale.set(0.1, 2.428, 2.739), r.add(c);
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1963
|
+
const f = new R.Mesh(e, l(50));
|
|
1964
|
+
f.position.set(-16.109, 18.021, -8.207), f.scale.set(0.1, 2.425, 2.751), r.add(f);
|
|
1965
1965
|
const u = new R.Mesh(e, l(17));
|
|
1966
1966
|
u.position.set(14.904, 12.198, -1.832), u.scale.set(0.15, 4.265, 6.331), r.add(u);
|
|
1967
1967
|
const A = new R.Mesh(e, l(43));
|
|
@@ -1971,7 +1971,7 @@ function Ur() {
|
|
|
1971
1971
|
const b = new R.Mesh(e, l(100));
|
|
1972
1972
|
return b.position.set(0, 20, 0), b.scale.set(1, 0.1, 1), r.add(b), r;
|
|
1973
1973
|
}
|
|
1974
|
-
function
|
|
1974
|
+
function ts(r) {
|
|
1975
1975
|
try {
|
|
1976
1976
|
const e = new R.PMREMGenerator(r), t = Ur(), n = e.fromScene(t).texture;
|
|
1977
1977
|
return t.traverse((s) => {
|
|
@@ -2167,7 +2167,7 @@ function Yr(r, e, t) {
|
|
|
2167
2167
|
for (let s = e; s < e + t; s++)
|
|
2168
2168
|
for (let i = 0; i < r.itemSize; i++) {
|
|
2169
2169
|
let o;
|
|
2170
|
-
r.itemSize > 4 ? o = r.array[s * r.itemSize + i] : (i === 0 ? o = r.getX(s) : i === 1 ? o = r.getY(s) : i === 2 ? o = r.getZ(s) : i === 3 && (o = r.getW(s)), r.normalized === !0 && (o =
|
|
2170
|
+
r.itemSize > 4 ? o = r.array[s * r.itemSize + i] : (i === 0 ? o = r.getX(s) : i === 1 ? o = r.getY(s) : i === 2 ? o = r.getZ(s) : i === 3 && (o = r.getW(s)), r.normalized === !0 && (o = Lt.normalize(o, r.array))), n.min[i] = Math.min(n.min[i], o), n.max[i] = Math.max(n.max[i], o);
|
|
2171
2171
|
}
|
|
2172
2172
|
return n;
|
|
2173
2173
|
}
|
|
@@ -2239,27 +2239,27 @@ class Zr {
|
|
|
2239
2239
|
}, n), this.options.animations.length > 0 && (this.options.trs = !0), await this.processInputAsync(e), await Promise.all(this.pending);
|
|
2240
2240
|
const s = this, i = s.buffers, o = s.json;
|
|
2241
2241
|
n = s.options;
|
|
2242
|
-
const a = s.extensionsUsed, l = s.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }),
|
|
2243
|
-
if (
|
|
2242
|
+
const a = s.extensionsUsed, l = s.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }), f = Object.keys(a), u = Object.keys(l);
|
|
2243
|
+
if (f.length > 0 && (o.extensionsUsed = f), u.length > 0 && (o.extensionsRequired = u), o.buffers && o.buffers.length > 0 && (o.buffers[0].byteLength = c.size), n.binary === !0) {
|
|
2244
2244
|
const A = new FileReader();
|
|
2245
2245
|
A.readAsArrayBuffer(c), A.onloadend = function() {
|
|
2246
2246
|
const m = Ms(A.result), b = new DataView(new ArrayBuffer(En));
|
|
2247
2247
|
b.setUint32(0, m.byteLength, !0), b.setUint32(4, Xr, !0);
|
|
2248
2248
|
const h = Ms(qr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(En));
|
|
2249
2249
|
p.setUint32(0, h.byteLength, !0), p.setUint32(4, Br, !0);
|
|
2250
|
-
const
|
|
2251
|
-
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2254
|
-
const
|
|
2255
|
-
|
|
2250
|
+
const C = new ArrayBuffer(Tn), v = new DataView(C);
|
|
2251
|
+
v.setUint32(0, Wr, !0), v.setUint32(4, Gr, !0);
|
|
2252
|
+
const w = Tn + p.byteLength + h.byteLength + b.byteLength + m.byteLength;
|
|
2253
|
+
v.setUint32(8, w, !0);
|
|
2254
|
+
const d = new Blob([
|
|
2255
|
+
C,
|
|
2256
2256
|
p,
|
|
2257
2257
|
h,
|
|
2258
2258
|
b,
|
|
2259
2259
|
m
|
|
2260
|
-
], { type: "application/octet-stream" }),
|
|
2261
|
-
|
|
2262
|
-
t(
|
|
2260
|
+
], { type: "application/octet-stream" }), x = new FileReader();
|
|
2261
|
+
x.readAsArrayBuffer(d), x.onloadend = function() {
|
|
2262
|
+
t(x.result);
|
|
2263
2263
|
};
|
|
2264
2264
|
};
|
|
2265
2265
|
} else if (o.buffers && o.buffers.length > 0) {
|
|
@@ -2363,20 +2363,20 @@ class Zr {
|
|
|
2363
2363
|
willReadFrequently: !0
|
|
2364
2364
|
});
|
|
2365
2365
|
c.fillStyle = "#00ffff", c.fillRect(0, 0, o, a);
|
|
2366
|
-
const
|
|
2366
|
+
const f = c.getImageData(0, 0, o, a);
|
|
2367
2367
|
if (s) {
|
|
2368
2368
|
c.drawImage(s, 0, 0, o, a);
|
|
2369
2369
|
const m = n(e), b = c.getImageData(0, 0, o, a).data;
|
|
2370
2370
|
for (let h = 2; h < b.length; h += 4)
|
|
2371
|
-
|
|
2371
|
+
f.data[h] = m(b[h] / 256) * 256;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (i) {
|
|
2374
2374
|
c.drawImage(i, 0, 0, o, a);
|
|
2375
2375
|
const m = n(t), b = c.getImageData(0, 0, o, a).data;
|
|
2376
2376
|
for (let h = 1; h < b.length; h += 4)
|
|
2377
|
-
|
|
2377
|
+
f.data[h] = m(b[h] / 256) * 256;
|
|
2378
2378
|
}
|
|
2379
|
-
c.putImageData(
|
|
2379
|
+
c.putImageData(f, 0, 0);
|
|
2380
2380
|
const A = (e || t).clone();
|
|
2381
2381
|
return A.source = new To(l), A.colorSpace = Eo, A.channel = (e || t).channel, e && t && e.channel !== t.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), A;
|
|
2382
2382
|
}
|
|
@@ -2421,17 +2421,17 @@ class Zr {
|
|
|
2421
2421
|
}
|
|
2422
2422
|
let l = e.itemSize * a;
|
|
2423
2423
|
i === K.ARRAY_BUFFER && (l = Math.ceil(l / 4) * 4);
|
|
2424
|
-
const c = ui(s * l),
|
|
2424
|
+
const c = ui(s * l), f = new DataView(new ArrayBuffer(c));
|
|
2425
2425
|
let u = 0;
|
|
2426
2426
|
for (let b = n; b < n + s; b++) {
|
|
2427
2427
|
for (let h = 0; h < e.itemSize; h++) {
|
|
2428
2428
|
let p;
|
|
2429
|
-
e.itemSize > 4 ? p = e.array[b * e.itemSize + h] : (h === 0 ? p = e.getX(b) : h === 1 ? p = e.getY(b) : h === 2 ? p = e.getZ(b) : h === 3 && (p = e.getW(b)), e.normalized === !0 && (p =
|
|
2429
|
+
e.itemSize > 4 ? p = e.array[b * e.itemSize + h] : (h === 0 ? p = e.getX(b) : h === 1 ? p = e.getY(b) : h === 2 ? p = e.getZ(b) : h === 3 && (p = e.getW(b)), e.normalized === !0 && (p = Lt.normalize(p, e.array))), t === K.FLOAT ? f.setFloat32(u, p, !0) : t === K.INT ? f.setInt32(u, p, !0) : t === K.UNSIGNED_INT ? f.setUint32(u, p, !0) : t === K.SHORT ? f.setInt16(u, p, !0) : t === K.UNSIGNED_SHORT ? f.setUint16(u, p, !0) : t === K.BYTE ? f.setInt8(u, p) : t === K.UNSIGNED_BYTE && f.setUint8(u, p), u += a;
|
|
2430
2430
|
}
|
|
2431
2431
|
u % l !== 0 && (u += l - u % l);
|
|
2432
2432
|
}
|
|
2433
2433
|
const A = {
|
|
2434
|
-
buffer: this.processBuffer(
|
|
2434
|
+
buffer: this.processBuffer(f.buffer),
|
|
2435
2435
|
byteOffset: this.byteOffset,
|
|
2436
2436
|
byteLength: c
|
|
2437
2437
|
};
|
|
@@ -2497,9 +2497,9 @@ class Zr {
|
|
|
2497
2497
|
const l = Yr(e, n, s);
|
|
2498
2498
|
let c;
|
|
2499
2499
|
t !== void 0 && (c = e === t.index ? K.ELEMENT_ARRAY_BUFFER : K.ARRAY_BUFFER);
|
|
2500
|
-
const
|
|
2501
|
-
bufferView:
|
|
2502
|
-
byteOffset:
|
|
2500
|
+
const f = this.processBufferView(e, a, n, s, c), u = {
|
|
2501
|
+
bufferView: f.id,
|
|
2502
|
+
byteOffset: f.byteOffset,
|
|
2503
2503
|
componentType: a,
|
|
2504
2504
|
count: s,
|
|
2505
2505
|
max: l.max,
|
|
@@ -2520,8 +2520,8 @@ class Zr {
|
|
|
2520
2520
|
if (e !== null) {
|
|
2521
2521
|
const i = this, o = i.cache, a = i.json, l = i.options, c = i.pending;
|
|
2522
2522
|
o.images.has(e) || o.images.set(e, {});
|
|
2523
|
-
const
|
|
2524
|
-
if (
|
|
2523
|
+
const f = o.images.get(e), u = s + ":flipY/" + n.toString();
|
|
2524
|
+
if (f[u] !== void 0) return f[u];
|
|
2525
2525
|
a.images || (a.images = []);
|
|
2526
2526
|
const A = { mimeType: s }, m = Dn();
|
|
2527
2527
|
m.width = Math.min(e.width, l.maxTextureSize), m.height = Math.min(e.height, l.maxTextureSize);
|
|
@@ -2531,8 +2531,8 @@ class Zr {
|
|
|
2531
2531
|
if (n === !0 && (b.translate(0, m.height), b.scale(1, -1)), e.data !== void 0) {
|
|
2532
2532
|
t !== Do && console.error("GLTFExporter: Only RGBAFormat is supported.", t), (e.width > l.maxTextureSize || e.height > l.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
|
|
2533
2533
|
const p = new Uint8ClampedArray(e.height * e.width * 4);
|
|
2534
|
-
for (let
|
|
2535
|
-
p[
|
|
2534
|
+
for (let C = 0; C < p.length; C += 4)
|
|
2535
|
+
p[C + 0] = e.data[C + 0], p[C + 1] = e.data[C + 1], p[C + 2] = e.data[C + 2], p[C + 3] = e.data[C + 3];
|
|
2536
2536
|
b.putImageData(new ImageData(p, e.width, e.height), 0, 0);
|
|
2537
2537
|
} else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
|
|
2538
2538
|
b.drawImage(e, 0, 0, m.width, m.height);
|
|
@@ -2544,7 +2544,7 @@ class Zr {
|
|
|
2544
2544
|
})
|
|
2545
2545
|
) : A.uri = Oo.getDataURL(m, s);
|
|
2546
2546
|
const h = a.images.push(A) - 1;
|
|
2547
|
-
return
|
|
2547
|
+
return f[u] = h, h;
|
|
2548
2548
|
} else
|
|
2549
2549
|
throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
|
|
2550
2550
|
}
|
|
@@ -2578,8 +2578,8 @@ class Zr {
|
|
|
2578
2578
|
};
|
|
2579
2579
|
o === "image/webp" ? (l.extensions = l.extensions || {}, l.extensions.EXT_texture_webp = {
|
|
2580
2580
|
source: a
|
|
2581
|
-
}, this.extensionsUsed.EXT_texture_webp = !0, this.extensionsRequired.EXT_texture_webp = !0) : l.source = a, e.name && (l.name = e.name), await this._invokeAllAsync(async function(
|
|
2582
|
-
|
|
2581
|
+
}, this.extensionsUsed.EXT_texture_webp = !0, this.extensionsRequired.EXT_texture_webp = !0) : l.source = a, e.name && (l.name = e.name), await this._invokeAllAsync(async function(f) {
|
|
2582
|
+
f.writeTexture && await f.writeTexture(e, l);
|
|
2583
2583
|
});
|
|
2584
2584
|
const c = i.textures.push(l) - 1;
|
|
2585
2585
|
return s.textures.set(e, c), c;
|
|
@@ -2650,8 +2650,8 @@ class Zr {
|
|
|
2650
2650
|
async processMeshAsync(e) {
|
|
2651
2651
|
const t = this.cache, n = this.json, s = [e.geometry.uuid];
|
|
2652
2652
|
if (Array.isArray(e.material))
|
|
2653
|
-
for (let
|
|
2654
|
-
s.push(e.material[
|
|
2653
|
+
for (let d = 0, x = e.material.length; d < x; d++)
|
|
2654
|
+
s.push(e.material[d].uuid);
|
|
2655
2655
|
else
|
|
2656
2656
|
s.push(e.material.uuid);
|
|
2657
2657
|
const i = s.join(":");
|
|
@@ -2659,7 +2659,7 @@ class Zr {
|
|
|
2659
2659
|
const o = e.geometry;
|
|
2660
2660
|
let a;
|
|
2661
2661
|
e.isLineSegments ? a = K.LINES : e.isLineLoop ? a = K.LINE_LOOP : e.isLine ? a = K.LINE_STRIP : e.isPoints ? a = K.POINTS : a = e.material.wireframe ? K.LINES : K.TRIANGLES;
|
|
2662
|
-
const l = {}, c = {},
|
|
2662
|
+
const l = {}, c = {}, f = [], u = [], A = {
|
|
2663
2663
|
uv: "TEXCOORD_0",
|
|
2664
2664
|
uv1: "TEXCOORD_1",
|
|
2665
2665
|
uv2: "TEXCOORD_2",
|
|
@@ -2670,22 +2670,22 @@ class Zr {
|
|
|
2670
2670
|
}, m = o.getAttribute("normal");
|
|
2671
2671
|
m !== void 0 && !this.isNormalizedNormalAttribute(m) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(m)));
|
|
2672
2672
|
let b = null;
|
|
2673
|
-
for (let
|
|
2674
|
-
if (
|
|
2675
|
-
const
|
|
2676
|
-
if (
|
|
2677
|
-
c[
|
|
2673
|
+
for (let d in o.attributes) {
|
|
2674
|
+
if (d.slice(0, 5) === "morph") continue;
|
|
2675
|
+
const x = o.attributes[d];
|
|
2676
|
+
if (d = A[d] || d.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(d) && !d.startsWith("_") && (d = "_" + d), t.attributes.has(this.getUID(x))) {
|
|
2677
|
+
c[d] = t.attributes.get(this.getUID(x));
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
2680
|
b = null;
|
|
2681
|
-
const D =
|
|
2682
|
-
|
|
2683
|
-
const E = this.processAccessor(b ||
|
|
2684
|
-
E !== null && (
|
|
2681
|
+
const D = x.array;
|
|
2682
|
+
d === "JOINTS_0" && !(D instanceof Uint16Array) && !(D instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Ot.Utils.toTypedBufferAttribute(x, Uint16Array)) : (D instanceof Uint32Array || D instanceof Int32Array) && !d.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${d}" converted to type FLOAT.`), b = Ot.Utils.toTypedBufferAttribute(x, Float32Array));
|
|
2683
|
+
const E = this.processAccessor(b || x, o);
|
|
2684
|
+
E !== null && (d.startsWith("_") || this.detectMeshQuantization(d, x), c[d] = E, t.attributes.set(this.getUID(x), E));
|
|
2685
2685
|
}
|
|
2686
2686
|
if (m !== void 0 && o.setAttribute("normal", m), Object.keys(c).length === 0) return null;
|
|
2687
2687
|
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
2688
|
-
const
|
|
2688
|
+
const d = [], x = [], M = {};
|
|
2689
2689
|
if (e.morphTargetDictionary !== void 0)
|
|
2690
2690
|
for (const D in e.morphTargetDictionary)
|
|
2691
2691
|
M[e.morphTargetDictionary[D]] = D;
|
|
@@ -2709,37 +2709,37 @@ class Zr {
|
|
|
2709
2709
|
G === 0 && Q.setX(N, _.getX(N) - $.getX(N)), G === 1 && Q.setY(N, _.getY(N) - $.getY(N)), G === 2 && Q.setZ(N, _.getZ(N) - $.getZ(N)), G === 3 && Q.setW(N, _.getW(N) - $.getW(N));
|
|
2710
2710
|
E[ne] = this.processAccessor(Q, o), t.attributes.set(this.getUID($, !0), E[ne]);
|
|
2711
2711
|
}
|
|
2712
|
-
u.push(E),
|
|
2712
|
+
u.push(E), d.push(e.morphTargetInfluences[D]), e.morphTargetDictionary !== void 0 && x.push(M[D]);
|
|
2713
2713
|
}
|
|
2714
|
-
l.weights =
|
|
2714
|
+
l.weights = d, x.length > 0 && (l.extras = {}, l.extras.targetNames = x);
|
|
2715
2715
|
}
|
|
2716
2716
|
const h = Array.isArray(e.material);
|
|
2717
2717
|
if (h && o.groups.length === 0) return null;
|
|
2718
2718
|
let p = !1;
|
|
2719
2719
|
if (h && o.index === null) {
|
|
2720
|
-
const
|
|
2721
|
-
for (let
|
|
2722
|
-
|
|
2723
|
-
o.setIndex(
|
|
2720
|
+
const d = [];
|
|
2721
|
+
for (let x = 0, M = o.attributes.position.count; x < M; x++)
|
|
2722
|
+
d[x] = x;
|
|
2723
|
+
o.setIndex(d), p = !0;
|
|
2724
2724
|
}
|
|
2725
|
-
const
|
|
2726
|
-
for (let
|
|
2725
|
+
const C = h ? e.material : [e.material], v = h ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
2726
|
+
for (let d = 0, x = v.length; d < x; d++) {
|
|
2727
2727
|
const M = {
|
|
2728
2728
|
mode: a,
|
|
2729
2729
|
attributes: c
|
|
2730
2730
|
};
|
|
2731
2731
|
if (this.serializeUserData(o, M), u.length > 0 && (M.targets = u), o.index !== null) {
|
|
2732
2732
|
let E = this.getUID(o.index);
|
|
2733
|
-
(
|
|
2733
|
+
(v[d].start !== void 0 || v[d].count !== void 0) && (E += ":" + v[d].start + ":" + v[d].count), t.attributes.has(E) ? M.indices = t.attributes.get(E) : (M.indices = this.processAccessor(o.index, o, v[d].start, v[d].count), t.attributes.set(E, M.indices)), M.indices === null && delete M.indices;
|
|
2734
2734
|
}
|
|
2735
|
-
const D = await this.processMaterialAsync(
|
|
2736
|
-
D !== null && (M.material = D),
|
|
2735
|
+
const D = await this.processMaterialAsync(C[v[d].materialIndex]);
|
|
2736
|
+
D !== null && (M.material = D), f.push(M);
|
|
2737
2737
|
}
|
|
2738
|
-
p === !0 && o.setIndex(null), l.primitives =
|
|
2739
|
-
|
|
2738
|
+
p === !0 && o.setIndex(null), l.primitives = f, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(d) {
|
|
2739
|
+
d.writeMesh && d.writeMesh(e, l);
|
|
2740
2740
|
});
|
|
2741
|
-
const
|
|
2742
|
-
return t.meshes.set(i,
|
|
2741
|
+
const w = n.meshes.push(l) - 1;
|
|
2742
|
+
return t.meshes.set(i, w), w;
|
|
2743
2743
|
}
|
|
2744
2744
|
/**
|
|
2745
2745
|
* If a vertex attribute with a
|
|
@@ -2793,7 +2793,7 @@ class Zr {
|
|
|
2793
2793
|
znear: e.near < 0 ? 0 : e.near
|
|
2794
2794
|
} : s.perspective = {
|
|
2795
2795
|
aspectRatio: e.aspect,
|
|
2796
|
-
yfov:
|
|
2796
|
+
yfov: Lt.degToRad(e.fov),
|
|
2797
2797
|
zfar: e.far <= 0 ? 1e-3 : e.far,
|
|
2798
2798
|
znear: e.near < 0 ? 0 : e.near
|
|
2799
2799
|
}, e.name !== "" && (s.name = e.type), t.cameras.push(s) - 1;
|
|
@@ -2813,20 +2813,20 @@ class Zr {
|
|
|
2813
2813
|
n.animations || (n.animations = []), e = Ot.Utils.mergeMorphTargetTracks(e.clone(), t);
|
|
2814
2814
|
const i = e.tracks, o = [], a = [];
|
|
2815
2815
|
for (let c = 0; c < i.length; ++c) {
|
|
2816
|
-
const
|
|
2817
|
-
let A =
|
|
2816
|
+
const f = i[c], u = Nt.parseTrackName(f.name);
|
|
2817
|
+
let A = Nt.findNode(t, u.nodeName);
|
|
2818
2818
|
const m = Mn[u.propertyName];
|
|
2819
2819
|
if (u.objectName === "bones" && (A.isSkinnedMesh === !0 ? A = A.skeleton.getBoneByName(u.objectIndex) : A = void 0), !A || !m) {
|
|
2820
|
-
console.warn('THREE.GLTFExporter: Could not export animation track "%s".',
|
|
2820
|
+
console.warn('THREE.GLTFExporter: Could not export animation track "%s".', f.name);
|
|
2821
2821
|
continue;
|
|
2822
2822
|
}
|
|
2823
2823
|
const b = 1;
|
|
2824
|
-
let h =
|
|
2824
|
+
let h = f.values.length / f.times.length;
|
|
2825
2825
|
m === Mn.morphTargetInfluences && (h /= A.morphTargetInfluences.length);
|
|
2826
2826
|
let p;
|
|
2827
|
-
|
|
2828
|
-
input: this.processAccessor(new De(
|
|
2829
|
-
output: this.processAccessor(new De(
|
|
2827
|
+
f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", h /= 3) : f.getInterpolation() === Kn ? p = "STEP" : p = "LINEAR", a.push({
|
|
2828
|
+
input: this.processAccessor(new De(f.times, b)),
|
|
2829
|
+
output: this.processAccessor(new De(f.values, h)),
|
|
2830
2830
|
interpolation: p
|
|
2831
2831
|
}), o.push({
|
|
2832
2832
|
sampler: a.length - 1,
|
|
@@ -2885,9 +2885,9 @@ class Zr {
|
|
|
2885
2885
|
if (s.set(e, o), e.children.length > 0) {
|
|
2886
2886
|
const a = [];
|
|
2887
2887
|
for (let l = 0, c = e.children.length; l < c; l++) {
|
|
2888
|
-
const
|
|
2889
|
-
if (
|
|
2890
|
-
const u = await this.processNodeAsync(
|
|
2888
|
+
const f = e.children[l];
|
|
2889
|
+
if (f.visible || n.onlyVisible === !1) {
|
|
2890
|
+
const u = await this.processNodeAsync(f);
|
|
2891
2891
|
u !== null && a.push(u);
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
@@ -2909,8 +2909,8 @@ class Zr {
|
|
|
2909
2909
|
e.position.z + i.z
|
|
2910
2910
|
], c = e.scale.toArray();
|
|
2911
2911
|
Ge(a, [0, 0, 0, 1]) || (o.rotation = a), Ge(l, [0, 0, 0]) || (o.translation = l), Ge(c, [1, 1, 1]) || (o.scale = c), o.extras = { pivot: i.toArray() }, e.name !== "" && (o.name = String(e.name)), this.serializeUserData(e, o);
|
|
2912
|
-
const
|
|
2913
|
-
s.set(e,
|
|
2912
|
+
const f = t.nodes.push(o) - 1;
|
|
2913
|
+
s.set(e, f);
|
|
2914
2914
|
const u = {}, A = [-i.x, -i.y, -i.z];
|
|
2915
2915
|
if (Ge(A, [0, 0, 0]) || (u.translation = A), e.isMesh || e.isLine || e.isPoints) {
|
|
2916
2916
|
const h = await this.processMeshAsync(e);
|
|
@@ -2920,18 +2920,18 @@ class Zr {
|
|
|
2920
2920
|
const b = [t.nodes.push(u) - 1];
|
|
2921
2921
|
if (e.children.length > 0) {
|
|
2922
2922
|
const h = [];
|
|
2923
|
-
for (let p = 0,
|
|
2924
|
-
const
|
|
2925
|
-
if (
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2923
|
+
for (let p = 0, C = e.children.length; p < C; p++) {
|
|
2924
|
+
const v = e.children[p];
|
|
2925
|
+
if (v.visible || n.onlyVisible === !1) {
|
|
2926
|
+
const w = await this.processNodeAsync(v);
|
|
2927
|
+
w !== null && h.push(w);
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
h.length > 0 && (u.children = h);
|
|
2931
2931
|
}
|
|
2932
2932
|
return o.children = b, await this._invokeAllAsync(function(h) {
|
|
2933
2933
|
h.writeNode && h.writeNode(e, o);
|
|
2934
|
-
}),
|
|
2934
|
+
}), f;
|
|
2935
2935
|
}
|
|
2936
2936
|
/**
|
|
2937
2937
|
* Process Scene
|
|
@@ -3206,9 +3206,9 @@ let Jr = class {
|
|
|
3206
3206
|
}
|
|
3207
3207
|
writeNode(e, t) {
|
|
3208
3208
|
if (!e.isInstancedMesh) return;
|
|
3209
|
-
const n = this.writer, s = e, i = new Float32Array(s.count * 3), o = new Float32Array(s.count * 4), a = new Float32Array(s.count * 3), l = new Ce(), c = new S(),
|
|
3209
|
+
const n = this.writer, s = e, i = new Float32Array(s.count * 3), o = new Float32Array(s.count * 4), a = new Float32Array(s.count * 3), l = new Ce(), c = new S(), f = new me(), u = new S();
|
|
3210
3210
|
for (let m = 0; m < s.count; m++)
|
|
3211
|
-
s.getMatrixAt(m, l), l.decompose(c,
|
|
3211
|
+
s.getMatrixAt(m, l), l.decompose(c, f, u), c.toArray(i, m * 3), f.toArray(o, m * 4), u.toArray(a, m * 3);
|
|
3212
3212
|
const A = {
|
|
3213
3213
|
TRANSLATION: n.processAccessor(new De(i, 3)),
|
|
3214
3214
|
ROTATION: n.processAccessor(new De(o, 4)),
|
|
@@ -3247,7 +3247,7 @@ Ot.Utils = {
|
|
|
3247
3247
|
const t = [], n = {}, s = r.tracks;
|
|
3248
3248
|
for (let i = 0; i < s.length; ++i) {
|
|
3249
3249
|
let o = s[i];
|
|
3250
|
-
const a =
|
|
3250
|
+
const a = Nt.parseTrackName(o.name), l = Nt.findNode(e, a.nodeName);
|
|
3251
3251
|
if (a.propertyName !== "morphTargetInfluences" || a.propertyIndex === void 0) {
|
|
3252
3252
|
t.push(o);
|
|
3253
3253
|
continue;
|
|
@@ -3257,25 +3257,25 @@ Ot.Utils = {
|
|
|
3257
3257
|
throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
|
|
3258
3258
|
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), o = o.clone(), o.setInterpolation(Ys);
|
|
3259
3259
|
}
|
|
3260
|
-
const c = l.morphTargetInfluences.length,
|
|
3261
|
-
if (
|
|
3260
|
+
const c = l.morphTargetInfluences.length, f = l.morphTargetDictionary[a.propertyIndex];
|
|
3261
|
+
if (f === void 0)
|
|
3262
3262
|
throw new Error("THREE.GLTFExporter: Morph target name not found: " + a.propertyIndex);
|
|
3263
3263
|
let u;
|
|
3264
3264
|
if (n[l.uuid] === void 0) {
|
|
3265
3265
|
u = o.clone();
|
|
3266
3266
|
const m = new u.ValueBufferType(c * u.times.length);
|
|
3267
3267
|
for (let b = 0; b < u.times.length; b++)
|
|
3268
|
-
m[b * c +
|
|
3268
|
+
m[b * c + f] = u.values[b];
|
|
3269
3269
|
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = m, n[l.uuid] = u, t.push(u);
|
|
3270
3270
|
continue;
|
|
3271
3271
|
}
|
|
3272
3272
|
const A = o.createInterpolant(new o.ValueBufferType(1));
|
|
3273
3273
|
u = n[l.uuid];
|
|
3274
3274
|
for (let m = 0; m < u.times.length; m++)
|
|
3275
|
-
u.values[m * c +
|
|
3275
|
+
u.values[m * c + f] = A.evaluate(u.times[m]);
|
|
3276
3276
|
for (let m = 0; m < o.times.length; m++) {
|
|
3277
3277
|
const b = this.insertKeyframe(u, o.times[m]);
|
|
3278
|
-
u.values[b * c +
|
|
3278
|
+
u.values[b * c + f] = o.values[m];
|
|
3279
3279
|
}
|
|
3280
3280
|
}
|
|
3281
3281
|
return r.tracks = t, r;
|
|
@@ -3401,14 +3401,14 @@ class fi extends Ks {
|
|
|
3401
3401
|
this.manager.itemStart(e);
|
|
3402
3402
|
const a = function(c) {
|
|
3403
3403
|
s ? s(c) : console.error(c), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
3404
|
-
}, l = new
|
|
3404
|
+
}, l = new Ht(this.manager);
|
|
3405
3405
|
l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(c) {
|
|
3406
3406
|
try {
|
|
3407
|
-
i.parse(c, o, function(
|
|
3408
|
-
t(
|
|
3407
|
+
i.parse(c, o, function(f) {
|
|
3408
|
+
t(f), i.manager.itemEnd(e);
|
|
3409
3409
|
}, a);
|
|
3410
|
-
} catch (
|
|
3411
|
-
a(
|
|
3410
|
+
} catch (f) {
|
|
3411
|
+
a(f);
|
|
3412
3412
|
}
|
|
3413
3413
|
}, n, a);
|
|
3414
3414
|
}
|
|
@@ -3501,13 +3501,13 @@ class fi extends Ks {
|
|
|
3501
3501
|
meshoptDecoder: this.meshoptDecoder
|
|
3502
3502
|
});
|
|
3503
3503
|
c.fileLoader.setRequestHeader(this.requestHeader);
|
|
3504
|
-
for (let
|
|
3505
|
-
const u = this.pluginCallbacks[
|
|
3504
|
+
for (let f = 0; f < this.pluginCallbacks.length; f++) {
|
|
3505
|
+
const u = this.pluginCallbacks[f](c);
|
|
3506
3506
|
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, o[u.name] = !0;
|
|
3507
3507
|
}
|
|
3508
3508
|
if (i.extensionsUsed)
|
|
3509
|
-
for (let
|
|
3510
|
-
const u = i.extensionsUsed[
|
|
3509
|
+
for (let f = 0; f < i.extensionsUsed.length; ++f) {
|
|
3510
|
+
const u = i.extensionsUsed[f], A = i.extensionsRequired || [];
|
|
3511
3511
|
switch (u) {
|
|
3512
3512
|
case Y.KHR_MATERIALS_UNLIT:
|
|
3513
3513
|
o[u] = new ha();
|
|
@@ -3605,18 +3605,18 @@ class fa {
|
|
|
3605
3605
|
if (s) return s;
|
|
3606
3606
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
3607
3607
|
let c;
|
|
3608
|
-
const
|
|
3609
|
-
l.color !== void 0 &&
|
|
3608
|
+
const f = new le(16777215);
|
|
3609
|
+
l.color !== void 0 && f.setRGB(l.color[0], l.color[1], l.color[2], Fe);
|
|
3610
3610
|
const u = l.range !== void 0 ? l.range : 0;
|
|
3611
3611
|
switch (l.type) {
|
|
3612
3612
|
case "directional":
|
|
3613
|
-
c = new Lo(
|
|
3613
|
+
c = new Lo(f), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
3614
3614
|
break;
|
|
3615
3615
|
case "point":
|
|
3616
|
-
c = new So(
|
|
3616
|
+
c = new So(f), c.distance = u;
|
|
3617
3617
|
break;
|
|
3618
3618
|
case "spot":
|
|
3619
|
-
c = new Po(
|
|
3619
|
+
c = new Po(f), c.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
3620
3620
|
break;
|
|
3621
3621
|
default:
|
|
3622
3622
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -3677,7 +3677,7 @@ class Aa {
|
|
|
3677
3677
|
const s = [];
|
|
3678
3678
|
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (s.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
|
|
3679
3679
|
const i = n.clearcoatNormalTexture.scale;
|
|
3680
|
-
t.clearcoatNormalScale = new
|
|
3680
|
+
t.clearcoatNormalScale = new fe(i, i);
|
|
3681
3681
|
}
|
|
3682
3682
|
return Promise.all(s);
|
|
3683
3683
|
}
|
|
@@ -3877,12 +3877,12 @@ class Rn {
|
|
|
3877
3877
|
return null;
|
|
3878
3878
|
}
|
|
3879
3879
|
return i.then(function(a) {
|
|
3880
|
-
const l = s.byteOffset || 0, c = s.byteLength || 0,
|
|
3881
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(
|
|
3880
|
+
const l = s.byteOffset || 0, c = s.byteLength || 0, f = s.count, u = s.byteStride, A = new Uint8Array(a, l, c);
|
|
3881
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(f, u, A, s.mode, s.filter).then(function(m) {
|
|
3882
3882
|
return m.buffer;
|
|
3883
3883
|
}) : o.ready.then(function() {
|
|
3884
|
-
const m = new ArrayBuffer(
|
|
3885
|
-
return o.decodeGltfBuffer(new Uint8Array(m),
|
|
3884
|
+
const m = new ArrayBuffer(f * u);
|
|
3885
|
+
return o.decodeGltfBuffer(new Uint8Array(m), f, u, A, s.mode, s.filter), m;
|
|
3886
3886
|
});
|
|
3887
3887
|
});
|
|
3888
3888
|
} else
|
|
@@ -3903,21 +3903,21 @@ class Da {
|
|
|
3903
3903
|
return null;
|
|
3904
3904
|
const o = n.extensions[this.name].attributes, a = [], l = {};
|
|
3905
3905
|
for (const c in o)
|
|
3906
|
-
a.push(this.parser.getDependency("accessor", o[c]).then((
|
|
3906
|
+
a.push(this.parser.getDependency("accessor", o[c]).then((f) => (l[c] = f, l[c])));
|
|
3907
3907
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
3908
|
-
const
|
|
3908
|
+
const f = c.pop(), u = f.isGroup ? f.children : [f], A = c[0].count, m = [];
|
|
3909
3909
|
for (const b of u) {
|
|
3910
|
-
const h = new Ce(), p = new S(),
|
|
3911
|
-
for (let
|
|
3912
|
-
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION,
|
|
3913
|
-
for (const
|
|
3914
|
-
if (
|
|
3915
|
-
const
|
|
3916
|
-
|
|
3917
|
-
} else
|
|
3918
|
-
gt.prototype.copy.call(
|
|
3910
|
+
const h = new Ce(), p = new S(), C = new me(), v = new S(1, 1, 1), w = new No(b.geometry, b.material, A);
|
|
3911
|
+
for (let d = 0; d < A; d++)
|
|
3912
|
+
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, d), l.ROTATION && C.fromBufferAttribute(l.ROTATION, d), l.SCALE && v.fromBufferAttribute(l.SCALE, d), w.setMatrixAt(d, h.compose(p, C, v));
|
|
3913
|
+
for (const d in l)
|
|
3914
|
+
if (d === "_COLOR_0") {
|
|
3915
|
+
const x = l[d];
|
|
3916
|
+
w.instanceColor = new Ho(x.array, x.itemSize, x.normalized);
|
|
3917
|
+
} else d !== "TRANSLATION" && d !== "ROTATION" && d !== "SCALE" && b.geometry.setAttribute(d, l[d]);
|
|
3918
|
+
gt.prototype.copy.call(w, b), this.parser.assignFinalMaterial(w), m.push(w);
|
|
3919
3919
|
}
|
|
3920
|
-
return
|
|
3920
|
+
return f.isGroup ? (f.clear(), f.add(...m), f) : m[0];
|
|
3921
3921
|
}));
|
|
3922
3922
|
}
|
|
3923
3923
|
}
|
|
@@ -3961,20 +3961,20 @@ class Ra {
|
|
|
3961
3961
|
}
|
|
3962
3962
|
decodePrimitive(e, t) {
|
|
3963
3963
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
|
|
3964
|
-
for (const
|
|
3965
|
-
const u = ks[
|
|
3966
|
-
a[u] = o[
|
|
3967
|
-
}
|
|
3968
|
-
for (const
|
|
3969
|
-
const u = ks[
|
|
3970
|
-
if (o[
|
|
3971
|
-
const A = n.accessors[e.attributes[
|
|
3964
|
+
for (const f in o) {
|
|
3965
|
+
const u = ks[f] || f.toLowerCase();
|
|
3966
|
+
a[u] = o[f];
|
|
3967
|
+
}
|
|
3968
|
+
for (const f in e.attributes) {
|
|
3969
|
+
const u = ks[f] || f.toLowerCase();
|
|
3970
|
+
if (o[f] !== void 0) {
|
|
3971
|
+
const A = n.accessors[e.attributes[f]], m = At[A.componentType];
|
|
3972
3972
|
c[u] = m.name, l[u] = A.normalized === !0;
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
|
-
return t.getDependency("bufferView", i).then(function(
|
|
3975
|
+
return t.getDependency("bufferView", i).then(function(f) {
|
|
3976
3976
|
return new Promise(function(u, A) {
|
|
3977
|
-
s.decodeDracoFile(
|
|
3977
|
+
s.decodeDracoFile(f, function(m) {
|
|
3978
3978
|
for (const b in m.attributes) {
|
|
3979
3979
|
const h = m.attributes[b], p = l[b];
|
|
3980
3980
|
p !== void 0 && (h.normalized = p);
|
|
@@ -4009,10 +4009,10 @@ class pi extends Go {
|
|
|
4009
4009
|
return t;
|
|
4010
4010
|
}
|
|
4011
4011
|
interpolate_(e, t, n, s) {
|
|
4012
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3,
|
|
4013
|
-
for (let
|
|
4014
|
-
const
|
|
4015
|
-
i[
|
|
4012
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, f = s - t, u = (n - t) / f, A = u * u, m = A * u, b = e * c, h = b - c, p = -2 * m + 3 * A, C = m - A, v = 1 - p, w = C - A + u;
|
|
4013
|
+
for (let d = 0; d !== a; d++) {
|
|
4014
|
+
const x = o[h + d + a], M = o[h + d + l] * f, D = o[b + d + a], E = o[b + d] * f;
|
|
4015
|
+
i[d] = v * x + w * M + p * D + C * E;
|
|
4016
4016
|
}
|
|
4017
4017
|
return i;
|
|
4018
4018
|
}
|
|
@@ -4096,7 +4096,7 @@ function ka(r) {
|
|
|
4096
4096
|
side: oi
|
|
4097
4097
|
})), r.DefaultMaterial;
|
|
4098
4098
|
}
|
|
4099
|
-
function
|
|
4099
|
+
function et(r, e, t) {
|
|
4100
4100
|
for (const n in t.extensions)
|
|
4101
4101
|
r[n] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = t.extensions[n]);
|
|
4102
4102
|
}
|
|
@@ -4105,13 +4105,13 @@ function He(r, e) {
|
|
|
4105
4105
|
}
|
|
4106
4106
|
function ja(r, e, t) {
|
|
4107
4107
|
let n = !1, s = !1, i = !1;
|
|
4108
|
-
for (let c = 0,
|
|
4108
|
+
for (let c = 0, f = e.length; c < f; c++) {
|
|
4109
4109
|
const u = e[c];
|
|
4110
4110
|
if (u.POSITION !== void 0 && (n = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (i = !0), n && s && i) break;
|
|
4111
4111
|
}
|
|
4112
4112
|
if (!n && !s && !i) return Promise.resolve(r);
|
|
4113
4113
|
const o = [], a = [], l = [];
|
|
4114
|
-
for (let c = 0,
|
|
4114
|
+
for (let c = 0, f = e.length; c < f; c++) {
|
|
4115
4115
|
const u = e[c];
|
|
4116
4116
|
if (n) {
|
|
4117
4117
|
const A = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
|
|
@@ -4131,8 +4131,8 @@ function ja(r, e, t) {
|
|
|
4131
4131
|
Promise.all(a),
|
|
4132
4132
|
Promise.all(l)
|
|
4133
4133
|
]).then(function(c) {
|
|
4134
|
-
const
|
|
4135
|
-
return n && (r.morphAttributes.position =
|
|
4134
|
+
const f = c[0], u = c[1], A = c[2];
|
|
4135
|
+
return n && (r.morphAttributes.position = f), s && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = A), r.morphTargetsRelative = !0, r;
|
|
4136
4136
|
});
|
|
4137
4137
|
}
|
|
4138
4138
|
function Fa(r, e) {
|
|
@@ -4192,7 +4192,7 @@ class Ga {
|
|
|
4192
4192
|
const l = a.match(/Version\/(\d+)/);
|
|
4193
4193
|
s = n && l ? parseInt(l[1], 10) : -1, i = a.indexOf("Firefox") > -1, o = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
4194
4194
|
}
|
|
4195
|
-
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new
|
|
4195
|
+
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new Jt(this.options.manager) : this.textureLoader = new ko(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Ht(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
4196
4196
|
}
|
|
4197
4197
|
setExtensions(e) {
|
|
4198
4198
|
this.extensions = e;
|
|
@@ -4222,7 +4222,7 @@ class Ga {
|
|
|
4222
4222
|
parser: n,
|
|
4223
4223
|
userData: {}
|
|
4224
4224
|
};
|
|
4225
|
-
return
|
|
4225
|
+
return et(i, a, s), He(a, s), Promise.all(n._invokeAll(function(l) {
|
|
4226
4226
|
return l.afterRoot && l.afterRoot(a);
|
|
4227
4227
|
})).then(function() {
|
|
4228
4228
|
for (const l of a.scenes)
|
|
@@ -4278,8 +4278,8 @@ class Ga {
|
|
|
4278
4278
|
const s = n.clone(), i = (o, a) => {
|
|
4279
4279
|
const l = this.associations.get(o);
|
|
4280
4280
|
l != null && this.associations.set(a, l);
|
|
4281
|
-
for (const [c,
|
|
4282
|
-
i(
|
|
4281
|
+
for (const [c, f] of o.children.entries())
|
|
4282
|
+
i(f, a.children[c]);
|
|
4283
4283
|
};
|
|
4284
4284
|
return i(n, s), s.name += "_instance_" + e.uses[t]++, s;
|
|
4285
4285
|
}
|
|
@@ -4437,19 +4437,19 @@ class Ga {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
const i = [];
|
|
4439
4439
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
4440
|
-
const a = o[0], l = Ts[s.type], c = At[s.componentType],
|
|
4440
|
+
const a = o[0], l = Ts[s.type], c = At[s.componentType], f = c.BYTES_PER_ELEMENT, u = f * l, A = s.byteOffset || 0, m = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
|
|
4441
4441
|
let h, p;
|
|
4442
4442
|
if (m && m !== u) {
|
|
4443
|
-
const
|
|
4444
|
-
let
|
|
4445
|
-
|
|
4443
|
+
const C = Math.floor(A / m), v = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + C + ":" + s.count;
|
|
4444
|
+
let w = t.cache.get(v);
|
|
4445
|
+
w || (h = new c(a, C * m, s.count * m / f), w = new ti(h, m / f), t.cache.add(v, w)), p = new si(w, l, A % m / f, b);
|
|
4446
4446
|
} else
|
|
4447
4447
|
a === null ? h = new c(s.count * l) : h = new c(a, A, s.count * l), p = new De(h, l, b);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
|
-
const
|
|
4449
|
+
const C = Ts.SCALAR, v = At[s.sparse.indices.componentType], w = s.sparse.indices.byteOffset || 0, d = s.sparse.values.byteOffset || 0, x = new v(o[1], w, s.sparse.count * C), M = new c(o[2], d, s.sparse.count * l);
|
|
4450
4450
|
a !== null && (p = new De(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
4451
|
-
for (let D = 0, E =
|
|
4452
|
-
const U =
|
|
4451
|
+
for (let D = 0, E = x.length; D < E; D++) {
|
|
4452
|
+
const U = x[D];
|
|
4453
4453
|
if (p.setX(U, M[D * l]), l >= 2 && p.setY(U, M[D * l + 1]), l >= 3 && p.setZ(U, M[D * l + 2]), l >= 4 && p.setW(U, M[D * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4454
4454
|
}
|
|
4455
4455
|
p.normalized = b;
|
|
@@ -4477,10 +4477,10 @@ class Ga {
|
|
|
4477
4477
|
const s = this, i = this.json, o = i.textures[e], a = i.images[t], l = (a.uri || a.bufferView) + ":" + o.sampler;
|
|
4478
4478
|
if (this.textureCache[l])
|
|
4479
4479
|
return this.textureCache[l];
|
|
4480
|
-
const c = this.loadImageSource(t, n).then(function(
|
|
4481
|
-
|
|
4480
|
+
const c = this.loadImageSource(t, n).then(function(f) {
|
|
4481
|
+
f.flipY = !1, f.name = o.name || a.name || "", f.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (f.name = a.uri);
|
|
4482
4482
|
const A = (i.samplers || {})[o.sampler] || {};
|
|
4483
|
-
return
|
|
4483
|
+
return f.magFilter = Sn[A.magFilter] || cs, f.minFilter = Sn[A.minFilter] || Vs, f.wrapS = Ln[A.wrapS] || it, f.wrapT = Ln[A.wrapT] || it, f.generateMipmaps = !f.isCompressedTexture && f.minFilter !== qs && f.minFilter !== cs, s.associations.set(f, { textures: e }), f;
|
|
4484
4484
|
}).catch(function() {
|
|
4485
4485
|
return null;
|
|
4486
4486
|
});
|
|
@@ -4500,7 +4500,7 @@ class Ga {
|
|
|
4500
4500
|
});
|
|
4501
4501
|
else if (o.uri === void 0)
|
|
4502
4502
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4503
|
-
const
|
|
4503
|
+
const f = Promise.resolve(l).then(function(u) {
|
|
4504
4504
|
return new Promise(function(A, m) {
|
|
4505
4505
|
let b = A;
|
|
4506
4506
|
t.isImageBitmapLoader === !0 && (b = function(h) {
|
|
@@ -4513,7 +4513,7 @@ class Ga {
|
|
|
4513
4513
|
}).catch(function(u) {
|
|
4514
4514
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
|
|
4515
4515
|
});
|
|
4516
|
-
return this.sourceCache[e] =
|
|
4516
|
+
return this.sourceCache[e] = f, f;
|
|
4517
4517
|
}
|
|
4518
4518
|
/**
|
|
4519
4519
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -4600,8 +4600,8 @@ class Ga {
|
|
|
4600
4600
|
})));
|
|
4601
4601
|
}
|
|
4602
4602
|
i.doubleSided === !0 && (a.side = Xs);
|
|
4603
|
-
const
|
|
4604
|
-
if (
|
|
4603
|
+
const f = i.alphaMode || Es.OPAQUE;
|
|
4604
|
+
if (f === Es.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, f === Es.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== nt && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new fe(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4605
4605
|
const u = i.normalTexture.scale;
|
|
4606
4606
|
a.normalScale.set(u, u);
|
|
4607
4607
|
}
|
|
@@ -4611,7 +4611,7 @@ class Ga {
|
|
|
4611
4611
|
}
|
|
4612
4612
|
return i.emissiveTexture !== void 0 && o !== nt && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, je)), Promise.all(c).then(function() {
|
|
4613
4613
|
const u = new o(a);
|
|
4614
|
-
return i.name && (u.name = i.name), He(u, i), t.associations.set(u, { materials: e }), i.extensions &&
|
|
4614
|
+
return i.name && (u.name = i.name), He(u, i), t.associations.set(u, { materials: e }), i.extensions && et(s, u, i), u;
|
|
4615
4615
|
});
|
|
4616
4616
|
}
|
|
4617
4617
|
/**
|
|
@@ -4622,7 +4622,7 @@ class Ga {
|
|
|
4622
4622
|
* @return {string}
|
|
4623
4623
|
*/
|
|
4624
4624
|
createUniqueName(e) {
|
|
4625
|
-
const t =
|
|
4625
|
+
const t = Nt.sanitizeNodeName(e || "");
|
|
4626
4626
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
4627
4627
|
}
|
|
4628
4628
|
/**
|
|
@@ -4643,12 +4643,12 @@ class Ga {
|
|
|
4643
4643
|
}
|
|
4644
4644
|
const o = [];
|
|
4645
4645
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
4646
|
-
const c = e[a],
|
|
4646
|
+
const c = e[a], f = Ua(c), u = s[f];
|
|
4647
4647
|
if (u)
|
|
4648
4648
|
o.push(u.promise);
|
|
4649
4649
|
else {
|
|
4650
4650
|
let A;
|
|
4651
|
-
c.extensions && c.extensions[Y.KHR_DRACO_MESH_COMPRESSION] ? A = i(c) : A = Nn(new rt(), c, t), s[
|
|
4651
|
+
c.extensions && c.extensions[Y.KHR_DRACO_MESH_COMPRESSION] ? A = i(c) : A = Nn(new rt(), c, t), s[f] = { primitive: c, promise: A }, o.push(A);
|
|
4652
4652
|
}
|
|
4653
4653
|
}
|
|
4654
4654
|
return Promise.all(o);
|
|
@@ -4663,28 +4663,28 @@ class Ga {
|
|
|
4663
4663
|
loadMesh(e) {
|
|
4664
4664
|
const t = this, n = this.json, s = this.extensions, i = n.meshes[e], o = i.primitives, a = [];
|
|
4665
4665
|
for (let l = 0, c = o.length; l < c; l++) {
|
|
4666
|
-
const
|
|
4667
|
-
a.push(
|
|
4666
|
+
const f = o[l].material === void 0 ? ka(this.cache) : this.getDependency("material", o[l].material);
|
|
4667
|
+
a.push(f);
|
|
4668
4668
|
}
|
|
4669
4669
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
4670
|
-
const c = l.slice(0, l.length - 1),
|
|
4671
|
-
for (let m = 0, b =
|
|
4672
|
-
const h =
|
|
4673
|
-
let
|
|
4674
|
-
const
|
|
4670
|
+
const c = l.slice(0, l.length - 1), f = l[l.length - 1], u = [];
|
|
4671
|
+
for (let m = 0, b = f.length; m < b; m++) {
|
|
4672
|
+
const h = f[m], p = o[m];
|
|
4673
|
+
let C;
|
|
4674
|
+
const v = c[m];
|
|
4675
4675
|
if (p.mode === ve.TRIANGLES || p.mode === ve.TRIANGLE_STRIP || p.mode === ve.TRIANGLE_FAN || p.mode === void 0)
|
|
4676
|
-
|
|
4676
|
+
C = i.isSkinnedMesh === !0 ? new jo(h, v) : new L(h, v), C.isSkinnedMesh === !0 && C.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? C.geometry = On(C.geometry, ei) : p.mode === ve.TRIANGLE_FAN && (C.geometry = On(C.geometry, Ns));
|
|
4677
4677
|
else if (p.mode === ve.LINES)
|
|
4678
|
-
|
|
4678
|
+
C = new Hs(h, v);
|
|
4679
4679
|
else if (p.mode === ve.LINE_STRIP)
|
|
4680
|
-
|
|
4680
|
+
C = new We(h, v);
|
|
4681
4681
|
else if (p.mode === ve.LINE_LOOP)
|
|
4682
|
-
|
|
4682
|
+
C = new Fo(h, v);
|
|
4683
4683
|
else if (p.mode === ve.POINTS)
|
|
4684
|
-
|
|
4684
|
+
C = new _t(h, v);
|
|
4685
4685
|
else
|
|
4686
4686
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
4687
|
-
Object.keys(
|
|
4687
|
+
Object.keys(C.geometry.morphAttributes).length > 0 && Fa(C, i), C.name = t.createUniqueName(i.name || "mesh_" + e), He(C, i), p.extensions && et(s, C, p), t.assignFinalMaterial(C), u.push(C);
|
|
4688
4688
|
}
|
|
4689
4689
|
for (let m = 0, b = u.length; m < b; m++)
|
|
4690
4690
|
t.associations.set(u[m], {
|
|
@@ -4692,9 +4692,9 @@ class Ga {
|
|
|
4692
4692
|
primitives: m
|
|
4693
4693
|
});
|
|
4694
4694
|
if (u.length === 1)
|
|
4695
|
-
return i.extensions &&
|
|
4696
|
-
const A = new
|
|
4697
|
-
i.extensions &&
|
|
4695
|
+
return i.extensions && et(s, u[0], i), u[0];
|
|
4696
|
+
const A = new $t();
|
|
4697
|
+
i.extensions && et(s, A, i), t.associations.set(A, { meshes: e });
|
|
4698
4698
|
for (let m = 0, b = u.length; m < b; m++)
|
|
4699
4699
|
A.add(u[m]);
|
|
4700
4700
|
return A;
|
|
@@ -4714,7 +4714,7 @@ class Ga {
|
|
|
4714
4714
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
4715
4715
|
return;
|
|
4716
4716
|
}
|
|
4717
|
-
return n.type === "perspective" ? t = new ii(
|
|
4717
|
+
return n.type === "perspective" ? t = new ii(Lt.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : n.type === "orthographic" && (t = new qn(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), n.name && (t.name = this.createUniqueName(n.name)), He(t, n), Promise.resolve(t);
|
|
4718
4718
|
}
|
|
4719
4719
|
/**
|
|
4720
4720
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -4729,7 +4729,7 @@ class Ga {
|
|
|
4729
4729
|
n.push(this._loadNodeShallow(t.joints[s]));
|
|
4730
4730
|
return t.inverseBindMatrices !== void 0 ? n.push(this.getDependency("accessor", t.inverseBindMatrices)) : n.push(null), Promise.all(n).then(function(s) {
|
|
4731
4731
|
const i = s.pop(), o = s, a = [], l = [];
|
|
4732
|
-
for (let c = 0,
|
|
4732
|
+
for (let c = 0, f = o.length; c < f; c++) {
|
|
4733
4733
|
const u = o[c];
|
|
4734
4734
|
if (u) {
|
|
4735
4735
|
a.push(u);
|
|
@@ -4749,30 +4749,30 @@ class Ga {
|
|
|
4749
4749
|
* @return {Promise<AnimationClip>}
|
|
4750
4750
|
*/
|
|
4751
4751
|
loadAnimation(e) {
|
|
4752
|
-
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [],
|
|
4752
|
+
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [], f = [];
|
|
4753
4753
|
for (let u = 0, A = s.channels.length; u < A; u++) {
|
|
4754
|
-
const m = s.channels[u], b = s.samplers[m.sampler], h = m.target, p = h.node,
|
|
4755
|
-
h.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor",
|
|
4754
|
+
const m = s.channels[u], b = s.samplers[m.sampler], h = m.target, p = h.node, C = s.parameters !== void 0 ? s.parameters[b.input] : b.input, v = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
|
|
4755
|
+
h.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", C)), l.push(this.getDependency("accessor", v)), c.push(b), f.push(h));
|
|
4756
4756
|
}
|
|
4757
4757
|
return Promise.all([
|
|
4758
4758
|
Promise.all(o),
|
|
4759
4759
|
Promise.all(a),
|
|
4760
4760
|
Promise.all(l),
|
|
4761
4761
|
Promise.all(c),
|
|
4762
|
-
Promise.all(
|
|
4762
|
+
Promise.all(f)
|
|
4763
4763
|
]).then(function(u) {
|
|
4764
|
-
const A = u[0], m = u[1], b = u[2], h = u[3], p = u[4],
|
|
4765
|
-
for (let
|
|
4766
|
-
const
|
|
4767
|
-
if (
|
|
4768
|
-
|
|
4769
|
-
const Z = n._createAnimationTracks(
|
|
4764
|
+
const A = u[0], m = u[1], b = u[2], h = u[3], p = u[4], C = [];
|
|
4765
|
+
for (let w = 0, d = A.length; w < d; w++) {
|
|
4766
|
+
const x = A[w], M = m[w], D = b[w], E = h[w], U = p[w];
|
|
4767
|
+
if (x === void 0) continue;
|
|
4768
|
+
x.updateMatrix && x.updateMatrix();
|
|
4769
|
+
const Z = n._createAnimationTracks(x, M, D, E, U);
|
|
4770
4770
|
if (Z)
|
|
4771
4771
|
for (let _ = 0; _ < Z.length; _++)
|
|
4772
|
-
|
|
4772
|
+
C.push(Z[_]);
|
|
4773
4773
|
}
|
|
4774
|
-
const
|
|
4775
|
-
return He(
|
|
4774
|
+
const v = new zo(i, void 0, C);
|
|
4775
|
+
return He(v, s), v;
|
|
4776
4776
|
});
|
|
4777
4777
|
}
|
|
4778
4778
|
createNodeMesh(e) {
|
|
@@ -4795,7 +4795,7 @@ class Ga {
|
|
|
4795
4795
|
*/
|
|
4796
4796
|
loadNode(e) {
|
|
4797
4797
|
const t = this.json, n = this, s = t.nodes[e], i = n._loadNodeShallow(e), o = [], a = s.children || [];
|
|
4798
|
-
for (let c = 0,
|
|
4798
|
+
for (let c = 0, f = a.length; c < f; c++)
|
|
4799
4799
|
o.push(n.getDependency("node", a[c]));
|
|
4800
4800
|
const l = s.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", s.skin);
|
|
4801
4801
|
return Promise.all([
|
|
@@ -4803,17 +4803,17 @@ class Ga {
|
|
|
4803
4803
|
Promise.all(o),
|
|
4804
4804
|
l
|
|
4805
4805
|
]).then(function(c) {
|
|
4806
|
-
const
|
|
4807
|
-
A !== null &&
|
|
4806
|
+
const f = c[0], u = c[1], A = c[2];
|
|
4807
|
+
A !== null && f.traverse(function(m) {
|
|
4808
4808
|
m.isSkinnedMesh && m.bind(A, Wa);
|
|
4809
4809
|
});
|
|
4810
4810
|
for (let m = 0, b = u.length; m < b; m++)
|
|
4811
|
-
|
|
4812
|
-
if (
|
|
4813
|
-
const m =
|
|
4814
|
-
|
|
4811
|
+
f.add(u[m]);
|
|
4812
|
+
if (f.userData.pivot !== void 0 && u.length > 0) {
|
|
4813
|
+
const m = f.userData.pivot, b = u[0];
|
|
4814
|
+
f.pivot = new S().fromArray(m), f.position.x -= m[0], f.position.y -= m[1], f.position.z -= m[2], b.position.set(0, 0, 0), delete f.userData.pivot;
|
|
4815
4815
|
}
|
|
4816
|
-
return
|
|
4816
|
+
return f;
|
|
4817
4817
|
});
|
|
4818
4818
|
}
|
|
4819
4819
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -4832,22 +4832,22 @@ class Ga {
|
|
|
4832
4832
|
}).forEach(function(c) {
|
|
4833
4833
|
a.push(c);
|
|
4834
4834
|
}), this.nodeCache[e] = Promise.all(a).then(function(c) {
|
|
4835
|
-
let
|
|
4836
|
-
if (i.isBone === !0 ?
|
|
4835
|
+
let f;
|
|
4836
|
+
if (i.isBone === !0 ? f = new Wo() : c.length > 1 ? f = new $t() : c.length === 1 ? f = c[0] : f = new gt(), f !== c[0])
|
|
4837
4837
|
for (let u = 0, A = c.length; u < A; u++)
|
|
4838
|
-
|
|
4839
|
-
if (i.name && (
|
|
4838
|
+
f.add(c[u]);
|
|
4839
|
+
if (i.name && (f.userData.name = i.name, f.name = o), He(f, i), i.extensions && et(n, f, i), i.matrix !== void 0) {
|
|
4840
4840
|
const u = new Ce();
|
|
4841
|
-
u.fromArray(i.matrix),
|
|
4841
|
+
u.fromArray(i.matrix), f.applyMatrix4(u);
|
|
4842
4842
|
} else
|
|
4843
|
-
i.translation !== void 0 &&
|
|
4844
|
-
if (!s.associations.has(
|
|
4845
|
-
s.associations.set(
|
|
4843
|
+
i.translation !== void 0 && f.position.fromArray(i.translation), i.rotation !== void 0 && f.quaternion.fromArray(i.rotation), i.scale !== void 0 && f.scale.fromArray(i.scale);
|
|
4844
|
+
if (!s.associations.has(f))
|
|
4845
|
+
s.associations.set(f, {});
|
|
4846
4846
|
else if (i.mesh !== void 0 && s.meshCache.refs[i.mesh] > 1) {
|
|
4847
|
-
const u = s.associations.get(
|
|
4848
|
-
s.associations.set(
|
|
4847
|
+
const u = s.associations.get(f);
|
|
4848
|
+
s.associations.set(f, { ...u });
|
|
4849
4849
|
}
|
|
4850
|
-
return s.associations.get(
|
|
4850
|
+
return s.associations.get(f).nodes = e, f;
|
|
4851
4851
|
}), this.nodeCache[e];
|
|
4852
4852
|
}
|
|
4853
4853
|
/**
|
|
@@ -4858,21 +4858,21 @@ class Ga {
|
|
|
4858
4858
|
* @return {Promise<Group>}
|
|
4859
4859
|
*/
|
|
4860
4860
|
loadScene(e) {
|
|
4861
|
-
const t = this.extensions, n = this.json.scenes[e], s = this, i = new
|
|
4862
|
-
n.name && (i.name = s.createUniqueName(n.name)), He(i, n), n.extensions &&
|
|
4861
|
+
const t = this.extensions, n = this.json.scenes[e], s = this, i = new $t();
|
|
4862
|
+
n.name && (i.name = s.createUniqueName(n.name)), He(i, n), n.extensions && et(t, i, n);
|
|
4863
4863
|
const o = n.nodes || [], a = [];
|
|
4864
4864
|
for (let l = 0, c = o.length; l < c; l++)
|
|
4865
4865
|
a.push(s.getDependency("node", o[l]));
|
|
4866
4866
|
return Promise.all(a).then(function(l) {
|
|
4867
|
-
for (let
|
|
4868
|
-
const A = l[
|
|
4867
|
+
for (let f = 0, u = l.length; f < u; f++) {
|
|
4868
|
+
const A = l[f];
|
|
4869
4869
|
A.parent !== null ? i.add(ua(A)) : i.add(A);
|
|
4870
4870
|
}
|
|
4871
|
-
const c = (
|
|
4871
|
+
const c = (f) => {
|
|
4872
4872
|
const u = /* @__PURE__ */ new Map();
|
|
4873
4873
|
for (const [A, m] of s.associations)
|
|
4874
4874
|
(A instanceof Dt || A instanceof nn) && u.set(A, m);
|
|
4875
|
-
return
|
|
4875
|
+
return f.traverse((A) => {
|
|
4876
4876
|
const m = s.associations.get(A);
|
|
4877
4877
|
m != null && u.set(A, m);
|
|
4878
4878
|
}), u;
|
|
@@ -4886,34 +4886,34 @@ class Ga {
|
|
|
4886
4886
|
m.morphTargetInfluences && l.push(m.name ? m.name : m.uuid);
|
|
4887
4887
|
}
|
|
4888
4888
|
Ve[i.path] === Ve.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
|
|
4889
|
-
let
|
|
4889
|
+
let f;
|
|
4890
4890
|
switch (Ve[i.path]) {
|
|
4891
4891
|
case Ve.weights:
|
|
4892
|
-
|
|
4892
|
+
f = rn;
|
|
4893
4893
|
break;
|
|
4894
4894
|
case Ve.rotation:
|
|
4895
|
-
|
|
4895
|
+
f = an;
|
|
4896
4896
|
break;
|
|
4897
4897
|
case Ve.translation:
|
|
4898
4898
|
case Ve.scale:
|
|
4899
|
-
|
|
4899
|
+
f = on;
|
|
4900
4900
|
break;
|
|
4901
4901
|
default:
|
|
4902
4902
|
switch (n.itemSize) {
|
|
4903
4903
|
case 1:
|
|
4904
|
-
|
|
4904
|
+
f = rn;
|
|
4905
4905
|
break;
|
|
4906
4906
|
case 2:
|
|
4907
4907
|
case 3:
|
|
4908
4908
|
default:
|
|
4909
|
-
|
|
4909
|
+
f = on;
|
|
4910
4910
|
break;
|
|
4911
4911
|
}
|
|
4912
4912
|
break;
|
|
4913
4913
|
}
|
|
4914
4914
|
const u = s.interpolation !== void 0 ? Ha[s.interpolation] : Ys, A = this._getArrayFromAccessor(n);
|
|
4915
4915
|
for (let m = 0, b = l.length; m < b; m++) {
|
|
4916
|
-
const h = new
|
|
4916
|
+
const h = new f(
|
|
4917
4917
|
l[m] + "." + Ve[i.path],
|
|
4918
4918
|
t.array,
|
|
4919
4919
|
A,
|
|
@@ -4949,8 +4949,8 @@ function Ba(r, e, t) {
|
|
|
4949
4949
|
new S(l[0], l[1], l[2]),
|
|
4950
4950
|
new S(c[0], c[1], c[2])
|
|
4951
4951
|
), a.normalized) {
|
|
4952
|
-
const
|
|
4953
|
-
s.min.multiplyScalar(
|
|
4952
|
+
const f = js(At[a.componentType]);
|
|
4953
|
+
s.min.multiplyScalar(f), s.max.multiplyScalar(f);
|
|
4954
4954
|
}
|
|
4955
4955
|
} else {
|
|
4956
4956
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -4961,7 +4961,7 @@ function Ba(r, e, t) {
|
|
|
4961
4961
|
const i = e.targets;
|
|
4962
4962
|
if (i !== void 0) {
|
|
4963
4963
|
const a = new S(), l = new S();
|
|
4964
|
-
for (let c = 0,
|
|
4964
|
+
for (let c = 0, f = i.length; c < f; c++) {
|
|
4965
4965
|
const u = i[c];
|
|
4966
4966
|
if (u.POSITION !== void 0) {
|
|
4967
4967
|
const A = t.json.accessors[u.POSITION], m = A.min, b = A.max;
|
|
@@ -5006,7 +5006,7 @@ let Fs = null;
|
|
|
5006
5006
|
function Xa(r) {
|
|
5007
5007
|
Fs = r;
|
|
5008
5008
|
}
|
|
5009
|
-
const Se =
|
|
5009
|
+
const Se = os({
|
|
5010
5010
|
scripts: []
|
|
5011
5011
|
});
|
|
5012
5012
|
function Ai() {
|
|
@@ -5063,7 +5063,7 @@ function Qa(r, e = 0) {
|
|
|
5063
5063
|
);
|
|
5064
5064
|
return n ? n[1] : `脚本${e + 1}`;
|
|
5065
5065
|
}
|
|
5066
|
-
const
|
|
5066
|
+
const I = {
|
|
5067
5067
|
/** 场景模式 */
|
|
5068
5068
|
mode: "",
|
|
5069
5069
|
/** 控制器模式 */
|
|
@@ -5087,70 +5087,70 @@ const C = {
|
|
|
5087
5087
|
/** 当前选中的物体 */
|
|
5088
5088
|
selectedObject: null
|
|
5089
5089
|
};
|
|
5090
|
-
let
|
|
5090
|
+
let ss = !1, at = !1, Ke = null;
|
|
5091
5091
|
const Ja = 16755200;
|
|
5092
|
-
let Us = [],
|
|
5092
|
+
let Us = [], Zt = [], kt = !0, ot = null, Te = null, ns = null, Ze = [];
|
|
5093
5093
|
const lt = /* @__PURE__ */ new Map();
|
|
5094
|
-
let
|
|
5094
|
+
let jt, is = null, Rt = null, Pt = null;
|
|
5095
5095
|
async function _a(r, e = "edit", t) {
|
|
5096
|
-
|
|
5096
|
+
I.container = r, I.mode = e, el(), sl(), il(), t && (await Nl(t.scene, e, t.dataPanels, t.waters, t.textures, t.ambientLight, t.scripts), t != null && t.camera && (I.defaultMainCamera = t.camera, gi(!0))), rl(), ol(), jt && I.orbitControls && (I.orbitControls.target.fromArray(jt), I.orbitControls.update()), tl(), zs(), bi(), Rt = (n) => ul(n), Pt = () => ll(), e === "edit" && r.addEventListener("click", Rt), window.addEventListener("resize", Pt), t || al(), e === "edit" && nl(), Ol();
|
|
5097
5097
|
}
|
|
5098
5098
|
function $a() {
|
|
5099
5099
|
return window.devicePixelRatio;
|
|
5100
5100
|
}
|
|
5101
5101
|
function el() {
|
|
5102
5102
|
const r = $a(), e = new R.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
5103
|
-
e.setSize(
|
|
5104
|
-
`[Renderer] css=${
|
|
5105
|
-
),
|
|
5103
|
+
e.setSize(I.container.clientWidth, I.container.clientHeight), e.setPixelRatio(r), e.toneMapping = R.NeutralToneMapping, e.toneMappingExposure = 1, console.log(
|
|
5104
|
+
`[Renderer] css=${I.container.clientWidth}×${I.container.clientHeight}, dpr=${window.devicePixelRatio}, targetRatio=${r}, antialias=true`
|
|
5105
|
+
), I.container.appendChild(e.domElement), I.renderer = e;
|
|
5106
5106
|
}
|
|
5107
5107
|
function tl() {
|
|
5108
|
-
if (!
|
|
5109
|
-
const r =
|
|
5108
|
+
if (!I.renderer || !I.scene || !I.camera) return;
|
|
5109
|
+
const r = I.renderer.getPixelRatio(), e = I.container.clientWidth * r, t = I.container.clientHeight * r, n = new R.WebGLRenderTarget(e, t, {
|
|
5110
5110
|
type: R.HalfFloatType,
|
|
5111
5111
|
samples: 4
|
|
5112
5112
|
});
|
|
5113
5113
|
n.texture.name = "EffectComposer.rt1";
|
|
5114
|
-
const s = new Ir(
|
|
5115
|
-
s.addPass(new Cr(
|
|
5114
|
+
const s = new Ir(I.renderer, n);
|
|
5115
|
+
s.addPass(new Cr(I.scene, I.camera)), s.addPass(new wr()), Ke = s;
|
|
5116
5116
|
}
|
|
5117
5117
|
function sl() {
|
|
5118
|
-
if (
|
|
5119
|
-
const r =
|
|
5120
|
-
r ? (
|
|
5118
|
+
if (I.scene = new R.Scene(), I.scene.name = "sl_scene", I.renderer) {
|
|
5119
|
+
const r = ts(I.renderer);
|
|
5120
|
+
r ? (I.scene.environment = r, I.scene.environmentIntensity = 1) : console.warn("[初始化] 环境贴图生成失败,场景将没有 IBL 间接光照");
|
|
5121
5121
|
}
|
|
5122
5122
|
}
|
|
5123
5123
|
function nl() {
|
|
5124
5124
|
const r = new R.GridHelper(30, 30, 8956671, 3364232);
|
|
5125
|
-
r.name = "地板", r.userData.type = "initFloor",
|
|
5125
|
+
r.name = "地板", r.userData.type = "initFloor", I.scene.add(r), I.gridHelper = r;
|
|
5126
5126
|
}
|
|
5127
5127
|
function il() {
|
|
5128
|
-
const r =
|
|
5129
|
-
t.position.set(0, 6, 15), t.lookAt(0, 0, 0),
|
|
5128
|
+
const r = I.container, e = r.clientWidth / r.clientHeight, t = new R.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
5129
|
+
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), I.camera = t;
|
|
5130
5130
|
}
|
|
5131
5131
|
function gi(r = !1) {
|
|
5132
|
-
if (!
|
|
5133
|
-
const e =
|
|
5132
|
+
if (!I.defaultMainCamera) return;
|
|
5133
|
+
const e = I.defaultMainCamera;
|
|
5134
5134
|
if (r) {
|
|
5135
|
-
|
|
5135
|
+
I.camera.position.set(
|
|
5136
5136
|
e.position[0],
|
|
5137
5137
|
e.position[1],
|
|
5138
5138
|
e.position[2]
|
|
5139
|
-
),
|
|
5139
|
+
), I.camera.rotation.set(
|
|
5140
5140
|
e.rotation[0],
|
|
5141
5141
|
e.rotation[1],
|
|
5142
5142
|
e.rotation[2]
|
|
5143
|
-
),
|
|
5143
|
+
), I.camera.updateProjectionMatrix(), jt = e.target;
|
|
5144
5144
|
return;
|
|
5145
5145
|
} else
|
|
5146
5146
|
Ci(""), fs();
|
|
5147
|
-
if (!
|
|
5148
|
-
const t =
|
|
5147
|
+
if (!I.camera || !I.orbitControls) return;
|
|
5148
|
+
const t = I.camera.position.clone(), n = I.orbitControls.target.clone(), s = new R.Vector3(
|
|
5149
5149
|
e.position[0],
|
|
5150
5150
|
e.position[1],
|
|
5151
5151
|
e.position[2]
|
|
5152
5152
|
), i = e.target ? new R.Vector3(e.target[0], e.target[1], e.target[2]) : new R.Vector3(0, 0, 0);
|
|
5153
|
-
|
|
5153
|
+
I.orbitControls.enabled = !1, new he.Tween({
|
|
5154
5154
|
x: t.x,
|
|
5155
5155
|
y: t.y,
|
|
5156
5156
|
z: t.z,
|
|
@@ -5167,42 +5167,42 @@ function gi(r = !1) {
|
|
|
5167
5167
|
tz: i.z
|
|
5168
5168
|
},
|
|
5169
5169
|
1e3
|
|
5170
|
-
).easing(
|
|
5171
|
-
|
|
5170
|
+
).easing(he.Easing.Quadratic.InOut).onUpdate((o) => {
|
|
5171
|
+
I.camera.position.set(o.x, o.y, o.z), I.orbitControls.target.set(o.tx, o.ty, o.tz), I.orbitControls.update();
|
|
5172
5172
|
}).onComplete(() => {
|
|
5173
|
-
|
|
5173
|
+
jt = e.target, I.orbitControls.enabled = !0;
|
|
5174
5174
|
}).start();
|
|
5175
5175
|
}
|
|
5176
5176
|
function ol() {
|
|
5177
|
-
const r = new Yo(
|
|
5177
|
+
const r = new Yo(I.camera, I.renderer.domElement);
|
|
5178
5178
|
r.minDistance = 0, r.maxDistance = 1 / 0, r.addEventListener("start", () => {
|
|
5179
|
-
|
|
5179
|
+
ss = !1;
|
|
5180
5180
|
}), r.addEventListener("change", () => {
|
|
5181
|
-
|
|
5181
|
+
ss = !0;
|
|
5182
5182
|
}), r.addEventListener("end", () => {
|
|
5183
|
-
|
|
5183
|
+
ss && (at = !0, setTimeout(() => {
|
|
5184
5184
|
at = !1;
|
|
5185
5185
|
}, 200));
|
|
5186
|
-
}),
|
|
5186
|
+
}), I.orbitControls = r;
|
|
5187
5187
|
}
|
|
5188
5188
|
function rl() {
|
|
5189
5189
|
const r = new rr(
|
|
5190
|
-
|
|
5191
|
-
|
|
5190
|
+
I.camera,
|
|
5191
|
+
I.renderer.domElement
|
|
5192
5192
|
);
|
|
5193
5193
|
r.addEventListener("dragging-changed", (e) => {
|
|
5194
|
-
|
|
5194
|
+
I.orbitControls.enabled = !e.value, e.value || (at = !0, setTimeout(() => {
|
|
5195
5195
|
at = !1;
|
|
5196
5196
|
}, 200));
|
|
5197
5197
|
}), r.addEventListener("objectChange", () => {
|
|
5198
|
-
const e =
|
|
5198
|
+
const e = I.selectedObject;
|
|
5199
5199
|
if (Te && e && Te(e), e && e.type === "DirectionalLight") {
|
|
5200
5200
|
const t = e.userData.helper;
|
|
5201
5201
|
t && t.update && t.update();
|
|
5202
5202
|
}
|
|
5203
|
-
}),
|
|
5203
|
+
}), I.scene.add(r.getHelper()), I.transformControls = r;
|
|
5204
5204
|
}
|
|
5205
|
-
function yi(r =
|
|
5205
|
+
function yi(r = I.scene) {
|
|
5206
5206
|
if (!r || r.children.some((t) => t.type === "AmbientLight")) return null;
|
|
5207
5207
|
const e = new R.AmbientLight(
|
|
5208
5208
|
Rl,
|
|
@@ -5211,18 +5211,18 @@ function yi(r = C.scene) {
|
|
|
5211
5211
|
return e.name = "环境光", r.add(e), e;
|
|
5212
5212
|
}
|
|
5213
5213
|
function al() {
|
|
5214
|
-
yi(
|
|
5214
|
+
yi(I.scene);
|
|
5215
5215
|
}
|
|
5216
5216
|
function bi() {
|
|
5217
5217
|
var e, t;
|
|
5218
|
-
|
|
5219
|
-
n.userData.isWater && n.type === "Mesh" &&
|
|
5220
|
-
}),
|
|
5221
|
-
for (let n = 0; n <
|
|
5222
|
-
const s =
|
|
5218
|
+
is = requestAnimationFrame(bi), he.update(), (e = I.orbitControls) == null || e.update(), I.mode === "run" && Ke && I.scene && I.camera ? Ke.render() : (t = I.renderer) == null || t.render(I.scene, I.camera), I.scene && I.camera && kr(I.scene, I.camera), kt && I.scene && (Zt = [], I.scene.traverse((n) => {
|
|
5219
|
+
n.userData.isWater && n.type === "Mesh" && Zt.push(n);
|
|
5220
|
+
}), kt = !1);
|
|
5221
|
+
for (let n = 0; n < Zt.length; n++) {
|
|
5222
|
+
const s = Zt[n], i = s.material;
|
|
5223
5223
|
if (i.uniforms && i.uniforms.time) {
|
|
5224
5224
|
const o = s.userData.waterTimeScale ?? 1;
|
|
5225
|
-
i.uniforms.time.value += 1 / 60 * o,
|
|
5225
|
+
i.uniforms.time.value += 1 / 60 * o, I.camera && i.uniforms.eye && i.uniforms.eye.value.copy(I.camera.position);
|
|
5226
5226
|
continue;
|
|
5227
5227
|
}
|
|
5228
5228
|
if (i.normalMap) {
|
|
@@ -5232,9 +5232,9 @@ function bi() {
|
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
5234
|
function ll() {
|
|
5235
|
-
if (!
|
|
5236
|
-
const r =
|
|
5237
|
-
r === 0 || e === 0 || (
|
|
5235
|
+
if (!I.container || !I.camera || !I.renderer) return;
|
|
5236
|
+
const r = I.container.clientWidth, e = I.container.clientHeight;
|
|
5237
|
+
r === 0 || e === 0 || (I.camera.aspect = r / e, I.camera.updateProjectionMatrix(), I.renderer.setSize(r, e), Ke && Ke.setSize(r, e), jr(r, e));
|
|
5238
5238
|
}
|
|
5239
5239
|
function ps(r) {
|
|
5240
5240
|
let e = r;
|
|
@@ -5242,7 +5242,7 @@ function ps(r) {
|
|
|
5242
5242
|
if (e.isTransformControlsRoot) return;
|
|
5243
5243
|
e = e.parent;
|
|
5244
5244
|
}
|
|
5245
|
-
|
|
5245
|
+
I.selectedObject !== r && (I.selectedObject && I.transformControls.detach(), I.selectedObject = r, I.transformControls.attach(r), I.transformControls.setMode(I.transformControlsMode), I.transformControls.showX = !0, I.transformControls.showY = !0, I.transformControls.showZ = !0, Ii(r), ot == null || ot(r));
|
|
5246
5246
|
}
|
|
5247
5247
|
let xe = null;
|
|
5248
5248
|
function cl(r) {
|
|
@@ -5252,10 +5252,10 @@ function Os(r) {
|
|
|
5252
5252
|
xe == null || xe(r);
|
|
5253
5253
|
}
|
|
5254
5254
|
function xi(r) {
|
|
5255
|
-
|
|
5255
|
+
I.transformControlsMode = r, I.transformControls && I.transformControls.setMode(I.transformControlsMode);
|
|
5256
5256
|
}
|
|
5257
5257
|
function Ii(r) {
|
|
5258
|
-
if (
|
|
5258
|
+
if (I.mode !== "edit") {
|
|
5259
5259
|
fs();
|
|
5260
5260
|
return;
|
|
5261
5261
|
}
|
|
@@ -5275,7 +5275,7 @@ function fs() {
|
|
|
5275
5275
|
Us = [];
|
|
5276
5276
|
}
|
|
5277
5277
|
function Qs() {
|
|
5278
|
-
|
|
5278
|
+
I.selectedObject && (fs(), I.transformControls.detach(), I.selectedObject = null, ot == null || ot(null));
|
|
5279
5279
|
}
|
|
5280
5280
|
function Ci(r) {
|
|
5281
5281
|
let e = null;
|
|
@@ -5285,7 +5285,7 @@ function Ci(r) {
|
|
|
5285
5285
|
});
|
|
5286
5286
|
}), e && (e.children.forEach((t) => {
|
|
5287
5287
|
t.name && t.name.startsWith("DataPanel_") && (t.visible = !0);
|
|
5288
|
-
}), Ii(e),
|
|
5288
|
+
}), Ii(e), I.selectedObject = e, setTimeout(() => {
|
|
5289
5289
|
wi(e);
|
|
5290
5290
|
}, 500));
|
|
5291
5291
|
}
|
|
@@ -5298,20 +5298,20 @@ function ul(r) {
|
|
|
5298
5298
|
e ? ps(e) : Qs();
|
|
5299
5299
|
}
|
|
5300
5300
|
function dl(r) {
|
|
5301
|
-
const e =
|
|
5301
|
+
const e = I.renderer.domElement.getBoundingClientRect(), t = new R.Vector2(
|
|
5302
5302
|
(r.clientX - e.left) / e.width * 2 - 1,
|
|
5303
5303
|
-((r.clientY - e.top) / e.height) * 2 + 1
|
|
5304
5304
|
), n = new R.Raycaster();
|
|
5305
|
-
n.setFromCamera(t,
|
|
5305
|
+
n.setFromCamera(t, I.camera);
|
|
5306
5306
|
const s = [], i = (a) => {
|
|
5307
5307
|
a.isTransformControlsRoot || a.isLine || a.isLineSegments || ((a.userData.isMovable || a.userData.type === "lightHelper") && s.push(a), a.children.forEach(i));
|
|
5308
5308
|
};
|
|
5309
|
-
i(
|
|
5309
|
+
i(I.scene);
|
|
5310
5310
|
const o = n.intersectObjects(s);
|
|
5311
5311
|
if (o.length === 0) return null;
|
|
5312
5312
|
for (const a of o) {
|
|
5313
5313
|
const l = Hn(a.object);
|
|
5314
|
-
if (l !==
|
|
5314
|
+
if (l !== I.selectedObject)
|
|
5315
5315
|
return l;
|
|
5316
5316
|
}
|
|
5317
5317
|
return Hn(o[0].object);
|
|
@@ -5340,7 +5340,7 @@ function Hn(r) {
|
|
|
5340
5340
|
return r;
|
|
5341
5341
|
}
|
|
5342
5342
|
function wi(r, e = 500) {
|
|
5343
|
-
if (!
|
|
5343
|
+
if (!I.camera || !I.orbitControls) {
|
|
5344
5344
|
console.warn(
|
|
5345
5345
|
"[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
|
|
5346
5346
|
);
|
|
@@ -5354,14 +5354,14 @@ function wi(r, e = 500) {
|
|
|
5354
5354
|
r.userData.closeUpView && typeof r.userData.closeUpView.x == "number" && typeof r.userData.closeUpView.y == "number" && typeof r.userData.closeUpView.z == "number" && (t = r.userData.closeUpView);
|
|
5355
5355
|
const n = new R.Vector3();
|
|
5356
5356
|
r.getWorldPosition(n);
|
|
5357
|
-
const i = new R.Box3().setFromObject(r).getSize(new R.Vector3()), o = Math.max(i.x, i.y, i.z) * 0.5, a = Math.max(o * 3.5, 5), l = new R.Vector3().copy(
|
|
5357
|
+
const i = new R.Box3().setFromObject(r).getSize(new R.Vector3()), o = Math.max(i.x, i.y, i.z) * 0.5, a = Math.max(o * 3.5, 5), l = new R.Vector3().copy(I.camera.position).sub(n).normalize();
|
|
5358
5358
|
l.lengthSq() < 1e-3 && l.set(0, 0, 1);
|
|
5359
|
-
const c = n.clone().add(l.multiplyScalar(a)),
|
|
5359
|
+
const c = n.clone().add(l.multiplyScalar(a)), f = I.camera.position.clone(), u = I.orbitControls.target.clone();
|
|
5360
5360
|
try {
|
|
5361
|
-
new
|
|
5362
|
-
x:
|
|
5363
|
-
y:
|
|
5364
|
-
z:
|
|
5361
|
+
new he.Tween({
|
|
5362
|
+
x: f.x,
|
|
5363
|
+
y: f.y,
|
|
5364
|
+
z: f.z,
|
|
5365
5365
|
tx: u.x,
|
|
5366
5366
|
ty: u.y,
|
|
5367
5367
|
tz: u.z
|
|
@@ -5375,8 +5375,8 @@ function wi(r, e = 500) {
|
|
|
5375
5375
|
tz: n.z
|
|
5376
5376
|
},
|
|
5377
5377
|
e
|
|
5378
|
-
).easing(
|
|
5379
|
-
|
|
5378
|
+
).easing(he.Easing.Quadratic.InOut).onUpdate((A) => {
|
|
5379
|
+
I.camera.position.set(A.x, A.y, A.z), I.orbitControls.target.set(A.tx, A.ty, A.tz), I.orbitControls.update();
|
|
5380
5380
|
}).start();
|
|
5381
5381
|
} catch (A) {
|
|
5382
5382
|
console.error(
|
|
@@ -5410,9 +5410,9 @@ function Al(r) {
|
|
|
5410
5410
|
}
|
|
5411
5411
|
function vi(r) {
|
|
5412
5412
|
var n, s;
|
|
5413
|
-
const e = (n =
|
|
5413
|
+
const e = (n = I.scene) == null ? void 0 : n.environment;
|
|
5414
5414
|
if (!e) return;
|
|
5415
|
-
const t = ((s =
|
|
5415
|
+
const t = ((s = I.scene) == null ? void 0 : s.environmentIntensity) ?? 1;
|
|
5416
5416
|
r.traverse((i) => {
|
|
5417
5417
|
if (i.isMesh) {
|
|
5418
5418
|
const o = i, a = Array.isArray(o.material) ? o.material : [o.material];
|
|
@@ -5424,30 +5424,30 @@ function vi(r) {
|
|
|
5424
5424
|
});
|
|
5425
5425
|
}
|
|
5426
5426
|
function Be(r, e = !1) {
|
|
5427
|
-
|
|
5427
|
+
I.scene.add(r), vi(r), kt = !0, r.userData.isMovable && (ml(r), As()), e && I.mode === "edit" && ps(r);
|
|
5428
5428
|
}
|
|
5429
5429
|
function Mi(r) {
|
|
5430
|
-
|
|
5430
|
+
I.selectedObject === r && Qs(), kt = !0, Al(r), hl(r), r.userData.helper && I.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : I.scene.remove(r), gl(r), As();
|
|
5431
5431
|
}
|
|
5432
5432
|
function Ti(r) {
|
|
5433
|
-
const e =
|
|
5433
|
+
const e = I.scene.getObjectByProperty("uuid", r);
|
|
5434
5434
|
e && Mi(e);
|
|
5435
5435
|
}
|
|
5436
5436
|
function ml(r) {
|
|
5437
|
-
r.userData.isMovable && r.parent ===
|
|
5437
|
+
r.userData.isMovable && r.parent === I.scene && (Ze.includes(r) || Ze.push(r));
|
|
5438
5438
|
}
|
|
5439
5439
|
function gl(r) {
|
|
5440
|
-
const e =
|
|
5441
|
-
e !== -1 &&
|
|
5440
|
+
const e = Ze.indexOf(r);
|
|
5441
|
+
e !== -1 && Ze.splice(e, 1);
|
|
5442
5442
|
}
|
|
5443
5443
|
function zs() {
|
|
5444
5444
|
const r = [];
|
|
5445
|
-
|
|
5445
|
+
I.scene.children.forEach((e) => {
|
|
5446
5446
|
e.userData.isMovable && r.push(e);
|
|
5447
|
-
}),
|
|
5447
|
+
}), Ze = r, As();
|
|
5448
5448
|
}
|
|
5449
5449
|
function As() {
|
|
5450
|
-
|
|
5450
|
+
ns == null || ns([...Ze]);
|
|
5451
5451
|
}
|
|
5452
5452
|
function yl(r) {
|
|
5453
5453
|
ot = r;
|
|
@@ -5456,41 +5456,41 @@ function bl(r) {
|
|
|
5456
5456
|
Te = r;
|
|
5457
5457
|
}
|
|
5458
5458
|
function xl(r) {
|
|
5459
|
-
|
|
5459
|
+
ns = r;
|
|
5460
5460
|
}
|
|
5461
5461
|
function Ei() {
|
|
5462
|
-
return
|
|
5462
|
+
return Ze;
|
|
5463
5463
|
}
|
|
5464
5464
|
function Ws() {
|
|
5465
|
-
return
|
|
5465
|
+
return I.selectedObject;
|
|
5466
5466
|
}
|
|
5467
5467
|
function Il(r, e, t) {
|
|
5468
|
-
if (!
|
|
5468
|
+
if (!I.scene) return;
|
|
5469
5469
|
const n = lt.get(r);
|
|
5470
5470
|
if (n) {
|
|
5471
|
-
const s =
|
|
5471
|
+
const s = Ut(n);
|
|
5472
5472
|
s && s.updateItemByCode(e, t);
|
|
5473
5473
|
}
|
|
5474
5474
|
}
|
|
5475
5475
|
function kn() {
|
|
5476
|
-
return
|
|
5476
|
+
return I.scene;
|
|
5477
5477
|
}
|
|
5478
5478
|
function Gs() {
|
|
5479
|
-
return
|
|
5479
|
+
return I.camera;
|
|
5480
5480
|
}
|
|
5481
5481
|
function jn() {
|
|
5482
|
-
return
|
|
5482
|
+
return I.renderer;
|
|
5483
5483
|
}
|
|
5484
5484
|
const Di = {
|
|
5485
|
-
linear:
|
|
5486
|
-
"quad.in":
|
|
5487
|
-
"quad.out":
|
|
5488
|
-
"quad.inout":
|
|
5489
|
-
"cubic.inout":
|
|
5490
|
-
"sine.inout":
|
|
5491
|
-
"back.out":
|
|
5492
|
-
"elastic.out":
|
|
5493
|
-
"bounce.out":
|
|
5485
|
+
linear: he.Easing.Linear.None,
|
|
5486
|
+
"quad.in": he.Easing.Quadratic.In,
|
|
5487
|
+
"quad.out": he.Easing.Quadratic.Out,
|
|
5488
|
+
"quad.inout": he.Easing.Quadratic.InOut,
|
|
5489
|
+
"cubic.inout": he.Easing.Cubic.InOut,
|
|
5490
|
+
"sine.inout": he.Easing.Sinusoidal.InOut,
|
|
5491
|
+
"back.out": he.Easing.Back.Out,
|
|
5492
|
+
"elastic.out": he.Easing.Elastic.Out,
|
|
5493
|
+
"bounce.out": he.Easing.Bounce.Out
|
|
5494
5494
|
}, Bs = /* @__PURE__ */ new WeakMap();
|
|
5495
5495
|
function Oi(r) {
|
|
5496
5496
|
let e = Bs.get(r);
|
|
@@ -5526,14 +5526,14 @@ function wl(r) {
|
|
|
5526
5526
|
function ms(r, e = {}) {
|
|
5527
5527
|
if (!r)
|
|
5528
5528
|
return console.warn("[脚本动画] 目标对象为空,无法执行动画"), null;
|
|
5529
|
-
const t = e.duration ?? 1e3, n = Di[e.easing ?? "quad.inout"] ??
|
|
5529
|
+
const t = e.duration ?? 1e3, n = Di[e.easing ?? "quad.inout"] ?? he.Easing.Quadratic.InOut, s = [], i = {};
|
|
5530
5530
|
e.position && (s.push("position"), i.position = e.position), e.rotation && (s.push("rotation"), i.rotation = e.rotation), e.scale && (s.push("scale"), i.scale = e.scale), Js(r, s);
|
|
5531
|
-
const o = new
|
|
5532
|
-
r ===
|
|
5531
|
+
const o = new he.Tween(r).to(i, t).easing(n).onUpdate(() => {
|
|
5532
|
+
r === I.selectedObject && (Te == null || Te(r));
|
|
5533
5533
|
}).start();
|
|
5534
5534
|
return Cl(r, o, s, () => {
|
|
5535
5535
|
var a;
|
|
5536
|
-
(a = e.onComplete) == null || a.call(e), r ===
|
|
5536
|
+
(a = e.onComplete) == null || a.call(e), r === I.selectedObject && (Te == null || Te(r));
|
|
5537
5537
|
}), o;
|
|
5538
5538
|
}
|
|
5539
5539
|
function vl(r, e, t = 1e3, n) {
|
|
@@ -5553,32 +5553,32 @@ function El(r, e, t = 1e3, n, s) {
|
|
|
5553
5553
|
if (r.traverse((h) => {
|
|
5554
5554
|
const p = h.material;
|
|
5555
5555
|
if (!p) return;
|
|
5556
|
-
(Array.isArray(p) ? p : [p]).forEach((
|
|
5556
|
+
(Array.isArray(p) ? p : [p]).forEach((v) => v && i.add(v));
|
|
5557
5557
|
}), i.size === 0)
|
|
5558
5558
|
return console.warn("[脚本动画] 目标及其子节点没有材质,无法执行透明度动画:", r.name), null;
|
|
5559
|
-
const o = t ?? 1e3, a = Di[n ?? "quad.inout"] ??
|
|
5559
|
+
const o = t ?? 1e3, a = Di[n ?? "quad.inout"] ?? he.Easing.Quadratic.InOut, l = Math.min(1, Math.max(0, e)), c = l <= 0.01;
|
|
5560
5560
|
c || (r.visible = !0), Js(r, ["opacity"]);
|
|
5561
|
-
const
|
|
5562
|
-
|
|
5561
|
+
const f = [...i], u = Ri;
|
|
5562
|
+
f.forEach((h) => {
|
|
5563
5563
|
const p = h.userData;
|
|
5564
5564
|
!p[u] && !h.uniforms && (p[u] = { transparent: h.transparent, opacity: h.opacity });
|
|
5565
|
-
}),
|
|
5565
|
+
}), f.forEach((h) => {
|
|
5566
5566
|
h.transparent = !0, h.needsUpdate = !0;
|
|
5567
|
-
}),
|
|
5568
|
-
const A = Oi(r), m =
|
|
5569
|
-
const p = new
|
|
5567
|
+
}), I.renderer && I.scene && I.camera && I.renderer.render(I.scene, I.camera);
|
|
5568
|
+
const A = Oi(r), m = f.map((h) => {
|
|
5569
|
+
const p = new he.Tween(h).to({ opacity: l }, o).easing(a).start();
|
|
5570
5570
|
return A.opacity.add(p), p;
|
|
5571
5571
|
}), b = () => {
|
|
5572
|
-
|
|
5572
|
+
f.forEach((h) => {
|
|
5573
5573
|
if (h.uniforms) return;
|
|
5574
|
-
const
|
|
5575
|
-
if (!
|
|
5576
|
-
!
|
|
5574
|
+
const C = h.userData[u];
|
|
5575
|
+
if (!C) return;
|
|
5576
|
+
!C.transparent && h.transparent && (h.transparent = !1, h.needsUpdate = !0);
|
|
5577
5577
|
});
|
|
5578
5578
|
};
|
|
5579
5579
|
return m.forEach((h, p) => {
|
|
5580
5580
|
p === 0 ? h.onComplete(() => {
|
|
5581
|
-
A.opacity.delete(h), !c && l >= 0.999 ? b() : c && (b(), r.visible = !1), s == null || s(), r ===
|
|
5581
|
+
A.opacity.delete(h), !c && l >= 0.999 ? b() : c && (b(), r.visible = !1), s == null || s(), r === I.selectedObject && (Te == null || Te(r));
|
|
5582
5582
|
}) : h.onComplete(() => A.opacity.delete(h)), h.onStop(() => A.opacity.delete(h));
|
|
5583
5583
|
}), m[0] ?? null;
|
|
5584
5584
|
}
|
|
@@ -5662,9 +5662,9 @@ function Ol() {
|
|
|
5662
5662
|
}
|
|
5663
5663
|
const Rl = 16777215, Pl = 1;
|
|
5664
5664
|
async function Sl() {
|
|
5665
|
-
var
|
|
5665
|
+
var d, x, M, D;
|
|
5666
5666
|
xe == null || xe(!0), await new Promise((E) => setTimeout(E, 50)), Qs();
|
|
5667
|
-
const r =
|
|
5667
|
+
const r = I.scene;
|
|
5668
5668
|
if (!r)
|
|
5669
5669
|
return xe == null || xe(!1), {
|
|
5670
5670
|
scene: new ArrayBuffer(0),
|
|
@@ -5731,7 +5731,7 @@ async function Sl() {
|
|
|
5731
5731
|
N.push({ label: Xe, value: Le, unit: ct, code: gs });
|
|
5732
5732
|
}
|
|
5733
5733
|
}), E.parent) {
|
|
5734
|
-
const G = $.element.style.width || "", ee = $.element.style.fontSize || "", X =
|
|
5734
|
+
const G = $.element.style.width || "", ee = $.element.style.fontSize || "", X = Ut(E.parent), be = X ? X.getOffsetY() : 0.1;
|
|
5735
5735
|
n.set(
|
|
5736
5736
|
E.parent.userData.id ? E.parent.userData.id : E.parent.uuid,
|
|
5737
5737
|
{
|
|
@@ -5759,7 +5759,7 @@ async function Sl() {
|
|
|
5759
5759
|
}
|
|
5760
5760
|
}
|
|
5761
5761
|
}), e.forEach((E) => r.remove(E));
|
|
5762
|
-
const c = (
|
|
5762
|
+
const c = (d = I.transformControls) == null ? void 0 : d.getHelper(), f = (c == null ? void 0 : c.parent) ?? null;
|
|
5763
5763
|
c && c.parent && c.parent.remove(c);
|
|
5764
5764
|
const u = /* @__PURE__ */ new Map();
|
|
5765
5765
|
for (const E of l)
|
|
@@ -5802,19 +5802,19 @@ async function Sl() {
|
|
|
5802
5802
|
U.userData.helper = E;
|
|
5803
5803
|
}), r.traverse((E) => {
|
|
5804
5804
|
delete E.userData._sourceUuid;
|
|
5805
|
-
}), c && (
|
|
5806
|
-
const
|
|
5807
|
-
position: (
|
|
5808
|
-
rotation: (M =
|
|
5809
|
-
target: ((D =
|
|
5810
|
-
},
|
|
5805
|
+
}), c && (f ? f.add(c) : r.add(c));
|
|
5806
|
+
const C = {
|
|
5807
|
+
position: (x = I.camera) == null ? void 0 : x.position.toArray(),
|
|
5808
|
+
rotation: (M = I.camera) == null ? void 0 : M.rotation.toArray(),
|
|
5809
|
+
target: ((D = I.orbitControls) == null ? void 0 : D.target.toArray()) || [0, 0, 0]
|
|
5810
|
+
}, v = {};
|
|
5811
5811
|
n.forEach((E, U) => {
|
|
5812
|
-
|
|
5812
|
+
v[U] = E;
|
|
5813
5813
|
});
|
|
5814
|
-
const
|
|
5814
|
+
const w = {
|
|
5815
5815
|
scene: p,
|
|
5816
|
-
camera:
|
|
5817
|
-
dataPanels:
|
|
5816
|
+
camera: C,
|
|
5817
|
+
dataPanels: v,
|
|
5818
5818
|
waters: i,
|
|
5819
5819
|
textures: s,
|
|
5820
5820
|
ambientLight: a,
|
|
@@ -5824,7 +5824,7 @@ async function Sl() {
|
|
|
5824
5824
|
code: E.code
|
|
5825
5825
|
}))
|
|
5826
5826
|
};
|
|
5827
|
-
return xe == null || xe(!1),
|
|
5827
|
+
return xe == null || xe(!1), w;
|
|
5828
5828
|
}
|
|
5829
5829
|
function Ll(r) {
|
|
5830
5830
|
if (r instanceof ArrayBuffer || ArrayBuffer.isView(r)) {
|
|
@@ -5850,52 +5850,52 @@ function Ll(r) {
|
|
|
5850
5850
|
return r && typeof r == "object" && r.type === "Buffer" && Array.isArray(r.data) ? new Uint8Array(r.data).buffer : null;
|
|
5851
5851
|
}
|
|
5852
5852
|
async function Nl(r, e = "edit", t, n, s, i, o) {
|
|
5853
|
-
var l, c,
|
|
5853
|
+
var l, c, f, u, A, m, b;
|
|
5854
5854
|
const a = Ll(r);
|
|
5855
5855
|
if (a) {
|
|
5856
|
-
const h = await new fi().parseAsync(a, ""), p = h.scene || ((l = h.scenes) == null ? void 0 : l[0]),
|
|
5857
|
-
if (
|
|
5856
|
+
const h = await new fi().parseAsync(a, ""), p = h.scene || ((l = h.scenes) == null ? void 0 : l[0]), C = (c = I.scene) == null ? void 0 : c.environment;
|
|
5857
|
+
if (I.scene = p, !p.children.some((d) => d.type === "AmbientLight"))
|
|
5858
5858
|
if (i) {
|
|
5859
|
-
const
|
|
5860
|
-
|
|
5859
|
+
const d = new R.AmbientLight(i.color, i.intensity);
|
|
5860
|
+
d.name = i.name || "环境光", d.visible = i.visible ?? !0, i.position && d.position.fromArray(i.position), p.add(d);
|
|
5861
5861
|
} else
|
|
5862
5862
|
yi(p);
|
|
5863
|
-
if (
|
|
5864
|
-
|
|
5865
|
-
else if (
|
|
5866
|
-
const
|
|
5867
|
-
|
|
5863
|
+
if (C)
|
|
5864
|
+
I.scene.environment = C, I.scene.environmentIntensity = 1;
|
|
5865
|
+
else if (I.renderer) {
|
|
5866
|
+
const d = ts(I.renderer);
|
|
5867
|
+
d && (I.scene.environment = d, I.scene.environmentIntensity = 1);
|
|
5868
5868
|
}
|
|
5869
|
-
if (!
|
|
5870
|
-
const
|
|
5871
|
-
|
|
5869
|
+
if (!I.scene.environment && I.renderer) {
|
|
5870
|
+
const d = ts(I.renderer);
|
|
5871
|
+
d ? (I.scene.environment = d, I.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5872
5872
|
}
|
|
5873
5873
|
vi(p);
|
|
5874
|
-
let
|
|
5875
|
-
for (;
|
|
5876
|
-
|
|
5877
|
-
for (let
|
|
5878
|
-
const
|
|
5879
|
-
if (
|
|
5880
|
-
|
|
5881
|
-
const M =
|
|
5882
|
-
[...
|
|
5883
|
-
|
|
5884
|
-
}), p.remove(
|
|
5874
|
+
let v = !0;
|
|
5875
|
+
for (; v; ) {
|
|
5876
|
+
v = !1;
|
|
5877
|
+
for (let d = p.children.length - 1; d >= 0; d--) {
|
|
5878
|
+
const x = p.children[d];
|
|
5879
|
+
if (x.name === "sl_scene" || x.name.startsWith("AuxScene")) {
|
|
5880
|
+
x.updateMatrixWorld();
|
|
5881
|
+
const M = x.matrixWorld.clone();
|
|
5882
|
+
[...x.children].forEach((D) => {
|
|
5883
|
+
x.remove(D), D.applyMatrix4(M), p.add(D);
|
|
5884
|
+
}), p.remove(x), v = !0;
|
|
5885
5885
|
}
|
|
5886
5886
|
}
|
|
5887
5887
|
}
|
|
5888
|
-
const
|
|
5889
|
-
if (
|
|
5888
|
+
const w = (d) => {
|
|
5889
|
+
if (d.isTransformControlsRoot || d.isLine || d.isLineSegments || d.type === "AmbientLight" || d.userData.type === "lightHelper" || d.userData.type === "initFloor")
|
|
5890
5890
|
return;
|
|
5891
|
-
(
|
|
5892
|
-
const
|
|
5893
|
-
|
|
5891
|
+
(d.isMesh || d.type === "Group" && d.parent === p) && (d.userData.isMovable = !0);
|
|
5892
|
+
const x = d.material;
|
|
5893
|
+
d.userData.isWater && x && !x.uniforms && !d.userData.waterSpeed && (d.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), d.children.forEach(w);
|
|
5894
5894
|
};
|
|
5895
|
-
|
|
5896
|
-
const
|
|
5897
|
-
if (!
|
|
5898
|
-
const M = Array.isArray(
|
|
5895
|
+
w(p), p.traverse((d) => {
|
|
5896
|
+
const x = d.material;
|
|
5897
|
+
if (!x || x.uniforms) return;
|
|
5898
|
+
const M = Array.isArray(x) ? x : [x];
|
|
5899
5899
|
for (const D of M) {
|
|
5900
5900
|
if (!D) continue;
|
|
5901
5901
|
const U = (D.userData || {})[Ri];
|
|
@@ -5909,83 +5909,83 @@ async function Nl(r, e = "edit", t, n, s, i, o) {
|
|
|
5909
5909
|
}
|
|
5910
5910
|
}), zs();
|
|
5911
5911
|
} else {
|
|
5912
|
-
const h = typeof r == "string" ? JSON.parse(r) : r,
|
|
5913
|
-
if (
|
|
5914
|
-
const
|
|
5915
|
-
if (
|
|
5916
|
-
|
|
5917
|
-
else if (
|
|
5918
|
-
const
|
|
5919
|
-
|
|
5912
|
+
const h = typeof r == "string" ? JSON.parse(r) : r, C = new R.ObjectLoader().parse(h);
|
|
5913
|
+
if (C.type === "Scene") {
|
|
5914
|
+
const v = (f = I.scene) == null ? void 0 : f.environment;
|
|
5915
|
+
if (I.scene = C, v)
|
|
5916
|
+
I.scene.environment = v, I.scene.environmentIntensity = 1;
|
|
5917
|
+
else if (I.renderer) {
|
|
5918
|
+
const w = ts(I.renderer);
|
|
5919
|
+
w && (I.scene.environment = w, I.scene.environmentIntensity = 1);
|
|
5920
5920
|
}
|
|
5921
5921
|
} else
|
|
5922
|
-
(u =
|
|
5922
|
+
(u = I.scene) == null || u.add(C);
|
|
5923
5923
|
}
|
|
5924
|
-
if (t && ((A =
|
|
5925
|
-
const p = h.userData.id || h.userData._sourceUuid || h.uuid,
|
|
5926
|
-
if (
|
|
5924
|
+
if (t && ((A = I.scene) == null || A.traverse((h) => {
|
|
5925
|
+
const p = h.userData.id || h.userData._sourceUuid || h.uuid, C = t[p];
|
|
5926
|
+
if (C && h.userData.isMovable) {
|
|
5927
5927
|
fl(h);
|
|
5928
|
-
const
|
|
5929
|
-
title:
|
|
5930
|
-
items:
|
|
5928
|
+
const v = new us({
|
|
5929
|
+
title: C.title,
|
|
5930
|
+
items: C.items
|
|
5931
5931
|
});
|
|
5932
|
-
|
|
5932
|
+
v.attachTo(h), v.visible = !1, C.width && v.setWidth(C.width), C.fontSize && v.setFontSize(C.fontSize), C.offsetY !== void 0 && v.setOffsetY(C.offsetY), C.offsetX !== void 0 && v.setOffsetX(C.offsetX), C.offsetZ !== void 0 && v.setOffsetZ(C.offsetZ), li(h, v);
|
|
5933
5933
|
}
|
|
5934
|
-
})), n && n.length > 0 && Promise.resolve().then(() => ql).then(({ addWater: h, addWaterCylinder: p, setWaterReflection:
|
|
5935
|
-
for (const
|
|
5936
|
-
const
|
|
5937
|
-
let
|
|
5938
|
-
|
|
5939
|
-
radiusTop:
|
|
5940
|
-
radiusBottom:
|
|
5941
|
-
radialSegments:
|
|
5934
|
+
})), n && n.length > 0 && Promise.resolve().then(() => ql).then(({ addWater: h, addWaterCylinder: p, setWaterReflection: C }) => {
|
|
5935
|
+
for (const v of n) {
|
|
5936
|
+
const w = v.geometryType || "box";
|
|
5937
|
+
let d;
|
|
5938
|
+
w === "cylinder" ? d = p({
|
|
5939
|
+
radiusTop: v.cylinderRadiusTop ?? 5,
|
|
5940
|
+
radiusBottom: v.cylinderRadiusBottom ?? 5,
|
|
5941
|
+
radialSegments: v.cylinderRadialSegments ?? 32,
|
|
5942
5942
|
height: 0.8,
|
|
5943
|
-
color:
|
|
5943
|
+
color: v.color,
|
|
5944
5944
|
scale: 4
|
|
5945
|
-
}) :
|
|
5946
|
-
width:
|
|
5947
|
-
height:
|
|
5948
|
-
color:
|
|
5945
|
+
}) : d = h({
|
|
5946
|
+
width: v.boxWidth ?? 10,
|
|
5947
|
+
height: v.boxDepth ?? 10,
|
|
5948
|
+
color: v.color,
|
|
5949
5949
|
scale: 4
|
|
5950
|
-
}),
|
|
5950
|
+
}), d.position.fromArray(v.position), d.rotation.set(v.rotation[0], v.rotation[1], v.rotation[2]), d.scale.fromArray(v.scale), d.name = v.name, d.userData.waterTimeScale = v.timeScale ?? 0.05, d.userData.isWater = !0, d.userData.isMovable = !0, v.alpha !== void 0 && d.material.uniforms && d.material.uniforms.alpha && (d.material.uniforms.alpha.value = v.alpha), v.reflection === !1 && C(d, !1), kt = !0;
|
|
5951
5951
|
}
|
|
5952
5952
|
zs();
|
|
5953
5953
|
}), s) {
|
|
5954
5954
|
const h = new R.TextureLoader();
|
|
5955
|
-
(m =
|
|
5955
|
+
(m = I.scene) == null || m.traverse((p) => {
|
|
5956
5956
|
if (p.type === "Mesh") {
|
|
5957
|
-
const
|
|
5958
|
-
for (const
|
|
5959
|
-
if (
|
|
5960
|
-
const
|
|
5961
|
-
if (
|
|
5962
|
-
const
|
|
5963
|
-
|
|
5957
|
+
const C = p, v = Array.isArray(C.material) ? C.material : [C.material];
|
|
5958
|
+
for (const w of v)
|
|
5959
|
+
if (w && w.uuid && s[w.uuid]) {
|
|
5960
|
+
const d = s[w.uuid];
|
|
5961
|
+
if (d.mapDataUrl) {
|
|
5962
|
+
const x = h.load(d.mapDataUrl);
|
|
5963
|
+
x.wrapS = x.wrapT = R.RepeatWrapping, x.repeat.set(1, 1), w.map = x, w.userData = w.userData || {}, w.userData._mapDataUrl = d.mapDataUrl, w.userData._mapFileName = d.mapFileName;
|
|
5964
5964
|
}
|
|
5965
|
-
if (
|
|
5966
|
-
const
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
),
|
|
5965
|
+
if (d.normalMapDataUrl) {
|
|
5966
|
+
const x = h.load(d.normalMapDataUrl);
|
|
5967
|
+
x.wrapS = x.wrapT = R.RepeatWrapping, x.repeat.set(1, 1), w.normalMap = x, w.normalScale = new R.Vector2(
|
|
5968
|
+
d.normalScale ?? 1,
|
|
5969
|
+
d.normalScale ?? 1
|
|
5970
|
+
), w.userData = w.userData || {}, w.userData._normalMapDataUrl = d.normalMapDataUrl, w.userData._normalMapFileName = d.normalMapFileName;
|
|
5971
5971
|
}
|
|
5972
|
-
if (
|
|
5973
|
-
const
|
|
5974
|
-
|
|
5972
|
+
if (d.aoMapDataUrl) {
|
|
5973
|
+
const x = h.load(d.aoMapDataUrl);
|
|
5974
|
+
x.wrapS = x.wrapT = R.RepeatWrapping, x.repeat.set(1, 1), w.aoMap = x, w.aoMapIntensity = d.aoMapIntensity ?? 1, w.userData = w.userData || {}, w.userData._aoMapDataUrl = d.aoMapDataUrl, w.userData._aoMapFileName = d.aoMapFileName;
|
|
5975
5975
|
}
|
|
5976
|
-
|
|
5976
|
+
w.needsUpdate = !0;
|
|
5977
5977
|
}
|
|
5978
5978
|
}
|
|
5979
5979
|
});
|
|
5980
5980
|
}
|
|
5981
|
-
o && Ya(o), e === "edit" && ((b =
|
|
5982
|
-
var p,
|
|
5981
|
+
o && Ya(o), e === "edit" && ((b = I.scene) == null || b.traverse((h) => {
|
|
5982
|
+
var p, C;
|
|
5983
5983
|
if (h.type === "DirectionalLight") {
|
|
5984
|
-
const
|
|
5985
|
-
if (!
|
|
5986
|
-
|
|
5987
|
-
const
|
|
5988
|
-
|
|
5984
|
+
const v = h;
|
|
5985
|
+
if (!v.userData.helper) {
|
|
5986
|
+
v.target.parent !== I.scene && (v.target.parent && v.target.parent.remove(v.target), v.target.position.set(0, 0, 0), (p = I.scene) == null || p.add(v.target));
|
|
5987
|
+
const w = new R.DirectionalLightHelper(v, 1);
|
|
5988
|
+
w.userData.type = "lightHelper", v.userData.helper = w, w.update(), (C = I.scene) == null || C.add(w);
|
|
5989
5989
|
}
|
|
5990
5990
|
}
|
|
5991
5991
|
}));
|
|
@@ -6003,9 +6003,9 @@ function Si(r) {
|
|
|
6003
6003
|
Si(t);
|
|
6004
6004
|
}
|
|
6005
6005
|
function Hl() {
|
|
6006
|
-
|
|
6006
|
+
is !== null && (cancelAnimationFrame(is), is = null), Rt && I.container && (I.container.removeEventListener("click", Rt), Rt = null), Pt && (window.removeEventListener("resize", Pt), Pt = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), Ke && (Ke.dispose(), Ke = null), I.scene && (Si(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), Fr(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "", I.defaultMainCamera = null, jt = void 0, Ze = [], lt.clear(), As(), Ka(), ss = !1, at = !1;
|
|
6007
6007
|
}
|
|
6008
|
-
const kl = /^[og]\s*(.+)?/, jl = /^mtllib /, Fl = /^usemtl /, Ul = /^usemap /, Fn = /\s+/, Un = new S(), Rs = new S(), zn = new S(), Wn = new S(), we = new S(),
|
|
6008
|
+
const kl = /^[og]\s*(.+)?/, jl = /^mtllib /, Fl = /^usemtl /, Ul = /^usemap /, Fn = /\s+/, Un = new S(), Rs = new S(), zn = new S(), Wn = new S(), we = new S(), Qt = new le();
|
|
6009
6009
|
function zl() {
|
|
6010
6010
|
const r = {
|
|
6011
6011
|
objects: [],
|
|
@@ -6134,8 +6134,8 @@ function zl() {
|
|
|
6134
6134
|
this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
|
|
6135
6135
|
},
|
|
6136
6136
|
addFace: function(e, t, n, s, i, o, a, l, c) {
|
|
6137
|
-
const
|
|
6138
|
-
let u = this.parseVertexIndex(e,
|
|
6137
|
+
const f = this.vertices.length;
|
|
6138
|
+
let u = this.parseVertexIndex(e, f), A = this.parseVertexIndex(t, f), m = this.parseVertexIndex(n, f);
|
|
6139
6139
|
if (this.addVertex(u, A, m), this.addColor(u, A, m), a !== void 0 && a !== "") {
|
|
6140
6140
|
const b = this.normals.length;
|
|
6141
6141
|
u = this.parseNormalIndex(a, b), A = this.parseNormalIndex(l, b), m = this.parseNormalIndex(c, b), this.addNormal(u, A, m);
|
|
@@ -6185,7 +6185,7 @@ class Wl extends Ks {
|
|
|
6185
6185
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
6186
6186
|
*/
|
|
6187
6187
|
load(e, t, n, s) {
|
|
6188
|
-
const i = this, o = new
|
|
6188
|
+
const i = this, o = new Ht(this.manager);
|
|
6189
6189
|
o.setPath(this.path), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, function(a) {
|
|
6190
6190
|
try {
|
|
6191
6191
|
t(i.parse(a));
|
|
@@ -6221,9 +6221,9 @@ class Wl extends Ks {
|
|
|
6221
6221
|
for (let a = 0, l = n.length; a < l; a++) {
|
|
6222
6222
|
const c = n[a].trimStart();
|
|
6223
6223
|
if (c.length === 0) continue;
|
|
6224
|
-
const
|
|
6225
|
-
if (
|
|
6226
|
-
if (
|
|
6224
|
+
const f = c.charAt(0);
|
|
6225
|
+
if (f !== "#")
|
|
6226
|
+
if (f === "v") {
|
|
6227
6227
|
const u = c.split(Fn);
|
|
6228
6228
|
switch (u[0]) {
|
|
6229
6229
|
case "v":
|
|
@@ -6231,12 +6231,12 @@ class Wl extends Ks {
|
|
|
6231
6231
|
parseFloat(u[1]),
|
|
6232
6232
|
parseFloat(u[2]),
|
|
6233
6233
|
parseFloat(u[3])
|
|
6234
|
-
), u.length >= 7 ? (
|
|
6234
|
+
), u.length >= 7 ? (Qt.setRGB(
|
|
6235
6235
|
parseFloat(u[4]),
|
|
6236
6236
|
parseFloat(u[5]),
|
|
6237
6237
|
parseFloat(u[6]),
|
|
6238
6238
|
je
|
|
6239
|
-
), t.colors.push(
|
|
6239
|
+
), t.colors.push(Qt.r, Qt.g, Qt.b)) : t.colors.push(void 0, void 0, void 0);
|
|
6240
6240
|
break;
|
|
6241
6241
|
case "vn":
|
|
6242
6242
|
t.normals.push(
|
|
@@ -6252,31 +6252,31 @@ class Wl extends Ks {
|
|
|
6252
6252
|
);
|
|
6253
6253
|
break;
|
|
6254
6254
|
}
|
|
6255
|
-
} else if (
|
|
6255
|
+
} else if (f === "f") {
|
|
6256
6256
|
const A = c.slice(1).trim().split(Fn), m = [];
|
|
6257
6257
|
for (let h = 0, p = A.length; h < p; h++) {
|
|
6258
|
-
const
|
|
6259
|
-
if (
|
|
6260
|
-
const
|
|
6261
|
-
m.push(
|
|
6258
|
+
const C = A[h];
|
|
6259
|
+
if (C.length > 0) {
|
|
6260
|
+
const v = C.split("/");
|
|
6261
|
+
m.push(v);
|
|
6262
6262
|
}
|
|
6263
6263
|
}
|
|
6264
6264
|
const b = m[0];
|
|
6265
6265
|
for (let h = 1, p = m.length - 1; h < p; h++) {
|
|
6266
|
-
const
|
|
6266
|
+
const C = m[h], v = m[h + 1];
|
|
6267
6267
|
t.addFace(
|
|
6268
6268
|
b[0],
|
|
6269
|
-
|
|
6270
|
-
|
|
6269
|
+
C[0],
|
|
6270
|
+
v[0],
|
|
6271
6271
|
b[1],
|
|
6272
|
-
|
|
6273
|
-
|
|
6272
|
+
C[1],
|
|
6273
|
+
v[1],
|
|
6274
6274
|
b[2],
|
|
6275
|
-
|
|
6276
|
-
|
|
6275
|
+
C[2],
|
|
6276
|
+
v[2]
|
|
6277
6277
|
);
|
|
6278
6278
|
}
|
|
6279
|
-
} else if (
|
|
6279
|
+
} else if (f === "l") {
|
|
6280
6280
|
const u = c.substring(1).trim().split(" ");
|
|
6281
6281
|
let A = [];
|
|
6282
6282
|
const m = [];
|
|
@@ -6288,7 +6288,7 @@ class Wl extends Ks {
|
|
|
6288
6288
|
p[0] !== "" && A.push(p[0]), p[1] !== "" && m.push(p[1]);
|
|
6289
6289
|
}
|
|
6290
6290
|
t.addLineGeometry(A, m);
|
|
6291
|
-
} else if (
|
|
6291
|
+
} else if (f === "p") {
|
|
6292
6292
|
const A = c.slice(1).trim().split(" ");
|
|
6293
6293
|
t.addPointGeometry(A);
|
|
6294
6294
|
} else if ((s = kl.exec(c)) !== null) {
|
|
@@ -6300,7 +6300,7 @@ class Wl extends Ks {
|
|
|
6300
6300
|
t.materialLibraries.push(c.substring(7).trim());
|
|
6301
6301
|
else if (Ul.test(c))
|
|
6302
6302
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
6303
|
-
else if (
|
|
6303
|
+
else if (f === "s") {
|
|
6304
6304
|
if (s = c.split(" "), s.length > 1) {
|
|
6305
6305
|
const A = s[1].trim().toLowerCase();
|
|
6306
6306
|
t.object.smooth = A !== "0" && A !== "off";
|
|
@@ -6314,20 +6314,20 @@ class Wl extends Ks {
|
|
|
6314
6314
|
}
|
|
6315
6315
|
}
|
|
6316
6316
|
t.finalize();
|
|
6317
|
-
const i = new
|
|
6317
|
+
const i = new $t();
|
|
6318
6318
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
6319
6319
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
6320
|
-
const c = t.objects[a],
|
|
6320
|
+
const c = t.objects[a], f = c.geometry, u = c.materials, A = f.type === "Line", m = f.type === "Points";
|
|
6321
6321
|
let b = !1;
|
|
6322
|
-
if (
|
|
6322
|
+
if (f.vertices.length === 0) continue;
|
|
6323
6323
|
const h = new rt();
|
|
6324
|
-
h.setAttribute("position", new ke(
|
|
6324
|
+
h.setAttribute("position", new ke(f.vertices, 3)), f.normals.length > 0 && h.setAttribute("normal", new ke(f.normals, 3)), f.colors.length > 0 && (b = !0, h.setAttribute("color", new ke(f.colors, 3))), f.hasUVIndices === !0 && h.setAttribute("uv", new ke(f.uvs, 2));
|
|
6325
6325
|
const p = [];
|
|
6326
|
-
for (let
|
|
6327
|
-
const
|
|
6328
|
-
let M = t.materials[
|
|
6326
|
+
for (let v = 0, w = u.length; v < w; v++) {
|
|
6327
|
+
const d = u[v], x = d.name + "_" + d.smooth + "_" + b;
|
|
6328
|
+
let M = t.materials[x];
|
|
6329
6329
|
if (this.materials !== null) {
|
|
6330
|
-
if (M = this.materials.create(
|
|
6330
|
+
if (M = this.materials.create(d.name), A && M && !(M instanceof Tt)) {
|
|
6331
6331
|
const D = new Tt();
|
|
6332
6332
|
Dt.prototype.copy.call(D, M), D.color.copy(M.color), M = D;
|
|
6333
6333
|
} else if (m && M && !(M instanceof Ct)) {
|
|
@@ -6335,23 +6335,23 @@ class Wl extends Ks {
|
|
|
6335
6335
|
Dt.prototype.copy.call(D, M), D.color.copy(M.color), D.map = M.map, M = D;
|
|
6336
6336
|
}
|
|
6337
6337
|
}
|
|
6338
|
-
M === void 0 && (A ? M = new Tt() : m ? M = new Ct({ size: 1, sizeAttenuation: !1 }) : M = new qo(), M.name =
|
|
6338
|
+
M === void 0 && (A ? M = new Tt() : m ? M = new Ct({ size: 1, sizeAttenuation: !1 }) : M = new qo(), M.name = d.name, M.flatShading = !d.smooth, M.vertexColors = b, t.materials[x] = M), p.push(M);
|
|
6339
6339
|
}
|
|
6340
|
-
let
|
|
6340
|
+
let C;
|
|
6341
6341
|
if (p.length > 1) {
|
|
6342
|
-
for (let
|
|
6343
|
-
const
|
|
6344
|
-
h.addGroup(
|
|
6342
|
+
for (let v = 0, w = u.length; v < w; v++) {
|
|
6343
|
+
const d = u[v];
|
|
6344
|
+
h.addGroup(d.groupStart, d.groupCount, v);
|
|
6345
6345
|
}
|
|
6346
|
-
A ?
|
|
6346
|
+
A ? C = new Hs(h, p) : m ? C = new _t(h, p) : C = new L(h, p);
|
|
6347
6347
|
} else
|
|
6348
|
-
A ?
|
|
6349
|
-
|
|
6348
|
+
A ? C = new Hs(h, p[0]) : m ? C = new _t(h, p[0]) : C = new L(h, p[0]);
|
|
6349
|
+
C.name = c.name, i.add(C);
|
|
6350
6350
|
}
|
|
6351
6351
|
else if (t.vertices.length > 0) {
|
|
6352
6352
|
const a = new Ct({ size: 1, sizeAttenuation: !1 }), l = new rt();
|
|
6353
6353
|
l.setAttribute("position", new ke(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new ke(t.colors, 3)), a.vertexColors = !0);
|
|
6354
|
-
const c = new
|
|
6354
|
+
const c = new _t(l, a);
|
|
6355
6355
|
i.add(c);
|
|
6356
6356
|
}
|
|
6357
6357
|
return i;
|
|
@@ -6415,7 +6415,7 @@ class Gl extends Ks {
|
|
|
6415
6415
|
* @param {onErrorCallback} onError - Executed when errors occur.
|
|
6416
6416
|
*/
|
|
6417
6417
|
load(e, t, n, s) {
|
|
6418
|
-
const i = new
|
|
6418
|
+
const i = new Ht(this.manager);
|
|
6419
6419
|
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, (o) => {
|
|
6420
6420
|
this.parse(o, t, s);
|
|
6421
6421
|
}, n, s);
|
|
@@ -6454,8 +6454,8 @@ class Gl extends Ks {
|
|
|
6454
6454
|
);
|
|
6455
6455
|
}
|
|
6456
6456
|
let s;
|
|
6457
|
-
const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (s = l, new Promise((c,
|
|
6458
|
-
s._callbacks[i] = { resolve: c, reject:
|
|
6457
|
+
const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (s = l, new Promise((c, f) => {
|
|
6458
|
+
s._callbacks[i] = { resolve: c, reject: f }, s.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
|
|
6459
6459
|
}))).then((l) => this._createGeometry(l.geometry));
|
|
6460
6460
|
return a.catch(() => !0).then(() => {
|
|
6461
6461
|
s && i && this._releaseTask(s, i);
|
|
@@ -6473,8 +6473,8 @@ class Gl extends Ks {
|
|
|
6473
6473
|
if (o === a)
|
|
6474
6474
|
c = new De(i, o);
|
|
6475
6475
|
else {
|
|
6476
|
-
const
|
|
6477
|
-
c = new si(
|
|
6476
|
+
const f = new ti(i, a);
|
|
6477
|
+
c = new si(f, o, 0);
|
|
6478
6478
|
}
|
|
6479
6479
|
s === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(s, c);
|
|
6480
6480
|
}
|
|
@@ -6487,7 +6487,7 @@ class Gl extends Ks {
|
|
|
6487
6487
|
n.fromBufferAttribute(e, s), ls.colorSpaceToWorking(n, je), e.setXYZ(s, n.r, n.g, n.b);
|
|
6488
6488
|
}
|
|
6489
6489
|
_loadLibrary(e, t) {
|
|
6490
|
-
const n = new
|
|
6490
|
+
const n = new Ht(this.manager);
|
|
6491
6491
|
return n.setPath(this.decoderPath), n.setResponseType(t), n.setWithCredentials(this.withCredentials), new Promise((s, i) => {
|
|
6492
6492
|
n.load(e, s, void 0, i);
|
|
6493
6493
|
});
|
|
@@ -6555,16 +6555,16 @@ function Bl() {
|
|
|
6555
6555
|
const a = o.data;
|
|
6556
6556
|
switch (a.type) {
|
|
6557
6557
|
case "init":
|
|
6558
|
-
r = a.decoderConfig, e = new Promise(function(
|
|
6558
|
+
r = a.decoderConfig, e = new Promise(function(f) {
|
|
6559
6559
|
r.onModuleLoaded = function(u) {
|
|
6560
|
-
|
|
6560
|
+
f({ draco: u });
|
|
6561
6561
|
}, DracoDecoderModule(r);
|
|
6562
6562
|
});
|
|
6563
6563
|
break;
|
|
6564
6564
|
case "decode":
|
|
6565
6565
|
const l = a.buffer, c = a.taskConfig;
|
|
6566
|
-
e.then((
|
|
6567
|
-
const u =
|
|
6566
|
+
e.then((f) => {
|
|
6567
|
+
const u = f.draco, A = new u.Decoder();
|
|
6568
6568
|
try {
|
|
6569
6569
|
const m = t(u, A, new Int8Array(l), c), b = m.attributes.map((h) => h.array.buffer);
|
|
6570
6570
|
m.index && b.push(m.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: m }, b);
|
|
@@ -6578,7 +6578,7 @@ function Bl() {
|
|
|
6578
6578
|
}
|
|
6579
6579
|
};
|
|
6580
6580
|
function t(o, a, l, c) {
|
|
6581
|
-
const
|
|
6581
|
+
const f = c.attributeIDs, u = c.attributeTypes;
|
|
6582
6582
|
let A, m;
|
|
6583
6583
|
const b = a.GetEncodedGeometryType(l);
|
|
6584
6584
|
if (b === o.TRIANGULAR_MESH)
|
|
@@ -6590,48 +6590,48 @@ function Bl() {
|
|
|
6590
6590
|
if (!m.ok() || A.ptr === 0)
|
|
6591
6591
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + m.error_msg());
|
|
6592
6592
|
const h = { index: null, attributes: [] };
|
|
6593
|
-
for (const p in
|
|
6594
|
-
const
|
|
6595
|
-
let
|
|
6593
|
+
for (const p in f) {
|
|
6594
|
+
const C = self[u[p]];
|
|
6595
|
+
let v, w;
|
|
6596
6596
|
if (c.useUniqueIDs)
|
|
6597
|
-
|
|
6597
|
+
w = f[p], v = a.GetAttributeByUniqueId(A, w);
|
|
6598
6598
|
else {
|
|
6599
|
-
if (
|
|
6600
|
-
|
|
6599
|
+
if (w = a.GetAttributeId(A, o[f[p]]), w === -1) continue;
|
|
6600
|
+
v = a.GetAttribute(A, w);
|
|
6601
6601
|
}
|
|
6602
|
-
const
|
|
6603
|
-
p === "color" && (
|
|
6602
|
+
const d = s(o, a, A, p, C, v);
|
|
6603
|
+
p === "color" && (d.vertexColorSpace = c.vertexColorSpace), h.attributes.push(d);
|
|
6604
6604
|
}
|
|
6605
6605
|
return b === o.TRIANGULAR_MESH && (h.index = n(o, a, A)), o.destroy(A), h;
|
|
6606
6606
|
}
|
|
6607
6607
|
function n(o, a, l) {
|
|
6608
|
-
const
|
|
6608
|
+
const f = l.num_faces() * 3, u = f * 4, A = o._malloc(u);
|
|
6609
6609
|
a.GetTrianglesUInt32Array(l, u, A);
|
|
6610
|
-
const m = new Uint32Array(o.HEAPF32.buffer, A,
|
|
6610
|
+
const m = new Uint32Array(o.HEAPF32.buffer, A, f).slice();
|
|
6611
6611
|
return o._free(A), { array: m, itemSize: 1 };
|
|
6612
6612
|
}
|
|
6613
|
-
function s(o, a, l, c,
|
|
6614
|
-
const A = l.num_points(), m = u.num_components(), b = i(o,
|
|
6615
|
-
a.GetAttributeDataArrayForAllPoints(l, u, b,
|
|
6616
|
-
const
|
|
6613
|
+
function s(o, a, l, c, f, u) {
|
|
6614
|
+
const A = l.num_points(), m = u.num_components(), b = i(o, f), h = m * f.BYTES_PER_ELEMENT, p = Math.ceil(h / 4) * 4, C = p / f.BYTES_PER_ELEMENT, v = A * h, w = A * p, d = o._malloc(v);
|
|
6615
|
+
a.GetAttributeDataArrayForAllPoints(l, u, b, v, d);
|
|
6616
|
+
const x = new f(o.HEAPF32.buffer, d, v / f.BYTES_PER_ELEMENT);
|
|
6617
6617
|
let M;
|
|
6618
6618
|
if (h === p)
|
|
6619
|
-
M =
|
|
6619
|
+
M = x.slice();
|
|
6620
6620
|
else {
|
|
6621
|
-
M = new
|
|
6621
|
+
M = new f(w / f.BYTES_PER_ELEMENT);
|
|
6622
6622
|
let D = 0;
|
|
6623
|
-
for (let E = 0, U =
|
|
6623
|
+
for (let E = 0, U = x.length; E < U; E++) {
|
|
6624
6624
|
for (let Z = 0; Z < m; Z++)
|
|
6625
|
-
M[D + Z] =
|
|
6626
|
-
D +=
|
|
6625
|
+
M[D + Z] = x[E * m + Z];
|
|
6626
|
+
D += C;
|
|
6627
6627
|
}
|
|
6628
6628
|
}
|
|
6629
|
-
return o._free(
|
|
6629
|
+
return o._free(d), {
|
|
6630
6630
|
name: c,
|
|
6631
6631
|
count: A,
|
|
6632
6632
|
itemSize: m,
|
|
6633
6633
|
array: M,
|
|
6634
|
-
stride:
|
|
6634
|
+
stride: C
|
|
6635
6635
|
};
|
|
6636
6636
|
}
|
|
6637
6637
|
function i(o, a) {
|
|
@@ -6662,7 +6662,7 @@ class Xl extends L {
|
|
|
6662
6662
|
*/
|
|
6663
6663
|
constructor(e, t = {}) {
|
|
6664
6664
|
super(e), this.isWater = !0;
|
|
6665
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null,
|
|
6665
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, f = t.sunDirection !== void 0 ? t.sunDirection : new S(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), A = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), m = t.eye !== void 0 ? t.eye : new S(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, h = t.side !== void 0 ? t.side : oi, p = t.fog !== void 0 ? t.fog : !1, C = new Xn(), v = new S(), w = new S(), d = new S(), x = new Ce(), M = new S(0, 0, -1), D = new ln(), E = new S(), U = new S(), Z = new ln(), _ = new Ce(), ne = new ii(), $ = new Vn(s, i, { type: Yn }), Q = {
|
|
6666
6666
|
name: "MirrorShader",
|
|
6667
6667
|
uniforms: as.merge([
|
|
6668
6668
|
cn.fog,
|
|
@@ -6794,9 +6794,9 @@ class Xl extends L {
|
|
|
6794
6794
|
side: h,
|
|
6795
6795
|
fog: p
|
|
6796
6796
|
});
|
|
6797
|
-
N.uniforms.mirrorSampler.value = $.texture, N.uniforms.textureMatrix.value = _, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = A, N.uniforms.sunDirection.value =
|
|
6798
|
-
if (
|
|
6799
|
-
E.reflect(
|
|
6797
|
+
N.uniforms.mirrorSampler.value = $.texture, N.uniforms.textureMatrix.value = _, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = A, N.uniforms.sunDirection.value = f, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = m, n.material = N, n.onBeforeRender = function(z, G, ee) {
|
|
6798
|
+
if (w.setFromMatrixPosition(n.matrixWorld), d.setFromMatrixPosition(ee.matrixWorld), x.extractRotation(n.matrixWorld), v.set(0, 0, 1), v.applyMatrix4(x), E.subVectors(w, d), E.dot(v) > 0) return;
|
|
6799
|
+
E.reflect(v).negate(), E.add(w), x.extractRotation(ee.matrixWorld), M.set(0, 0, -1), M.applyMatrix4(x), M.add(d), U.subVectors(w, M), U.reflect(v).negate(), U.add(w), ne.position.copy(E), ne.up.set(0, 1, 0), ne.up.applyMatrix4(x), ne.up.reflect(v), ne.lookAt(U), ne.far = ee.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(ee.projectionMatrix), _.set(
|
|
6800
6800
|
0.5,
|
|
6801
6801
|
0,
|
|
6802
6802
|
0,
|
|
@@ -6813,7 +6813,7 @@ class Xl extends L {
|
|
|
6813
6813
|
0,
|
|
6814
6814
|
0,
|
|
6815
6815
|
1
|
|
6816
|
-
), _.multiply(ne.projectionMatrix), _.multiply(ne.matrixWorldInverse),
|
|
6816
|
+
), _.multiply(ne.projectionMatrix), _.multiply(ne.matrixWorldInverse), C.setFromNormalAndCoplanarPoint(v, w), C.applyMatrix4(ne.matrixWorldInverse), D.set(C.normal.x, C.normal.y, C.normal.z, C.constant);
|
|
6817
6817
|
const X = ne.projectionMatrix;
|
|
6818
6818
|
Z.x = (Math.sign(D.x) + X.elements[8]) / X.elements[0], Z.y = (Math.sign(D.y) + X.elements[9]) / X.elements[5], Z.z = -1, Z.w = (1 + X.elements[10]) / X.elements[14], D.multiplyScalar(2 / D.dot(Z)), X.elements[2] = D.x, X.elements[6] = D.y, X.elements[10] = D.z + 1 - o, X.elements[14] = D.w, m.setFromMatrixPosition(ee.matrixWorld);
|
|
6819
6819
|
const be = z.getRenderTarget(), Oe = z.xr.enabled, Re = z.shadowMap.autoUpdate;
|
|
@@ -6862,8 +6862,8 @@ function Fi(r) {
|
|
|
6862
6862
|
return Ui(a, l, c, i, o, "水体(圆柱)");
|
|
6863
6863
|
}
|
|
6864
6864
|
function Ui(r, e, t, n, s, i = "水体(Water)") {
|
|
6865
|
-
const a = new R.TextureLoader().load(Li, (
|
|
6866
|
-
|
|
6865
|
+
const a = new R.TextureLoader().load(Li, (f) => {
|
|
6866
|
+
f.wrapS = f.wrapT = R.RepeatWrapping, f.repeat.set(s, s), f.generateMipmaps = !0, f.minFilter = R.LinearMipmapLinearFilter, f.magFilter = R.LinearFilter;
|
|
6867
6867
|
}), l = Math.min(1024, Math.max(256, Math.round(Math.sqrt(e * t) * 64))), c = new Xl(r, {
|
|
6868
6868
|
textureWidth: l,
|
|
6869
6869
|
textureHeight: l,
|
|
@@ -6905,7 +6905,7 @@ function Wi(r) {
|
|
|
6905
6905
|
repeatX: a = 4,
|
|
6906
6906
|
repeatY: l = 4,
|
|
6907
6907
|
speedX: c = 5e-4,
|
|
6908
|
-
speedY:
|
|
6908
|
+
speedY: f = 5e-4
|
|
6909
6909
|
} = r || {}, u = new R.PlaneGeometry(e, t), m = new R.TextureLoader().load(Li, (p) => {
|
|
6910
6910
|
p.wrapS = p.wrapT = R.RepeatWrapping, p.repeat.set(a, l), p.generateMipmaps = !1, p.minFilter = R.LinearFilter, p.magFilter = R.LinearFilter;
|
|
6911
6911
|
}), b = new R.MeshStandardMaterial({
|
|
@@ -6919,13 +6919,13 @@ function Wi(r) {
|
|
|
6919
6919
|
transparent: !0,
|
|
6920
6920
|
opacity: 0.6
|
|
6921
6921
|
}), h = new R.Mesh(u, b);
|
|
6922
|
-
h.rotation.x = -Math.PI / 2, h.position.y = 0, h.name = "水面(标准材质)", h.userData.isWater = !0, h.userData.isMovable = !0, h.userData.waterSpeed = { x: c, y:
|
|
6922
|
+
h.rotation.x = -Math.PI / 2, h.position.y = 0, h.name = "水面(标准材质)", h.userData.isWater = !0, h.userData.isMovable = !0, h.userData.waterSpeed = { x: c, y: f }, Be(h);
|
|
6923
6923
|
}
|
|
6924
6924
|
function Gi(r) {
|
|
6925
6925
|
const e = Ws();
|
|
6926
6926
|
if (!e)
|
|
6927
6927
|
return console.warn("请先选中一个模型,再添加数据面板"), null;
|
|
6928
|
-
const t =
|
|
6928
|
+
const t = Ut(e);
|
|
6929
6929
|
t && (t.dispose(), ci(e));
|
|
6930
6930
|
const n = [
|
|
6931
6931
|
{ label: "温度", value: "30", unit: "℃" },
|
|
@@ -6963,8 +6963,8 @@ function Bi(r) {
|
|
|
6963
6963
|
l.traverse((u) => {
|
|
6964
6964
|
u.userData.isMovable = !0, u.name || (u.name = u.type), u.type === "Mesh" && (u.frustumCulled = !0, u.castShadow = !0, u.receiveShadow = !0);
|
|
6965
6965
|
});
|
|
6966
|
-
const
|
|
6967
|
-
l.position.sub(
|
|
6966
|
+
const f = new R.Box3().setFromObject(l).getCenter(new R.Vector3());
|
|
6967
|
+
l.position.sub(f), Be(l, !0), Os(!1), e(l);
|
|
6968
6968
|
},
|
|
6969
6969
|
void 0,
|
|
6970
6970
|
(a) => {
|
|
@@ -7008,7 +7008,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7008
7008
|
addWater: ji,
|
|
7009
7009
|
addWaterCylinder: Fi,
|
|
7010
7010
|
addWaterPlane: Wi,
|
|
7011
|
-
getDataPanel:
|
|
7011
|
+
getDataPanel: Ut,
|
|
7012
7012
|
importModelFromFile: Bi,
|
|
7013
7013
|
removeDataPanel: ci,
|
|
7014
7014
|
setWaterReflection: zi
|
|
@@ -7018,7 +7018,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7018
7018
|
}, Yl = { class: "tree-icon" }, Kl = { class: "tree-name" }, Zl = {
|
|
7019
7019
|
key: 0,
|
|
7020
7020
|
class: "tree-children"
|
|
7021
|
-
}, Ql = /* @__PURE__ */
|
|
7021
|
+
}, Ql = /* @__PURE__ */ Qe({
|
|
7022
7022
|
__name: "TreeItem",
|
|
7023
7023
|
props: {
|
|
7024
7024
|
node: {},
|
|
@@ -7027,9 +7027,9 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7027
7027
|
},
|
|
7028
7028
|
emits: ["select", "delete"],
|
|
7029
7029
|
setup(r, { emit: e }) {
|
|
7030
|
-
const t = r, n = e, s = W(null), { expandedSet: i, toggleExpand: o } = eo("treeExpand"), a =
|
|
7030
|
+
const t = r, n = e, s = W(null), { expandedSet: i, toggleExpand: o } = eo("treeExpand"), a = st(() => i.value.has(t.node.uuid)), l = st(() => (t.version, t.node.children.some((h) => h.userData.isMovable === !0))), c = st(() => (t.version, t.node.children.filter(
|
|
7031
7031
|
(h) => h.userData.isMovable === !0
|
|
7032
|
-
))),
|
|
7032
|
+
))), f = st(
|
|
7033
7033
|
() => {
|
|
7034
7034
|
var h;
|
|
7035
7035
|
return ((h = t.selectedObject) == null ? void 0 : h.uuid) === t.node.uuid;
|
|
@@ -7037,7 +7037,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7037
7037
|
);
|
|
7038
7038
|
to(
|
|
7039
7039
|
() => {
|
|
7040
|
-
|
|
7040
|
+
f.value && s.value && s.value.scrollIntoView({
|
|
7041
7041
|
block: "nearest",
|
|
7042
7042
|
// 仅当元素不在可视区域时才滚动
|
|
7043
7043
|
behavior: "smooth"
|
|
@@ -7052,47 +7052,47 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7052
7052
|
h.stopPropagation(), n("delete", t.node);
|
|
7053
7053
|
}, m = (h) => h.type === "Mesh" || h.type === "Sprite" ? "🟦" : h.type === "Light" ? "💡" : "📦", b = (h) => h.name || `${h.type} (${h.id})`;
|
|
7054
7054
|
return (h, p) => {
|
|
7055
|
-
const
|
|
7056
|
-
return H(),
|
|
7055
|
+
const C = so("TreeItem", !0);
|
|
7056
|
+
return H(), j("div", {
|
|
7057
7057
|
class: "tree-node",
|
|
7058
7058
|
ref_key: "nodeRef",
|
|
7059
7059
|
ref: s
|
|
7060
7060
|
}, [
|
|
7061
7061
|
g("div", {
|
|
7062
|
-
class: Pe(["tree-item", { selected:
|
|
7062
|
+
class: Pe(["tree-item", { selected: f.value }]),
|
|
7063
7063
|
onClick: u
|
|
7064
7064
|
}, [
|
|
7065
|
-
l.value ? (H(),
|
|
7065
|
+
l.value ? (H(), j("span", {
|
|
7066
7066
|
key: 0,
|
|
7067
7067
|
class: "toggle-icon",
|
|
7068
|
-
onClick: p[0] || (p[0] =
|
|
7069
|
-
},
|
|
7070
|
-
g("span", Yl,
|
|
7071
|
-
g("span", Kl,
|
|
7068
|
+
onClick: p[0] || (p[0] = St((v) => rs(o)(h.node.uuid), ["stop"]))
|
|
7069
|
+
}, ue(a.value ? "▼" : "▶"), 1)) : (H(), j("span", Vl)),
|
|
7070
|
+
g("span", Yl, ue(m(h.node)), 1),
|
|
7071
|
+
g("span", Kl, ue(b(h.node)), 1),
|
|
7072
7072
|
g("button", {
|
|
7073
7073
|
class: "tree-delete",
|
|
7074
|
-
onClick:
|
|
7074
|
+
onClick: St(A, ["stop"])
|
|
7075
7075
|
}, "×")
|
|
7076
7076
|
], 2),
|
|
7077
|
-
a.value && l.value ? (H(),
|
|
7078
|
-
(H(!0),
|
|
7079
|
-
key:
|
|
7080
|
-
node:
|
|
7077
|
+
a.value && l.value ? (H(), j("div", Zl, [
|
|
7078
|
+
(H(!0), j(Ee, null, mt(c.value, (v) => (H(), Mt(C, {
|
|
7079
|
+
key: v.uuid,
|
|
7080
|
+
node: v,
|
|
7081
7081
|
"selected-object": h.selectedObject,
|
|
7082
7082
|
version: h.version,
|
|
7083
|
-
onSelect: p[1] || (p[1] = (
|
|
7084
|
-
onDelete: p[2] || (p[2] = (
|
|
7083
|
+
onSelect: p[1] || (p[1] = (w) => n("select", w)),
|
|
7084
|
+
onDelete: p[2] || (p[2] = (w) => n("delete", w))
|
|
7085
7085
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
7086
7086
|
])) : re("", !0)
|
|
7087
7087
|
], 512);
|
|
7088
7088
|
};
|
|
7089
7089
|
}
|
|
7090
|
-
}),
|
|
7090
|
+
}), Je = (r, e) => {
|
|
7091
7091
|
const t = r.__vccOpts || r;
|
|
7092
7092
|
for (const [n, s] of e)
|
|
7093
7093
|
t[n] = s;
|
|
7094
7094
|
return t;
|
|
7095
|
-
}, Jl = /* @__PURE__ */
|
|
7095
|
+
}, Jl = /* @__PURE__ */ Je(Ql, [["__scopeId", "data-v-5ad9c842"]]), _l = { class: "property-group" }, $l = { class: "row" }, ec = { class: "property-group" }, tc = { class: "row" }, sc = { class: "property-group" }, nc = { class: "row" }, ic = {
|
|
7096
7096
|
key: 0,
|
|
7097
7097
|
class: "property-group light-group"
|
|
7098
7098
|
}, oc = { class: "slider-row" }, rc = {
|
|
@@ -7131,7 +7131,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7131
7131
|
}, kc = {
|
|
7132
7132
|
key: 2,
|
|
7133
7133
|
class: "property-group water-group"
|
|
7134
|
-
}, jc = { class: "color-row" }, Fc = ["value"], Uc = ["value"], zc = { class: "slider-row" }, Wc = { class: "toggle-row" }, Gc = { class: "switch" }, Ss = "__panelOriginTransparent__", Bc = /* @__PURE__ */
|
|
7134
|
+
}, jc = { class: "color-row" }, Fc = ["value"], Uc = ["value"], zc = { class: "slider-row" }, Wc = { class: "toggle-row" }, Gc = { class: "switch" }, Ss = "__panelOriginTransparent__", Bc = /* @__PURE__ */ Qe({
|
|
7135
7135
|
__name: "TransformTab",
|
|
7136
7136
|
props: {
|
|
7137
7137
|
transform: {},
|
|
@@ -7139,7 +7139,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7139
7139
|
},
|
|
7140
7140
|
emits: ["propertyChange"],
|
|
7141
7141
|
setup(r, { emit: e }) {
|
|
7142
|
-
const t = r, n = e, s = () => n("propertyChange"), i =
|
|
7142
|
+
const t = r, n = e, s = () => n("propertyChange"), i = os({
|
|
7143
7143
|
color: 16777215,
|
|
7144
7144
|
metalness: 0,
|
|
7145
7145
|
roughness: 0.5,
|
|
@@ -7147,18 +7147,18 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7147
7147
|
normalScale: 1,
|
|
7148
7148
|
aoIntensity: 1
|
|
7149
7149
|
}), o = W("#ffffff"), a = W(!1), l = W(!1), c = W("");
|
|
7150
|
-
let
|
|
7150
|
+
let f = null;
|
|
7151
7151
|
const u = W(!1), A = W("");
|
|
7152
7152
|
let m = null;
|
|
7153
7153
|
const b = W(!1), h = W("");
|
|
7154
7154
|
let p = null;
|
|
7155
|
-
const
|
|
7155
|
+
const C = os({
|
|
7156
7156
|
intensity: 1
|
|
7157
7157
|
});
|
|
7158
|
-
function
|
|
7159
|
-
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity =
|
|
7158
|
+
function v() {
|
|
7159
|
+
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = C.intensity);
|
|
7160
7160
|
}
|
|
7161
|
-
function
|
|
7161
|
+
function w(O) {
|
|
7162
7162
|
let y = null;
|
|
7163
7163
|
return O.traverse((T) => {
|
|
7164
7164
|
if (T.type === "Mesh" && !y) {
|
|
@@ -7171,7 +7171,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7171
7171
|
}
|
|
7172
7172
|
}), y;
|
|
7173
7173
|
}
|
|
7174
|
-
function
|
|
7174
|
+
function d(O) {
|
|
7175
7175
|
let y = null;
|
|
7176
7176
|
return O.traverse((T) => {
|
|
7177
7177
|
if (T.type === "Mesh" && !y) {
|
|
@@ -7190,7 +7190,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7190
7190
|
}
|
|
7191
7191
|
}), y;
|
|
7192
7192
|
}
|
|
7193
|
-
function
|
|
7193
|
+
function x(O, y) {
|
|
7194
7194
|
let T = !1;
|
|
7195
7195
|
return O.traverse((P) => {
|
|
7196
7196
|
if (P.type === "Mesh") {
|
|
@@ -7198,8 +7198,8 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7198
7198
|
for (const q of J)
|
|
7199
7199
|
if (q && (q.type === "MeshStandardMaterial" || q.type === "MeshPhongMaterial" || q.type === "MeshBasicMaterial" || q.type === "MeshLambertMaterial" || q.type === "MeshToonMaterial" || q.type === "MeshPhysicalMaterial")) {
|
|
7200
7200
|
if (y.color !== void 0 && (q.color = new le(y.color)), y.metalness !== void 0 && (q.metalness = y.metalness), y.roughness !== void 0 && (q.roughness = y.roughness), y.opacity !== void 0) {
|
|
7201
|
-
const
|
|
7202
|
-
|
|
7201
|
+
const de = q.userData = q.userData || {};
|
|
7202
|
+
de[Ss] === void 0 && (de[Ss] = q.transparent), q.opacity = y.opacity, q.transparent = y.opacity < 1 ? !0 : de[Ss] === !0;
|
|
7203
7203
|
}
|
|
7204
7204
|
q.needsUpdate = !0, T = !0;
|
|
7205
7205
|
}
|
|
@@ -7208,7 +7208,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7208
7208
|
}
|
|
7209
7209
|
function M() {
|
|
7210
7210
|
if (t.selectedObject) {
|
|
7211
|
-
const O =
|
|
7211
|
+
const O = x(t.selectedObject, {
|
|
7212
7212
|
metalness: i.metalness,
|
|
7213
7213
|
roughness: i.roughness,
|
|
7214
7214
|
opacity: i.opacity
|
|
@@ -7220,20 +7220,20 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7220
7220
|
const T = O.target.value;
|
|
7221
7221
|
o.value = T;
|
|
7222
7222
|
const P = new le(T);
|
|
7223
|
-
i.color = P.getHex(), t.selectedObject &&
|
|
7223
|
+
i.color = P.getHex(), t.selectedObject && x(t.selectedObject, { color: P.getHex() });
|
|
7224
7224
|
}
|
|
7225
7225
|
function E(O) {
|
|
7226
7226
|
let T = O.target.value.trim();
|
|
7227
7227
|
if (T.startsWith("#") || (T = "#" + T), /^#[0-9a-fA-F]{6}$/.test(T)) {
|
|
7228
7228
|
o.value = T;
|
|
7229
7229
|
const P = new le(T);
|
|
7230
|
-
i.color = P.getHex(), t.selectedObject &&
|
|
7230
|
+
i.color = P.getHex(), t.selectedObject && x(t.selectedObject, { color: P.getHex() });
|
|
7231
7231
|
}
|
|
7232
7232
|
}
|
|
7233
7233
|
function U(O) {
|
|
7234
7234
|
var T, P;
|
|
7235
|
-
const y =
|
|
7236
|
-
y && y.normalMap ? (l.value = !0,
|
|
7235
|
+
const y = w(O);
|
|
7236
|
+
y && y.normalMap ? (l.value = !0, f = y.normalMap, c.value = ((T = y.userData) == null ? void 0 : T._normalMapFileName) || "法线贴图", i.normalScale = ((P = y.normalScale) == null ? void 0 : P.x) ?? 1) : (l.value = !1, f = null, c.value = "", i.normalScale = 1);
|
|
7237
7237
|
}
|
|
7238
7238
|
function Z(O) {
|
|
7239
7239
|
var F;
|
|
@@ -7241,20 +7241,20 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7241
7241
|
if (!T || !t.selectedObject) return;
|
|
7242
7242
|
const P = new FileReader();
|
|
7243
7243
|
P.onload = (J) => {
|
|
7244
|
-
var
|
|
7245
|
-
const q = (
|
|
7244
|
+
var de;
|
|
7245
|
+
const q = (de = J.target) == null ? void 0 : de.result;
|
|
7246
7246
|
_(t.selectedObject, q, T.name);
|
|
7247
7247
|
}, P.readAsDataURL(T), y.value = "";
|
|
7248
7248
|
}
|
|
7249
7249
|
function _(O, y, T) {
|
|
7250
|
-
const F = new
|
|
7250
|
+
const F = new Jt().load(y);
|
|
7251
7251
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), O.traverse((J) => {
|
|
7252
7252
|
if (J.type === "Mesh") {
|
|
7253
|
-
const q = J,
|
|
7254
|
-
for (const V of
|
|
7255
|
-
V && (V.type === "MeshStandardMaterial" || V.type === "MeshPhongMaterial" || V.type === "MeshToonMaterial" || V.type === "MeshPhysicalMaterial") && (V.normalMap = F, V.normalScale = new
|
|
7253
|
+
const q = J, de = Array.isArray(q.material) ? q.material : [q.material];
|
|
7254
|
+
for (const V of de)
|
|
7255
|
+
V && (V.type === "MeshStandardMaterial" || V.type === "MeshPhongMaterial" || V.type === "MeshToonMaterial" || V.type === "MeshPhysicalMaterial") && (V.normalMap = F, V.normalScale = new fe(i.normalScale, i.normalScale), V.userData = V.userData || {}, V.userData._normalMapDataUrl = y, V.userData._normalMapFileName = T, V.needsUpdate = !0);
|
|
7256
7256
|
}
|
|
7257
|
-
}),
|
|
7257
|
+
}), f = F, l.value = !0, c.value = T;
|
|
7258
7258
|
}
|
|
7259
7259
|
function ne() {
|
|
7260
7260
|
t.selectedObject && (t.selectedObject.traverse((O) => {
|
|
@@ -7263,7 +7263,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7263
7263
|
for (const P of T)
|
|
7264
7264
|
P.normalMap && (P.normalMap = null, P.userData && (delete P.userData._normalMapDataUrl, delete P.userData._normalMapFileName), P.needsUpdate = !0);
|
|
7265
7265
|
}
|
|
7266
|
-
}),
|
|
7266
|
+
}), f && (f.dispose(), f = null), l.value = !1, c.value = "");
|
|
7267
7267
|
}
|
|
7268
7268
|
function $() {
|
|
7269
7269
|
if (!t.selectedObject) return;
|
|
@@ -7272,13 +7272,13 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7272
7272
|
if (y.type === "Mesh") {
|
|
7273
7273
|
const T = y, P = Array.isArray(T.material) ? T.material : [T.material];
|
|
7274
7274
|
for (const F of P)
|
|
7275
|
-
F.normalMap && (F.normalScale = new
|
|
7275
|
+
F.normalMap && (F.normalScale = new fe(O, O), F.needsUpdate = !0);
|
|
7276
7276
|
}
|
|
7277
7277
|
});
|
|
7278
7278
|
}
|
|
7279
7279
|
function Q(O) {
|
|
7280
7280
|
var T;
|
|
7281
|
-
const y =
|
|
7281
|
+
const y = w(O);
|
|
7282
7282
|
y && y.map ? (u.value = !0, m = y.map, A.value = ((T = y.userData) == null ? void 0 : T._mapFileName) || "模型贴图") : (u.value = !1, m = null, A.value = "");
|
|
7283
7283
|
}
|
|
7284
7284
|
function N(O) {
|
|
@@ -7287,17 +7287,17 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7287
7287
|
if (!T || !t.selectedObject) return;
|
|
7288
7288
|
const P = new FileReader();
|
|
7289
7289
|
P.onload = (J) => {
|
|
7290
|
-
var
|
|
7291
|
-
const q = (
|
|
7290
|
+
var de;
|
|
7291
|
+
const q = (de = J.target) == null ? void 0 : de.result;
|
|
7292
7292
|
z(t.selectedObject, q, T.name);
|
|
7293
7293
|
}, P.readAsDataURL(T), y.value = "";
|
|
7294
7294
|
}
|
|
7295
7295
|
function z(O, y, T) {
|
|
7296
|
-
const F = new
|
|
7296
|
+
const F = new Jt().load(y);
|
|
7297
7297
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), O.traverse((J) => {
|
|
7298
7298
|
if (J.type === "Mesh") {
|
|
7299
|
-
const q = J,
|
|
7300
|
-
for (const V of
|
|
7299
|
+
const q = J, de = Array.isArray(q.material) ? q.material : [q.material];
|
|
7300
|
+
for (const V of de)
|
|
7301
7301
|
V && (V.type === "MeshStandardMaterial" || V.type === "MeshPhongMaterial" || V.type === "MeshBasicMaterial" || V.type === "MeshLambertMaterial" || V.type === "MeshToonMaterial" || V.type === "MeshPhysicalMaterial") && (V.map = F, V.userData = V.userData || {}, V.userData._mapDataUrl = y, V.userData._mapFileName = T, V.needsUpdate = !0);
|
|
7302
7302
|
}
|
|
7303
7303
|
}), m = F, u.value = !0, A.value = T;
|
|
@@ -7313,7 +7313,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7313
7313
|
}
|
|
7314
7314
|
function ee(O) {
|
|
7315
7315
|
var T;
|
|
7316
|
-
const y =
|
|
7316
|
+
const y = w(O);
|
|
7317
7317
|
y && y.aoMap ? (b.value = !0, p = y.aoMap, h.value = ((T = y.userData) == null ? void 0 : T._aoMapFileName) || "AO 贴图", i.aoIntensity = y.aoMapIntensity ?? 1) : (b.value = !1, p = null, h.value = "", i.aoIntensity = 1);
|
|
7318
7318
|
}
|
|
7319
7319
|
function X(O) {
|
|
@@ -7322,17 +7322,17 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7322
7322
|
if (!T || !t.selectedObject) return;
|
|
7323
7323
|
const P = new FileReader();
|
|
7324
7324
|
P.onload = (J) => {
|
|
7325
|
-
var
|
|
7326
|
-
const q = (
|
|
7325
|
+
var de;
|
|
7326
|
+
const q = (de = J.target) == null ? void 0 : de.result;
|
|
7327
7327
|
be(t.selectedObject, q, T.name);
|
|
7328
7328
|
}, P.readAsDataURL(T), y.value = "";
|
|
7329
7329
|
}
|
|
7330
7330
|
function be(O, y, T) {
|
|
7331
|
-
const F = new
|
|
7331
|
+
const F = new Jt().load(y);
|
|
7332
7332
|
F.wrapS = F.wrapT = it, F.repeat.set(1, 1), O.traverse((J) => {
|
|
7333
7333
|
if (J.type === "Mesh") {
|
|
7334
|
-
const q = J,
|
|
7335
|
-
for (const V of
|
|
7334
|
+
const q = J, de = Array.isArray(q.material) ? q.material : [q.material];
|
|
7335
|
+
for (const V of de)
|
|
7336
7336
|
V && (V.type === "MeshStandardMaterial" || V.type === "MeshPhongMaterial" || V.type === "MeshToonMaterial" || V.type === "MeshPhysicalMaterial") && (V.aoMap = F, V.aoMapIntensity = i.aoIntensity, V.userData = V.userData || {}, V.userData._aoMapDataUrl = y, V.userData._aoMapFileName = T, V.needsUpdate = !0);
|
|
7337
7337
|
}
|
|
7338
7338
|
}), p = F, b.value = !0, h.value = T;
|
|
@@ -7357,7 +7357,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7357
7357
|
}
|
|
7358
7358
|
});
|
|
7359
7359
|
}
|
|
7360
|
-
const Xe =
|
|
7360
|
+
const Xe = st(() => {
|
|
7361
7361
|
const O = t.selectedObject;
|
|
7362
7362
|
if (!O) return !1;
|
|
7363
7363
|
let y = !1;
|
|
@@ -7434,18 +7434,18 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7434
7434
|
() => t.selectedObject,
|
|
7435
7435
|
(O) => {
|
|
7436
7436
|
if (O) {
|
|
7437
|
-
const y =
|
|
7438
|
-
y ? (i.color = y.color, i.metalness = y.metalness, i.roughness = y.roughness, i.opacity = y.opacity, o.value = "#" + new le(y.color).getHexString(), a.value = !0) : (i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1), U(O), Q(O), ee(O), O.type === "DirectionalLight" && (
|
|
7437
|
+
const y = d(O);
|
|
7438
|
+
y ? (i.color = y.color, i.metalness = y.metalness, i.roughness = y.roughness, i.opacity = y.opacity, o.value = "#" + new le(y.color).getHexString(), a.value = !0) : (i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1), U(O), Q(O), ee(O), O.type === "DirectionalLight" && (C.intensity = O.intensity ?? 1), gs(O), qi(O), Yi(O);
|
|
7439
7439
|
} else
|
|
7440
7440
|
i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1, l.value = !1, c.value = "", u.value = !1, A.value = "", b.value = !1, h.value = "";
|
|
7441
7441
|
},
|
|
7442
7442
|
{ immediate: !0 }
|
|
7443
|
-
), (O, y) => (H(),
|
|
7443
|
+
), (O, y) => (H(), j("div", null, [
|
|
7444
7444
|
g("div", _l, [
|
|
7445
7445
|
y[22] || (y[22] = g("label", null, "位置", -1)),
|
|
7446
7446
|
g("div", $l, [
|
|
7447
7447
|
y[19] || (y[19] = g("span", null, "X:", -1)),
|
|
7448
|
-
|
|
7448
|
+
k(g("input", {
|
|
7449
7449
|
type: "number",
|
|
7450
7450
|
"onUpdate:modelValue": y[0] || (y[0] = (T) => O.transform.position.x = T),
|
|
7451
7451
|
step: "0.01",
|
|
@@ -7459,7 +7459,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7459
7459
|
]
|
|
7460
7460
|
]),
|
|
7461
7461
|
y[20] || (y[20] = g("span", null, "Y:", -1)),
|
|
7462
|
-
|
|
7462
|
+
k(g("input", {
|
|
7463
7463
|
type: "number",
|
|
7464
7464
|
"onUpdate:modelValue": y[1] || (y[1] = (T) => O.transform.position.y = T),
|
|
7465
7465
|
step: "0.01",
|
|
@@ -7473,7 +7473,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7473
7473
|
]
|
|
7474
7474
|
]),
|
|
7475
7475
|
y[21] || (y[21] = g("span", null, "Z:", -1)),
|
|
7476
|
-
|
|
7476
|
+
k(g("input", {
|
|
7477
7477
|
type: "number",
|
|
7478
7478
|
"onUpdate:modelValue": y[2] || (y[2] = (T) => O.transform.position.z = T),
|
|
7479
7479
|
step: "0.01",
|
|
@@ -7492,7 +7492,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7492
7492
|
y[26] || (y[26] = g("label", null, "旋转 (弧度)", -1)),
|
|
7493
7493
|
g("div", tc, [
|
|
7494
7494
|
y[23] || (y[23] = g("span", null, "X:", -1)),
|
|
7495
|
-
|
|
7495
|
+
k(g("input", {
|
|
7496
7496
|
type: "number",
|
|
7497
7497
|
"onUpdate:modelValue": y[3] || (y[3] = (T) => O.transform.rotation.x = T),
|
|
7498
7498
|
step: "0.01",
|
|
@@ -7506,7 +7506,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7506
7506
|
]
|
|
7507
7507
|
]),
|
|
7508
7508
|
y[24] || (y[24] = g("span", null, "Y:", -1)),
|
|
7509
|
-
|
|
7509
|
+
k(g("input", {
|
|
7510
7510
|
type: "number",
|
|
7511
7511
|
"onUpdate:modelValue": y[4] || (y[4] = (T) => O.transform.rotation.y = T),
|
|
7512
7512
|
step: "0.01",
|
|
@@ -7520,7 +7520,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7520
7520
|
]
|
|
7521
7521
|
]),
|
|
7522
7522
|
y[25] || (y[25] = g("span", null, "Z:", -1)),
|
|
7523
|
-
|
|
7523
|
+
k(g("input", {
|
|
7524
7524
|
type: "number",
|
|
7525
7525
|
"onUpdate:modelValue": y[5] || (y[5] = (T) => O.transform.rotation.z = T),
|
|
7526
7526
|
step: "0.01",
|
|
@@ -7539,7 +7539,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7539
7539
|
y[30] || (y[30] = g("label", null, "缩放", -1)),
|
|
7540
7540
|
g("div", nc, [
|
|
7541
7541
|
y[27] || (y[27] = g("span", null, "X:", -1)),
|
|
7542
|
-
|
|
7542
|
+
k(g("input", {
|
|
7543
7543
|
type: "number",
|
|
7544
7544
|
"onUpdate:modelValue": y[6] || (y[6] = (T) => O.transform.scale.x = T),
|
|
7545
7545
|
step: "0.01",
|
|
@@ -7553,7 +7553,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7553
7553
|
]
|
|
7554
7554
|
]),
|
|
7555
7555
|
y[28] || (y[28] = g("span", null, "Y:", -1)),
|
|
7556
|
-
|
|
7556
|
+
k(g("input", {
|
|
7557
7557
|
type: "number",
|
|
7558
7558
|
"onUpdate:modelValue": y[7] || (y[7] = (T) => O.transform.scale.y = T),
|
|
7559
7559
|
step: "0.01",
|
|
@@ -7567,7 +7567,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7567
7567
|
]
|
|
7568
7568
|
]),
|
|
7569
7569
|
y[29] || (y[29] = g("span", null, "Z:", -1)),
|
|
7570
|
-
|
|
7570
|
+
k(g("input", {
|
|
7571
7571
|
type: "number",
|
|
7572
7572
|
"onUpdate:modelValue": y[8] || (y[8] = (T) => O.transform.scale.z = T),
|
|
7573
7573
|
step: "0.01",
|
|
@@ -7582,44 +7582,44 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7582
7582
|
])
|
|
7583
7583
|
])
|
|
7584
7584
|
]),
|
|
7585
|
-
O.selectedObject && O.selectedObject.type === "DirectionalLight" ? (H(),
|
|
7585
|
+
O.selectedObject && O.selectedObject.type === "DirectionalLight" ? (H(), j("div", ic, [
|
|
7586
7586
|
y[32] || (y[32] = g("label", null, "光源属性", -1)),
|
|
7587
7587
|
g("div", oc, [
|
|
7588
7588
|
y[31] || (y[31] = g("span", { class: "slider-label" }, "强度", -1)),
|
|
7589
|
-
|
|
7589
|
+
k(g("input", {
|
|
7590
7590
|
type: "range",
|
|
7591
7591
|
min: "0",
|
|
7592
7592
|
max: "10",
|
|
7593
7593
|
step: "0.1",
|
|
7594
|
-
"onUpdate:modelValue": y[9] || (y[9] = (T) =>
|
|
7595
|
-
onInput:
|
|
7594
|
+
"onUpdate:modelValue": y[9] || (y[9] = (T) => C.intensity = T),
|
|
7595
|
+
onInput: v
|
|
7596
7596
|
}, null, 544), [
|
|
7597
7597
|
[
|
|
7598
7598
|
B,
|
|
7599
|
-
|
|
7599
|
+
C.intensity,
|
|
7600
7600
|
void 0,
|
|
7601
7601
|
{ number: !0 }
|
|
7602
7602
|
]
|
|
7603
7603
|
]),
|
|
7604
|
-
|
|
7604
|
+
k(g("input", {
|
|
7605
7605
|
type: "number",
|
|
7606
7606
|
min: "0",
|
|
7607
7607
|
max: "100",
|
|
7608
7608
|
step: "0.1",
|
|
7609
|
-
"onUpdate:modelValue": y[10] || (y[10] = (T) =>
|
|
7609
|
+
"onUpdate:modelValue": y[10] || (y[10] = (T) => C.intensity = T),
|
|
7610
7610
|
class: "intensity-input",
|
|
7611
|
-
onInput:
|
|
7611
|
+
onInput: v
|
|
7612
7612
|
}, null, 544), [
|
|
7613
7613
|
[
|
|
7614
7614
|
B,
|
|
7615
|
-
|
|
7615
|
+
C.intensity,
|
|
7616
7616
|
void 0,
|
|
7617
7617
|
{ number: !0 }
|
|
7618
7618
|
]
|
|
7619
7619
|
])
|
|
7620
7620
|
])
|
|
7621
7621
|
])) : re("", !0),
|
|
7622
|
-
O.selectedObject ? (H(),
|
|
7622
|
+
O.selectedObject ? (H(), j("div", rc, [
|
|
7623
7623
|
y[48] || (y[48] = g("label", null, "材质", -1)),
|
|
7624
7624
|
g("div", ac, [
|
|
7625
7625
|
y[33] || (y[33] = g("span", { class: "slider-label" }, "颜色", -1)),
|
|
@@ -7639,7 +7639,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7639
7639
|
]),
|
|
7640
7640
|
g("div", uc, [
|
|
7641
7641
|
y[34] || (y[34] = g("span", { class: "slider-label" }, "金属度", -1)),
|
|
7642
|
-
|
|
7642
|
+
k(g("input", {
|
|
7643
7643
|
type: "range",
|
|
7644
7644
|
min: "0",
|
|
7645
7645
|
max: "1",
|
|
@@ -7654,11 +7654,11 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7654
7654
|
{ number: !0 }
|
|
7655
7655
|
]
|
|
7656
7656
|
]),
|
|
7657
|
-
g("span", dc,
|
|
7657
|
+
g("span", dc, ue(i.metalness.toFixed(2)), 1)
|
|
7658
7658
|
]),
|
|
7659
7659
|
g("div", fc, [
|
|
7660
7660
|
y[35] || (y[35] = g("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
7661
|
-
|
|
7661
|
+
k(g("input", {
|
|
7662
7662
|
type: "range",
|
|
7663
7663
|
min: "0",
|
|
7664
7664
|
max: "1",
|
|
@@ -7673,11 +7673,11 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7673
7673
|
{ number: !0 }
|
|
7674
7674
|
]
|
|
7675
7675
|
]),
|
|
7676
|
-
g("span", hc,
|
|
7676
|
+
g("span", hc, ue(i.roughness.toFixed(2)), 1)
|
|
7677
7677
|
]),
|
|
7678
7678
|
g("div", pc, [
|
|
7679
7679
|
y[36] || (y[36] = g("span", { class: "slider-label" }, "透明度", -1)),
|
|
7680
|
-
|
|
7680
|
+
k(g("input", {
|
|
7681
7681
|
type: "range",
|
|
7682
7682
|
min: "0",
|
|
7683
7683
|
max: "1",
|
|
@@ -7692,12 +7692,12 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7692
7692
|
{ number: !0 }
|
|
7693
7693
|
]
|
|
7694
7694
|
]),
|
|
7695
|
-
g("span", Ac,
|
|
7695
|
+
g("span", Ac, ue(i.opacity.toFixed(2)), 1)
|
|
7696
7696
|
]),
|
|
7697
7697
|
g("div", mc, [
|
|
7698
7698
|
y[39] || (y[39] = g("span", { class: "slider-label" }, "法线贴图", -1)),
|
|
7699
7699
|
g("div", gc, [
|
|
7700
|
-
l.value ? (H(),
|
|
7700
|
+
l.value ? (H(), j(Ee, { key: 1 }, [
|
|
7701
7701
|
g("label", bc, [
|
|
7702
7702
|
g("input", {
|
|
7703
7703
|
type: "file",
|
|
@@ -7705,7 +7705,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7705
7705
|
onChange: Z,
|
|
7706
7706
|
class: "texture-file-input"
|
|
7707
7707
|
}, null, 32),
|
|
7708
|
-
g("span", xc,
|
|
7708
|
+
g("span", xc, ue(c.value), 1),
|
|
7709
7709
|
y[38] || (y[38] = g("span", { class: "modify-hint" }, "修改", -1))
|
|
7710
7710
|
]),
|
|
7711
7711
|
g("button", {
|
|
@@ -7713,7 +7713,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7713
7713
|
title: "移除法线贴图",
|
|
7714
7714
|
onClick: ne
|
|
7715
7715
|
}, " ✕ ")
|
|
7716
|
-
], 64)) : (H(),
|
|
7716
|
+
], 64)) : (H(), j("label", yc, [
|
|
7717
7717
|
g("input", {
|
|
7718
7718
|
type: "file",
|
|
7719
7719
|
accept: "image/*",
|
|
@@ -7724,9 +7724,9 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7724
7724
|
]))
|
|
7725
7725
|
])
|
|
7726
7726
|
]),
|
|
7727
|
-
l.value ? (H(),
|
|
7727
|
+
l.value ? (H(), j("div", Ic, [
|
|
7728
7728
|
y[40] || (y[40] = g("span", { class: "slider-label" }, "法线强度", -1)),
|
|
7729
|
-
|
|
7729
|
+
k(g("input", {
|
|
7730
7730
|
type: "range",
|
|
7731
7731
|
min: "0",
|
|
7732
7732
|
max: "5",
|
|
@@ -7741,12 +7741,12 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7741
7741
|
{ number: !0 }
|
|
7742
7742
|
]
|
|
7743
7743
|
]),
|
|
7744
|
-
g("span", Cc,
|
|
7744
|
+
g("span", Cc, ue(i.normalScale.toFixed(2)), 1)
|
|
7745
7745
|
])) : re("", !0),
|
|
7746
7746
|
g("div", wc, [
|
|
7747
7747
|
y[43] || (y[43] = g("span", { class: "slider-label" }, "AO 贴图", -1)),
|
|
7748
7748
|
g("div", vc, [
|
|
7749
|
-
b.value ? (H(),
|
|
7749
|
+
b.value ? (H(), j(Ee, { key: 1 }, [
|
|
7750
7750
|
g("label", Tc, [
|
|
7751
7751
|
g("input", {
|
|
7752
7752
|
type: "file",
|
|
@@ -7754,7 +7754,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7754
7754
|
onChange: X,
|
|
7755
7755
|
class: "texture-file-input"
|
|
7756
7756
|
}, null, 32),
|
|
7757
|
-
g("span", Ec,
|
|
7757
|
+
g("span", Ec, ue(h.value), 1),
|
|
7758
7758
|
y[42] || (y[42] = g("span", { class: "modify-hint" }, "修改", -1))
|
|
7759
7759
|
]),
|
|
7760
7760
|
g("button", {
|
|
@@ -7762,7 +7762,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7762
7762
|
title: "移除 AO 贴图",
|
|
7763
7763
|
onClick: Oe
|
|
7764
7764
|
}, " ✕ ")
|
|
7765
|
-
], 64)) : (H(),
|
|
7765
|
+
], 64)) : (H(), j("label", Mc, [
|
|
7766
7766
|
g("input", {
|
|
7767
7767
|
type: "file",
|
|
7768
7768
|
accept: "image/*",
|
|
@@ -7773,9 +7773,9 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7773
7773
|
]))
|
|
7774
7774
|
])
|
|
7775
7775
|
]),
|
|
7776
|
-
b.value ? (H(),
|
|
7776
|
+
b.value ? (H(), j("div", Dc, [
|
|
7777
7777
|
y[44] || (y[44] = g("span", { class: "slider-label" }, "AO 强度", -1)),
|
|
7778
|
-
|
|
7778
|
+
k(g("input", {
|
|
7779
7779
|
type: "range",
|
|
7780
7780
|
min: "0",
|
|
7781
7781
|
max: "1",
|
|
@@ -7790,12 +7790,12 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7790
7790
|
{ number: !0 }
|
|
7791
7791
|
]
|
|
7792
7792
|
]),
|
|
7793
|
-
g("span", Oc,
|
|
7793
|
+
g("span", Oc, ue(i.aoIntensity.toFixed(2)), 1)
|
|
7794
7794
|
])) : re("", !0),
|
|
7795
7795
|
g("div", Rc, [
|
|
7796
7796
|
y[47] || (y[47] = g("span", { class: "slider-label" }, "模型贴图", -1)),
|
|
7797
7797
|
g("div", Pc, [
|
|
7798
|
-
u.value ? (H(),
|
|
7798
|
+
u.value ? (H(), j(Ee, { key: 1 }, [
|
|
7799
7799
|
g("label", Lc, [
|
|
7800
7800
|
g("input", {
|
|
7801
7801
|
type: "file",
|
|
@@ -7803,7 +7803,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7803
7803
|
onChange: N,
|
|
7804
7804
|
class: "texture-file-input"
|
|
7805
7805
|
}, null, 32),
|
|
7806
|
-
g("span", Nc,
|
|
7806
|
+
g("span", Nc, ue(A.value), 1),
|
|
7807
7807
|
y[46] || (y[46] = g("span", { class: "modify-hint" }, "修改", -1))
|
|
7808
7808
|
]),
|
|
7809
7809
|
g("button", {
|
|
@@ -7811,7 +7811,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7811
7811
|
title: "移除模型贴图",
|
|
7812
7812
|
onClick: G
|
|
7813
7813
|
}, " ✕ ")
|
|
7814
|
-
], 64)) : (H(),
|
|
7814
|
+
], 64)) : (H(), j("label", Sc, [
|
|
7815
7815
|
g("input", {
|
|
7816
7816
|
type: "file",
|
|
7817
7817
|
accept: "image/*",
|
|
@@ -7822,9 +7822,9 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7822
7822
|
]))
|
|
7823
7823
|
])
|
|
7824
7824
|
]),
|
|
7825
|
-
a.value ? re("", !0) : (H(),
|
|
7825
|
+
a.value ? re("", !0) : (H(), j("div", Hc, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
7826
7826
|
])) : re("", !0),
|
|
7827
|
-
Xe.value ? (H(),
|
|
7827
|
+
Xe.value ? (H(), j("div", kc, [
|
|
7828
7828
|
y[54] || (y[54] = g("label", null, "水体属性", -1)),
|
|
7829
7829
|
g("div", jc, [
|
|
7830
7830
|
y[49] || (y[49] = g("span", { class: "slider-label" }, "水体颜色", -1)),
|
|
@@ -7844,7 +7844,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7844
7844
|
]),
|
|
7845
7845
|
g("div", zc, [
|
|
7846
7846
|
y[50] || (y[50] = g("span", { class: "slider-label" }, "浑浊度", -1)),
|
|
7847
|
-
|
|
7847
|
+
k(g("input", {
|
|
7848
7848
|
type: "range",
|
|
7849
7849
|
min: "0",
|
|
7850
7850
|
max: "1",
|
|
@@ -7859,7 +7859,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7859
7859
|
{ number: !0 }
|
|
7860
7860
|
]
|
|
7861
7861
|
]),
|
|
7862
|
-
|
|
7862
|
+
k(g("input", {
|
|
7863
7863
|
type: "number",
|
|
7864
7864
|
min: "0",
|
|
7865
7865
|
max: "1",
|
|
@@ -7879,7 +7879,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7879
7879
|
g("div", Wc, [
|
|
7880
7880
|
y[52] || (y[52] = g("span", { class: "slider-label" }, "实时反射", -1)),
|
|
7881
7881
|
g("label", Gc, [
|
|
7882
|
-
|
|
7882
|
+
k(g("input", {
|
|
7883
7883
|
type: "checkbox",
|
|
7884
7884
|
"onUpdate:modelValue": y[18] || (y[18] = (T) => ct.value = T),
|
|
7885
7885
|
onChange: Zi
|
|
@@ -7894,7 +7894,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7894
7894
|
])) : re("", !0)
|
|
7895
7895
|
]));
|
|
7896
7896
|
}
|
|
7897
|
-
}), Xc = /* @__PURE__ */
|
|
7897
|
+
}), Xc = /* @__PURE__ */ Je(Bc, [["__scopeId", "data-v-fab33ce4"]]), qc = { class: "userdata-tab" }, Vc = { class: "property-group userdata-group" }, Yc = { class: "userdata-add-row" }, Kc = ["onKeyup"], Zc = {
|
|
7898
7898
|
key: 0,
|
|
7899
7899
|
class: "userdata-list"
|
|
7900
7900
|
}, Qc = { class: "ud-key" }, Jc = {
|
|
@@ -7907,139 +7907,139 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7907
7907
|
}, tu = { class: "ud-json-actions" }, su = ["onClick"], nu = ["onClick"], iu = {
|
|
7908
7908
|
key: 1,
|
|
7909
7909
|
class: "userdata-empty"
|
|
7910
|
-
}, ou = /* @__PURE__ */
|
|
7910
|
+
}, ou = /* @__PURE__ */ Qe({
|
|
7911
7911
|
__name: "UserDataTab",
|
|
7912
7912
|
props: {
|
|
7913
7913
|
selectedObject: {}
|
|
7914
7914
|
},
|
|
7915
7915
|
setup(r) {
|
|
7916
7916
|
const e = r, t = W(""), n = W(""), s = W(null), i = W(""), o = W(null), a = W([]);
|
|
7917
|
-
function l(
|
|
7918
|
-
if (
|
|
7919
|
-
if (
|
|
7920
|
-
if (Array.isArray(
|
|
7921
|
-
const
|
|
7922
|
-
return
|
|
7923
|
-
}
|
|
7924
|
-
function c(
|
|
7925
|
-
const
|
|
7926
|
-
if (
|
|
7927
|
-
for (const [
|
|
7928
|
-
typeof
|
|
7929
|
-
key:
|
|
7917
|
+
function l(w) {
|
|
7918
|
+
if (w === null) return "null";
|
|
7919
|
+
if (w === void 0) return "undefined";
|
|
7920
|
+
if (Array.isArray(w)) return "array";
|
|
7921
|
+
const d = typeof w;
|
|
7922
|
+
return d === "object" ? "object" : d === "number" ? "number" : d === "boolean" ? "boolean" : "string";
|
|
7923
|
+
}
|
|
7924
|
+
function c(w) {
|
|
7925
|
+
const d = [];
|
|
7926
|
+
if (w.userData)
|
|
7927
|
+
for (const [x, M] of Object.entries(w.userData))
|
|
7928
|
+
typeof x == "string" && !x.startsWith("_") && d.push({
|
|
7929
|
+
key: x,
|
|
7930
7930
|
value: typeof M == "object" ? JSON.stringify(M) : String(M),
|
|
7931
7931
|
rawType: l(M)
|
|
7932
7932
|
});
|
|
7933
|
-
a.value =
|
|
7934
|
-
}
|
|
7935
|
-
function
|
|
7936
|
-
const
|
|
7937
|
-
if (
|
|
7938
|
-
if (
|
|
7939
|
-
if (
|
|
7940
|
-
if (
|
|
7941
|
-
const
|
|
7942
|
-
if (
|
|
7943
|
-
return String(
|
|
7944
|
-
if (
|
|
7933
|
+
a.value = d;
|
|
7934
|
+
}
|
|
7935
|
+
function f(w) {
|
|
7936
|
+
const d = w.trim();
|
|
7937
|
+
if (d === "true") return !0;
|
|
7938
|
+
if (d === "false") return !1;
|
|
7939
|
+
if (d === "null") return null;
|
|
7940
|
+
if (d === "undefined") return;
|
|
7941
|
+
const x = Number(d);
|
|
7942
|
+
if (d !== "" && !isNaN(x))
|
|
7943
|
+
return String(x) !== d ? d : x;
|
|
7944
|
+
if (d.startsWith("{") && d.endsWith("}") || d.startsWith("[") && d.endsWith("]"))
|
|
7945
7945
|
try {
|
|
7946
|
-
return JSON.parse(
|
|
7946
|
+
return JSON.parse(d);
|
|
7947
7947
|
} catch {
|
|
7948
7948
|
}
|
|
7949
|
-
return
|
|
7949
|
+
return d;
|
|
7950
7950
|
}
|
|
7951
7951
|
function u() {
|
|
7952
7952
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
7953
|
-
const
|
|
7954
|
-
if (
|
|
7953
|
+
const w = t.value.trim();
|
|
7954
|
+
if (w === "isMovable") {
|
|
7955
7955
|
t.value = "";
|
|
7956
7956
|
return;
|
|
7957
7957
|
}
|
|
7958
|
-
const
|
|
7959
|
-
e.selectedObject.userData[
|
|
7958
|
+
const d = f(n.value);
|
|
7959
|
+
e.selectedObject.userData[w] = d, c(e.selectedObject), t.value = "", n.value = "";
|
|
7960
7960
|
}
|
|
7961
|
-
function A(
|
|
7962
|
-
e.selectedObject && (delete e.selectedObject.userData[
|
|
7961
|
+
function A(w, d) {
|
|
7962
|
+
e.selectedObject && (delete e.selectedObject.userData[w], c(e.selectedObject));
|
|
7963
7963
|
}
|
|
7964
|
-
function m(
|
|
7965
|
-
return
|
|
7964
|
+
function m(w) {
|
|
7965
|
+
return w.length <= 28 ? w : w.substring(0, 28) + "…";
|
|
7966
7966
|
}
|
|
7967
|
-
function b(
|
|
7968
|
-
s.value =
|
|
7969
|
-
const
|
|
7970
|
-
if (!
|
|
7971
|
-
const
|
|
7967
|
+
function b(w) {
|
|
7968
|
+
s.value = w;
|
|
7969
|
+
const d = e.selectedObject;
|
|
7970
|
+
if (!d) return;
|
|
7971
|
+
const x = d.userData[w];
|
|
7972
7972
|
try {
|
|
7973
|
-
i.value = JSON.stringify(
|
|
7973
|
+
i.value = JSON.stringify(x, null, 2);
|
|
7974
7974
|
} catch {
|
|
7975
|
-
i.value = String(
|
|
7975
|
+
i.value = String(x);
|
|
7976
7976
|
}
|
|
7977
7977
|
h();
|
|
7978
7978
|
}
|
|
7979
7979
|
function h() {
|
|
7980
|
-
const
|
|
7981
|
-
if (!
|
|
7980
|
+
const w = i.value.trim();
|
|
7981
|
+
if (!w) {
|
|
7982
7982
|
o.value = null;
|
|
7983
7983
|
return;
|
|
7984
7984
|
}
|
|
7985
|
-
if (!
|
|
7985
|
+
if (!w.startsWith("{") && !w.startsWith("[")) {
|
|
7986
7986
|
o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
|
|
7987
7987
|
return;
|
|
7988
7988
|
}
|
|
7989
7989
|
try {
|
|
7990
|
-
JSON.parse(
|
|
7991
|
-
} catch (
|
|
7992
|
-
o.value = "JSON 格式错误:" +
|
|
7990
|
+
JSON.parse(w), o.value = null;
|
|
7991
|
+
} catch (d) {
|
|
7992
|
+
o.value = "JSON 格式错误:" + d.message;
|
|
7993
7993
|
}
|
|
7994
7994
|
}
|
|
7995
|
-
function p(
|
|
7996
|
-
const
|
|
7997
|
-
if (!
|
|
7998
|
-
const
|
|
7995
|
+
function p(w) {
|
|
7996
|
+
const d = e.selectedObject;
|
|
7997
|
+
if (!d) return;
|
|
7998
|
+
const x = i.value.trim();
|
|
7999
7999
|
try {
|
|
8000
|
-
const M = JSON.parse(
|
|
8001
|
-
|
|
8000
|
+
const M = JSON.parse(x);
|
|
8001
|
+
d.userData[w] = M, c(d), s.value = null, i.value = "";
|
|
8002
8002
|
} catch {
|
|
8003
|
-
|
|
8003
|
+
d.userData[w] = x, c(d), s.value = null, i.value = "";
|
|
8004
8004
|
}
|
|
8005
8005
|
}
|
|
8006
|
-
function
|
|
8006
|
+
function C() {
|
|
8007
8007
|
s.value = null, i.value = "";
|
|
8008
8008
|
}
|
|
8009
|
-
function
|
|
8010
|
-
const
|
|
8011
|
-
if (!
|
|
8012
|
-
const
|
|
8013
|
-
|
|
8014
|
-
x:
|
|
8015
|
-
y:
|
|
8016
|
-
z:
|
|
8017
|
-
}, c(
|
|
8009
|
+
function v() {
|
|
8010
|
+
const w = e.selectedObject;
|
|
8011
|
+
if (!w) return;
|
|
8012
|
+
const d = Gs();
|
|
8013
|
+
d && (w.userData.closeUpView = {
|
|
8014
|
+
x: d.position.x,
|
|
8015
|
+
y: d.position.y,
|
|
8016
|
+
z: d.position.z
|
|
8017
|
+
}, c(w));
|
|
8018
8018
|
}
|
|
8019
8019
|
return Me(
|
|
8020
8020
|
() => e.selectedObject,
|
|
8021
|
-
(
|
|
8022
|
-
|
|
8021
|
+
(w) => {
|
|
8022
|
+
w ? c(w) : a.value = [], s.value = null, i.value = "";
|
|
8023
8023
|
},
|
|
8024
8024
|
{ immediate: !0 }
|
|
8025
|
-
), (
|
|
8025
|
+
), (w, d) => (H(), j("div", qc, [
|
|
8026
8026
|
g("div", Vc, [
|
|
8027
|
-
|
|
8027
|
+
d[3] || (d[3] = g("label", null, "userData 属性", -1)),
|
|
8028
8028
|
g("div", Yc, [
|
|
8029
|
-
|
|
8029
|
+
k(g("input", {
|
|
8030
8030
|
type: "text",
|
|
8031
|
-
"onUpdate:modelValue":
|
|
8031
|
+
"onUpdate:modelValue": d[0] || (d[0] = (x) => t.value = x),
|
|
8032
8032
|
placeholder: "属性名",
|
|
8033
8033
|
class: "ud-input",
|
|
8034
8034
|
onKeyup: dt(u, ["enter"])
|
|
8035
8035
|
}, null, 544), [
|
|
8036
8036
|
[B, t.value]
|
|
8037
8037
|
]),
|
|
8038
|
-
|
|
8039
|
-
"onUpdate:modelValue":
|
|
8038
|
+
k(g("textarea", {
|
|
8039
|
+
"onUpdate:modelValue": d[1] || (d[1] = (x) => n.value = x),
|
|
8040
8040
|
placeholder: "值",
|
|
8041
8041
|
class: "ud-input ud-textarea",
|
|
8042
|
-
onKeyup: dt(
|
|
8042
|
+
onKeyup: dt(St(u, ["prevent"]), ["enter"])
|
|
8043
8043
|
}, null, 40, Kc), [
|
|
8044
8044
|
[B, n.value]
|
|
8045
8045
|
]),
|
|
@@ -8049,27 +8049,27 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8049
8049
|
onClick: u
|
|
8050
8050
|
}, " + ")
|
|
8051
8051
|
]),
|
|
8052
|
-
a.value.length > 0 ? (H(),
|
|
8053
|
-
(H(!0),
|
|
8054
|
-
key:
|
|
8052
|
+
a.value.length > 0 ? (H(), j("div", Zc, [
|
|
8053
|
+
(H(!0), j(Ee, null, mt(a.value, (x, M) => (H(), j("div", {
|
|
8054
|
+
key: x.key,
|
|
8055
8055
|
class: Pe(["userdata-item", {
|
|
8056
|
-
readonly:
|
|
8057
|
-
"editing-json": s.value ===
|
|
8056
|
+
readonly: x.key === "isMovable",
|
|
8057
|
+
"editing-json": s.value === x.key
|
|
8058
8058
|
}])
|
|
8059
8059
|
}, [
|
|
8060
|
-
g("span", Qc,
|
|
8061
|
-
|
|
8062
|
-
s.value !==
|
|
8063
|
-
g("span", _c,
|
|
8060
|
+
g("span", Qc, ue(x.key), 1),
|
|
8061
|
+
x.key === "isMovable" ? (H(), j("span", Jc, ue(String(x.value)) + " 🔒 ", 1)) : x.key !== "isMovable" ? (H(), j(Ee, { key: 1 }, [
|
|
8062
|
+
s.value !== x.key ? (H(), j(Ee, { key: 0 }, [
|
|
8063
|
+
g("span", _c, ue(m(x.value)), 1),
|
|
8064
8064
|
g("button", {
|
|
8065
8065
|
class: "ud-btn edit-json-btn",
|
|
8066
8066
|
title: "编辑对象",
|
|
8067
|
-
onClick: (D) => b(
|
|
8067
|
+
onClick: (D) => b(x.key)
|
|
8068
8068
|
}, " ✎ ", 8, $c)
|
|
8069
|
-
], 64)) : (H(),
|
|
8070
|
-
o.value ? (H(),
|
|
8071
|
-
|
|
8072
|
-
"onUpdate:modelValue":
|
|
8069
|
+
], 64)) : (H(), j(Ee, { key: 1 }, [
|
|
8070
|
+
o.value ? (H(), j("div", eu, " ⚠ " + ue(o.value), 1)) : re("", !0),
|
|
8071
|
+
k(g("textarea", {
|
|
8072
|
+
"onUpdate:modelValue": d[2] || (d[2] = (D) => i.value = D),
|
|
8073
8073
|
class: Pe(["ud-json-textarea", { "has-error": o.value }]),
|
|
8074
8074
|
rows: "3",
|
|
8075
8075
|
onInput: h
|
|
@@ -8080,120 +8080,120 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8080
8080
|
g("button", {
|
|
8081
8081
|
class: "ud-btn apply-btn",
|
|
8082
8082
|
title: "应用修改",
|
|
8083
|
-
onClick: (D) => p(
|
|
8083
|
+
onClick: (D) => p(x.key)
|
|
8084
8084
|
}, " ✓ ", 8, su),
|
|
8085
8085
|
g("button", {
|
|
8086
8086
|
class: "ud-btn cancel-btn",
|
|
8087
8087
|
title: "取消编辑",
|
|
8088
|
-
onClick:
|
|
8088
|
+
onClick: C
|
|
8089
8089
|
}, " ✕ ")
|
|
8090
8090
|
])
|
|
8091
8091
|
], 64)),
|
|
8092
|
-
s.value !==
|
|
8092
|
+
s.value !== x.key ? (H(), j("button", {
|
|
8093
8093
|
key: 2,
|
|
8094
8094
|
class: "ud-btn del-btn",
|
|
8095
8095
|
title: "删除",
|
|
8096
|
-
onClick: (D) => A(
|
|
8096
|
+
onClick: (D) => A(x.key)
|
|
8097
8097
|
}, " ✕ ", 8, nu)) : re("", !0)
|
|
8098
8098
|
], 64)) : re("", !0)
|
|
8099
8099
|
], 2))), 128))
|
|
8100
|
-
])) : (H(),
|
|
8100
|
+
])) : (H(), j("div", iu, "暂无自定义数据")),
|
|
8101
8101
|
g("button", {
|
|
8102
8102
|
class: "get-camera-btn",
|
|
8103
|
-
onClick:
|
|
8103
|
+
onClick: v
|
|
8104
8104
|
}, " 添加当前相机位置 ")
|
|
8105
8105
|
])
|
|
8106
8106
|
]));
|
|
8107
8107
|
}
|
|
8108
|
-
}), ru = /* @__PURE__ */
|
|
8108
|
+
}), ru = /* @__PURE__ */ Je(ou, [["__scopeId", "data-v-4e117415"]]), au = { class: "datapanel-tab" }, lu = { class: "property-group" }, cu = { class: "dp-section" }, uu = { class: "dp-visibility-row" }, du = { class: "dp-toggle" }, fu = { class: "dp-visibility-text" }, hu = { class: "dp-section" }, pu = { class: "dp-section" }, Au = { class: "dp-size-row" }, mu = { class: "dp-size-value" }, gu = { class: "dp-section" }, yu = { class: "dp-size-row" }, bu = { class: "dp-section" }, xu = { class: "dp-size-row" }, Iu = { class: "dp-section" }, Cu = { class: "dp-size-row" }, wu = { class: "dp-section" }, vu = { class: "dp-list" }, Mu = ["onUpdate:modelValue"], Tu = ["onUpdate:modelValue"], Eu = ["onUpdate:modelValue"], Du = ["onUpdate:modelValue"], Ou = ["onClick"], Ru = { class: "dp-add-row" }, Pu = /* @__PURE__ */ Qe({
|
|
8109
8109
|
__name: "DataPanelTab",
|
|
8110
8110
|
props: {
|
|
8111
8111
|
selectedObject: {}
|
|
8112
8112
|
},
|
|
8113
8113
|
setup(r) {
|
|
8114
|
-
const e = r, t = W(""), n = W([]), s = W(!0), i = W(0.1), o = W(0), a = W(0), l = W(20), c = W(""),
|
|
8114
|
+
const e = r, t = W(""), n = W([]), s = W(!0), i = W(0.1), o = W(0), a = W(0), l = W(20), c = W(""), f = W(""), u = W(""), A = W("");
|
|
8115
8115
|
let m = h(), b = !1;
|
|
8116
8116
|
function h() {
|
|
8117
|
-
const
|
|
8118
|
-
return
|
|
8119
|
-
}
|
|
8120
|
-
Me(s, (
|
|
8121
|
-
b || !m || (m.visible =
|
|
8122
|
-
}), Me(l, (
|
|
8123
|
-
b || !m || m.setWidth(`${
|
|
8124
|
-
}), Me(o, (
|
|
8125
|
-
b || !m || m.setOffsetX(
|
|
8126
|
-
}), Me(i, (
|
|
8127
|
-
b || !m || m.setOffsetY(
|
|
8128
|
-
}), Me(a, (
|
|
8129
|
-
b || !m || m.setOffsetZ(
|
|
8117
|
+
const w = e.selectedObject;
|
|
8118
|
+
return w ? Ut(hs(w)) : null;
|
|
8119
|
+
}
|
|
8120
|
+
Me(s, (w) => {
|
|
8121
|
+
b || !m || (m.visible = w);
|
|
8122
|
+
}), Me(l, (w) => {
|
|
8123
|
+
b || !m || m.setWidth(`${w}em`);
|
|
8124
|
+
}), Me(o, (w) => {
|
|
8125
|
+
b || !m || m.setOffsetX(w);
|
|
8126
|
+
}), Me(i, (w) => {
|
|
8127
|
+
b || !m || m.setOffsetY(w);
|
|
8128
|
+
}), Me(a, (w) => {
|
|
8129
|
+
b || !m || m.setOffsetZ(w);
|
|
8130
8130
|
});
|
|
8131
8131
|
function p() {
|
|
8132
8132
|
b || !m || (m.setTitle(t.value), m.setItems([...n.value]));
|
|
8133
8133
|
}
|
|
8134
8134
|
Me(t, () => p()), Me(n, () => p(), { deep: !0 });
|
|
8135
|
-
function w
|
|
8136
|
-
n.value = n.value.filter((
|
|
8135
|
+
function C(w) {
|
|
8136
|
+
n.value = n.value.filter((d, x) => x !== w), p();
|
|
8137
8137
|
}
|
|
8138
|
-
function
|
|
8139
|
-
!c.value.trim() || !
|
|
8138
|
+
function v() {
|
|
8139
|
+
!c.value.trim() || !f.value.trim() || (n.value = [
|
|
8140
8140
|
...n.value,
|
|
8141
8141
|
{
|
|
8142
8142
|
label: c.value.trim(),
|
|
8143
|
-
value:
|
|
8143
|
+
value: f.value.trim(),
|
|
8144
8144
|
unit: u.value.trim() || void 0,
|
|
8145
8145
|
code: A.value.trim() || void 0
|
|
8146
8146
|
}
|
|
8147
|
-
], p(), c.value = "",
|
|
8147
|
+
], p(), c.value = "", f.value = "", u.value = "", A.value = "");
|
|
8148
8148
|
}
|
|
8149
8149
|
return Me(
|
|
8150
8150
|
() => e.selectedObject,
|
|
8151
8151
|
() => {
|
|
8152
|
-
b = !0, m = h(), m ? (t.value = m.getTitle(), n.value = m.getItems(), s.value = m.visible, i.value = m.getOffsetY(), o.value = m.getOffsetX(), a.value = m.getOffsetZ(), l.value = parseFloat(m.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "",
|
|
8152
|
+
b = !0, m = h(), m ? (t.value = m.getTitle(), n.value = m.getItems(), s.value = m.visible, i.value = m.getOffsetY(), o.value = m.getOffsetX(), a.value = m.getOffsetZ(), l.value = parseFloat(m.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "", f.value = "", u.value = "", A.value = "", setTimeout(() => {
|
|
8153
8153
|
b = !1;
|
|
8154
8154
|
}, 0);
|
|
8155
8155
|
},
|
|
8156
8156
|
{ immediate: !0 }
|
|
8157
|
-
), (
|
|
8157
|
+
), (w, d) => (H(), j("div", au, [
|
|
8158
8158
|
g("div", lu, [
|
|
8159
|
-
|
|
8159
|
+
d[29] || (d[29] = g("label", null, "📊 数据面板", -1)),
|
|
8160
8160
|
g("div", cu, [
|
|
8161
|
-
|
|
8161
|
+
d[14] || (d[14] = g("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
8162
8162
|
g("div", uu, [
|
|
8163
8163
|
g("label", du, [
|
|
8164
|
-
|
|
8164
|
+
k(g("input", {
|
|
8165
8165
|
type: "checkbox",
|
|
8166
|
-
"onUpdate:modelValue":
|
|
8166
|
+
"onUpdate:modelValue": d[0] || (d[0] = (x) => s.value = x)
|
|
8167
8167
|
}, null, 512), [
|
|
8168
8168
|
[Gn, s.value]
|
|
8169
8169
|
]),
|
|
8170
|
-
|
|
8170
|
+
d[13] || (d[13] = g("span", { class: "dp-toggle-slider" }, null, -1))
|
|
8171
8171
|
]),
|
|
8172
|
-
g("span", fu,
|
|
8172
|
+
g("span", fu, ue(s.value ? "显示中" : "已隐藏"), 1)
|
|
8173
8173
|
])
|
|
8174
8174
|
]),
|
|
8175
8175
|
g("div", hu, [
|
|
8176
|
-
|
|
8177
|
-
|
|
8176
|
+
d[15] || (d[15] = g("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
8177
|
+
k(g("input", {
|
|
8178
8178
|
type: "text",
|
|
8179
8179
|
class: "dp-input",
|
|
8180
|
-
"onUpdate:modelValue":
|
|
8180
|
+
"onUpdate:modelValue": d[1] || (d[1] = (x) => t.value = x),
|
|
8181
8181
|
placeholder: "面板标题"
|
|
8182
8182
|
}, null, 512), [
|
|
8183
8183
|
[B, t.value]
|
|
8184
8184
|
])
|
|
8185
8185
|
]),
|
|
8186
8186
|
g("div", pu, [
|
|
8187
|
-
|
|
8187
|
+
d[18] || (d[18] = g("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
8188
8188
|
g("div", Au, [
|
|
8189
|
-
|
|
8190
|
-
|
|
8189
|
+
d[16] || (d[16] = g("span", { class: "dp-range-label" }, "窄", -1)),
|
|
8190
|
+
k(g("input", {
|
|
8191
8191
|
type: "range",
|
|
8192
8192
|
class: "dp-range",
|
|
8193
8193
|
min: "10",
|
|
8194
8194
|
max: "40",
|
|
8195
8195
|
step: "1",
|
|
8196
|
-
"onUpdate:modelValue":
|
|
8196
|
+
"onUpdate:modelValue": d[2] || (d[2] = (x) => l.value = x)
|
|
8197
8197
|
}, null, 512), [
|
|
8198
8198
|
[
|
|
8199
8199
|
B,
|
|
@@ -8202,21 +8202,21 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8202
8202
|
{ number: !0 }
|
|
8203
8203
|
]
|
|
8204
8204
|
]),
|
|
8205
|
-
|
|
8206
|
-
g("span", mu,
|
|
8205
|
+
d[17] || (d[17] = g("span", { class: "dp-range-label" }, "宽", -1)),
|
|
8206
|
+
g("span", mu, ue(l.value) + "em", 1)
|
|
8207
8207
|
])
|
|
8208
8208
|
]),
|
|
8209
8209
|
g("div", gu, [
|
|
8210
|
-
|
|
8210
|
+
d[21] || (d[21] = g("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
|
|
8211
8211
|
g("div", yu, [
|
|
8212
|
-
|
|
8213
|
-
|
|
8212
|
+
d[19] || (d[19] = g("span", { class: "dp-range-label" }, "偏左", -1)),
|
|
8213
|
+
k(g("input", {
|
|
8214
8214
|
type: "range",
|
|
8215
8215
|
class: "dp-range",
|
|
8216
8216
|
min: "-5",
|
|
8217
8217
|
max: "5",
|
|
8218
8218
|
step: "0.01",
|
|
8219
|
-
"onUpdate:modelValue":
|
|
8219
|
+
"onUpdate:modelValue": d[3] || (d[3] = (x) => o.value = x)
|
|
8220
8220
|
}, null, 512), [
|
|
8221
8221
|
[
|
|
8222
8222
|
B,
|
|
@@ -8225,11 +8225,11 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8225
8225
|
{ number: !0 }
|
|
8226
8226
|
]
|
|
8227
8227
|
]),
|
|
8228
|
-
|
|
8229
|
-
|
|
8228
|
+
d[20] || (d[20] = g("span", { class: "dp-range-label" }, "偏右", -1)),
|
|
8229
|
+
k(g("input", {
|
|
8230
8230
|
type: "number",
|
|
8231
8231
|
class: "dp-input dp-input-number",
|
|
8232
|
-
"onUpdate:modelValue":
|
|
8232
|
+
"onUpdate:modelValue": d[4] || (d[4] = (x) => o.value = x),
|
|
8233
8233
|
step: "0.01"
|
|
8234
8234
|
}, null, 512), [
|
|
8235
8235
|
[
|
|
@@ -8242,16 +8242,16 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8242
8242
|
])
|
|
8243
8243
|
]),
|
|
8244
8244
|
g("div", bu, [
|
|
8245
|
-
|
|
8245
|
+
d[24] || (d[24] = g("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
|
|
8246
8246
|
g("div", xu, [
|
|
8247
|
-
|
|
8248
|
-
|
|
8247
|
+
d[22] || (d[22] = g("span", { class: "dp-range-label" }, "偏下", -1)),
|
|
8248
|
+
k(g("input", {
|
|
8249
8249
|
type: "range",
|
|
8250
8250
|
class: "dp-range",
|
|
8251
8251
|
min: "-5",
|
|
8252
8252
|
max: "5",
|
|
8253
8253
|
step: "0.01",
|
|
8254
|
-
"onUpdate:modelValue":
|
|
8254
|
+
"onUpdate:modelValue": d[5] || (d[5] = (x) => i.value = x)
|
|
8255
8255
|
}, null, 512), [
|
|
8256
8256
|
[
|
|
8257
8257
|
B,
|
|
@@ -8260,11 +8260,11 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8260
8260
|
{ number: !0 }
|
|
8261
8261
|
]
|
|
8262
8262
|
]),
|
|
8263
|
-
|
|
8264
|
-
|
|
8263
|
+
d[23] || (d[23] = g("span", { class: "dp-range-label" }, "偏上", -1)),
|
|
8264
|
+
k(g("input", {
|
|
8265
8265
|
type: "number",
|
|
8266
8266
|
class: "dp-input dp-input-number",
|
|
8267
|
-
"onUpdate:modelValue":
|
|
8267
|
+
"onUpdate:modelValue": d[6] || (d[6] = (x) => i.value = x),
|
|
8268
8268
|
step: "0.01"
|
|
8269
8269
|
}, null, 512), [
|
|
8270
8270
|
[
|
|
@@ -8277,16 +8277,16 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8277
8277
|
])
|
|
8278
8278
|
]),
|
|
8279
8279
|
g("div", Iu, [
|
|
8280
|
-
|
|
8280
|
+
d[27] || (d[27] = g("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
|
|
8281
8281
|
g("div", Cu, [
|
|
8282
|
-
|
|
8283
|
-
|
|
8282
|
+
d[25] || (d[25] = g("span", { class: "dp-range-label" }, "近", -1)),
|
|
8283
|
+
k(g("input", {
|
|
8284
8284
|
type: "range",
|
|
8285
8285
|
class: "dp-range",
|
|
8286
8286
|
min: "-5",
|
|
8287
8287
|
max: "5",
|
|
8288
8288
|
step: "0.01",
|
|
8289
|
-
"onUpdate:modelValue":
|
|
8289
|
+
"onUpdate:modelValue": d[7] || (d[7] = (x) => a.value = x)
|
|
8290
8290
|
}, null, 512), [
|
|
8291
8291
|
[
|
|
8292
8292
|
B,
|
|
@@ -8295,11 +8295,11 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8295
8295
|
{ number: !0 }
|
|
8296
8296
|
]
|
|
8297
8297
|
]),
|
|
8298
|
-
|
|
8299
|
-
|
|
8298
|
+
d[26] || (d[26] = g("span", { class: "dp-range-label" }, "远", -1)),
|
|
8299
|
+
k(g("input", {
|
|
8300
8300
|
type: "number",
|
|
8301
8301
|
class: "dp-input dp-input-number",
|
|
8302
|
-
"onUpdate:modelValue":
|
|
8302
|
+
"onUpdate:modelValue": d[8] || (d[8] = (x) => a.value = x),
|
|
8303
8303
|
step: "0.01"
|
|
8304
8304
|
}, null, 512), [
|
|
8305
8305
|
[
|
|
@@ -8312,91 +8312,91 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8312
8312
|
])
|
|
8313
8313
|
]),
|
|
8314
8314
|
g("div", wu, [
|
|
8315
|
-
|
|
8315
|
+
d[28] || (d[28] = g("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
8316
8316
|
g("div", vu, [
|
|
8317
|
-
(H(!0),
|
|
8317
|
+
(H(!0), j(Ee, null, mt(n.value, (x, M) => (H(), j("div", {
|
|
8318
8318
|
key: M,
|
|
8319
8319
|
class: "dp-item"
|
|
8320
8320
|
}, [
|
|
8321
|
-
|
|
8321
|
+
k(g("input", {
|
|
8322
8322
|
type: "text",
|
|
8323
8323
|
class: "dp-input dp-input-sm",
|
|
8324
|
-
"onUpdate:modelValue": (D) =>
|
|
8324
|
+
"onUpdate:modelValue": (D) => x.label = D,
|
|
8325
8325
|
placeholder: "标签"
|
|
8326
8326
|
}, null, 8, Mu), [
|
|
8327
|
-
[B,
|
|
8327
|
+
[B, x.label]
|
|
8328
8328
|
]),
|
|
8329
|
-
|
|
8329
|
+
k(g("input", {
|
|
8330
8330
|
type: "text",
|
|
8331
8331
|
class: "dp-input dp-input-sm",
|
|
8332
|
-
"onUpdate:modelValue": (D) =>
|
|
8332
|
+
"onUpdate:modelValue": (D) => x.value = D,
|
|
8333
8333
|
placeholder: "值"
|
|
8334
8334
|
}, null, 8, Tu), [
|
|
8335
|
-
[B,
|
|
8335
|
+
[B, x.value]
|
|
8336
8336
|
]),
|
|
8337
|
-
|
|
8337
|
+
k(g("input", {
|
|
8338
8338
|
type: "text",
|
|
8339
8339
|
class: "dp-input dp-input-xs",
|
|
8340
|
-
"onUpdate:modelValue": (D) =>
|
|
8340
|
+
"onUpdate:modelValue": (D) => x.unit = D,
|
|
8341
8341
|
placeholder: "单位"
|
|
8342
8342
|
}, null, 8, Eu), [
|
|
8343
|
-
[B,
|
|
8343
|
+
[B, x.unit]
|
|
8344
8344
|
]),
|
|
8345
|
-
|
|
8345
|
+
k(g("input", {
|
|
8346
8346
|
type: "text",
|
|
8347
8347
|
class: "dp-input dp-input-xs",
|
|
8348
|
-
"onUpdate:modelValue": (D) =>
|
|
8348
|
+
"onUpdate:modelValue": (D) => x.code = D,
|
|
8349
8349
|
placeholder: "编码"
|
|
8350
8350
|
}, null, 8, Du), [
|
|
8351
|
-
[B,
|
|
8351
|
+
[B, x.code]
|
|
8352
8352
|
]),
|
|
8353
8353
|
g("button", {
|
|
8354
8354
|
class: "dp-btn dp-btn-del",
|
|
8355
|
-
onClick: (D) =>
|
|
8355
|
+
onClick: (D) => C(M),
|
|
8356
8356
|
title: "删除此项"
|
|
8357
8357
|
}, "✕", 8, Ou)
|
|
8358
8358
|
]))), 128))
|
|
8359
8359
|
]),
|
|
8360
8360
|
g("div", Ru, [
|
|
8361
|
-
|
|
8361
|
+
k(g("input", {
|
|
8362
8362
|
type: "text",
|
|
8363
8363
|
class: "dp-input dp-input-sm",
|
|
8364
|
-
"onUpdate:modelValue":
|
|
8364
|
+
"onUpdate:modelValue": d[9] || (d[9] = (x) => c.value = x),
|
|
8365
8365
|
placeholder: "标签",
|
|
8366
|
-
onKeyup: dt(
|
|
8366
|
+
onKeyup: dt(v, ["enter"])
|
|
8367
8367
|
}, null, 544), [
|
|
8368
8368
|
[B, c.value]
|
|
8369
8369
|
]),
|
|
8370
|
-
|
|
8370
|
+
k(g("input", {
|
|
8371
8371
|
type: "text",
|
|
8372
8372
|
class: "dp-input dp-input-sm",
|
|
8373
|
-
"onUpdate:modelValue":
|
|
8373
|
+
"onUpdate:modelValue": d[10] || (d[10] = (x) => f.value = x),
|
|
8374
8374
|
placeholder: "值",
|
|
8375
|
-
onKeyup: dt(
|
|
8375
|
+
onKeyup: dt(v, ["enter"])
|
|
8376
8376
|
}, null, 544), [
|
|
8377
|
-
[B,
|
|
8377
|
+
[B, f.value]
|
|
8378
8378
|
]),
|
|
8379
|
-
|
|
8379
|
+
k(g("input", {
|
|
8380
8380
|
type: "text",
|
|
8381
8381
|
class: "dp-input dp-input-xs",
|
|
8382
|
-
"onUpdate:modelValue":
|
|
8382
|
+
"onUpdate:modelValue": d[11] || (d[11] = (x) => u.value = x),
|
|
8383
8383
|
placeholder: "单位",
|
|
8384
|
-
onKeyup: dt(
|
|
8384
|
+
onKeyup: dt(v, ["enter"])
|
|
8385
8385
|
}, null, 544), [
|
|
8386
8386
|
[B, u.value]
|
|
8387
8387
|
]),
|
|
8388
|
-
|
|
8388
|
+
k(g("input", {
|
|
8389
8389
|
type: "text",
|
|
8390
8390
|
class: "dp-input dp-input-xs",
|
|
8391
|
-
"onUpdate:modelValue":
|
|
8391
|
+
"onUpdate:modelValue": d[12] || (d[12] = (x) => A.value = x),
|
|
8392
8392
|
placeholder: "编码",
|
|
8393
|
-
onKeyup: dt(
|
|
8393
|
+
onKeyup: dt(v, ["enter"])
|
|
8394
8394
|
}, null, 544), [
|
|
8395
8395
|
[B, A.value]
|
|
8396
8396
|
]),
|
|
8397
8397
|
g("button", {
|
|
8398
8398
|
class: "dp-btn dp-btn-add",
|
|
8399
|
-
onClick:
|
|
8399
|
+
onClick: v,
|
|
8400
8400
|
title: "添加"
|
|
8401
8401
|
}, "+")
|
|
8402
8402
|
])
|
|
@@ -8404,7 +8404,7 @@ const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8404
8404
|
])
|
|
8405
8405
|
]));
|
|
8406
8406
|
}
|
|
8407
|
-
}), Su = /* @__PURE__ */
|
|
8407
|
+
}), Su = /* @__PURE__ */ Je(Pu, [["__scopeId", "data-v-b4c7c7dc"]]);
|
|
8408
8408
|
function Lu(r) {
|
|
8409
8409
|
const e = W(/* @__PURE__ */ new Set()), t = (s) => {
|
|
8410
8410
|
const i = new Set(e.value);
|
|
@@ -8431,22 +8431,22 @@ const Nu = {
|
|
|
8431
8431
|
}, Hu = { class: "property-group tree-group" }, ku = { class: "tree-container" }, ju = {
|
|
8432
8432
|
key: 0,
|
|
8433
8433
|
class: "tree-empty"
|
|
8434
|
-
}, Fu = { class: "property-group" }, Uu = { class: "transform-mode-row" }, zu = { class: "script-editor" }, Wu = { class: "script-item-header" },
|
|
8434
|
+
}, Fu = { class: "property-group" }, Uu = { class: "transform-mode-row" }, zu = { class: "script-editor" }, Wu = { class: "script-collapse-arrow" }, Gu = { class: "script-editor-body" }, Bu = { class: "script-item-header" }, Xu = ["onUpdate:modelValue"], qu = ["onClick"], Vu = ["onUpdate:modelValue"], Yu = {
|
|
8435
8435
|
key: 0,
|
|
8436
8436
|
class: "script-empty"
|
|
8437
|
-
},
|
|
8437
|
+
}, Ku = {
|
|
8438
8438
|
key: 0,
|
|
8439
8439
|
class: "object-name-row"
|
|
8440
|
-
},
|
|
8440
|
+
}, Zu = {
|
|
8441
8441
|
key: 1,
|
|
8442
8442
|
class: "tabs"
|
|
8443
|
-
},
|
|
8443
|
+
}, Qu = {
|
|
8444
8444
|
key: 2,
|
|
8445
8445
|
class: "tab-content"
|
|
8446
|
-
},
|
|
8446
|
+
}, Ju = {
|
|
8447
8447
|
key: 1,
|
|
8448
8448
|
class: "property-panel empty"
|
|
8449
|
-
},
|
|
8449
|
+
}, _u = /* @__PURE__ */ Qe({
|
|
8450
8450
|
__name: "index",
|
|
8451
8451
|
props: {
|
|
8452
8452
|
transform: {},
|
|
@@ -8456,16 +8456,16 @@ const Nu = {
|
|
|
8456
8456
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
8457
8457
|
setup(r, { emit: e }) {
|
|
8458
8458
|
const t = r, n = e, s = W("translate");
|
|
8459
|
-
function i(
|
|
8460
|
-
s.value =
|
|
8459
|
+
function i(d) {
|
|
8460
|
+
s.value = d, n("transformModeChange", d);
|
|
8461
8461
|
}
|
|
8462
|
-
const o = () => n("propertyChange"), a = W("transform"), l =
|
|
8463
|
-
var
|
|
8464
|
-
return !!(t.selectedObject && ((
|
|
8465
|
-
}), c = W(0),
|
|
8462
|
+
const o = () => n("propertyChange"), a = W("transform"), l = st(() => {
|
|
8463
|
+
var d;
|
|
8464
|
+
return !!(t.selectedObject && ((d = t.selectedObject.userData) != null && d._hasDataPanel));
|
|
8465
|
+
}), c = W(0), f = no(t, "selectedObject"), { expandedSet: u, toggleExpand: A } = Lu(f);
|
|
8466
8466
|
io("treeExpand", { expandedSet: u, toggleExpand: A });
|
|
8467
|
-
const m = (
|
|
8468
|
-
c.value++, n("treeDelete",
|
|
8467
|
+
const m = (d) => {
|
|
8468
|
+
c.value++, n("treeDelete", d);
|
|
8469
8469
|
}, b = () => {
|
|
8470
8470
|
qa({
|
|
8471
8471
|
name: "",
|
|
@@ -8475,32 +8475,34 @@ if (selectedObject) {
|
|
|
8475
8475
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
|
|
8476
8476
|
}`
|
|
8477
8477
|
});
|
|
8478
|
-
}, h = (
|
|
8478
|
+
}, h = (d) => Va(d), p = W(!1), C = () => {
|
|
8479
|
+
p.value = !p.value;
|
|
8480
|
+
}, v = W("");
|
|
8479
8481
|
Me(
|
|
8480
8482
|
() => t.selectedObject,
|
|
8481
|
-
(
|
|
8482
|
-
|
|
8483
|
+
(d) => {
|
|
8484
|
+
v.value = (d == null ? void 0 : d.name) ?? "";
|
|
8483
8485
|
},
|
|
8484
8486
|
{ immediate: !0 }
|
|
8485
8487
|
);
|
|
8486
8488
|
const w = () => {
|
|
8487
8489
|
if (!t.selectedObject) return;
|
|
8488
|
-
const
|
|
8489
|
-
t.selectedObject.name =
|
|
8490
|
+
const d = v.value.trim();
|
|
8491
|
+
t.selectedObject.name = d || "未命名", v.value = t.selectedObject.name, c.value++;
|
|
8490
8492
|
};
|
|
8491
|
-
return (
|
|
8493
|
+
return (d, x) => d.transform ? (H(), j("div", Nu, [
|
|
8492
8494
|
g("div", Hu, [
|
|
8493
8495
|
x[8] || (x[8] = g("label", null, "场景物体", -1)),
|
|
8494
8496
|
g("div", ku, [
|
|
8495
|
-
(H(!0),
|
|
8496
|
-
key:
|
|
8497
|
-
node:
|
|
8498
|
-
"selected-object":
|
|
8497
|
+
(H(!0), j(Ee, null, mt(d.treeData, (M) => (H(), Mt(Jl, {
|
|
8498
|
+
key: M.uuid,
|
|
8499
|
+
node: M,
|
|
8500
|
+
"selected-object": d.selectedObject,
|
|
8499
8501
|
version: c.value,
|
|
8500
|
-
onSelect: x[0] || (x[0] = (
|
|
8502
|
+
onSelect: x[0] || (x[0] = (D) => n("treeSelect", D)),
|
|
8501
8503
|
onDelete: m
|
|
8502
8504
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
8503
|
-
|
|
8505
|
+
d.treeData.length === 0 ? (H(), j("div", ju, "暂无物体")) : re("", !0)
|
|
8504
8506
|
])
|
|
8505
8507
|
]),
|
|
8506
8508
|
g("div", Fu, [
|
|
@@ -8509,53 +8511,58 @@ if (selectedObject) {
|
|
|
8509
8511
|
g("button", {
|
|
8510
8512
|
class: Pe(["mode-btn", { active: s.value === "translate" }]),
|
|
8511
8513
|
title: "移动 (W)",
|
|
8512
|
-
onClick: x[1] || (x[1] = (
|
|
8514
|
+
onClick: x[1] || (x[1] = (M) => i("translate"))
|
|
8513
8515
|
}, " ↕ 移动 ", 2),
|
|
8514
8516
|
g("button", {
|
|
8515
8517
|
class: Pe(["mode-btn", { active: s.value === "rotate" }]),
|
|
8516
8518
|
title: "旋转 (E)",
|
|
8517
|
-
onClick: x[2] || (x[2] = (
|
|
8519
|
+
onClick: x[2] || (x[2] = (M) => i("rotate"))
|
|
8518
8520
|
}, " ↻ 旋转 ", 2),
|
|
8519
8521
|
g("button", {
|
|
8520
8522
|
class: Pe(["mode-btn", { active: s.value === "scale" }]),
|
|
8521
8523
|
title: "缩放 (R)",
|
|
8522
|
-
onClick: x[3] || (x[3] = (
|
|
8524
|
+
onClick: x[3] || (x[3] = (M) => i("scale"))
|
|
8523
8525
|
}, " ⤡ 缩放 ", 2)
|
|
8524
8526
|
]),
|
|
8525
8527
|
g("div", zu, [
|
|
8526
|
-
g("div", {
|
|
8528
|
+
g("div", {
|
|
8529
|
+
class: "script-editor-header",
|
|
8530
|
+
onClick: C
|
|
8531
|
+
}, [
|
|
8532
|
+
g("span", Wu, ue(p.value ? "▶" : "▼"), 1),
|
|
8527
8533
|
x[9] || (x[9] = g("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
|
|
8528
8534
|
g("button", {
|
|
8529
8535
|
class: "add-script-btn",
|
|
8530
|
-
onClick: b,
|
|
8536
|
+
onClick: St(b, ["stop"]),
|
|
8531
8537
|
title: "新增一个脚本"
|
|
8532
8538
|
}, " + 添加脚本 ")
|
|
8533
8539
|
]),
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
"
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8540
|
+
k(g("div", Gu, [
|
|
8541
|
+
(H(!0), j(Ee, null, mt(rs(Se).scripts, (M) => (H(), j("div", {
|
|
8542
|
+
key: M.id,
|
|
8543
|
+
class: "script-item"
|
|
8544
|
+
}, [
|
|
8545
|
+
g("div", Bu, [
|
|
8546
|
+
k(g("input", {
|
|
8547
|
+
"onUpdate:modelValue": (D) => M.name = D,
|
|
8548
|
+
class: "script-name-input",
|
|
8549
|
+
placeholder: "函数名称(按钮显示文字)",
|
|
8550
|
+
spellcheck: "false"
|
|
8551
|
+
}, null, 8, Xu), [
|
|
8552
|
+
[B, M.name]
|
|
8553
|
+
]),
|
|
8554
|
+
g("button", {
|
|
8555
|
+
class: "script-del-btn",
|
|
8556
|
+
title: "删除该脚本",
|
|
8557
|
+
onClick: (D) => h(M.id)
|
|
8558
|
+
}, "✕", 8, qu)
|
|
8546
8559
|
]),
|
|
8547
|
-
g("
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
j(g("textarea", {
|
|
8554
|
-
"onUpdate:modelValue": (v) => f.code = v,
|
|
8555
|
-
class: "script-code-input",
|
|
8556
|
-
rows: "6",
|
|
8557
|
-
spellcheck: "false",
|
|
8558
|
-
placeholder: `填写 JS 函数体或完整函数定义,例如:
|
|
8560
|
+
k(g("textarea", {
|
|
8561
|
+
"onUpdate:modelValue": (D) => M.code = D,
|
|
8562
|
+
class: "script-code-input",
|
|
8563
|
+
rows: "6",
|
|
8564
|
+
spellcheck: "false",
|
|
8565
|
+
placeholder: `填写 JS 函数体或完整函数定义,例如:
|
|
8559
8566
|
rotateTo(selectedObject, { y: degToRad(90) }, 1500); // 旋转动画(弧度)
|
|
8560
8567
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000); // 移动动画
|
|
8561
8568
|
scaleTo(selectedObject, { x: 2 }, 800); // 缩放动画
|
|
@@ -8578,60 +8585,63 @@ function myFunc() {
|
|
|
8578
8585
|
脚本内可直接使用:THREE、scene、camera、renderer、selectedObject
|
|
8579
8586
|
动画 API:animateTo / moveTo / rotateTo / scaleTo / fadeTo / stopAnimations / degToRad
|
|
8580
8587
|
其他:addModel/removeModel/selectObject 等编辑器 API`
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8588
|
+
}, null, 8, Vu), [
|
|
8589
|
+
[B, M.code]
|
|
8590
|
+
])
|
|
8591
|
+
]))), 128)),
|
|
8592
|
+
rs(Se).scripts.length === 0 ? (H(), j("div", Yu, " 暂无脚本,点击“+ 添加脚本”创建(画布底部会为每个脚本生成一个触发按钮) ")) : re("", !0)
|
|
8593
|
+
], 512), [
|
|
8594
|
+
[Ye, !p.value]
|
|
8595
|
+
])
|
|
8586
8596
|
])
|
|
8587
8597
|
]),
|
|
8588
|
-
|
|
8598
|
+
d.selectedObject ? (H(), j("div", Ku, [
|
|
8589
8599
|
x[11] || (x[11] = g("label", null, "物体名称", -1)),
|
|
8590
|
-
|
|
8591
|
-
"onUpdate:modelValue": x[4] || (x[4] = (
|
|
8600
|
+
k(g("input", {
|
|
8601
|
+
"onUpdate:modelValue": x[4] || (x[4] = (M) => v.value = M),
|
|
8592
8602
|
class: "object-name-input",
|
|
8593
8603
|
placeholder: "输入名称,脚本中可用 scene.getObjectByName() 查找",
|
|
8594
8604
|
spellcheck: "false",
|
|
8595
8605
|
onChange: w
|
|
8596
8606
|
}, null, 544), [
|
|
8597
|
-
[B,
|
|
8607
|
+
[B, v.value]
|
|
8598
8608
|
])
|
|
8599
8609
|
])) : re("", !0),
|
|
8600
|
-
|
|
8610
|
+
d.selectedObject ? (H(), j("div", Zu, [
|
|
8601
8611
|
g("button", {
|
|
8602
8612
|
class: Pe(["tab-btn", { active: a.value === "transform" }]),
|
|
8603
|
-
onClick: x[5] || (x[5] = (
|
|
8613
|
+
onClick: x[5] || (x[5] = (M) => a.value = "transform")
|
|
8604
8614
|
}, " 🔄 变换 ", 2),
|
|
8605
8615
|
g("button", {
|
|
8606
8616
|
class: Pe(["tab-btn", { active: a.value === "userdata" }]),
|
|
8607
|
-
onClick: x[6] || (x[6] = (
|
|
8617
|
+
onClick: x[6] || (x[6] = (M) => a.value = "userdata")
|
|
8608
8618
|
}, " 📋 自定义数据 ", 2),
|
|
8609
|
-
l.value ? (H(),
|
|
8619
|
+
l.value ? (H(), j("button", {
|
|
8610
8620
|
key: 0,
|
|
8611
8621
|
class: Pe(["tab-btn", { active: a.value === "datapanel" }]),
|
|
8612
|
-
onClick: x[7] || (x[7] = (
|
|
8622
|
+
onClick: x[7] || (x[7] = (M) => a.value = "datapanel")
|
|
8613
8623
|
}, " 📊 数据面板 ", 2)) : re("", !0)
|
|
8614
8624
|
])) : re("", !0),
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
transform:
|
|
8618
|
-
"selected-object":
|
|
8625
|
+
d.selectedObject ? (H(), j("div", Qu, [
|
|
8626
|
+
k(bs(Xc, {
|
|
8627
|
+
transform: d.transform,
|
|
8628
|
+
"selected-object": d.selectedObject,
|
|
8619
8629
|
onPropertyChange: o
|
|
8620
8630
|
}, null, 8, ["transform", "selected-object"]), [
|
|
8621
|
-
[
|
|
8631
|
+
[Ye, a.value === "transform"]
|
|
8622
8632
|
]),
|
|
8623
|
-
|
|
8624
|
-
[
|
|
8633
|
+
k(bs(ru, { "selected-object": d.selectedObject }, null, 8, ["selected-object"]), [
|
|
8634
|
+
[Ye, a.value === "userdata"]
|
|
8625
8635
|
]),
|
|
8626
|
-
|
|
8627
|
-
[
|
|
8636
|
+
k(bs(Su, { "selected-object": d.selectedObject }, null, 8, ["selected-object"]), [
|
|
8637
|
+
[Ye, a.value === "datapanel"]
|
|
8628
8638
|
])
|
|
8629
8639
|
])) : re("", !0)
|
|
8630
|
-
])) : (H(),
|
|
8640
|
+
])) : (H(), j("div", Ju, x[12] || (x[12] = [
|
|
8631
8641
|
g("p", null, "未选中任何模型", -1)
|
|
8632
8642
|
])));
|
|
8633
8643
|
}
|
|
8634
|
-
}),
|
|
8644
|
+
}), $u = /* @__PURE__ */ Je(_u, [["__scopeId", "data-v-7acd33b7"]]), ed = { class: "top-bar" }, td = { class: "left-section" }, sd = { class: "dropdown-menu" }, nd = { class: "dropdown-menu sub-menu" }, id = { class: "dropdown-menu sub-menu" }, od = { class: "dropdown-menu" }, rd = /* @__PURE__ */ Qe({
|
|
8635
8645
|
__name: "TopBar",
|
|
8636
8646
|
emits: ["addModel", "importModel"],
|
|
8637
8647
|
setup(r, { emit: e }) {
|
|
@@ -8641,74 +8651,74 @@ function myFunc() {
|
|
|
8641
8651
|
}, c = (h) => {
|
|
8642
8652
|
const p = h.target;
|
|
8643
8653
|
p.files && p.files.length > 0 && (o("importModel", p.files[0]), p.value = "");
|
|
8644
|
-
},
|
|
8654
|
+
}, f = () => console.log("撤销"), u = () => console.log("删除物体"), A = async () => {
|
|
8645
8655
|
const h = await Sl();
|
|
8646
8656
|
console.log("scene GLB 字节数:", h.scene.byteLength), console.log("camera:", h.camera), console.log("dataPanels:", h.dataPanels), console.log("waters:", h.waters), console.log("textures:", h.textures), console.log("ambientLight:", h.ambientLight);
|
|
8647
8657
|
}, m = () => {
|
|
8648
8658
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
8649
8659
|
Ci(localStorage.getItem("test_id"));
|
|
8650
8660
|
}, b = () => gi();
|
|
8651
|
-
return (h, p) => (H(),
|
|
8652
|
-
g("div",
|
|
8661
|
+
return (h, p) => (H(), j("div", ed, [
|
|
8662
|
+
g("div", td, [
|
|
8653
8663
|
g("div", {
|
|
8654
8664
|
class: "dropdown-wrapper",
|
|
8655
|
-
onMouseenter: p[11] || (p[11] = (
|
|
8656
|
-
onMouseleave: p[12] || (p[12] = (
|
|
8665
|
+
onMouseenter: p[11] || (p[11] = (C) => n.value = !0),
|
|
8666
|
+
onMouseleave: p[12] || (p[12] = (C) => n.value = !1)
|
|
8657
8667
|
}, [
|
|
8658
8668
|
p[17] || (p[17] = g("button", { class: "menu-btn" }, "添加", -1)),
|
|
8659
|
-
|
|
8669
|
+
k(g("div", sd, [
|
|
8660
8670
|
g("div", {
|
|
8661
8671
|
class: "menu-item",
|
|
8662
|
-
onClick:
|
|
8672
|
+
onClick: f
|
|
8663
8673
|
}, "组"),
|
|
8664
8674
|
g("div", {
|
|
8665
8675
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8666
|
-
onMouseenter: p[5] || (p[5] = (
|
|
8667
|
-
onMouseleave: p[6] || (p[6] = (
|
|
8676
|
+
onMouseenter: p[5] || (p[5] = (C) => s.value = !0),
|
|
8677
|
+
onMouseleave: p[6] || (p[6] = (C) => s.value = !1)
|
|
8668
8678
|
}, [
|
|
8669
8679
|
p[15] || (p[15] = g("span", null, "网格", -1)),
|
|
8670
|
-
|
|
8680
|
+
k(g("div", nd, [
|
|
8671
8681
|
g("div", {
|
|
8672
8682
|
class: "menu-item",
|
|
8673
|
-
onClick: p[0] || (p[0] = (
|
|
8683
|
+
onClick: p[0] || (p[0] = (C) => o("addModel", "box"))
|
|
8674
8684
|
}, " 正方体 "),
|
|
8675
8685
|
g("div", {
|
|
8676
8686
|
class: "menu-item",
|
|
8677
|
-
onClick: p[1] || (p[1] = (
|
|
8687
|
+
onClick: p[1] || (p[1] = (C) => o("addModel", "sphere"))
|
|
8678
8688
|
}, " 球体 "),
|
|
8679
8689
|
g("div", {
|
|
8680
8690
|
class: "menu-item",
|
|
8681
|
-
onClick: p[2] || (p[2] = (
|
|
8691
|
+
onClick: p[2] || (p[2] = (C) => o("addModel", "water"))
|
|
8682
8692
|
}, " 水体(Water.js) "),
|
|
8683
8693
|
g("div", {
|
|
8684
8694
|
class: "menu-item",
|
|
8685
|
-
onClick: p[3] || (p[3] = (
|
|
8695
|
+
onClick: p[3] || (p[3] = (C) => o("addModel", "waterCylinder"))
|
|
8686
8696
|
}, " 水体(圆柱) "),
|
|
8687
8697
|
g("div", {
|
|
8688
8698
|
class: "menu-item",
|
|
8689
|
-
onClick: p[4] || (p[4] = (
|
|
8699
|
+
onClick: p[4] || (p[4] = (C) => o("addModel", "waterPlane"))
|
|
8690
8700
|
}, " 水面(标准材质) "),
|
|
8691
8701
|
g("div", {
|
|
8692
8702
|
class: "menu-item",
|
|
8693
8703
|
onClick: l
|
|
8694
8704
|
}, "导入")
|
|
8695
8705
|
], 512), [
|
|
8696
|
-
[
|
|
8706
|
+
[Ye, s.value]
|
|
8697
8707
|
])
|
|
8698
8708
|
], 32),
|
|
8699
8709
|
g("div", {
|
|
8700
8710
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
8701
|
-
onMouseenter: p[8] || (p[8] = (
|
|
8702
|
-
onMouseleave: p[9] || (p[9] = (
|
|
8711
|
+
onMouseenter: p[8] || (p[8] = (C) => i.value = !0),
|
|
8712
|
+
onMouseleave: p[9] || (p[9] = (C) => i.value = !1)
|
|
8703
8713
|
}, [
|
|
8704
8714
|
p[16] || (p[16] = g("span", null, "光源", -1)),
|
|
8705
|
-
|
|
8715
|
+
k(g("div", id, [
|
|
8706
8716
|
g("div", {
|
|
8707
8717
|
class: "menu-item",
|
|
8708
|
-
onClick: p[7] || (p[7] = (
|
|
8718
|
+
onClick: p[7] || (p[7] = (C) => o("addModel", "directionalLight"))
|
|
8709
8719
|
}, " 平行光 ")
|
|
8710
8720
|
], 512), [
|
|
8711
|
-
[
|
|
8721
|
+
[Ye, i.value]
|
|
8712
8722
|
])
|
|
8713
8723
|
], 32),
|
|
8714
8724
|
g("div", {
|
|
@@ -8717,19 +8727,19 @@ function myFunc() {
|
|
|
8717
8727
|
}, "摄像机"),
|
|
8718
8728
|
g("div", {
|
|
8719
8729
|
class: "menu-item",
|
|
8720
|
-
onClick: p[10] || (p[10] = (
|
|
8730
|
+
onClick: p[10] || (p[10] = (C) => o("addModel", "dataPanel"))
|
|
8721
8731
|
}, " 数据面板 ")
|
|
8722
8732
|
], 512), [
|
|
8723
|
-
[
|
|
8733
|
+
[Ye, n.value]
|
|
8724
8734
|
])
|
|
8725
8735
|
], 32),
|
|
8726
8736
|
g("div", {
|
|
8727
8737
|
class: "dropdown-wrapper",
|
|
8728
|
-
onMouseenter: p[13] || (p[13] = (
|
|
8729
|
-
onMouseleave: p[14] || (p[14] = (
|
|
8738
|
+
onMouseenter: p[13] || (p[13] = (C) => t.value = !0),
|
|
8739
|
+
onMouseleave: p[14] || (p[14] = (C) => t.value = !1)
|
|
8730
8740
|
}, [
|
|
8731
8741
|
p[19] || (p[19] = g("button", { class: "menu-btn" }, "帮助", -1)),
|
|
8732
|
-
|
|
8742
|
+
k(g("div", od, [
|
|
8733
8743
|
g("div", {
|
|
8734
8744
|
class: "menu-item",
|
|
8735
8745
|
onClick: A
|
|
@@ -8744,7 +8754,7 @@ function myFunc() {
|
|
|
8744
8754
|
}, " 重置相机位置 "),
|
|
8745
8755
|
p[18] || (p[18] = g("div", { class: "menu-divider" }, null, -1))
|
|
8746
8756
|
], 512), [
|
|
8747
|
-
[
|
|
8757
|
+
[Ye, t.value]
|
|
8748
8758
|
])
|
|
8749
8759
|
], 32)
|
|
8750
8760
|
]),
|
|
@@ -8761,10 +8771,10 @@ function myFunc() {
|
|
|
8761
8771
|
}, null, 544)
|
|
8762
8772
|
]));
|
|
8763
8773
|
}
|
|
8764
|
-
}),
|
|
8774
|
+
}), ad = /* @__PURE__ */ Je(rd, [["__scopeId", "data-v-9cee44a7"]]), ld = { class: "bottom-bar" }, cd = /* @__PURE__ */ Qe({
|
|
8765
8775
|
__name: "BottomBar",
|
|
8766
8776
|
setup(r) {
|
|
8767
|
-
return (e, t) => (H(),
|
|
8777
|
+
return (e, t) => (H(), j("div", ld, t[0] || (t[0] = [
|
|
8768
8778
|
g("div", { class: "status-left" }, [
|
|
8769
8779
|
g("span", null, "就绪")
|
|
8770
8780
|
], -1),
|
|
@@ -8773,10 +8783,10 @@ function myFunc() {
|
|
|
8773
8783
|
], -1)
|
|
8774
8784
|
])));
|
|
8775
8785
|
}
|
|
8776
|
-
}),
|
|
8786
|
+
}), ud = /* @__PURE__ */ Je(cd, [["__scopeId", "data-v-3427bb27"]]), dd = { class: "app-layout" }, fd = {
|
|
8777
8787
|
key: 0,
|
|
8778
8788
|
class: "loading-overlay"
|
|
8779
|
-
},
|
|
8789
|
+
}, hd = ["title", "onClick"], pd = /* @__PURE__ */ Qe({
|
|
8780
8790
|
__name: "DrawingBoard",
|
|
8781
8791
|
props: {
|
|
8782
8792
|
mode: { default: "edit" },
|
|
@@ -8787,7 +8797,7 @@ function myFunc() {
|
|
|
8787
8797
|
cl((M) => {
|
|
8788
8798
|
t.value = M;
|
|
8789
8799
|
});
|
|
8790
|
-
const n = en(null), s =
|
|
8800
|
+
const n = en(null), s = os({
|
|
8791
8801
|
position: { x: 0, y: 0, z: 0 },
|
|
8792
8802
|
rotation: { x: 0, y: 0, z: 0 },
|
|
8793
8803
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -8820,37 +8830,37 @@ function myFunc() {
|
|
|
8820
8830
|
} catch (D) {
|
|
8821
8831
|
console.error("导入失败:", D), alert("导入失败:" + D.message);
|
|
8822
8832
|
}
|
|
8823
|
-
},
|
|
8833
|
+
}, f = en([]);
|
|
8824
8834
|
xl((M) => {
|
|
8825
|
-
|
|
8835
|
+
f.value = M;
|
|
8826
8836
|
});
|
|
8827
8837
|
const u = () => {
|
|
8828
8838
|
const M = Ei();
|
|
8829
|
-
M && (
|
|
8839
|
+
M && (f.value = M);
|
|
8830
8840
|
}, A = (M) => ps(M), m = (M) => Ti(M.uuid), b = (M) => {
|
|
8831
8841
|
xi(M);
|
|
8832
|
-
}, h = (M) => Za(M), p =
|
|
8842
|
+
}, h = (M) => Za(M), p = st(
|
|
8833
8843
|
() => Se.scripts.filter((M) => !mi(M))
|
|
8834
|
-
),
|
|
8835
|
-
function
|
|
8844
|
+
), C = W(13);
|
|
8845
|
+
function v() {
|
|
8836
8846
|
const Z = window.innerWidth / 1920, _ = Math.min(Math.max(Z, 0.6), 4);
|
|
8837
8847
|
return Math.round(13 * _);
|
|
8838
8848
|
}
|
|
8839
|
-
const
|
|
8840
|
-
|
|
8841
|
-
},
|
|
8842
|
-
|
|
8849
|
+
const w = () => {
|
|
8850
|
+
C.value = v();
|
|
8851
|
+
}, d = W(null), x = async () => {
|
|
8852
|
+
d.value && await _a(d.value, e.mode, e.sceneData), u();
|
|
8843
8853
|
};
|
|
8844
8854
|
return oo(() => {
|
|
8845
|
-
|
|
8855
|
+
x(), d.value && Hr(d.value), C.value = v(), window.addEventListener("resize", w);
|
|
8846
8856
|
}), ro(() => {
|
|
8847
|
-
console.log("endset_three_editor destroy"), window.removeEventListener("resize",
|
|
8848
|
-
}), (M, D) => (H(),
|
|
8849
|
-
t.value ? (H(),
|
|
8857
|
+
console.log("endset_three_editor destroy"), window.removeEventListener("resize", w), Hl();
|
|
8858
|
+
}), (M, D) => (H(), j("div", dd, [
|
|
8859
|
+
t.value ? (H(), j("div", fd, D[0] || (D[0] = [
|
|
8850
8860
|
g("div", { class: "loading-spinner" }, null, -1),
|
|
8851
8861
|
g("div", { class: "loading-text" }, "加载中...", -1)
|
|
8852
8862
|
]))) : re("", !0),
|
|
8853
|
-
M.mode === "edit" ? (H(), Mt(
|
|
8863
|
+
M.mode === "edit" ? (H(), Mt(ad, {
|
|
8854
8864
|
key: 1,
|
|
8855
8865
|
onAddModel: l,
|
|
8856
8866
|
onImportModel: c
|
|
@@ -8861,25 +8871,25 @@ function myFunc() {
|
|
|
8861
8871
|
g("div", {
|
|
8862
8872
|
class: Pe(`canvas canvas-mode-${M.mode}`),
|
|
8863
8873
|
ref_key: "containerRef",
|
|
8864
|
-
ref:
|
|
8874
|
+
ref: d
|
|
8865
8875
|
}, [
|
|
8866
|
-
p.value.length > 0 ? (H(),
|
|
8876
|
+
p.value.length > 0 ? (H(), j("div", {
|
|
8867
8877
|
key: 0,
|
|
8868
8878
|
class: "script-bar",
|
|
8869
|
-
style: ao({ fontSize:
|
|
8879
|
+
style: ao({ fontSize: C.value + "px" })
|
|
8870
8880
|
}, [
|
|
8871
|
-
(H(!0),
|
|
8881
|
+
(H(!0), j(Ee, null, mt(p.value, (E, U) => (H(), j("button", {
|
|
8872
8882
|
key: E.id,
|
|
8873
8883
|
class: "script-trigger-btn",
|
|
8874
8884
|
title: E.code,
|
|
8875
|
-
onClick:
|
|
8876
|
-
}, " ▶ " +
|
|
8885
|
+
onClick: St((Z) => h(E.id), ["stop"])
|
|
8886
|
+
}, " ▶ " + ue(rs(Qa)(E, U)), 9, hd))), 128))
|
|
8877
8887
|
], 4)) : re("", !0)
|
|
8878
8888
|
], 2),
|
|
8879
|
-
M.mode === "edit" ? (H(), Mt(
|
|
8889
|
+
M.mode === "edit" ? (H(), Mt($u, {
|
|
8880
8890
|
key: 0,
|
|
8881
8891
|
transform: s,
|
|
8882
|
-
"tree-data":
|
|
8892
|
+
"tree-data": f.value,
|
|
8883
8893
|
"selected-object": n.value,
|
|
8884
8894
|
onPropertyChange: a,
|
|
8885
8895
|
onTreeSelect: A,
|
|
@@ -8887,16 +8897,16 @@ function myFunc() {
|
|
|
8887
8897
|
onTransformModeChange: b
|
|
8888
8898
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : re("", !0)
|
|
8889
8899
|
], 2),
|
|
8890
|
-
M.mode === "edit" ? (H(), Mt(
|
|
8900
|
+
M.mode === "edit" ? (H(), Mt(ud, { key: 2 })) : re("", !0)
|
|
8891
8901
|
]));
|
|
8892
8902
|
}
|
|
8893
|
-
}),
|
|
8903
|
+
}), Ld = /* @__PURE__ */ Je(pd, [["__scopeId", "data-v-79b9d552"]]);
|
|
8894
8904
|
export {
|
|
8895
|
-
|
|
8905
|
+
ud as BottomBar,
|
|
8896
8906
|
us as DataPanel,
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8907
|
+
Ld as DrawingBoard,
|
|
8908
|
+
$u as PropertyPanel,
|
|
8909
|
+
ad as TopBar,
|
|
8900
8910
|
Jl as TreeItem,
|
|
8901
8911
|
Ni as addBox,
|
|
8902
8912
|
Gi as addDataPanel,
|
|
@@ -8912,9 +8922,9 @@ export {
|
|
|
8912
8922
|
Fr as disposeCSS2DRenderer,
|
|
8913
8923
|
Sl as exportSceneToJSON,
|
|
8914
8924
|
wi as focusOnObject,
|
|
8915
|
-
|
|
8925
|
+
bd as getCSS2DRenderer,
|
|
8916
8926
|
Gs as getCamera,
|
|
8917
|
-
|
|
8927
|
+
Ut as getDataPanel,
|
|
8918
8928
|
jn as getRenderer,
|
|
8919
8929
|
kn as getScene,
|
|
8920
8930
|
Ei as getSceneObjects,
|