endset_three_editor 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var gn = Object.defineProperty;
|
|
2
2
|
var bn = (r, e, t) => e in r ? gn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ue = (r, e, t) => bn(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as Wt, defineComponent as ve, ref as
|
|
4
|
+
import { toRaw as Wt, defineComponent as ve, ref as O, inject as Cn, computed as $e, watchEffect as In, resolveComponent as yn, openBlock as R, createElementBlock as P, createElementVNode as C, normalizeClass as oe, withModifiers as Yt, unref as xn, toDisplayString as $, Fragment as Pe, renderList as jt, createBlock as nt, createCommentVNode as Z, reactive as _t, watch as he, withDirectives as k, vModelText as N, withKeys as ze, vModelCheckbox as vn, toRef as Sn, provide as Tn, createVNode as zt, vShow as Le, shallowRef as ms, onMounted as Mn, onBeforeUnmount as wn } from "vue";
|
|
5
5
|
import * as w from "three";
|
|
6
|
-
import { Controls as qs, Vector3 as T, MOUSE as Ke, TOUCH as Ge, Quaternion as J, Spherical as gs, Vector2 as F, Ray as Rn, Plane as En, MathUtils as Vs, Raycaster as kn, Object3D as Ze, MeshBasicMaterial as Ne, LineBasicMaterial as it, CylinderGeometry as q, BoxGeometry as K, BufferGeometry as De, Float32BufferAttribute as le, Mesh as S, OctahedronGeometry as gt, Line as de, TorusGeometry as Ve, SphereGeometry as Pn, Euler as Ln, Matrix4 as
|
|
6
|
+
import { Controls as qs, Vector3 as T, MOUSE as Ke, TOUCH as Ge, Quaternion as J, Spherical as gs, Vector2 as F, Ray as Rn, Plane as En, MathUtils as Vs, Raycaster as kn, Object3D as Ze, MeshBasicMaterial as Ne, LineBasicMaterial as it, CylinderGeometry as q, BoxGeometry as K, BufferGeometry as De, Float32BufferAttribute as le, Mesh as S, OctahedronGeometry as gt, Line as de, TorusGeometry as Ve, SphereGeometry as Pn, Euler as Ln, Matrix4 as pe, PlaneGeometry as Nn, DoubleSide as Pt, OrthographicCamera as Js, ShaderMaterial as ke, UniformsUtils as ls, WebGLRenderTarget as be, HalfFloatType as Re, NoBlending as $t, Timer as On, Color as B, RawShaderMaterial as Dn, ColorManagement as Lt, SRGBTransfer as Wn, LinearToneMapping as jn, ReinhardToneMapping as Fn, CineonToneMapping as Un, ACESFilmicToneMapping as Hn, AgXToneMapping as zn, NeutralToneMapping as Gn, CustomToneMapping as Kn, MeshDepthMaterial as Bn, RGBADepthPacking as Zn, AdditiveBlending as Xn, Loader as As, FileLoader as ct, SRGBColorSpace as fe, Group as Tt, Material as ot, PointsMaterial as et, MeshPhongMaterial as qn, LineSegments as es, Points as Mt, TrianglesDrawMode as Vn, TriangleFanDrawMode as ts, TriangleStripDrawMode as Qs, LoaderUtils as rt, MeshPhysicalMaterial as ce, LinearSRGBColorSpace as Ae, SpotLight as Jn, PointLight as Qn, DirectionalLight as Yn, InstancedMesh as _n, InstancedBufferAttribute as $n, TextureLoader as ei, ImageBitmapLoader as ti, BufferAttribute as at, InterleavedBuffer as Ys, InterleavedBufferAttribute as _s, LinearMipmapLinearFilter as $s, NearestMipmapLinearFilter as si, LinearMipmapNearestFilter as ni, NearestMipmapNearestFilter as ii, LinearFilter as ss, NearestFilter as en, RepeatWrapping as ns, MirroredRepeatWrapping as oi, ClampToEdgeWrapping as ri, MeshStandardMaterial as tn, PropertyBinding as ai, SkinnedMesh as li, LineLoop as Ai, PerspectiveCamera as ci, Skeleton as ui, AnimationClip as di, Bone as hi, InterpolateDiscrete as fi, InterpolateLinear as sn, Texture as bs, VectorKeyframeTrack as Cs, NumberKeyframeTrack as Is, QuaternionKeyframeTrack as ys, FrontSide as pi, Interpolant as mi, Box3 as gi, Sphere as bi } from "three";
|
|
7
7
|
import ut from "@tweenjs/tween.js";
|
|
8
|
-
const xs = { type: "change" }, cs = { type: "start" }, nn = { type: "end" }, bt = new Rn(), vs = new En(), Ci = Math.cos(70 * Vs.DEG2RAD), z = new T(), V = 2 * Math.PI,
|
|
8
|
+
const xs = { type: "change" }, cs = { type: "start" }, nn = { type: "end" }, bt = new Rn(), vs = new En(), Ci = Math.cos(70 * Vs.DEG2RAD), z = new T(), V = 2 * Math.PI, D = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -23,7 +23,7 @@ class Ii extends qs {
|
|
|
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 =
|
|
26
|
+
super(e, t), this.state = D.NONE, this.target = new T(), this.cursor = new T(), 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: Ke.ROTATE, MIDDLE: Ke.DOLLY, RIGHT: Ke.PAN }, this.touches = { ONE: Ge.ROTATE, TWO: Ge.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 T(), this._lastQuaternion = new J(), this._lastTargetPosition = new T(), this._quat = new J().setFromUnitVectors(e.up, new T(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new gs(), this._sphericalDelta = new gs(), this._scale = 1, this._panOffset = new T(), this._rotateStart = new F(), this._rotateEnd = new F(), this._rotateDelta = new F(), this._panStart = new F(), this._panEnd = new F(), this._panDelta = new F(), this._dollyStart = new F(), this._dollyEnd = new F(), this._dollyDelta = new F(), this._dollyDirection = new T(), this._mouse = new F(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = xi.bind(this), this._onPointerDown = yi.bind(this), this._onPointerUp = vi.bind(this), this._onContextMenu = ki.bind(this), this._onMouseWheel = Mi.bind(this), this._onKeyDown = wi.bind(this), this._onTouchStart = Ri.bind(this), this._onTouchMove = Ei.bind(this), this._onMouseDown = Si.bind(this), this._onMouseMove = Ti.bind(this), this._interceptControlDown = Pi.bind(this), this._interceptControlUp = Li.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Defines the visual representation of the cursor.
|
|
@@ -96,7 +96,7 @@ class Ii extends qs {
|
|
|
96
96
|
* was called, or the initial state.
|
|
97
97
|
*/
|
|
98
98
|
reset() {
|
|
99
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(xs), this.update(), this.state =
|
|
99
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(xs), this.update(), this.state = D.NONE;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Programmatically pan the camera.
|
|
@@ -141,7 +141,7 @@ class Ii extends qs {
|
|
|
141
141
|
}
|
|
142
142
|
update(e = null) {
|
|
143
143
|
const t = this.object.position;
|
|
144
|
-
z.copy(t).sub(this.target), z.applyQuaternion(this._quat), this._spherical.setFromVector3(z), this.autoRotate && this.state ===
|
|
144
|
+
z.copy(t).sub(this.target), z.applyQuaternion(this._quat), this._spherical.setFromVector3(z), this.autoRotate && this.state === D.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
145
145
|
let n = this.minAzimuthAngle, s = this.maxAzimuthAngle;
|
|
146
146
|
isFinite(n) && isFinite(s) && (n < -Math.PI ? n += V : n > Math.PI && (n -= V), s < -Math.PI ? s += V : s > Math.PI && (s -= V), n <= s ? this._spherical.theta = Math.max(n, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + s) / 2 ? Math.max(n, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
147
147
|
let i = !1;
|
|
@@ -373,7 +373,7 @@ function xi(r) {
|
|
|
373
373
|
function vi(r) {
|
|
374
374
|
switch (this._removePointer(r), this._pointers.length) {
|
|
375
375
|
case 0:
|
|
376
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(nn), this.state =
|
|
376
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(nn), this.state = D.NONE, this._cursorStyle === "grab" && (this.domElement.style.cursor = "grab");
|
|
377
377
|
break;
|
|
378
378
|
case 1:
|
|
379
379
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -399,49 +399,49 @@ function Si(r) {
|
|
|
399
399
|
switch (e) {
|
|
400
400
|
case Ke.DOLLY:
|
|
401
401
|
if (this.enableZoom === !1) return;
|
|
402
|
-
this._handleMouseDownDolly(r), this.state =
|
|
402
|
+
this._handleMouseDownDolly(r), this.state = D.DOLLY;
|
|
403
403
|
break;
|
|
404
404
|
case Ke.ROTATE:
|
|
405
405
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
406
406
|
if (this.enablePan === !1) return;
|
|
407
|
-
this._handleMouseDownPan(r), this.state =
|
|
407
|
+
this._handleMouseDownPan(r), this.state = D.PAN;
|
|
408
408
|
} else {
|
|
409
409
|
if (this.enableRotate === !1) return;
|
|
410
|
-
this._handleMouseDownRotate(r), this.state =
|
|
410
|
+
this._handleMouseDownRotate(r), this.state = D.ROTATE;
|
|
411
411
|
}
|
|
412
412
|
break;
|
|
413
413
|
case Ke.PAN:
|
|
414
414
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
415
415
|
if (this.enableRotate === !1) return;
|
|
416
|
-
this._handleMouseDownRotate(r), this.state =
|
|
416
|
+
this._handleMouseDownRotate(r), this.state = D.ROTATE;
|
|
417
417
|
} else {
|
|
418
418
|
if (this.enablePan === !1) return;
|
|
419
|
-
this._handleMouseDownPan(r), this.state =
|
|
419
|
+
this._handleMouseDownPan(r), this.state = D.PAN;
|
|
420
420
|
}
|
|
421
421
|
break;
|
|
422
422
|
default:
|
|
423
|
-
this.state =
|
|
423
|
+
this.state = D.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !==
|
|
425
|
+
this.state !== D.NONE && this.dispatchEvent(cs);
|
|
426
426
|
}
|
|
427
427
|
function Ti(r) {
|
|
428
428
|
switch (this.state) {
|
|
429
|
-
case
|
|
429
|
+
case D.ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
431
431
|
this._handleMouseMoveRotate(r);
|
|
432
432
|
break;
|
|
433
|
-
case
|
|
433
|
+
case D.DOLLY:
|
|
434
434
|
if (this.enableZoom === !1) return;
|
|
435
435
|
this._handleMouseMoveDolly(r);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case D.PAN:
|
|
438
438
|
if (this.enablePan === !1) return;
|
|
439
439
|
this._handleMouseMovePan(r);
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function Mi(r) {
|
|
444
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
444
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== D.NONE || (r.preventDefault(), this.dispatchEvent(cs), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(nn));
|
|
445
445
|
}
|
|
446
446
|
function wi(r) {
|
|
447
447
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -452,55 +452,55 @@ function Ri(r) {
|
|
|
452
452
|
switch (this.touches.ONE) {
|
|
453
453
|
case Ge.ROTATE:
|
|
454
454
|
if (this.enableRotate === !1) return;
|
|
455
|
-
this._handleTouchStartRotate(r), this.state =
|
|
455
|
+
this._handleTouchStartRotate(r), this.state = D.TOUCH_ROTATE;
|
|
456
456
|
break;
|
|
457
457
|
case Ge.PAN:
|
|
458
458
|
if (this.enablePan === !1) return;
|
|
459
|
-
this._handleTouchStartPan(r), this.state =
|
|
459
|
+
this._handleTouchStartPan(r), this.state = D.TOUCH_PAN;
|
|
460
460
|
break;
|
|
461
461
|
default:
|
|
462
|
-
this.state =
|
|
462
|
+
this.state = D.NONE;
|
|
463
463
|
}
|
|
464
464
|
break;
|
|
465
465
|
case 2:
|
|
466
466
|
switch (this.touches.TWO) {
|
|
467
467
|
case Ge.DOLLY_PAN:
|
|
468
468
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
469
|
-
this._handleTouchStartDollyPan(r), this.state =
|
|
469
|
+
this._handleTouchStartDollyPan(r), this.state = D.TOUCH_DOLLY_PAN;
|
|
470
470
|
break;
|
|
471
471
|
case Ge.DOLLY_ROTATE:
|
|
472
472
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
473
|
-
this._handleTouchStartDollyRotate(r), this.state =
|
|
473
|
+
this._handleTouchStartDollyRotate(r), this.state = D.TOUCH_DOLLY_ROTATE;
|
|
474
474
|
break;
|
|
475
475
|
default:
|
|
476
|
-
this.state =
|
|
476
|
+
this.state = D.NONE;
|
|
477
477
|
}
|
|
478
478
|
break;
|
|
479
479
|
default:
|
|
480
|
-
this.state =
|
|
480
|
+
this.state = D.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !==
|
|
482
|
+
this.state !== D.NONE && this.dispatchEvent(cs);
|
|
483
483
|
}
|
|
484
484
|
function Ei(r) {
|
|
485
485
|
switch (this._trackPointer(r), this.state) {
|
|
486
|
-
case
|
|
486
|
+
case D.TOUCH_ROTATE:
|
|
487
487
|
if (this.enableRotate === !1) return;
|
|
488
488
|
this._handleTouchMoveRotate(r), this.update();
|
|
489
489
|
break;
|
|
490
|
-
case
|
|
490
|
+
case D.TOUCH_PAN:
|
|
491
491
|
if (this.enablePan === !1) return;
|
|
492
492
|
this._handleTouchMovePan(r), this.update();
|
|
493
493
|
break;
|
|
494
|
-
case
|
|
494
|
+
case D.TOUCH_DOLLY_PAN:
|
|
495
495
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
496
496
|
this._handleTouchMoveDollyPan(r), this.update();
|
|
497
497
|
break;
|
|
498
|
-
case
|
|
498
|
+
case D.TOUCH_DOLLY_ROTATE:
|
|
499
499
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
500
500
|
this._handleTouchMoveDollyRotate(r), this.update();
|
|
501
501
|
break;
|
|
502
502
|
default:
|
|
503
|
-
this.state =
|
|
503
|
+
this.state = D.NONE;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function ki(r) {
|
|
@@ -512,7 +512,7 @@ function Pi(r) {
|
|
|
512
512
|
function Li(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const Me = new kn(), G = new T(),
|
|
515
|
+
const Me = new kn(), G = new T(), me = new T(), j = new J(), Ss = {
|
|
516
516
|
X: new T(1, 0, 0),
|
|
517
517
|
Y: new T(0, 1, 0),
|
|
518
518
|
Z: new T(0, 0, 1)
|
|
@@ -533,20 +533,20 @@ class Ni extends qs {
|
|
|
533
533
|
const i = new zi();
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(
|
|
537
|
-
let v =
|
|
538
|
-
Object.defineProperty(o,
|
|
536
|
+
function a(y, x) {
|
|
537
|
+
let v = x;
|
|
538
|
+
Object.defineProperty(o, y, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return v !== void 0 ? v :
|
|
540
|
+
return v !== void 0 ? v : x;
|
|
541
541
|
},
|
|
542
542
|
set: function(M) {
|
|
543
|
-
v !== M && (v = M, i[
|
|
543
|
+
v !== M && (v = M, i[y] = M, s[y] = M, o.dispatchEvent({ type: y + "-changed", value: M }), o.dispatchEvent(Kt));
|
|
544
544
|
}
|
|
545
|
-
}), o[
|
|
545
|
+
}), o[y] = x, i[y] = x, s[y] = x;
|
|
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 T(), A = new T(), d = new J(), c = new J(), u = new T(), h = new J(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", A), a("worldQuaternion", d), a("worldQuaternionStart", c), a("cameraPosition", u), a("cameraQuaternion", h), a("pointStart",
|
|
548
|
+
const l = new T(), A = new T(), d = new J(), c = new J(), u = new T(), h = new J(), f = new T(), p = new T(), m = new T(), g = 0, I = new T();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", A), a("worldQuaternion", d), a("worldQuaternionStart", c), a("cameraPosition", u), a("cameraQuaternion", h), a("pointStart", f), a("pointEnd", p), a("rotationAxis", m), a("rotationAngle", g), a("eye", I), this._offset = new T(), this._startNorm = new T(), this._endNorm = new T(), this._cameraScale = new T(), this._parentPosition = new T(), this._parentQuaternion = new J(), this._parentQuaternionInv = new J(), this._parentScale = new T(), this._worldScaleStart = new T(), this._worldQuaternionInv = new J(), this._worldScale = new T(), this._positionStart = new T(), this._quaternionStart = new J(), this._scaleStart = new T(), this._getPointer = Oi.bind(this), this._onPointerDown = Wi.bind(this), this._onPointerHover = Di.bind(this), this._onPointerMove = ji.bind(this), this._onPointerUp = Fi.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";
|
|
@@ -588,10 +588,10 @@ class Ni extends qs {
|
|
|
588
588
|
else if (n === "scale") {
|
|
589
589
|
if (t.search("XYZ") !== -1) {
|
|
590
590
|
let a = this.pointEnd.length() / this.pointStart.length();
|
|
591
|
-
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1),
|
|
591
|
+
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), me.set(a, a, a);
|
|
592
592
|
} else
|
|
593
|
-
G.copy(this.pointStart),
|
|
594
|
-
s.scale.copy(this._scaleStart).multiply(
|
|
593
|
+
G.copy(this.pointStart), me.copy(this.pointEnd), G.applyQuaternion(this._worldQuaternionInv), me.applyQuaternion(this._worldQuaternionInv), me.divide(G), t.search("X") === -1 && (me.x = 1), t.search("Y") === -1 && (me.y = 1), t.search("Z") === -1 && (me.z = 1);
|
|
594
|
+
s.scale.copy(this._scaleStart).multiply(me), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
595
595
|
} else if (n === "rotate") {
|
|
596
596
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
597
597
|
const a = 20 / this.worldPosition.distanceTo(G.setFromMatrixPosition(this.camera.matrixWorld));
|
|
@@ -749,7 +749,7 @@ function Bt(r, e, t) {
|
|
|
749
749
|
return n[s];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const Ct = new Ln(),
|
|
752
|
+
const Ct = new Ln(), W = new T(0, 1, 0), Rs = new T(0, 0, 0), Es = new pe(), It = new J(), wt = new J(), re = new T(), ks = new pe(), tt = new T(1, 0, 0), Ee = new T(0, 1, 0), st = new T(0, 0, 1), yt = new T(), Je = new T(), Qe = new T();
|
|
753
753
|
class Ui extends Ze {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -802,8 +802,8 @@ class Hi extends Ze {
|
|
|
802
802
|
u.color.setHex(16776960), u.opacity = 0.25;
|
|
803
803
|
const h = e.clone();
|
|
804
804
|
h.color.setHex(16776960);
|
|
805
|
-
const
|
|
806
|
-
|
|
805
|
+
const f = e.clone();
|
|
806
|
+
f.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
@@ -813,36 +813,36 @@ class Hi extends Ze {
|
|
|
813
813
|
zAxisTransparent: d,
|
|
814
814
|
activeTransparent: u
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
|
|
816
|
+
const p = new q(0, 0.04, 0.1, 12);
|
|
817
|
+
p.translate(0, 0.05, 0);
|
|
818
|
+
const m = new K(0.08, 0.08, 0.08);
|
|
819
|
+
m.translate(0, 0.04, 0);
|
|
820
|
+
const g = new De();
|
|
821
|
+
g.setAttribute("position", new le([0, 0, 0, 1, 0, 0], 3));
|
|
822
822
|
const I = new q(75e-4, 75e-4, 0.5, 3);
|
|
823
823
|
I.translate(0, 0.25, 0);
|
|
824
|
-
function
|
|
825
|
-
const ie = new Ve(
|
|
824
|
+
function y(te, ht) {
|
|
825
|
+
const ie = new Ve(te, 75e-4, 3, 64, ht * Math.PI * 2);
|
|
826
826
|
return ie.rotateY(Math.PI / 2), ie.rotateX(Math.PI / 2), ie;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
const
|
|
830
|
-
return
|
|
828
|
+
function x() {
|
|
829
|
+
const te = new De();
|
|
830
|
+
return te.setAttribute("position", new le([0, 0, 0, 1, 1, 1], 3)), te;
|
|
831
831
|
}
|
|
832
832
|
const v = {
|
|
833
833
|
X: [
|
|
834
|
-
[new S(
|
|
835
|
-
[new S(
|
|
834
|
+
[new S(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new S(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
836
|
[new S(I, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new S(
|
|
840
|
-
[new S(
|
|
839
|
+
[new S(p, o), [0, 0.5, 0]],
|
|
840
|
+
[new S(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
841
|
[new S(I, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new S(
|
|
845
|
-
[new S(
|
|
844
|
+
[new S(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new S(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
846
|
[new S(I, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
@@ -890,36 +890,36 @@ class Hi extends Ze {
|
|
|
890
890
|
[new S(new gt(0.01, 2), s), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new de(
|
|
893
|
+
[new de(x(), s), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
|
-
[new de(
|
|
896
|
+
[new de(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
897
897
|
],
|
|
898
898
|
Y: [
|
|
899
|
-
[new de(
|
|
899
|
+
[new de(g, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
900
900
|
],
|
|
901
901
|
Z: [
|
|
902
|
-
[new de(
|
|
902
|
+
[new de(g, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
903
903
|
]
|
|
904
904
|
}, Q = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new S(
|
|
906
|
+
[new S(y(0.5, 1), f), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
|
-
[new S(
|
|
909
|
+
[new S(y(0.5, 0.5), i)]
|
|
910
910
|
],
|
|
911
911
|
Y: [
|
|
912
|
-
[new S(
|
|
912
|
+
[new S(y(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
|
|
913
913
|
],
|
|
914
914
|
Z: [
|
|
915
|
-
[new S(
|
|
915
|
+
[new S(y(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
|
|
916
916
|
],
|
|
917
917
|
E: [
|
|
918
|
-
[new S(
|
|
918
|
+
[new S(y(0.75, 1), u), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
|
-
},
|
|
920
|
+
}, ee = {
|
|
921
921
|
AXIS: [
|
|
922
|
-
[new de(
|
|
922
|
+
[new de(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
923
923
|
]
|
|
924
924
|
}, Y = {
|
|
925
925
|
XYZE: [
|
|
@@ -939,19 +939,19 @@ class Hi extends Ze {
|
|
|
939
939
|
]
|
|
940
940
|
}, Te = {
|
|
941
941
|
X: [
|
|
942
|
-
[new S(
|
|
942
|
+
[new S(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
943
|
[new S(I, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
|
-
[new S(
|
|
944
|
+
[new S(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
|
-
[new S(
|
|
947
|
+
[new S(m, o), [0, 0.5, 0]],
|
|
948
948
|
[new S(I, o)],
|
|
949
|
-
[new S(
|
|
949
|
+
[new S(m, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
|
-
[new S(
|
|
952
|
+
[new S(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
953
|
[new S(I, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
|
-
[new S(
|
|
954
|
+
[new S(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
957
|
[new S(new K(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
@@ -992,27 +992,27 @@ class Hi extends Ze {
|
|
|
992
992
|
]
|
|
993
993
|
}, pn = {
|
|
994
994
|
X: [
|
|
995
|
-
[new de(
|
|
995
|
+
[new de(g, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
996
996
|
],
|
|
997
997
|
Y: [
|
|
998
|
-
[new de(
|
|
998
|
+
[new de(g, s), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
|
|
999
999
|
],
|
|
1000
1000
|
Z: [
|
|
1001
|
-
[new de(
|
|
1001
|
+
[new de(g, s), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1002
1002
|
]
|
|
1003
1003
|
};
|
|
1004
|
-
function ue(
|
|
1004
|
+
function ue(te) {
|
|
1005
1005
|
const ht = new Ze();
|
|
1006
|
-
for (const ie in
|
|
1007
|
-
for (let Fe =
|
|
1008
|
-
const X =
|
|
1006
|
+
for (const ie in te)
|
|
1007
|
+
for (let Fe = te[ie].length; Fe--; ) {
|
|
1008
|
+
const X = te[ie][Fe][0].clone(), ft = te[ie][Fe][1], pt = te[ie][Fe][2], mt = te[ie][Fe][3], mn = te[ie][Fe][4];
|
|
1009
1009
|
X.name = ie, X.tag = mn, ft && X.position.set(ft[0], ft[1], ft[2]), pt && X.rotation.set(pt[0], pt[1], pt[2]), mt && X.scale.set(mt[0], mt[1], mt[2]), X.updateMatrix();
|
|
1010
1010
|
const ps = X.geometry.clone();
|
|
1011
1011
|
ps.applyMatrix4(X.matrix), X.geometry = ps, X.renderOrder = 1 / 0, X.position.set(0, 0, 0), X.rotation.set(0, 0, 0), X.scale.set(1, 1, 1), ht.add(X);
|
|
1012
1012
|
}
|
|
1013
1013
|
return ht;
|
|
1014
1014
|
}
|
|
1015
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ue(v)), this.add(this.gizmo.rotate = ue(Q)), this.add(this.gizmo.scale = ue(Te)), this.add(this.picker.translate = ue(M)), this.add(this.picker.rotate = ue(Y)), this.add(this.picker.scale = ue(Ht)), this.add(this.helper.translate = ue(L)), this.add(this.helper.rotate = ue(
|
|
1015
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ue(v)), this.add(this.gizmo.rotate = ue(Q)), this.add(this.gizmo.scale = ue(Te)), this.add(this.picker.translate = ue(M)), this.add(this.picker.rotate = ue(Y)), this.add(this.picker.scale = ue(Ht)), this.add(this.helper.translate = ue(L)), this.add(this.helper.rotate = ue(ee)), this.add(this.helper.scale = ue(pn)), 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) {
|
|
@@ -1025,10 +1025,10 @@ class Hi extends Ze {
|
|
|
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" && (j.setFromEuler(Ct.set(0, 0, 0)), o.quaternion.copy(n).multiply(j), Math.abs(
|
|
1028
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Ct.set(0, 0, 0)), o.quaternion.copy(n).multiply(j), Math.abs(W.copy(tt).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (j.setFromEuler(Ct.set(0, 0, Math.PI / 2)), o.quaternion.copy(n).multiply(j), Math.abs(W.copy(Ee).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (j.setFromEuler(Ct.set(0, Math.PI / 2, 0)), o.quaternion.copy(n).multiply(j), Math.abs(W.copy(st).applyQuaternion(n).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(Ct.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(Es.lookAt(Rs, W, Ee)), o.quaternion.multiply(j), 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), G.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), G.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(G), 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(
|
|
1031
|
+
o.quaternion.copy(n), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(W.copy(tt).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(W.copy(Ee).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(W.copy(st).applyQuaternion(n).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(W.copy(st).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(W.copy(tt).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(W.copy(Ee).applyQuaternion(n).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (It.copy(n), W.copy(this.eye).applyQuaternion(j.copy(n).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(Es.lookAt(this.eye, Rs, Ee)), o.name === "X" && (j.setFromAxisAngle(tt, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(It, j), o.quaternion.copy(j)), o.name === "Y" && (j.setFromAxisAngle(Ee, Math.atan2(W.x, W.z)), j.multiplyQuaternions(It, j), o.quaternion.copy(j)), o.name === "Z" && (j.setFromAxisAngle(st, Math.atan2(W.y, W.x)), j.multiplyQuaternions(It, j), o.quaternion.copy(j))), 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,18 +1044,18 @@ class zi extends S {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
1046
1046
|
let t = this.space;
|
|
1047
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), yt.copy(tt).applyQuaternion(t === "local" ? this.worldQuaternion : wt), Je.copy(Ee).applyQuaternion(t === "local" ? this.worldQuaternion : wt), Qe.copy(st).applyQuaternion(t === "local" ? this.worldQuaternion : wt),
|
|
1047
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), yt.copy(tt).applyQuaternion(t === "local" ? this.worldQuaternion : wt), Je.copy(Ee).applyQuaternion(t === "local" ? this.worldQuaternion : wt), Qe.copy(st).applyQuaternion(t === "local" ? this.worldQuaternion : wt), W.copy(Je), this.mode) {
|
|
1048
1048
|
case "translate":
|
|
1049
1049
|
case "scale":
|
|
1050
1050
|
switch (this.axis) {
|
|
1051
1051
|
case "X":
|
|
1052
|
-
|
|
1052
|
+
W.copy(this.eye).cross(yt), re.copy(yt).cross(W);
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "Y":
|
|
1055
|
-
|
|
1055
|
+
W.copy(this.eye).cross(Je), re.copy(Je).cross(W);
|
|
1056
1056
|
break;
|
|
1057
1057
|
case "Z":
|
|
1058
|
-
|
|
1058
|
+
W.copy(this.eye).cross(Qe), re.copy(Qe).cross(W);
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "XY":
|
|
1061
1061
|
re.copy(Qe);
|
|
@@ -1064,7 +1064,7 @@ class zi extends S {
|
|
|
1064
1064
|
re.copy(yt);
|
|
1065
1065
|
break;
|
|
1066
1066
|
case "XZ":
|
|
1067
|
-
|
|
1067
|
+
W.copy(Qe), re.copy(Je);
|
|
1068
1068
|
break;
|
|
1069
1069
|
case "XYZ":
|
|
1070
1070
|
case "E":
|
|
@@ -1076,7 +1076,7 @@ class zi extends S {
|
|
|
1076
1076
|
default:
|
|
1077
1077
|
re.set(0, 0, 0);
|
|
1078
1078
|
}
|
|
1079
|
-
re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (ks.lookAt(G.set(0, 0, 0), re,
|
|
1079
|
+
re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (ks.lookAt(G.set(0, 0, 0), re, W), this.quaternion.setFromRotationMatrix(ks)), super.updateMatrixWorld(e);
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
const on = {
|
|
@@ -1302,7 +1302,7 @@ class qi {
|
|
|
1302
1302
|
constructor(e, t) {
|
|
1303
1303
|
if (this.renderer = e, this._pixelRatio = e.getPixelRatio(), t === void 0) {
|
|
1304
1304
|
const n = e.getSize(new F());
|
|
1305
|
-
this._width = n.width, this._height = n.height, t = new
|
|
1305
|
+
this._width = n.width, this._height = n.height, t = new be(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: Re }), t.texture.name = "EffectComposer.rt1";
|
|
1306
1306
|
} else
|
|
1307
1307
|
this._width = t.width, this._height = t.height;
|
|
1308
1308
|
this.renderTarget1 = t, this.renderTarget2 = t.clone(), this.renderTarget2.texture.name = "EffectComposer.rt2", this.writeBuffer = this.renderTarget1, this.readBuffer = this.renderTarget2, this.renderToScreen = !0, this.passes = [], this.copyPass = new Zi(on), this.copyPass.material.blending = $t, this.timer = new On();
|
|
@@ -1586,7 +1586,7 @@ class Ce extends qe {
|
|
|
1586
1586
|
constructor(e, t, n, s) {
|
|
1587
1587
|
super(), this.renderScene = t, this.renderCamera = n, this.selectedObjects = s !== void 0 ? s : [], this.visibleEdgeColor = new B(1, 1, 1), this.hiddenEdgeColor = new B(0.1, 0.04, 0.02), this.edgeGlow = 0, this.usePatternTexture = !1, this.patternTexture = null, this.edgeThickness = 1, this.edgeStrength = 3, this.downSampleRatio = 2, this.pulsePeriod = 0, this._visibilityCache = /* @__PURE__ */ new Map(), this._selectionCache = /* @__PURE__ */ new Set(), this.resolution = e !== void 0 ? new F(e.x, e.y) : new F(256, 256);
|
|
1588
1588
|
const i = Math.round(this.resolution.x / this.downSampleRatio), o = Math.round(this.resolution.y / this.downSampleRatio);
|
|
1589
|
-
this.renderTargetMaskBuffer = new
|
|
1589
|
+
this.renderTargetMaskBuffer = new be(this.resolution.x, this.resolution.y), this.renderTargetMaskBuffer.texture.name = "OutlinePass.mask", this.renderTargetMaskBuffer.texture.generateMipmaps = !1, this.depthMaterial = new Bn(), this.depthMaterial.side = Pt, this.depthMaterial.depthPacking = Zn, this.depthMaterial.blending = $t, this.prepareMaskMaterial = this._getPrepareMaskMaterial(), this.prepareMaskMaterial.side = Pt, this.prepareMaskMaterial.fragmentShader = d(this.prepareMaskMaterial.fragmentShader, this.renderCamera), this.renderTargetDepthBuffer = new be(this.resolution.x, this.resolution.y, { type: Re }), this.renderTargetDepthBuffer.texture.name = "OutlinePass.depth", this.renderTargetDepthBuffer.texture.generateMipmaps = !1, this.renderTargetMaskDownSampleBuffer = new be(i, o, { type: Re }), this.renderTargetMaskDownSampleBuffer.texture.name = "OutlinePass.depthDownSample", this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps = !1, this.renderTargetBlurBuffer1 = new be(i, o, { type: Re }), this.renderTargetBlurBuffer1.texture.name = "OutlinePass.blur1", this.renderTargetBlurBuffer1.texture.generateMipmaps = !1, this.renderTargetBlurBuffer2 = new be(Math.round(i / 2), Math.round(o / 2), { type: Re }), this.renderTargetBlurBuffer2.texture.name = "OutlinePass.blur2", this.renderTargetBlurBuffer2.texture.generateMipmaps = !1, this.edgeDetectionMaterial = this._getEdgeDetectionMaterial(), this.renderTargetEdgeBuffer1 = new be(i, o, { type: Re }), this.renderTargetEdgeBuffer1.texture.name = "OutlinePass.edge1", this.renderTargetEdgeBuffer1.texture.generateMipmaps = !1, this.renderTargetEdgeBuffer2 = new be(Math.round(i / 2), Math.round(o / 2), { type: Re }), this.renderTargetEdgeBuffer2.texture.name = "OutlinePass.edge2", this.renderTargetEdgeBuffer2.texture.generateMipmaps = !1;
|
|
1590
1590
|
const a = 4, l = 4;
|
|
1591
1591
|
this.separableBlurMaterial1 = this._getSeparableBlurMaterial(a), this.separableBlurMaterial1.uniforms.texSize.value.set(i, o), this.separableBlurMaterial1.uniforms.kernelRadius.value = 1, this.separableBlurMaterial2 = this._getSeparableBlurMaterial(l), this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(i / 2), Math.round(o / 2)), this.separableBlurMaterial2.uniforms.kernelRadius.value = l, this.overlayMaterial = this._getOverlayMaterial();
|
|
1592
1592
|
const A = on;
|
|
@@ -1597,7 +1597,7 @@ class Ce extends qe {
|
|
|
1597
1597
|
blending: $t,
|
|
1598
1598
|
depthTest: !1,
|
|
1599
1599
|
depthWrite: !1
|
|
1600
|
-
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new B(), this.oldClearAlpha = 1, this._fsQuad = new us(null), this.tempPulseColor1 = new B(), this.tempPulseColor2 = new B(), this.textureMatrix = new
|
|
1600
|
+
}), this.enabled = !0, this.needsSwap = !1, this._oldClearColor = new B(), this.oldClearAlpha = 1, this._fsQuad = new us(null), this.tempPulseColor1 = new B(), this.tempPulseColor2 = new B(), this.textureMatrix = new pe();
|
|
1601
1601
|
function d(c, u) {
|
|
1602
1602
|
const h = u.isPerspectiveCamera ? "perspective" : "orthographic";
|
|
1603
1603
|
return c.replace(/DEPTH_TO_VIEW_Z/g, h + "DepthToViewZ");
|
|
@@ -1901,7 +1901,7 @@ class Yi extends Ze {
|
|
|
1901
1901
|
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
|
|
1902
1902
|
}
|
|
1903
1903
|
}
|
|
1904
|
-
const He = new T(), Ls = new
|
|
1904
|
+
const He = new T(), Ls = new pe(), Ns = new pe(), Os = new T(), Ds = new T();
|
|
1905
1905
|
class _i {
|
|
1906
1906
|
/**
|
|
1907
1907
|
* Constructs a new CSS2D renderer.
|
|
@@ -1919,51 +1919,51 @@ class _i {
|
|
|
1919
1919
|
width: n,
|
|
1920
1920
|
height: s
|
|
1921
1921
|
};
|
|
1922
|
-
}, this.render = function(
|
|
1923
|
-
|
|
1924
|
-
}, this.setSize = function(
|
|
1925
|
-
n =
|
|
1922
|
+
}, this.render = function(f, p) {
|
|
1923
|
+
f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), Ls.copy(p.matrixWorldInverse), Ns.multiplyMatrices(p.projectionMatrix, Ls), d(f, f, p), this.sortObjects && h(f);
|
|
1924
|
+
}, this.setSize = function(f, p) {
|
|
1925
|
+
n = f, s = p, i = n / 2, o = s / 2, l.style.width = f + "px", l.style.height = p + "px";
|
|
1926
1926
|
};
|
|
1927
|
-
function A(
|
|
1928
|
-
|
|
1929
|
-
for (let
|
|
1930
|
-
A(
|
|
1927
|
+
function A(f) {
|
|
1928
|
+
f.isCSS2DObject && (f.element.style.display = "none");
|
|
1929
|
+
for (let p = 0, m = f.children.length; p < m; p++)
|
|
1930
|
+
A(f.children[p]);
|
|
1931
1931
|
}
|
|
1932
|
-
function d(
|
|
1933
|
-
if (
|
|
1934
|
-
A(
|
|
1932
|
+
function d(f, p, m) {
|
|
1933
|
+
if (f.visible === !1) {
|
|
1934
|
+
A(f);
|
|
1935
1935
|
return;
|
|
1936
1936
|
}
|
|
1937
|
-
if (
|
|
1938
|
-
He.setFromMatrixPosition(
|
|
1939
|
-
const
|
|
1940
|
-
I.style.display =
|
|
1941
|
-
const
|
|
1942
|
-
distanceToCameraSquared: c(
|
|
1937
|
+
if (f.isCSS2DObject) {
|
|
1938
|
+
He.setFromMatrixPosition(f.matrixWorld), He.applyMatrix4(Ns);
|
|
1939
|
+
const g = He.z >= -1 && He.z <= 1 && f.layers.test(m.layers) === !0, I = f.element;
|
|
1940
|
+
I.style.display = g === !0 ? "" : "none", g === !0 && (f.onBeforeRender(t, p, m), I.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (He.x * i + i) + "px," + (-He.y * o + o) + "px)", I.parentNode !== l && l.appendChild(I), f.onAfterRender(t, p, m));
|
|
1941
|
+
const y = {
|
|
1942
|
+
distanceToCameraSquared: c(m, f)
|
|
1943
1943
|
};
|
|
1944
|
-
a.objects.set(
|
|
1944
|
+
a.objects.set(f, y);
|
|
1945
1945
|
}
|
|
1946
|
-
for (let
|
|
1947
|
-
d(
|
|
1946
|
+
for (let g = 0, I = f.children.length; g < I; g++)
|
|
1947
|
+
d(f.children[g], p, m);
|
|
1948
1948
|
}
|
|
1949
|
-
function c(
|
|
1950
|
-
return Os.setFromMatrixPosition(
|
|
1949
|
+
function c(f, p) {
|
|
1950
|
+
return Os.setFromMatrixPosition(f.matrixWorld), Ds.setFromMatrixPosition(p.matrixWorld), Os.distanceToSquared(Ds);
|
|
1951
1951
|
}
|
|
1952
|
-
function u(
|
|
1953
|
-
const
|
|
1954
|
-
return
|
|
1955
|
-
|
|
1956
|
-
}),
|
|
1952
|
+
function u(f) {
|
|
1953
|
+
const p = [];
|
|
1954
|
+
return f.traverseVisible(function(m) {
|
|
1955
|
+
m.isCSS2DObject && p.push(m);
|
|
1956
|
+
}), p;
|
|
1957
1957
|
}
|
|
1958
|
-
function h(
|
|
1959
|
-
const
|
|
1960
|
-
if (
|
|
1961
|
-
return I.renderOrder -
|
|
1962
|
-
const
|
|
1963
|
-
return
|
|
1964
|
-
}),
|
|
1965
|
-
for (let
|
|
1966
|
-
|
|
1958
|
+
function h(f) {
|
|
1959
|
+
const p = u(f).sort(function(g, I) {
|
|
1960
|
+
if (g.renderOrder !== I.renderOrder)
|
|
1961
|
+
return I.renderOrder - g.renderOrder;
|
|
1962
|
+
const y = a.objects.get(g).distanceToCameraSquared, x = a.objects.get(I).distanceToCameraSquared;
|
|
1963
|
+
return y - x;
|
|
1964
|
+
}), m = p.length;
|
|
1965
|
+
for (let g = 0, I = p.length; g < I; g++)
|
|
1966
|
+
p[g].element.style.zIndex = m - g;
|
|
1967
1967
|
}
|
|
1968
1968
|
}
|
|
1969
1969
|
}
|
|
@@ -2246,7 +2246,7 @@ let U = null;
|
|
|
2246
2246
|
function lo(r) {
|
|
2247
2247
|
return U ? (U.domElement.parentNode !== r && r.appendChild(U.domElement), U) : (U = new _i(), U.setSize(r.clientWidth, r.clientHeight), U.domElement.style.position = "absolute", U.domElement.style.top = "0", U.domElement.style.left = "0", U.domElement.style.pointerEvents = "none", r.appendChild(U.domElement), U);
|
|
2248
2248
|
}
|
|
2249
|
-
function
|
|
2249
|
+
function kl() {
|
|
2250
2250
|
return U;
|
|
2251
2251
|
}
|
|
2252
2252
|
function Ao(r, e) {
|
|
@@ -2642,7 +2642,7 @@ function Go() {
|
|
|
2642
2642
|
function Ko() {
|
|
2643
2643
|
return b.selectedObject;
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2645
|
+
function Pl(r, e, t) {
|
|
2646
2646
|
if (!b.scene) return;
|
|
2647
2647
|
const n = je.get(r);
|
|
2648
2648
|
if (n) {
|
|
@@ -2650,13 +2650,13 @@ function Rl(r, e, t) {
|
|
|
2650
2650
|
s && s.updateItemByCode(e, t);
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
|
-
function
|
|
2653
|
+
function Ll() {
|
|
2654
2654
|
return b.scene;
|
|
2655
2655
|
}
|
|
2656
2656
|
function Bo() {
|
|
2657
2657
|
return b.camera;
|
|
2658
2658
|
}
|
|
2659
|
-
function
|
|
2659
|
+
function Nl() {
|
|
2660
2660
|
return b.renderer;
|
|
2661
2661
|
}
|
|
2662
2662
|
async function Zo() {
|
|
@@ -2669,31 +2669,31 @@ async function Zo() {
|
|
|
2669
2669
|
r.traverse((u) => {
|
|
2670
2670
|
var h;
|
|
2671
2671
|
if (u.userData.type === "lightHelper" && e.push(u), u.type === "DirectionalLight" && u.userData.helper && (t.set(u, u.userData.helper), u.userData.helper = void 0), u.name && u.name.startsWith("DataPanel_")) {
|
|
2672
|
-
const
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2672
|
+
const f = u;
|
|
2673
|
+
if (f.element) {
|
|
2674
|
+
const p = f.element.querySelector(
|
|
2675
2675
|
"[data-panel-title]"
|
|
2676
|
-
),
|
|
2677
|
-
if (
|
|
2676
|
+
), m = [];
|
|
2677
|
+
if (f.element.querySelectorAll(
|
|
2678
2678
|
".sl-css2d-data-panel-item"
|
|
2679
2679
|
).forEach((I) => {
|
|
2680
2680
|
var v, M, L;
|
|
2681
|
-
const
|
|
2682
|
-
if (
|
|
2683
|
-
const Q = (
|
|
2681
|
+
const y = I.querySelector(".item-label"), x = I.querySelector(".item-value");
|
|
2682
|
+
if (y && x) {
|
|
2683
|
+
const Q = (y.textContent || "").trim(), ee = ((M = (v = x.childNodes[0]) == null ? void 0 : v.textContent) == null ? void 0 : M.trim()) || "", Y = x.querySelector(
|
|
2684
2684
|
"span"
|
|
2685
2685
|
), Te = Y ? (Y.textContent || "").trim() : void 0, Ht = ((L = I.getAttribute("data-item-code")) == null ? void 0 : L.trim()) || void 0;
|
|
2686
|
-
|
|
2686
|
+
m.push({ label: Q, value: ee, unit: Te, code: Ht });
|
|
2687
2687
|
}
|
|
2688
2688
|
}), u.parent) {
|
|
2689
|
-
const I =
|
|
2689
|
+
const I = f.element.style.width || "", y = f.element.style.fontSize || "", x = Ft(u.parent), v = x ? x.getOffsetY() : 0.1;
|
|
2690
2690
|
n.set(
|
|
2691
2691
|
u.parent.userData.id ? u.parent.userData.id : u.parent.uuid,
|
|
2692
2692
|
{
|
|
2693
|
-
title: ((h =
|
|
2694
|
-
items:
|
|
2693
|
+
title: ((h = p == null ? void 0 : p.textContent) == null ? void 0 : h.trim()) || "",
|
|
2694
|
+
items: m,
|
|
2695
2695
|
width: I,
|
|
2696
|
-
fontSize:
|
|
2696
|
+
fontSize: y,
|
|
2697
2697
|
offsetY: v
|
|
2698
2698
|
}
|
|
2699
2699
|
);
|
|
@@ -2766,7 +2766,7 @@ function un(r) {
|
|
|
2766
2766
|
function qo() {
|
|
2767
2767
|
kt !== null && (cancelAnimationFrame(kt), kt = null), lt && b.container && (b.container.removeEventListener("click", lt), lt = null), At && (window.removeEventListener("resize", At), At = null), b.orbitControls && (b.orbitControls.dispose(), b.orbitControls = null), b.transformControls && (b.transformControls.dispose(), b.transformControls = null), Ie && (Ie.dispose(), Ie = null, ye = null), b.scene && (un(b.scene), b.scene = null), b.renderer && (b.renderer.dispose(), b.renderer.domElement && b.container && b.container.removeChild(b.renderer.domElement), b.renderer = null), uo(), b.camera = null, b.gridHelper = null, b.selectedObject = null, b.container = null, b.mode = "", xe = [], je.clear(), Ut(), Rt = !1, We = !1;
|
|
2768
2768
|
}
|
|
2769
|
-
const Vo = /^[og]\s*(.+)?/, Jo = /^mtllib /, Qo = /^usemtl /, Yo = /^usemap /, js = /\s+/, Fs = new T(), Xt = new T(), Us = new T(), Hs = new T(),
|
|
2769
|
+
const Vo = /^[og]\s*(.+)?/, Jo = /^mtllib /, Qo = /^usemtl /, Yo = /^usemap /, js = /\s+/, Fs = new T(), Xt = new T(), Us = new T(), Hs = new T(), se = new T(), St = new B();
|
|
2770
2770
|
function _o() {
|
|
2771
2771
|
const r = {
|
|
2772
2772
|
objects: [],
|
|
@@ -2876,7 +2876,7 @@ function _o() {
|
|
|
2876
2876
|
},
|
|
2877
2877
|
addFaceNormal: function(e, t, n) {
|
|
2878
2878
|
const s = this.vertices, i = this.object.geometry.normals;
|
|
2879
|
-
Fs.fromArray(s, e), Xt.fromArray(s, t), Us.fromArray(s, n),
|
|
2879
|
+
Fs.fromArray(s, e), Xt.fromArray(s, t), Us.fromArray(s, n), se.subVectors(Us, Xt), Hs.subVectors(Fs, Xt), se.cross(Hs), se.normalize(), i.push(se.x, se.y, se.z), i.push(se.x, se.y, se.z), i.push(se.x, se.y, se.z);
|
|
2880
2880
|
},
|
|
2881
2881
|
addColor: function(e, t, n) {
|
|
2882
2882
|
const s = this.colors, i = this.object.geometry.colors;
|
|
@@ -2898,13 +2898,13 @@ function _o() {
|
|
|
2898
2898
|
const d = this.vertices.length;
|
|
2899
2899
|
let c = this.parseVertexIndex(e, d), u = this.parseVertexIndex(t, d), h = this.parseVertexIndex(n, d);
|
|
2900
2900
|
if (this.addVertex(c, u, h), this.addColor(c, u, h), a !== void 0 && a !== "") {
|
|
2901
|
-
const
|
|
2902
|
-
c = this.parseNormalIndex(a,
|
|
2901
|
+
const f = this.normals.length;
|
|
2902
|
+
c = this.parseNormalIndex(a, f), u = this.parseNormalIndex(l, f), h = this.parseNormalIndex(A, f), this.addNormal(c, u, h);
|
|
2903
2903
|
} else
|
|
2904
2904
|
this.addFaceNormal(c, u, h);
|
|
2905
2905
|
if (s !== void 0 && s !== "") {
|
|
2906
|
-
const
|
|
2907
|
-
c = this.parseUVIndex(s,
|
|
2906
|
+
const f = this.uvs.length;
|
|
2907
|
+
c = this.parseUVIndex(s, f), u = this.parseUVIndex(i, f), h = this.parseUVIndex(o, f), this.addUV(c, u, h), this.object.geometry.hasUVIndices = !0;
|
|
2908
2908
|
} else
|
|
2909
2909
|
this.addDefaultUV();
|
|
2910
2910
|
},
|
|
@@ -2996,7 +2996,7 @@ class $o extends As {
|
|
|
2996
2996
|
parseFloat(c[4]),
|
|
2997
2997
|
parseFloat(c[5]),
|
|
2998
2998
|
parseFloat(c[6]),
|
|
2999
|
-
|
|
2999
|
+
fe
|
|
3000
3000
|
), t.colors.push(St.r, St.g, St.b)) : t.colors.push(void 0, void 0, void 0);
|
|
3001
3001
|
break;
|
|
3002
3002
|
case "vn":
|
|
@@ -3015,25 +3015,25 @@ class $o extends As {
|
|
|
3015
3015
|
}
|
|
3016
3016
|
} else if (d === "f") {
|
|
3017
3017
|
const u = A.slice(1).trim().split(js), h = [];
|
|
3018
|
-
for (let
|
|
3019
|
-
const
|
|
3020
|
-
if (
|
|
3021
|
-
const I =
|
|
3018
|
+
for (let p = 0, m = u.length; p < m; p++) {
|
|
3019
|
+
const g = u[p];
|
|
3020
|
+
if (g.length > 0) {
|
|
3021
|
+
const I = g.split("/");
|
|
3022
3022
|
h.push(I);
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
const
|
|
3026
|
-
for (let
|
|
3027
|
-
const
|
|
3025
|
+
const f = h[0];
|
|
3026
|
+
for (let p = 1, m = h.length - 1; p < m; p++) {
|
|
3027
|
+
const g = h[p], I = h[p + 1];
|
|
3028
3028
|
t.addFace(
|
|
3029
|
-
|
|
3030
|
-
|
|
3029
|
+
f[0],
|
|
3030
|
+
g[0],
|
|
3031
3031
|
I[0],
|
|
3032
|
-
|
|
3033
|
-
|
|
3032
|
+
f[1],
|
|
3033
|
+
g[1],
|
|
3034
3034
|
I[1],
|
|
3035
|
-
|
|
3036
|
-
|
|
3035
|
+
f[2],
|
|
3036
|
+
g[2],
|
|
3037
3037
|
I[2]
|
|
3038
3038
|
);
|
|
3039
3039
|
}
|
|
@@ -3044,9 +3044,9 @@ class $o extends As {
|
|
|
3044
3044
|
if (A.indexOf("/") === -1)
|
|
3045
3045
|
u = c;
|
|
3046
3046
|
else
|
|
3047
|
-
for (let
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3047
|
+
for (let f = 0, p = c.length; f < p; f++) {
|
|
3048
|
+
const m = c[f].split("/");
|
|
3049
|
+
m[0] !== "" && u.push(m[0]), m[1] !== "" && h.push(m[1]);
|
|
3050
3050
|
}
|
|
3051
3051
|
t.addLineGeometry(u, h);
|
|
3052
3052
|
} else if (d === "p") {
|
|
@@ -3079,16 +3079,16 @@ class $o extends As {
|
|
|
3079
3079
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
3080
3080
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
3081
3081
|
const A = t.objects[a], d = A.geometry, c = A.materials, u = d.type === "Line", h = d.type === "Points";
|
|
3082
|
-
let
|
|
3082
|
+
let f = !1;
|
|
3083
3083
|
if (d.vertices.length === 0) continue;
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3086
|
-
const
|
|
3087
|
-
for (let I = 0,
|
|
3088
|
-
const
|
|
3084
|
+
const p = new De();
|
|
3085
|
+
p.setAttribute("position", new le(d.vertices, 3)), d.normals.length > 0 && p.setAttribute("normal", new le(d.normals, 3)), d.colors.length > 0 && (f = !0, p.setAttribute("color", new le(d.colors, 3))), d.hasUVIndices === !0 && p.setAttribute("uv", new le(d.uvs, 2));
|
|
3086
|
+
const m = [];
|
|
3087
|
+
for (let I = 0, y = c.length; I < y; I++) {
|
|
3088
|
+
const x = c[I], v = x.name + "_" + x.smooth + "_" + f;
|
|
3089
3089
|
let M = t.materials[v];
|
|
3090
3090
|
if (this.materials !== null) {
|
|
3091
|
-
if (M = this.materials.create(
|
|
3091
|
+
if (M = this.materials.create(x.name), u && M && !(M instanceof it)) {
|
|
3092
3092
|
const L = new it();
|
|
3093
3093
|
ot.prototype.copy.call(L, M), L.color.copy(M.color), M = L;
|
|
3094
3094
|
} else if (h && M && !(M instanceof et)) {
|
|
@@ -3096,18 +3096,18 @@ class $o extends As {
|
|
|
3096
3096
|
ot.prototype.copy.call(L, M), L.color.copy(M.color), L.map = M.map, M = L;
|
|
3097
3097
|
}
|
|
3098
3098
|
}
|
|
3099
|
-
M === void 0 && (u ? M = new it() : h ? M = new et({ size: 1, sizeAttenuation: !1 }) : M = new qn(), M.name =
|
|
3099
|
+
M === void 0 && (u ? M = new it() : h ? M = new et({ size: 1, sizeAttenuation: !1 }) : M = new qn(), M.name = x.name, M.flatShading = !x.smooth, M.vertexColors = f, t.materials[v] = M), m.push(M);
|
|
3100
3100
|
}
|
|
3101
|
-
let
|
|
3102
|
-
if (
|
|
3103
|
-
for (let I = 0,
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3101
|
+
let g;
|
|
3102
|
+
if (m.length > 1) {
|
|
3103
|
+
for (let I = 0, y = c.length; I < y; I++) {
|
|
3104
|
+
const x = c[I];
|
|
3105
|
+
p.addGroup(x.groupStart, x.groupCount, I);
|
|
3106
3106
|
}
|
|
3107
|
-
u ?
|
|
3107
|
+
u ? g = new es(p, m) : h ? g = new Mt(p, m) : g = new S(p, m);
|
|
3108
3108
|
} else
|
|
3109
|
-
u ?
|
|
3110
|
-
|
|
3109
|
+
u ? g = new es(p, m[0]) : h ? g = new Mt(p, m[0]) : g = new S(p, m[0]);
|
|
3110
|
+
g.name = A.name, i.add(g);
|
|
3111
3111
|
}
|
|
3112
3112
|
else if (t.vertices.length > 0) {
|
|
3113
3113
|
const a = new et({ size: 1, sizeAttenuation: !1 }), l = new De();
|
|
@@ -3478,7 +3478,7 @@ class ir {
|
|
|
3478
3478
|
const o = i.baseColorFactor;
|
|
3479
3479
|
e.color.setRGB(o[0], o[1], o[2], Ae), e.opacity = o[3];
|
|
3480
3480
|
}
|
|
3481
|
-
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture,
|
|
3481
|
+
i.baseColorTexture !== void 0 && s.push(n.assignTexture(e, "map", i.baseColorTexture, fe));
|
|
3482
3482
|
}
|
|
3483
3483
|
return Promise.all(s);
|
|
3484
3484
|
}
|
|
@@ -3551,7 +3551,7 @@ class Ar {
|
|
|
3551
3551
|
const i = n.sheenColorFactor;
|
|
3552
3552
|
t.sheenColor.setRGB(i[0], i[1], i[2], Ae);
|
|
3553
3553
|
}
|
|
3554
|
-
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture,
|
|
3554
|
+
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, fe)), n.sheenRoughnessTexture !== void 0 && s.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(s);
|
|
3555
3555
|
}
|
|
3556
3556
|
}
|
|
3557
3557
|
class cr {
|
|
@@ -3609,7 +3609,7 @@ class hr {
|
|
|
3609
3609
|
const s = [];
|
|
3610
3610
|
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
3611
3611
|
const i = n.specularColorFactor || [1, 1, 1];
|
|
3612
|
-
return t.specularColor = new B().setRGB(i[0], i[1], i[2], Ae), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture,
|
|
3612
|
+
return t.specularColor = new B().setRGB(i[0], i[1], i[2], Ae), n.specularColorTexture !== void 0 && s.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, fe)), Promise.all(s);
|
|
3613
3613
|
}
|
|
3614
3614
|
}
|
|
3615
3615
|
class fr {
|
|
@@ -3727,23 +3727,23 @@ class Cr {
|
|
|
3727
3727
|
return null;
|
|
3728
3728
|
const s = t.meshes[n.mesh];
|
|
3729
3729
|
for (const A of s.primitives)
|
|
3730
|
-
if (A.mode !==
|
|
3730
|
+
if (A.mode !== ne.TRIANGLES && A.mode !== ne.TRIANGLE_STRIP && A.mode !== ne.TRIANGLE_FAN && A.mode !== void 0)
|
|
3731
3731
|
return null;
|
|
3732
3732
|
const o = n.extensions[this.name].attributes, a = [], l = {};
|
|
3733
3733
|
for (const A in o)
|
|
3734
3734
|
a.push(this.parser.getDependency("accessor", o[A]).then((d) => (l[A] = d, l[A])));
|
|
3735
3735
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((A) => {
|
|
3736
3736
|
const d = A.pop(), c = d.isGroup ? d.children : [d], u = A[0].count, h = [];
|
|
3737
|
-
for (const
|
|
3738
|
-
const
|
|
3739
|
-
for (let
|
|
3740
|
-
l.TRANSLATION &&
|
|
3741
|
-
for (const
|
|
3742
|
-
if (
|
|
3743
|
-
const v = l[
|
|
3744
|
-
|
|
3745
|
-
} else
|
|
3746
|
-
Ze.prototype.copy.call(
|
|
3737
|
+
for (const f of c) {
|
|
3738
|
+
const p = new pe(), m = new T(), g = new J(), I = new T(1, 1, 1), y = new _n(f.geometry, f.material, u);
|
|
3739
|
+
for (let x = 0; x < u; x++)
|
|
3740
|
+
l.TRANSLATION && m.fromBufferAttribute(l.TRANSLATION, x), l.ROTATION && g.fromBufferAttribute(l.ROTATION, x), l.SCALE && I.fromBufferAttribute(l.SCALE, x), y.setMatrixAt(x, p.compose(m, g, I));
|
|
3741
|
+
for (const x in l)
|
|
3742
|
+
if (x === "_COLOR_0") {
|
|
3743
|
+
const v = l[x];
|
|
3744
|
+
y.instanceColor = new $n(v.array, v.itemSize, v.normalized);
|
|
3745
|
+
} else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && f.geometry.setAttribute(x, l[x]);
|
|
3746
|
+
Ze.prototype.copy.call(y, f), this.parser.assignFinalMaterial(y), h.push(y);
|
|
3747
3747
|
}
|
|
3748
3748
|
return d.isGroup ? (d.clear(), d.add(...h), d) : h[0];
|
|
3749
3749
|
}));
|
|
@@ -3803,9 +3803,9 @@ class yr {
|
|
|
3803
3803
|
return t.getDependency("bufferView", i).then(function(d) {
|
|
3804
3804
|
return new Promise(function(c, u) {
|
|
3805
3805
|
s.decodeDracoFile(d, function(h) {
|
|
3806
|
-
for (const
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3806
|
+
for (const f in h.attributes) {
|
|
3807
|
+
const p = h.attributes[f], m = l[f];
|
|
3808
|
+
m !== void 0 && (p.normalized = m);
|
|
3809
3809
|
}
|
|
3810
3810
|
c(h);
|
|
3811
3811
|
}, a, A, Ae, u);
|
|
@@ -3837,10 +3837,10 @@ class fn extends mi {
|
|
|
3837
3837
|
return t;
|
|
3838
3838
|
}
|
|
3839
3839
|
interpolate_(e, t, n, s) {
|
|
3840
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, A = a * 3, d = s - t, c = (n - t) / d, u = c * c, h = u * c,
|
|
3841
|
-
for (let
|
|
3842
|
-
const v = o[
|
|
3843
|
-
i[
|
|
3840
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, A = a * 3, d = s - t, c = (n - t) / d, u = c * c, h = u * c, f = e * A, p = f - A, m = -2 * h + 3 * u, g = h - u, I = 1 - m, y = g - u + c;
|
|
3841
|
+
for (let x = 0; x !== a; x++) {
|
|
3842
|
+
const v = o[p + x + a], M = o[p + x + l] * d, L = o[f + x + a], Q = o[f + x] * d;
|
|
3843
|
+
i[x] = I * v + y * M + m * L + g * Q;
|
|
3844
3844
|
}
|
|
3845
3845
|
return i;
|
|
3846
3846
|
}
|
|
@@ -3852,7 +3852,7 @@ class Tr extends fn {
|
|
|
3852
3852
|
return Sr.fromArray(i).normalize().toArray(i), i;
|
|
3853
3853
|
}
|
|
3854
3854
|
}
|
|
3855
|
-
const
|
|
3855
|
+
const ne = {
|
|
3856
3856
|
POINTS: 0,
|
|
3857
3857
|
LINES: 1,
|
|
3858
3858
|
LINE_LOOP: 2,
|
|
@@ -3897,7 +3897,7 @@ const se = {
|
|
|
3897
3897
|
COLOR_0: "color",
|
|
3898
3898
|
WEIGHTS_0: "skinWeight",
|
|
3899
3899
|
JOINTS_0: "skinIndex"
|
|
3900
|
-
},
|
|
3900
|
+
}, ge = {
|
|
3901
3901
|
scale: "scale",
|
|
3902
3902
|
translation: "position",
|
|
3903
3903
|
rotation: "quaternion",
|
|
@@ -4009,7 +4009,7 @@ function as(r) {
|
|
|
4009
4009
|
function Pr(r) {
|
|
4010
4010
|
return r.search(/\.jpe?g($|\?)/i) > 0 || r.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : r.search(/\.webp($|\?)/i) > 0 || r.search(/^data\:image\/webp/) === 0 ? "image/webp" : r.search(/\.ktx2($|\?)/i) > 0 || r.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
4011
4011
|
}
|
|
4012
|
-
const Lr = new
|
|
4012
|
+
const Lr = new pe();
|
|
4013
4013
|
class Nr {
|
|
4014
4014
|
constructor(e = {}, t = {}) {
|
|
4015
4015
|
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new sr(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
@@ -4265,24 +4265,24 @@ class Nr {
|
|
|
4265
4265
|
}
|
|
4266
4266
|
const i = [];
|
|
4267
4267
|
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) {
|
|
4268
|
-
const a = o[0], l = qt[s.type], A = Be[s.componentType], d = A.BYTES_PER_ELEMENT, c = d * l, u = s.byteOffset || 0, h = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0,
|
|
4269
|
-
let
|
|
4268
|
+
const a = o[0], l = qt[s.type], A = Be[s.componentType], d = A.BYTES_PER_ELEMENT, c = d * l, u = s.byteOffset || 0, h = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, f = s.normalized === !0;
|
|
4269
|
+
let p, m;
|
|
4270
4270
|
if (h && h !== c) {
|
|
4271
|
-
const
|
|
4272
|
-
let
|
|
4273
|
-
|
|
4271
|
+
const g = Math.floor(u / h), I = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + g + ":" + s.count;
|
|
4272
|
+
let y = t.cache.get(I);
|
|
4273
|
+
y || (p = new A(a, g * h, s.count * h / d), y = new Ys(p, h / d), t.cache.add(I, y)), m = new _s(y, l, u % h / d, f);
|
|
4274
4274
|
} else
|
|
4275
|
-
a === null ?
|
|
4275
|
+
a === null ? p = new A(s.count * l) : p = new A(a, u, s.count * l), m = new at(p, l, f);
|
|
4276
4276
|
if (s.sparse !== void 0) {
|
|
4277
|
-
const
|
|
4278
|
-
a !== null && (
|
|
4277
|
+
const g = qt.SCALAR, I = Be[s.sparse.indices.componentType], y = s.sparse.indices.byteOffset || 0, x = s.sparse.values.byteOffset || 0, v = new I(o[1], y, s.sparse.count * g), M = new A(o[2], x, s.sparse.count * l);
|
|
4278
|
+
a !== null && (m = new at(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
4279
4279
|
for (let L = 0, Q = v.length; L < Q; L++) {
|
|
4280
|
-
const
|
|
4281
|
-
if (
|
|
4280
|
+
const ee = v[L];
|
|
4281
|
+
if (m.setX(ee, M[L * l]), l >= 2 && m.setY(ee, M[L * l + 1]), l >= 3 && m.setZ(ee, M[L * l + 2]), l >= 4 && m.setW(ee, M[L * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4282
4282
|
}
|
|
4283
|
-
|
|
4283
|
+
m.normalized = f;
|
|
4284
4284
|
}
|
|
4285
|
-
return
|
|
4285
|
+
return m;
|
|
4286
4286
|
});
|
|
4287
4287
|
}
|
|
4288
4288
|
/**
|
|
@@ -4330,11 +4330,11 @@ class Nr {
|
|
|
4330
4330
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4331
4331
|
const d = Promise.resolve(l).then(function(c) {
|
|
4332
4332
|
return new Promise(function(u, h) {
|
|
4333
|
-
let
|
|
4334
|
-
t.isImageBitmapLoader === !0 && (
|
|
4335
|
-
const
|
|
4336
|
-
|
|
4337
|
-
}), t.load(rt.resolveURL(c, i.path),
|
|
4333
|
+
let f = u;
|
|
4334
|
+
t.isImageBitmapLoader === !0 && (f = function(p) {
|
|
4335
|
+
const m = new bs(p);
|
|
4336
|
+
m.needsUpdate = !0, u(m);
|
|
4337
|
+
}), t.load(rt.resolveURL(c, i.path), f, void 0, h);
|
|
4338
4338
|
});
|
|
4339
4339
|
}).then(function(c) {
|
|
4340
4340
|
return A === !0 && a.revokeObjectURL(l), ae(c, o), c.userData.mimeType = o.mimeType || Pr(o.uri), c;
|
|
@@ -4421,7 +4421,7 @@ class Nr {
|
|
|
4421
4421
|
const u = c.baseColorFactor;
|
|
4422
4422
|
a.color.setRGB(u[0], u[1], u[2], Ae), a.opacity = u[3];
|
|
4423
4423
|
}
|
|
4424
|
-
c.baseColorTexture !== void 0 && A.push(t.assignTexture(a, "map", c.baseColorTexture,
|
|
4424
|
+
c.baseColorTexture !== void 0 && A.push(t.assignTexture(a, "map", c.baseColorTexture, fe)), a.metalness = c.metallicFactor !== void 0 ? c.metallicFactor : 1, a.roughness = c.roughnessFactor !== void 0 ? c.roughnessFactor : 1, c.metallicRoughnessTexture !== void 0 && (A.push(t.assignTexture(a, "metalnessMap", c.metallicRoughnessTexture)), A.push(t.assignTexture(a, "roughnessMap", c.metallicRoughnessTexture))), o = this._invokeOne(function(u) {
|
|
4425
4425
|
return u.getMaterialType && u.getMaterialType(e);
|
|
4426
4426
|
}), A.push(Promise.all(this._invokeAll(function(u) {
|
|
4427
4427
|
return u.extendMaterialParams && u.extendMaterialParams(e, a);
|
|
@@ -4437,7 +4437,7 @@ class Nr {
|
|
|
4437
4437
|
const c = i.emissiveFactor;
|
|
4438
4438
|
a.emissive = new B().setRGB(c[0], c[1], c[2], Ae);
|
|
4439
4439
|
}
|
|
4440
|
-
return i.emissiveTexture !== void 0 && o !== Ne && A.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture,
|
|
4440
|
+
return i.emissiveTexture !== void 0 && o !== Ne && A.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, fe)), Promise.all(A).then(function() {
|
|
4441
4441
|
const c = new o(a);
|
|
4442
4442
|
return i.name && (c.name = i.name), ae(c, i), t.associations.set(c, { materials: e }), i.extensions && we(s, c, i), c;
|
|
4443
4443
|
});
|
|
@@ -4496,25 +4496,25 @@ class Nr {
|
|
|
4496
4496
|
}
|
|
4497
4497
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
4498
4498
|
const A = l.slice(0, l.length - 1), d = l[l.length - 1], c = [];
|
|
4499
|
-
for (let h = 0,
|
|
4500
|
-
const
|
|
4501
|
-
let
|
|
4499
|
+
for (let h = 0, f = d.length; h < f; h++) {
|
|
4500
|
+
const p = d[h], m = o[h];
|
|
4501
|
+
let g;
|
|
4502
4502
|
const I = A[h];
|
|
4503
|
-
if (
|
|
4504
|
-
|
|
4505
|
-
else if (
|
|
4506
|
-
|
|
4507
|
-
else if (
|
|
4508
|
-
|
|
4509
|
-
else if (
|
|
4510
|
-
|
|
4511
|
-
else if (
|
|
4512
|
-
|
|
4503
|
+
if (m.mode === ne.TRIANGLES || m.mode === ne.TRIANGLE_STRIP || m.mode === ne.TRIANGLE_FAN || m.mode === void 0)
|
|
4504
|
+
g = i.isSkinnedMesh === !0 ? new li(p, I) : new S(p, I), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === ne.TRIANGLE_STRIP ? g.geometry = zs(g.geometry, Qs) : m.mode === ne.TRIANGLE_FAN && (g.geometry = zs(g.geometry, ts));
|
|
4505
|
+
else if (m.mode === ne.LINES)
|
|
4506
|
+
g = new es(p, I);
|
|
4507
|
+
else if (m.mode === ne.LINE_STRIP)
|
|
4508
|
+
g = new de(p, I);
|
|
4509
|
+
else if (m.mode === ne.LINE_LOOP)
|
|
4510
|
+
g = new Ai(p, I);
|
|
4511
|
+
else if (m.mode === ne.POINTS)
|
|
4512
|
+
g = new Mt(p, I);
|
|
4513
4513
|
else
|
|
4514
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
4515
|
-
Object.keys(
|
|
4514
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
4515
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && Er(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), ae(g, i), m.extensions && we(s, g, m), t.assignFinalMaterial(g), c.push(g);
|
|
4516
4516
|
}
|
|
4517
|
-
for (let h = 0,
|
|
4517
|
+
for (let h = 0, f = c.length; h < f; h++)
|
|
4518
4518
|
t.associations.set(c[h], {
|
|
4519
4519
|
meshes: e,
|
|
4520
4520
|
primitives: h
|
|
@@ -4523,7 +4523,7 @@ class Nr {
|
|
|
4523
4523
|
return i.extensions && we(s, c[0], i), c[0];
|
|
4524
4524
|
const u = new Tt();
|
|
4525
4525
|
i.extensions && we(s, u, i), t.associations.set(u, { meshes: e });
|
|
4526
|
-
for (let h = 0,
|
|
4526
|
+
for (let h = 0, f = c.length; h < f; h++)
|
|
4527
4527
|
u.add(c[h]);
|
|
4528
4528
|
return u;
|
|
4529
4529
|
});
|
|
@@ -4561,7 +4561,7 @@ class Nr {
|
|
|
4561
4561
|
const c = o[A];
|
|
4562
4562
|
if (c) {
|
|
4563
4563
|
a.push(c);
|
|
4564
|
-
const u = new
|
|
4564
|
+
const u = new pe();
|
|
4565
4565
|
i !== null && u.fromArray(i.array, A * 16), l.push(u);
|
|
4566
4566
|
} else
|
|
4567
4567
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[A]);
|
|
@@ -4579,8 +4579,8 @@ class Nr {
|
|
|
4579
4579
|
loadAnimation(e) {
|
|
4580
4580
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], A = [], d = [];
|
|
4581
4581
|
for (let c = 0, u = s.channels.length; c < u; c++) {
|
|
4582
|
-
const h = s.channels[c],
|
|
4583
|
-
|
|
4582
|
+
const h = s.channels[c], f = s.samplers[h.sampler], p = h.target, m = p.node, g = s.parameters !== void 0 ? s.parameters[f.input] : f.input, I = s.parameters !== void 0 ? s.parameters[f.output] : f.output;
|
|
4583
|
+
p.node !== void 0 && (o.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", I)), A.push(f), d.push(p));
|
|
4584
4584
|
}
|
|
4585
4585
|
return Promise.all([
|
|
4586
4586
|
Promise.all(o),
|
|
@@ -4589,17 +4589,17 @@ class Nr {
|
|
|
4589
4589
|
Promise.all(A),
|
|
4590
4590
|
Promise.all(d)
|
|
4591
4591
|
]).then(function(c) {
|
|
4592
|
-
const u = c[0], h = c[1],
|
|
4593
|
-
for (let
|
|
4594
|
-
const v = u[
|
|
4592
|
+
const u = c[0], h = c[1], f = c[2], p = c[3], m = c[4], g = [];
|
|
4593
|
+
for (let y = 0, x = u.length; y < x; y++) {
|
|
4594
|
+
const v = u[y], M = h[y], L = f[y], Q = p[y], ee = m[y];
|
|
4595
4595
|
if (v === void 0) continue;
|
|
4596
4596
|
v.updateMatrix && v.updateMatrix();
|
|
4597
|
-
const Y = n._createAnimationTracks(v, M, L, Q,
|
|
4597
|
+
const Y = n._createAnimationTracks(v, M, L, Q, ee);
|
|
4598
4598
|
if (Y)
|
|
4599
4599
|
for (let Te = 0; Te < Y.length; Te++)
|
|
4600
|
-
|
|
4600
|
+
g.push(Y[Te]);
|
|
4601
4601
|
}
|
|
4602
|
-
const I = new di(i, void 0,
|
|
4602
|
+
const I = new di(i, void 0, g);
|
|
4603
4603
|
return ae(I, s), I;
|
|
4604
4604
|
});
|
|
4605
4605
|
}
|
|
@@ -4635,11 +4635,11 @@ class Nr {
|
|
|
4635
4635
|
u !== null && d.traverse(function(h) {
|
|
4636
4636
|
h.isSkinnedMesh && h.bind(u, Lr);
|
|
4637
4637
|
});
|
|
4638
|
-
for (let h = 0,
|
|
4638
|
+
for (let h = 0, f = c.length; h < f; h++)
|
|
4639
4639
|
d.add(c[h]);
|
|
4640
4640
|
if (d.userData.pivot !== void 0 && c.length > 0) {
|
|
4641
|
-
const h = d.userData.pivot,
|
|
4642
|
-
d.pivot = new T().fromArray(h), d.position.x -= h[0], d.position.y -= h[1], d.position.z -= h[2],
|
|
4641
|
+
const h = d.userData.pivot, f = c[0];
|
|
4642
|
+
d.pivot = new T().fromArray(h), d.position.x -= h[0], d.position.y -= h[1], d.position.z -= h[2], f.position.set(0, 0, 0), delete d.userData.pivot;
|
|
4643
4643
|
}
|
|
4644
4644
|
return d;
|
|
4645
4645
|
});
|
|
@@ -4665,7 +4665,7 @@ class Nr {
|
|
|
4665
4665
|
for (let c = 0, u = A.length; c < u; c++)
|
|
4666
4666
|
d.add(A[c]);
|
|
4667
4667
|
if (i.name && (d.userData.name = i.name, d.name = o), ae(d, i), i.extensions && we(n, d, i), i.matrix !== void 0) {
|
|
4668
|
-
const c = new
|
|
4668
|
+
const c = new pe();
|
|
4669
4669
|
c.fromArray(i.matrix), d.applyMatrix4(c);
|
|
4670
4670
|
} else
|
|
4671
4671
|
i.translation !== void 0 && d.position.fromArray(i.translation), i.rotation !== void 0 && d.quaternion.fromArray(i.rotation), i.scale !== void 0 && d.scale.fromArray(i.scale);
|
|
@@ -4713,17 +4713,17 @@ class Nr {
|
|
|
4713
4713
|
function A(h) {
|
|
4714
4714
|
h.morphTargetInfluences && l.push(h.name ? h.name : h.uuid);
|
|
4715
4715
|
}
|
|
4716
|
-
|
|
4716
|
+
ge[i.path] === ge.weights ? (A(e), e.isGroup && e.children.forEach(A)) : l.push(a);
|
|
4717
4717
|
let d;
|
|
4718
|
-
switch (
|
|
4719
|
-
case
|
|
4718
|
+
switch (ge[i.path]) {
|
|
4719
|
+
case ge.weights:
|
|
4720
4720
|
d = Is;
|
|
4721
4721
|
break;
|
|
4722
|
-
case
|
|
4722
|
+
case ge.rotation:
|
|
4723
4723
|
d = ys;
|
|
4724
4724
|
break;
|
|
4725
|
-
case
|
|
4726
|
-
case
|
|
4725
|
+
case ge.translation:
|
|
4726
|
+
case ge.scale:
|
|
4727
4727
|
d = Cs;
|
|
4728
4728
|
break;
|
|
4729
4729
|
default:
|
|
@@ -4740,14 +4740,14 @@ class Nr {
|
|
|
4740
4740
|
break;
|
|
4741
4741
|
}
|
|
4742
4742
|
const c = s.interpolation !== void 0 ? Mr[s.interpolation] : sn, u = this._getArrayFromAccessor(n);
|
|
4743
|
-
for (let h = 0,
|
|
4744
|
-
const
|
|
4745
|
-
l[h] + "." +
|
|
4743
|
+
for (let h = 0, f = l.length; h < f; h++) {
|
|
4744
|
+
const p = new d(
|
|
4745
|
+
l[h] + "." + ge[i.path],
|
|
4746
4746
|
t.array,
|
|
4747
4747
|
u,
|
|
4748
4748
|
c
|
|
4749
4749
|
);
|
|
4750
|
-
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
4750
|
+
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
|
|
4751
4751
|
}
|
|
4752
4752
|
return o;
|
|
4753
4753
|
}
|
|
@@ -4792,11 +4792,11 @@ function Or(r, e, t) {
|
|
|
4792
4792
|
for (let A = 0, d = i.length; A < d; A++) {
|
|
4793
4793
|
const c = i[A];
|
|
4794
4794
|
if (c.POSITION !== void 0) {
|
|
4795
|
-
const u = t.json.accessors[c.POSITION], h = u.min,
|
|
4796
|
-
if (h !== void 0 &&
|
|
4797
|
-
if (l.setX(Math.max(Math.abs(h[0]), Math.abs(
|
|
4798
|
-
const
|
|
4799
|
-
l.multiplyScalar(
|
|
4795
|
+
const u = t.json.accessors[c.POSITION], h = u.min, f = u.max;
|
|
4796
|
+
if (h !== void 0 && f !== void 0) {
|
|
4797
|
+
if (l.setX(Math.max(Math.abs(h[0]), Math.abs(f[0]))), l.setY(Math.max(Math.abs(h[1]), Math.abs(f[1]))), l.setZ(Math.max(Math.abs(h[2]), Math.abs(f[2]))), u.normalized) {
|
|
4798
|
+
const p = as(Be[u.componentType]);
|
|
4799
|
+
l.multiplyScalar(p);
|
|
4800
4800
|
}
|
|
4801
4801
|
a.max(l);
|
|
4802
4802
|
} else
|
|
@@ -4902,7 +4902,7 @@ class Dr extends As {
|
|
|
4902
4902
|
*/
|
|
4903
4903
|
parse(e, t, n = () => {
|
|
4904
4904
|
}) {
|
|
4905
|
-
this.decodeDracoFile(e, t, null, null,
|
|
4905
|
+
this.decodeDracoFile(e, t, null, null, fe, n).catch(n);
|
|
4906
4906
|
}
|
|
4907
4907
|
//
|
|
4908
4908
|
decodeDracoFile(e, t, n, s, i = Ae, o = () => {
|
|
@@ -4954,10 +4954,10 @@ class Dr extends As {
|
|
|
4954
4954
|
return t;
|
|
4955
4955
|
}
|
|
4956
4956
|
_assignVertexColorSpace(e, t) {
|
|
4957
|
-
if (t !==
|
|
4957
|
+
if (t !== fe) return;
|
|
4958
4958
|
const n = new B();
|
|
4959
4959
|
for (let s = 0, i = e.count; s < i; s++)
|
|
4960
|
-
n.fromBufferAttribute(e, s), Lt.colorSpaceToWorking(n,
|
|
4960
|
+
n.fromBufferAttribute(e, s), Lt.colorSpaceToWorking(n, fe), e.setXYZ(s, n.r, n.g, n.b);
|
|
4961
4961
|
}
|
|
4962
4962
|
_loadLibrary(e, t) {
|
|
4963
4963
|
const n = new ct(this.manager);
|
|
@@ -5039,8 +5039,8 @@ function Wr() {
|
|
|
5039
5039
|
e.then((d) => {
|
|
5040
5040
|
const c = d.draco, u = new c.Decoder();
|
|
5041
5041
|
try {
|
|
5042
|
-
const h = t(c, u, new Int8Array(l), A),
|
|
5043
|
-
h.index &&
|
|
5042
|
+
const h = t(c, u, new Int8Array(l), A), f = h.attributes.map((p) => p.array.buffer);
|
|
5043
|
+
h.index && f.push(h.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: h }, f);
|
|
5044
5044
|
} catch (h) {
|
|
5045
5045
|
console.error(h), self.postMessage({ type: "error", id: a.id, error: h.message });
|
|
5046
5046
|
} finally {
|
|
@@ -5053,29 +5053,29 @@ function Wr() {
|
|
|
5053
5053
|
function t(o, a, l, A) {
|
|
5054
5054
|
const d = A.attributeIDs, c = A.attributeTypes;
|
|
5055
5055
|
let u, h;
|
|
5056
|
-
const
|
|
5057
|
-
if (
|
|
5056
|
+
const f = a.GetEncodedGeometryType(l);
|
|
5057
|
+
if (f === o.TRIANGULAR_MESH)
|
|
5058
5058
|
u = new o.Mesh(), h = a.DecodeArrayToMesh(l, l.byteLength, u);
|
|
5059
|
-
else if (
|
|
5059
|
+
else if (f === o.POINT_CLOUD)
|
|
5060
5060
|
u = new o.PointCloud(), h = a.DecodeArrayToPointCloud(l, l.byteLength, u);
|
|
5061
5061
|
else
|
|
5062
5062
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
5063
5063
|
if (!h.ok() || u.ptr === 0)
|
|
5064
5064
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + h.error_msg());
|
|
5065
|
-
const
|
|
5066
|
-
for (const
|
|
5067
|
-
const
|
|
5068
|
-
let I,
|
|
5065
|
+
const p = { index: null, attributes: [] };
|
|
5066
|
+
for (const m in d) {
|
|
5067
|
+
const g = self[c[m]];
|
|
5068
|
+
let I, y;
|
|
5069
5069
|
if (A.useUniqueIDs)
|
|
5070
|
-
|
|
5070
|
+
y = d[m], I = a.GetAttributeByUniqueId(u, y);
|
|
5071
5071
|
else {
|
|
5072
|
-
if (
|
|
5073
|
-
I = a.GetAttribute(u,
|
|
5072
|
+
if (y = a.GetAttributeId(u, o[d[m]]), y === -1) continue;
|
|
5073
|
+
I = a.GetAttribute(u, y);
|
|
5074
5074
|
}
|
|
5075
|
-
const
|
|
5076
|
-
|
|
5075
|
+
const x = s(o, a, u, m, g, I);
|
|
5076
|
+
m === "color" && (x.vertexColorSpace = A.vertexColorSpace), p.attributes.push(x);
|
|
5077
5077
|
}
|
|
5078
|
-
return
|
|
5078
|
+
return f === o.TRIANGULAR_MESH && (p.index = n(o, a, u)), o.destroy(u), p;
|
|
5079
5079
|
}
|
|
5080
5080
|
function n(o, a, l) {
|
|
5081
5081
|
const d = l.num_faces() * 3, c = d * 4, u = o._malloc(c);
|
|
@@ -5084,27 +5084,27 @@ function Wr() {
|
|
|
5084
5084
|
return o._free(u), { array: h, itemSize: 1 };
|
|
5085
5085
|
}
|
|
5086
5086
|
function s(o, a, l, A, d, c) {
|
|
5087
|
-
const u = l.num_points(), h = c.num_components(),
|
|
5088
|
-
a.GetAttributeDataArrayForAllPoints(l, c,
|
|
5089
|
-
const v = new d(o.HEAPF32.buffer,
|
|
5087
|
+
const u = l.num_points(), h = c.num_components(), f = i(o, d), p = h * d.BYTES_PER_ELEMENT, m = Math.ceil(p / 4) * 4, g = m / d.BYTES_PER_ELEMENT, I = u * p, y = u * m, x = o._malloc(I);
|
|
5088
|
+
a.GetAttributeDataArrayForAllPoints(l, c, f, I, x);
|
|
5089
|
+
const v = new d(o.HEAPF32.buffer, x, I / d.BYTES_PER_ELEMENT);
|
|
5090
5090
|
let M;
|
|
5091
|
-
if (
|
|
5091
|
+
if (p === m)
|
|
5092
5092
|
M = v.slice();
|
|
5093
5093
|
else {
|
|
5094
|
-
M = new d(
|
|
5094
|
+
M = new d(y / d.BYTES_PER_ELEMENT);
|
|
5095
5095
|
let L = 0;
|
|
5096
|
-
for (let Q = 0,
|
|
5096
|
+
for (let Q = 0, ee = v.length; Q < ee; Q++) {
|
|
5097
5097
|
for (let Y = 0; Y < h; Y++)
|
|
5098
5098
|
M[L + Y] = v[Q * h + Y];
|
|
5099
|
-
L +=
|
|
5099
|
+
L += g;
|
|
5100
5100
|
}
|
|
5101
5101
|
}
|
|
5102
|
-
return o._free(
|
|
5102
|
+
return o._free(x), {
|
|
5103
5103
|
name: A,
|
|
5104
5104
|
count: u,
|
|
5105
5105
|
itemSize: h,
|
|
5106
5106
|
array: M,
|
|
5107
|
-
stride:
|
|
5107
|
+
stride: g
|
|
5108
5108
|
};
|
|
5109
5109
|
}
|
|
5110
5110
|
function i(o, a) {
|
|
@@ -5155,9 +5155,9 @@ function zr(r) {
|
|
|
5155
5155
|
repeatY: l = 4,
|
|
5156
5156
|
speedX: A = 5e-4,
|
|
5157
5157
|
speedY: d = 5e-4
|
|
5158
|
-
} = r || {}, c = new w.PlaneGeometry(e, t), h = new w.TextureLoader().load(jr, (
|
|
5159
|
-
|
|
5160
|
-
}),
|
|
5158
|
+
} = r || {}, c = new w.PlaneGeometry(e, t), h = new w.TextureLoader().load(jr, (m) => {
|
|
5159
|
+
m.wrapS = m.wrapT = w.RepeatWrapping, m.repeat.set(a, l), m.generateMipmaps = !1, m.minFilter = w.LinearFilter, m.magFilter = w.LinearFilter;
|
|
5160
|
+
}), f = new w.MeshStandardMaterial({
|
|
5161
5161
|
color: n,
|
|
5162
5162
|
roughness: s,
|
|
5163
5163
|
metalness: i,
|
|
@@ -5167,8 +5167,8 @@ function zr(r) {
|
|
|
5167
5167
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
5168
5168
|
transparent: !0,
|
|
5169
5169
|
opacity: 0.6
|
|
5170
|
-
}),
|
|
5171
|
-
|
|
5170
|
+
}), p = new w.Mesh(c, f);
|
|
5171
|
+
p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: A, y: d }, Xe(p);
|
|
5172
5172
|
}
|
|
5173
5173
|
function Gr(r) {
|
|
5174
5174
|
const e = Ko();
|
|
@@ -5257,12 +5257,12 @@ const Zr = {
|
|
|
5257
5257
|
},
|
|
5258
5258
|
emits: ["select", "delete"],
|
|
5259
5259
|
setup(r, { emit: e }) {
|
|
5260
|
-
const t = r, n = e, s =
|
|
5261
|
-
(
|
|
5260
|
+
const t = r, n = e, s = O(null), { expandedSet: i, toggleExpand: o } = Cn("treeExpand"), a = $e(() => i.value.has(t.node.uuid)), l = $e(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), A = $e(() => (t.version, t.node.children.filter(
|
|
5261
|
+
(p) => p.userData.isMovable === !0
|
|
5262
5262
|
))), d = $e(
|
|
5263
5263
|
() => {
|
|
5264
|
-
var
|
|
5265
|
-
return ((
|
|
5264
|
+
var p;
|
|
5265
|
+
return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
|
|
5266
5266
|
}
|
|
5267
5267
|
);
|
|
5268
5268
|
In(
|
|
@@ -5276,13 +5276,13 @@ const Zr = {
|
|
|
5276
5276
|
},
|
|
5277
5277
|
{ flush: "post" }
|
|
5278
5278
|
);
|
|
5279
|
-
const c = (
|
|
5280
|
-
|
|
5281
|
-
}, u = (
|
|
5282
|
-
|
|
5283
|
-
}, h = (
|
|
5284
|
-
return (
|
|
5285
|
-
const
|
|
5279
|
+
const c = (p) => {
|
|
5280
|
+
p.stopPropagation(), n("select", t.node);
|
|
5281
|
+
}, u = (p) => {
|
|
5282
|
+
p.stopPropagation(), n("delete", t.node);
|
|
5283
|
+
}, h = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", f = (p) => p.name || `${p.type} (${p.id})`;
|
|
5284
|
+
return (p, m) => {
|
|
5285
|
+
const g = yn("TreeItem", !0);
|
|
5286
5286
|
return R(), P("div", {
|
|
5287
5287
|
class: "tree-node",
|
|
5288
5288
|
ref_key: "nodeRef",
|
|
@@ -5295,23 +5295,23 @@ const Zr = {
|
|
|
5295
5295
|
l.value ? (R(), P("span", {
|
|
5296
5296
|
key: 0,
|
|
5297
5297
|
class: "toggle-icon",
|
|
5298
|
-
onClick:
|
|
5299
|
-
},
|
|
5300
|
-
C("span", Xr,
|
|
5301
|
-
C("span", qr,
|
|
5298
|
+
onClick: m[0] || (m[0] = Yt((I) => xn(o)(p.node.uuid), ["stop"]))
|
|
5299
|
+
}, $(a.value ? "▼" : "▶"), 1)) : (R(), P("span", Zr)),
|
|
5300
|
+
C("span", Xr, $(h(p.node)), 1),
|
|
5301
|
+
C("span", qr, $(f(p.node)), 1),
|
|
5302
5302
|
C("button", {
|
|
5303
5303
|
class: "tree-delete",
|
|
5304
5304
|
onClick: Yt(u, ["stop"])
|
|
5305
5305
|
}, "×")
|
|
5306
5306
|
], 2),
|
|
5307
5307
|
a.value && l.value ? (R(), P("div", Vr, [
|
|
5308
|
-
(R(!0), P(Pe, null, jt(A.value, (I) => (R(), nt(
|
|
5308
|
+
(R(!0), P(Pe, null, jt(A.value, (I) => (R(), nt(g, {
|
|
5309
5309
|
key: I.uuid,
|
|
5310
5310
|
node: I,
|
|
5311
|
-
"selected-object":
|
|
5312
|
-
version:
|
|
5313
|
-
onSelect:
|
|
5314
|
-
onDelete:
|
|
5311
|
+
"selected-object": p.selectedObject,
|
|
5312
|
+
version: p.version,
|
|
5313
|
+
onSelect: m[1] || (m[1] = (y) => n("select", y)),
|
|
5314
|
+
onDelete: m[2] || (m[2] = (y) => n("delete", y))
|
|
5315
5315
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
5316
5316
|
])) : Z("", !0)
|
|
5317
5317
|
], 512);
|
|
@@ -5343,7 +5343,7 @@ const Zr = {
|
|
|
5343
5343
|
metalness: 0,
|
|
5344
5344
|
roughness: 0.5,
|
|
5345
5345
|
opacity: 1
|
|
5346
|
-
}), o =
|
|
5346
|
+
}), o = O(!1), a = _t({
|
|
5347
5347
|
intensity: 1
|
|
5348
5348
|
});
|
|
5349
5349
|
function l() {
|
|
@@ -5351,16 +5351,16 @@ const Zr = {
|
|
|
5351
5351
|
}
|
|
5352
5352
|
function A(u) {
|
|
5353
5353
|
let h = null;
|
|
5354
|
-
return u.traverse((
|
|
5355
|
-
if (
|
|
5356
|
-
const
|
|
5357
|
-
for (const
|
|
5358
|
-
if (
|
|
5359
|
-
const I =
|
|
5354
|
+
return u.traverse((f) => {
|
|
5355
|
+
if (f.type === "Mesh" && !h) {
|
|
5356
|
+
const p = f, m = Array.isArray(p.material) ? p.material : [p.material];
|
|
5357
|
+
for (const g of m)
|
|
5358
|
+
if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
|
|
5359
|
+
const I = g;
|
|
5360
5360
|
h = {
|
|
5361
5361
|
metalness: I.metalness ?? 0,
|
|
5362
5362
|
roughness: I.roughness ?? 0.5,
|
|
5363
|
-
opacity:
|
|
5363
|
+
opacity: g.opacity ?? 1
|
|
5364
5364
|
};
|
|
5365
5365
|
break;
|
|
5366
5366
|
}
|
|
@@ -5368,14 +5368,14 @@ const Zr = {
|
|
|
5368
5368
|
}), h;
|
|
5369
5369
|
}
|
|
5370
5370
|
function d(u, h) {
|
|
5371
|
-
let
|
|
5372
|
-
return u.traverse((
|
|
5373
|
-
if (
|
|
5374
|
-
const
|
|
5375
|
-
for (const I of
|
|
5376
|
-
I && (I.type === "MeshStandardMaterial" || I.type === "MeshPhongMaterial") && (h.metalness !== void 0 && (I.metalness = h.metalness), h.roughness !== void 0 && (I.roughness = h.roughness), h.opacity !== void 0 && (I.opacity = h.opacity, I.transparent = h.opacity < 1), I.needsUpdate = !0,
|
|
5371
|
+
let f = !1;
|
|
5372
|
+
return u.traverse((p) => {
|
|
5373
|
+
if (p.type === "Mesh") {
|
|
5374
|
+
const m = p, g = Array.isArray(m.material) ? m.material : [m.material];
|
|
5375
|
+
for (const I of g)
|
|
5376
|
+
I && (I.type === "MeshStandardMaterial" || I.type === "MeshPhongMaterial") && (h.metalness !== void 0 && (I.metalness = h.metalness), h.roughness !== void 0 && (I.roughness = h.roughness), h.opacity !== void 0 && (I.opacity = h.opacity, I.transparent = h.opacity < 1), I.needsUpdate = !0, f = !0);
|
|
5377
5377
|
}
|
|
5378
|
-
}),
|
|
5378
|
+
}), f;
|
|
5379
5379
|
}
|
|
5380
5380
|
function c() {
|
|
5381
5381
|
if (t.selectedObject) {
|
|
@@ -5387,7 +5387,7 @@ const Zr = {
|
|
|
5387
5387
|
o.value = u;
|
|
5388
5388
|
}
|
|
5389
5389
|
}
|
|
5390
|
-
return
|
|
5390
|
+
return he(
|
|
5391
5391
|
() => t.selectedObject,
|
|
5392
5392
|
(u) => {
|
|
5393
5393
|
if (u) {
|
|
@@ -5404,12 +5404,12 @@ const Zr = {
|
|
|
5404
5404
|
h[14] || (h[14] = C("span", null, "X:", -1)),
|
|
5405
5405
|
k(C("input", {
|
|
5406
5406
|
type: "number",
|
|
5407
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
5407
|
+
"onUpdate:modelValue": h[0] || (h[0] = (f) => u.transform.position.x = f),
|
|
5408
5408
|
step: "0.01",
|
|
5409
5409
|
onInput: s
|
|
5410
5410
|
}, null, 544), [
|
|
5411
5411
|
[
|
|
5412
|
-
|
|
5412
|
+
N,
|
|
5413
5413
|
u.transform.position.x,
|
|
5414
5414
|
void 0,
|
|
5415
5415
|
{ number: !0 }
|
|
@@ -5418,12 +5418,12 @@ const Zr = {
|
|
|
5418
5418
|
h[15] || (h[15] = C("span", null, "Y:", -1)),
|
|
5419
5419
|
k(C("input", {
|
|
5420
5420
|
type: "number",
|
|
5421
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
5421
|
+
"onUpdate:modelValue": h[1] || (h[1] = (f) => u.transform.position.y = f),
|
|
5422
5422
|
step: "0.01",
|
|
5423
5423
|
onInput: s
|
|
5424
5424
|
}, null, 544), [
|
|
5425
5425
|
[
|
|
5426
|
-
|
|
5426
|
+
N,
|
|
5427
5427
|
u.transform.position.y,
|
|
5428
5428
|
void 0,
|
|
5429
5429
|
{ number: !0 }
|
|
@@ -5432,12 +5432,12 @@ const Zr = {
|
|
|
5432
5432
|
h[16] || (h[16] = C("span", null, "Z:", -1)),
|
|
5433
5433
|
k(C("input", {
|
|
5434
5434
|
type: "number",
|
|
5435
|
-
"onUpdate:modelValue": h[2] || (h[2] = (
|
|
5435
|
+
"onUpdate:modelValue": h[2] || (h[2] = (f) => u.transform.position.z = f),
|
|
5436
5436
|
step: "0.01",
|
|
5437
5437
|
onInput: s
|
|
5438
5438
|
}, null, 544), [
|
|
5439
5439
|
[
|
|
5440
|
-
|
|
5440
|
+
N,
|
|
5441
5441
|
u.transform.position.z,
|
|
5442
5442
|
void 0,
|
|
5443
5443
|
{ number: !0 }
|
|
@@ -5451,12 +5451,12 @@ const Zr = {
|
|
|
5451
5451
|
h[18] || (h[18] = C("span", null, "X:", -1)),
|
|
5452
5452
|
k(C("input", {
|
|
5453
5453
|
type: "number",
|
|
5454
|
-
"onUpdate:modelValue": h[3] || (h[3] = (
|
|
5454
|
+
"onUpdate:modelValue": h[3] || (h[3] = (f) => u.transform.rotation.x = f),
|
|
5455
5455
|
step: "0.01",
|
|
5456
5456
|
onInput: s
|
|
5457
5457
|
}, null, 544), [
|
|
5458
5458
|
[
|
|
5459
|
-
|
|
5459
|
+
N,
|
|
5460
5460
|
u.transform.rotation.x,
|
|
5461
5461
|
void 0,
|
|
5462
5462
|
{ number: !0 }
|
|
@@ -5465,12 +5465,12 @@ const Zr = {
|
|
|
5465
5465
|
h[19] || (h[19] = C("span", null, "Y:", -1)),
|
|
5466
5466
|
k(C("input", {
|
|
5467
5467
|
type: "number",
|
|
5468
|
-
"onUpdate:modelValue": h[4] || (h[4] = (
|
|
5468
|
+
"onUpdate:modelValue": h[4] || (h[4] = (f) => u.transform.rotation.y = f),
|
|
5469
5469
|
step: "0.01",
|
|
5470
5470
|
onInput: s
|
|
5471
5471
|
}, null, 544), [
|
|
5472
5472
|
[
|
|
5473
|
-
|
|
5473
|
+
N,
|
|
5474
5474
|
u.transform.rotation.y,
|
|
5475
5475
|
void 0,
|
|
5476
5476
|
{ number: !0 }
|
|
@@ -5479,12 +5479,12 @@ const Zr = {
|
|
|
5479
5479
|
h[20] || (h[20] = C("span", null, "Z:", -1)),
|
|
5480
5480
|
k(C("input", {
|
|
5481
5481
|
type: "number",
|
|
5482
|
-
"onUpdate:modelValue": h[5] || (h[5] = (
|
|
5482
|
+
"onUpdate:modelValue": h[5] || (h[5] = (f) => u.transform.rotation.z = f),
|
|
5483
5483
|
step: "0.01",
|
|
5484
5484
|
onInput: s
|
|
5485
5485
|
}, null, 544), [
|
|
5486
5486
|
[
|
|
5487
|
-
|
|
5487
|
+
N,
|
|
5488
5488
|
u.transform.rotation.z,
|
|
5489
5489
|
void 0,
|
|
5490
5490
|
{ number: !0 }
|
|
@@ -5498,12 +5498,12 @@ const Zr = {
|
|
|
5498
5498
|
h[22] || (h[22] = C("span", null, "X:", -1)),
|
|
5499
5499
|
k(C("input", {
|
|
5500
5500
|
type: "number",
|
|
5501
|
-
"onUpdate:modelValue": h[6] || (h[6] = (
|
|
5501
|
+
"onUpdate:modelValue": h[6] || (h[6] = (f) => u.transform.scale.x = f),
|
|
5502
5502
|
step: "0.01",
|
|
5503
5503
|
onInput: s
|
|
5504
5504
|
}, null, 544), [
|
|
5505
5505
|
[
|
|
5506
|
-
|
|
5506
|
+
N,
|
|
5507
5507
|
u.transform.scale.x,
|
|
5508
5508
|
void 0,
|
|
5509
5509
|
{ number: !0 }
|
|
@@ -5512,12 +5512,12 @@ const Zr = {
|
|
|
5512
5512
|
h[23] || (h[23] = C("span", null, "Y:", -1)),
|
|
5513
5513
|
k(C("input", {
|
|
5514
5514
|
type: "number",
|
|
5515
|
-
"onUpdate:modelValue": h[7] || (h[7] = (
|
|
5515
|
+
"onUpdate:modelValue": h[7] || (h[7] = (f) => u.transform.scale.y = f),
|
|
5516
5516
|
step: "0.01",
|
|
5517
5517
|
onInput: s
|
|
5518
5518
|
}, null, 544), [
|
|
5519
5519
|
[
|
|
5520
|
-
|
|
5520
|
+
N,
|
|
5521
5521
|
u.transform.scale.y,
|
|
5522
5522
|
void 0,
|
|
5523
5523
|
{ number: !0 }
|
|
@@ -5526,12 +5526,12 @@ const Zr = {
|
|
|
5526
5526
|
h[24] || (h[24] = C("span", null, "Z:", -1)),
|
|
5527
5527
|
k(C("input", {
|
|
5528
5528
|
type: "number",
|
|
5529
|
-
"onUpdate:modelValue": h[8] || (h[8] = (
|
|
5529
|
+
"onUpdate:modelValue": h[8] || (h[8] = (f) => u.transform.scale.z = f),
|
|
5530
5530
|
step: "0.01",
|
|
5531
5531
|
onInput: s
|
|
5532
5532
|
}, null, 544), [
|
|
5533
5533
|
[
|
|
5534
|
-
|
|
5534
|
+
N,
|
|
5535
5535
|
u.transform.scale.z,
|
|
5536
5536
|
void 0,
|
|
5537
5537
|
{ number: !0 }
|
|
@@ -5548,11 +5548,11 @@ const Zr = {
|
|
|
5548
5548
|
min: "0",
|
|
5549
5549
|
max: "10",
|
|
5550
5550
|
step: "0.1",
|
|
5551
|
-
"onUpdate:modelValue": h[9] || (h[9] = (
|
|
5551
|
+
"onUpdate:modelValue": h[9] || (h[9] = (f) => a.intensity = f),
|
|
5552
5552
|
onInput: l
|
|
5553
5553
|
}, null, 544), [
|
|
5554
5554
|
[
|
|
5555
|
-
|
|
5555
|
+
N,
|
|
5556
5556
|
a.intensity,
|
|
5557
5557
|
void 0,
|
|
5558
5558
|
{ number: !0 }
|
|
@@ -5563,12 +5563,12 @@ const Zr = {
|
|
|
5563
5563
|
min: "0",
|
|
5564
5564
|
max: "100",
|
|
5565
5565
|
step: "0.1",
|
|
5566
|
-
"onUpdate:modelValue": h[10] || (h[10] = (
|
|
5566
|
+
"onUpdate:modelValue": h[10] || (h[10] = (f) => a.intensity = f),
|
|
5567
5567
|
class: "intensity-input",
|
|
5568
5568
|
onInput: l
|
|
5569
5569
|
}, null, 544), [
|
|
5570
5570
|
[
|
|
5571
|
-
|
|
5571
|
+
N,
|
|
5572
5572
|
a.intensity,
|
|
5573
5573
|
void 0,
|
|
5574
5574
|
{ number: !0 }
|
|
@@ -5585,17 +5585,17 @@ const Zr = {
|
|
|
5585
5585
|
min: "0",
|
|
5586
5586
|
max: "1",
|
|
5587
5587
|
step: "0.01",
|
|
5588
|
-
"onUpdate:modelValue": h[11] || (h[11] = (
|
|
5588
|
+
"onUpdate:modelValue": h[11] || (h[11] = (f) => i.metalness = f),
|
|
5589
5589
|
onInput: c
|
|
5590
5590
|
}, null, 544), [
|
|
5591
5591
|
[
|
|
5592
|
-
|
|
5592
|
+
N,
|
|
5593
5593
|
i.metalness,
|
|
5594
5594
|
void 0,
|
|
5595
5595
|
{ number: !0 }
|
|
5596
5596
|
]
|
|
5597
5597
|
]),
|
|
5598
|
-
C("span", aa,
|
|
5598
|
+
C("span", aa, $(i.metalness.toFixed(2)), 1)
|
|
5599
5599
|
]),
|
|
5600
5600
|
C("div", la, [
|
|
5601
5601
|
h[29] || (h[29] = C("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
@@ -5604,17 +5604,17 @@ const Zr = {
|
|
|
5604
5604
|
min: "0",
|
|
5605
5605
|
max: "1",
|
|
5606
5606
|
step: "0.01",
|
|
5607
|
-
"onUpdate:modelValue": h[12] || (h[12] = (
|
|
5607
|
+
"onUpdate:modelValue": h[12] || (h[12] = (f) => i.roughness = f),
|
|
5608
5608
|
onInput: c
|
|
5609
5609
|
}, null, 544), [
|
|
5610
5610
|
[
|
|
5611
|
-
|
|
5611
|
+
N,
|
|
5612
5612
|
i.roughness,
|
|
5613
5613
|
void 0,
|
|
5614
5614
|
{ number: !0 }
|
|
5615
5615
|
]
|
|
5616
5616
|
]),
|
|
5617
|
-
C("span", Aa,
|
|
5617
|
+
C("span", Aa, $(i.roughness.toFixed(2)), 1)
|
|
5618
5618
|
]),
|
|
5619
5619
|
C("div", ca, [
|
|
5620
5620
|
h[30] || (h[30] = C("span", { class: "slider-label" }, "透明度", -1)),
|
|
@@ -5623,17 +5623,17 @@ const Zr = {
|
|
|
5623
5623
|
min: "0",
|
|
5624
5624
|
max: "1",
|
|
5625
5625
|
step: "0.01",
|
|
5626
|
-
"onUpdate:modelValue": h[13] || (h[13] = (
|
|
5626
|
+
"onUpdate:modelValue": h[13] || (h[13] = (f) => i.opacity = f),
|
|
5627
5627
|
onInput: c
|
|
5628
5628
|
}, null, 544), [
|
|
5629
5629
|
[
|
|
5630
|
-
|
|
5630
|
+
N,
|
|
5631
5631
|
i.opacity,
|
|
5632
5632
|
void 0,
|
|
5633
5633
|
{ number: !0 }
|
|
5634
5634
|
]
|
|
5635
5635
|
]),
|
|
5636
|
-
C("span", ua,
|
|
5636
|
+
C("span", ua, $(i.opacity.toFixed(2)), 1)
|
|
5637
5637
|
]),
|
|
5638
5638
|
o.value ? Z("", !0) : (R(), P("div", da, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
5639
5639
|
])) : Z("", !0)
|
|
@@ -5658,135 +5658,135 @@ const Zr = {
|
|
|
5658
5658
|
selectedObject: {}
|
|
5659
5659
|
},
|
|
5660
5660
|
setup(r) {
|
|
5661
|
-
const e = r, t =
|
|
5662
|
-
function l(
|
|
5663
|
-
if (
|
|
5664
|
-
if (
|
|
5665
|
-
if (Array.isArray(
|
|
5666
|
-
const
|
|
5667
|
-
return
|
|
5661
|
+
const e = r, t = O(""), n = O(""), s = O(null), i = O(""), o = O(null), a = O([]);
|
|
5662
|
+
function l(y) {
|
|
5663
|
+
if (y === null) return "null";
|
|
5664
|
+
if (y === void 0) return "undefined";
|
|
5665
|
+
if (Array.isArray(y)) return "array";
|
|
5666
|
+
const x = typeof y;
|
|
5667
|
+
return x === "object" ? "object" : x === "number" ? "number" : x === "boolean" ? "boolean" : "string";
|
|
5668
5668
|
}
|
|
5669
|
-
function A(
|
|
5670
|
-
const
|
|
5671
|
-
if (
|
|
5672
|
-
for (const [v, M] of Object.entries(
|
|
5673
|
-
typeof v == "string" && !v.startsWith("_") &&
|
|
5669
|
+
function A(y) {
|
|
5670
|
+
const x = [];
|
|
5671
|
+
if (y.userData)
|
|
5672
|
+
for (const [v, M] of Object.entries(y.userData))
|
|
5673
|
+
typeof v == "string" && !v.startsWith("_") && x.push({
|
|
5674
5674
|
key: v,
|
|
5675
5675
|
value: typeof M == "object" ? JSON.stringify(M) : String(M),
|
|
5676
5676
|
rawType: l(M)
|
|
5677
5677
|
});
|
|
5678
|
-
a.value =
|
|
5678
|
+
a.value = x;
|
|
5679
5679
|
}
|
|
5680
|
-
function d(
|
|
5681
|
-
const
|
|
5682
|
-
if (
|
|
5683
|
-
if (
|
|
5684
|
-
if (
|
|
5685
|
-
if (
|
|
5686
|
-
const v = Number(
|
|
5687
|
-
if (
|
|
5688
|
-
return String(v) !==
|
|
5689
|
-
if (
|
|
5680
|
+
function d(y) {
|
|
5681
|
+
const x = y.trim();
|
|
5682
|
+
if (x === "true") return !0;
|
|
5683
|
+
if (x === "false") return !1;
|
|
5684
|
+
if (x === "null") return null;
|
|
5685
|
+
if (x === "undefined") return;
|
|
5686
|
+
const v = Number(x);
|
|
5687
|
+
if (x !== "" && !isNaN(v))
|
|
5688
|
+
return String(v) !== x ? x : v;
|
|
5689
|
+
if (x.startsWith("{") && x.endsWith("}") || x.startsWith("[") && x.endsWith("]"))
|
|
5690
5690
|
try {
|
|
5691
|
-
return JSON.parse(
|
|
5691
|
+
return JSON.parse(x);
|
|
5692
5692
|
} catch {
|
|
5693
5693
|
}
|
|
5694
|
-
return
|
|
5694
|
+
return x;
|
|
5695
5695
|
}
|
|
5696
5696
|
function c() {
|
|
5697
5697
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
5698
|
-
const
|
|
5699
|
-
if (
|
|
5698
|
+
const y = t.value.trim();
|
|
5699
|
+
if (y === "isMovable") {
|
|
5700
5700
|
t.value = "";
|
|
5701
5701
|
return;
|
|
5702
5702
|
}
|
|
5703
|
-
const
|
|
5704
|
-
e.selectedObject.userData[
|
|
5703
|
+
const x = d(n.value);
|
|
5704
|
+
e.selectedObject.userData[y] = x, A(e.selectedObject), t.value = "", n.value = "";
|
|
5705
5705
|
}
|
|
5706
|
-
function u(
|
|
5707
|
-
e.selectedObject && (delete e.selectedObject.userData[
|
|
5706
|
+
function u(y, x) {
|
|
5707
|
+
e.selectedObject && (delete e.selectedObject.userData[y], A(e.selectedObject));
|
|
5708
5708
|
}
|
|
5709
|
-
function h(
|
|
5710
|
-
return
|
|
5709
|
+
function h(y) {
|
|
5710
|
+
return y.length <= 28 ? y : y.substring(0, 28) + "…";
|
|
5711
5711
|
}
|
|
5712
|
-
function
|
|
5713
|
-
s.value =
|
|
5714
|
-
const
|
|
5715
|
-
if (!
|
|
5716
|
-
const v =
|
|
5712
|
+
function f(y) {
|
|
5713
|
+
s.value = y;
|
|
5714
|
+
const x = e.selectedObject;
|
|
5715
|
+
if (!x) return;
|
|
5716
|
+
const v = x.userData[y];
|
|
5717
5717
|
try {
|
|
5718
5718
|
i.value = JSON.stringify(v, null, 2);
|
|
5719
5719
|
} catch {
|
|
5720
5720
|
i.value = String(v);
|
|
5721
5721
|
}
|
|
5722
|
-
|
|
5722
|
+
p();
|
|
5723
5723
|
}
|
|
5724
|
-
function
|
|
5725
|
-
const
|
|
5726
|
-
if (!
|
|
5724
|
+
function p() {
|
|
5725
|
+
const y = i.value.trim();
|
|
5726
|
+
if (!y) {
|
|
5727
5727
|
o.value = null;
|
|
5728
5728
|
return;
|
|
5729
5729
|
}
|
|
5730
|
-
if (!
|
|
5730
|
+
if (!y.startsWith("{") && !y.startsWith("[")) {
|
|
5731
5731
|
o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
|
|
5732
5732
|
return;
|
|
5733
5733
|
}
|
|
5734
5734
|
try {
|
|
5735
|
-
JSON.parse(
|
|
5736
|
-
} catch (
|
|
5737
|
-
o.value = "JSON 格式错误:" +
|
|
5735
|
+
JSON.parse(y), o.value = null;
|
|
5736
|
+
} catch (x) {
|
|
5737
|
+
o.value = "JSON 格式错误:" + x.message;
|
|
5738
5738
|
}
|
|
5739
5739
|
}
|
|
5740
|
-
function
|
|
5741
|
-
const
|
|
5742
|
-
if (!
|
|
5740
|
+
function m(y) {
|
|
5741
|
+
const x = e.selectedObject;
|
|
5742
|
+
if (!x) return;
|
|
5743
5743
|
const v = i.value.trim();
|
|
5744
5744
|
try {
|
|
5745
5745
|
const M = JSON.parse(v);
|
|
5746
|
-
|
|
5746
|
+
x.userData[y] = M, A(x), s.value = null, i.value = "";
|
|
5747
5747
|
} catch {
|
|
5748
|
-
|
|
5748
|
+
x.userData[y] = v, A(x), s.value = null, i.value = "";
|
|
5749
5749
|
}
|
|
5750
5750
|
}
|
|
5751
|
-
function
|
|
5751
|
+
function g() {
|
|
5752
5752
|
s.value = null, i.value = "";
|
|
5753
5753
|
}
|
|
5754
5754
|
function I() {
|
|
5755
|
-
const
|
|
5756
|
-
if (!
|
|
5757
|
-
const
|
|
5758
|
-
|
|
5759
|
-
x:
|
|
5760
|
-
y:
|
|
5761
|
-
z:
|
|
5762
|
-
}, A(
|
|
5755
|
+
const y = e.selectedObject;
|
|
5756
|
+
if (!y) return;
|
|
5757
|
+
const x = Bo();
|
|
5758
|
+
x && (y.userData.closeUpView = {
|
|
5759
|
+
x: x.position.x,
|
|
5760
|
+
y: x.position.y,
|
|
5761
|
+
z: x.position.z
|
|
5762
|
+
}, A(y));
|
|
5763
5763
|
}
|
|
5764
|
-
return
|
|
5764
|
+
return he(
|
|
5765
5765
|
() => e.selectedObject,
|
|
5766
|
-
(
|
|
5767
|
-
|
|
5766
|
+
(y) => {
|
|
5767
|
+
y ? A(y) : a.value = [], s.value = null, i.value = "";
|
|
5768
5768
|
},
|
|
5769
5769
|
{ immediate: !0 }
|
|
5770
|
-
), (
|
|
5770
|
+
), (y, x) => (R(), P("div", pa, [
|
|
5771
5771
|
C("div", ma, [
|
|
5772
|
-
|
|
5772
|
+
x[3] || (x[3] = C("label", null, "userData 属性", -1)),
|
|
5773
5773
|
C("div", ga, [
|
|
5774
5774
|
k(C("input", {
|
|
5775
5775
|
type: "text",
|
|
5776
|
-
"onUpdate:modelValue":
|
|
5776
|
+
"onUpdate:modelValue": x[0] || (x[0] = (v) => t.value = v),
|
|
5777
5777
|
placeholder: "属性名",
|
|
5778
5778
|
class: "ud-input",
|
|
5779
5779
|
onKeyup: ze(c, ["enter"])
|
|
5780
5780
|
}, null, 544), [
|
|
5781
|
-
[
|
|
5781
|
+
[N, t.value]
|
|
5782
5782
|
]),
|
|
5783
5783
|
k(C("textarea", {
|
|
5784
|
-
"onUpdate:modelValue":
|
|
5784
|
+
"onUpdate:modelValue": x[1] || (x[1] = (v) => n.value = v),
|
|
5785
5785
|
placeholder: "值",
|
|
5786
5786
|
class: "ud-input ud-textarea",
|
|
5787
5787
|
onKeyup: ze(Yt(c, ["prevent"]), ["enter"])
|
|
5788
5788
|
}, null, 40, ba), [
|
|
5789
|
-
[
|
|
5789
|
+
[N, n.value]
|
|
5790
5790
|
]),
|
|
5791
5791
|
C("button", {
|
|
5792
5792
|
class: "ud-btn add-btn",
|
|
@@ -5802,35 +5802,35 @@ const Zr = {
|
|
|
5802
5802
|
"editing-json": s.value === v.key
|
|
5803
5803
|
}])
|
|
5804
5804
|
}, [
|
|
5805
|
-
C("span", Ia,
|
|
5806
|
-
v.key === "isMovable" ? (R(), P("span", ya,
|
|
5805
|
+
C("span", Ia, $(v.key), 1),
|
|
5806
|
+
v.key === "isMovable" ? (R(), P("span", ya, $(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (R(), P(Pe, { key: 1 }, [
|
|
5807
5807
|
s.value !== v.key ? (R(), P(Pe, { key: 0 }, [
|
|
5808
|
-
C("span", xa,
|
|
5808
|
+
C("span", xa, $(h(v.value)), 1),
|
|
5809
5809
|
C("button", {
|
|
5810
5810
|
class: "ud-btn edit-json-btn",
|
|
5811
5811
|
title: "编辑对象",
|
|
5812
|
-
onClick: (L) =>
|
|
5812
|
+
onClick: (L) => f(v.key)
|
|
5813
5813
|
}, " ✎ ", 8, va)
|
|
5814
5814
|
], 64)) : (R(), P(Pe, { key: 1 }, [
|
|
5815
|
-
o.value ? (R(), P("div", Sa, " ⚠ " +
|
|
5815
|
+
o.value ? (R(), P("div", Sa, " ⚠ " + $(o.value), 1)) : Z("", !0),
|
|
5816
5816
|
k(C("textarea", {
|
|
5817
|
-
"onUpdate:modelValue":
|
|
5817
|
+
"onUpdate:modelValue": x[2] || (x[2] = (L) => i.value = L),
|
|
5818
5818
|
class: oe(["ud-json-textarea", { "has-error": o.value }]),
|
|
5819
5819
|
rows: "3",
|
|
5820
|
-
onInput:
|
|
5820
|
+
onInput: p
|
|
5821
5821
|
}, null, 34), [
|
|
5822
|
-
[
|
|
5822
|
+
[N, i.value]
|
|
5823
5823
|
]),
|
|
5824
5824
|
C("div", Ta, [
|
|
5825
5825
|
C("button", {
|
|
5826
5826
|
class: "ud-btn apply-btn",
|
|
5827
5827
|
title: "应用修改",
|
|
5828
|
-
onClick: (L) =>
|
|
5828
|
+
onClick: (L) => m(v.key)
|
|
5829
5829
|
}, " ✓ ", 8, Ma),
|
|
5830
5830
|
C("button", {
|
|
5831
5831
|
class: "ud-btn cancel-btn",
|
|
5832
5832
|
title: "取消编辑",
|
|
5833
|
-
onClick:
|
|
5833
|
+
onClick: g
|
|
5834
5834
|
}, " ✕ ")
|
|
5835
5835
|
])
|
|
5836
5836
|
], 64)),
|
|
@@ -5850,187 +5850,212 @@ const Zr = {
|
|
|
5850
5850
|
])
|
|
5851
5851
|
]));
|
|
5852
5852
|
}
|
|
5853
|
-
}), ka = /* @__PURE__ */ Se(Ea, [["__scopeId", "data-v-4e117415"]]), Pa = { class: "datapanel-tab" }, La = { class: "property-group" }, Na = { class: "dp-section" }, Oa = { class: "dp-visibility-row" }, Da = { class: "dp-toggle" }, Wa = { class: "dp-visibility-text" }, ja = { class: "dp-section" }, Fa = { class: "dp-section" }, Ua = { class: "dp-size-row" }, Ha = { class: "dp-size-value" }, za = { class: "dp-section" }, Ga = { class: "dp-
|
|
5853
|
+
}), ka = /* @__PURE__ */ Se(Ea, [["__scopeId", "data-v-4e117415"]]), Pa = { class: "datapanel-tab" }, La = { class: "property-group" }, Na = { class: "dp-section" }, Oa = { class: "dp-visibility-row" }, Da = { class: "dp-toggle" }, Wa = { class: "dp-visibility-text" }, ja = { class: "dp-section" }, Fa = { class: "dp-section" }, Ua = { class: "dp-size-row" }, Ha = { class: "dp-size-value" }, za = { class: "dp-section" }, Ga = { class: "dp-size-row" }, Ka = { class: "dp-size-value" }, Ba = { class: "dp-section" }, Za = { class: "dp-list" }, Xa = ["onUpdate:modelValue"], qa = ["onUpdate:modelValue"], Va = ["onUpdate:modelValue"], Ja = ["onUpdate:modelValue"], Qa = ["onClick"], Ya = { class: "dp-add-row" }, _a = /* @__PURE__ */ ve({
|
|
5854
5854
|
__name: "DataPanelTab",
|
|
5855
5855
|
props: {
|
|
5856
5856
|
selectedObject: {}
|
|
5857
5857
|
},
|
|
5858
5858
|
setup(r) {
|
|
5859
|
-
const e = r, t =
|
|
5860
|
-
let
|
|
5861
|
-
function
|
|
5859
|
+
const e = r, t = O(""), n = O([]), s = O(!0), i = O(0.1), o = O(220), a = O(""), l = O(""), A = O(""), d = O("");
|
|
5860
|
+
let c = h(), u = !1;
|
|
5861
|
+
function h() {
|
|
5862
5862
|
const g = e.selectedObject;
|
|
5863
5863
|
return g ? Ft(Wt(g)) : null;
|
|
5864
5864
|
}
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
}),
|
|
5868
|
-
|
|
5865
|
+
he(s, (g) => {
|
|
5866
|
+
u || !c || (c.visible = g);
|
|
5867
|
+
}), he(o, (g) => {
|
|
5868
|
+
u || !c || c.setWidth(`${g}px`);
|
|
5869
|
+
}), he(i, (g) => {
|
|
5870
|
+
u || !c || c.setOffsetY(g);
|
|
5869
5871
|
});
|
|
5870
|
-
function
|
|
5871
|
-
|
|
5872
|
+
function f() {
|
|
5873
|
+
u || !c || (c.setTitle(t.value), c.setItems([...n.value]));
|
|
5872
5874
|
}
|
|
5873
|
-
|
|
5874
|
-
function
|
|
5875
|
-
n.value = n.value.filter((
|
|
5875
|
+
he(t, () => f()), he(n, () => f(), { deep: !0 });
|
|
5876
|
+
function p(g) {
|
|
5877
|
+
n.value = n.value.filter((I, y) => y !== g), f();
|
|
5876
5878
|
}
|
|
5877
|
-
function
|
|
5878
|
-
!
|
|
5879
|
+
function m() {
|
|
5880
|
+
!a.value.trim() || !l.value.trim() || (n.value = [
|
|
5879
5881
|
...n.value,
|
|
5880
5882
|
{
|
|
5881
|
-
label:
|
|
5882
|
-
value:
|
|
5883
|
-
unit:
|
|
5884
|
-
code:
|
|
5883
|
+
label: a.value.trim(),
|
|
5884
|
+
value: l.value.trim(),
|
|
5885
|
+
unit: A.value.trim() || void 0,
|
|
5886
|
+
code: d.value.trim() || void 0
|
|
5885
5887
|
}
|
|
5886
|
-
],
|
|
5888
|
+
], f(), a.value = "", l.value = "", A.value = "", d.value = "");
|
|
5887
5889
|
}
|
|
5888
|
-
return
|
|
5890
|
+
return he(
|
|
5889
5891
|
() => e.selectedObject,
|
|
5890
5892
|
() => {
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
+
u = !0, c = h(), c ? (t.value = c.getTitle(), n.value = c.getItems(), s.value = c.visible, i.value = c.getOffsetY(), o.value = parseInt(c.getWidth()) || 220) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 220), a.value = "", l.value = "", A.value = "", d.value = "", setTimeout(() => {
|
|
5894
|
+
u = !1;
|
|
5893
5895
|
}, 0);
|
|
5894
5896
|
},
|
|
5895
5897
|
{ immediate: !0 }
|
|
5896
|
-
), (g,
|
|
5898
|
+
), (g, I) => (R(), P("div", Pa, [
|
|
5897
5899
|
C("div", La, [
|
|
5898
|
-
|
|
5900
|
+
I[18] || (I[18] = C("label", null, "📊 数据面板", -1)),
|
|
5899
5901
|
C("div", Na, [
|
|
5900
|
-
|
|
5902
|
+
I[9] || (I[9] = C("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
5901
5903
|
C("div", Oa, [
|
|
5902
5904
|
C("label", Da, [
|
|
5903
5905
|
k(C("input", {
|
|
5904
5906
|
type: "checkbox",
|
|
5905
|
-
"onUpdate:modelValue":
|
|
5907
|
+
"onUpdate:modelValue": I[0] || (I[0] = (y) => s.value = y)
|
|
5906
5908
|
}, null, 512), [
|
|
5907
5909
|
[vn, s.value]
|
|
5908
5910
|
]),
|
|
5909
|
-
|
|
5911
|
+
I[8] || (I[8] = C("span", { class: "dp-toggle-slider" }, null, -1))
|
|
5910
5912
|
]),
|
|
5911
|
-
C("span", Wa,
|
|
5913
|
+
C("span", Wa, $(s.value ? "显示中" : "已隐藏"), 1)
|
|
5912
5914
|
])
|
|
5913
5915
|
]),
|
|
5914
5916
|
C("div", ja, [
|
|
5915
|
-
|
|
5917
|
+
I[10] || (I[10] = C("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
5916
5918
|
k(C("input", {
|
|
5917
5919
|
type: "text",
|
|
5918
5920
|
class: "dp-input",
|
|
5919
|
-
"onUpdate:modelValue":
|
|
5921
|
+
"onUpdate:modelValue": I[1] || (I[1] = (y) => t.value = y),
|
|
5920
5922
|
placeholder: "面板标题"
|
|
5921
5923
|
}, null, 512), [
|
|
5922
|
-
[
|
|
5924
|
+
[N, t.value]
|
|
5923
5925
|
])
|
|
5924
5926
|
]),
|
|
5925
5927
|
C("div", Fa, [
|
|
5926
|
-
|
|
5928
|
+
I[13] || (I[13] = C("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
5927
5929
|
C("div", Ua, [
|
|
5928
|
-
|
|
5930
|
+
I[11] || (I[11] = C("span", { class: "dp-range-label" }, "窄", -1)),
|
|
5931
|
+
k(C("input", {
|
|
5932
|
+
type: "range",
|
|
5933
|
+
class: "dp-range",
|
|
5934
|
+
min: "120",
|
|
5935
|
+
max: "600",
|
|
5936
|
+
step: "10",
|
|
5937
|
+
"onUpdate:modelValue": I[2] || (I[2] = (y) => o.value = y)
|
|
5938
|
+
}, null, 512), [
|
|
5939
|
+
[
|
|
5940
|
+
N,
|
|
5941
|
+
o.value,
|
|
5942
|
+
void 0,
|
|
5943
|
+
{ number: !0 }
|
|
5944
|
+
]
|
|
5945
|
+
]),
|
|
5946
|
+
I[12] || (I[12] = C("span", { class: "dp-range-label" }, "宽", -1)),
|
|
5947
|
+
C("span", Ha, $(o.value), 1)
|
|
5948
|
+
])
|
|
5949
|
+
]),
|
|
5950
|
+
C("div", za, [
|
|
5951
|
+
I[16] || (I[16] = C("span", { class: "dp-label-sm" }, "面板离模型距离", -1)),
|
|
5952
|
+
C("div", Ga, [
|
|
5953
|
+
I[14] || (I[14] = C("span", { class: "dp-range-label" }, "近", -1)),
|
|
5929
5954
|
k(C("input", {
|
|
5930
5955
|
type: "range",
|
|
5931
5956
|
class: "dp-range",
|
|
5932
5957
|
min: "-0.5",
|
|
5933
5958
|
max: "0.5",
|
|
5934
5959
|
step: "0.01",
|
|
5935
|
-
"onUpdate:modelValue":
|
|
5960
|
+
"onUpdate:modelValue": I[3] || (I[3] = (y) => i.value = y)
|
|
5936
5961
|
}, null, 512), [
|
|
5937
5962
|
[
|
|
5938
|
-
|
|
5963
|
+
N,
|
|
5939
5964
|
i.value,
|
|
5940
5965
|
void 0,
|
|
5941
5966
|
{ number: !0 }
|
|
5942
5967
|
]
|
|
5943
5968
|
]),
|
|
5944
|
-
|
|
5945
|
-
C("span",
|
|
5969
|
+
I[15] || (I[15] = C("span", { class: "dp-range-label" }, "远", -1)),
|
|
5970
|
+
C("span", Ka, $((i.value * 100).toFixed(0)), 1)
|
|
5946
5971
|
])
|
|
5947
5972
|
]),
|
|
5948
|
-
C("div",
|
|
5949
|
-
|
|
5950
|
-
C("div",
|
|
5951
|
-
(R(!0), P(Pe, null, jt(n.value, (
|
|
5973
|
+
C("div", Ba, [
|
|
5974
|
+
I[17] || (I[17] = C("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
5975
|
+
C("div", Za, [
|
|
5976
|
+
(R(!0), P(Pe, null, jt(n.value, (y, x) => (R(), P("div", {
|
|
5952
5977
|
key: x,
|
|
5953
5978
|
class: "dp-item"
|
|
5954
5979
|
}, [
|
|
5955
5980
|
k(C("input", {
|
|
5956
5981
|
type: "text",
|
|
5957
5982
|
class: "dp-input dp-input-sm",
|
|
5958
|
-
"onUpdate:modelValue": (
|
|
5983
|
+
"onUpdate:modelValue": (v) => y.label = v,
|
|
5959
5984
|
placeholder: "标签"
|
|
5960
|
-
}, null, 8,
|
|
5961
|
-
[
|
|
5985
|
+
}, null, 8, Xa), [
|
|
5986
|
+
[N, y.label]
|
|
5962
5987
|
]),
|
|
5963
5988
|
k(C("input", {
|
|
5964
5989
|
type: "text",
|
|
5965
5990
|
class: "dp-input dp-input-sm",
|
|
5966
|
-
"onUpdate:modelValue": (
|
|
5991
|
+
"onUpdate:modelValue": (v) => y.value = v,
|
|
5967
5992
|
placeholder: "值"
|
|
5968
|
-
}, null, 8,
|
|
5969
|
-
[
|
|
5993
|
+
}, null, 8, qa), [
|
|
5994
|
+
[N, y.value]
|
|
5970
5995
|
]),
|
|
5971
5996
|
k(C("input", {
|
|
5972
5997
|
type: "text",
|
|
5973
5998
|
class: "dp-input dp-input-xs",
|
|
5974
|
-
"onUpdate:modelValue": (
|
|
5999
|
+
"onUpdate:modelValue": (v) => y.unit = v,
|
|
5975
6000
|
placeholder: "单位"
|
|
5976
|
-
}, null, 8,
|
|
5977
|
-
[
|
|
6001
|
+
}, null, 8, Va), [
|
|
6002
|
+
[N, y.unit]
|
|
5978
6003
|
]),
|
|
5979
6004
|
k(C("input", {
|
|
5980
6005
|
type: "text",
|
|
5981
6006
|
class: "dp-input dp-input-xs",
|
|
5982
|
-
"onUpdate:modelValue": (
|
|
6007
|
+
"onUpdate:modelValue": (v) => y.code = v,
|
|
5983
6008
|
placeholder: "编码"
|
|
5984
|
-
}, null, 8,
|
|
5985
|
-
[
|
|
6009
|
+
}, null, 8, Ja), [
|
|
6010
|
+
[N, y.code]
|
|
5986
6011
|
]),
|
|
5987
6012
|
C("button", {
|
|
5988
6013
|
class: "dp-btn dp-btn-del",
|
|
5989
|
-
onClick: (
|
|
6014
|
+
onClick: (v) => p(x),
|
|
5990
6015
|
title: "删除此项"
|
|
5991
|
-
}, "✕", 8,
|
|
6016
|
+
}, "✕", 8, Qa)
|
|
5992
6017
|
]))), 128))
|
|
5993
6018
|
]),
|
|
5994
|
-
C("div",
|
|
6019
|
+
C("div", Ya, [
|
|
5995
6020
|
k(C("input", {
|
|
5996
6021
|
type: "text",
|
|
5997
6022
|
class: "dp-input dp-input-sm",
|
|
5998
|
-
"onUpdate:modelValue":
|
|
6023
|
+
"onUpdate:modelValue": I[4] || (I[4] = (y) => a.value = y),
|
|
5999
6024
|
placeholder: "标签",
|
|
6000
|
-
onKeyup: ze(
|
|
6025
|
+
onKeyup: ze(m, ["enter"])
|
|
6001
6026
|
}, null, 544), [
|
|
6002
|
-
[
|
|
6027
|
+
[N, a.value]
|
|
6003
6028
|
]),
|
|
6004
6029
|
k(C("input", {
|
|
6005
6030
|
type: "text",
|
|
6006
6031
|
class: "dp-input dp-input-sm",
|
|
6007
|
-
"onUpdate:modelValue":
|
|
6032
|
+
"onUpdate:modelValue": I[5] || (I[5] = (y) => l.value = y),
|
|
6008
6033
|
placeholder: "值",
|
|
6009
|
-
onKeyup: ze(
|
|
6034
|
+
onKeyup: ze(m, ["enter"])
|
|
6010
6035
|
}, null, 544), [
|
|
6011
|
-
[
|
|
6036
|
+
[N, l.value]
|
|
6012
6037
|
]),
|
|
6013
6038
|
k(C("input", {
|
|
6014
6039
|
type: "text",
|
|
6015
6040
|
class: "dp-input dp-input-xs",
|
|
6016
|
-
"onUpdate:modelValue":
|
|
6041
|
+
"onUpdate:modelValue": I[6] || (I[6] = (y) => A.value = y),
|
|
6017
6042
|
placeholder: "单位",
|
|
6018
|
-
onKeyup: ze(
|
|
6043
|
+
onKeyup: ze(m, ["enter"])
|
|
6019
6044
|
}, null, 544), [
|
|
6020
|
-
[
|
|
6045
|
+
[N, A.value]
|
|
6021
6046
|
]),
|
|
6022
6047
|
k(C("input", {
|
|
6023
6048
|
type: "text",
|
|
6024
6049
|
class: "dp-input dp-input-xs",
|
|
6025
|
-
"onUpdate:modelValue":
|
|
6050
|
+
"onUpdate:modelValue": I[7] || (I[7] = (y) => d.value = y),
|
|
6026
6051
|
placeholder: "编码",
|
|
6027
|
-
onKeyup: ze(
|
|
6052
|
+
onKeyup: ze(m, ["enter"])
|
|
6028
6053
|
}, null, 544), [
|
|
6029
|
-
[
|
|
6054
|
+
[N, d.value]
|
|
6030
6055
|
]),
|
|
6031
6056
|
C("button", {
|
|
6032
6057
|
class: "dp-btn dp-btn-add",
|
|
6033
|
-
onClick:
|
|
6058
|
+
onClick: m,
|
|
6034
6059
|
title: "添加"
|
|
6035
6060
|
}, "+")
|
|
6036
6061
|
])
|
|
@@ -6038,9 +6063,9 @@ const Zr = {
|
|
|
6038
6063
|
])
|
|
6039
6064
|
]));
|
|
6040
6065
|
}
|
|
6041
|
-
}),
|
|
6042
|
-
function
|
|
6043
|
-
const e =
|
|
6066
|
+
}), $a = /* @__PURE__ */ Se(_a, [["__scopeId", "data-v-251404b0"]]);
|
|
6067
|
+
function el(r) {
|
|
6068
|
+
const e = O(/* @__PURE__ */ new Set()), t = (s) => {
|
|
6044
6069
|
const i = new Set(e.value);
|
|
6045
6070
|
i.has(s) ? i.delete(s) : i.add(s), e.value = i;
|
|
6046
6071
|
}, n = (s) => {
|
|
@@ -6051,7 +6076,7 @@ function Ya(r) {
|
|
|
6051
6076
|
i.add(o.uuid), o = o.parent;
|
|
6052
6077
|
e.value = i;
|
|
6053
6078
|
};
|
|
6054
|
-
return
|
|
6079
|
+
return he(
|
|
6055
6080
|
r,
|
|
6056
6081
|
(s) => {
|
|
6057
6082
|
s && n(s);
|
|
@@ -6059,22 +6084,22 @@ function Ya(r) {
|
|
|
6059
6084
|
{ immediate: !0 }
|
|
6060
6085
|
), { expandedSet: e, toggleExpand: t };
|
|
6061
6086
|
}
|
|
6062
|
-
const
|
|
6087
|
+
const tl = {
|
|
6063
6088
|
key: 0,
|
|
6064
6089
|
class: "property-panel"
|
|
6065
|
-
},
|
|
6090
|
+
}, sl = { class: "property-group tree-group" }, nl = { class: "tree-container" }, il = {
|
|
6066
6091
|
key: 0,
|
|
6067
6092
|
class: "tree-empty"
|
|
6068
|
-
},
|
|
6093
|
+
}, ol = { class: "property-group" }, rl = { class: "transform-mode-row" }, al = {
|
|
6069
6094
|
key: 0,
|
|
6070
6095
|
class: "tabs"
|
|
6071
|
-
},
|
|
6096
|
+
}, ll = {
|
|
6072
6097
|
key: 1,
|
|
6073
6098
|
class: "tab-content"
|
|
6074
|
-
},
|
|
6099
|
+
}, Al = {
|
|
6075
6100
|
key: 1,
|
|
6076
6101
|
class: "property-panel empty"
|
|
6077
|
-
},
|
|
6102
|
+
}, cl = /* @__PURE__ */ ve({
|
|
6078
6103
|
__name: "index",
|
|
6079
6104
|
props: {
|
|
6080
6105
|
transform: {},
|
|
@@ -6083,135 +6108,135 @@ const _a = {
|
|
|
6083
6108
|
},
|
|
6084
6109
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
6085
6110
|
setup(r, { emit: e }) {
|
|
6086
|
-
const t = r, n = e, s =
|
|
6087
|
-
function i(
|
|
6088
|
-
s.value =
|
|
6111
|
+
const t = r, n = e, s = O("translate");
|
|
6112
|
+
function i(f) {
|
|
6113
|
+
s.value = f, n("transformModeChange", f);
|
|
6089
6114
|
}
|
|
6090
|
-
const o = () => n("propertyChange"), a =
|
|
6091
|
-
var
|
|
6092
|
-
return !!(t.selectedObject && ((
|
|
6093
|
-
}), A =
|
|
6115
|
+
const o = () => n("propertyChange"), a = O("transform"), l = $e(() => {
|
|
6116
|
+
var f;
|
|
6117
|
+
return !!(t.selectedObject && ((f = t.selectedObject.userData) != null && f._hasDataPanel));
|
|
6118
|
+
}), A = O(0), d = Sn(t, "selectedObject"), { expandedSet: c, toggleExpand: u } = el(d);
|
|
6094
6119
|
Tn("treeExpand", { expandedSet: c, toggleExpand: u });
|
|
6095
|
-
const h = (
|
|
6096
|
-
A.value++, n("treeDelete",
|
|
6120
|
+
const h = (f) => {
|
|
6121
|
+
A.value++, n("treeDelete", f);
|
|
6097
6122
|
};
|
|
6098
|
-
return (
|
|
6099
|
-
C("div",
|
|
6100
|
-
|
|
6101
|
-
C("div",
|
|
6102
|
-
(R(!0), P(Pe, null, jt(
|
|
6103
|
-
key:
|
|
6104
|
-
node:
|
|
6105
|
-
"selected-object":
|
|
6123
|
+
return (f, p) => f.transform ? (R(), P("div", tl, [
|
|
6124
|
+
C("div", sl, [
|
|
6125
|
+
p[7] || (p[7] = C("label", null, "场景物体", -1)),
|
|
6126
|
+
C("div", nl, [
|
|
6127
|
+
(R(!0), P(Pe, null, jt(f.treeData, (m) => (R(), nt(Qr, {
|
|
6128
|
+
key: m.uuid,
|
|
6129
|
+
node: m,
|
|
6130
|
+
"selected-object": f.selectedObject,
|
|
6106
6131
|
version: A.value,
|
|
6107
|
-
onSelect:
|
|
6132
|
+
onSelect: p[0] || (p[0] = (g) => n("treeSelect", g)),
|
|
6108
6133
|
onDelete: h
|
|
6109
6134
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
6110
|
-
|
|
6135
|
+
f.treeData.length === 0 ? (R(), P("div", il, "暂无物体")) : Z("", !0)
|
|
6111
6136
|
])
|
|
6112
6137
|
]),
|
|
6113
|
-
C("div",
|
|
6114
|
-
|
|
6115
|
-
C("div",
|
|
6138
|
+
C("div", ol, [
|
|
6139
|
+
p[8] || (p[8] = C("label", null, "全局属性", -1)),
|
|
6140
|
+
C("div", rl, [
|
|
6116
6141
|
C("button", {
|
|
6117
6142
|
class: oe(["mode-btn", { active: s.value === "translate" }]),
|
|
6118
6143
|
title: "移动 (W)",
|
|
6119
|
-
onClick:
|
|
6144
|
+
onClick: p[1] || (p[1] = (m) => i("translate"))
|
|
6120
6145
|
}, " ↕ 移动 ", 2),
|
|
6121
6146
|
C("button", {
|
|
6122
6147
|
class: oe(["mode-btn", { active: s.value === "rotate" }]),
|
|
6123
6148
|
title: "旋转 (E)",
|
|
6124
|
-
onClick:
|
|
6149
|
+
onClick: p[2] || (p[2] = (m) => i("rotate"))
|
|
6125
6150
|
}, " ↻ 旋转 ", 2),
|
|
6126
6151
|
C("button", {
|
|
6127
6152
|
class: oe(["mode-btn", { active: s.value === "scale" }]),
|
|
6128
6153
|
title: "缩放 (R)",
|
|
6129
|
-
onClick:
|
|
6154
|
+
onClick: p[3] || (p[3] = (m) => i("scale"))
|
|
6130
6155
|
}, " ⤡ 缩放 ", 2)
|
|
6131
6156
|
])
|
|
6132
6157
|
]),
|
|
6133
|
-
|
|
6158
|
+
f.selectedObject ? (R(), P("div", al, [
|
|
6134
6159
|
C("button", {
|
|
6135
6160
|
class: oe(["tab-btn", { active: a.value === "transform" }]),
|
|
6136
|
-
onClick:
|
|
6161
|
+
onClick: p[4] || (p[4] = (m) => a.value = "transform")
|
|
6137
6162
|
}, " 🔄 变换 ", 2),
|
|
6138
6163
|
C("button", {
|
|
6139
6164
|
class: oe(["tab-btn", { active: a.value === "userdata" }]),
|
|
6140
|
-
onClick:
|
|
6165
|
+
onClick: p[5] || (p[5] = (m) => a.value = "userdata")
|
|
6141
6166
|
}, " 📋 自定义数据 ", 2),
|
|
6142
6167
|
l.value ? (R(), P("button", {
|
|
6143
6168
|
key: 0,
|
|
6144
6169
|
class: oe(["tab-btn", { active: a.value === "datapanel" }]),
|
|
6145
|
-
onClick:
|
|
6170
|
+
onClick: p[6] || (p[6] = (m) => a.value = "datapanel")
|
|
6146
6171
|
}, " 📊 数据面板 ", 2)) : Z("", !0)
|
|
6147
6172
|
])) : Z("", !0),
|
|
6148
|
-
|
|
6173
|
+
f.selectedObject ? (R(), P("div", ll, [
|
|
6149
6174
|
k(zt(fa, {
|
|
6150
|
-
transform:
|
|
6151
|
-
"selected-object":
|
|
6175
|
+
transform: f.transform,
|
|
6176
|
+
"selected-object": f.selectedObject,
|
|
6152
6177
|
onPropertyChange: o
|
|
6153
6178
|
}, null, 8, ["transform", "selected-object"]), [
|
|
6154
6179
|
[Le, a.value === "transform"]
|
|
6155
6180
|
]),
|
|
6156
|
-
k(zt(ka, { "selected-object":
|
|
6181
|
+
k(zt(ka, { "selected-object": f.selectedObject }, null, 8, ["selected-object"]), [
|
|
6157
6182
|
[Le, a.value === "userdata"]
|
|
6158
6183
|
]),
|
|
6159
|
-
k(zt(
|
|
6184
|
+
k(zt($a, { "selected-object": f.selectedObject }, null, 8, ["selected-object"]), [
|
|
6160
6185
|
[Le, a.value === "datapanel"]
|
|
6161
6186
|
])
|
|
6162
6187
|
])) : Z("", !0)
|
|
6163
|
-
])) : (R(), P("div",
|
|
6188
|
+
])) : (R(), P("div", Al, p[9] || (p[9] = [
|
|
6164
6189
|
C("p", null, "未选中任何模型", -1)
|
|
6165
6190
|
])));
|
|
6166
6191
|
}
|
|
6167
|
-
}),
|
|
6192
|
+
}), ul = /* @__PURE__ */ Se(cl, [["__scopeId", "data-v-c92c9fa7"]]), dl = { class: "top-bar" }, hl = { class: "left-section" }, fl = { class: "dropdown-menu" }, pl = { class: "dropdown-menu sub-menu" }, ml = { class: "dropdown-menu sub-menu" }, gl = { class: "dropdown-menu" }, bl = /* @__PURE__ */ ve({
|
|
6168
6193
|
__name: "TopBar",
|
|
6169
6194
|
emits: ["addModel", "importModel"],
|
|
6170
6195
|
setup(r, { emit: e }) {
|
|
6171
|
-
const t =
|
|
6172
|
-
var
|
|
6173
|
-
return (
|
|
6174
|
-
}, A = (
|
|
6175
|
-
const
|
|
6176
|
-
|
|
6196
|
+
const t = O(!1), n = O(!1), s = O(!1), i = O(!1), o = e, a = O(null), l = () => {
|
|
6197
|
+
var p;
|
|
6198
|
+
return (p = a.value) == null ? void 0 : p.click();
|
|
6199
|
+
}, A = (p) => {
|
|
6200
|
+
const m = p.target;
|
|
6201
|
+
m.files && m.files.length > 0 && (o("importModel", m.files[0]), m.value = "");
|
|
6177
6202
|
}, d = () => console.log("撤销"), c = () => console.log("删除物体"), u = async () => {
|
|
6178
|
-
const
|
|
6179
|
-
console.log(JSON.parse(await
|
|
6203
|
+
const p = Zo();
|
|
6204
|
+
console.log(JSON.parse(await p));
|
|
6180
6205
|
}, h = () => {
|
|
6181
6206
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
6182
6207
|
cn(localStorage.getItem("test_id"));
|
|
6183
|
-
},
|
|
6184
|
-
return (
|
|
6185
|
-
C("div",
|
|
6208
|
+
}, f = () => an();
|
|
6209
|
+
return (p, m) => (R(), P("div", dl, [
|
|
6210
|
+
C("div", hl, [
|
|
6186
6211
|
C("div", {
|
|
6187
6212
|
class: "dropdown-wrapper",
|
|
6188
|
-
onMouseenter:
|
|
6189
|
-
onMouseleave:
|
|
6213
|
+
onMouseenter: m[9] || (m[9] = (g) => n.value = !0),
|
|
6214
|
+
onMouseleave: m[10] || (m[10] = (g) => n.value = !1)
|
|
6190
6215
|
}, [
|
|
6191
|
-
|
|
6192
|
-
k(C("div",
|
|
6216
|
+
m[15] || (m[15] = C("button", { class: "menu-btn" }, "添加", -1)),
|
|
6217
|
+
k(C("div", fl, [
|
|
6193
6218
|
C("div", {
|
|
6194
6219
|
class: "menu-item",
|
|
6195
6220
|
onClick: d
|
|
6196
6221
|
}, "组"),
|
|
6197
6222
|
C("div", {
|
|
6198
6223
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
6199
|
-
onMouseenter:
|
|
6200
|
-
onMouseleave:
|
|
6224
|
+
onMouseenter: m[3] || (m[3] = (g) => s.value = !0),
|
|
6225
|
+
onMouseleave: m[4] || (m[4] = (g) => s.value = !1)
|
|
6201
6226
|
}, [
|
|
6202
|
-
|
|
6203
|
-
k(C("div",
|
|
6227
|
+
m[13] || (m[13] = C("span", null, "网格", -1)),
|
|
6228
|
+
k(C("div", pl, [
|
|
6204
6229
|
C("div", {
|
|
6205
6230
|
class: "menu-item",
|
|
6206
|
-
onClick:
|
|
6231
|
+
onClick: m[0] || (m[0] = (g) => o("addModel", "box"))
|
|
6207
6232
|
}, " 正方体 "),
|
|
6208
6233
|
C("div", {
|
|
6209
6234
|
class: "menu-item",
|
|
6210
|
-
onClick:
|
|
6235
|
+
onClick: m[1] || (m[1] = (g) => o("addModel", "sphere"))
|
|
6211
6236
|
}, " 球体 "),
|
|
6212
6237
|
C("div", {
|
|
6213
6238
|
class: "menu-item",
|
|
6214
|
-
onClick:
|
|
6239
|
+
onClick: m[2] || (m[2] = (g) => o("addModel", "waterPlane"))
|
|
6215
6240
|
}, " 水面 "),
|
|
6216
6241
|
C("div", {
|
|
6217
6242
|
class: "menu-item",
|
|
@@ -6223,14 +6248,14 @@ const _a = {
|
|
|
6223
6248
|
], 32),
|
|
6224
6249
|
C("div", {
|
|
6225
6250
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
6226
|
-
onMouseenter:
|
|
6227
|
-
onMouseleave:
|
|
6251
|
+
onMouseenter: m[6] || (m[6] = (g) => i.value = !0),
|
|
6252
|
+
onMouseleave: m[7] || (m[7] = (g) => i.value = !1)
|
|
6228
6253
|
}, [
|
|
6229
|
-
|
|
6230
|
-
k(C("div",
|
|
6254
|
+
m[14] || (m[14] = C("span", null, "光源", -1)),
|
|
6255
|
+
k(C("div", ml, [
|
|
6231
6256
|
C("div", {
|
|
6232
6257
|
class: "menu-item",
|
|
6233
|
-
onClick:
|
|
6258
|
+
onClick: m[5] || (m[5] = (g) => o("addModel", "directionalLight"))
|
|
6234
6259
|
}, " 平行光 ")
|
|
6235
6260
|
], 512), [
|
|
6236
6261
|
[Le, i.value]
|
|
@@ -6242,7 +6267,7 @@ const _a = {
|
|
|
6242
6267
|
}, "摄像机"),
|
|
6243
6268
|
C("div", {
|
|
6244
6269
|
class: "menu-item",
|
|
6245
|
-
onClick:
|
|
6270
|
+
onClick: m[8] || (m[8] = (g) => o("addModel", "dataPanel"))
|
|
6246
6271
|
}, " 数据面板 ")
|
|
6247
6272
|
], 512), [
|
|
6248
6273
|
[Le, n.value]
|
|
@@ -6250,11 +6275,11 @@ const _a = {
|
|
|
6250
6275
|
], 32),
|
|
6251
6276
|
C("div", {
|
|
6252
6277
|
class: "dropdown-wrapper",
|
|
6253
|
-
onMouseenter:
|
|
6254
|
-
onMouseleave:
|
|
6278
|
+
onMouseenter: m[11] || (m[11] = (g) => t.value = !0),
|
|
6279
|
+
onMouseleave: m[12] || (m[12] = (g) => t.value = !1)
|
|
6255
6280
|
}, [
|
|
6256
|
-
|
|
6257
|
-
k(C("div",
|
|
6281
|
+
m[16] || (m[16] = C("button", { class: "menu-btn" }, "帮助", -1)),
|
|
6282
|
+
k(C("div", gl, [
|
|
6258
6283
|
C("div", {
|
|
6259
6284
|
class: "menu-item",
|
|
6260
6285
|
onClick: u
|
|
@@ -6265,14 +6290,14 @@ const _a = {
|
|
|
6265
6290
|
}, "镜头拉近"),
|
|
6266
6291
|
C("div", {
|
|
6267
6292
|
class: "menu-item",
|
|
6268
|
-
onClick:
|
|
6293
|
+
onClick: f
|
|
6269
6294
|
}, " 重置相机位置 ")
|
|
6270
6295
|
], 512), [
|
|
6271
6296
|
[Le, t.value]
|
|
6272
6297
|
])
|
|
6273
6298
|
], 32)
|
|
6274
6299
|
]),
|
|
6275
|
-
|
|
6300
|
+
m[17] || (m[17] = C("div", { class: "right-section" }, [
|
|
6276
6301
|
C("span", { class: "app-title" }, "3D 模型编辑器")
|
|
6277
6302
|
], -1)),
|
|
6278
6303
|
C("input", {
|
|
@@ -6285,10 +6310,10 @@ const _a = {
|
|
|
6285
6310
|
}, null, 544)
|
|
6286
6311
|
]));
|
|
6287
6312
|
}
|
|
6288
|
-
}),
|
|
6313
|
+
}), Cl = /* @__PURE__ */ Se(bl, [["__scopeId", "data-v-45df3361"]]), Il = { class: "bottom-bar" }, yl = /* @__PURE__ */ ve({
|
|
6289
6314
|
__name: "BottomBar",
|
|
6290
6315
|
setup(r) {
|
|
6291
|
-
return (e, t) => (R(), P("div",
|
|
6316
|
+
return (e, t) => (R(), P("div", Il, t[0] || (t[0] = [
|
|
6292
6317
|
C("div", { class: "status-left" }, [
|
|
6293
6318
|
C("span", null, "就绪")
|
|
6294
6319
|
], -1),
|
|
@@ -6297,88 +6322,88 @@ const _a = {
|
|
|
6297
6322
|
], -1)
|
|
6298
6323
|
])));
|
|
6299
6324
|
}
|
|
6300
|
-
}),
|
|
6325
|
+
}), xl = /* @__PURE__ */ Se(yl, [["__scopeId", "data-v-3427bb27"]]), vl = { class: "app-layout" }, Sl = {
|
|
6301
6326
|
key: 0,
|
|
6302
6327
|
class: "loading-overlay"
|
|
6303
|
-
},
|
|
6328
|
+
}, Tl = /* @__PURE__ */ ve({
|
|
6304
6329
|
__name: "DrawingBoard",
|
|
6305
6330
|
props: {
|
|
6306
6331
|
mode: { default: "edit" },
|
|
6307
6332
|
sceneData: { default: null }
|
|
6308
6333
|
},
|
|
6309
6334
|
setup(r) {
|
|
6310
|
-
const e = r, t =
|
|
6311
|
-
To((
|
|
6312
|
-
t.value =
|
|
6335
|
+
const e = r, t = O(!1);
|
|
6336
|
+
To((g) => {
|
|
6337
|
+
t.value = g;
|
|
6313
6338
|
});
|
|
6314
6339
|
const n = ms(null), s = _t({
|
|
6315
6340
|
position: { x: 0, y: 0, z: 0 },
|
|
6316
6341
|
rotation: { x: 0, y: 0, z: 0 },
|
|
6317
6342
|
scale: { x: 1, y: 1, z: 1 }
|
|
6318
|
-
}), i = (
|
|
6319
|
-
s.position.x = Number(
|
|
6320
|
-
}, o = (
|
|
6321
|
-
|
|
6343
|
+
}), i = (g) => {
|
|
6344
|
+
s.position.x = Number(g.position.x.toFixed(3)), s.position.y = Number(g.position.y.toFixed(3)), s.position.z = Number(g.position.z.toFixed(3)), s.rotation.x = Number(g.rotation.x.toFixed(3)), s.rotation.y = Number(g.rotation.y.toFixed(3)), s.rotation.z = Number(g.rotation.z.toFixed(3)), s.scale.x = Number(g.scale.x.toFixed(3)), s.scale.y = Number(g.scale.y.toFixed(3)), s.scale.z = Number(g.scale.z.toFixed(3));
|
|
6345
|
+
}, o = (g) => {
|
|
6346
|
+
g.position.set(
|
|
6322
6347
|
s.position.x,
|
|
6323
6348
|
s.position.y,
|
|
6324
6349
|
s.position.z
|
|
6325
|
-
),
|
|
6350
|
+
), g.rotation.set(
|
|
6326
6351
|
s.rotation.x,
|
|
6327
6352
|
s.rotation.y,
|
|
6328
6353
|
s.rotation.z
|
|
6329
|
-
),
|
|
6354
|
+
), g.scale.set(s.scale.x, s.scale.y, s.scale.z);
|
|
6330
6355
|
};
|
|
6331
|
-
Uo((
|
|
6332
|
-
n.value =
|
|
6333
|
-
}), Ho((
|
|
6334
|
-
i(
|
|
6356
|
+
Uo((g) => {
|
|
6357
|
+
n.value = g, g && i(g);
|
|
6358
|
+
}), Ho((g) => {
|
|
6359
|
+
i(g);
|
|
6335
6360
|
});
|
|
6336
6361
|
const a = () => {
|
|
6337
6362
|
if (n.value && (o(n.value), n.value.type === "DirectionalLight")) {
|
|
6338
|
-
const
|
|
6339
|
-
|
|
6363
|
+
const g = n.value.userData.helper;
|
|
6364
|
+
g && typeof g.update == "function" && g.update();
|
|
6340
6365
|
}
|
|
6341
|
-
}, l = (
|
|
6366
|
+
}, l = (g) => Br(g), A = async (g) => {
|
|
6342
6367
|
try {
|
|
6343
|
-
await Kr(
|
|
6368
|
+
await Kr(g);
|
|
6344
6369
|
} catch (I) {
|
|
6345
6370
|
console.error("导入失败:", I), alert("导入失败:" + I.message);
|
|
6346
6371
|
}
|
|
6347
6372
|
}, d = ms([]);
|
|
6348
|
-
zo((
|
|
6349
|
-
d.value =
|
|
6373
|
+
zo((g) => {
|
|
6374
|
+
d.value = g;
|
|
6350
6375
|
});
|
|
6351
6376
|
const c = () => {
|
|
6352
|
-
const
|
|
6353
|
-
|
|
6354
|
-
}, u = (
|
|
6355
|
-
Mo(
|
|
6356
|
-
},
|
|
6357
|
-
|
|
6377
|
+
const g = Go();
|
|
6378
|
+
g && (d.value = g);
|
|
6379
|
+
}, u = (g) => ds(g), h = (g) => Do(g.uuid), f = (g) => {
|
|
6380
|
+
Mo(g);
|
|
6381
|
+
}, p = O(null), m = () => {
|
|
6382
|
+
p.value && fo(p.value, e.mode, e.sceneData), c();
|
|
6358
6383
|
};
|
|
6359
6384
|
return Mn(() => {
|
|
6360
|
-
|
|
6385
|
+
m(), p.value && lo(p.value);
|
|
6361
6386
|
}), wn(() => {
|
|
6362
6387
|
console.log("endset_three_editor destroy"), qo();
|
|
6363
|
-
}), (
|
|
6364
|
-
t.value ? (R(), P("div",
|
|
6388
|
+
}), (g, I) => (R(), P("div", vl, [
|
|
6389
|
+
t.value ? (R(), P("div", Sl, I[0] || (I[0] = [
|
|
6365
6390
|
C("div", { class: "loading-spinner" }, null, -1),
|
|
6366
6391
|
C("div", { class: "loading-text" }, "加载中...", -1)
|
|
6367
6392
|
]))) : Z("", !0),
|
|
6368
|
-
|
|
6393
|
+
g.mode === "edit" ? (R(), nt(Cl, {
|
|
6369
6394
|
key: 1,
|
|
6370
6395
|
onAddModel: l,
|
|
6371
6396
|
onImportModel: A
|
|
6372
6397
|
})) : Z("", !0),
|
|
6373
6398
|
C("div", {
|
|
6374
|
-
class: oe(`editor-container editor-container-mode-${
|
|
6399
|
+
class: oe(`editor-container editor-container-mode-${g.mode}`)
|
|
6375
6400
|
}, [
|
|
6376
6401
|
C("div", {
|
|
6377
|
-
class: oe(`canvas canvas-mode-${
|
|
6402
|
+
class: oe(`canvas canvas-mode-${g.mode}`),
|
|
6378
6403
|
ref_key: "containerRef",
|
|
6379
|
-
ref:
|
|
6404
|
+
ref: p
|
|
6380
6405
|
}, null, 2),
|
|
6381
|
-
|
|
6406
|
+
g.mode === "edit" ? (R(), nt(ul, {
|
|
6382
6407
|
key: 0,
|
|
6383
6408
|
transform: s,
|
|
6384
6409
|
"tree-data": d.value,
|
|
@@ -6386,19 +6411,19 @@ const _a = {
|
|
|
6386
6411
|
onPropertyChange: a,
|
|
6387
6412
|
onTreeSelect: u,
|
|
6388
6413
|
onTreeDelete: h,
|
|
6389
|
-
onTransformModeChange:
|
|
6414
|
+
onTransformModeChange: f
|
|
6390
6415
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : Z("", !0)
|
|
6391
6416
|
], 2),
|
|
6392
|
-
|
|
6417
|
+
g.mode === "edit" ? (R(), nt(xl, { key: 2 })) : Z("", !0)
|
|
6393
6418
|
]));
|
|
6394
6419
|
}
|
|
6395
|
-
}),
|
|
6420
|
+
}), Ol = /* @__PURE__ */ Se(Tl, [["__scopeId", "data-v-b3d90c56"]]);
|
|
6396
6421
|
export {
|
|
6397
|
-
|
|
6422
|
+
xl as BottomBar,
|
|
6398
6423
|
dt as DataPanel,
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6424
|
+
Ol as DrawingBoard,
|
|
6425
|
+
ul as PropertyPanel,
|
|
6426
|
+
Cl as TopBar,
|
|
6402
6427
|
Qr as TreeItem,
|
|
6403
6428
|
Fr as addBox,
|
|
6404
6429
|
Gr as addDataPanel,
|
|
@@ -6412,11 +6437,11 @@ export {
|
|
|
6412
6437
|
uo as disposeCSS2DRenderer,
|
|
6413
6438
|
Zo as exportSceneToJSON,
|
|
6414
6439
|
Eo as focusOnObject,
|
|
6415
|
-
|
|
6440
|
+
kl as getCSS2DRenderer,
|
|
6416
6441
|
Bo as getCamera,
|
|
6417
6442
|
Ft as getDataPanel,
|
|
6418
|
-
|
|
6419
|
-
|
|
6443
|
+
Nl as getRenderer,
|
|
6444
|
+
Ll as getScene,
|
|
6420
6445
|
Go as getSceneObjects,
|
|
6421
6446
|
Ko as getSelectedObject,
|
|
6422
6447
|
Kr as importModelFromFile,
|
|
@@ -6437,7 +6462,7 @@ export {
|
|
|
6437
6462
|
Uo as setSelectedObjectCallback,
|
|
6438
6463
|
Ho as setTransformChangeCallback,
|
|
6439
6464
|
Mo as setTransformMode,
|
|
6440
|
-
|
|
6441
|
-
|
|
6465
|
+
Pl as updateDataPanelValue,
|
|
6466
|
+
el as useTreeExpand
|
|
6442
6467
|
};
|
|
6443
6468
|
//# sourceMappingURL=three-editor.es.js.map
|