endset_three_editor 0.4.3 → 0.4.5
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/endset_three_editor.css +1 -1
- package/dist/three/addHandle.d.ts +0 -1
- package/dist/three/css2dPanel.d.ts +8 -0
- package/dist/three/index.d.ts +2 -0
- package/dist/three-editor.cjs.js +4 -4
- package/dist/three-editor.cjs.js.map +1 -1
- package/dist/three-editor.es.js +940 -873
- package/dist/three-editor.es.js.map +1 -1
- package/package.json +1 -1
package/dist/three-editor.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var _n = Object.defineProperty;
|
|
2
2
|
var $n = (r, e, t) => e in r ? _n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Re = (r, e, t) => $n(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { toRaw as xt, defineComponent as
|
|
4
|
+
import { toRaw as xt, defineComponent as Ie, ref as L, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as ie, withModifiers as jt, unref as ss, toDisplayString as _, Fragment as Me, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as de, withDirectives as E, vModelText as H, withKeys as He, vModelCheckbox as is, toRef as os, provide as rs, createVNode as Dt, vShow as De, shallowRef as $t, onMounted as as, onBeforeUnmount as ls } from "vue";
|
|
5
5
|
import * as P from "three";
|
|
6
|
-
import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as
|
|
6
|
+
import { Controls as On, Vector3 as M, MOUSE as Ne, TOUCH as Le, Quaternion as K, Spherical as en, Vector2 as Y, Ray as cs, Plane as us, MathUtils as En, Raycaster as ds, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as me, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as As, Euler as hs, Matrix4 as ge, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as he, SRGBColorSpace as Ae, Group as ft, Material as Qe, PointsMaterial as Ue, MeshPhongMaterial as ps, LineSegments as Wt, Points as pt, TrianglesDrawMode as ms, TriangleFanDrawMode as zt, TriangleStripDrawMode as Sn, LoaderUtils as Je, MeshPhysicalMaterial as le, LinearSRGBColorSpace as ae, SpotLight as gs, PointLight as bs, DirectionalLight as Is, InstancedMesh as ys, InstancedBufferAttribute as Cs, TextureLoader as xs, ImageBitmapLoader as ws, BufferAttribute as _e, InterleavedBuffer as Hn, InterleavedBufferAttribute as Ln, LinearMipmapLinearFilter as Nn, NearestMipmapLinearFilter as vs, LinearMipmapNearestFilter as Ms, NearestMipmapNearestFilter as Ds, LinearFilter as Gt, NearestFilter as jn, RepeatWrapping as Ft, MirroredRepeatWrapping as Ps, ClampToEdgeWrapping as Ts, MeshStandardMaterial as kn, PropertyBinding as Os, SkinnedMesh as Es, LineLoop as Rs, PerspectiveCamera as Ss, OrthographicCamera as Hs, Skeleton as Ls, AnimationClip as Ns, Bone as js, InterpolateDiscrete as ks, InterpolateLinear as Wn, Texture as tn, VectorKeyframeTrack as nn, NumberKeyframeTrack as sn, QuaternionKeyframeTrack as on, ColorManagement as qt, FrontSide as Ws, Interpolant as zs, Box3 as Gs, Sphere as Fs } from "three";
|
|
7
7
|
import nt from "@tweenjs/tween.js";
|
|
8
|
-
const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI,
|
|
8
|
+
const rn = { type: "change" }, Kt = { type: "start" }, zn = { type: "end" }, ct = new cs(), an = new us(), qs = Math.cos(70 * En.DEG2RAD), G = new M(), V = 2 * Math.PI, N = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -23,7 +23,7 @@ class Xs extends On {
|
|
|
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 = N.NONE, this.target = new M(), this.cursor = new M(), 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: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.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 M(), this._lastQuaternion = new K(), this._lastTargetPosition = new M(), this._quat = new K().setFromUnitVectors(e.up, new M(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new en(), this._sphericalDelta = new en(), this._scale = 1, this._panOffset = new M(), this._rotateStart = new Y(), this._rotateEnd = new Y(), this._rotateDelta = new Y(), this._panStart = new Y(), this._panEnd = new Y(), this._panDelta = new Y(), this._dollyStart = new Y(), this._dollyEnd = new Y(), this._dollyDelta = new Y(), this._dollyDirection = new M(), this._mouse = new Y(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Us.bind(this), this._onPointerDown = Bs.bind(this), this._onPointerUp = Vs.bind(this), this._onContextMenu = $s.bind(this), this._onMouseWheel = Zs.bind(this), this._onKeyDown = Qs.bind(this), this._onTouchStart = Js.bind(this), this._onTouchMove = _s.bind(this), this._onMouseDown = Ys.bind(this), this._onMouseMove = Ks.bind(this), this._interceptControlDown = ei.bind(this), this._interceptControlUp = ti.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 Xs extends On {
|
|
|
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(rn), 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(rn), this.update(), this.state = N.NONE;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Programmatically pan the camera.
|
|
@@ -141,7 +141,7 @@ class Xs extends On {
|
|
|
141
141
|
}
|
|
142
142
|
update(e = null) {
|
|
143
143
|
const t = this.object.position;
|
|
144
|
-
G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state ===
|
|
144
|
+
G.copy(t).sub(this.target), G.applyQuaternion(this._quat), this._spherical.setFromVector3(G), this.autoRotate && this.state === N.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 s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
|
|
146
146
|
isFinite(s) && isFinite(n) && (s < -Math.PI ? s += V : s > Math.PI && (s -= V), n < -Math.PI ? n += V : n > Math.PI && (n -= V), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, 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 Us(r) {
|
|
|
373
373
|
function Vs(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(zn), this.state =
|
|
376
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.ownerDocument.removeEventListener("pointermove", this._onPointerMove), this.domElement.ownerDocument.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(zn), this.state = N.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 Ys(r) {
|
|
|
399
399
|
switch (e) {
|
|
400
400
|
case Ne.DOLLY:
|
|
401
401
|
if (this.enableZoom === !1) return;
|
|
402
|
-
this._handleMouseDownDolly(r), this.state =
|
|
402
|
+
this._handleMouseDownDolly(r), this.state = N.DOLLY;
|
|
403
403
|
break;
|
|
404
404
|
case Ne.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 = N.PAN;
|
|
408
408
|
} else {
|
|
409
409
|
if (this.enableRotate === !1) return;
|
|
410
|
-
this._handleMouseDownRotate(r), this.state =
|
|
410
|
+
this._handleMouseDownRotate(r), this.state = N.ROTATE;
|
|
411
411
|
}
|
|
412
412
|
break;
|
|
413
413
|
case Ne.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 = N.ROTATE;
|
|
417
417
|
} else {
|
|
418
418
|
if (this.enablePan === !1) return;
|
|
419
|
-
this._handleMouseDownPan(r), this.state =
|
|
419
|
+
this._handleMouseDownPan(r), this.state = N.PAN;
|
|
420
420
|
}
|
|
421
421
|
break;
|
|
422
422
|
default:
|
|
423
|
-
this.state =
|
|
423
|
+
this.state = N.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !==
|
|
425
|
+
this.state !== N.NONE && this.dispatchEvent(Kt);
|
|
426
426
|
}
|
|
427
427
|
function Ks(r) {
|
|
428
428
|
switch (this.state) {
|
|
429
|
-
case
|
|
429
|
+
case N.ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
431
431
|
this._handleMouseMoveRotate(r);
|
|
432
432
|
break;
|
|
433
|
-
case
|
|
433
|
+
case N.DOLLY:
|
|
434
434
|
if (this.enableZoom === !1) return;
|
|
435
435
|
this._handleMouseMoveDolly(r);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case N.PAN:
|
|
438
438
|
if (this.enablePan === !1) return;
|
|
439
439
|
this._handleMouseMovePan(r);
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
function Zs(r) {
|
|
444
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
444
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== N.NONE || (r.preventDefault(), this.dispatchEvent(Kt), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(zn));
|
|
445
445
|
}
|
|
446
446
|
function Qs(r) {
|
|
447
447
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -452,55 +452,55 @@ function Js(r) {
|
|
|
452
452
|
switch (this.touches.ONE) {
|
|
453
453
|
case Le.ROTATE:
|
|
454
454
|
if (this.enableRotate === !1) return;
|
|
455
|
-
this._handleTouchStartRotate(r), this.state =
|
|
455
|
+
this._handleTouchStartRotate(r), this.state = N.TOUCH_ROTATE;
|
|
456
456
|
break;
|
|
457
457
|
case Le.PAN:
|
|
458
458
|
if (this.enablePan === !1) return;
|
|
459
|
-
this._handleTouchStartPan(r), this.state =
|
|
459
|
+
this._handleTouchStartPan(r), this.state = N.TOUCH_PAN;
|
|
460
460
|
break;
|
|
461
461
|
default:
|
|
462
|
-
this.state =
|
|
462
|
+
this.state = N.NONE;
|
|
463
463
|
}
|
|
464
464
|
break;
|
|
465
465
|
case 2:
|
|
466
466
|
switch (this.touches.TWO) {
|
|
467
467
|
case Le.DOLLY_PAN:
|
|
468
468
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
469
|
-
this._handleTouchStartDollyPan(r), this.state =
|
|
469
|
+
this._handleTouchStartDollyPan(r), this.state = N.TOUCH_DOLLY_PAN;
|
|
470
470
|
break;
|
|
471
471
|
case Le.DOLLY_ROTATE:
|
|
472
472
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
473
|
-
this._handleTouchStartDollyRotate(r), this.state =
|
|
473
|
+
this._handleTouchStartDollyRotate(r), this.state = N.TOUCH_DOLLY_ROTATE;
|
|
474
474
|
break;
|
|
475
475
|
default:
|
|
476
|
-
this.state =
|
|
476
|
+
this.state = N.NONE;
|
|
477
477
|
}
|
|
478
478
|
break;
|
|
479
479
|
default:
|
|
480
|
-
this.state =
|
|
480
|
+
this.state = N.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !==
|
|
482
|
+
this.state !== N.NONE && this.dispatchEvent(Kt);
|
|
483
483
|
}
|
|
484
484
|
function _s(r) {
|
|
485
485
|
switch (this._trackPointer(r), this.state) {
|
|
486
|
-
case
|
|
486
|
+
case N.TOUCH_ROTATE:
|
|
487
487
|
if (this.enableRotate === !1) return;
|
|
488
488
|
this._handleTouchMoveRotate(r), this.update();
|
|
489
489
|
break;
|
|
490
|
-
case
|
|
490
|
+
case N.TOUCH_PAN:
|
|
491
491
|
if (this.enablePan === !1) return;
|
|
492
492
|
this._handleTouchMovePan(r), this.update();
|
|
493
493
|
break;
|
|
494
|
-
case
|
|
494
|
+
case N.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 N.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 = N.NONE;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function $s(r) {
|
|
@@ -512,11 +512,11 @@ function ei(r) {
|
|
|
512
512
|
function ti(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const
|
|
515
|
+
const xe = new ds(), F = new M(), fe = new M(), k = new K(), ln = {
|
|
516
516
|
X: new M(1, 0, 0),
|
|
517
517
|
Y: new M(0, 1, 0),
|
|
518
518
|
Z: new M(0, 0, 1)
|
|
519
|
-
}, Tt = { type: "change" }, cn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null },
|
|
519
|
+
}, Tt = { type: "change" }, cn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, dn = { type: "objectChange" };
|
|
520
520
|
class ni extends On {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
@@ -533,20 +533,20 @@ class ni extends On {
|
|
|
533
533
|
const i = new ui();
|
|
534
534
|
this._plane = i, s.add(i);
|
|
535
535
|
const o = this;
|
|
536
|
-
function a(C,
|
|
537
|
-
let w =
|
|
536
|
+
function a(C, x) {
|
|
537
|
+
let w = x;
|
|
538
538
|
Object.defineProperty(o, C, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return w !== void 0 ? w :
|
|
540
|
+
return w !== void 0 ? w : x;
|
|
541
541
|
},
|
|
542
542
|
set: function(D) {
|
|
543
543
|
w !== D && (w = D, i[C] = D, n[C] = D, o.dispatchEvent({ type: C + "-changed", value: D }), o.dispatchEvent(Tt));
|
|
544
544
|
}
|
|
545
|
-
}), o[C] =
|
|
545
|
+
}), o[C] = x, i[C] = x, n[C] = 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 M(), c = new M(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion",
|
|
548
|
+
const l = new M(), c = new M(), d = new K(), u = new K(), h = new M(), A = new K(), f = new M(), p = new M(), m = new M(), g = 0, y = new M();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", A), a("pointStart", f), a("pointEnd", p), a("rotationAxis", m), a("rotationAngle", g), a("eye", y), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new K(), this._parentQuaternionInv = new K(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new K(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new K(), this._scaleStart = new M(), this._getPointer = si.bind(this), this._onPointerDown = oi.bind(this), this._onPointerHover = ii.bind(this), this._onPointerMove = ri.bind(this), this._onPointerUp = ai.bind(this), t !== null && this.connect(t);
|
|
550
550
|
}
|
|
551
551
|
connect(e) {
|
|
552
552
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -565,14 +565,14 @@ class ni extends On {
|
|
|
565
565
|
}
|
|
566
566
|
pointerHover(e) {
|
|
567
567
|
if (this.object === void 0 || this.dragging === !0) return;
|
|
568
|
-
e !== null &&
|
|
569
|
-
const t = Ot(this._gizmo.picker[this.mode],
|
|
568
|
+
e !== null && xe.setFromCamera(e, this.camera);
|
|
569
|
+
const t = Ot(this._gizmo.picker[this.mode], xe);
|
|
570
570
|
t ? this.axis = t.object.name : this.axis = null;
|
|
571
571
|
}
|
|
572
572
|
pointerDown(e) {
|
|
573
573
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
574
|
-
e !== null &&
|
|
575
|
-
const t = Ot(this._plane,
|
|
574
|
+
e !== null && xe.setFromCamera(e, this.camera);
|
|
575
|
+
const t = Ot(this._plane, xe, !0);
|
|
576
576
|
t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, cn.mode = this.mode, this.dispatchEvent(cn);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -580,25 +580,25 @@ class ni extends On {
|
|
|
580
580
|
const t = this.axis, s = this.mode, n = this.object;
|
|
581
581
|
let i = this.space;
|
|
582
582
|
if (s === "scale" ? i = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (i = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1) return;
|
|
583
|
-
e !== null &&
|
|
584
|
-
const o = Ot(this._plane,
|
|
583
|
+
e !== null && xe.setFromCamera(e, this.camera);
|
|
584
|
+
const o = Ot(this._plane, xe, !0);
|
|
585
585
|
if (o) {
|
|
586
586
|
if (this.pointEnd.copy(o.point).sub(this.worldPositionStart), s === "translate")
|
|
587
587
|
this._offset.copy(this.pointEnd).sub(this.pointStart), i === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), i === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (i === "local" && (n.position.applyQuaternion(k.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), i === "world" && (n.parent && n.position.add(F.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(F.setFromMatrixPosition(n.parent.matrixWorld)))), n.position.x = Math.max(this.minX, Math.min(this.maxX, n.position.x)), n.position.y = Math.max(this.minY, Math.min(this.maxY, n.position.y)), n.position.z = Math.max(this.minZ, Math.min(this.maxZ, n.position.z));
|
|
588
588
|
else if (s === "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), fe.set(a, a, a);
|
|
592
592
|
} else
|
|
593
|
-
F.copy(this.pointStart),
|
|
594
|
-
n.scale.copy(this._scaleStart).multiply(
|
|
593
|
+
F.copy(this.pointStart), fe.copy(this.pointEnd), F.applyQuaternion(this._worldQuaternionInv), fe.applyQuaternion(this._worldQuaternionInv), fe.divide(F), t.search("X") === -1 && (fe.x = 1), t.search("Y") === -1 && (fe.y = 1), t.search("Z") === -1 && (fe.z = 1);
|
|
594
|
+
n.scale.copy(this._scaleStart).multiply(fe), this.scaleSnap && (t.search("X") !== -1 && (n.scale.x = Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (n.scale.y = Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (n.scale.z = Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
595
595
|
} else if (s === "rotate") {
|
|
596
596
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
597
597
|
const a = 20 / this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld));
|
|
598
598
|
let l = !1;
|
|
599
599
|
t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(F.copy(this.rotationAxis).cross(this.eye)) * a) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(ln[t]), F.copy(ln[t]), i === "local" && F.applyQuaternion(this.worldQuaternion), F.cross(this.eye), F.length() === 0 ? l = !0 : this.rotationAngle = this._offset.dot(F.normalize()) * a), (t === "E" || l) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), i === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(k.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(k.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
|
|
600
600
|
}
|
|
601
|
-
this.dispatchEvent(Tt), this.dispatchEvent(
|
|
601
|
+
this.dispatchEvent(Tt), this.dispatchEvent(dn);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
pointerUp(e) {
|
|
@@ -628,7 +628,7 @@ class ni extends On {
|
|
|
628
628
|
* Resets the object's position, rotation and scale to when the current transform began.
|
|
629
629
|
*/
|
|
630
630
|
reset() {
|
|
631
|
-
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Tt), this.dispatchEvent(
|
|
631
|
+
this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Tt), this.dispatchEvent(dn), this.pointStart.copy(this.pointEnd));
|
|
632
632
|
}
|
|
633
633
|
/**
|
|
634
634
|
* Returns the raycaster that is used for user interaction. This object is shared between all
|
|
@@ -637,7 +637,7 @@ class ni extends On {
|
|
|
637
637
|
* @returns {Raycaster} The internal raycaster.
|
|
638
638
|
*/
|
|
639
639
|
getRaycaster() {
|
|
640
|
-
return
|
|
640
|
+
return xe;
|
|
641
641
|
}
|
|
642
642
|
/**
|
|
643
643
|
* Returns the transformation mode.
|
|
@@ -749,7 +749,7 @@ function Ot(r, e, t) {
|
|
|
749
749
|
return s[n];
|
|
750
750
|
return !1;
|
|
751
751
|
}
|
|
752
|
-
const ut = new hs(),
|
|
752
|
+
const ut = new hs(), j = new M(0, 1, 0), An = new M(0, 0, 0), hn = new ge(), dt = new K(), mt = new K(), oe = new M(), fn = new ge(), Ve = new M(1, 0, 0), ve = new M(0, 1, 0), Ye = new M(0, 0, 1), At = new M(), Fe = new M(), qe = new M();
|
|
753
753
|
class li extends ke {
|
|
754
754
|
constructor(e) {
|
|
755
755
|
super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
|
|
@@ -794,62 +794,62 @@ class ci extends ke {
|
|
|
794
794
|
l.color.setHex(16711680), l.opacity = 0.5;
|
|
795
795
|
const c = e.clone();
|
|
796
796
|
c.color.setHex(65280), c.opacity = 0.5;
|
|
797
|
-
const
|
|
798
|
-
|
|
797
|
+
const d = e.clone();
|
|
798
|
+
d.color.setHex(255), d.opacity = 0.5;
|
|
799
799
|
const u = e.clone();
|
|
800
800
|
u.opacity = 0.25;
|
|
801
801
|
const h = e.clone();
|
|
802
802
|
h.color.setHex(16776960), h.opacity = 0.25;
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
const
|
|
806
|
-
|
|
803
|
+
const A = e.clone();
|
|
804
|
+
A.color.setHex(16776960);
|
|
805
|
+
const f = e.clone();
|
|
806
|
+
f.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
810
|
-
active:
|
|
810
|
+
active: A,
|
|
811
811
|
xAxisTransparent: l,
|
|
812
812
|
yAxisTransparent: c,
|
|
813
|
-
zAxisTransparent:
|
|
813
|
+
zAxisTransparent: d,
|
|
814
814
|
activeTransparent: h
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
|
|
816
|
+
const p = new U(0, 0.04, 0.1, 12);
|
|
817
|
+
p.translate(0, 0.05, 0);
|
|
818
|
+
const m = new q(0.08, 0.08, 0.08);
|
|
819
|
+
m.translate(0, 0.04, 0);
|
|
820
820
|
const g = new We();
|
|
821
|
-
g.setAttribute("position", new
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
function C(
|
|
825
|
-
const
|
|
826
|
-
return
|
|
821
|
+
g.setAttribute("position", new me([0, 0, 0, 1, 0, 0], 3));
|
|
822
|
+
const y = new U(75e-4, 75e-4, 0.5, 3);
|
|
823
|
+
y.translate(0, 0.25, 0);
|
|
824
|
+
function C(ee, it) {
|
|
825
|
+
const se = new Ge(ee, 75e-4, 3, 64, it * Math.PI * 2);
|
|
826
|
+
return se.rotateY(Math.PI / 2), se.rotateX(Math.PI / 2), se;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
const
|
|
830
|
-
return
|
|
828
|
+
function x() {
|
|
829
|
+
const ee = new We();
|
|
830
|
+
return ee.setAttribute("position", new me([0, 0, 0, 1, 1, 1], 3)), ee;
|
|
831
831
|
}
|
|
832
832
|
const w = {
|
|
833
833
|
X: [
|
|
834
|
-
[new v(
|
|
835
|
-
[new v(
|
|
836
|
-
[new v(
|
|
834
|
+
[new v(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new v(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
|
+
[new v(y, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new v(
|
|
840
|
-
[new v(
|
|
841
|
-
[new v(
|
|
839
|
+
[new v(p, o), [0, 0.5, 0]],
|
|
840
|
+
[new v(p, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
|
+
[new v(y, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new v(
|
|
845
|
-
[new v(
|
|
846
|
-
[new v(
|
|
844
|
+
[new v(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new v(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
|
+
[new v(y, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
849
849
|
[new v(new lt(0.1, 0), u), [0, 0, 0]]
|
|
850
850
|
],
|
|
851
851
|
XY: [
|
|
852
|
-
[new v(new q(0.15, 0.15, 0.01),
|
|
852
|
+
[new v(new q(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
853
853
|
],
|
|
854
854
|
YZ: [
|
|
855
855
|
[new v(new q(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
@@ -890,7 +890,7 @@ class ci extends ke {
|
|
|
890
890
|
[new v(new lt(0.01, 2), n), null, null, null, "helper"]
|
|
891
891
|
],
|
|
892
892
|
DELTA: [
|
|
893
|
-
[new ue(
|
|
893
|
+
[new ue(x(), n), null, null, null, "helper"]
|
|
894
894
|
],
|
|
895
895
|
X: [
|
|
896
896
|
[new ue(g, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
@@ -903,7 +903,7 @@ class ci extends ke {
|
|
|
903
903
|
]
|
|
904
904
|
}, Z = {
|
|
905
905
|
XYZE: [
|
|
906
|
-
[new v(C(0.5, 1),
|
|
906
|
+
[new v(C(0.5, 1), f), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
909
|
[new v(C(0.5, 0.5), i)]
|
|
@@ -917,13 +917,13 @@ class ci extends ke {
|
|
|
917
917
|
E: [
|
|
918
918
|
[new v(C(0.75, 1), h), null, [0, Math.PI / 2, 0]]
|
|
919
919
|
]
|
|
920
|
-
},
|
|
920
|
+
}, $ = {
|
|
921
921
|
AXIS: [
|
|
922
922
|
[new ue(g, n), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
|
|
923
923
|
]
|
|
924
924
|
}, Q = {
|
|
925
925
|
XYZE: [
|
|
926
|
-
[new v(new
|
|
926
|
+
[new v(new As(0.25, 10, 8), s)]
|
|
927
927
|
],
|
|
928
928
|
X: [
|
|
929
929
|
[new v(new Ge(0.5, 0.1, 4, 24), s), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
|
|
@@ -937,24 +937,24 @@ class ci extends ke {
|
|
|
937
937
|
E: [
|
|
938
938
|
[new v(new Ge(0.75, 0.1, 2, 24), s)]
|
|
939
939
|
]
|
|
940
|
-
},
|
|
940
|
+
}, Ce = {
|
|
941
941
|
X: [
|
|
942
|
-
[new v(
|
|
943
|
-
[new v(
|
|
944
|
-
[new v(
|
|
942
|
+
[new v(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
|
+
[new v(y, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
|
+
[new v(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
|
-
[new v(
|
|
948
|
-
[new v(
|
|
949
|
-
[new v(
|
|
947
|
+
[new v(m, o), [0, 0.5, 0]],
|
|
948
|
+
[new v(y, o)],
|
|
949
|
+
[new v(m, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
|
-
[new v(
|
|
953
|
-
[new v(
|
|
954
|
-
[new v(
|
|
952
|
+
[new v(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
|
+
[new v(y, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
|
+
[new v(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
957
|
-
[new v(new q(0.15, 0.15, 0.01),
|
|
957
|
+
[new v(new q(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
|
|
958
958
|
],
|
|
959
959
|
YZ: [
|
|
960
960
|
[new v(new q(0.15, 0.15, 0.01), l), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
|
|
@@ -1001,18 +1001,18 @@ class ci extends ke {
|
|
|
1001
1001
|
[new ue(g, n), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
|
|
1002
1002
|
]
|
|
1003
1003
|
};
|
|
1004
|
-
function ce(
|
|
1004
|
+
function ce(ee) {
|
|
1005
1005
|
const it = new ke();
|
|
1006
|
-
for (const
|
|
1007
|
-
for (let Ee =
|
|
1008
|
-
const B =
|
|
1009
|
-
B.name =
|
|
1006
|
+
for (const se in ee)
|
|
1007
|
+
for (let Ee = ee[se].length; Ee--; ) {
|
|
1008
|
+
const B = ee[se][Ee][0].clone(), ot = ee[se][Ee][1], rt = ee[se][Ee][2], at = ee[se][Ee][3], Jn = ee[se][Ee][4];
|
|
1009
|
+
B.name = se, B.tag = Jn, ot && B.position.set(ot[0], ot[1], ot[2]), rt && B.rotation.set(rt[0], rt[1], rt[2]), at && B.scale.set(at[0], at[1], at[2]), B.updateMatrix();
|
|
1010
1010
|
const _t = B.geometry.clone();
|
|
1011
1011
|
_t.applyMatrix4(B.matrix), B.geometry = _t, B.renderOrder = 1 / 0, B.position.set(0, 0, 0), B.rotation.set(0, 0, 0), B.scale.set(1, 1, 1), it.add(B);
|
|
1012
1012
|
}
|
|
1013
1013
|
return it;
|
|
1014
1014
|
}
|
|
1015
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(
|
|
1015
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = ce(w)), this.add(this.gizmo.rotate = ce(Z)), this.add(this.gizmo.scale = ce(Ce)), this.add(this.picker.translate = ce(D)), this.add(this.picker.rotate = ce(Q)), this.add(this.picker.scale = ce(Mt)), this.add(this.helper.translate = ce(S)), this.add(this.helper.rotate = ce($)), this.add(this.helper.scale = ce(Qn)), 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 ci extends ke {
|
|
|
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" && (k.setFromEuler(ut.set(0, 0, 0)), o.quaternion.copy(s).multiply(k), Math.abs(
|
|
1028
|
+
o.visible = !1, o.name === "AXIS" ? (o.visible = !!this.axis, this.axis === "X" && (k.setFromEuler(ut.set(0, 0, 0)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Y" && (k.setFromEuler(ut.set(0, 0, Math.PI / 2)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "Z" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), o.quaternion.copy(s).multiply(k), Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), j.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(hn.lookAt(An, j, ve)), o.quaternion.multiply(k), 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), F.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), F.applyQuaternion(this.worldQuaternionStart.clone().invert()), o.scale.copy(F), o.visible = this.dragging) : (o.quaternion.copy(s), 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(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(
|
|
1031
|
+
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Y" && Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XY" && Math.abs(j.copy(Ye).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "YZ" && Math.abs(j.copy(Ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "XZ" && Math.abs(j.copy(ve).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (dt.copy(s), j.copy(this.eye).applyQuaternion(k.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(hn.lookAt(this.eye, An, ve)), o.name === "X" && (k.setFromAxisAngle(Ve, Math.atan2(-j.y, j.z)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k)), o.name === "Y" && (k.setFromAxisAngle(ve, Math.atan2(j.x, j.z)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k)), o.name === "Z" && (k.setFromAxisAngle(Ye, Math.atan2(j.y, j.x)), k.multiplyQuaternions(dt, k), o.quaternion.copy(k))), 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,27 +1044,27 @@ class ui extends v {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
1046
1046
|
let t = this.space;
|
|
1047
|
-
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"),
|
|
1047
|
+
switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), At.copy(Ve).applyQuaternion(t === "local" ? this.worldQuaternion : mt), Fe.copy(ve).applyQuaternion(t === "local" ? this.worldQuaternion : mt), qe.copy(Ye).applyQuaternion(t === "local" ? this.worldQuaternion : mt), j.copy(Fe), this.mode) {
|
|
1048
1048
|
case "translate":
|
|
1049
1049
|
case "scale":
|
|
1050
1050
|
switch (this.axis) {
|
|
1051
1051
|
case "X":
|
|
1052
|
-
|
|
1052
|
+
j.copy(this.eye).cross(At), oe.copy(At).cross(j);
|
|
1053
1053
|
break;
|
|
1054
1054
|
case "Y":
|
|
1055
|
-
|
|
1055
|
+
j.copy(this.eye).cross(Fe), oe.copy(Fe).cross(j);
|
|
1056
1056
|
break;
|
|
1057
1057
|
case "Z":
|
|
1058
|
-
|
|
1058
|
+
j.copy(this.eye).cross(qe), oe.copy(qe).cross(j);
|
|
1059
1059
|
break;
|
|
1060
1060
|
case "XY":
|
|
1061
1061
|
oe.copy(qe);
|
|
1062
1062
|
break;
|
|
1063
1063
|
case "YZ":
|
|
1064
|
-
oe.copy(
|
|
1064
|
+
oe.copy(At);
|
|
1065
1065
|
break;
|
|
1066
1066
|
case "XZ":
|
|
1067
|
-
|
|
1067
|
+
j.copy(qe), oe.copy(Fe);
|
|
1068
1068
|
break;
|
|
1069
1069
|
case "XYZ":
|
|
1070
1070
|
case "E":
|
|
@@ -1076,10 +1076,10 @@ class ui extends v {
|
|
|
1076
1076
|
default:
|
|
1077
1077
|
oe.set(0, 0, 0);
|
|
1078
1078
|
}
|
|
1079
|
-
oe.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (fn.lookAt(F.set(0, 0, 0), oe,
|
|
1079
|
+
oe.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (fn.lookAt(F.set(0, 0, 0), oe, j), this.quaternion.setFromRotationMatrix(fn)), super.updateMatrixWorld(e);
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
class
|
|
1082
|
+
class di extends ke {
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Constructs a new CSS2D object.
|
|
1085
1085
|
*
|
|
@@ -1096,8 +1096,8 @@ class Ai extends ke {
|
|
|
1096
1096
|
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
|
-
const Se = new M(), pn = new
|
|
1100
|
-
class
|
|
1099
|
+
const Se = new M(), pn = new ge(), mn = new ge(), gn = new M(), bn = new M();
|
|
1100
|
+
class Ai {
|
|
1101
1101
|
/**
|
|
1102
1102
|
* Constructs a new CSS2D renderer.
|
|
1103
1103
|
*
|
|
@@ -1114,51 +1114,51 @@ class di {
|
|
|
1114
1114
|
width: s,
|
|
1115
1115
|
height: n
|
|
1116
1116
|
};
|
|
1117
|
-
}, this.render = function(
|
|
1118
|
-
|
|
1119
|
-
}, this.setSize = function(
|
|
1120
|
-
s =
|
|
1117
|
+
}, this.render = function(f, p) {
|
|
1118
|
+
f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), p.parent === null && p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), pn.copy(p.matrixWorldInverse), mn.multiplyMatrices(p.projectionMatrix, pn), d(f, f, p), this.sortObjects && A(f);
|
|
1119
|
+
}, this.setSize = function(f, p) {
|
|
1120
|
+
s = f, n = p, i = s / 2, o = n / 2, l.style.width = f + "px", l.style.height = p + "px";
|
|
1121
1121
|
};
|
|
1122
|
-
function c(
|
|
1123
|
-
|
|
1124
|
-
for (let
|
|
1125
|
-
c(
|
|
1122
|
+
function c(f) {
|
|
1123
|
+
f.isCSS2DObject && (f.element.style.display = "none");
|
|
1124
|
+
for (let p = 0, m = f.children.length; p < m; p++)
|
|
1125
|
+
c(f.children[p]);
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1128
|
-
if (
|
|
1129
|
-
c(
|
|
1127
|
+
function d(f, p, m) {
|
|
1128
|
+
if (f.visible === !1) {
|
|
1129
|
+
c(f);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
|
-
if (
|
|
1133
|
-
Se.setFromMatrixPosition(
|
|
1134
|
-
const g = Se.z >= -1 && Se.z <= 1 &&
|
|
1135
|
-
|
|
1132
|
+
if (f.isCSS2DObject) {
|
|
1133
|
+
Se.setFromMatrixPosition(f.matrixWorld), Se.applyMatrix4(mn);
|
|
1134
|
+
const g = Se.z >= -1 && Se.z <= 1 && f.layers.test(m.layers) === !0, y = f.element;
|
|
1135
|
+
y.style.display = g === !0 ? "" : "none", g === !0 && (f.onBeforeRender(t, p, m), y.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (Se.x * i + i) + "px," + (-Se.y * o + o) + "px)", y.parentNode !== l && l.appendChild(y), f.onAfterRender(t, p, m));
|
|
1136
1136
|
const C = {
|
|
1137
|
-
distanceToCameraSquared: u(
|
|
1137
|
+
distanceToCameraSquared: u(m, f)
|
|
1138
1138
|
};
|
|
1139
|
-
a.objects.set(
|
|
1139
|
+
a.objects.set(f, C);
|
|
1140
1140
|
}
|
|
1141
|
-
for (let g = 0,
|
|
1142
|
-
|
|
1141
|
+
for (let g = 0, y = f.children.length; g < y; g++)
|
|
1142
|
+
d(f.children[g], p, m);
|
|
1143
1143
|
}
|
|
1144
|
-
function u(
|
|
1145
|
-
return gn.setFromMatrixPosition(
|
|
1144
|
+
function u(f, p) {
|
|
1145
|
+
return gn.setFromMatrixPosition(f.matrixWorld), bn.setFromMatrixPosition(p.matrixWorld), gn.distanceToSquared(bn);
|
|
1146
1146
|
}
|
|
1147
|
-
function h(
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1150
|
-
|
|
1151
|
-
}),
|
|
1147
|
+
function h(f) {
|
|
1148
|
+
const p = [];
|
|
1149
|
+
return f.traverseVisible(function(m) {
|
|
1150
|
+
m.isCSS2DObject && p.push(m);
|
|
1151
|
+
}), p;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1154
|
-
const
|
|
1155
|
-
if (g.renderOrder !==
|
|
1156
|
-
return
|
|
1157
|
-
const C = a.objects.get(g).distanceToCameraSquared,
|
|
1158
|
-
return C -
|
|
1159
|
-
}),
|
|
1160
|
-
for (let g = 0,
|
|
1161
|
-
|
|
1153
|
+
function A(f) {
|
|
1154
|
+
const p = h(f).sort(function(g, y) {
|
|
1155
|
+
if (g.renderOrder !== y.renderOrder)
|
|
1156
|
+
return y.renderOrder - g.renderOrder;
|
|
1157
|
+
const C = a.objects.get(g).distanceToCameraSquared, x = a.objects.get(y).distanceToCameraSquared;
|
|
1158
|
+
return C - x;
|
|
1159
|
+
}), m = p.length;
|
|
1160
|
+
for (let g = 0, y = p.length; g < y; g++)
|
|
1161
|
+
p[g].element.style.zIndex = m - g;
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
@@ -1261,7 +1261,7 @@ class Gn {
|
|
|
1261
1261
|
const t = new P.Box3().setFromObject(e), s = new P.Vector3();
|
|
1262
1262
|
t.getSize(s);
|
|
1263
1263
|
const n = s.y / 2 + this.options.offsetY;
|
|
1264
|
-
this.css2dObject || (this.css2dObject = new
|
|
1264
|
+
this.css2dObject || (this.css2dObject = new di(this.container), this.css2dObject.name = `DataPanel_${e.name || e.uuid}`, this.css2dObject.center.set(0.5, 1)), this.css2dObject.position.set(0, n, 0), e.add(this.css2dObject), this.attachedObject = e;
|
|
1265
1265
|
}
|
|
1266
1266
|
/**
|
|
1267
1267
|
* 从附着的物体上移除面板
|
|
@@ -1366,6 +1366,26 @@ class Gn {
|
|
|
1366
1366
|
t.getSize(s), this.css2dObject.position.set(0, s.y / 2 + e, 0);
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
+
/** 获取面板宽度 */
|
|
1370
|
+
getWidth() {
|
|
1371
|
+
return this.options.width || "200px";
|
|
1372
|
+
}
|
|
1373
|
+
/** 获取面板字体大小 */
|
|
1374
|
+
getFontSize() {
|
|
1375
|
+
return this.options.fontSize || "13px";
|
|
1376
|
+
}
|
|
1377
|
+
/** 设置面板宽度(轻量,不重建 DOM) */
|
|
1378
|
+
setWidth(e) {
|
|
1379
|
+
this.options.width = e, this.container && (this.container.style.width = e);
|
|
1380
|
+
}
|
|
1381
|
+
/** 设置面板字体大小(轻量,不重建 DOM) */
|
|
1382
|
+
setFontSize(e) {
|
|
1383
|
+
if (this.options.fontSize = e, this.container) {
|
|
1384
|
+
this.container.style.fontSize = e;
|
|
1385
|
+
const t = this.container.querySelector("[data-panel-title]");
|
|
1386
|
+
t && (t.style.fontSize = `calc(${e} + 2px)`);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1369
1389
|
/** 获取面板 DOM 元素(用于外部样式自定义) */
|
|
1370
1390
|
getElement() {
|
|
1371
1391
|
return this.container;
|
|
@@ -1390,9 +1410,9 @@ function hi(r) {
|
|
|
1390
1410
|
}
|
|
1391
1411
|
let W = null;
|
|
1392
1412
|
function fi(r) {
|
|
1393
|
-
return W ? (W.domElement.parentNode !== r && r.appendChild(W.domElement), W) : (W = new
|
|
1413
|
+
return W ? (W.domElement.parentNode !== r && r.appendChild(W.domElement), W) : (W = new Ai(), W.setSize(r.clientWidth, r.clientHeight), W.domElement.style.position = "absolute", W.domElement.style.top = "0", W.domElement.style.left = "0", W.domElement.style.pointerEvents = "none", r.appendChild(W.domElement), W);
|
|
1394
1414
|
}
|
|
1395
|
-
function
|
|
1415
|
+
function La() {
|
|
1396
1416
|
return W;
|
|
1397
1417
|
}
|
|
1398
1418
|
function pi(r, e) {
|
|
@@ -1430,7 +1450,7 @@ const I = {
|
|
|
1430
1450
|
};
|
|
1431
1451
|
let gt = !1, Oe = !1, Xt = [];
|
|
1432
1452
|
const bi = 16755200;
|
|
1433
|
-
let Te = null, Bt = null, bt = null,
|
|
1453
|
+
let Te = null, Bt = null, bt = null, be = [];
|
|
1434
1454
|
const st = /* @__PURE__ */ new Map();
|
|
1435
1455
|
let Ct, It = null, $e = null, et = null;
|
|
1436
1456
|
function Ii(r, e = "edit", t) {
|
|
@@ -1631,7 +1651,7 @@ function Si(r) {
|
|
|
1631
1651
|
return r;
|
|
1632
1652
|
}
|
|
1633
1653
|
function Hi(r, e = 500) {
|
|
1634
|
-
var
|
|
1654
|
+
var A;
|
|
1635
1655
|
if (!I.camera || !I.orbitControls) {
|
|
1636
1656
|
console.warn(
|
|
1637
1657
|
"[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
|
|
@@ -1639,8 +1659,8 @@ function Hi(r, e = 500) {
|
|
|
1639
1659
|
return;
|
|
1640
1660
|
}
|
|
1641
1661
|
let t = null;
|
|
1642
|
-
if ((
|
|
1643
|
-
|
|
1662
|
+
if ((A = I.scene) == null || A.traverse((f) => {
|
|
1663
|
+
f.userData.id == r && (t = f);
|
|
1644
1664
|
}), !t) {
|
|
1645
1665
|
console.warn(
|
|
1646
1666
|
`[focusOnObject] 在场景中未找到 userData.id 为 "${r}" 的物体。请确认:1) 物体已被正确添加到场景(addModel);2) 物体的 userData.id 与传入的 objectId 一致;3) 传入的 objectId 不为空`
|
|
@@ -1653,7 +1673,7 @@ function Hi(r, e = 500) {
|
|
|
1653
1673
|
t.getWorldPosition(n);
|
|
1654
1674
|
const o = new P.Box3().setFromObject(t).getSize(new P.Vector3()), a = Math.max(o.x, o.y, o.z) * 0.5, l = Math.max(a * 3.5, 5), c = new P.Vector3().copy(I.camera.position).sub(n).normalize();
|
|
1655
1675
|
c.lengthSq() < 1e-3 && c.set(0, 0, 1);
|
|
1656
|
-
const
|
|
1676
|
+
const d = n.clone().add(c.multiplyScalar(l)), u = I.camera.position.clone(), h = I.orbitControls.target.clone();
|
|
1657
1677
|
try {
|
|
1658
1678
|
new nt.Tween({
|
|
1659
1679
|
x: u.x,
|
|
@@ -1664,21 +1684,21 @@ function Hi(r, e = 500) {
|
|
|
1664
1684
|
tz: h.z
|
|
1665
1685
|
}).to(
|
|
1666
1686
|
{
|
|
1667
|
-
x: s ? s.x :
|
|
1668
|
-
y: s ? s.y :
|
|
1669
|
-
z: s ? s.z :
|
|
1687
|
+
x: s ? s.x : d.x,
|
|
1688
|
+
y: s ? s.y : d.y,
|
|
1689
|
+
z: s ? s.z : d.z,
|
|
1670
1690
|
tx: n.x,
|
|
1671
1691
|
ty: n.y,
|
|
1672
1692
|
tz: n.z
|
|
1673
1693
|
},
|
|
1674
1694
|
e
|
|
1675
|
-
).easing(nt.Easing.Quadratic.InOut).onUpdate((
|
|
1676
|
-
I.camera.position.set(
|
|
1695
|
+
).easing(nt.Easing.Quadratic.InOut).onUpdate((f) => {
|
|
1696
|
+
I.camera.position.set(f.x, f.y, f.z), I.orbitControls.target.set(f.tx, f.ty, f.tz), I.orbitControls.update();
|
|
1677
1697
|
}).start();
|
|
1678
|
-
} catch (
|
|
1698
|
+
} catch (f) {
|
|
1679
1699
|
console.error(
|
|
1680
1700
|
"[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
|
|
1681
|
-
|
|
1701
|
+
f
|
|
1682
1702
|
);
|
|
1683
1703
|
}
|
|
1684
1704
|
}
|
|
@@ -1707,20 +1727,20 @@ function Wi(r) {
|
|
|
1707
1727
|
e && ki(e);
|
|
1708
1728
|
}
|
|
1709
1729
|
function zi(r) {
|
|
1710
|
-
r.userData.isMovable && r.parent === I.scene && (
|
|
1730
|
+
r.userData.isMovable && r.parent === I.scene && (be.includes(r) || be.push(r));
|
|
1711
1731
|
}
|
|
1712
1732
|
function Gi(r) {
|
|
1713
|
-
const e =
|
|
1714
|
-
e !== -1 &&
|
|
1733
|
+
const e = be.indexOf(r);
|
|
1734
|
+
e !== -1 && be.splice(e, 1);
|
|
1715
1735
|
}
|
|
1716
1736
|
function Fi() {
|
|
1717
1737
|
const r = [];
|
|
1718
1738
|
I.scene.children.forEach((e) => {
|
|
1719
1739
|
e.userData.isMovable && r.push(e);
|
|
1720
|
-
}),
|
|
1740
|
+
}), be = r, vt();
|
|
1721
1741
|
}
|
|
1722
1742
|
function vt() {
|
|
1723
|
-
bt == null || bt([...
|
|
1743
|
+
bt == null || bt([...be]);
|
|
1724
1744
|
}
|
|
1725
1745
|
function qi(r) {
|
|
1726
1746
|
Te = r;
|
|
@@ -1732,12 +1752,12 @@ function Bi(r) {
|
|
|
1732
1752
|
bt = r;
|
|
1733
1753
|
}
|
|
1734
1754
|
function Ui() {
|
|
1735
|
-
return
|
|
1755
|
+
return be;
|
|
1736
1756
|
}
|
|
1737
1757
|
function Vi() {
|
|
1738
1758
|
return I.selectedObject;
|
|
1739
1759
|
}
|
|
1740
|
-
function
|
|
1760
|
+
function Na(r, e, t) {
|
|
1741
1761
|
if (!I.scene) return;
|
|
1742
1762
|
const s = st.get(r);
|
|
1743
1763
|
if (s) {
|
|
@@ -1745,48 +1765,53 @@ function Oa(r, e, t) {
|
|
|
1745
1765
|
n && n.updateItemByCode(e, t);
|
|
1746
1766
|
}
|
|
1747
1767
|
}
|
|
1748
|
-
function
|
|
1768
|
+
function ja() {
|
|
1749
1769
|
return I.scene;
|
|
1750
1770
|
}
|
|
1751
1771
|
function Yi() {
|
|
1752
1772
|
return I.camera;
|
|
1753
1773
|
}
|
|
1754
|
-
function
|
|
1774
|
+
function ka() {
|
|
1755
1775
|
return I.renderer;
|
|
1756
1776
|
}
|
|
1757
1777
|
async function Ki() {
|
|
1758
|
-
var c,
|
|
1778
|
+
var c, d, u;
|
|
1759
1779
|
J == null || J(!0), await new Promise((h) => setTimeout(h, 50)), Jt();
|
|
1760
1780
|
const r = I.scene;
|
|
1761
1781
|
if (!r)
|
|
1762
1782
|
return J == null || J(!1), "{}";
|
|
1763
1783
|
const e = [], t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1764
1784
|
r.traverse((h) => {
|
|
1765
|
-
var
|
|
1785
|
+
var A;
|
|
1766
1786
|
if (h.userData.type === "lightHelper" && e.push(h), h.type === "DirectionalLight" && h.userData.helper && (t.set(h, h.userData.helper), h.userData.helper = void 0), h.name && h.name.startsWith("DataPanel_")) {
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1769
|
-
const
|
|
1787
|
+
const f = h;
|
|
1788
|
+
if (f.element) {
|
|
1789
|
+
const p = f.element.querySelector(
|
|
1770
1790
|
"[data-panel-title]"
|
|
1771
|
-
),
|
|
1772
|
-
|
|
1791
|
+
), m = [];
|
|
1792
|
+
if (f.element.querySelectorAll(
|
|
1773
1793
|
".css2d-data-panel-item"
|
|
1774
|
-
).forEach((
|
|
1794
|
+
).forEach((y) => {
|
|
1775
1795
|
var w, D, S;
|
|
1776
|
-
const C =
|
|
1777
|
-
if (C &&
|
|
1778
|
-
const Z = (C.textContent || "").trim(),
|
|
1796
|
+
const C = y.querySelector(".item-label"), x = y.querySelector(".item-value");
|
|
1797
|
+
if (C && x) {
|
|
1798
|
+
const Z = (C.textContent || "").trim(), $ = ((D = (w = x.childNodes[0]) == null ? void 0 : w.textContent) == null ? void 0 : D.trim()) || "", Q = x.querySelector(
|
|
1779
1799
|
"span"
|
|
1780
|
-
),
|
|
1781
|
-
|
|
1800
|
+
), Ce = Q ? (Q.textContent || "").trim() : void 0, Mt = ((S = y.getAttribute("data-item-code")) == null ? void 0 : S.trim()) || void 0;
|
|
1801
|
+
m.push({ label: Z, value: $, unit: Ce, code: Mt });
|
|
1782
1802
|
}
|
|
1783
|
-
}), h.parent
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1803
|
+
}), h.parent) {
|
|
1804
|
+
const y = f.element.style.width || "", C = f.element.style.fontSize || "";
|
|
1805
|
+
s.set(
|
|
1806
|
+
h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
|
|
1807
|
+
{
|
|
1808
|
+
title: ((A = p == null ? void 0 : p.textContent) == null ? void 0 : A.trim()) || "",
|
|
1809
|
+
items: m,
|
|
1810
|
+
width: y,
|
|
1811
|
+
fontSize: C
|
|
1812
|
+
}
|
|
1813
|
+
);
|
|
1814
|
+
}
|
|
1790
1815
|
}
|
|
1791
1816
|
}
|
|
1792
1817
|
}), e.forEach((h) => r.remove(h));
|
|
@@ -1797,16 +1822,16 @@ async function Ki() {
|
|
|
1797
1822
|
h.name && h.name.startsWith("DataPanel_") && h.parent && h.parent.remove(h);
|
|
1798
1823
|
});
|
|
1799
1824
|
const i = n.toJSON();
|
|
1800
|
-
e.forEach((h) => r.add(h)), t.forEach((h,
|
|
1801
|
-
|
|
1825
|
+
e.forEach((h) => r.add(h)), t.forEach((h, A) => {
|
|
1826
|
+
A.userData.helper = h;
|
|
1802
1827
|
});
|
|
1803
1828
|
const o = {
|
|
1804
1829
|
position: (c = I.camera) == null ? void 0 : c.position.toArray(),
|
|
1805
|
-
rotation: (
|
|
1830
|
+
rotation: (d = I.camera) == null ? void 0 : d.rotation.toArray(),
|
|
1806
1831
|
target: ((u = I.orbitControls) == null ? void 0 : u.target.toArray()) || [0, 0, 0]
|
|
1807
1832
|
}, a = {};
|
|
1808
|
-
s.forEach((h,
|
|
1809
|
-
a[
|
|
1833
|
+
s.forEach((h, A) => {
|
|
1834
|
+
a[A] = h;
|
|
1810
1835
|
});
|
|
1811
1836
|
const l = JSON.stringify({
|
|
1812
1837
|
scene: i,
|
|
@@ -1820,22 +1845,22 @@ function Zi(r, e = "edit", t) {
|
|
|
1820
1845
|
var o, a, l;
|
|
1821
1846
|
const s = typeof r == "string" ? JSON.parse(r) : r, i = new P.ObjectLoader().parse(s);
|
|
1822
1847
|
i.type === "Scene" ? I.scene = i : (o = I.scene) == null || o.add(i), t && ((a = I.scene) == null || a.traverse((c) => {
|
|
1823
|
-
const
|
|
1848
|
+
const d = c.userData.id || c.uuid, u = t[d];
|
|
1824
1849
|
if (u && c.userData.isMovable) {
|
|
1825
1850
|
Li(c);
|
|
1826
1851
|
const h = new Gn({
|
|
1827
1852
|
title: u.title,
|
|
1828
1853
|
items: u.items
|
|
1829
1854
|
});
|
|
1830
|
-
h.attachTo(c), h.visible = !1,
|
|
1855
|
+
h.attachTo(c), h.visible = !1, u.width && h.setWidth(u.width), u.fontSize && h.setFontSize(u.fontSize), Fn(c, h);
|
|
1831
1856
|
}
|
|
1832
1857
|
})), e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
|
|
1833
|
-
var
|
|
1858
|
+
var d;
|
|
1834
1859
|
if (c.type === "DirectionalLight") {
|
|
1835
1860
|
const u = c;
|
|
1836
1861
|
if (!u.userData.helper) {
|
|
1837
1862
|
const h = new P.DirectionalLightHelper(u, 1);
|
|
1838
|
-
h.userData.type = "lightHelper", u.userData.helper = h, (
|
|
1863
|
+
h.userData.type = "lightHelper", u.userData.helper = h, (d = I.scene) == null || d.add(h);
|
|
1839
1864
|
}
|
|
1840
1865
|
}
|
|
1841
1866
|
}));
|
|
@@ -1853,9 +1878,9 @@ function Vn(r) {
|
|
|
1853
1878
|
Vn(t);
|
|
1854
1879
|
}
|
|
1855
1880
|
function Qi() {
|
|
1856
|
-
It !== null && (cancelAnimationFrame(It), It = null), $e && I.container && (I.container.removeEventListener("click", $e), $e = null), et && (window.removeEventListener("resize", et), et = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), I.scene && (Vn(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), gi(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "",
|
|
1881
|
+
It !== null && (cancelAnimationFrame(It), It = null), $e && I.container && (I.container.removeEventListener("click", $e), $e = null), et && (window.removeEventListener("resize", et), et = null), I.orbitControls && (I.orbitControls.dispose(), I.orbitControls = null), I.transformControls && (I.transformControls.dispose(), I.transformControls = null), I.scene && (Vn(I.scene), I.scene = null), I.renderer && (I.renderer.dispose(), I.renderer.domElement && I.container && I.container.removeChild(I.renderer.domElement), I.renderer = null), gi(), I.camera = null, I.gridHelper = null, I.selectedObject = null, I.container = null, I.mode = "", be = [], st.clear(), vt(), gt = !1, Oe = !1;
|
|
1857
1882
|
}
|
|
1858
|
-
const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /, In = /\s+/, yn = new M(), Rt = new M(), Cn = new M(), xn = new M(),
|
|
1883
|
+
const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /, In = /\s+/, yn = new M(), Rt = new M(), Cn = new M(), xn = new M(), te = new M(), ht = new he();
|
|
1859
1884
|
function to() {
|
|
1860
1885
|
const r = {
|
|
1861
1886
|
objects: [],
|
|
@@ -1965,7 +1990,7 @@ function to() {
|
|
|
1965
1990
|
},
|
|
1966
1991
|
addFaceNormal: function(e, t, s) {
|
|
1967
1992
|
const n = this.vertices, i = this.object.geometry.normals;
|
|
1968
|
-
yn.fromArray(n, e), Rt.fromArray(n, t), Cn.fromArray(n, s),
|
|
1993
|
+
yn.fromArray(n, e), Rt.fromArray(n, t), Cn.fromArray(n, s), te.subVectors(Cn, Rt), xn.subVectors(yn, Rt), te.cross(xn), te.normalize(), i.push(te.x, te.y, te.z), i.push(te.x, te.y, te.z), i.push(te.x, te.y, te.z);
|
|
1969
1994
|
},
|
|
1970
1995
|
addColor: function(e, t, s) {
|
|
1971
1996
|
const n = this.colors, i = this.object.geometry.colors;
|
|
@@ -1984,16 +2009,16 @@ function to() {
|
|
|
1984
2009
|
this.object.geometry.uvs.push(t[e + 0], t[e + 1]);
|
|
1985
2010
|
},
|
|
1986
2011
|
addFace: function(e, t, s, n, i, o, a, l, c) {
|
|
1987
|
-
const
|
|
1988
|
-
let u = this.parseVertexIndex(e,
|
|
1989
|
-
if (this.addVertex(u, h,
|
|
1990
|
-
const
|
|
1991
|
-
u = this.parseNormalIndex(a,
|
|
2012
|
+
const d = this.vertices.length;
|
|
2013
|
+
let u = this.parseVertexIndex(e, d), h = this.parseVertexIndex(t, d), A = this.parseVertexIndex(s, d);
|
|
2014
|
+
if (this.addVertex(u, h, A), this.addColor(u, h, A), a !== void 0 && a !== "") {
|
|
2015
|
+
const f = this.normals.length;
|
|
2016
|
+
u = this.parseNormalIndex(a, f), h = this.parseNormalIndex(l, f), A = this.parseNormalIndex(c, f), this.addNormal(u, h, A);
|
|
1992
2017
|
} else
|
|
1993
|
-
this.addFaceNormal(u, h,
|
|
2018
|
+
this.addFaceNormal(u, h, A);
|
|
1994
2019
|
if (n !== void 0 && n !== "") {
|
|
1995
|
-
const
|
|
1996
|
-
u = this.parseUVIndex(n,
|
|
2020
|
+
const f = this.uvs.length;
|
|
2021
|
+
u = this.parseUVIndex(n, f), h = this.parseUVIndex(i, f), A = this.parseUVIndex(o, f), this.addUV(u, h, A), this.object.geometry.hasUVIndices = !0;
|
|
1997
2022
|
} else
|
|
1998
2023
|
this.addDefaultUV();
|
|
1999
2024
|
},
|
|
@@ -2071,9 +2096,9 @@ class no extends Yt {
|
|
|
2071
2096
|
for (let a = 0, l = s.length; a < l; a++) {
|
|
2072
2097
|
const c = s[a].trimStart();
|
|
2073
2098
|
if (c.length === 0) continue;
|
|
2074
|
-
const
|
|
2075
|
-
if (
|
|
2076
|
-
if (
|
|
2099
|
+
const d = c.charAt(0);
|
|
2100
|
+
if (d !== "#")
|
|
2101
|
+
if (d === "v") {
|
|
2077
2102
|
const u = c.split(In);
|
|
2078
2103
|
switch (u[0]) {
|
|
2079
2104
|
case "v":
|
|
@@ -2102,43 +2127,43 @@ class no extends Yt {
|
|
|
2102
2127
|
);
|
|
2103
2128
|
break;
|
|
2104
2129
|
}
|
|
2105
|
-
} else if (
|
|
2106
|
-
const h = c.slice(1).trim().split(In),
|
|
2107
|
-
for (let
|
|
2108
|
-
const g = h[
|
|
2130
|
+
} else if (d === "f") {
|
|
2131
|
+
const h = c.slice(1).trim().split(In), A = [];
|
|
2132
|
+
for (let p = 0, m = h.length; p < m; p++) {
|
|
2133
|
+
const g = h[p];
|
|
2109
2134
|
if (g.length > 0) {
|
|
2110
|
-
const
|
|
2111
|
-
|
|
2135
|
+
const y = g.split("/");
|
|
2136
|
+
A.push(y);
|
|
2112
2137
|
}
|
|
2113
2138
|
}
|
|
2114
|
-
const
|
|
2115
|
-
for (let
|
|
2116
|
-
const g =
|
|
2139
|
+
const f = A[0];
|
|
2140
|
+
for (let p = 1, m = A.length - 1; p < m; p++) {
|
|
2141
|
+
const g = A[p], y = A[p + 1];
|
|
2117
2142
|
t.addFace(
|
|
2118
|
-
|
|
2143
|
+
f[0],
|
|
2119
2144
|
g[0],
|
|
2120
|
-
|
|
2121
|
-
|
|
2145
|
+
y[0],
|
|
2146
|
+
f[1],
|
|
2122
2147
|
g[1],
|
|
2123
|
-
|
|
2124
|
-
|
|
2148
|
+
y[1],
|
|
2149
|
+
f[2],
|
|
2125
2150
|
g[2],
|
|
2126
|
-
|
|
2151
|
+
y[2]
|
|
2127
2152
|
);
|
|
2128
2153
|
}
|
|
2129
|
-
} else if (
|
|
2154
|
+
} else if (d === "l") {
|
|
2130
2155
|
const u = c.substring(1).trim().split(" ");
|
|
2131
2156
|
let h = [];
|
|
2132
|
-
const
|
|
2157
|
+
const A = [];
|
|
2133
2158
|
if (c.indexOf("/") === -1)
|
|
2134
2159
|
h = u;
|
|
2135
2160
|
else
|
|
2136
|
-
for (let
|
|
2137
|
-
const
|
|
2138
|
-
|
|
2161
|
+
for (let f = 0, p = u.length; f < p; f++) {
|
|
2162
|
+
const m = u[f].split("/");
|
|
2163
|
+
m[0] !== "" && h.push(m[0]), m[1] !== "" && A.push(m[1]);
|
|
2139
2164
|
}
|
|
2140
|
-
t.addLineGeometry(h,
|
|
2141
|
-
} else if (
|
|
2165
|
+
t.addLineGeometry(h, A);
|
|
2166
|
+
} else if (d === "p") {
|
|
2142
2167
|
const h = c.slice(1).trim().split(" ");
|
|
2143
2168
|
t.addPointGeometry(h);
|
|
2144
2169
|
} else if ((n = Ji.exec(c)) !== null) {
|
|
@@ -2150,7 +2175,7 @@ class no extends Yt {
|
|
|
2150
2175
|
t.materialLibraries.push(c.substring(7).trim());
|
|
2151
2176
|
else if (eo.test(c))
|
|
2152
2177
|
console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');
|
|
2153
|
-
else if (
|
|
2178
|
+
else if (d === "s") {
|
|
2154
2179
|
if (n = c.split(" "), n.length > 1) {
|
|
2155
2180
|
const h = n[1].trim().toLowerCase();
|
|
2156
2181
|
t.object.smooth = h !== "0" && h !== "off";
|
|
@@ -2167,40 +2192,40 @@ class no extends Yt {
|
|
|
2167
2192
|
const i = new ft();
|
|
2168
2193
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
2169
2194
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
2170
|
-
const c = t.objects[a],
|
|
2171
|
-
let
|
|
2172
|
-
if (
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2175
|
-
const
|
|
2176
|
-
for (let
|
|
2177
|
-
const
|
|
2195
|
+
const c = t.objects[a], d = c.geometry, u = c.materials, h = d.type === "Line", A = d.type === "Points";
|
|
2196
|
+
let f = !1;
|
|
2197
|
+
if (d.vertices.length === 0) continue;
|
|
2198
|
+
const p = new We();
|
|
2199
|
+
p.setAttribute("position", new me(d.vertices, 3)), d.normals.length > 0 && p.setAttribute("normal", new me(d.normals, 3)), d.colors.length > 0 && (f = !0, p.setAttribute("color", new me(d.colors, 3))), d.hasUVIndices === !0 && p.setAttribute("uv", new me(d.uvs, 2));
|
|
2200
|
+
const m = [];
|
|
2201
|
+
for (let y = 0, C = u.length; y < C; y++) {
|
|
2202
|
+
const x = u[y], w = x.name + "_" + x.smooth + "_" + f;
|
|
2178
2203
|
let D = t.materials[w];
|
|
2179
2204
|
if (this.materials !== null) {
|
|
2180
|
-
if (D = this.materials.create(
|
|
2205
|
+
if (D = this.materials.create(x.name), h && D && !(D instanceof Ze)) {
|
|
2181
2206
|
const S = new Ze();
|
|
2182
2207
|
Qe.prototype.copy.call(S, D), S.color.copy(D.color), D = S;
|
|
2183
|
-
} else if (
|
|
2208
|
+
} else if (A && D && !(D instanceof Ue)) {
|
|
2184
2209
|
const S = new Ue({ size: 10, sizeAttenuation: !1 });
|
|
2185
2210
|
Qe.prototype.copy.call(S, D), S.color.copy(D.color), S.map = D.map, D = S;
|
|
2186
2211
|
}
|
|
2187
2212
|
}
|
|
2188
|
-
D === void 0 && (h ? D = new Ze() :
|
|
2213
|
+
D === void 0 && (h ? D = new Ze() : A ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = x.name, D.flatShading = !x.smooth, D.vertexColors = f, t.materials[w] = D), m.push(D);
|
|
2189
2214
|
}
|
|
2190
2215
|
let g;
|
|
2191
|
-
if (
|
|
2192
|
-
for (let
|
|
2193
|
-
const
|
|
2194
|
-
|
|
2216
|
+
if (m.length > 1) {
|
|
2217
|
+
for (let y = 0, C = u.length; y < C; y++) {
|
|
2218
|
+
const x = u[y];
|
|
2219
|
+
p.addGroup(x.groupStart, x.groupCount, y);
|
|
2195
2220
|
}
|
|
2196
|
-
h ? g = new Wt(
|
|
2221
|
+
h ? g = new Wt(p, m) : A ? g = new pt(p, m) : g = new v(p, m);
|
|
2197
2222
|
} else
|
|
2198
|
-
h ? g = new Wt(
|
|
2223
|
+
h ? g = new Wt(p, m[0]) : A ? g = new pt(p, m[0]) : g = new v(p, m[0]);
|
|
2199
2224
|
g.name = c.name, i.add(g);
|
|
2200
2225
|
}
|
|
2201
2226
|
else if (t.vertices.length > 0) {
|
|
2202
2227
|
const a = new Ue({ size: 1, sizeAttenuation: !1 }), l = new We();
|
|
2203
|
-
l.setAttribute("position", new
|
|
2228
|
+
l.setAttribute("position", new me(t.vertices, 3)), t.colors.length > 0 && t.colors[0] !== void 0 && (l.setAttribute("color", new me(t.colors, 3)), a.vertexColors = !0);
|
|
2204
2229
|
const c = new pt(l, a);
|
|
2205
2230
|
i.add(c);
|
|
2206
2231
|
}
|
|
@@ -2321,11 +2346,11 @@ class io extends Yt {
|
|
|
2321
2346
|
}, l = new tt(this.manager);
|
|
2322
2347
|
l.setPath(this.path), l.setResponseType("arraybuffer"), l.setRequestHeader(this.requestHeader), l.setWithCredentials(this.withCredentials), l.load(e, function(c) {
|
|
2323
2348
|
try {
|
|
2324
|
-
i.parse(c, o, function(
|
|
2325
|
-
t(
|
|
2349
|
+
i.parse(c, o, function(d) {
|
|
2350
|
+
t(d), i.manager.itemEnd(e);
|
|
2326
2351
|
}, a);
|
|
2327
|
-
} catch (
|
|
2328
|
-
a(
|
|
2352
|
+
} catch (d) {
|
|
2353
|
+
a(d);
|
|
2329
2354
|
}
|
|
2330
2355
|
}, s, a);
|
|
2331
2356
|
}
|
|
@@ -2418,13 +2443,13 @@ class io extends Yt {
|
|
|
2418
2443
|
meshoptDecoder: this.meshoptDecoder
|
|
2419
2444
|
});
|
|
2420
2445
|
c.fileLoader.setRequestHeader(this.requestHeader);
|
|
2421
|
-
for (let
|
|
2422
|
-
const u = this.pluginCallbacks[
|
|
2446
|
+
for (let d = 0; d < this.pluginCallbacks.length; d++) {
|
|
2447
|
+
const u = this.pluginCallbacks[d](c);
|
|
2423
2448
|
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, o[u.name] = !0;
|
|
2424
2449
|
}
|
|
2425
2450
|
if (i.extensionsUsed)
|
|
2426
|
-
for (let
|
|
2427
|
-
const u = i.extensionsUsed[
|
|
2451
|
+
for (let d = 0; d < i.extensionsUsed.length; ++d) {
|
|
2452
|
+
const u = i.extensionsUsed[d], h = i.extensionsRequired || [];
|
|
2428
2453
|
switch (u) {
|
|
2429
2454
|
case O.KHR_MATERIALS_UNLIT:
|
|
2430
2455
|
o[u] = new ao();
|
|
@@ -2522,18 +2547,18 @@ class ro {
|
|
|
2522
2547
|
if (n) return n;
|
|
2523
2548
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
2524
2549
|
let c;
|
|
2525
|
-
const
|
|
2526
|
-
l.color !== void 0 &&
|
|
2550
|
+
const d = new he(16777215);
|
|
2551
|
+
l.color !== void 0 && d.setRGB(l.color[0], l.color[1], l.color[2], ae);
|
|
2527
2552
|
const u = l.range !== void 0 ? l.range : 0;
|
|
2528
2553
|
switch (l.type) {
|
|
2529
2554
|
case "directional":
|
|
2530
|
-
c = new Is(
|
|
2555
|
+
c = new Is(d), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
2531
2556
|
break;
|
|
2532
2557
|
case "point":
|
|
2533
|
-
c = new bs(
|
|
2558
|
+
c = new bs(d), c.distance = u;
|
|
2534
2559
|
break;
|
|
2535
2560
|
case "spot":
|
|
2536
|
-
c = new gs(
|
|
2561
|
+
c = new gs(d), c.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
2537
2562
|
break;
|
|
2538
2563
|
default:
|
|
2539
2564
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -2560,7 +2585,7 @@ class ao {
|
|
|
2560
2585
|
}
|
|
2561
2586
|
extendParams(e, t, s) {
|
|
2562
2587
|
const n = [];
|
|
2563
|
-
e.color = new
|
|
2588
|
+
e.color = new he(1, 1, 1), e.opacity = 1;
|
|
2564
2589
|
const i = t.pbrMetallicRoughness;
|
|
2565
2590
|
if (i) {
|
|
2566
2591
|
if (Array.isArray(i.baseColorFactor)) {
|
|
@@ -2636,7 +2661,7 @@ class ho {
|
|
|
2636
2661
|
const s = z(this.parser, e, this.name);
|
|
2637
2662
|
if (s === null) return Promise.resolve();
|
|
2638
2663
|
const n = [];
|
|
2639
|
-
if (t.sheenColor = new
|
|
2664
|
+
if (t.sheenColor = new he(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, s.sheenColorFactor !== void 0) {
|
|
2640
2665
|
const i = s.sheenColorFactor;
|
|
2641
2666
|
t.sheenColor.setRGB(i[0], i[1], i[2], ae);
|
|
2642
2667
|
}
|
|
@@ -2670,7 +2695,7 @@ class po {
|
|
|
2670
2695
|
const n = [];
|
|
2671
2696
|
t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && n.push(this.parser.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
|
|
2672
2697
|
const i = s.attenuationColor || [1, 1, 1];
|
|
2673
|
-
return t.attenuationColor = new
|
|
2698
|
+
return t.attenuationColor = new he().setRGB(i[0], i[1], i[2], ae), Promise.all(n);
|
|
2674
2699
|
}
|
|
2675
2700
|
}
|
|
2676
2701
|
class mo {
|
|
@@ -2698,7 +2723,7 @@ class go {
|
|
|
2698
2723
|
const n = [];
|
|
2699
2724
|
t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularIntensityMap", s.specularTexture));
|
|
2700
2725
|
const i = s.specularColorFactor || [1, 1, 1];
|
|
2701
|
-
return t.specularColor = new
|
|
2726
|
+
return t.specularColor = new he().setRGB(i[0], i[1], i[2], ae), s.specularColorTexture !== void 0 && n.push(this.parser.assignTexture(t, "specularColorMap", s.specularColorTexture, Ae)), Promise.all(n);
|
|
2702
2727
|
}
|
|
2703
2728
|
}
|
|
2704
2729
|
class bo {
|
|
@@ -2794,12 +2819,12 @@ class vn {
|
|
|
2794
2819
|
return null;
|
|
2795
2820
|
}
|
|
2796
2821
|
return i.then(function(a) {
|
|
2797
|
-
const l = n.byteOffset || 0, c = n.byteLength || 0,
|
|
2798
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(
|
|
2799
|
-
return
|
|
2822
|
+
const l = n.byteOffset || 0, c = n.byteLength || 0, d = n.count, u = n.byteStride, h = new Uint8Array(a, l, c);
|
|
2823
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, h, n.mode, n.filter).then(function(A) {
|
|
2824
|
+
return A.buffer;
|
|
2800
2825
|
}) : o.ready.then(function() {
|
|
2801
|
-
const
|
|
2802
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
2826
|
+
const A = new ArrayBuffer(d * u);
|
|
2827
|
+
return o.decodeGltfBuffer(new Uint8Array(A), d, u, h, n.mode, n.filter), A;
|
|
2803
2828
|
});
|
|
2804
2829
|
});
|
|
2805
2830
|
} else
|
|
@@ -2816,25 +2841,25 @@ class wo {
|
|
|
2816
2841
|
return null;
|
|
2817
2842
|
const n = t.meshes[s.mesh];
|
|
2818
2843
|
for (const c of n.primitives)
|
|
2819
|
-
if (c.mode !==
|
|
2844
|
+
if (c.mode !== ne.TRIANGLES && c.mode !== ne.TRIANGLE_STRIP && c.mode !== ne.TRIANGLE_FAN && c.mode !== void 0)
|
|
2820
2845
|
return null;
|
|
2821
2846
|
const o = s.extensions[this.name].attributes, a = [], l = {};
|
|
2822
2847
|
for (const c in o)
|
|
2823
|
-
a.push(this.parser.getDependency("accessor", o[c]).then((
|
|
2848
|
+
a.push(this.parser.getDependency("accessor", o[c]).then((d) => (l[c] = d, l[c])));
|
|
2824
2849
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
2825
|
-
const
|
|
2826
|
-
for (const
|
|
2827
|
-
const
|
|
2828
|
-
for (let
|
|
2829
|
-
l.TRANSLATION &&
|
|
2830
|
-
for (const
|
|
2831
|
-
if (
|
|
2832
|
-
const w = l[
|
|
2850
|
+
const d = c.pop(), u = d.isGroup ? d.children : [d], h = c[0].count, A = [];
|
|
2851
|
+
for (const f of u) {
|
|
2852
|
+
const p = new ge(), m = new M(), g = new K(), y = new M(1, 1, 1), C = new ys(f.geometry, f.material, h);
|
|
2853
|
+
for (let x = 0; x < h; x++)
|
|
2854
|
+
l.TRANSLATION && m.fromBufferAttribute(l.TRANSLATION, x), l.ROTATION && g.fromBufferAttribute(l.ROTATION, x), l.SCALE && y.fromBufferAttribute(l.SCALE, x), C.setMatrixAt(x, p.compose(m, g, y));
|
|
2855
|
+
for (const x in l)
|
|
2856
|
+
if (x === "_COLOR_0") {
|
|
2857
|
+
const w = l[x];
|
|
2833
2858
|
C.instanceColor = new Cs(w.array, w.itemSize, w.normalized);
|
|
2834
|
-
} else
|
|
2835
|
-
ke.prototype.copy.call(C,
|
|
2859
|
+
} else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && f.geometry.setAttribute(x, l[x]);
|
|
2860
|
+
ke.prototype.copy.call(C, f), this.parser.assignFinalMaterial(C), A.push(C);
|
|
2836
2861
|
}
|
|
2837
|
-
return
|
|
2862
|
+
return d.isGroup ? (d.clear(), d.add(...A), d) : A[0];
|
|
2838
2863
|
}));
|
|
2839
2864
|
}
|
|
2840
2865
|
}
|
|
@@ -2878,25 +2903,25 @@ class Mo {
|
|
|
2878
2903
|
}
|
|
2879
2904
|
decodePrimitive(e, t) {
|
|
2880
2905
|
const s = this.json, n = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
|
|
2881
|
-
for (const
|
|
2882
|
-
const u = Ut[
|
|
2883
|
-
a[u] = o[
|
|
2906
|
+
for (const d in o) {
|
|
2907
|
+
const u = Ut[d] || d.toLowerCase();
|
|
2908
|
+
a[u] = o[d];
|
|
2884
2909
|
}
|
|
2885
|
-
for (const
|
|
2886
|
-
const u = Ut[
|
|
2887
|
-
if (o[
|
|
2888
|
-
const h = s.accessors[e.attributes[
|
|
2889
|
-
c[u] =
|
|
2910
|
+
for (const d in e.attributes) {
|
|
2911
|
+
const u = Ut[d] || d.toLowerCase();
|
|
2912
|
+
if (o[d] !== void 0) {
|
|
2913
|
+
const h = s.accessors[e.attributes[d]], A = je[h.componentType];
|
|
2914
|
+
c[u] = A.name, l[u] = h.normalized === !0;
|
|
2890
2915
|
}
|
|
2891
2916
|
}
|
|
2892
|
-
return t.getDependency("bufferView", i).then(function(
|
|
2917
|
+
return t.getDependency("bufferView", i).then(function(d) {
|
|
2893
2918
|
return new Promise(function(u, h) {
|
|
2894
|
-
n.decodeDracoFile(
|
|
2895
|
-
for (const
|
|
2896
|
-
const
|
|
2897
|
-
|
|
2919
|
+
n.decodeDracoFile(d, function(A) {
|
|
2920
|
+
for (const f in A.attributes) {
|
|
2921
|
+
const p = A.attributes[f], m = l[f];
|
|
2922
|
+
m !== void 0 && (p.normalized = m);
|
|
2898
2923
|
}
|
|
2899
|
-
u(
|
|
2924
|
+
u(A);
|
|
2900
2925
|
}, a, c, ae, h);
|
|
2901
2926
|
});
|
|
2902
2927
|
});
|
|
@@ -2926,10 +2951,10 @@ class Zn extends zs {
|
|
|
2926
2951
|
return t;
|
|
2927
2952
|
}
|
|
2928
2953
|
interpolate_(e, t, s, n) {
|
|
2929
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3,
|
|
2930
|
-
for (let
|
|
2931
|
-
const w = o[
|
|
2932
|
-
i[
|
|
2954
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = n - t, u = (s - t) / d, h = u * u, A = h * u, f = e * c, p = f - c, m = -2 * A + 3 * h, g = A - h, y = 1 - m, C = g - h + u;
|
|
2955
|
+
for (let x = 0; x !== a; x++) {
|
|
2956
|
+
const w = o[p + x + a], D = o[p + x + l] * d, S = o[f + x + a], Z = o[f + x] * d;
|
|
2957
|
+
i[x] = y * w + C * D + m * S + g * Z;
|
|
2933
2958
|
}
|
|
2934
2959
|
return i;
|
|
2935
2960
|
}
|
|
@@ -2941,7 +2966,7 @@ class Oo extends Zn {
|
|
|
2941
2966
|
return To.fromArray(i).normalize().toArray(i), i;
|
|
2942
2967
|
}
|
|
2943
2968
|
}
|
|
2944
|
-
const
|
|
2969
|
+
const ne = {
|
|
2945
2970
|
POINTS: 0,
|
|
2946
2971
|
LINES: 1,
|
|
2947
2972
|
LINE_LOOP: 2,
|
|
@@ -2986,7 +3011,7 @@ const te = {
|
|
|
2986
3011
|
COLOR_0: "color",
|
|
2987
3012
|
WEIGHTS_0: "skinWeight",
|
|
2988
3013
|
JOINTS_0: "skinIndex"
|
|
2989
|
-
},
|
|
3014
|
+
}, pe = {
|
|
2990
3015
|
scale: "scale",
|
|
2991
3016
|
translation: "position",
|
|
2992
3017
|
rotation: "quaternion",
|
|
@@ -3013,7 +3038,7 @@ function Ro(r) {
|
|
|
3013
3038
|
side: Ws
|
|
3014
3039
|
})), r.DefaultMaterial;
|
|
3015
3040
|
}
|
|
3016
|
-
function
|
|
3041
|
+
function we(r, e, t) {
|
|
3017
3042
|
for (const s in t.extensions)
|
|
3018
3043
|
r[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
|
|
3019
3044
|
}
|
|
@@ -3022,13 +3047,13 @@ function re(r, e) {
|
|
|
3022
3047
|
}
|
|
3023
3048
|
function So(r, e, t) {
|
|
3024
3049
|
let s = !1, n = !1, i = !1;
|
|
3025
|
-
for (let c = 0,
|
|
3050
|
+
for (let c = 0, d = e.length; c < d; c++) {
|
|
3026
3051
|
const u = e[c];
|
|
3027
3052
|
if (u.POSITION !== void 0 && (s = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (i = !0), s && n && i) break;
|
|
3028
3053
|
}
|
|
3029
3054
|
if (!s && !n && !i) return Promise.resolve(r);
|
|
3030
3055
|
const o = [], a = [], l = [];
|
|
3031
|
-
for (let c = 0,
|
|
3056
|
+
for (let c = 0, d = e.length; c < d; c++) {
|
|
3032
3057
|
const u = e[c];
|
|
3033
3058
|
if (s) {
|
|
3034
3059
|
const h = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : r.attributes.position;
|
|
@@ -3048,8 +3073,8 @@ function So(r, e, t) {
|
|
|
3048
3073
|
Promise.all(a),
|
|
3049
3074
|
Promise.all(l)
|
|
3050
3075
|
]).then(function(c) {
|
|
3051
|
-
const
|
|
3052
|
-
return s && (r.morphAttributes.position =
|
|
3076
|
+
const d = c[0], u = c[1], h = c[2];
|
|
3077
|
+
return s && (r.morphAttributes.position = d), n && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
|
|
3053
3078
|
});
|
|
3054
3079
|
}
|
|
3055
3080
|
function Ho(r, e) {
|
|
@@ -3098,7 +3123,7 @@ function Vt(r) {
|
|
|
3098
3123
|
function No(r) {
|
|
3099
3124
|
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";
|
|
3100
3125
|
}
|
|
3101
|
-
const jo = new
|
|
3126
|
+
const jo = new ge();
|
|
3102
3127
|
class ko {
|
|
3103
3128
|
constructor(e = {}, t = {}) {
|
|
3104
3129
|
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new oo(), 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 = {};
|
|
@@ -3139,7 +3164,7 @@ class ko {
|
|
|
3139
3164
|
parser: s,
|
|
3140
3165
|
userData: {}
|
|
3141
3166
|
};
|
|
3142
|
-
return
|
|
3167
|
+
return we(i, a, n), re(a, n), Promise.all(s._invokeAll(function(l) {
|
|
3143
3168
|
return l.afterRoot && l.afterRoot(a);
|
|
3144
3169
|
})).then(function() {
|
|
3145
3170
|
for (const l of a.scenes)
|
|
@@ -3195,8 +3220,8 @@ class ko {
|
|
|
3195
3220
|
const n = s.clone(), i = (o, a) => {
|
|
3196
3221
|
const l = this.associations.get(o);
|
|
3197
3222
|
l != null && this.associations.set(a, l);
|
|
3198
|
-
for (const [c,
|
|
3199
|
-
i(
|
|
3223
|
+
for (const [c, d] of o.children.entries())
|
|
3224
|
+
i(d, a.children[c]);
|
|
3200
3225
|
};
|
|
3201
3226
|
return i(s, n), n.name += "_instance_" + e.uses[t]++, n;
|
|
3202
3227
|
}
|
|
@@ -3354,24 +3379,24 @@ class ko {
|
|
|
3354
3379
|
}
|
|
3355
3380
|
const i = [];
|
|
3356
3381
|
return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
3357
|
-
const a = o[0], l = St[n.type], c = je[n.componentType],
|
|
3358
|
-
let
|
|
3359
|
-
if (
|
|
3360
|
-
const g = Math.floor(h /
|
|
3361
|
-
let C = t.cache.get(
|
|
3362
|
-
C || (
|
|
3382
|
+
const a = o[0], l = St[n.type], c = je[n.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, h = n.byteOffset || 0, A = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, f = n.normalized === !0;
|
|
3383
|
+
let p, m;
|
|
3384
|
+
if (A && A !== u) {
|
|
3385
|
+
const g = Math.floor(h / A), y = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
|
|
3386
|
+
let C = t.cache.get(y);
|
|
3387
|
+
C || (p = new c(a, g * A, n.count * A / d), C = new Hn(p, A / d), t.cache.add(y, C)), m = new Ln(C, l, h % A / d, f);
|
|
3363
3388
|
} else
|
|
3364
|
-
a === null ?
|
|
3389
|
+
a === null ? p = new c(n.count * l) : p = new c(a, h, n.count * l), m = new _e(p, l, f);
|
|
3365
3390
|
if (n.sparse !== void 0) {
|
|
3366
|
-
const g = St.SCALAR,
|
|
3367
|
-
a !== null && (
|
|
3391
|
+
const g = St.SCALAR, y = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, x = n.sparse.values.byteOffset || 0, w = new y(o[1], C, n.sparse.count * g), D = new c(o[2], x, n.sparse.count * l);
|
|
3392
|
+
a !== null && (m = new _e(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
3368
3393
|
for (let S = 0, Z = w.length; S < Z; S++) {
|
|
3369
|
-
const
|
|
3370
|
-
if (
|
|
3394
|
+
const $ = w[S];
|
|
3395
|
+
if (m.setX($, D[S * l]), l >= 2 && m.setY($, D[S * l + 1]), l >= 3 && m.setZ($, D[S * l + 2]), l >= 4 && m.setW($, D[S * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
3371
3396
|
}
|
|
3372
|
-
|
|
3397
|
+
m.normalized = f;
|
|
3373
3398
|
}
|
|
3374
|
-
return
|
|
3399
|
+
return m;
|
|
3375
3400
|
});
|
|
3376
3401
|
}
|
|
3377
3402
|
/**
|
|
@@ -3394,10 +3419,10 @@ class ko {
|
|
|
3394
3419
|
const n = this, i = this.json, o = i.textures[e], a = i.images[t], l = (a.uri || a.bufferView) + ":" + o.sampler;
|
|
3395
3420
|
if (this.textureCache[l])
|
|
3396
3421
|
return this.textureCache[l];
|
|
3397
|
-
const c = this.loadImageSource(t, s).then(function(
|
|
3398
|
-
|
|
3422
|
+
const c = this.loadImageSource(t, s).then(function(d) {
|
|
3423
|
+
d.flipY = !1, d.name = o.name || a.name || "", d.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (d.name = a.uri);
|
|
3399
3424
|
const h = (i.samplers || {})[o.sampler] || {};
|
|
3400
|
-
return
|
|
3425
|
+
return d.magFilter = Dn[h.magFilter] || Gt, d.minFilter = Dn[h.minFilter] || Nn, d.wrapS = Pn[h.wrapS] || Ft, d.wrapT = Pn[h.wrapT] || Ft, d.generateMipmaps = !d.isCompressedTexture && d.minFilter !== jn && d.minFilter !== Gt, n.associations.set(d, { textures: e }), d;
|
|
3401
3426
|
}).catch(function() {
|
|
3402
3427
|
return null;
|
|
3403
3428
|
});
|
|
@@ -3417,20 +3442,20 @@ class ko {
|
|
|
3417
3442
|
});
|
|
3418
3443
|
else if (o.uri === void 0)
|
|
3419
3444
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
3420
|
-
const
|
|
3421
|
-
return new Promise(function(h,
|
|
3422
|
-
let
|
|
3423
|
-
t.isImageBitmapLoader === !0 && (
|
|
3424
|
-
const
|
|
3425
|
-
|
|
3426
|
-
}), t.load(Je.resolveURL(u, i.path),
|
|
3445
|
+
const d = Promise.resolve(l).then(function(u) {
|
|
3446
|
+
return new Promise(function(h, A) {
|
|
3447
|
+
let f = h;
|
|
3448
|
+
t.isImageBitmapLoader === !0 && (f = function(p) {
|
|
3449
|
+
const m = new tn(p);
|
|
3450
|
+
m.needsUpdate = !0, h(m);
|
|
3451
|
+
}), t.load(Je.resolveURL(u, i.path), f, void 0, A);
|
|
3427
3452
|
});
|
|
3428
3453
|
}).then(function(u) {
|
|
3429
3454
|
return c === !0 && a.revokeObjectURL(l), re(u, o), u.userData.mimeType = o.mimeType || No(o.uri), u;
|
|
3430
3455
|
}).catch(function(u) {
|
|
3431
3456
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
|
|
3432
3457
|
});
|
|
3433
|
-
return this.sourceCache[e] =
|
|
3458
|
+
return this.sourceCache[e] = d, d;
|
|
3434
3459
|
}
|
|
3435
3460
|
/**
|
|
3436
3461
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -3506,7 +3531,7 @@ class ko {
|
|
|
3506
3531
|
o = u.getMaterialType(), c.push(u.extendParams(a, i, t));
|
|
3507
3532
|
} else {
|
|
3508
3533
|
const u = i.pbrMetallicRoughness || {};
|
|
3509
|
-
if (a.color = new
|
|
3534
|
+
if (a.color = new he(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
3510
3535
|
const h = u.baseColorFactor;
|
|
3511
3536
|
a.color.setRGB(h[0], h[1], h[2], ae), a.opacity = h[3];
|
|
3512
3537
|
}
|
|
@@ -3517,18 +3542,18 @@ class ko {
|
|
|
3517
3542
|
})));
|
|
3518
3543
|
}
|
|
3519
3544
|
i.doubleSided === !0 && (a.side = Rn);
|
|
3520
|
-
const
|
|
3521
|
-
if (
|
|
3545
|
+
const d = i.alphaMode || Ht.OPAQUE;
|
|
3546
|
+
if (d === Ht.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === Ht.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new Y(1, 1), i.normalTexture.scale !== void 0)) {
|
|
3522
3547
|
const u = i.normalTexture.scale;
|
|
3523
3548
|
a.normalScale.set(u, u);
|
|
3524
3549
|
}
|
|
3525
3550
|
if (i.occlusionTexture !== void 0 && o !== Pe && (c.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== Pe) {
|
|
3526
3551
|
const u = i.emissiveFactor;
|
|
3527
|
-
a.emissive = new
|
|
3552
|
+
a.emissive = new he().setRGB(u[0], u[1], u[2], ae);
|
|
3528
3553
|
}
|
|
3529
3554
|
return i.emissiveTexture !== void 0 && o !== Pe && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Ae)), Promise.all(c).then(function() {
|
|
3530
3555
|
const u = new o(a);
|
|
3531
|
-
return i.name && (u.name = i.name), re(u, i), t.associations.set(u, { materials: e }), i.extensions &&
|
|
3556
|
+
return i.name && (u.name = i.name), re(u, i), t.associations.set(u, { materials: e }), i.extensions && we(n, u, i), u;
|
|
3532
3557
|
});
|
|
3533
3558
|
}
|
|
3534
3559
|
/**
|
|
@@ -3560,12 +3585,12 @@ class ko {
|
|
|
3560
3585
|
}
|
|
3561
3586
|
const o = [];
|
|
3562
3587
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
3563
|
-
const c = e[a],
|
|
3588
|
+
const c = e[a], d = Lo(c), u = n[d];
|
|
3564
3589
|
if (u)
|
|
3565
3590
|
o.push(u.promise);
|
|
3566
3591
|
else {
|
|
3567
3592
|
let h;
|
|
3568
|
-
c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h = Tn(new We(), c, t), n[
|
|
3593
|
+
c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h = Tn(new We(), c, t), n[d] = { primitive: c, promise: h }, o.push(h);
|
|
3569
3594
|
}
|
|
3570
3595
|
}
|
|
3571
3596
|
return Promise.all(o);
|
|
@@ -3580,40 +3605,40 @@ class ko {
|
|
|
3580
3605
|
loadMesh(e) {
|
|
3581
3606
|
const t = this, s = this.json, n = this.extensions, i = s.meshes[e], o = i.primitives, a = [];
|
|
3582
3607
|
for (let l = 0, c = o.length; l < c; l++) {
|
|
3583
|
-
const
|
|
3584
|
-
a.push(
|
|
3608
|
+
const d = o[l].material === void 0 ? Ro(this.cache) : this.getDependency("material", o[l].material);
|
|
3609
|
+
a.push(d);
|
|
3585
3610
|
}
|
|
3586
3611
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
3587
|
-
const c = l.slice(0, l.length - 1),
|
|
3588
|
-
for (let
|
|
3589
|
-
const
|
|
3612
|
+
const c = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
|
|
3613
|
+
for (let A = 0, f = d.length; A < f; A++) {
|
|
3614
|
+
const p = d[A], m = o[A];
|
|
3590
3615
|
let g;
|
|
3591
|
-
const
|
|
3592
|
-
if (
|
|
3593
|
-
g = i.isSkinnedMesh === !0 ? new Es(
|
|
3594
|
-
else if (
|
|
3595
|
-
g = new Wt(
|
|
3596
|
-
else if (
|
|
3597
|
-
g = new ue(
|
|
3598
|
-
else if (
|
|
3599
|
-
g = new Rs(
|
|
3600
|
-
else if (
|
|
3601
|
-
g = new pt(
|
|
3616
|
+
const y = c[A];
|
|
3617
|
+
if (m.mode === ne.TRIANGLES || m.mode === ne.TRIANGLE_STRIP || m.mode === ne.TRIANGLE_FAN || m.mode === void 0)
|
|
3618
|
+
g = i.isSkinnedMesh === !0 ? new Es(p, y) : new v(p, y), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), m.mode === ne.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Sn) : m.mode === ne.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
|
|
3619
|
+
else if (m.mode === ne.LINES)
|
|
3620
|
+
g = new Wt(p, y);
|
|
3621
|
+
else if (m.mode === ne.LINE_STRIP)
|
|
3622
|
+
g = new ue(p, y);
|
|
3623
|
+
else if (m.mode === ne.LINE_LOOP)
|
|
3624
|
+
g = new Rs(p, y);
|
|
3625
|
+
else if (m.mode === ne.POINTS)
|
|
3626
|
+
g = new pt(p, y);
|
|
3602
3627
|
else
|
|
3603
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
3604
|
-
Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i),
|
|
3628
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
3629
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && Ho(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), m.extensions && we(n, g, m), t.assignFinalMaterial(g), u.push(g);
|
|
3605
3630
|
}
|
|
3606
|
-
for (let
|
|
3607
|
-
t.associations.set(u[
|
|
3631
|
+
for (let A = 0, f = u.length; A < f; A++)
|
|
3632
|
+
t.associations.set(u[A], {
|
|
3608
3633
|
meshes: e,
|
|
3609
|
-
primitives:
|
|
3634
|
+
primitives: A
|
|
3610
3635
|
});
|
|
3611
3636
|
if (u.length === 1)
|
|
3612
|
-
return i.extensions &&
|
|
3637
|
+
return i.extensions && we(n, u[0], i), u[0];
|
|
3613
3638
|
const h = new ft();
|
|
3614
|
-
i.extensions &&
|
|
3615
|
-
for (let
|
|
3616
|
-
h.add(u[
|
|
3639
|
+
i.extensions && we(n, h, i), t.associations.set(h, { meshes: e });
|
|
3640
|
+
for (let A = 0, f = u.length; A < f; A++)
|
|
3641
|
+
h.add(u[A]);
|
|
3617
3642
|
return h;
|
|
3618
3643
|
});
|
|
3619
3644
|
}
|
|
@@ -3646,11 +3671,11 @@ class ko {
|
|
|
3646
3671
|
s.push(this._loadNodeShallow(t.joints[n]));
|
|
3647
3672
|
return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
|
|
3648
3673
|
const i = n.pop(), o = n, a = [], l = [];
|
|
3649
|
-
for (let c = 0,
|
|
3674
|
+
for (let c = 0, d = o.length; c < d; c++) {
|
|
3650
3675
|
const u = o[c];
|
|
3651
3676
|
if (u) {
|
|
3652
3677
|
a.push(u);
|
|
3653
|
-
const h = new
|
|
3678
|
+
const h = new ge();
|
|
3654
3679
|
i !== null && h.fromArray(i.array, c * 16), l.push(h);
|
|
3655
3680
|
} else
|
|
3656
3681
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
|
|
@@ -3666,30 +3691,30 @@ class ko {
|
|
|
3666
3691
|
* @return {Promise<AnimationClip>}
|
|
3667
3692
|
*/
|
|
3668
3693
|
loadAnimation(e) {
|
|
3669
|
-
const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [],
|
|
3694
|
+
const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
|
|
3670
3695
|
for (let u = 0, h = n.channels.length; u < h; u++) {
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3696
|
+
const A = n.channels[u], f = n.samplers[A.sampler], p = A.target, m = p.node, g = n.parameters !== void 0 ? n.parameters[f.input] : f.input, y = n.parameters !== void 0 ? n.parameters[f.output] : f.output;
|
|
3697
|
+
p.node !== void 0 && (o.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", y)), c.push(f), d.push(p));
|
|
3673
3698
|
}
|
|
3674
3699
|
return Promise.all([
|
|
3675
3700
|
Promise.all(o),
|
|
3676
3701
|
Promise.all(a),
|
|
3677
3702
|
Promise.all(l),
|
|
3678
3703
|
Promise.all(c),
|
|
3679
|
-
Promise.all(
|
|
3704
|
+
Promise.all(d)
|
|
3680
3705
|
]).then(function(u) {
|
|
3681
|
-
const h = u[0],
|
|
3682
|
-
for (let C = 0,
|
|
3683
|
-
const w = h[C], D =
|
|
3706
|
+
const h = u[0], A = u[1], f = u[2], p = u[3], m = u[4], g = [];
|
|
3707
|
+
for (let C = 0, x = h.length; C < x; C++) {
|
|
3708
|
+
const w = h[C], D = A[C], S = f[C], Z = p[C], $ = m[C];
|
|
3684
3709
|
if (w === void 0) continue;
|
|
3685
3710
|
w.updateMatrix && w.updateMatrix();
|
|
3686
|
-
const Q = s._createAnimationTracks(w, D, S, Z,
|
|
3711
|
+
const Q = s._createAnimationTracks(w, D, S, Z, $);
|
|
3687
3712
|
if (Q)
|
|
3688
|
-
for (let
|
|
3689
|
-
g.push(Q[
|
|
3713
|
+
for (let Ce = 0; Ce < Q.length; Ce++)
|
|
3714
|
+
g.push(Q[Ce]);
|
|
3690
3715
|
}
|
|
3691
|
-
const
|
|
3692
|
-
return re(
|
|
3716
|
+
const y = new Ns(i, void 0, g);
|
|
3717
|
+
return re(y, n), y;
|
|
3693
3718
|
});
|
|
3694
3719
|
}
|
|
3695
3720
|
createNodeMesh(e) {
|
|
@@ -3712,7 +3737,7 @@ class ko {
|
|
|
3712
3737
|
*/
|
|
3713
3738
|
loadNode(e) {
|
|
3714
3739
|
const t = this.json, s = this, n = t.nodes[e], i = s._loadNodeShallow(e), o = [], a = n.children || [];
|
|
3715
|
-
for (let c = 0,
|
|
3740
|
+
for (let c = 0, d = a.length; c < d; c++)
|
|
3716
3741
|
o.push(s.getDependency("node", a[c]));
|
|
3717
3742
|
const l = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
|
|
3718
3743
|
return Promise.all([
|
|
@@ -3720,17 +3745,17 @@ class ko {
|
|
|
3720
3745
|
Promise.all(o),
|
|
3721
3746
|
l
|
|
3722
3747
|
]).then(function(c) {
|
|
3723
|
-
const
|
|
3724
|
-
h !== null &&
|
|
3725
|
-
|
|
3748
|
+
const d = c[0], u = c[1], h = c[2];
|
|
3749
|
+
h !== null && d.traverse(function(A) {
|
|
3750
|
+
A.isSkinnedMesh && A.bind(h, jo);
|
|
3726
3751
|
});
|
|
3727
|
-
for (let
|
|
3728
|
-
|
|
3729
|
-
if (
|
|
3730
|
-
const
|
|
3731
|
-
|
|
3752
|
+
for (let A = 0, f = u.length; A < f; A++)
|
|
3753
|
+
d.add(u[A]);
|
|
3754
|
+
if (d.userData.pivot !== void 0 && u.length > 0) {
|
|
3755
|
+
const A = d.userData.pivot, f = u[0];
|
|
3756
|
+
d.pivot = new M().fromArray(A), d.position.x -= A[0], d.position.y -= A[1], d.position.z -= A[2], f.position.set(0, 0, 0), delete d.userData.pivot;
|
|
3732
3757
|
}
|
|
3733
|
-
return
|
|
3758
|
+
return d;
|
|
3734
3759
|
});
|
|
3735
3760
|
}
|
|
3736
3761
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -3749,22 +3774,22 @@ class ko {
|
|
|
3749
3774
|
}).forEach(function(c) {
|
|
3750
3775
|
a.push(c);
|
|
3751
3776
|
}), this.nodeCache[e] = Promise.all(a).then(function(c) {
|
|
3752
|
-
let
|
|
3753
|
-
if (i.isBone === !0 ?
|
|
3777
|
+
let d;
|
|
3778
|
+
if (i.isBone === !0 ? d = new js() : c.length > 1 ? d = new ft() : c.length === 1 ? d = c[0] : d = new ke(), d !== c[0])
|
|
3754
3779
|
for (let u = 0, h = c.length; u < h; u++)
|
|
3755
|
-
|
|
3756
|
-
if (i.name && (
|
|
3757
|
-
const u = new
|
|
3758
|
-
u.fromArray(i.matrix),
|
|
3780
|
+
d.add(c[u]);
|
|
3781
|
+
if (i.name && (d.userData.name = i.name, d.name = o), re(d, i), i.extensions && we(s, d, i), i.matrix !== void 0) {
|
|
3782
|
+
const u = new ge();
|
|
3783
|
+
u.fromArray(i.matrix), d.applyMatrix4(u);
|
|
3759
3784
|
} else
|
|
3760
|
-
i.translation !== void 0 &&
|
|
3761
|
-
if (!n.associations.has(
|
|
3762
|
-
n.associations.set(
|
|
3785
|
+
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);
|
|
3786
|
+
if (!n.associations.has(d))
|
|
3787
|
+
n.associations.set(d, {});
|
|
3763
3788
|
else if (i.mesh !== void 0 && n.meshCache.refs[i.mesh] > 1) {
|
|
3764
|
-
const u = n.associations.get(
|
|
3765
|
-
n.associations.set(
|
|
3789
|
+
const u = n.associations.get(d);
|
|
3790
|
+
n.associations.set(d, { ...u });
|
|
3766
3791
|
}
|
|
3767
|
-
return n.associations.get(
|
|
3792
|
+
return n.associations.get(d).nodes = e, d;
|
|
3768
3793
|
}), this.nodeCache[e];
|
|
3769
3794
|
}
|
|
3770
3795
|
/**
|
|
@@ -3776,22 +3801,22 @@ class ko {
|
|
|
3776
3801
|
*/
|
|
3777
3802
|
loadScene(e) {
|
|
3778
3803
|
const t = this.extensions, s = this.json.scenes[e], n = this, i = new ft();
|
|
3779
|
-
s.name && (i.name = n.createUniqueName(s.name)), re(i, s), s.extensions &&
|
|
3804
|
+
s.name && (i.name = n.createUniqueName(s.name)), re(i, s), s.extensions && we(t, i, s);
|
|
3780
3805
|
const o = s.nodes || [], a = [];
|
|
3781
3806
|
for (let l = 0, c = o.length; l < c; l++)
|
|
3782
3807
|
a.push(n.getDependency("node", o[l]));
|
|
3783
3808
|
return Promise.all(a).then(function(l) {
|
|
3784
|
-
for (let
|
|
3785
|
-
const h = l[
|
|
3809
|
+
for (let d = 0, u = l.length; d < u; d++) {
|
|
3810
|
+
const h = l[d];
|
|
3786
3811
|
h.parent !== null ? i.add(so(h)) : i.add(h);
|
|
3787
3812
|
}
|
|
3788
|
-
const c = (
|
|
3813
|
+
const c = (d) => {
|
|
3789
3814
|
const u = /* @__PURE__ */ new Map();
|
|
3790
|
-
for (const [h,
|
|
3791
|
-
(h instanceof Qe || h instanceof tn) && u.set(h,
|
|
3792
|
-
return
|
|
3793
|
-
const
|
|
3794
|
-
|
|
3815
|
+
for (const [h, A] of n.associations)
|
|
3816
|
+
(h instanceof Qe || h instanceof tn) && u.set(h, A);
|
|
3817
|
+
return d.traverse((h) => {
|
|
3818
|
+
const A = n.associations.get(h);
|
|
3819
|
+
A != null && u.set(h, A);
|
|
3795
3820
|
}), u;
|
|
3796
3821
|
};
|
|
3797
3822
|
return n.associations = c(i), i;
|
|
@@ -3799,44 +3824,44 @@ class ko {
|
|
|
3799
3824
|
}
|
|
3800
3825
|
_createAnimationTracks(e, t, s, n, i) {
|
|
3801
3826
|
const o = [], a = e.name ? e.name : e.uuid, l = [];
|
|
3802
|
-
function c(
|
|
3803
|
-
|
|
3827
|
+
function c(A) {
|
|
3828
|
+
A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
|
|
3804
3829
|
}
|
|
3805
|
-
|
|
3806
|
-
let
|
|
3807
|
-
switch (
|
|
3808
|
-
case
|
|
3809
|
-
|
|
3830
|
+
pe[i.path] === pe.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
|
|
3831
|
+
let d;
|
|
3832
|
+
switch (pe[i.path]) {
|
|
3833
|
+
case pe.weights:
|
|
3834
|
+
d = sn;
|
|
3810
3835
|
break;
|
|
3811
|
-
case
|
|
3812
|
-
|
|
3836
|
+
case pe.rotation:
|
|
3837
|
+
d = on;
|
|
3813
3838
|
break;
|
|
3814
|
-
case
|
|
3815
|
-
case
|
|
3816
|
-
|
|
3839
|
+
case pe.translation:
|
|
3840
|
+
case pe.scale:
|
|
3841
|
+
d = nn;
|
|
3817
3842
|
break;
|
|
3818
3843
|
default:
|
|
3819
3844
|
switch (s.itemSize) {
|
|
3820
3845
|
case 1:
|
|
3821
|
-
|
|
3846
|
+
d = sn;
|
|
3822
3847
|
break;
|
|
3823
3848
|
case 2:
|
|
3824
3849
|
case 3:
|
|
3825
3850
|
default:
|
|
3826
|
-
|
|
3851
|
+
d = nn;
|
|
3827
3852
|
break;
|
|
3828
3853
|
}
|
|
3829
3854
|
break;
|
|
3830
3855
|
}
|
|
3831
3856
|
const u = n.interpolation !== void 0 ? Eo[n.interpolation] : Wn, h = this._getArrayFromAccessor(s);
|
|
3832
|
-
for (let
|
|
3833
|
-
const
|
|
3834
|
-
l[
|
|
3857
|
+
for (let A = 0, f = l.length; A < f; A++) {
|
|
3858
|
+
const p = new d(
|
|
3859
|
+
l[A] + "." + pe[i.path],
|
|
3835
3860
|
t.array,
|
|
3836
3861
|
h,
|
|
3837
3862
|
u
|
|
3838
3863
|
);
|
|
3839
|
-
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
3864
|
+
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(p), o.push(p);
|
|
3840
3865
|
}
|
|
3841
3866
|
return o;
|
|
3842
3867
|
}
|
|
@@ -3866,8 +3891,8 @@ function Wo(r, e, t) {
|
|
|
3866
3891
|
new M(l[0], l[1], l[2]),
|
|
3867
3892
|
new M(c[0], c[1], c[2])
|
|
3868
3893
|
), a.normalized) {
|
|
3869
|
-
const
|
|
3870
|
-
n.min.multiplyScalar(
|
|
3894
|
+
const d = Vt(je[a.componentType]);
|
|
3895
|
+
n.min.multiplyScalar(d), n.max.multiplyScalar(d);
|
|
3871
3896
|
}
|
|
3872
3897
|
} else {
|
|
3873
3898
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -3878,14 +3903,14 @@ function Wo(r, e, t) {
|
|
|
3878
3903
|
const i = e.targets;
|
|
3879
3904
|
if (i !== void 0) {
|
|
3880
3905
|
const a = new M(), l = new M();
|
|
3881
|
-
for (let c = 0,
|
|
3906
|
+
for (let c = 0, d = i.length; c < d; c++) {
|
|
3882
3907
|
const u = i[c];
|
|
3883
3908
|
if (u.POSITION !== void 0) {
|
|
3884
|
-
const h = t.json.accessors[u.POSITION],
|
|
3885
|
-
if (
|
|
3886
|
-
if (l.setX(Math.max(Math.abs(
|
|
3887
|
-
const
|
|
3888
|
-
l.multiplyScalar(
|
|
3909
|
+
const h = t.json.accessors[u.POSITION], A = h.min, f = h.max;
|
|
3910
|
+
if (A !== void 0 && f !== void 0) {
|
|
3911
|
+
if (l.setX(Math.max(Math.abs(A[0]), Math.abs(f[0]))), l.setY(Math.max(Math.abs(A[1]), Math.abs(f[1]))), l.setZ(Math.max(Math.abs(A[2]), Math.abs(f[2]))), h.normalized) {
|
|
3912
|
+
const p = Vt(je[h.componentType]);
|
|
3913
|
+
l.multiplyScalar(p);
|
|
3889
3914
|
}
|
|
3890
3915
|
a.max(l);
|
|
3891
3916
|
} else
|
|
@@ -4016,8 +4041,8 @@ class zo extends Yt {
|
|
|
4016
4041
|
);
|
|
4017
4042
|
}
|
|
4018
4043
|
let n;
|
|
4019
|
-
const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (n = l, new Promise((c,
|
|
4020
|
-
n._callbacks[i] = { resolve: c, reject:
|
|
4044
|
+
const i = this.workerNextTaskID++, o = e.byteLength, a = this._getWorker(i, o).then((l) => (n = l, new Promise((c, d) => {
|
|
4045
|
+
n._callbacks[i] = { resolve: c, reject: d }, n.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
|
|
4021
4046
|
}))).then((l) => this._createGeometry(l.geometry));
|
|
4022
4047
|
return a.catch(() => !0).then(() => {
|
|
4023
4048
|
n && i && this._releaseTask(n, i);
|
|
@@ -4035,8 +4060,8 @@ class zo extends Yt {
|
|
|
4035
4060
|
if (o === a)
|
|
4036
4061
|
c = new _e(i, o);
|
|
4037
4062
|
else {
|
|
4038
|
-
const
|
|
4039
|
-
c = new Ln(
|
|
4063
|
+
const d = new Hn(i, a);
|
|
4064
|
+
c = new Ln(d, o, 0);
|
|
4040
4065
|
}
|
|
4041
4066
|
n === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(n, c);
|
|
4042
4067
|
}
|
|
@@ -4044,7 +4069,7 @@ class zo extends Yt {
|
|
|
4044
4069
|
}
|
|
4045
4070
|
_assignVertexColorSpace(e, t) {
|
|
4046
4071
|
if (t !== Ae) return;
|
|
4047
|
-
const s = new
|
|
4072
|
+
const s = new he();
|
|
4048
4073
|
for (let n = 0, i = e.count; n < i; n++)
|
|
4049
4074
|
s.fromBufferAttribute(e, n), qt.colorSpaceToWorking(s, Ae), e.setXYZ(n, s.r, s.g, s.b);
|
|
4050
4075
|
}
|
|
@@ -4117,21 +4142,21 @@ function Go() {
|
|
|
4117
4142
|
const a = o.data;
|
|
4118
4143
|
switch (a.type) {
|
|
4119
4144
|
case "init":
|
|
4120
|
-
r = a.decoderConfig, e = new Promise(function(
|
|
4145
|
+
r = a.decoderConfig, e = new Promise(function(d) {
|
|
4121
4146
|
r.onModuleLoaded = function(u) {
|
|
4122
|
-
|
|
4147
|
+
d({ draco: u });
|
|
4123
4148
|
}, DracoDecoderModule(r);
|
|
4124
4149
|
});
|
|
4125
4150
|
break;
|
|
4126
4151
|
case "decode":
|
|
4127
4152
|
const l = a.buffer, c = a.taskConfig;
|
|
4128
|
-
e.then((
|
|
4129
|
-
const u =
|
|
4153
|
+
e.then((d) => {
|
|
4154
|
+
const u = d.draco, h = new u.Decoder();
|
|
4130
4155
|
try {
|
|
4131
|
-
const
|
|
4132
|
-
|
|
4133
|
-
} catch (
|
|
4134
|
-
console.error(
|
|
4156
|
+
const A = t(u, h, new Int8Array(l), c), f = A.attributes.map((p) => p.array.buffer);
|
|
4157
|
+
A.index && f.push(A.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: A }, f);
|
|
4158
|
+
} catch (A) {
|
|
4159
|
+
console.error(A), self.postMessage({ type: "error", id: a.id, error: A.message });
|
|
4135
4160
|
} finally {
|
|
4136
4161
|
u.destroy(h);
|
|
4137
4162
|
}
|
|
@@ -4140,58 +4165,58 @@ function Go() {
|
|
|
4140
4165
|
}
|
|
4141
4166
|
};
|
|
4142
4167
|
function t(o, a, l, c) {
|
|
4143
|
-
const
|
|
4144
|
-
let h,
|
|
4145
|
-
const
|
|
4146
|
-
if (
|
|
4147
|
-
h = new o.Mesh(),
|
|
4148
|
-
else if (
|
|
4149
|
-
h = new o.PointCloud(),
|
|
4168
|
+
const d = c.attributeIDs, u = c.attributeTypes;
|
|
4169
|
+
let h, A;
|
|
4170
|
+
const f = a.GetEncodedGeometryType(l);
|
|
4171
|
+
if (f === o.TRIANGULAR_MESH)
|
|
4172
|
+
h = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, h);
|
|
4173
|
+
else if (f === o.POINT_CLOUD)
|
|
4174
|
+
h = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, h);
|
|
4150
4175
|
else
|
|
4151
4176
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
4152
|
-
if (!
|
|
4153
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
4154
|
-
const
|
|
4155
|
-
for (const
|
|
4156
|
-
const g = self[u[
|
|
4157
|
-
let
|
|
4177
|
+
if (!A.ok() || h.ptr === 0)
|
|
4178
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + A.error_msg());
|
|
4179
|
+
const p = { index: null, attributes: [] };
|
|
4180
|
+
for (const m in d) {
|
|
4181
|
+
const g = self[u[m]];
|
|
4182
|
+
let y, C;
|
|
4158
4183
|
if (c.useUniqueIDs)
|
|
4159
|
-
C =
|
|
4184
|
+
C = d[m], y = a.GetAttributeByUniqueId(h, C);
|
|
4160
4185
|
else {
|
|
4161
|
-
if (C = a.GetAttributeId(h, o[
|
|
4162
|
-
|
|
4186
|
+
if (C = a.GetAttributeId(h, o[d[m]]), C === -1) continue;
|
|
4187
|
+
y = a.GetAttribute(h, C);
|
|
4163
4188
|
}
|
|
4164
|
-
const
|
|
4165
|
-
|
|
4189
|
+
const x = n(o, a, h, m, g, y);
|
|
4190
|
+
m === "color" && (x.vertexColorSpace = c.vertexColorSpace), p.attributes.push(x);
|
|
4166
4191
|
}
|
|
4167
|
-
return
|
|
4192
|
+
return f === o.TRIANGULAR_MESH && (p.index = s(o, a, h)), o.destroy(h), p;
|
|
4168
4193
|
}
|
|
4169
4194
|
function s(o, a, l) {
|
|
4170
|
-
const
|
|
4195
|
+
const d = l.num_faces() * 3, u = d * 4, h = o._malloc(u);
|
|
4171
4196
|
a.GetTrianglesUInt32Array(l, u, h);
|
|
4172
|
-
const
|
|
4173
|
-
return o._free(h), { array:
|
|
4197
|
+
const A = new Uint32Array(o.HEAPF32.buffer, h, d).slice();
|
|
4198
|
+
return o._free(h), { array: A, itemSize: 1 };
|
|
4174
4199
|
}
|
|
4175
|
-
function n(o, a, l, c,
|
|
4176
|
-
const h = l.num_points(),
|
|
4177
|
-
a.GetAttributeDataArrayForAllPoints(l, u,
|
|
4178
|
-
const w = new
|
|
4200
|
+
function n(o, a, l, c, d, u) {
|
|
4201
|
+
const h = l.num_points(), A = u.num_components(), f = i(o, d), p = A * d.BYTES_PER_ELEMENT, m = Math.ceil(p / 4) * 4, g = m / d.BYTES_PER_ELEMENT, y = h * p, C = h * m, x = o._malloc(y);
|
|
4202
|
+
a.GetAttributeDataArrayForAllPoints(l, u, f, y, x);
|
|
4203
|
+
const w = new d(o.HEAPF32.buffer, x, y / d.BYTES_PER_ELEMENT);
|
|
4179
4204
|
let D;
|
|
4180
|
-
if (
|
|
4205
|
+
if (p === m)
|
|
4181
4206
|
D = w.slice();
|
|
4182
4207
|
else {
|
|
4183
|
-
D = new
|
|
4208
|
+
D = new d(C / d.BYTES_PER_ELEMENT);
|
|
4184
4209
|
let S = 0;
|
|
4185
|
-
for (let Z = 0,
|
|
4186
|
-
for (let Q = 0; Q <
|
|
4187
|
-
D[S + Q] = w[Z *
|
|
4210
|
+
for (let Z = 0, $ = w.length; Z < $; Z++) {
|
|
4211
|
+
for (let Q = 0; Q < A; Q++)
|
|
4212
|
+
D[S + Q] = w[Z * A + Q];
|
|
4188
4213
|
S += g;
|
|
4189
4214
|
}
|
|
4190
4215
|
}
|
|
4191
|
-
return o._free(
|
|
4216
|
+
return o._free(x), {
|
|
4192
4217
|
name: c,
|
|
4193
4218
|
count: h,
|
|
4194
|
-
itemSize:
|
|
4219
|
+
itemSize: A,
|
|
4195
4220
|
array: D,
|
|
4196
4221
|
stride: g
|
|
4197
4222
|
};
|
|
@@ -4243,21 +4268,21 @@ function Uo(r) {
|
|
|
4243
4268
|
repeatX: a = 4,
|
|
4244
4269
|
repeatY: l = 4,
|
|
4245
4270
|
speedX: c = 5e-4,
|
|
4246
|
-
speedY:
|
|
4247
|
-
} = r || {}, u = new P.PlaneGeometry(e, t),
|
|
4248
|
-
|
|
4249
|
-
}),
|
|
4271
|
+
speedY: d = 5e-4
|
|
4272
|
+
} = r || {}, u = new P.PlaneGeometry(e, t), A = new P.TextureLoader().load(Fo, (m) => {
|
|
4273
|
+
m.wrapS = m.wrapT = P.RepeatWrapping, m.repeat.set(a, l), m.generateMipmaps = !1, m.minFilter = P.LinearFilter, m.magFilter = P.LinearFilter;
|
|
4274
|
+
}), f = new P.MeshStandardMaterial({
|
|
4250
4275
|
color: s,
|
|
4251
4276
|
roughness: n,
|
|
4252
4277
|
metalness: i,
|
|
4253
|
-
normalMap:
|
|
4278
|
+
normalMap: A,
|
|
4254
4279
|
normalScale: new P.Vector2(o, o),
|
|
4255
4280
|
side: P.DoubleSide,
|
|
4256
4281
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
4257
4282
|
transparent: !0,
|
|
4258
4283
|
opacity: 0.6
|
|
4259
|
-
}),
|
|
4260
|
-
|
|
4284
|
+
}), p = new P.Mesh(u, f);
|
|
4285
|
+
p.rotation.x = -Math.PI / 2, p.position.y = 0, p.name = "水面(标准材质)", p.userData.isWater = !0, p.userData.isMovable = !0, p.userData.waterSpeed = { x: c, y: d }, ze(p);
|
|
4261
4286
|
}
|
|
4262
4287
|
function Vo(r) {
|
|
4263
4288
|
return Et(!0), new Promise((e, t) => {
|
|
@@ -4285,8 +4310,8 @@ function Vo(r) {
|
|
|
4285
4310
|
var h;
|
|
4286
4311
|
u.userData.isMovable = !0, u.name || (u.name = u.type), u.type === "Mesh" && (u.frustumCulled = !0, (h = u.geometry) == null || h.computeVertexNormals(), u.castShadow = !0, u.receiveShadow = !0);
|
|
4287
4312
|
});
|
|
4288
|
-
const
|
|
4289
|
-
l.position.sub(
|
|
4313
|
+
const d = new P.Box3().setFromObject(l).getCenter(new P.Vector3());
|
|
4314
|
+
l.position.sub(d), ze(l, !0), Et(!1), e(l);
|
|
4290
4315
|
},
|
|
4291
4316
|
void 0,
|
|
4292
4317
|
(a) => {
|
|
@@ -4320,28 +4345,16 @@ function Ko(r) {
|
|
|
4320
4345
|
return console.warn("请先选中一个模型,再添加数据面板"), null;
|
|
4321
4346
|
const t = Zt(e);
|
|
4322
4347
|
t && (t.dispose(), hi(e));
|
|
4323
|
-
const s =
|
|
4324
|
-
150,
|
|
4325
|
-
// 最小宽度 150px(小屏设备)
|
|
4326
|
-
Math.round(s / n * i)
|
|
4327
|
-
), l = Math.max(
|
|
4328
|
-
12,
|
|
4329
|
-
Math.min(
|
|
4330
|
-
20,
|
|
4331
|
-
Math.round(o / i * 13)
|
|
4332
|
-
)
|
|
4333
|
-
), c = [
|
|
4348
|
+
const s = [
|
|
4334
4349
|
{ label: "温度", value: "30", unit: "℃" },
|
|
4335
4350
|
{ label: "湿度", value: "65", unit: "%" },
|
|
4336
4351
|
{ label: "压力", value: "101.3", unit: "kPa" },
|
|
4337
4352
|
{ label: "名称", value: e.name || "未命名" }
|
|
4338
|
-
],
|
|
4353
|
+
], n = new Gn({
|
|
4339
4354
|
title: (r == null ? void 0 : r.title) || "数据面板",
|
|
4340
|
-
items: (r == null ? void 0 : r.items) ||
|
|
4341
|
-
width: `${o}px`,
|
|
4342
|
-
fontSize: `${l}px`
|
|
4355
|
+
items: (r == null ? void 0 : r.items) || s
|
|
4343
4356
|
});
|
|
4344
|
-
return
|
|
4357
|
+
return n.attachTo(e), Fn(e, n), n;
|
|
4345
4358
|
}
|
|
4346
4359
|
const Zo = {
|
|
4347
4360
|
key: 1,
|
|
@@ -4349,7 +4362,7 @@ const Zo = {
|
|
|
4349
4362
|
}, Qo = { class: "tree-icon" }, Jo = { class: "tree-name" }, _o = {
|
|
4350
4363
|
key: 0,
|
|
4351
4364
|
class: "tree-children"
|
|
4352
|
-
}, $o = /* @__PURE__ */
|
|
4365
|
+
}, $o = /* @__PURE__ */ Ie({
|
|
4353
4366
|
__name: "TreeItem",
|
|
4354
4367
|
props: {
|
|
4355
4368
|
node: {},
|
|
@@ -4358,17 +4371,17 @@ const Zo = {
|
|
|
4358
4371
|
},
|
|
4359
4372
|
emits: ["select", "delete"],
|
|
4360
4373
|
setup(r, { emit: e }) {
|
|
4361
|
-
const t = r, s = e, n =
|
|
4362
|
-
(
|
|
4363
|
-
))),
|
|
4374
|
+
const t = r, s = e, n = L(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((p) => p.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
|
|
4375
|
+
(p) => p.userData.isMovable === !0
|
|
4376
|
+
))), d = Be(
|
|
4364
4377
|
() => {
|
|
4365
|
-
var
|
|
4366
|
-
return ((
|
|
4378
|
+
var p;
|
|
4379
|
+
return ((p = t.selectedObject) == null ? void 0 : p.uuid) === t.node.uuid;
|
|
4367
4380
|
}
|
|
4368
4381
|
);
|
|
4369
4382
|
ts(
|
|
4370
4383
|
() => {
|
|
4371
|
-
|
|
4384
|
+
d.value && n.value && n.value.scrollIntoView({
|
|
4372
4385
|
block: "nearest",
|
|
4373
4386
|
// 仅当元素不在可视区域时才滚动
|
|
4374
4387
|
behavior: "smooth"
|
|
@@ -4377,12 +4390,12 @@ const Zo = {
|
|
|
4377
4390
|
},
|
|
4378
4391
|
{ flush: "post" }
|
|
4379
4392
|
);
|
|
4380
|
-
const u = (
|
|
4381
|
-
|
|
4382
|
-
}, h = (
|
|
4383
|
-
|
|
4384
|
-
},
|
|
4385
|
-
return (
|
|
4393
|
+
const u = (p) => {
|
|
4394
|
+
p.stopPropagation(), s("select", t.node);
|
|
4395
|
+
}, h = (p) => {
|
|
4396
|
+
p.stopPropagation(), s("delete", t.node);
|
|
4397
|
+
}, A = (p) => p.type === "Mesh" || p.type === "Sprite" ? "🟦" : p.type === "Light" ? "💡" : "📦", f = (p) => p.name || `${p.type} (${p.id})`;
|
|
4398
|
+
return (p, m) => {
|
|
4386
4399
|
const g = ns("TreeItem", !0);
|
|
4387
4400
|
return T(), R("div", {
|
|
4388
4401
|
class: "tree-node",
|
|
@@ -4390,49 +4403,49 @@ const Zo = {
|
|
|
4390
4403
|
ref: n
|
|
4391
4404
|
}, [
|
|
4392
4405
|
b("div", {
|
|
4393
|
-
class:
|
|
4406
|
+
class: ie(["tree-item", { selected: d.value }]),
|
|
4394
4407
|
onClick: u
|
|
4395
4408
|
}, [
|
|
4396
4409
|
l.value ? (T(), R("span", {
|
|
4397
4410
|
key: 0,
|
|
4398
4411
|
class: "toggle-icon",
|
|
4399
|
-
onClick:
|
|
4400
|
-
},
|
|
4401
|
-
b("span", Qo,
|
|
4402
|
-
b("span", Jo,
|
|
4412
|
+
onClick: m[0] || (m[0] = jt((y) => ss(o)(r.node.uuid), ["stop"]))
|
|
4413
|
+
}, _(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
|
|
4414
|
+
b("span", Qo, _(A(r.node)), 1),
|
|
4415
|
+
b("span", Jo, _(f(r.node)), 1),
|
|
4403
4416
|
b("button", {
|
|
4404
4417
|
class: "tree-delete",
|
|
4405
4418
|
onClick: jt(h, ["stop"])
|
|
4406
4419
|
}, "×")
|
|
4407
4420
|
], 2),
|
|
4408
4421
|
a.value && l.value ? (T(), R("div", _o, [
|
|
4409
|
-
(T(!0), R(
|
|
4410
|
-
key:
|
|
4411
|
-
node:
|
|
4422
|
+
(T(!0), R(Me, null, wt(c.value, (y) => (T(), Ke(g, {
|
|
4423
|
+
key: y.uuid,
|
|
4424
|
+
node: y,
|
|
4412
4425
|
"selected-object": r.selectedObject,
|
|
4413
4426
|
version: r.version,
|
|
4414
|
-
onSelect:
|
|
4415
|
-
onDelete:
|
|
4427
|
+
onSelect: m[1] || (m[1] = (C) => s("select", C)),
|
|
4428
|
+
onDelete: m[2] || (m[2] = (C) => s("delete", C))
|
|
4416
4429
|
}, null, 8, ["node", "selected-object", "version"]))), 128))
|
|
4417
4430
|
])) : X("", !0)
|
|
4418
4431
|
], 512);
|
|
4419
4432
|
};
|
|
4420
4433
|
}
|
|
4421
|
-
}),
|
|
4434
|
+
}), ye = (r, e) => {
|
|
4422
4435
|
const t = r.__vccOpts || r;
|
|
4423
4436
|
for (const [s, n] of e)
|
|
4424
4437
|
t[s] = n;
|
|
4425
4438
|
return t;
|
|
4426
|
-
}, er = /* @__PURE__ */
|
|
4439
|
+
}, er = /* @__PURE__ */ ye($o, [["__scopeId", "data-v-5ad9c842"]]), tr = { class: "property-group" }, nr = { class: "row" }, sr = { class: "property-group" }, ir = { class: "row" }, or = { class: "property-group" }, rr = { class: "row" }, ar = {
|
|
4427
4440
|
key: 0,
|
|
4428
4441
|
class: "property-group light-group"
|
|
4429
4442
|
}, lr = { class: "slider-row" }, cr = {
|
|
4430
4443
|
key: 1,
|
|
4431
4444
|
class: "property-group material-group"
|
|
4432
|
-
}, ur = { class: "slider-row" },
|
|
4445
|
+
}, ur = { class: "slider-row" }, dr = { class: "slider-value" }, Ar = { class: "slider-row" }, hr = { class: "slider-value" }, fr = { class: "slider-row" }, pr = { class: "slider-value" }, mr = {
|
|
4433
4446
|
key: 0,
|
|
4434
4447
|
class: "material-hint"
|
|
4435
|
-
}, gr = /* @__PURE__ */
|
|
4448
|
+
}, gr = /* @__PURE__ */ Ie({
|
|
4436
4449
|
__name: "TransformTab",
|
|
4437
4450
|
props: {
|
|
4438
4451
|
transform: {},
|
|
@@ -4444,43 +4457,43 @@ const Zo = {
|
|
|
4444
4457
|
metalness: 0,
|
|
4445
4458
|
roughness: 0.5,
|
|
4446
4459
|
opacity: 1
|
|
4447
|
-
}), o =
|
|
4460
|
+
}), o = L(!1), a = kt({
|
|
4448
4461
|
intensity: 1
|
|
4449
4462
|
});
|
|
4450
4463
|
function l() {
|
|
4451
4464
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = a.intensity);
|
|
4452
4465
|
}
|
|
4453
4466
|
function c(h) {
|
|
4454
|
-
let
|
|
4455
|
-
return h.traverse((
|
|
4456
|
-
if (
|
|
4457
|
-
const
|
|
4458
|
-
for (const g of
|
|
4467
|
+
let A = null;
|
|
4468
|
+
return h.traverse((f) => {
|
|
4469
|
+
if (f.type === "Mesh" && !A) {
|
|
4470
|
+
const p = f, m = Array.isArray(p.material) ? p.material : [p.material];
|
|
4471
|
+
for (const g of m)
|
|
4459
4472
|
if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
|
|
4460
|
-
const
|
|
4461
|
-
|
|
4462
|
-
metalness:
|
|
4463
|
-
roughness:
|
|
4473
|
+
const y = g;
|
|
4474
|
+
A = {
|
|
4475
|
+
metalness: y.metalness ?? 0,
|
|
4476
|
+
roughness: y.roughness ?? 0.5,
|
|
4464
4477
|
opacity: g.opacity ?? 1
|
|
4465
4478
|
};
|
|
4466
4479
|
break;
|
|
4467
4480
|
}
|
|
4468
4481
|
}
|
|
4469
|
-
}),
|
|
4482
|
+
}), A;
|
|
4470
4483
|
}
|
|
4471
|
-
function
|
|
4472
|
-
let
|
|
4473
|
-
return h.traverse((
|
|
4474
|
-
if (
|
|
4475
|
-
const
|
|
4476
|
-
for (const
|
|
4477
|
-
|
|
4484
|
+
function d(h, A) {
|
|
4485
|
+
let f = !1;
|
|
4486
|
+
return h.traverse((p) => {
|
|
4487
|
+
if (p.type === "Mesh") {
|
|
4488
|
+
const m = p, g = Array.isArray(m.material) ? m.material : [m.material];
|
|
4489
|
+
for (const y of g)
|
|
4490
|
+
y && (y.type === "MeshStandardMaterial" || y.type === "MeshPhongMaterial") && (A.metalness !== void 0 && (y.metalness = A.metalness), A.roughness !== void 0 && (y.roughness = A.roughness), A.opacity !== void 0 && (y.opacity = A.opacity, y.transparent = A.opacity < 1), y.needsUpdate = !0, f = !0);
|
|
4478
4491
|
}
|
|
4479
|
-
}),
|
|
4492
|
+
}), f;
|
|
4480
4493
|
}
|
|
4481
4494
|
function u() {
|
|
4482
4495
|
if (t.selectedObject) {
|
|
4483
|
-
const h =
|
|
4496
|
+
const h = d(t.selectedObject, {
|
|
4484
4497
|
metalness: i.metalness,
|
|
4485
4498
|
roughness: i.roughness,
|
|
4486
4499
|
opacity: i.opacity
|
|
@@ -4488,57 +4501,57 @@ const Zo = {
|
|
|
4488
4501
|
o.value = h;
|
|
4489
4502
|
}
|
|
4490
4503
|
}
|
|
4491
|
-
return
|
|
4504
|
+
return de(
|
|
4492
4505
|
() => t.selectedObject,
|
|
4493
4506
|
(h) => {
|
|
4494
4507
|
if (h) {
|
|
4495
|
-
const
|
|
4496
|
-
|
|
4508
|
+
const A = c(h);
|
|
4509
|
+
A ? (i.metalness = A.metalness, i.roughness = A.roughness, i.opacity = A.opacity, o.value = !0) : (i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1), h.type === "DirectionalLight" && (a.intensity = h.intensity ?? 1);
|
|
4497
4510
|
} else
|
|
4498
4511
|
i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = !1;
|
|
4499
4512
|
},
|
|
4500
4513
|
{ immediate: !0 }
|
|
4501
|
-
), (h,
|
|
4514
|
+
), (h, A) => (T(), R("div", null, [
|
|
4502
4515
|
b("div", tr, [
|
|
4503
|
-
|
|
4516
|
+
A[17] || (A[17] = b("label", null, "位置", -1)),
|
|
4504
4517
|
b("div", nr, [
|
|
4505
|
-
|
|
4518
|
+
A[14] || (A[14] = b("span", null, "X:", -1)),
|
|
4506
4519
|
E(b("input", {
|
|
4507
4520
|
type: "number",
|
|
4508
|
-
"onUpdate:modelValue":
|
|
4521
|
+
"onUpdate:modelValue": A[0] || (A[0] = (f) => r.transform.position.x = f),
|
|
4509
4522
|
step: "0.01",
|
|
4510
4523
|
onInput: n
|
|
4511
4524
|
}, null, 544), [
|
|
4512
4525
|
[
|
|
4513
|
-
|
|
4526
|
+
H,
|
|
4514
4527
|
r.transform.position.x,
|
|
4515
4528
|
void 0,
|
|
4516
4529
|
{ number: !0 }
|
|
4517
4530
|
]
|
|
4518
4531
|
]),
|
|
4519
|
-
|
|
4532
|
+
A[15] || (A[15] = b("span", null, "Y:", -1)),
|
|
4520
4533
|
E(b("input", {
|
|
4521
4534
|
type: "number",
|
|
4522
|
-
"onUpdate:modelValue":
|
|
4535
|
+
"onUpdate:modelValue": A[1] || (A[1] = (f) => r.transform.position.y = f),
|
|
4523
4536
|
step: "0.01",
|
|
4524
4537
|
onInput: n
|
|
4525
4538
|
}, null, 544), [
|
|
4526
4539
|
[
|
|
4527
|
-
|
|
4540
|
+
H,
|
|
4528
4541
|
r.transform.position.y,
|
|
4529
4542
|
void 0,
|
|
4530
4543
|
{ number: !0 }
|
|
4531
4544
|
]
|
|
4532
4545
|
]),
|
|
4533
|
-
|
|
4546
|
+
A[16] || (A[16] = b("span", null, "Z:", -1)),
|
|
4534
4547
|
E(b("input", {
|
|
4535
4548
|
type: "number",
|
|
4536
|
-
"onUpdate:modelValue":
|
|
4549
|
+
"onUpdate:modelValue": A[2] || (A[2] = (f) => r.transform.position.z = f),
|
|
4537
4550
|
step: "0.01",
|
|
4538
4551
|
onInput: n
|
|
4539
4552
|
}, null, 544), [
|
|
4540
4553
|
[
|
|
4541
|
-
|
|
4554
|
+
H,
|
|
4542
4555
|
r.transform.position.z,
|
|
4543
4556
|
void 0,
|
|
4544
4557
|
{ number: !0 }
|
|
@@ -4547,45 +4560,45 @@ const Zo = {
|
|
|
4547
4560
|
])
|
|
4548
4561
|
]),
|
|
4549
4562
|
b("div", sr, [
|
|
4550
|
-
|
|
4563
|
+
A[21] || (A[21] = b("label", null, "旋转 (弧度)", -1)),
|
|
4551
4564
|
b("div", ir, [
|
|
4552
|
-
|
|
4565
|
+
A[18] || (A[18] = b("span", null, "X:", -1)),
|
|
4553
4566
|
E(b("input", {
|
|
4554
4567
|
type: "number",
|
|
4555
|
-
"onUpdate:modelValue":
|
|
4568
|
+
"onUpdate:modelValue": A[3] || (A[3] = (f) => r.transform.rotation.x = f),
|
|
4556
4569
|
step: "0.01",
|
|
4557
4570
|
onInput: n
|
|
4558
4571
|
}, null, 544), [
|
|
4559
4572
|
[
|
|
4560
|
-
|
|
4573
|
+
H,
|
|
4561
4574
|
r.transform.rotation.x,
|
|
4562
4575
|
void 0,
|
|
4563
4576
|
{ number: !0 }
|
|
4564
4577
|
]
|
|
4565
4578
|
]),
|
|
4566
|
-
|
|
4579
|
+
A[19] || (A[19] = b("span", null, "Y:", -1)),
|
|
4567
4580
|
E(b("input", {
|
|
4568
4581
|
type: "number",
|
|
4569
|
-
"onUpdate:modelValue":
|
|
4582
|
+
"onUpdate:modelValue": A[4] || (A[4] = (f) => r.transform.rotation.y = f),
|
|
4570
4583
|
step: "0.01",
|
|
4571
4584
|
onInput: n
|
|
4572
4585
|
}, null, 544), [
|
|
4573
4586
|
[
|
|
4574
|
-
|
|
4587
|
+
H,
|
|
4575
4588
|
r.transform.rotation.y,
|
|
4576
4589
|
void 0,
|
|
4577
4590
|
{ number: !0 }
|
|
4578
4591
|
]
|
|
4579
4592
|
]),
|
|
4580
|
-
|
|
4593
|
+
A[20] || (A[20] = b("span", null, "Z:", -1)),
|
|
4581
4594
|
E(b("input", {
|
|
4582
4595
|
type: "number",
|
|
4583
|
-
"onUpdate:modelValue":
|
|
4596
|
+
"onUpdate:modelValue": A[5] || (A[5] = (f) => r.transform.rotation.z = f),
|
|
4584
4597
|
step: "0.01",
|
|
4585
4598
|
onInput: n
|
|
4586
4599
|
}, null, 544), [
|
|
4587
4600
|
[
|
|
4588
|
-
|
|
4601
|
+
H,
|
|
4589
4602
|
r.transform.rotation.z,
|
|
4590
4603
|
void 0,
|
|
4591
4604
|
{ number: !0 }
|
|
@@ -4594,45 +4607,45 @@ const Zo = {
|
|
|
4594
4607
|
])
|
|
4595
4608
|
]),
|
|
4596
4609
|
b("div", or, [
|
|
4597
|
-
|
|
4610
|
+
A[25] || (A[25] = b("label", null, "缩放", -1)),
|
|
4598
4611
|
b("div", rr, [
|
|
4599
|
-
|
|
4612
|
+
A[22] || (A[22] = b("span", null, "X:", -1)),
|
|
4600
4613
|
E(b("input", {
|
|
4601
4614
|
type: "number",
|
|
4602
|
-
"onUpdate:modelValue":
|
|
4615
|
+
"onUpdate:modelValue": A[6] || (A[6] = (f) => r.transform.scale.x = f),
|
|
4603
4616
|
step: "0.01",
|
|
4604
4617
|
onInput: n
|
|
4605
4618
|
}, null, 544), [
|
|
4606
4619
|
[
|
|
4607
|
-
|
|
4620
|
+
H,
|
|
4608
4621
|
r.transform.scale.x,
|
|
4609
4622
|
void 0,
|
|
4610
4623
|
{ number: !0 }
|
|
4611
4624
|
]
|
|
4612
4625
|
]),
|
|
4613
|
-
|
|
4626
|
+
A[23] || (A[23] = b("span", null, "Y:", -1)),
|
|
4614
4627
|
E(b("input", {
|
|
4615
4628
|
type: "number",
|
|
4616
|
-
"onUpdate:modelValue":
|
|
4629
|
+
"onUpdate:modelValue": A[7] || (A[7] = (f) => r.transform.scale.y = f),
|
|
4617
4630
|
step: "0.01",
|
|
4618
4631
|
onInput: n
|
|
4619
4632
|
}, null, 544), [
|
|
4620
4633
|
[
|
|
4621
|
-
|
|
4634
|
+
H,
|
|
4622
4635
|
r.transform.scale.y,
|
|
4623
4636
|
void 0,
|
|
4624
4637
|
{ number: !0 }
|
|
4625
4638
|
]
|
|
4626
4639
|
]),
|
|
4627
|
-
|
|
4640
|
+
A[24] || (A[24] = b("span", null, "Z:", -1)),
|
|
4628
4641
|
E(b("input", {
|
|
4629
4642
|
type: "number",
|
|
4630
|
-
"onUpdate:modelValue":
|
|
4643
|
+
"onUpdate:modelValue": A[8] || (A[8] = (f) => r.transform.scale.z = f),
|
|
4631
4644
|
step: "0.01",
|
|
4632
4645
|
onInput: n
|
|
4633
4646
|
}, null, 544), [
|
|
4634
4647
|
[
|
|
4635
|
-
|
|
4648
|
+
H,
|
|
4636
4649
|
r.transform.scale.z,
|
|
4637
4650
|
void 0,
|
|
4638
4651
|
{ number: !0 }
|
|
@@ -4641,19 +4654,19 @@ const Zo = {
|
|
|
4641
4654
|
])
|
|
4642
4655
|
]),
|
|
4643
4656
|
r.selectedObject && r.selectedObject.type === "DirectionalLight" ? (T(), R("div", ar, [
|
|
4644
|
-
|
|
4657
|
+
A[27] || (A[27] = b("label", null, "光源属性", -1)),
|
|
4645
4658
|
b("div", lr, [
|
|
4646
|
-
|
|
4659
|
+
A[26] || (A[26] = b("span", { class: "slider-label" }, "强度", -1)),
|
|
4647
4660
|
E(b("input", {
|
|
4648
4661
|
type: "range",
|
|
4649
4662
|
min: "0",
|
|
4650
4663
|
max: "10",
|
|
4651
4664
|
step: "0.1",
|
|
4652
|
-
"onUpdate:modelValue":
|
|
4665
|
+
"onUpdate:modelValue": A[9] || (A[9] = (f) => a.intensity = f),
|
|
4653
4666
|
onInput: l
|
|
4654
4667
|
}, null, 544), [
|
|
4655
4668
|
[
|
|
4656
|
-
|
|
4669
|
+
H,
|
|
4657
4670
|
a.intensity,
|
|
4658
4671
|
void 0,
|
|
4659
4672
|
{ number: !0 }
|
|
@@ -4664,12 +4677,12 @@ const Zo = {
|
|
|
4664
4677
|
min: "0",
|
|
4665
4678
|
max: "100",
|
|
4666
4679
|
step: "0.1",
|
|
4667
|
-
"onUpdate:modelValue":
|
|
4680
|
+
"onUpdate:modelValue": A[10] || (A[10] = (f) => a.intensity = f),
|
|
4668
4681
|
class: "intensity-input",
|
|
4669
4682
|
onInput: l
|
|
4670
4683
|
}, null, 544), [
|
|
4671
4684
|
[
|
|
4672
|
-
|
|
4685
|
+
H,
|
|
4673
4686
|
a.intensity,
|
|
4674
4687
|
void 0,
|
|
4675
4688
|
{ number: !0 }
|
|
@@ -4678,69 +4691,69 @@ const Zo = {
|
|
|
4678
4691
|
])
|
|
4679
4692
|
])) : X("", !0),
|
|
4680
4693
|
r.selectedObject ? (T(), R("div", cr, [
|
|
4681
|
-
|
|
4694
|
+
A[31] || (A[31] = b("label", null, "材质", -1)),
|
|
4682
4695
|
b("div", ur, [
|
|
4683
|
-
|
|
4696
|
+
A[28] || (A[28] = b("span", { class: "slider-label" }, "金属度", -1)),
|
|
4684
4697
|
E(b("input", {
|
|
4685
4698
|
type: "range",
|
|
4686
4699
|
min: "0",
|
|
4687
4700
|
max: "1",
|
|
4688
4701
|
step: "0.01",
|
|
4689
|
-
"onUpdate:modelValue":
|
|
4702
|
+
"onUpdate:modelValue": A[11] || (A[11] = (f) => i.metalness = f),
|
|
4690
4703
|
onInput: u
|
|
4691
4704
|
}, null, 544), [
|
|
4692
4705
|
[
|
|
4693
|
-
|
|
4706
|
+
H,
|
|
4694
4707
|
i.metalness,
|
|
4695
4708
|
void 0,
|
|
4696
4709
|
{ number: !0 }
|
|
4697
4710
|
]
|
|
4698
4711
|
]),
|
|
4699
|
-
b("span",
|
|
4712
|
+
b("span", dr, _(i.metalness.toFixed(2)), 1)
|
|
4700
4713
|
]),
|
|
4701
|
-
b("div",
|
|
4702
|
-
|
|
4714
|
+
b("div", Ar, [
|
|
4715
|
+
A[29] || (A[29] = b("span", { class: "slider-label" }, "粗糙度", -1)),
|
|
4703
4716
|
E(b("input", {
|
|
4704
4717
|
type: "range",
|
|
4705
4718
|
min: "0",
|
|
4706
4719
|
max: "1",
|
|
4707
4720
|
step: "0.01",
|
|
4708
|
-
"onUpdate:modelValue":
|
|
4721
|
+
"onUpdate:modelValue": A[12] || (A[12] = (f) => i.roughness = f),
|
|
4709
4722
|
onInput: u
|
|
4710
4723
|
}, null, 544), [
|
|
4711
4724
|
[
|
|
4712
|
-
|
|
4725
|
+
H,
|
|
4713
4726
|
i.roughness,
|
|
4714
4727
|
void 0,
|
|
4715
4728
|
{ number: !0 }
|
|
4716
4729
|
]
|
|
4717
4730
|
]),
|
|
4718
|
-
b("span", hr,
|
|
4731
|
+
b("span", hr, _(i.roughness.toFixed(2)), 1)
|
|
4719
4732
|
]),
|
|
4720
4733
|
b("div", fr, [
|
|
4721
|
-
|
|
4734
|
+
A[30] || (A[30] = b("span", { class: "slider-label" }, "透明度", -1)),
|
|
4722
4735
|
E(b("input", {
|
|
4723
4736
|
type: "range",
|
|
4724
4737
|
min: "0",
|
|
4725
4738
|
max: "1",
|
|
4726
4739
|
step: "0.01",
|
|
4727
|
-
"onUpdate:modelValue":
|
|
4740
|
+
"onUpdate:modelValue": A[13] || (A[13] = (f) => i.opacity = f),
|
|
4728
4741
|
onInput: u
|
|
4729
4742
|
}, null, 544), [
|
|
4730
4743
|
[
|
|
4731
|
-
|
|
4744
|
+
H,
|
|
4732
4745
|
i.opacity,
|
|
4733
4746
|
void 0,
|
|
4734
4747
|
{ number: !0 }
|
|
4735
4748
|
]
|
|
4736
4749
|
]),
|
|
4737
|
-
b("span", pr,
|
|
4750
|
+
b("span", pr, _(i.opacity.toFixed(2)), 1)
|
|
4738
4751
|
]),
|
|
4739
4752
|
o.value ? X("", !0) : (T(), R("div", mr, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
4740
4753
|
])) : X("", !0)
|
|
4741
4754
|
]));
|
|
4742
4755
|
}
|
|
4743
|
-
}), br = /* @__PURE__ */
|
|
4756
|
+
}), br = /* @__PURE__ */ ye(gr, [["__scopeId", "data-v-4cecf018"]]), Ir = { class: "userdata-tab" }, yr = { class: "property-group userdata-group" }, Cr = { class: "userdata-add-row" }, xr = ["onKeyup"], wr = {
|
|
4744
4757
|
key: 0,
|
|
4745
4758
|
class: "userdata-list"
|
|
4746
4759
|
}, vr = { class: "ud-key" }, Mr = {
|
|
@@ -4753,46 +4766,46 @@ const Zo = {
|
|
|
4753
4766
|
}, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"], Sr = {
|
|
4754
4767
|
key: 1,
|
|
4755
4768
|
class: "userdata-empty"
|
|
4756
|
-
}, Hr = /* @__PURE__ */
|
|
4769
|
+
}, Hr = /* @__PURE__ */ Ie({
|
|
4757
4770
|
__name: "UserDataTab",
|
|
4758
4771
|
props: {
|
|
4759
4772
|
selectedObject: {}
|
|
4760
4773
|
},
|
|
4761
4774
|
setup(r) {
|
|
4762
|
-
const e = r, t =
|
|
4775
|
+
const e = r, t = L(""), s = L(""), n = L(null), i = L(""), o = L(null), a = L([]);
|
|
4763
4776
|
function l(C) {
|
|
4764
4777
|
if (C === null) return "null";
|
|
4765
4778
|
if (C === void 0) return "undefined";
|
|
4766
4779
|
if (Array.isArray(C)) return "array";
|
|
4767
|
-
const
|
|
4768
|
-
return
|
|
4780
|
+
const x = typeof C;
|
|
4781
|
+
return x === "object" ? "object" : x === "number" ? "number" : x === "boolean" ? "boolean" : "string";
|
|
4769
4782
|
}
|
|
4770
4783
|
function c(C) {
|
|
4771
|
-
const
|
|
4784
|
+
const x = [];
|
|
4772
4785
|
if (C.userData)
|
|
4773
4786
|
for (const [w, D] of Object.entries(C.userData))
|
|
4774
|
-
typeof w == "string" && !w.startsWith("_") &&
|
|
4787
|
+
typeof w == "string" && !w.startsWith("_") && x.push({
|
|
4775
4788
|
key: w,
|
|
4776
4789
|
value: typeof D == "object" ? JSON.stringify(D) : String(D),
|
|
4777
4790
|
rawType: l(D)
|
|
4778
4791
|
});
|
|
4779
|
-
a.value =
|
|
4792
|
+
a.value = x;
|
|
4780
4793
|
}
|
|
4781
|
-
function
|
|
4782
|
-
const
|
|
4783
|
-
if (
|
|
4784
|
-
if (
|
|
4785
|
-
if (
|
|
4786
|
-
if (
|
|
4787
|
-
const w = Number(
|
|
4788
|
-
if (
|
|
4789
|
-
return String(w) !==
|
|
4790
|
-
if (
|
|
4794
|
+
function d(C) {
|
|
4795
|
+
const x = C.trim();
|
|
4796
|
+
if (x === "true") return !0;
|
|
4797
|
+
if (x === "false") return !1;
|
|
4798
|
+
if (x === "null") return null;
|
|
4799
|
+
if (x === "undefined") return;
|
|
4800
|
+
const w = Number(x);
|
|
4801
|
+
if (x !== "" && !isNaN(w))
|
|
4802
|
+
return String(w) !== x ? x : w;
|
|
4803
|
+
if (x.startsWith("{") && x.endsWith("}") || x.startsWith("[") && x.endsWith("]"))
|
|
4791
4804
|
try {
|
|
4792
|
-
return JSON.parse(
|
|
4805
|
+
return JSON.parse(x);
|
|
4793
4806
|
} catch {
|
|
4794
4807
|
}
|
|
4795
|
-
return
|
|
4808
|
+
return x;
|
|
4796
4809
|
}
|
|
4797
4810
|
function u() {
|
|
4798
4811
|
if (!e.selectedObject || !t.value.trim()) return;
|
|
@@ -4801,28 +4814,28 @@ const Zo = {
|
|
|
4801
4814
|
t.value = "";
|
|
4802
4815
|
return;
|
|
4803
4816
|
}
|
|
4804
|
-
const
|
|
4805
|
-
e.selectedObject.userData[C] =
|
|
4817
|
+
const x = d(s.value);
|
|
4818
|
+
e.selectedObject.userData[C] = x, c(e.selectedObject), t.value = "", s.value = "";
|
|
4806
4819
|
}
|
|
4807
|
-
function h(C,
|
|
4820
|
+
function h(C, x) {
|
|
4808
4821
|
e.selectedObject && (delete e.selectedObject.userData[C], c(e.selectedObject));
|
|
4809
4822
|
}
|
|
4810
|
-
function
|
|
4823
|
+
function A(C) {
|
|
4811
4824
|
return C.length <= 28 ? C : C.substring(0, 28) + "…";
|
|
4812
4825
|
}
|
|
4813
|
-
function
|
|
4826
|
+
function f(C) {
|
|
4814
4827
|
n.value = C;
|
|
4815
|
-
const
|
|
4816
|
-
if (!
|
|
4817
|
-
const w =
|
|
4828
|
+
const x = e.selectedObject;
|
|
4829
|
+
if (!x) return;
|
|
4830
|
+
const w = x.userData[C];
|
|
4818
4831
|
try {
|
|
4819
4832
|
i.value = JSON.stringify(w, null, 2);
|
|
4820
4833
|
} catch {
|
|
4821
4834
|
i.value = String(w);
|
|
4822
4835
|
}
|
|
4823
|
-
|
|
4836
|
+
p();
|
|
4824
4837
|
}
|
|
4825
|
-
function
|
|
4838
|
+
function p() {
|
|
4826
4839
|
const C = i.value.trim();
|
|
4827
4840
|
if (!C) {
|
|
4828
4841
|
o.value = null;
|
|
@@ -4834,60 +4847,60 @@ const Zo = {
|
|
|
4834
4847
|
}
|
|
4835
4848
|
try {
|
|
4836
4849
|
JSON.parse(C), o.value = null;
|
|
4837
|
-
} catch (
|
|
4838
|
-
o.value = "JSON 格式错误:" +
|
|
4850
|
+
} catch (x) {
|
|
4851
|
+
o.value = "JSON 格式错误:" + x.message;
|
|
4839
4852
|
}
|
|
4840
4853
|
}
|
|
4841
|
-
function
|
|
4842
|
-
const
|
|
4843
|
-
if (!
|
|
4854
|
+
function m(C) {
|
|
4855
|
+
const x = e.selectedObject;
|
|
4856
|
+
if (!x) return;
|
|
4844
4857
|
const w = i.value.trim();
|
|
4845
4858
|
try {
|
|
4846
4859
|
const D = JSON.parse(w);
|
|
4847
|
-
|
|
4860
|
+
x.userData[C] = D, c(x), n.value = null, i.value = "";
|
|
4848
4861
|
} catch {
|
|
4849
|
-
|
|
4862
|
+
x.userData[C] = w, c(x), n.value = null, i.value = "";
|
|
4850
4863
|
}
|
|
4851
4864
|
}
|
|
4852
4865
|
function g() {
|
|
4853
4866
|
n.value = null, i.value = "";
|
|
4854
4867
|
}
|
|
4855
|
-
function
|
|
4868
|
+
function y() {
|
|
4856
4869
|
const C = e.selectedObject;
|
|
4857
4870
|
if (!C) return;
|
|
4858
|
-
const
|
|
4859
|
-
|
|
4860
|
-
x:
|
|
4861
|
-
y:
|
|
4862
|
-
z:
|
|
4871
|
+
const x = Yi();
|
|
4872
|
+
x && (C.userData.closeUpView = {
|
|
4873
|
+
x: x.position.x,
|
|
4874
|
+
y: x.position.y,
|
|
4875
|
+
z: x.position.z
|
|
4863
4876
|
}, c(C));
|
|
4864
4877
|
}
|
|
4865
|
-
return
|
|
4878
|
+
return de(
|
|
4866
4879
|
() => e.selectedObject,
|
|
4867
4880
|
(C) => {
|
|
4868
4881
|
C ? c(C) : a.value = [], n.value = null, i.value = "";
|
|
4869
4882
|
},
|
|
4870
4883
|
{ immediate: !0 }
|
|
4871
|
-
), (C,
|
|
4884
|
+
), (C, x) => (T(), R("div", Ir, [
|
|
4872
4885
|
b("div", yr, [
|
|
4873
|
-
|
|
4886
|
+
x[3] || (x[3] = b("label", null, "userData 属性", -1)),
|
|
4874
4887
|
b("div", Cr, [
|
|
4875
4888
|
E(b("input", {
|
|
4876
4889
|
type: "text",
|
|
4877
|
-
"onUpdate:modelValue":
|
|
4890
|
+
"onUpdate:modelValue": x[0] || (x[0] = (w) => t.value = w),
|
|
4878
4891
|
placeholder: "属性名",
|
|
4879
4892
|
class: "ud-input",
|
|
4880
4893
|
onKeyup: He(u, ["enter"])
|
|
4881
4894
|
}, null, 544), [
|
|
4882
|
-
[
|
|
4895
|
+
[H, t.value]
|
|
4883
4896
|
]),
|
|
4884
4897
|
E(b("textarea", {
|
|
4885
|
-
"onUpdate:modelValue":
|
|
4898
|
+
"onUpdate:modelValue": x[1] || (x[1] = (w) => s.value = w),
|
|
4886
4899
|
placeholder: "值",
|
|
4887
4900
|
class: "ud-input ud-textarea",
|
|
4888
4901
|
onKeyup: He(jt(u, ["prevent"]), ["enter"])
|
|
4889
4902
|
}, null, 40, xr), [
|
|
4890
|
-
[
|
|
4903
|
+
[H, s.value]
|
|
4891
4904
|
]),
|
|
4892
4905
|
b("button", {
|
|
4893
4906
|
class: "ud-btn add-btn",
|
|
@@ -4896,37 +4909,37 @@ const Zo = {
|
|
|
4896
4909
|
}, " + ")
|
|
4897
4910
|
]),
|
|
4898
4911
|
a.value.length > 0 ? (T(), R("div", wr, [
|
|
4899
|
-
(T(!0), R(
|
|
4912
|
+
(T(!0), R(Me, null, wt(a.value, (w, D) => (T(), R("div", {
|
|
4900
4913
|
key: w.key,
|
|
4901
|
-
class:
|
|
4914
|
+
class: ie(["userdata-item", {
|
|
4902
4915
|
readonly: w.key === "isMovable",
|
|
4903
4916
|
"editing-json": n.value === w.key
|
|
4904
4917
|
}])
|
|
4905
4918
|
}, [
|
|
4906
|
-
b("span", vr,
|
|
4907
|
-
w.key === "isMovable" ? (T(), R("span", Mr,
|
|
4908
|
-
n.value !== w.key ? (T(), R(
|
|
4909
|
-
b("span", Dr,
|
|
4919
|
+
b("span", vr, _(w.key), 1),
|
|
4920
|
+
w.key === "isMovable" ? (T(), R("span", Mr, _(String(w.value)) + " 🔒 ", 1)) : w.key !== "isMovable" ? (T(), R(Me, { key: 1 }, [
|
|
4921
|
+
n.value !== w.key ? (T(), R(Me, { key: 0 }, [
|
|
4922
|
+
b("span", Dr, _(A(w.value)), 1),
|
|
4910
4923
|
b("button", {
|
|
4911
4924
|
class: "ud-btn edit-json-btn",
|
|
4912
4925
|
title: "编辑对象",
|
|
4913
|
-
onClick: (S) =>
|
|
4926
|
+
onClick: (S) => f(w.key)
|
|
4914
4927
|
}, " ✎ ", 8, Pr)
|
|
4915
|
-
], 64)) : (T(), R(
|
|
4916
|
-
o.value ? (T(), R("div", Tr, " ⚠ " +
|
|
4928
|
+
], 64)) : (T(), R(Me, { key: 1 }, [
|
|
4929
|
+
o.value ? (T(), R("div", Tr, " ⚠ " + _(o.value), 1)) : X("", !0),
|
|
4917
4930
|
E(b("textarea", {
|
|
4918
|
-
"onUpdate:modelValue":
|
|
4919
|
-
class:
|
|
4931
|
+
"onUpdate:modelValue": x[2] || (x[2] = (S) => i.value = S),
|
|
4932
|
+
class: ie(["ud-json-textarea", { "has-error": o.value }]),
|
|
4920
4933
|
rows: "3",
|
|
4921
|
-
onInput:
|
|
4934
|
+
onInput: p
|
|
4922
4935
|
}, null, 34), [
|
|
4923
|
-
[
|
|
4936
|
+
[H, i.value]
|
|
4924
4937
|
]),
|
|
4925
4938
|
b("div", Or, [
|
|
4926
4939
|
b("button", {
|
|
4927
4940
|
class: "ud-btn apply-btn",
|
|
4928
4941
|
title: "应用修改",
|
|
4929
|
-
onClick: (S) =>
|
|
4942
|
+
onClick: (S) => m(w.key)
|
|
4930
4943
|
}, " ✓ ", 8, Er),
|
|
4931
4944
|
b("button", {
|
|
4932
4945
|
class: "ud-btn cancel-btn",
|
|
@@ -4946,167 +4959,221 @@ const Zo = {
|
|
|
4946
4959
|
])) : (T(), R("div", Sr, "暂无自定义数据")),
|
|
4947
4960
|
b("button", {
|
|
4948
4961
|
class: "get-camera-btn",
|
|
4949
|
-
onClick:
|
|
4962
|
+
onClick: y
|
|
4950
4963
|
}, " 添加当前相机位置 ")
|
|
4951
4964
|
])
|
|
4952
4965
|
]));
|
|
4953
4966
|
}
|
|
4954
|
-
}), Lr = /* @__PURE__ */
|
|
4967
|
+
}), Lr = /* @__PURE__ */ ye(Hr, [["__scopeId", "data-v-4e117415"]]), Nr = { class: "datapanel-tab" }, jr = { class: "property-group" }, kr = { class: "dp-section" }, Wr = { class: "dp-visibility-row" }, zr = { class: "dp-toggle" }, Gr = { class: "dp-visibility-text" }, Fr = { class: "dp-section" }, qr = { class: "dp-size-row" }, Xr = { class: "dp-size-value" }, Br = { class: "dp-section" }, Ur = { class: "dp-size-row" }, Vr = { class: "dp-size-value" }, Yr = { class: "dp-section" }, Kr = { class: "dp-section" }, Zr = { class: "dp-list" }, Qr = ["onUpdate:modelValue"], Jr = ["onUpdate:modelValue"], _r = ["onUpdate:modelValue"], $r = ["onUpdate:modelValue"], ea = ["onClick"], ta = { class: "dp-add-row" }, na = /* @__PURE__ */ Ie({
|
|
4955
4968
|
__name: "DataPanelTab",
|
|
4956
4969
|
props: {
|
|
4957
4970
|
selectedObject: {}
|
|
4958
4971
|
},
|
|
4959
4972
|
setup(r) {
|
|
4960
|
-
const e = r, t =
|
|
4961
|
-
let
|
|
4962
|
-
function
|
|
4963
|
-
const
|
|
4964
|
-
return
|
|
4973
|
+
const e = r, t = L(""), s = L([]), n = L(!0), i = L(200), o = L(13), a = L(""), l = L(""), c = L(""), d = L("");
|
|
4974
|
+
let u = A(), h = !1;
|
|
4975
|
+
function A() {
|
|
4976
|
+
const g = e.selectedObject;
|
|
4977
|
+
return g ? Zt(xt(g)) : null;
|
|
4965
4978
|
}
|
|
4966
|
-
|
|
4967
|
-
|
|
4979
|
+
de(n, (g) => {
|
|
4980
|
+
h || !u || (u.visible = g);
|
|
4968
4981
|
});
|
|
4969
|
-
function
|
|
4970
|
-
|
|
4982
|
+
function f() {
|
|
4983
|
+
h || !u || (u.setTitle(t.value), u.setItems([...s.value]));
|
|
4971
4984
|
}
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4985
|
+
de(i, (g) => {
|
|
4986
|
+
h || !u || u.setWidth(`${g}px`);
|
|
4987
|
+
}), de(o, (g) => {
|
|
4988
|
+
h || !u || u.setFontSize(`${g}px`);
|
|
4989
|
+
}), de(t, () => f()), de(s, () => f(), { deep: !0 });
|
|
4990
|
+
function p(g) {
|
|
4991
|
+
s.value = s.value.filter((y, C) => C !== g), f();
|
|
4975
4992
|
}
|
|
4976
|
-
function
|
|
4977
|
-
!
|
|
4993
|
+
function m() {
|
|
4994
|
+
!a.value.trim() || !l.value.trim() || (s.value = [
|
|
4978
4995
|
...s.value,
|
|
4979
4996
|
{
|
|
4980
|
-
label:
|
|
4981
|
-
value:
|
|
4982
|
-
unit:
|
|
4983
|
-
code:
|
|
4997
|
+
label: a.value.trim(),
|
|
4998
|
+
value: l.value.trim(),
|
|
4999
|
+
unit: c.value.trim() || void 0,
|
|
5000
|
+
code: d.value.trim() || void 0
|
|
4984
5001
|
}
|
|
4985
|
-
],
|
|
5002
|
+
], f(), a.value = "", l.value = "", c.value = "", d.value = "");
|
|
4986
5003
|
}
|
|
4987
|
-
return
|
|
5004
|
+
return de(
|
|
4988
5005
|
() => e.selectedObject,
|
|
4989
5006
|
() => {
|
|
4990
|
-
|
|
4991
|
-
|
|
5007
|
+
if (h = !0, u = A(), u) {
|
|
5008
|
+
t.value = u.getTitle(), s.value = u.getItems(), n.value = u.visible;
|
|
5009
|
+
const g = u.getWidth();
|
|
5010
|
+
i.value = parseInt(g) || 200;
|
|
5011
|
+
const y = u.getFontSize();
|
|
5012
|
+
o.value = parseInt(y) || 13;
|
|
5013
|
+
} else
|
|
5014
|
+
t.value = "", s.value = [], n.value = !0, i.value = 200, o.value = 13;
|
|
5015
|
+
a.value = "", l.value = "", c.value = "", setTimeout(() => {
|
|
5016
|
+
h = !1;
|
|
4992
5017
|
}, 0);
|
|
4993
5018
|
},
|
|
4994
5019
|
{ immediate: !0 }
|
|
4995
|
-
), (
|
|
5020
|
+
), (g, y) => (T(), R("div", Nr, [
|
|
4996
5021
|
b("div", jr, [
|
|
4997
|
-
|
|
5022
|
+
y[14] || (y[14] = b("label", null, "📊 数据面板", -1)),
|
|
4998
5023
|
b("div", kr, [
|
|
4999
|
-
|
|
5024
|
+
y[9] || (y[9] = b("span", { class: "dp-label-sm" }, "可见性", -1)),
|
|
5000
5025
|
b("div", Wr, [
|
|
5001
5026
|
b("label", zr, [
|
|
5002
5027
|
E(b("input", {
|
|
5003
5028
|
type: "checkbox",
|
|
5004
|
-
"onUpdate:modelValue":
|
|
5029
|
+
"onUpdate:modelValue": y[0] || (y[0] = (C) => n.value = C)
|
|
5005
5030
|
}, null, 512), [
|
|
5006
5031
|
[is, n.value]
|
|
5007
5032
|
]),
|
|
5008
|
-
|
|
5033
|
+
y[8] || (y[8] = b("span", { class: "dp-toggle-slider" }, null, -1))
|
|
5009
5034
|
]),
|
|
5010
|
-
b("span", Gr,
|
|
5035
|
+
b("span", Gr, _(n.value ? "显示中" : "已隐藏"), 1)
|
|
5011
5036
|
])
|
|
5012
5037
|
]),
|
|
5013
5038
|
b("div", Fr, [
|
|
5014
|
-
|
|
5039
|
+
y[10] || (y[10] = b("span", { class: "dp-label-sm" }, "面板宽度", -1)),
|
|
5040
|
+
b("div", qr, [
|
|
5041
|
+
E(b("input", {
|
|
5042
|
+
type: "range",
|
|
5043
|
+
class: "dp-range",
|
|
5044
|
+
min: "100",
|
|
5045
|
+
max: "1200",
|
|
5046
|
+
step: "10",
|
|
5047
|
+
"onUpdate:modelValue": y[1] || (y[1] = (C) => i.value = C)
|
|
5048
|
+
}, null, 512), [
|
|
5049
|
+
[
|
|
5050
|
+
H,
|
|
5051
|
+
i.value,
|
|
5052
|
+
void 0,
|
|
5053
|
+
{ number: !0 }
|
|
5054
|
+
]
|
|
5055
|
+
]),
|
|
5056
|
+
b("span", Xr, _(i.value) + "px", 1)
|
|
5057
|
+
])
|
|
5058
|
+
]),
|
|
5059
|
+
b("div", Br, [
|
|
5060
|
+
y[11] || (y[11] = b("span", { class: "dp-label-sm" }, "字体大小", -1)),
|
|
5061
|
+
b("div", Ur, [
|
|
5062
|
+
E(b("input", {
|
|
5063
|
+
type: "range",
|
|
5064
|
+
class: "dp-range",
|
|
5065
|
+
min: "10",
|
|
5066
|
+
max: "50",
|
|
5067
|
+
step: "1",
|
|
5068
|
+
"onUpdate:modelValue": y[2] || (y[2] = (C) => o.value = C)
|
|
5069
|
+
}, null, 512), [
|
|
5070
|
+
[
|
|
5071
|
+
H,
|
|
5072
|
+
o.value,
|
|
5073
|
+
void 0,
|
|
5074
|
+
{ number: !0 }
|
|
5075
|
+
]
|
|
5076
|
+
]),
|
|
5077
|
+
b("span", Vr, _(o.value) + "px", 1)
|
|
5078
|
+
])
|
|
5079
|
+
]),
|
|
5080
|
+
b("div", Yr, [
|
|
5081
|
+
y[12] || (y[12] = b("span", { class: "dp-label-sm" }, "标题", -1)),
|
|
5015
5082
|
E(b("input", {
|
|
5016
5083
|
type: "text",
|
|
5017
5084
|
class: "dp-input",
|
|
5018
|
-
"onUpdate:modelValue":
|
|
5085
|
+
"onUpdate:modelValue": y[3] || (y[3] = (C) => t.value = C),
|
|
5019
5086
|
placeholder: "面板标题"
|
|
5020
5087
|
}, null, 512), [
|
|
5021
|
-
[
|
|
5088
|
+
[H, t.value]
|
|
5022
5089
|
])
|
|
5023
5090
|
]),
|
|
5024
|
-
b("div",
|
|
5025
|
-
|
|
5026
|
-
b("div",
|
|
5027
|
-
(T(!0), R(
|
|
5091
|
+
b("div", Kr, [
|
|
5092
|
+
y[13] || (y[13] = b("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
5093
|
+
b("div", Zr, [
|
|
5094
|
+
(T(!0), R(Me, null, wt(s.value, (C, x) => (T(), R("div", {
|
|
5028
5095
|
key: x,
|
|
5029
5096
|
class: "dp-item"
|
|
5030
5097
|
}, [
|
|
5031
5098
|
E(b("input", {
|
|
5032
5099
|
type: "text",
|
|
5033
5100
|
class: "dp-input dp-input-sm",
|
|
5034
|
-
"onUpdate:modelValue": (
|
|
5101
|
+
"onUpdate:modelValue": (w) => C.label = w,
|
|
5035
5102
|
placeholder: "标签"
|
|
5036
|
-
}, null, 8,
|
|
5037
|
-
[
|
|
5103
|
+
}, null, 8, Qr), [
|
|
5104
|
+
[H, C.label]
|
|
5038
5105
|
]),
|
|
5039
5106
|
E(b("input", {
|
|
5040
5107
|
type: "text",
|
|
5041
5108
|
class: "dp-input dp-input-sm",
|
|
5042
|
-
"onUpdate:modelValue": (
|
|
5109
|
+
"onUpdate:modelValue": (w) => C.value = w,
|
|
5043
5110
|
placeholder: "值"
|
|
5044
|
-
}, null, 8,
|
|
5045
|
-
[
|
|
5111
|
+
}, null, 8, Jr), [
|
|
5112
|
+
[H, C.value]
|
|
5046
5113
|
]),
|
|
5047
5114
|
E(b("input", {
|
|
5048
5115
|
type: "text",
|
|
5049
5116
|
class: "dp-input dp-input-xs",
|
|
5050
|
-
"onUpdate:modelValue": (
|
|
5117
|
+
"onUpdate:modelValue": (w) => C.unit = w,
|
|
5051
5118
|
placeholder: "单位"
|
|
5052
|
-
}, null, 8,
|
|
5053
|
-
[
|
|
5119
|
+
}, null, 8, _r), [
|
|
5120
|
+
[H, C.unit]
|
|
5054
5121
|
]),
|
|
5055
5122
|
E(b("input", {
|
|
5056
5123
|
type: "text",
|
|
5057
5124
|
class: "dp-input dp-input-xs",
|
|
5058
|
-
"onUpdate:modelValue": (
|
|
5125
|
+
"onUpdate:modelValue": (w) => C.code = w,
|
|
5059
5126
|
placeholder: "编码"
|
|
5060
|
-
}, null, 8,
|
|
5061
|
-
[
|
|
5127
|
+
}, null, 8, $r), [
|
|
5128
|
+
[H, C.code]
|
|
5062
5129
|
]),
|
|
5063
5130
|
b("button", {
|
|
5064
5131
|
class: "dp-btn dp-btn-del",
|
|
5065
|
-
onClick: (
|
|
5132
|
+
onClick: (w) => p(x),
|
|
5066
5133
|
title: "删除此项"
|
|
5067
|
-
}, "✕", 8,
|
|
5134
|
+
}, "✕", 8, ea)
|
|
5068
5135
|
]))), 128))
|
|
5069
5136
|
]),
|
|
5070
|
-
b("div",
|
|
5137
|
+
b("div", ta, [
|
|
5071
5138
|
E(b("input", {
|
|
5072
5139
|
type: "text",
|
|
5073
5140
|
class: "dp-input dp-input-sm",
|
|
5074
|
-
"onUpdate:modelValue":
|
|
5141
|
+
"onUpdate:modelValue": y[4] || (y[4] = (C) => a.value = C),
|
|
5075
5142
|
placeholder: "标签",
|
|
5076
|
-
onKeyup: He(
|
|
5143
|
+
onKeyup: He(m, ["enter"])
|
|
5077
5144
|
}, null, 544), [
|
|
5078
|
-
[
|
|
5145
|
+
[H, a.value]
|
|
5079
5146
|
]),
|
|
5080
5147
|
E(b("input", {
|
|
5081
5148
|
type: "text",
|
|
5082
5149
|
class: "dp-input dp-input-sm",
|
|
5083
|
-
"onUpdate:modelValue":
|
|
5150
|
+
"onUpdate:modelValue": y[5] || (y[5] = (C) => l.value = C),
|
|
5084
5151
|
placeholder: "值",
|
|
5085
|
-
onKeyup: He(
|
|
5152
|
+
onKeyup: He(m, ["enter"])
|
|
5086
5153
|
}, null, 544), [
|
|
5087
|
-
[
|
|
5154
|
+
[H, l.value]
|
|
5088
5155
|
]),
|
|
5089
5156
|
E(b("input", {
|
|
5090
5157
|
type: "text",
|
|
5091
5158
|
class: "dp-input dp-input-xs",
|
|
5092
|
-
"onUpdate:modelValue":
|
|
5159
|
+
"onUpdate:modelValue": y[6] || (y[6] = (C) => c.value = C),
|
|
5093
5160
|
placeholder: "单位",
|
|
5094
|
-
onKeyup: He(
|
|
5161
|
+
onKeyup: He(m, ["enter"])
|
|
5095
5162
|
}, null, 544), [
|
|
5096
|
-
[
|
|
5163
|
+
[H, c.value]
|
|
5097
5164
|
]),
|
|
5098
5165
|
E(b("input", {
|
|
5099
5166
|
type: "text",
|
|
5100
5167
|
class: "dp-input dp-input-xs",
|
|
5101
|
-
"onUpdate:modelValue":
|
|
5168
|
+
"onUpdate:modelValue": y[7] || (y[7] = (C) => d.value = C),
|
|
5102
5169
|
placeholder: "编码",
|
|
5103
|
-
onKeyup: He(
|
|
5170
|
+
onKeyup: He(m, ["enter"])
|
|
5104
5171
|
}, null, 544), [
|
|
5105
|
-
[
|
|
5172
|
+
[H, d.value]
|
|
5106
5173
|
]),
|
|
5107
5174
|
b("button", {
|
|
5108
5175
|
class: "dp-btn dp-btn-add",
|
|
5109
|
-
onClick:
|
|
5176
|
+
onClick: m,
|
|
5110
5177
|
title: "添加"
|
|
5111
5178
|
}, "+")
|
|
5112
5179
|
])
|
|
@@ -5114,9 +5181,9 @@ const Zo = {
|
|
|
5114
5181
|
])
|
|
5115
5182
|
]));
|
|
5116
5183
|
}
|
|
5117
|
-
}),
|
|
5118
|
-
function
|
|
5119
|
-
const e =
|
|
5184
|
+
}), sa = /* @__PURE__ */ ye(na, [["__scopeId", "data-v-8d2c144b"]]);
|
|
5185
|
+
function ia(r) {
|
|
5186
|
+
const e = L(/* @__PURE__ */ new Set()), t = (n) => {
|
|
5120
5187
|
const i = new Set(e.value);
|
|
5121
5188
|
i.has(n) ? i.delete(n) : i.add(n), e.value = i;
|
|
5122
5189
|
}, s = (n) => {
|
|
@@ -5127,7 +5194,7 @@ function _r(r) {
|
|
|
5127
5194
|
i.add(o.uuid), o = o.parent;
|
|
5128
5195
|
e.value = i;
|
|
5129
5196
|
};
|
|
5130
|
-
return
|
|
5197
|
+
return de(
|
|
5131
5198
|
r,
|
|
5132
5199
|
(n) => {
|
|
5133
5200
|
n && s(n);
|
|
@@ -5135,22 +5202,22 @@ function _r(r) {
|
|
|
5135
5202
|
{ immediate: !0 }
|
|
5136
5203
|
), { expandedSet: e, toggleExpand: t };
|
|
5137
5204
|
}
|
|
5138
|
-
const
|
|
5205
|
+
const oa = {
|
|
5139
5206
|
key: 0,
|
|
5140
5207
|
class: "property-panel"
|
|
5141
|
-
},
|
|
5208
|
+
}, ra = { class: "property-group tree-group" }, aa = { class: "tree-container" }, la = {
|
|
5142
5209
|
key: 0,
|
|
5143
5210
|
class: "tree-empty"
|
|
5144
|
-
},
|
|
5211
|
+
}, ca = { class: "property-group" }, ua = { class: "transform-mode-row" }, da = {
|
|
5145
5212
|
key: 0,
|
|
5146
5213
|
class: "tabs"
|
|
5147
|
-
},
|
|
5214
|
+
}, Aa = {
|
|
5148
5215
|
key: 1,
|
|
5149
5216
|
class: "tab-content"
|
|
5150
|
-
},
|
|
5217
|
+
}, ha = {
|
|
5151
5218
|
key: 1,
|
|
5152
5219
|
class: "property-panel empty"
|
|
5153
|
-
},
|
|
5220
|
+
}, fa = /* @__PURE__ */ Ie({
|
|
5154
5221
|
__name: "index",
|
|
5155
5222
|
props: {
|
|
5156
5223
|
transform: {},
|
|
@@ -5159,69 +5226,69 @@ const $r = {
|
|
|
5159
5226
|
},
|
|
5160
5227
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
5161
5228
|
setup(r, { emit: e }) {
|
|
5162
|
-
const t = r, s = e, n =
|
|
5163
|
-
function i(
|
|
5164
|
-
n.value =
|
|
5229
|
+
const t = r, s = e, n = L("translate");
|
|
5230
|
+
function i(f) {
|
|
5231
|
+
n.value = f, s("transformModeChange", f);
|
|
5165
5232
|
}
|
|
5166
|
-
const o = () => s("propertyChange"), a =
|
|
5167
|
-
var
|
|
5168
|
-
return !!(t.selectedObject && ((
|
|
5169
|
-
}), c =
|
|
5233
|
+
const o = () => s("propertyChange"), a = L("transform"), l = Be(() => {
|
|
5234
|
+
var f;
|
|
5235
|
+
return !!(t.selectedObject && ((f = t.selectedObject.userData) != null && f._hasDataPanel));
|
|
5236
|
+
}), c = L(0), d = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = ia(d);
|
|
5170
5237
|
rs("treeExpand", { expandedSet: u, toggleExpand: h });
|
|
5171
|
-
const
|
|
5172
|
-
c.value++, s("treeDelete",
|
|
5238
|
+
const A = (f) => {
|
|
5239
|
+
c.value++, s("treeDelete", f);
|
|
5173
5240
|
};
|
|
5174
|
-
return (
|
|
5175
|
-
b("div",
|
|
5176
|
-
|
|
5177
|
-
b("div",
|
|
5178
|
-
(T(!0), R(
|
|
5179
|
-
key:
|
|
5180
|
-
node:
|
|
5241
|
+
return (f, p) => r.transform ? (T(), R("div", oa, [
|
|
5242
|
+
b("div", ra, [
|
|
5243
|
+
p[7] || (p[7] = b("label", null, "场景物体", -1)),
|
|
5244
|
+
b("div", aa, [
|
|
5245
|
+
(T(!0), R(Me, null, wt(r.treeData, (m) => (T(), Ke(er, {
|
|
5246
|
+
key: m.uuid,
|
|
5247
|
+
node: m,
|
|
5181
5248
|
"selected-object": r.selectedObject,
|
|
5182
5249
|
version: c.value,
|
|
5183
|
-
onSelect:
|
|
5184
|
-
onDelete:
|
|
5250
|
+
onSelect: p[0] || (p[0] = (g) => s("treeSelect", g)),
|
|
5251
|
+
onDelete: A
|
|
5185
5252
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
5186
|
-
r.treeData.length === 0 ? (T(), R("div",
|
|
5253
|
+
r.treeData.length === 0 ? (T(), R("div", la, "暂无物体")) : X("", !0)
|
|
5187
5254
|
])
|
|
5188
5255
|
]),
|
|
5189
|
-
b("div",
|
|
5190
|
-
|
|
5191
|
-
b("div",
|
|
5256
|
+
b("div", ca, [
|
|
5257
|
+
p[8] || (p[8] = b("label", null, "全局属性", -1)),
|
|
5258
|
+
b("div", ua, [
|
|
5192
5259
|
b("button", {
|
|
5193
|
-
class:
|
|
5260
|
+
class: ie(["mode-btn", { active: n.value === "translate" }]),
|
|
5194
5261
|
title: "移动 (W)",
|
|
5195
|
-
onClick:
|
|
5262
|
+
onClick: p[1] || (p[1] = (m) => i("translate"))
|
|
5196
5263
|
}, " ↕ 移动 ", 2),
|
|
5197
5264
|
b("button", {
|
|
5198
|
-
class:
|
|
5265
|
+
class: ie(["mode-btn", { active: n.value === "rotate" }]),
|
|
5199
5266
|
title: "旋转 (E)",
|
|
5200
|
-
onClick:
|
|
5267
|
+
onClick: p[2] || (p[2] = (m) => i("rotate"))
|
|
5201
5268
|
}, " ↻ 旋转 ", 2),
|
|
5202
5269
|
b("button", {
|
|
5203
|
-
class:
|
|
5270
|
+
class: ie(["mode-btn", { active: n.value === "scale" }]),
|
|
5204
5271
|
title: "缩放 (R)",
|
|
5205
|
-
onClick:
|
|
5272
|
+
onClick: p[3] || (p[3] = (m) => i("scale"))
|
|
5206
5273
|
}, " ⤡ 缩放 ", 2)
|
|
5207
5274
|
])
|
|
5208
5275
|
]),
|
|
5209
|
-
r.selectedObject ? (T(), R("div",
|
|
5276
|
+
r.selectedObject ? (T(), R("div", da, [
|
|
5210
5277
|
b("button", {
|
|
5211
|
-
class:
|
|
5212
|
-
onClick:
|
|
5278
|
+
class: ie(["tab-btn", { active: a.value === "transform" }]),
|
|
5279
|
+
onClick: p[4] || (p[4] = (m) => a.value = "transform")
|
|
5213
5280
|
}, " 🔄 变换 ", 2),
|
|
5214
5281
|
b("button", {
|
|
5215
|
-
class:
|
|
5216
|
-
onClick:
|
|
5282
|
+
class: ie(["tab-btn", { active: a.value === "userdata" }]),
|
|
5283
|
+
onClick: p[5] || (p[5] = (m) => a.value = "userdata")
|
|
5217
5284
|
}, " 📋 自定义数据 ", 2),
|
|
5218
5285
|
l.value ? (T(), R("button", {
|
|
5219
5286
|
key: 0,
|
|
5220
|
-
class:
|
|
5221
|
-
onClick:
|
|
5287
|
+
class: ie(["tab-btn", { active: a.value === "datapanel" }]),
|
|
5288
|
+
onClick: p[6] || (p[6] = (m) => a.value = "datapanel")
|
|
5222
5289
|
}, " 📊 数据面板 ", 2)) : X("", !0)
|
|
5223
5290
|
])) : X("", !0),
|
|
5224
|
-
r.selectedObject ? (T(), R("div",
|
|
5291
|
+
r.selectedObject ? (T(), R("div", Aa, [
|
|
5225
5292
|
E(Dt(br, {
|
|
5226
5293
|
transform: r.transform,
|
|
5227
5294
|
"selected-object": r.selectedObject,
|
|
@@ -5232,62 +5299,62 @@ const $r = {
|
|
|
5232
5299
|
E(Dt(Lr, { "selected-object": r.selectedObject }, null, 8, ["selected-object"]), [
|
|
5233
5300
|
[De, a.value === "userdata"]
|
|
5234
5301
|
]),
|
|
5235
|
-
E(Dt(
|
|
5302
|
+
E(Dt(sa, { "selected-object": r.selectedObject }, null, 8, ["selected-object"]), [
|
|
5236
5303
|
[De, a.value === "datapanel"]
|
|
5237
5304
|
])
|
|
5238
5305
|
])) : X("", !0)
|
|
5239
|
-
])) : (T(), R("div",
|
|
5306
|
+
])) : (T(), R("div", ha, [...p[9] || (p[9] = [
|
|
5240
5307
|
b("p", null, "未选中任何模型", -1)
|
|
5241
5308
|
])]));
|
|
5242
5309
|
}
|
|
5243
|
-
}),
|
|
5310
|
+
}), pa = /* @__PURE__ */ ye(fa, [["__scopeId", "data-v-c92c9fa7"]]), ma = { class: "top-bar" }, ga = { class: "left-section" }, ba = { class: "dropdown-menu" }, Ia = { class: "dropdown-menu sub-menu" }, ya = { class: "dropdown-menu sub-menu" }, Ca = { class: "dropdown-menu" }, xa = /* @__PURE__ */ Ie({
|
|
5244
5311
|
__name: "TopBar",
|
|
5245
5312
|
emits: ["addModel", "importModel"],
|
|
5246
5313
|
setup(r, { emit: e }) {
|
|
5247
|
-
const t =
|
|
5248
|
-
var
|
|
5249
|
-
return (
|
|
5250
|
-
}, c = (
|
|
5251
|
-
const
|
|
5252
|
-
|
|
5253
|
-
},
|
|
5254
|
-
const
|
|
5255
|
-
console.log(JSON.parse(await
|
|
5256
|
-
},
|
|
5314
|
+
const t = L(!1), s = L(!1), n = L(!1), i = L(!1), o = e, a = L(null), l = () => {
|
|
5315
|
+
var p;
|
|
5316
|
+
return (p = a.value) == null ? void 0 : p.click();
|
|
5317
|
+
}, c = (p) => {
|
|
5318
|
+
const m = p.target;
|
|
5319
|
+
m.files && m.files.length > 0 && (o("importModel", m.files[0]), m.value = "");
|
|
5320
|
+
}, d = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
|
|
5321
|
+
const p = Ki();
|
|
5322
|
+
console.log(JSON.parse(await p));
|
|
5323
|
+
}, A = () => {
|
|
5257
5324
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
5258
5325
|
Ei(localStorage.getItem("test_id"));
|
|
5259
|
-
},
|
|
5260
|
-
return (
|
|
5261
|
-
b("div",
|
|
5326
|
+
}, f = () => qn();
|
|
5327
|
+
return (p, m) => (T(), R("div", ma, [
|
|
5328
|
+
b("div", ga, [
|
|
5262
5329
|
b("div", {
|
|
5263
5330
|
class: "dropdown-wrapper",
|
|
5264
|
-
onMouseenter:
|
|
5265
|
-
onMouseleave:
|
|
5331
|
+
onMouseenter: m[9] || (m[9] = (g) => s.value = !0),
|
|
5332
|
+
onMouseleave: m[10] || (m[10] = (g) => s.value = !1)
|
|
5266
5333
|
}, [
|
|
5267
|
-
|
|
5268
|
-
E(b("div",
|
|
5334
|
+
m[15] || (m[15] = b("button", { class: "menu-btn" }, "添加", -1)),
|
|
5335
|
+
E(b("div", ba, [
|
|
5269
5336
|
b("div", {
|
|
5270
5337
|
class: "menu-item",
|
|
5271
|
-
onClick:
|
|
5338
|
+
onClick: d
|
|
5272
5339
|
}, "组"),
|
|
5273
5340
|
b("div", {
|
|
5274
5341
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
5275
|
-
onMouseenter:
|
|
5276
|
-
onMouseleave:
|
|
5342
|
+
onMouseenter: m[3] || (m[3] = (g) => n.value = !0),
|
|
5343
|
+
onMouseleave: m[4] || (m[4] = (g) => n.value = !1)
|
|
5277
5344
|
}, [
|
|
5278
|
-
|
|
5279
|
-
E(b("div",
|
|
5345
|
+
m[13] || (m[13] = b("span", null, "网格", -1)),
|
|
5346
|
+
E(b("div", Ia, [
|
|
5280
5347
|
b("div", {
|
|
5281
5348
|
class: "menu-item",
|
|
5282
|
-
onClick:
|
|
5349
|
+
onClick: m[0] || (m[0] = (g) => o("addModel", "box"))
|
|
5283
5350
|
}, " 正方体 "),
|
|
5284
5351
|
b("div", {
|
|
5285
5352
|
class: "menu-item",
|
|
5286
|
-
onClick:
|
|
5353
|
+
onClick: m[1] || (m[1] = (g) => o("addModel", "sphere"))
|
|
5287
5354
|
}, " 球体 "),
|
|
5288
5355
|
b("div", {
|
|
5289
5356
|
class: "menu-item",
|
|
5290
|
-
onClick:
|
|
5357
|
+
onClick: m[2] || (m[2] = (g) => o("addModel", "waterPlane"))
|
|
5291
5358
|
}, " 水面 "),
|
|
5292
5359
|
b("div", {
|
|
5293
5360
|
class: "menu-item",
|
|
@@ -5299,14 +5366,14 @@ const $r = {
|
|
|
5299
5366
|
], 32),
|
|
5300
5367
|
b("div", {
|
|
5301
5368
|
class: "menu-item dropdown-wrapper sub-trigger",
|
|
5302
|
-
onMouseenter:
|
|
5303
|
-
onMouseleave:
|
|
5369
|
+
onMouseenter: m[6] || (m[6] = (g) => i.value = !0),
|
|
5370
|
+
onMouseleave: m[7] || (m[7] = (g) => i.value = !1)
|
|
5304
5371
|
}, [
|
|
5305
|
-
|
|
5306
|
-
E(b("div",
|
|
5372
|
+
m[14] || (m[14] = b("span", null, "光源", -1)),
|
|
5373
|
+
E(b("div", ya, [
|
|
5307
5374
|
b("div", {
|
|
5308
5375
|
class: "menu-item",
|
|
5309
|
-
onClick:
|
|
5376
|
+
onClick: m[5] || (m[5] = (g) => o("addModel", "directionalLight"))
|
|
5310
5377
|
}, " 平行光 ")
|
|
5311
5378
|
], 512), [
|
|
5312
5379
|
[De, i.value]
|
|
@@ -5318,7 +5385,7 @@ const $r = {
|
|
|
5318
5385
|
}, "摄像机"),
|
|
5319
5386
|
b("div", {
|
|
5320
5387
|
class: "menu-item",
|
|
5321
|
-
onClick:
|
|
5388
|
+
onClick: m[8] || (m[8] = (g) => o("addModel", "dataPanel"))
|
|
5322
5389
|
}, " 数据面板 ")
|
|
5323
5390
|
], 512), [
|
|
5324
5391
|
[De, s.value]
|
|
@@ -5326,29 +5393,29 @@ const $r = {
|
|
|
5326
5393
|
], 32),
|
|
5327
5394
|
b("div", {
|
|
5328
5395
|
class: "dropdown-wrapper",
|
|
5329
|
-
onMouseenter:
|
|
5330
|
-
onMouseleave:
|
|
5396
|
+
onMouseenter: m[11] || (m[11] = (g) => t.value = !0),
|
|
5397
|
+
onMouseleave: m[12] || (m[12] = (g) => t.value = !1)
|
|
5331
5398
|
}, [
|
|
5332
|
-
|
|
5333
|
-
E(b("div",
|
|
5399
|
+
m[16] || (m[16] = b("button", { class: "menu-btn" }, "帮助", -1)),
|
|
5400
|
+
E(b("div", Ca, [
|
|
5334
5401
|
b("div", {
|
|
5335
5402
|
class: "menu-item",
|
|
5336
5403
|
onClick: h
|
|
5337
5404
|
}, "获取场景"),
|
|
5338
5405
|
b("div", {
|
|
5339
5406
|
class: "menu-item",
|
|
5340
|
-
onClick:
|
|
5407
|
+
onClick: A
|
|
5341
5408
|
}, "镜头拉近"),
|
|
5342
5409
|
b("div", {
|
|
5343
5410
|
class: "menu-item",
|
|
5344
|
-
onClick:
|
|
5411
|
+
onClick: f
|
|
5345
5412
|
}, " 重置相机位置 ")
|
|
5346
5413
|
], 512), [
|
|
5347
5414
|
[De, t.value]
|
|
5348
5415
|
])
|
|
5349
5416
|
], 32)
|
|
5350
5417
|
]),
|
|
5351
|
-
|
|
5418
|
+
m[17] || (m[17] = b("div", { class: "right-section" }, [
|
|
5352
5419
|
b("span", { class: "app-title" }, "3D 模型编辑器")
|
|
5353
5420
|
], -1)),
|
|
5354
5421
|
b("input", {
|
|
@@ -5361,10 +5428,10 @@ const $r = {
|
|
|
5361
5428
|
}, null, 544)
|
|
5362
5429
|
]));
|
|
5363
5430
|
}
|
|
5364
|
-
}),
|
|
5431
|
+
}), wa = /* @__PURE__ */ ye(xa, [["__scopeId", "data-v-45df3361"]]), va = { class: "bottom-bar" }, Ma = /* @__PURE__ */ Ie({
|
|
5365
5432
|
__name: "BottomBar",
|
|
5366
5433
|
setup(r) {
|
|
5367
|
-
return (e, t) => (T(), R("div",
|
|
5434
|
+
return (e, t) => (T(), R("div", va, [...t[0] || (t[0] = [
|
|
5368
5435
|
b("div", { class: "status-left" }, [
|
|
5369
5436
|
b("span", null, "就绪")
|
|
5370
5437
|
], -1),
|
|
@@ -5373,17 +5440,17 @@ const $r = {
|
|
|
5373
5440
|
], -1)
|
|
5374
5441
|
])]));
|
|
5375
5442
|
}
|
|
5376
|
-
}),
|
|
5443
|
+
}), Da = /* @__PURE__ */ ye(Ma, [["__scopeId", "data-v-3427bb27"]]), Pa = { class: "app-layout" }, Ta = {
|
|
5377
5444
|
key: 0,
|
|
5378
5445
|
class: "loading-overlay"
|
|
5379
|
-
},
|
|
5446
|
+
}, Oa = /* @__PURE__ */ Ie({
|
|
5380
5447
|
__name: "DrawingBoard",
|
|
5381
5448
|
props: {
|
|
5382
5449
|
mode: { default: "edit" },
|
|
5383
5450
|
sceneData: { default: null }
|
|
5384
5451
|
},
|
|
5385
5452
|
setup(r) {
|
|
5386
|
-
const e = r, t =
|
|
5453
|
+
const e = r, t = L(!1);
|
|
5387
5454
|
Ti((g) => {
|
|
5388
5455
|
t.value = g;
|
|
5389
5456
|
});
|
|
@@ -5417,64 +5484,64 @@ const $r = {
|
|
|
5417
5484
|
}, l = (g) => Yo(g), c = async (g) => {
|
|
5418
5485
|
try {
|
|
5419
5486
|
await Vo(g);
|
|
5420
|
-
} catch (
|
|
5421
|
-
console.error("导入失败:",
|
|
5487
|
+
} catch (y) {
|
|
5488
|
+
console.error("导入失败:", y), alert("导入失败:" + y.message);
|
|
5422
5489
|
}
|
|
5423
|
-
},
|
|
5490
|
+
}, d = $t([]);
|
|
5424
5491
|
Bi((g) => {
|
|
5425
|
-
|
|
5492
|
+
d.value = g;
|
|
5426
5493
|
});
|
|
5427
5494
|
const u = () => {
|
|
5428
5495
|
const g = Ui();
|
|
5429
|
-
g && (
|
|
5430
|
-
}, h = (g) => Qt(g),
|
|
5496
|
+
g && (d.value = g);
|
|
5497
|
+
}, h = (g) => Qt(g), A = (g) => Wi(g.uuid), f = (g) => {
|
|
5431
5498
|
Oi(g);
|
|
5432
|
-
},
|
|
5433
|
-
|
|
5499
|
+
}, p = L(null), m = () => {
|
|
5500
|
+
p.value && Ii(p.value, e.mode, e.sceneData), u();
|
|
5434
5501
|
};
|
|
5435
5502
|
return as(() => {
|
|
5436
|
-
|
|
5503
|
+
m(), p.value && fi(p.value);
|
|
5437
5504
|
}), ls(() => {
|
|
5438
5505
|
console.log("endset_three_editor destroy"), Qi();
|
|
5439
|
-
}), (g,
|
|
5440
|
-
t.value ? (T(), R("div",
|
|
5506
|
+
}), (g, y) => (T(), R("div", Pa, [
|
|
5507
|
+
t.value ? (T(), R("div", Ta, [...y[0] || (y[0] = [
|
|
5441
5508
|
b("div", { class: "loading-spinner" }, null, -1),
|
|
5442
5509
|
b("div", { class: "loading-text" }, "加载中...", -1)
|
|
5443
5510
|
])])) : X("", !0),
|
|
5444
|
-
r.mode === "edit" ? (T(), Ke(
|
|
5511
|
+
r.mode === "edit" ? (T(), Ke(wa, {
|
|
5445
5512
|
key: 1,
|
|
5446
5513
|
onAddModel: l,
|
|
5447
5514
|
onImportModel: c
|
|
5448
5515
|
})) : X("", !0),
|
|
5449
5516
|
b("div", {
|
|
5450
|
-
class:
|
|
5517
|
+
class: ie(`editor-container editor-container-mode-${r.mode}`)
|
|
5451
5518
|
}, [
|
|
5452
5519
|
b("div", {
|
|
5453
|
-
class:
|
|
5520
|
+
class: ie(`canvas canvas-mode-${r.mode}`),
|
|
5454
5521
|
ref_key: "containerRef",
|
|
5455
|
-
ref:
|
|
5522
|
+
ref: p
|
|
5456
5523
|
}, null, 2),
|
|
5457
|
-
r.mode === "edit" ? (T(), Ke(
|
|
5524
|
+
r.mode === "edit" ? (T(), Ke(pa, {
|
|
5458
5525
|
key: 0,
|
|
5459
5526
|
transform: n,
|
|
5460
|
-
"tree-data":
|
|
5527
|
+
"tree-data": d.value,
|
|
5461
5528
|
"selected-object": s.value,
|
|
5462
5529
|
onPropertyChange: a,
|
|
5463
5530
|
onTreeSelect: h,
|
|
5464
|
-
onTreeDelete:
|
|
5465
|
-
onTransformModeChange:
|
|
5531
|
+
onTreeDelete: A,
|
|
5532
|
+
onTransformModeChange: f
|
|
5466
5533
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
|
|
5467
5534
|
], 2),
|
|
5468
|
-
r.mode === "edit" ? (T(), Ke(
|
|
5535
|
+
r.mode === "edit" ? (T(), Ke(Da, { key: 2 })) : X("", !0)
|
|
5469
5536
|
]));
|
|
5470
5537
|
}
|
|
5471
|
-
}),
|
|
5538
|
+
}), Wa = /* @__PURE__ */ ye(Oa, [["__scopeId", "data-v-ffa5f5c1"]]);
|
|
5472
5539
|
export {
|
|
5473
|
-
|
|
5540
|
+
Da as BottomBar,
|
|
5474
5541
|
Gn as DataPanel,
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5542
|
+
Wa as DrawingBoard,
|
|
5543
|
+
pa as PropertyPanel,
|
|
5544
|
+
wa as TopBar,
|
|
5478
5545
|
er as TreeItem,
|
|
5479
5546
|
qo as addBox,
|
|
5480
5547
|
Ko as addDataPanel,
|
|
@@ -5488,11 +5555,11 @@ export {
|
|
|
5488
5555
|
gi as disposeCSS2DRenderer,
|
|
5489
5556
|
Ki as exportSceneToJSON,
|
|
5490
5557
|
Hi as focusOnObject,
|
|
5491
|
-
|
|
5558
|
+
La as getCSS2DRenderer,
|
|
5492
5559
|
Yi as getCamera,
|
|
5493
5560
|
Zt as getDataPanel,
|
|
5494
|
-
|
|
5495
|
-
|
|
5561
|
+
ka as getRenderer,
|
|
5562
|
+
ja as getScene,
|
|
5496
5563
|
Ui as getSceneObjects,
|
|
5497
5564
|
Vi as getSelectedObject,
|
|
5498
5565
|
Vo as importModelFromFile,
|
|
@@ -5512,7 +5579,7 @@ export {
|
|
|
5512
5579
|
qi as setSelectedObjectCallback,
|
|
5513
5580
|
Xi as setTransformChangeCallback,
|
|
5514
5581
|
Oi as setTransformMode,
|
|
5515
|
-
|
|
5516
|
-
|
|
5582
|
+
Na as updateDataPanelValue,
|
|
5583
|
+
ia as useTreeExpand
|
|
5517
5584
|
};
|
|
5518
5585
|
//# sourceMappingURL=three-editor.es.js.map
|