endset_three_editor 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/three-editor.es.js
CHANGED
|
@@ -1,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 be, ref as j, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as se, withModifiers as jt, unref as ss, toDisplayString as ie, Fragment as ve, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as Me, withDirectives as E, vModelText as N, withKeys as
|
|
4
|
+
import { toRaw as xt, defineComponent as be, ref as j, inject as es, computed as Be, watchEffect as ts, resolveComponent as ns, openBlock as T, createElementBlock as R, createElementVNode as b, normalizeClass as se, withModifiers as jt, unref as ss, toDisplayString as ie, Fragment as ve, renderList as wt, createBlock as Ke, createCommentVNode as X, reactive as kt, watch as Me, withDirectives as E, vModelText as N, withKeys as Se, 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
|
|
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 As, Object3D as ke, MeshBasicMaterial as Pe, LineBasicMaterial as Ze, CylinderGeometry as U, BoxGeometry as q, BufferGeometry as We, Float32BufferAttribute as pe, Mesh as v, OctahedronGeometry as lt, Line as ue, TorusGeometry as Ge, SphereGeometry as ds, Euler as hs, Matrix4 as me, PlaneGeometry as fs, DoubleSide as Rn, Loader as Yt, FileLoader as tt, Color as de, 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 Hn, 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 Sn, 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 Hs, OrthographicCamera as Ss, 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
|
|
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, S = {
|
|
9
9
|
NONE: -1,
|
|
10
10
|
ROTATE: 0,
|
|
11
11
|
DOLLY: 1,
|
|
@@ -15,7 +15,7 @@ const an = { type: "change" }, Kt = { type: "start" }, Gn = { type: "end" }, ct
|
|
|
15
15
|
TOUCH_DOLLY_PAN: 5,
|
|
16
16
|
TOUCH_DOLLY_ROTATE: 6
|
|
17
17
|
}, Pt = 1e-6;
|
|
18
|
-
class Xs extends
|
|
18
|
+
class Xs extends On {
|
|
19
19
|
/**
|
|
20
20
|
* Constructs a new controls instance.
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ class Xs extends En {
|
|
|
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 = S.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 En {
|
|
|
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(
|
|
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 = S.NONE;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Programmatically pan the camera.
|
|
@@ -141,7 +141,7 @@ class Xs extends En {
|
|
|
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 === S.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;
|
|
@@ -167,12 +167,12 @@ class Xs extends En {
|
|
|
167
167
|
c.unproject(this.object), this.object.position.sub(c).add(a), this.object.updateMatrixWorld(), o = G.length();
|
|
168
168
|
} else
|
|
169
169
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
170
|
-
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (ct.origin.copy(this.object.position), ct.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(ct.direction)) < qs ? this.object.lookAt(this.target) : (
|
|
170
|
+
o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (ct.origin.copy(this.object.position), ct.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(ct.direction)) < qs ? this.object.lookAt(this.target) : (an.setFromNormalAndCoplanarPoint(this.object.up, this.target), ct.intersectPlane(an, this.target))));
|
|
171
171
|
} else if (this.object.isOrthographicCamera) {
|
|
172
172
|
const o = this.object.zoom;
|
|
173
173
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
174
174
|
}
|
|
175
|
-
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Pt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Pt || this._lastTargetPosition.distanceToSquared(this.target) > Pt ? (this.dispatchEvent(
|
|
175
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > Pt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Pt || this._lastTargetPosition.distanceToSquared(this.target) > Pt ? (this.dispatchEvent(rn), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
176
176
|
}
|
|
177
177
|
_getAutoRotationAngle(e) {
|
|
178
178
|
return e !== null ? V / 60 * this.autoRotateSpeed * e : V / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -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(
|
|
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 = S.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 = S.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 = S.PAN;
|
|
408
408
|
} else {
|
|
409
409
|
if (this.enableRotate === !1) return;
|
|
410
|
-
this._handleMouseDownRotate(r), this.state =
|
|
410
|
+
this._handleMouseDownRotate(r), this.state = S.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 = S.ROTATE;
|
|
417
417
|
} else {
|
|
418
418
|
if (this.enablePan === !1) return;
|
|
419
|
-
this._handleMouseDownPan(r), this.state =
|
|
419
|
+
this._handleMouseDownPan(r), this.state = S.PAN;
|
|
420
420
|
}
|
|
421
421
|
break;
|
|
422
422
|
default:
|
|
423
|
-
this.state =
|
|
423
|
+
this.state = S.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !==
|
|
425
|
+
this.state !== S.NONE && this.dispatchEvent(Kt);
|
|
426
426
|
}
|
|
427
427
|
function Ks(r) {
|
|
428
428
|
switch (this.state) {
|
|
429
|
-
case
|
|
429
|
+
case S.ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
431
431
|
this._handleMouseMoveRotate(r);
|
|
432
432
|
break;
|
|
433
|
-
case
|
|
433
|
+
case S.DOLLY:
|
|
434
434
|
if (this.enableZoom === !1) return;
|
|
435
435
|
this._handleMouseMoveDolly(r);
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case S.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 !== S.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 = S.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 = S.TOUCH_PAN;
|
|
460
460
|
break;
|
|
461
461
|
default:
|
|
462
|
-
this.state =
|
|
462
|
+
this.state = S.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 = S.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 = S.TOUCH_DOLLY_ROTATE;
|
|
474
474
|
break;
|
|
475
475
|
default:
|
|
476
|
-
this.state =
|
|
476
|
+
this.state = S.NONE;
|
|
477
477
|
}
|
|
478
478
|
break;
|
|
479
479
|
default:
|
|
480
|
-
this.state =
|
|
480
|
+
this.state = S.NONE;
|
|
481
481
|
}
|
|
482
|
-
this.state !==
|
|
482
|
+
this.state !== S.NONE && this.dispatchEvent(Kt);
|
|
483
483
|
}
|
|
484
484
|
function _s(r) {
|
|
485
485
|
switch (this._trackPointer(r), this.state) {
|
|
486
|
-
case
|
|
486
|
+
case S.TOUCH_ROTATE:
|
|
487
487
|
if (this.enableRotate === !1) return;
|
|
488
488
|
this._handleTouchMoveRotate(r), this.update();
|
|
489
489
|
break;
|
|
490
|
-
case
|
|
490
|
+
case S.TOUCH_PAN:
|
|
491
491
|
if (this.enablePan === !1) return;
|
|
492
492
|
this._handleTouchMovePan(r), this.update();
|
|
493
493
|
break;
|
|
494
|
-
case
|
|
494
|
+
case S.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 S.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 = S.NONE;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function $s(r) {
|
|
@@ -512,12 +512,12 @@ 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 Ce = new As(), F = new M(), he = new M(), k = new K(),
|
|
515
|
+
const Ce = new As(), F = new M(), he = 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" },
|
|
520
|
-
class ni extends
|
|
519
|
+
}, Tt = { type: "change" }, cn = { type: "mouseDown", mode: null }, un = { type: "mouseUp", mode: null }, An = { type: "objectChange" };
|
|
520
|
+
class ni extends On {
|
|
521
521
|
/**
|
|
522
522
|
* Constructs a new controls instance.
|
|
523
523
|
*
|
|
@@ -545,8 +545,8 @@ class ni extends En {
|
|
|
545
545
|
}), o[C] = y, i[C] = y, n[C] = y;
|
|
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(), A = new K(), u = new K(), h = new M(), d = new K(),
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart",
|
|
548
|
+
const l = new M(), c = new M(), A = new K(), u = new K(), h = new M(), d = new K(), p = new M(), m = new M(), f = new M(), g = 0, x = new M();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", A), a("worldQuaternionStart", u), a("cameraPosition", h), a("cameraQuaternion", d), a("pointStart", p), a("pointEnd", m), a("rotationAxis", f), a("rotationAngle", g), a("eye", x), 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";
|
|
@@ -573,7 +573,7 @@ class ni extends En {
|
|
|
573
573
|
if (!(this.object === void 0 || this.dragging === !0 || e != null && e.button !== 0) && this.axis !== null) {
|
|
574
574
|
e !== null && Ce.setFromCamera(e, this.camera);
|
|
575
575
|
const t = Ot(this._plane, Ce, !0);
|
|
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,
|
|
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
|
}
|
|
579
579
|
pointerMove(e) {
|
|
@@ -596,13 +596,13 @@ class ni extends En {
|
|
|
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
|
-
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(
|
|
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(An);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
pointerUp(e) {
|
|
605
|
-
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (
|
|
605
|
+
e !== null && e.button !== 0 || (this.dragging && this.axis !== null && (un.mode = this.mode, this.dispatchEvent(un)), this.dragging = !1, this.axis = null);
|
|
606
606
|
}
|
|
607
607
|
dispose() {
|
|
608
608
|
this.disconnect(), this._root.dispose();
|
|
@@ -628,7 +628,7 @@ class ni extends En {
|
|
|
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(An), 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
|
|
@@ -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(), L = new M(0, 1, 0),
|
|
752
|
+
const ut = new hs(), L = new M(0, 1, 0), dn = new M(0, 0, 0), hn = new me(), At = new K(), mt = new K(), oe = new M(), fn = new me(), Ve = new M(1, 0, 0), we = new M(0, 1, 0), Ye = new M(0, 0, 1), dt = 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;
|
|
@@ -802,8 +802,8 @@ class ci extends ke {
|
|
|
802
802
|
h.color.setHex(16776960), h.opacity = 0.25;
|
|
803
803
|
const d = e.clone();
|
|
804
804
|
d.color.setHex(16776960);
|
|
805
|
-
const
|
|
806
|
-
|
|
805
|
+
const p = e.clone();
|
|
806
|
+
p.color.setHex(7895160), this.materialLib = {
|
|
807
807
|
xAxis: i,
|
|
808
808
|
yAxis: o,
|
|
809
809
|
zAxis: a,
|
|
@@ -813,8 +813,8 @@ class ci extends ke {
|
|
|
813
813
|
zAxisTransparent: A,
|
|
814
814
|
activeTransparent: h
|
|
815
815
|
};
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const m = new U(0, 0.04, 0.1, 12);
|
|
817
|
+
m.translate(0, 0.05, 0);
|
|
818
818
|
const f = new q(0.08, 0.08, 0.08);
|
|
819
819
|
f.translate(0, 0.04, 0);
|
|
820
820
|
const g = new We();
|
|
@@ -831,18 +831,18 @@ class ci extends ke {
|
|
|
831
831
|
}
|
|
832
832
|
const w = {
|
|
833
833
|
X: [
|
|
834
|
-
[new v(
|
|
835
|
-
[new v(
|
|
834
|
+
[new v(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
|
+
[new v(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
836
|
[new v(x, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
|
-
[new v(
|
|
840
|
-
[new v(
|
|
839
|
+
[new v(m, o), [0, 0.5, 0]],
|
|
840
|
+
[new v(m, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
841
|
[new v(x, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
|
-
[new v(
|
|
845
|
-
[new v(
|
|
844
|
+
[new v(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
|
+
[new v(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
846
|
[new v(x, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
@@ -882,7 +882,7 @@ class ci extends ke {
|
|
|
882
882
|
XZ: [
|
|
883
883
|
[new v(new q(0.2, 0.2, 0.01), s), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
|
|
884
884
|
]
|
|
885
|
-
},
|
|
885
|
+
}, H = {
|
|
886
886
|
START: [
|
|
887
887
|
[new v(new lt(0.01, 2), n), null, null, null, "helper"]
|
|
888
888
|
],
|
|
@@ -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), p), null, [0, Math.PI / 2, 0]]
|
|
907
907
|
],
|
|
908
908
|
X: [
|
|
909
909
|
[new v(C(0.5, 0.5), i)]
|
|
@@ -1007,12 +1007,12 @@ class ci extends ke {
|
|
|
1007
1007
|
for (let Ee = $[ne].length; Ee--; ) {
|
|
1008
1008
|
const B = $[ne][Ee][0].clone(), ot = $[ne][Ee][1], rt = $[ne][Ee][2], at = $[ne][Ee][3], Jn = $[ne][Ee][4];
|
|
1009
1009
|
B.name = ne, 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
|
-
const
|
|
1011
|
-
|
|
1010
|
+
const _t = B.geometry.clone();
|
|
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(ye)), 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(
|
|
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(ye)), 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(H)), 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(L.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(L.copy(we).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(L.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(
|
|
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(L.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(L.copy(we).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(L.copy(Ye).applyQuaternion(s).dot(this.eye)) > 0.9 && (o.visible = !1)), this.axis === "XYZE" && (k.setFromEuler(ut.set(0, Math.PI / 2, 0)), L.copy(this.rotationAxis), o.quaternion.setFromRotationMatrix(hn.lookAt(dn, L, we)), 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(L.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(L.copy(we).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.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(L.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(L.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(L.copy(we).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (At.copy(s), L.copy(this.eye).applyQuaternion(k.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(
|
|
1031
|
+
o.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (o.name === "X" && Math.abs(L.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(L.copy(we).applyQuaternion(s).dot(this.eye)) > 0.99 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1), o.name === "Z" && Math.abs(L.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(L.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(L.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(L.copy(we).applyQuaternion(s).dot(this.eye)) < 0.2 && (o.scale.set(1e-10, 1e-10, 1e-10), o.visible = !1)) : this.mode === "rotate" && (At.copy(s), L.copy(this.eye).applyQuaternion(k.copy(s).invert()), o.name.search("E") !== -1 && o.quaternion.setFromRotationMatrix(hn.lookAt(this.eye, dn, we)), o.name === "X" && (k.setFromAxisAngle(Ve, Math.atan2(-L.y, L.z)), k.multiplyQuaternions(At, k), o.quaternion.copy(k)), o.name === "Y" && (k.setFromAxisAngle(we, Math.atan2(L.x, L.z)), k.multiplyQuaternions(At, k), o.quaternion.copy(k)), o.name === "Z" && (k.setFromAxisAngle(Ye, Math.atan2(L.y, L.x)), k.multiplyQuaternions(At, 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
|
}
|
|
@@ -1039,7 +1039,7 @@ class ui extends v {
|
|
|
1039
1039
|
constructor() {
|
|
1040
1040
|
super(
|
|
1041
1041
|
new fs(1e5, 1e5, 2, 2),
|
|
1042
|
-
new Pe({ visible: !1, wireframe: !0, side:
|
|
1042
|
+
new Pe({ visible: !1, wireframe: !0, side: Rn, transparent: !0, opacity: 0.1, toneMapped: !1 })
|
|
1043
1043
|
), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
|
|
1044
1044
|
}
|
|
1045
1045
|
updateMatrixWorld(e) {
|
|
@@ -1076,7 +1076,7 @@ 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) : (
|
|
1079
|
+
oe.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (fn.lookAt(F.set(0, 0, 0), oe, L), this.quaternion.setFromRotationMatrix(fn)), super.updateMatrixWorld(e);
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
class Ai extends ke {
|
|
@@ -1096,7 +1096,7 @@ 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
|
|
1099
|
+
const He = new M(), pn = new me(), mn = new me(), gn = new M(), bn = new M();
|
|
1100
1100
|
class di {
|
|
1101
1101
|
/**
|
|
1102
1102
|
* Constructs a new CSS2D renderer.
|
|
@@ -1114,55 +1114,55 @@ 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(p, m) {
|
|
1118
|
+
p.matrixWorldAutoUpdate === !0 && p.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), pn.copy(m.matrixWorldInverse), mn.multiplyMatrices(m.projectionMatrix, pn), A(p, p, m), this.sortObjects && d(p);
|
|
1119
|
+
}, this.setSize = function(p, m) {
|
|
1120
|
+
s = p, n = m, i = s / 2, o = n / 2, l.style.width = p + "px", l.style.height = m + "px";
|
|
1121
1121
|
};
|
|
1122
|
-
function c(
|
|
1123
|
-
|
|
1124
|
-
for (let
|
|
1125
|
-
c(
|
|
1122
|
+
function c(p) {
|
|
1123
|
+
p.isCSS2DObject && (p.element.style.display = "none");
|
|
1124
|
+
for (let m = 0, f = p.children.length; m < f; m++)
|
|
1125
|
+
c(p.children[m]);
|
|
1126
1126
|
}
|
|
1127
|
-
function A(
|
|
1128
|
-
if (
|
|
1129
|
-
c(
|
|
1127
|
+
function A(p, m, f) {
|
|
1128
|
+
if (p.visible === !1) {
|
|
1129
|
+
c(p);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
|
-
if (
|
|
1133
|
-
|
|
1134
|
-
const g =
|
|
1135
|
-
x.style.display = g === !0 ? "" : "none", g === !0 && (
|
|
1132
|
+
if (p.isCSS2DObject) {
|
|
1133
|
+
He.setFromMatrixPosition(p.matrixWorld), He.applyMatrix4(mn);
|
|
1134
|
+
const g = He.z >= -1 && He.z <= 1 && p.layers.test(f.layers) === !0, x = p.element;
|
|
1135
|
+
x.style.display = g === !0 ? "" : "none", g === !0 && (p.onBeforeRender(t, m, f), x.style.transform = "translate(" + -100 * p.center.x + "%," + -100 * p.center.y + "%)translate(" + (He.x * i + i) + "px," + (-He.y * o + o) + "px)", x.parentNode !== l && l.appendChild(x), p.onAfterRender(t, m, f));
|
|
1136
1136
|
const C = {
|
|
1137
|
-
distanceToCameraSquared: u(f,
|
|
1137
|
+
distanceToCameraSquared: u(f, p)
|
|
1138
1138
|
};
|
|
1139
|
-
a.objects.set(
|
|
1139
|
+
a.objects.set(p, C);
|
|
1140
1140
|
}
|
|
1141
|
-
for (let g = 0, x =
|
|
1142
|
-
A(
|
|
1141
|
+
for (let g = 0, x = p.children.length; g < x; g++)
|
|
1142
|
+
A(p.children[g], m, f);
|
|
1143
1143
|
}
|
|
1144
|
-
function u(
|
|
1145
|
-
return
|
|
1144
|
+
function u(p, m) {
|
|
1145
|
+
return gn.setFromMatrixPosition(p.matrixWorld), bn.setFromMatrixPosition(m.matrixWorld), gn.distanceToSquared(bn);
|
|
1146
1146
|
}
|
|
1147
|
-
function h(
|
|
1148
|
-
const
|
|
1149
|
-
return
|
|
1150
|
-
f.isCSS2DObject &&
|
|
1151
|
-
}),
|
|
1147
|
+
function h(p) {
|
|
1148
|
+
const m = [];
|
|
1149
|
+
return p.traverseVisible(function(f) {
|
|
1150
|
+
f.isCSS2DObject && m.push(f);
|
|
1151
|
+
}), m;
|
|
1152
1152
|
}
|
|
1153
|
-
function d(
|
|
1154
|
-
const
|
|
1153
|
+
function d(p) {
|
|
1154
|
+
const m = h(p).sort(function(g, x) {
|
|
1155
1155
|
if (g.renderOrder !== x.renderOrder)
|
|
1156
1156
|
return x.renderOrder - g.renderOrder;
|
|
1157
1157
|
const C = a.objects.get(g).distanceToCameraSquared, y = a.objects.get(x).distanceToCameraSquared;
|
|
1158
1158
|
return C - y;
|
|
1159
|
-
}), f =
|
|
1160
|
-
for (let g = 0, x =
|
|
1161
|
-
|
|
1159
|
+
}), f = m.length;
|
|
1160
|
+
for (let g = 0, x = m.length; g < x; g++)
|
|
1161
|
+
m[g].element.style.zIndex = f - g;
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
|
-
class
|
|
1165
|
+
class Gn {
|
|
1166
1166
|
constructor(e = {}) {
|
|
1167
1167
|
/** CSS2DObject 实例 */
|
|
1168
1168
|
Re(this, "css2dObject", null);
|
|
@@ -1377,7 +1377,7 @@ class Fn {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
const yt = /* @__PURE__ */ new WeakMap();
|
|
1380
|
-
function
|
|
1380
|
+
function Fn(r, e) {
|
|
1381
1381
|
const t = xt(r);
|
|
1382
1382
|
yt.set(t, e), t.userData._hasDataPanel = !0;
|
|
1383
1383
|
}
|
|
@@ -1434,7 +1434,7 @@ let Te = null, Bt = null, bt = null, ge = [];
|
|
|
1434
1434
|
const st = /* @__PURE__ */ new Map();
|
|
1435
1435
|
let Ct, It = null, $e = null, et = null;
|
|
1436
1436
|
function Ii(r, e = "edit", t) {
|
|
1437
|
-
I.container = r, I.mode = e, yi(), Ci(), wi(), t && (Zi(t.scene, e, t.dataPanels), t != null && t.camera && (I.defaultMainCamera = t.camera,
|
|
1437
|
+
I.container = r, I.mode = e, yi(), Ci(), wi(), t && (Zi(t.scene, e, t.dataPanels), t != null && t.camera && (I.defaultMainCamera = t.camera, qn(!0))), Mi(), vi(), Ct && I.orbitControls && (I.orbitControls.target.fromArray(Ct), I.orbitControls.update()), Fi(), Xn(), $e = (s) => Ri(s), et = () => Pi(), e === "edit" && r.addEventListener("click", $e), window.addEventListener("resize", et), t || Di(), e === "edit" && xi();
|
|
1438
1438
|
}
|
|
1439
1439
|
function yi() {
|
|
1440
1440
|
const r = new P.WebGLRenderer({ antialias: !0, alpha: !0 });
|
|
@@ -1456,7 +1456,7 @@ function wi() {
|
|
|
1456
1456
|
const r = I.container, e = r.clientWidth / r.clientHeight, t = new P.PerspectiveCamera(45, e, 0.1, 1e3);
|
|
1457
1457
|
t.position.set(0, 6, 15), t.lookAt(0, 0, 0), I.camera = t;
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function qn(r = !1) {
|
|
1460
1460
|
if (!I.defaultMainCamera) return;
|
|
1461
1461
|
const e = I.defaultMainCamera;
|
|
1462
1462
|
if (r) {
|
|
@@ -1533,9 +1533,9 @@ function Di() {
|
|
|
1533
1533
|
const r = new P.AmbientLight(16777215, 1);
|
|
1534
1534
|
I.scene.add(r);
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function Xn() {
|
|
1537
1537
|
var r, e;
|
|
1538
|
-
It = requestAnimationFrame(
|
|
1538
|
+
It = requestAnimationFrame(Xn), nt.update(), (r = I.orbitControls) == null || r.update(), (e = I.renderer) == null || e.render(I.scene, I.camera), I.scene && I.camera && pi(I.scene, I.camera), I.scene && I.scene.traverse((t) => {
|
|
1539
1539
|
if (t.userData.isWater && t.type === "Mesh") {
|
|
1540
1540
|
const s = t, n = s.material;
|
|
1541
1541
|
if (n.normalMap) {
|
|
@@ -1551,7 +1551,7 @@ function Pi() {
|
|
|
1551
1551
|
r === 0 || e === 0 || (I.camera.aspect = r / e, I.camera.updateProjectionMatrix(), I.renderer.setSize(r, e), mi(r, e));
|
|
1552
1552
|
}
|
|
1553
1553
|
function Qt(r) {
|
|
1554
|
-
I.selectedObject !== r && (I.selectedObject && I.transformControls.detach(), I.selectedObject = r, I.transformControls.attach(r), I.transformControls.setMode(I.transformControlsMode), I.transformControls.showX = !0, I.transformControls.showY = !0, I.transformControls.showZ = !0,
|
|
1554
|
+
I.selectedObject !== r && (I.selectedObject && I.transformControls.detach(), I.selectedObject = r, I.transformControls.attach(r), I.transformControls.setMode(I.transformControlsMode), I.transformControls.showX = !0, I.transformControls.showY = !0, I.transformControls.showZ = !0, Bn(r), console.log("选中", I.selectedObject), Te == null || Te(r));
|
|
1555
1555
|
}
|
|
1556
1556
|
let J = null;
|
|
1557
1557
|
function Ti(r) {
|
|
@@ -1563,8 +1563,8 @@ function Et(r) {
|
|
|
1563
1563
|
function Oi(r) {
|
|
1564
1564
|
I.transformControlsMode = r, I.transformControls && I.transformControls.setMode(I.transformControlsMode);
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1566
|
+
function Bn(r) {
|
|
1567
|
+
Un(), r.traverse((e) => {
|
|
1568
1568
|
if (e.isMesh) {
|
|
1569
1569
|
const t = e, s = new P.EdgesGeometry(t.geometry), n = new P.LineBasicMaterial({
|
|
1570
1570
|
color: bi,
|
|
@@ -1574,24 +1574,28 @@ function Un(r) {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
});
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function Un() {
|
|
1578
1578
|
for (const r of Xt)
|
|
1579
1579
|
r.parent && r.parent.remove(r), r.geometry.dispose(), r.material.dispose();
|
|
1580
1580
|
Xt = [];
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1583
|
-
I.selectedObject && (
|
|
1582
|
+
function Jt() {
|
|
1583
|
+
I.selectedObject && (Un(), I.transformControls.detach(), I.selectedObject = null, Te == null || Te(null));
|
|
1584
1584
|
}
|
|
1585
1585
|
function Ei(r) {
|
|
1586
|
-
|
|
1587
|
-
|
|
1586
|
+
if (!r) {
|
|
1587
|
+
console.warn("[selectModelHandle] 传入的 objectId 为空");
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
Si(r);
|
|
1591
|
+
let e = null;
|
|
1592
|
+
st.forEach((t) => {
|
|
1588
1593
|
t.userData.id == r && (e = t), t.children && t.children.forEach((s) => {
|
|
1589
1594
|
s.name && s.name.startsWith("DataPanel_") && (s.visible = !1);
|
|
1590
1595
|
});
|
|
1591
|
-
}),
|
|
1592
|
-
e.children.forEach((t) => {
|
|
1596
|
+
}), e && (e.children.forEach((t) => {
|
|
1593
1597
|
t.name && t.name.startsWith("DataPanel_") && (t.visible = !0);
|
|
1594
|
-
}),
|
|
1598
|
+
}), Bn(e));
|
|
1595
1599
|
}
|
|
1596
1600
|
function Ri(r) {
|
|
1597
1601
|
if (Oe) {
|
|
@@ -1609,12 +1613,12 @@ function Ri(r) {
|
|
|
1609
1613
|
});
|
|
1610
1614
|
const i = s.intersectObjects(n);
|
|
1611
1615
|
if (i.length > 0) {
|
|
1612
|
-
let o =
|
|
1616
|
+
let o = Hi(i[0].object);
|
|
1613
1617
|
Qt(o);
|
|
1614
1618
|
} else
|
|
1615
|
-
|
|
1619
|
+
Jt();
|
|
1616
1620
|
}
|
|
1617
|
-
function
|
|
1621
|
+
function Hi(r) {
|
|
1618
1622
|
if (r.type === "Line") {
|
|
1619
1623
|
const e = r.parent;
|
|
1620
1624
|
switch (e.type) {
|
|
@@ -1626,35 +1630,61 @@ function Si(r) {
|
|
|
1626
1630
|
}
|
|
1627
1631
|
return r;
|
|
1628
1632
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1633
|
+
function Si(r, e = 500) {
|
|
1634
|
+
var d;
|
|
1635
|
+
if (!I.camera || !I.orbitControls) {
|
|
1636
|
+
console.warn(
|
|
1637
|
+
"[focusOnObject] 编辑器尚未初始化或已销毁,无法执行聚焦操作。请确保已调用 initEditor()"
|
|
1638
|
+
);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (r == null || r === "") {
|
|
1642
|
+
console.warn("[focusOnObject] 传入的 objectId 为空,无法聚焦");
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1631
1645
|
let t = null;
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1646
|
+
if ((d = I.scene) == null || d.traverse((p) => {
|
|
1647
|
+
p.userData.id == r && (t = p);
|
|
1648
|
+
}), !t) {
|
|
1649
|
+
console.warn(
|
|
1650
|
+
`[focusOnObject] 在场景中未找到 userData.id 为 "${r}" 的物体。请确认:1) 物体已被正确添加到场景(addModel);2) 物体的 userData.id 与传入的 objectId 一致;3) 传入的 objectId 不为空`
|
|
1651
|
+
);
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
let s = null;
|
|
1655
|
+
t.userData.closeUpView && typeof t.userData.closeUpView.x == "number" && typeof t.userData.closeUpView.y == "number" && typeof t.userData.closeUpView.z == "number" && (s = t.userData.closeUpView);
|
|
1656
|
+
const n = new P.Vector3();
|
|
1657
|
+
t.getWorldPosition(n);
|
|
1658
|
+
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();
|
|
1659
|
+
c.lengthSq() < 1e-3 && c.set(0, 0, 1);
|
|
1660
|
+
const A = n.clone().add(c.multiplyScalar(l)), u = I.camera.position.clone(), h = I.orbitControls.target.clone();
|
|
1661
|
+
try {
|
|
1662
|
+
new nt.Tween({
|
|
1663
|
+
x: u.x,
|
|
1664
|
+
y: u.y,
|
|
1665
|
+
z: u.z,
|
|
1666
|
+
tx: h.x,
|
|
1667
|
+
ty: h.y,
|
|
1668
|
+
tz: h.z
|
|
1669
|
+
}).to(
|
|
1670
|
+
{
|
|
1671
|
+
x: s ? s.x : A.x,
|
|
1672
|
+
y: s ? s.y : A.y,
|
|
1673
|
+
z: s ? s.z : A.z,
|
|
1674
|
+
tx: n.x,
|
|
1675
|
+
ty: n.y,
|
|
1676
|
+
tz: n.z
|
|
1677
|
+
},
|
|
1678
|
+
e
|
|
1679
|
+
).easing(nt.Easing.Quadratic.InOut).onUpdate((p) => {
|
|
1680
|
+
I.camera.position.set(p.x, p.y, p.z), I.orbitControls.target.set(p.tx, p.ty, p.tz), I.orbitControls.update();
|
|
1681
|
+
}).start();
|
|
1682
|
+
} catch (p) {
|
|
1683
|
+
console.error(
|
|
1684
|
+
"[focusOnObject] TWEEN 动画创建失败,请检查 @tweenjs/tween.js 是否已正确安装且版本兼容(^23.1.3):",
|
|
1685
|
+
p
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1658
1688
|
}
|
|
1659
1689
|
function Li(r) {
|
|
1660
1690
|
r.userData.id && st.set(String(r.userData.id), r);
|
|
@@ -1674,7 +1704,7 @@ function ze(r, e = !1) {
|
|
|
1674
1704
|
I.scene.add(r), r.userData.isMovable && (zi(r), vt()), e && I.mode === "edit" && Qt(r);
|
|
1675
1705
|
}
|
|
1676
1706
|
function ki(r) {
|
|
1677
|
-
I.selectedObject === r &&
|
|
1707
|
+
I.selectedObject === r && Jt(), ji(r), Ni(r), r.userData.helper && I.scene.remove(r.userData.helper), r.parent ? r.parent.remove(r) : I.scene.remove(r), Gi(r), vt();
|
|
1678
1708
|
}
|
|
1679
1709
|
function Wi(r) {
|
|
1680
1710
|
const e = I.scene.getObjectByProperty("uuid", r);
|
|
@@ -1730,7 +1760,7 @@ function Ra() {
|
|
|
1730
1760
|
}
|
|
1731
1761
|
async function Ki() {
|
|
1732
1762
|
var c, A, u;
|
|
1733
|
-
J == null || J(!0), await new Promise((h) => setTimeout(h, 50)),
|
|
1763
|
+
J == null || J(!0), await new Promise((h) => setTimeout(h, 50)), Jt();
|
|
1734
1764
|
const r = I.scene;
|
|
1735
1765
|
if (!r)
|
|
1736
1766
|
return J == null || J(!1), "{}";
|
|
@@ -1738,26 +1768,26 @@ async function Ki() {
|
|
|
1738
1768
|
r.traverse((h) => {
|
|
1739
1769
|
var d;
|
|
1740
1770
|
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_")) {
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1743
|
-
const
|
|
1771
|
+
const p = h;
|
|
1772
|
+
if (p.element) {
|
|
1773
|
+
const m = p.element.querySelector(
|
|
1744
1774
|
"[data-panel-title]"
|
|
1745
1775
|
), f = [];
|
|
1746
|
-
|
|
1776
|
+
p.element.querySelectorAll(
|
|
1747
1777
|
".css2d-data-panel-item"
|
|
1748
1778
|
).forEach((x) => {
|
|
1749
|
-
var w, D,
|
|
1779
|
+
var w, D, H;
|
|
1750
1780
|
const C = x.querySelector(".item-label"), y = x.querySelector(".item-value");
|
|
1751
1781
|
if (C && y) {
|
|
1752
1782
|
const Z = (C.textContent || "").trim(), _ = ((D = (w = y.childNodes[0]) == null ? void 0 : w.textContent) == null ? void 0 : D.trim()) || "", Q = y.querySelector(
|
|
1753
1783
|
"span"
|
|
1754
|
-
), ye = Q ? (Q.textContent || "").trim() : void 0, Mt = ((
|
|
1784
|
+
), ye = Q ? (Q.textContent || "").trim() : void 0, Mt = ((H = x.getAttribute("data-item-code")) == null ? void 0 : H.trim()) || void 0;
|
|
1755
1785
|
f.push({ label: Z, value: _, unit: ye, code: Mt });
|
|
1756
1786
|
}
|
|
1757
1787
|
}), h.parent && s.set(
|
|
1758
1788
|
h.parent.userData.id ? h.parent.userData.id : h.parent.uuid,
|
|
1759
1789
|
{
|
|
1760
|
-
title: ((d =
|
|
1790
|
+
title: ((d = m == null ? void 0 : m.textContent) == null ? void 0 : d.trim()) || "",
|
|
1761
1791
|
items: f
|
|
1762
1792
|
}
|
|
1763
1793
|
);
|
|
@@ -1797,11 +1827,11 @@ function Zi(r, e = "edit", t) {
|
|
|
1797
1827
|
const A = c.userData.id || c.uuid, u = t[A];
|
|
1798
1828
|
if (u && c.userData.isMovable) {
|
|
1799
1829
|
Li(c);
|
|
1800
|
-
const h = new
|
|
1830
|
+
const h = new Gn({
|
|
1801
1831
|
title: u.title,
|
|
1802
1832
|
items: u.items
|
|
1803
1833
|
});
|
|
1804
|
-
h.attachTo(c), h.visible = !1, console.log("panel", h),
|
|
1834
|
+
h.attachTo(c), h.visible = !1, console.log("panel", h), Fn(c, h);
|
|
1805
1835
|
}
|
|
1806
1836
|
})), e === "edit" && ((l = I.scene) == null || l.traverse((c) => {
|
|
1807
1837
|
var A;
|
|
@@ -1829,7 +1859,7 @@ function Vn(r) {
|
|
|
1829
1859
|
function Qi() {
|
|
1830
1860
|
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 = "", ge = [], st.clear(), vt(), gt = !1, Oe = !1;
|
|
1831
1861
|
}
|
|
1832
|
-
const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /,
|
|
1862
|
+
const Ji = /^[og]\s*(.+)?/, _i = /^mtllib /, $i = /^usemtl /, eo = /^usemap /, In = /\s+/, yn = new M(), Rt = new M(), Cn = new M(), xn = new M(), ee = new M(), ht = new de();
|
|
1833
1863
|
function to() {
|
|
1834
1864
|
const r = {
|
|
1835
1865
|
objects: [],
|
|
@@ -1939,7 +1969,7 @@ function to() {
|
|
|
1939
1969
|
},
|
|
1940
1970
|
addFaceNormal: function(e, t, s) {
|
|
1941
1971
|
const n = this.vertices, i = this.object.geometry.normals;
|
|
1942
|
-
|
|
1972
|
+
yn.fromArray(n, e), Rt.fromArray(n, t), Cn.fromArray(n, s), ee.subVectors(Cn, Rt), xn.subVectors(yn, Rt), ee.cross(xn), ee.normalize(), i.push(ee.x, ee.y, ee.z), i.push(ee.x, ee.y, ee.z), i.push(ee.x, ee.y, ee.z);
|
|
1943
1973
|
},
|
|
1944
1974
|
addColor: function(e, t, s) {
|
|
1945
1975
|
const n = this.colors, i = this.object.geometry.colors;
|
|
@@ -1961,13 +1991,13 @@ function to() {
|
|
|
1961
1991
|
const A = this.vertices.length;
|
|
1962
1992
|
let u = this.parseVertexIndex(e, A), h = this.parseVertexIndex(t, A), d = this.parseVertexIndex(s, A);
|
|
1963
1993
|
if (this.addVertex(u, h, d), this.addColor(u, h, d), a !== void 0 && a !== "") {
|
|
1964
|
-
const
|
|
1965
|
-
u = this.parseNormalIndex(a,
|
|
1994
|
+
const p = this.normals.length;
|
|
1995
|
+
u = this.parseNormalIndex(a, p), h = this.parseNormalIndex(l, p), d = this.parseNormalIndex(c, p), this.addNormal(u, h, d);
|
|
1966
1996
|
} else
|
|
1967
1997
|
this.addFaceNormal(u, h, d);
|
|
1968
1998
|
if (n !== void 0 && n !== "") {
|
|
1969
|
-
const
|
|
1970
|
-
u = this.parseUVIndex(n,
|
|
1999
|
+
const p = this.uvs.length;
|
|
2000
|
+
u = this.parseUVIndex(n, p), h = this.parseUVIndex(i, p), d = this.parseUVIndex(o, p), this.addUV(u, h, d), this.object.geometry.hasUVIndices = !0;
|
|
1971
2001
|
} else
|
|
1972
2002
|
this.addDefaultUV();
|
|
1973
2003
|
},
|
|
@@ -2048,7 +2078,7 @@ class no extends Yt {
|
|
|
2048
2078
|
const A = c.charAt(0);
|
|
2049
2079
|
if (A !== "#")
|
|
2050
2080
|
if (A === "v") {
|
|
2051
|
-
const u = c.split(
|
|
2081
|
+
const u = c.split(In);
|
|
2052
2082
|
switch (u[0]) {
|
|
2053
2083
|
case "v":
|
|
2054
2084
|
t.vertices.push(
|
|
@@ -2077,25 +2107,25 @@ class no extends Yt {
|
|
|
2077
2107
|
break;
|
|
2078
2108
|
}
|
|
2079
2109
|
} else if (A === "f") {
|
|
2080
|
-
const h = c.slice(1).trim().split(
|
|
2081
|
-
for (let
|
|
2082
|
-
const g = h[
|
|
2110
|
+
const h = c.slice(1).trim().split(In), d = [];
|
|
2111
|
+
for (let m = 0, f = h.length; m < f; m++) {
|
|
2112
|
+
const g = h[m];
|
|
2083
2113
|
if (g.length > 0) {
|
|
2084
2114
|
const x = g.split("/");
|
|
2085
2115
|
d.push(x);
|
|
2086
2116
|
}
|
|
2087
2117
|
}
|
|
2088
|
-
const
|
|
2089
|
-
for (let
|
|
2090
|
-
const g = d[
|
|
2118
|
+
const p = d[0];
|
|
2119
|
+
for (let m = 1, f = d.length - 1; m < f; m++) {
|
|
2120
|
+
const g = d[m], x = d[m + 1];
|
|
2091
2121
|
t.addFace(
|
|
2092
|
-
|
|
2122
|
+
p[0],
|
|
2093
2123
|
g[0],
|
|
2094
2124
|
x[0],
|
|
2095
|
-
|
|
2125
|
+
p[1],
|
|
2096
2126
|
g[1],
|
|
2097
2127
|
x[1],
|
|
2098
|
-
|
|
2128
|
+
p[2],
|
|
2099
2129
|
g[2],
|
|
2100
2130
|
x[2]
|
|
2101
2131
|
);
|
|
@@ -2107,8 +2137,8 @@ class no extends Yt {
|
|
|
2107
2137
|
if (c.indexOf("/") === -1)
|
|
2108
2138
|
h = u;
|
|
2109
2139
|
else
|
|
2110
|
-
for (let
|
|
2111
|
-
const f = u[
|
|
2140
|
+
for (let p = 0, m = u.length; p < m; p++) {
|
|
2141
|
+
const f = u[p].split("/");
|
|
2112
2142
|
f[0] !== "" && h.push(f[0]), f[1] !== "" && d.push(f[1]);
|
|
2113
2143
|
}
|
|
2114
2144
|
t.addLineGeometry(h, d);
|
|
@@ -2142,34 +2172,34 @@ class no extends Yt {
|
|
|
2142
2172
|
if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
|
|
2143
2173
|
for (let a = 0, l = t.objects.length; a < l; a++) {
|
|
2144
2174
|
const c = t.objects[a], A = c.geometry, u = c.materials, h = A.type === "Line", d = A.type === "Points";
|
|
2145
|
-
let
|
|
2175
|
+
let p = !1;
|
|
2146
2176
|
if (A.vertices.length === 0) continue;
|
|
2147
|
-
const
|
|
2148
|
-
|
|
2177
|
+
const m = new We();
|
|
2178
|
+
m.setAttribute("position", new pe(A.vertices, 3)), A.normals.length > 0 && m.setAttribute("normal", new pe(A.normals, 3)), A.colors.length > 0 && (p = !0, m.setAttribute("color", new pe(A.colors, 3))), A.hasUVIndices === !0 && m.setAttribute("uv", new pe(A.uvs, 2));
|
|
2149
2179
|
const f = [];
|
|
2150
2180
|
for (let x = 0, C = u.length; x < C; x++) {
|
|
2151
|
-
const y = u[x], w = y.name + "_" + y.smooth + "_" +
|
|
2181
|
+
const y = u[x], w = y.name + "_" + y.smooth + "_" + p;
|
|
2152
2182
|
let D = t.materials[w];
|
|
2153
2183
|
if (this.materials !== null) {
|
|
2154
2184
|
if (D = this.materials.create(y.name), h && D && !(D instanceof Ze)) {
|
|
2155
|
-
const
|
|
2156
|
-
Qe.prototype.copy.call(
|
|
2185
|
+
const H = new Ze();
|
|
2186
|
+
Qe.prototype.copy.call(H, D), H.color.copy(D.color), D = H;
|
|
2157
2187
|
} else if (d && D && !(D instanceof Ue)) {
|
|
2158
|
-
const
|
|
2159
|
-
Qe.prototype.copy.call(
|
|
2188
|
+
const H = new Ue({ size: 10, sizeAttenuation: !1 });
|
|
2189
|
+
Qe.prototype.copy.call(H, D), H.color.copy(D.color), H.map = D.map, D = H;
|
|
2160
2190
|
}
|
|
2161
2191
|
}
|
|
2162
|
-
D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors =
|
|
2192
|
+
D === void 0 && (h ? D = new Ze() : d ? D = new Ue({ size: 1, sizeAttenuation: !1 }) : D = new ps(), D.name = y.name, D.flatShading = !y.smooth, D.vertexColors = p, t.materials[w] = D), f.push(D);
|
|
2163
2193
|
}
|
|
2164
2194
|
let g;
|
|
2165
2195
|
if (f.length > 1) {
|
|
2166
2196
|
for (let x = 0, C = u.length; x < C; x++) {
|
|
2167
2197
|
const y = u[x];
|
|
2168
|
-
|
|
2198
|
+
m.addGroup(y.groupStart, y.groupCount, x);
|
|
2169
2199
|
}
|
|
2170
|
-
h ? g = new Wt(
|
|
2200
|
+
h ? g = new Wt(m, f) : d ? g = new pt(m, f) : g = new v(m, f);
|
|
2171
2201
|
} else
|
|
2172
|
-
h ? g = new Wt(
|
|
2202
|
+
h ? g = new Wt(m, f[0]) : d ? g = new pt(m, f[0]) : g = new v(m, f[0]);
|
|
2173
2203
|
g.name = c.name, i.add(g);
|
|
2174
2204
|
}
|
|
2175
2205
|
else if (t.vertices.length > 0) {
|
|
@@ -2181,7 +2211,7 @@ class no extends Yt {
|
|
|
2181
2211
|
return i;
|
|
2182
2212
|
}
|
|
2183
2213
|
}
|
|
2184
|
-
function
|
|
2214
|
+
function wn(r, e) {
|
|
2185
2215
|
if (e === ms)
|
|
2186
2216
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), r;
|
|
2187
2217
|
if (e === zt || e === Hn) {
|
|
@@ -2263,9 +2293,9 @@ class io extends Yt {
|
|
|
2263
2293
|
}), this.register(function(t) {
|
|
2264
2294
|
return new ro(t);
|
|
2265
2295
|
}), this.register(function(t) {
|
|
2266
|
-
return new
|
|
2296
|
+
return new vn(t, O.EXT_MESHOPT_COMPRESSION);
|
|
2267
2297
|
}), this.register(function(t) {
|
|
2268
|
-
return new
|
|
2298
|
+
return new vn(t, O.KHR_MESHOPT_COMPRESSION);
|
|
2269
2299
|
}), this.register(function(t) {
|
|
2270
2300
|
return new wo(t);
|
|
2271
2301
|
});
|
|
@@ -2754,7 +2784,7 @@ class xo {
|
|
|
2754
2784
|
return s.loadTextureImage(e, o.source, l);
|
|
2755
2785
|
}
|
|
2756
2786
|
}
|
|
2757
|
-
class
|
|
2787
|
+
class vn {
|
|
2758
2788
|
constructor(e, t) {
|
|
2759
2789
|
this.name = t, this.parser = e;
|
|
2760
2790
|
}
|
|
@@ -2797,22 +2827,22 @@ class wo {
|
|
|
2797
2827
|
a.push(this.parser.getDependency("accessor", o[c]).then((A) => (l[c] = A, l[c])));
|
|
2798
2828
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
2799
2829
|
const A = c.pop(), u = A.isGroup ? A.children : [A], h = c[0].count, d = [];
|
|
2800
|
-
for (const
|
|
2801
|
-
const
|
|
2830
|
+
for (const p of u) {
|
|
2831
|
+
const m = new me(), f = new M(), g = new K(), x = new M(1, 1, 1), C = new ys(p.geometry, p.material, h);
|
|
2802
2832
|
for (let y = 0; y < h; y++)
|
|
2803
|
-
l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y,
|
|
2833
|
+
l.TRANSLATION && f.fromBufferAttribute(l.TRANSLATION, y), l.ROTATION && g.fromBufferAttribute(l.ROTATION, y), l.SCALE && x.fromBufferAttribute(l.SCALE, y), C.setMatrixAt(y, m.compose(f, g, x));
|
|
2804
2834
|
for (const y in l)
|
|
2805
2835
|
if (y === "_COLOR_0") {
|
|
2806
2836
|
const w = l[y];
|
|
2807
2837
|
C.instanceColor = new Cs(w.array, w.itemSize, w.normalized);
|
|
2808
|
-
} else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" &&
|
|
2809
|
-
ke.prototype.copy.call(C,
|
|
2838
|
+
} else y !== "TRANSLATION" && y !== "ROTATION" && y !== "SCALE" && p.geometry.setAttribute(y, l[y]);
|
|
2839
|
+
ke.prototype.copy.call(C, p), this.parser.assignFinalMaterial(C), d.push(C);
|
|
2810
2840
|
}
|
|
2811
2841
|
return A.isGroup ? (A.clear(), A.add(...d), A) : d[0];
|
|
2812
2842
|
}));
|
|
2813
2843
|
}
|
|
2814
2844
|
}
|
|
2815
|
-
const Kn = "glTF", Xe = 12,
|
|
2845
|
+
const Kn = "glTF", Xe = 12, Mn = { JSON: 1313821514, BIN: 5130562 };
|
|
2816
2846
|
class vo {
|
|
2817
2847
|
constructor(e) {
|
|
2818
2848
|
this.name = O.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
@@ -2831,10 +2861,10 @@ class vo {
|
|
|
2831
2861
|
const a = i.getUint32(o, !0);
|
|
2832
2862
|
o += 4;
|
|
2833
2863
|
const l = i.getUint32(o, !0);
|
|
2834
|
-
if (o += 4, l ===
|
|
2864
|
+
if (o += 4, l === Mn.JSON) {
|
|
2835
2865
|
const c = new Uint8Array(e, Xe + o, a);
|
|
2836
2866
|
this.content = s.decode(c);
|
|
2837
|
-
} else if (l ===
|
|
2867
|
+
} else if (l === Mn.BIN) {
|
|
2838
2868
|
const c = Xe + o;
|
|
2839
2869
|
this.body = e.slice(c, c + a);
|
|
2840
2870
|
}
|
|
@@ -2866,9 +2896,9 @@ class Mo {
|
|
|
2866
2896
|
return t.getDependency("bufferView", i).then(function(A) {
|
|
2867
2897
|
return new Promise(function(u, h) {
|
|
2868
2898
|
n.decodeDracoFile(A, function(d) {
|
|
2869
|
-
for (const
|
|
2870
|
-
const
|
|
2871
|
-
f !== void 0 && (
|
|
2899
|
+
for (const p in d.attributes) {
|
|
2900
|
+
const m = d.attributes[p], f = l[p];
|
|
2901
|
+
f !== void 0 && (m.normalized = f);
|
|
2872
2902
|
}
|
|
2873
2903
|
u(d);
|
|
2874
2904
|
}, a, c, ae, h);
|
|
@@ -2900,10 +2930,10 @@ class Zn extends zs {
|
|
|
2900
2930
|
return t;
|
|
2901
2931
|
}
|
|
2902
2932
|
interpolate_(e, t, s, n) {
|
|
2903
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u,
|
|
2933
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, A = n - t, u = (s - t) / A, h = u * u, d = h * u, p = e * c, m = p - c, f = -2 * d + 3 * h, g = d - h, x = 1 - f, C = g - h + u;
|
|
2904
2934
|
for (let y = 0; y !== a; y++) {
|
|
2905
|
-
const w = o[
|
|
2906
|
-
i[y] = x * w + C * D + f *
|
|
2935
|
+
const w = o[m + y + a], D = o[m + y + l] * A, H = o[p + y + a], Z = o[p + y] * A;
|
|
2936
|
+
i[y] = x * w + C * D + f * H + g * Z;
|
|
2907
2937
|
}
|
|
2908
2938
|
return i;
|
|
2909
2939
|
}
|
|
@@ -2930,18 +2960,18 @@ const te = {
|
|
|
2930
2960
|
5123: Uint16Array,
|
|
2931
2961
|
5125: Uint32Array,
|
|
2932
2962
|
5126: Float32Array
|
|
2933
|
-
},
|
|
2934
|
-
9728:
|
|
2963
|
+
}, Dn = {
|
|
2964
|
+
9728: jn,
|
|
2935
2965
|
9729: Gt,
|
|
2936
2966
|
9984: Ds,
|
|
2937
2967
|
9985: Ms,
|
|
2938
2968
|
9986: vs,
|
|
2939
|
-
9987:
|
|
2940
|
-
},
|
|
2969
|
+
9987: Nn
|
|
2970
|
+
}, Pn = {
|
|
2941
2971
|
33071: Ts,
|
|
2942
2972
|
33648: Ps,
|
|
2943
2973
|
10497: Ft
|
|
2944
|
-
},
|
|
2974
|
+
}, Ht = {
|
|
2945
2975
|
SCALAR: 1,
|
|
2946
2976
|
VEC2: 2,
|
|
2947
2977
|
VEC3: 3,
|
|
@@ -2969,15 +2999,15 @@ const te = {
|
|
|
2969
2999
|
CUBICSPLINE: void 0,
|
|
2970
3000
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
2971
3001
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
2972
|
-
LINEAR:
|
|
3002
|
+
LINEAR: Wn,
|
|
2973
3003
|
STEP: ks
|
|
2974
|
-
},
|
|
3004
|
+
}, St = {
|
|
2975
3005
|
OPAQUE: "OPAQUE",
|
|
2976
3006
|
MASK: "MASK",
|
|
2977
3007
|
BLEND: "BLEND"
|
|
2978
3008
|
};
|
|
2979
3009
|
function Ro(r) {
|
|
2980
|
-
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new
|
|
3010
|
+
return r.DefaultMaterial === void 0 && (r.DefaultMaterial = new kn({
|
|
2981
3011
|
color: 16777215,
|
|
2982
3012
|
emissive: 0,
|
|
2983
3013
|
metalness: 1,
|
|
@@ -2994,7 +3024,7 @@ function xe(r, e, t) {
|
|
|
2994
3024
|
function re(r, e) {
|
|
2995
3025
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(r.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
2996
3026
|
}
|
|
2997
|
-
function
|
|
3027
|
+
function Ho(r, e, t) {
|
|
2998
3028
|
let s = !1, n = !1, i = !1;
|
|
2999
3029
|
for (let c = 0, A = e.length; c < A; c++) {
|
|
3000
3030
|
const u = e[c];
|
|
@@ -3026,7 +3056,7 @@ function So(r, e, t) {
|
|
|
3026
3056
|
return s && (r.morphAttributes.position = A), n && (r.morphAttributes.normal = u), i && (r.morphAttributes.color = h), r.morphTargetsRelative = !0, r;
|
|
3027
3057
|
});
|
|
3028
3058
|
}
|
|
3029
|
-
function
|
|
3059
|
+
function So(r, e) {
|
|
3030
3060
|
if (r.updateMorphTargets(), e.weights !== void 0)
|
|
3031
3061
|
for (let t = 0, s = e.weights.length; t < s; t++)
|
|
3032
3062
|
r.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -3323,27 +3353,27 @@ class ko {
|
|
|
3323
3353
|
loadAccessor(e) {
|
|
3324
3354
|
const t = this, s = this.json, n = this.json.accessors[e];
|
|
3325
3355
|
if (n.bufferView === void 0 && n.sparse === void 0) {
|
|
3326
|
-
const o =
|
|
3356
|
+
const o = Ht[n.type], a = je[n.componentType], l = n.normalized === !0, c = new a(n.count * o);
|
|
3327
3357
|
return Promise.resolve(new _e(c, o, l));
|
|
3328
3358
|
}
|
|
3329
3359
|
const i = [];
|
|
3330
3360
|
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) {
|
|
3331
|
-
const a = o[0], l =
|
|
3332
|
-
let
|
|
3361
|
+
const a = o[0], l = Ht[n.type], c = je[n.componentType], A = c.BYTES_PER_ELEMENT, u = A * l, h = n.byteOffset || 0, d = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, p = n.normalized === !0;
|
|
3362
|
+
let m, f;
|
|
3333
3363
|
if (d && d !== u) {
|
|
3334
3364
|
const g = Math.floor(h / d), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + g + ":" + n.count;
|
|
3335
3365
|
let C = t.cache.get(x);
|
|
3336
|
-
C || (
|
|
3366
|
+
C || (m = new c(a, g * d, n.count * d / A), C = new Sn(m, d / A), t.cache.add(x, C)), f = new Ln(C, l, h % d / A, p);
|
|
3337
3367
|
} else
|
|
3338
|
-
a === null ?
|
|
3368
|
+
a === null ? m = new c(n.count * l) : m = new c(a, h, n.count * l), f = new _e(m, l, p);
|
|
3339
3369
|
if (n.sparse !== void 0) {
|
|
3340
|
-
const g =
|
|
3370
|
+
const g = Ht.SCALAR, x = je[n.sparse.indices.componentType], C = n.sparse.indices.byteOffset || 0, y = n.sparse.values.byteOffset || 0, w = new x(o[1], C, n.sparse.count * g), D = new c(o[2], y, n.sparse.count * l);
|
|
3341
3371
|
a !== null && (f = new _e(f.array.slice(), f.itemSize, f.normalized)), f.normalized = !1;
|
|
3342
|
-
for (let
|
|
3343
|
-
const _ = w[
|
|
3344
|
-
if (f.setX(_, D[
|
|
3372
|
+
for (let H = 0, Z = w.length; H < Z; H++) {
|
|
3373
|
+
const _ = w[H];
|
|
3374
|
+
if (f.setX(_, D[H * l]), l >= 2 && f.setY(_, D[H * l + 1]), l >= 3 && f.setZ(_, D[H * l + 2]), l >= 4 && f.setW(_, D[H * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
3345
3375
|
}
|
|
3346
|
-
f.normalized =
|
|
3376
|
+
f.normalized = p;
|
|
3347
3377
|
}
|
|
3348
3378
|
return f;
|
|
3349
3379
|
});
|
|
@@ -3371,7 +3401,7 @@ class ko {
|
|
|
3371
3401
|
const c = this.loadImageSource(t, s).then(function(A) {
|
|
3372
3402
|
A.flipY = !1, A.name = o.name || a.name || "", A.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (A.name = a.uri);
|
|
3373
3403
|
const h = (i.samplers || {})[o.sampler] || {};
|
|
3374
|
-
return A.magFilter =
|
|
3404
|
+
return A.magFilter = Dn[h.magFilter] || Gt, A.minFilter = Dn[h.minFilter] || Nn, A.wrapS = Pn[h.wrapS] || Ft, A.wrapT = Pn[h.wrapT] || Ft, A.generateMipmaps = !A.isCompressedTexture && A.minFilter !== jn && A.minFilter !== Gt, n.associations.set(A, { textures: e }), A;
|
|
3375
3405
|
}).catch(function() {
|
|
3376
3406
|
return null;
|
|
3377
3407
|
});
|
|
@@ -3393,11 +3423,11 @@ class ko {
|
|
|
3393
3423
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
3394
3424
|
const A = Promise.resolve(l).then(function(u) {
|
|
3395
3425
|
return new Promise(function(h, d) {
|
|
3396
|
-
let
|
|
3397
|
-
t.isImageBitmapLoader === !0 && (
|
|
3398
|
-
const f = new
|
|
3426
|
+
let p = h;
|
|
3427
|
+
t.isImageBitmapLoader === !0 && (p = function(m) {
|
|
3428
|
+
const f = new tn(m);
|
|
3399
3429
|
f.needsUpdate = !0, h(f);
|
|
3400
|
-
}), t.load(Je.resolveURL(u, i.path),
|
|
3430
|
+
}), t.load(Je.resolveURL(u, i.path), p, void 0, d);
|
|
3401
3431
|
});
|
|
3402
3432
|
}).then(function(u) {
|
|
3403
3433
|
return c === !0 && a.revokeObjectURL(l), re(u, o), u.userData.mimeType = o.mimeType || No(o.uri), u;
|
|
@@ -3462,7 +3492,7 @@ class ko {
|
|
|
3462
3492
|
e.material = s;
|
|
3463
3493
|
}
|
|
3464
3494
|
getMaterialType() {
|
|
3465
|
-
return
|
|
3495
|
+
return kn;
|
|
3466
3496
|
}
|
|
3467
3497
|
/**
|
|
3468
3498
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -3490,9 +3520,9 @@ class ko {
|
|
|
3490
3520
|
return h.extendMaterialParams && h.extendMaterialParams(e, a);
|
|
3491
3521
|
})));
|
|
3492
3522
|
}
|
|
3493
|
-
i.doubleSided === !0 && (a.side =
|
|
3494
|
-
const A = i.alphaMode ||
|
|
3495
|
-
if (A ===
|
|
3523
|
+
i.doubleSided === !0 && (a.side = Rn);
|
|
3524
|
+
const A = i.alphaMode || St.OPAQUE;
|
|
3525
|
+
if (A === St.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, A === St.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)) {
|
|
3496
3526
|
const u = i.normalTexture.scale;
|
|
3497
3527
|
a.normalScale.set(u, u);
|
|
3498
3528
|
}
|
|
@@ -3529,7 +3559,7 @@ class ko {
|
|
|
3529
3559
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
3530
3560
|
function i(a) {
|
|
3531
3561
|
return s[O.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(l) {
|
|
3532
|
-
return
|
|
3562
|
+
return Tn(l, a, t);
|
|
3533
3563
|
});
|
|
3534
3564
|
}
|
|
3535
3565
|
const o = [];
|
|
@@ -3539,7 +3569,7 @@ class ko {
|
|
|
3539
3569
|
o.push(u.promise);
|
|
3540
3570
|
else {
|
|
3541
3571
|
let h;
|
|
3542
|
-
c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h =
|
|
3572
|
+
c.extensions && c.extensions[O.KHR_DRACO_MESH_COMPRESSION] ? h = i(c) : h = Tn(new We(), c, t), n[A] = { primitive: c, promise: h }, o.push(h);
|
|
3543
3573
|
}
|
|
3544
3574
|
}
|
|
3545
3575
|
return Promise.all(o);
|
|
@@ -3559,25 +3589,25 @@ class ko {
|
|
|
3559
3589
|
}
|
|
3560
3590
|
return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
|
|
3561
3591
|
const c = l.slice(0, l.length - 1), A = l[l.length - 1], u = [];
|
|
3562
|
-
for (let d = 0,
|
|
3563
|
-
const
|
|
3592
|
+
for (let d = 0, p = A.length; d < p; d++) {
|
|
3593
|
+
const m = A[d], f = o[d];
|
|
3564
3594
|
let g;
|
|
3565
3595
|
const x = c[d];
|
|
3566
3596
|
if (f.mode === te.TRIANGLES || f.mode === te.TRIANGLE_STRIP || f.mode === te.TRIANGLE_FAN || f.mode === void 0)
|
|
3567
|
-
g = i.isSkinnedMesh === !0 ? new Es(
|
|
3597
|
+
g = i.isSkinnedMesh === !0 ? new Es(m, x) : new v(m, x), g.isSkinnedMesh === !0 && g.normalizeSkinWeights(), f.mode === te.TRIANGLE_STRIP ? g.geometry = wn(g.geometry, Hn) : f.mode === te.TRIANGLE_FAN && (g.geometry = wn(g.geometry, zt));
|
|
3568
3598
|
else if (f.mode === te.LINES)
|
|
3569
|
-
g = new Wt(
|
|
3599
|
+
g = new Wt(m, x);
|
|
3570
3600
|
else if (f.mode === te.LINE_STRIP)
|
|
3571
|
-
g = new ue(
|
|
3601
|
+
g = new ue(m, x);
|
|
3572
3602
|
else if (f.mode === te.LINE_LOOP)
|
|
3573
|
-
g = new Rs(
|
|
3603
|
+
g = new Rs(m, x);
|
|
3574
3604
|
else if (f.mode === te.POINTS)
|
|
3575
|
-
g = new pt(
|
|
3605
|
+
g = new pt(m, x);
|
|
3576
3606
|
else
|
|
3577
3607
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + f.mode);
|
|
3578
|
-
Object.keys(g.geometry.morphAttributes).length > 0 &&
|
|
3608
|
+
Object.keys(g.geometry.morphAttributes).length > 0 && So(g, i), g.name = t.createUniqueName(i.name || "mesh_" + e), re(g, i), f.extensions && xe(n, g, f), t.assignFinalMaterial(g), u.push(g);
|
|
3579
3609
|
}
|
|
3580
|
-
for (let d = 0,
|
|
3610
|
+
for (let d = 0, p = u.length; d < p; d++)
|
|
3581
3611
|
t.associations.set(u[d], {
|
|
3582
3612
|
meshes: e,
|
|
3583
3613
|
primitives: d
|
|
@@ -3586,7 +3616,7 @@ class ko {
|
|
|
3586
3616
|
return i.extensions && xe(n, u[0], i), u[0];
|
|
3587
3617
|
const h = new ft();
|
|
3588
3618
|
i.extensions && xe(n, h, i), t.associations.set(h, { meshes: e });
|
|
3589
|
-
for (let d = 0,
|
|
3619
|
+
for (let d = 0, p = u.length; d < p; d++)
|
|
3590
3620
|
h.add(u[d]);
|
|
3591
3621
|
return h;
|
|
3592
3622
|
});
|
|
@@ -3605,7 +3635,7 @@ class ko {
|
|
|
3605
3635
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3606
3636
|
return;
|
|
3607
3637
|
}
|
|
3608
|
-
return s.type === "perspective" ? t = new
|
|
3638
|
+
return s.type === "perspective" ? t = new Hs(En.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new Ss(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), re(t, s), Promise.resolve(t);
|
|
3609
3639
|
}
|
|
3610
3640
|
/**
|
|
3611
3641
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -3642,8 +3672,8 @@ class ko {
|
|
|
3642
3672
|
loadAnimation(e) {
|
|
3643
3673
|
const t = this.json, s = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, o = [], a = [], l = [], c = [], A = [];
|
|
3644
3674
|
for (let u = 0, h = n.channels.length; u < h; u++) {
|
|
3645
|
-
const d = n.channels[u],
|
|
3646
|
-
|
|
3675
|
+
const d = n.channels[u], p = n.samplers[d.sampler], m = d.target, f = m.node, g = n.parameters !== void 0 ? n.parameters[p.input] : p.input, x = n.parameters !== void 0 ? n.parameters[p.output] : p.output;
|
|
3676
|
+
m.node !== void 0 && (o.push(this.getDependency("node", f)), a.push(this.getDependency("accessor", g)), l.push(this.getDependency("accessor", x)), c.push(p), A.push(m));
|
|
3647
3677
|
}
|
|
3648
3678
|
return Promise.all([
|
|
3649
3679
|
Promise.all(o),
|
|
@@ -3652,12 +3682,12 @@ class ko {
|
|
|
3652
3682
|
Promise.all(c),
|
|
3653
3683
|
Promise.all(A)
|
|
3654
3684
|
]).then(function(u) {
|
|
3655
|
-
const h = u[0], d = u[1],
|
|
3685
|
+
const h = u[0], d = u[1], p = u[2], m = u[3], f = u[4], g = [];
|
|
3656
3686
|
for (let C = 0, y = h.length; C < y; C++) {
|
|
3657
|
-
const w = h[C], D = d[C],
|
|
3687
|
+
const w = h[C], D = d[C], H = p[C], Z = m[C], _ = f[C];
|
|
3658
3688
|
if (w === void 0) continue;
|
|
3659
3689
|
w.updateMatrix && w.updateMatrix();
|
|
3660
|
-
const Q = s._createAnimationTracks(w, D,
|
|
3690
|
+
const Q = s._createAnimationTracks(w, D, H, Z, _);
|
|
3661
3691
|
if (Q)
|
|
3662
3692
|
for (let ye = 0; ye < Q.length; ye++)
|
|
3663
3693
|
g.push(Q[ye]);
|
|
@@ -3698,11 +3728,11 @@ class ko {
|
|
|
3698
3728
|
h !== null && A.traverse(function(d) {
|
|
3699
3729
|
d.isSkinnedMesh && d.bind(h, jo);
|
|
3700
3730
|
});
|
|
3701
|
-
for (let d = 0,
|
|
3731
|
+
for (let d = 0, p = u.length; d < p; d++)
|
|
3702
3732
|
A.add(u[d]);
|
|
3703
3733
|
if (A.userData.pivot !== void 0 && u.length > 0) {
|
|
3704
|
-
const d = A.userData.pivot,
|
|
3705
|
-
A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2],
|
|
3734
|
+
const d = A.userData.pivot, p = u[0];
|
|
3735
|
+
A.pivot = new M().fromArray(d), A.position.x -= d[0], A.position.y -= d[1], A.position.z -= d[2], p.position.set(0, 0, 0), delete A.userData.pivot;
|
|
3706
3736
|
}
|
|
3707
3737
|
return A;
|
|
3708
3738
|
});
|
|
@@ -3762,7 +3792,7 @@ class ko {
|
|
|
3762
3792
|
const c = (A) => {
|
|
3763
3793
|
const u = /* @__PURE__ */ new Map();
|
|
3764
3794
|
for (const [h, d] of n.associations)
|
|
3765
|
-
(h instanceof Qe || h instanceof
|
|
3795
|
+
(h instanceof Qe || h instanceof tn) && u.set(h, d);
|
|
3766
3796
|
return A.traverse((h) => {
|
|
3767
3797
|
const d = n.associations.get(h);
|
|
3768
3798
|
d != null && u.set(h, d);
|
|
@@ -3780,37 +3810,37 @@ class ko {
|
|
|
3780
3810
|
let A;
|
|
3781
3811
|
switch (fe[i.path]) {
|
|
3782
3812
|
case fe.weights:
|
|
3783
|
-
A =
|
|
3813
|
+
A = sn;
|
|
3784
3814
|
break;
|
|
3785
3815
|
case fe.rotation:
|
|
3786
|
-
A =
|
|
3816
|
+
A = on;
|
|
3787
3817
|
break;
|
|
3788
3818
|
case fe.translation:
|
|
3789
3819
|
case fe.scale:
|
|
3790
|
-
A =
|
|
3820
|
+
A = nn;
|
|
3791
3821
|
break;
|
|
3792
3822
|
default:
|
|
3793
3823
|
switch (s.itemSize) {
|
|
3794
3824
|
case 1:
|
|
3795
|
-
A =
|
|
3825
|
+
A = sn;
|
|
3796
3826
|
break;
|
|
3797
3827
|
case 2:
|
|
3798
3828
|
case 3:
|
|
3799
3829
|
default:
|
|
3800
|
-
A =
|
|
3830
|
+
A = nn;
|
|
3801
3831
|
break;
|
|
3802
3832
|
}
|
|
3803
3833
|
break;
|
|
3804
3834
|
}
|
|
3805
|
-
const u = n.interpolation !== void 0 ? Eo[n.interpolation] :
|
|
3806
|
-
for (let d = 0,
|
|
3807
|
-
const
|
|
3835
|
+
const u = n.interpolation !== void 0 ? Eo[n.interpolation] : Wn, h = this._getArrayFromAccessor(s);
|
|
3836
|
+
for (let d = 0, p = l.length; d < p; d++) {
|
|
3837
|
+
const m = new A(
|
|
3808
3838
|
l[d] + "." + fe[i.path],
|
|
3809
3839
|
t.array,
|
|
3810
3840
|
h,
|
|
3811
3841
|
u
|
|
3812
3842
|
);
|
|
3813
|
-
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
3843
|
+
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(m), o.push(m);
|
|
3814
3844
|
}
|
|
3815
3845
|
return o;
|
|
3816
3846
|
}
|
|
@@ -3826,7 +3856,7 @@ class ko {
|
|
|
3826
3856
|
}
|
|
3827
3857
|
_createCubicSplineTrackInterpolant(e) {
|
|
3828
3858
|
e.createInterpolant = function(s) {
|
|
3829
|
-
const n = this instanceof
|
|
3859
|
+
const n = this instanceof on ? Oo : Zn;
|
|
3830
3860
|
return new n(this.times, this.values, this.getValueSize() / 3, s);
|
|
3831
3861
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
3832
3862
|
}
|
|
@@ -3855,11 +3885,11 @@ function Wo(r, e, t) {
|
|
|
3855
3885
|
for (let c = 0, A = i.length; c < A; c++) {
|
|
3856
3886
|
const u = i[c];
|
|
3857
3887
|
if (u.POSITION !== void 0) {
|
|
3858
|
-
const h = t.json.accessors[u.POSITION], d = h.min,
|
|
3859
|
-
if (d !== void 0 &&
|
|
3860
|
-
if (l.setX(Math.max(Math.abs(d[0]), Math.abs(
|
|
3861
|
-
const
|
|
3862
|
-
l.multiplyScalar(
|
|
3888
|
+
const h = t.json.accessors[u.POSITION], d = h.min, p = h.max;
|
|
3889
|
+
if (d !== void 0 && p !== void 0) {
|
|
3890
|
+
if (l.setX(Math.max(Math.abs(d[0]), Math.abs(p[0]))), l.setY(Math.max(Math.abs(d[1]), Math.abs(p[1]))), l.setZ(Math.max(Math.abs(d[2]), Math.abs(p[2]))), h.normalized) {
|
|
3891
|
+
const m = Vt(je[h.componentType]);
|
|
3892
|
+
l.multiplyScalar(m);
|
|
3863
3893
|
}
|
|
3864
3894
|
a.max(l);
|
|
3865
3895
|
} else
|
|
@@ -3872,7 +3902,7 @@ function Wo(r, e, t) {
|
|
|
3872
3902
|
const o = new Fs();
|
|
3873
3903
|
n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, r.boundingSphere = o;
|
|
3874
3904
|
}
|
|
3875
|
-
function
|
|
3905
|
+
function Tn(r, e, t) {
|
|
3876
3906
|
const s = e.attributes, n = [];
|
|
3877
3907
|
function i(o, a) {
|
|
3878
3908
|
return t.getDependency("accessor", o).then(function(l) {
|
|
@@ -3890,7 +3920,7 @@ function On(r, e, t) {
|
|
|
3890
3920
|
n.push(o);
|
|
3891
3921
|
}
|
|
3892
3922
|
return qt.workingColorSpace !== ae && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${qt.workingColorSpace}" not supported.`), re(r, e), Wo(r, e, t), Promise.all(n).then(function() {
|
|
3893
|
-
return e.targets !== void 0 ?
|
|
3923
|
+
return e.targets !== void 0 ? Ho(r, e.targets, t) : r;
|
|
3894
3924
|
});
|
|
3895
3925
|
}
|
|
3896
3926
|
const Nt = /* @__PURE__ */ new WeakMap();
|
|
@@ -4009,8 +4039,8 @@ class zo extends Yt {
|
|
|
4009
4039
|
if (o === a)
|
|
4010
4040
|
c = new _e(i, o);
|
|
4011
4041
|
else {
|
|
4012
|
-
const A = new
|
|
4013
|
-
c = new
|
|
4042
|
+
const A = new Sn(i, a);
|
|
4043
|
+
c = new Ln(A, o, 0);
|
|
4014
4044
|
}
|
|
4015
4045
|
n === "color" && (this._assignVertexColorSpace(c, l), c.normalized = !(i instanceof Float32Array)), t.setAttribute(n, c);
|
|
4016
4046
|
}
|
|
@@ -4102,8 +4132,8 @@ function Go() {
|
|
|
4102
4132
|
e.then((A) => {
|
|
4103
4133
|
const u = A.draco, h = new u.Decoder();
|
|
4104
4134
|
try {
|
|
4105
|
-
const d = t(u, h, new Int8Array(l), c),
|
|
4106
|
-
d.index &&
|
|
4135
|
+
const d = t(u, h, new Int8Array(l), c), p = d.attributes.map((m) => m.array.buffer);
|
|
4136
|
+
d.index && p.push(d.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: d }, p);
|
|
4107
4137
|
} catch (d) {
|
|
4108
4138
|
console.error(d), self.postMessage({ type: "error", id: a.id, error: d.message });
|
|
4109
4139
|
} finally {
|
|
@@ -4116,16 +4146,16 @@ function Go() {
|
|
|
4116
4146
|
function t(o, a, l, c) {
|
|
4117
4147
|
const A = c.attributeIDs, u = c.attributeTypes;
|
|
4118
4148
|
let h, d;
|
|
4119
|
-
const
|
|
4120
|
-
if (
|
|
4149
|
+
const p = a.GetEncodedGeometryType(l);
|
|
4150
|
+
if (p === o.TRIANGULAR_MESH)
|
|
4121
4151
|
h = new o.Mesh(), d = a.DecodeArrayToMesh(l, l.byteLength, h);
|
|
4122
|
-
else if (
|
|
4152
|
+
else if (p === o.POINT_CLOUD)
|
|
4123
4153
|
h = new o.PointCloud(), d = a.DecodeArrayToPointCloud(l, l.byteLength, h);
|
|
4124
4154
|
else
|
|
4125
4155
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
4126
4156
|
if (!d.ok() || h.ptr === 0)
|
|
4127
4157
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + d.error_msg());
|
|
4128
|
-
const
|
|
4158
|
+
const m = { index: null, attributes: [] };
|
|
4129
4159
|
for (const f in A) {
|
|
4130
4160
|
const g = self[u[f]];
|
|
4131
4161
|
let x, C;
|
|
@@ -4136,9 +4166,9 @@ function Go() {
|
|
|
4136
4166
|
x = a.GetAttribute(h, C);
|
|
4137
4167
|
}
|
|
4138
4168
|
const y = n(o, a, h, f, g, x);
|
|
4139
|
-
f === "color" && (y.vertexColorSpace = c.vertexColorSpace),
|
|
4169
|
+
f === "color" && (y.vertexColorSpace = c.vertexColorSpace), m.attributes.push(y);
|
|
4140
4170
|
}
|
|
4141
|
-
return
|
|
4171
|
+
return p === o.TRIANGULAR_MESH && (m.index = s(o, a, h)), o.destroy(h), m;
|
|
4142
4172
|
}
|
|
4143
4173
|
function s(o, a, l) {
|
|
4144
4174
|
const A = l.num_faces() * 3, u = A * 4, h = o._malloc(u);
|
|
@@ -4147,19 +4177,19 @@ function Go() {
|
|
|
4147
4177
|
return o._free(h), { array: d, itemSize: 1 };
|
|
4148
4178
|
}
|
|
4149
4179
|
function n(o, a, l, c, A, u) {
|
|
4150
|
-
const h = l.num_points(), d = u.num_components(),
|
|
4151
|
-
a.GetAttributeDataArrayForAllPoints(l, u,
|
|
4180
|
+
const h = l.num_points(), d = u.num_components(), p = i(o, A), m = d * A.BYTES_PER_ELEMENT, f = Math.ceil(m / 4) * 4, g = f / A.BYTES_PER_ELEMENT, x = h * m, C = h * f, y = o._malloc(x);
|
|
4181
|
+
a.GetAttributeDataArrayForAllPoints(l, u, p, x, y);
|
|
4152
4182
|
const w = new A(o.HEAPF32.buffer, y, x / A.BYTES_PER_ELEMENT);
|
|
4153
4183
|
let D;
|
|
4154
|
-
if (
|
|
4184
|
+
if (m === f)
|
|
4155
4185
|
D = w.slice();
|
|
4156
4186
|
else {
|
|
4157
4187
|
D = new A(C / A.BYTES_PER_ELEMENT);
|
|
4158
|
-
let
|
|
4188
|
+
let H = 0;
|
|
4159
4189
|
for (let Z = 0, _ = w.length; Z < _; Z++) {
|
|
4160
4190
|
for (let Q = 0; Q < d; Q++)
|
|
4161
|
-
D[
|
|
4162
|
-
|
|
4191
|
+
D[H + Q] = w[Z * d + Q];
|
|
4192
|
+
H += g;
|
|
4163
4193
|
}
|
|
4164
4194
|
}
|
|
4165
4195
|
return o._free(y), {
|
|
@@ -4220,7 +4250,7 @@ function Uo(r) {
|
|
|
4220
4250
|
speedY: A = 5e-4
|
|
4221
4251
|
} = r || {}, u = new P.PlaneGeometry(e, t), d = new P.TextureLoader().load(Fo, (f) => {
|
|
4222
4252
|
f.wrapS = f.wrapT = P.RepeatWrapping, f.repeat.set(a, l), f.generateMipmaps = !1, f.minFilter = P.LinearFilter, f.magFilter = P.LinearFilter;
|
|
4223
|
-
}),
|
|
4253
|
+
}), p = new P.MeshStandardMaterial({
|
|
4224
4254
|
color: s,
|
|
4225
4255
|
roughness: n,
|
|
4226
4256
|
metalness: i,
|
|
@@ -4230,8 +4260,8 @@ function Uo(r) {
|
|
|
4230
4260
|
// 双面渲染,避免从侧面或底部看到黑色
|
|
4231
4261
|
transparent: !0,
|
|
4232
4262
|
opacity: 0.6
|
|
4233
|
-
}),
|
|
4234
|
-
|
|
4263
|
+
}), m = new P.Mesh(u, p);
|
|
4264
|
+
m.rotation.x = -Math.PI / 2, m.position.y = 0, m.name = "水面(标准材质)", m.userData.isWater = !0, m.userData.isMovable = !0, m.userData.waterSpeed = { x: c, y: A }, ze(m);
|
|
4235
4265
|
}
|
|
4236
4266
|
function Vo(r) {
|
|
4237
4267
|
return Et(!0), new Promise((e, t) => {
|
|
@@ -4299,11 +4329,11 @@ function Ko(r) {
|
|
|
4299
4329
|
{ label: "湿度", value: "65", unit: "%" },
|
|
4300
4330
|
{ label: "压力", value: "101.3", unit: "kPa" },
|
|
4301
4331
|
{ label: "名称", value: e.name || "未命名" }
|
|
4302
|
-
], n = new
|
|
4332
|
+
], n = new Gn({
|
|
4303
4333
|
title: (r == null ? void 0 : r.title) || "数据面板",
|
|
4304
4334
|
items: (r == null ? void 0 : r.items) || s
|
|
4305
4335
|
});
|
|
4306
|
-
return n.attachTo(e),
|
|
4336
|
+
return n.attachTo(e), Fn(e, n), n;
|
|
4307
4337
|
}
|
|
4308
4338
|
const Zo = {
|
|
4309
4339
|
key: 1,
|
|
@@ -4320,12 +4350,12 @@ const Zo = {
|
|
|
4320
4350
|
},
|
|
4321
4351
|
emits: ["select", "delete"],
|
|
4322
4352
|
setup(r, { emit: e }) {
|
|
4323
|
-
const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((
|
|
4324
|
-
(
|
|
4353
|
+
const t = r, s = e, n = j(null), { expandedSet: i, toggleExpand: o } = es("treeExpand"), a = Be(() => i.value.has(t.node.uuid)), l = Be(() => (t.version, t.node.children.some((m) => m.userData.isMovable === !0))), c = Be(() => (t.version, t.node.children.filter(
|
|
4354
|
+
(m) => m.userData.isMovable === !0
|
|
4325
4355
|
))), A = Be(
|
|
4326
4356
|
() => {
|
|
4327
|
-
var
|
|
4328
|
-
return ((
|
|
4357
|
+
var m;
|
|
4358
|
+
return ((m = t.selectedObject) == null ? void 0 : m.uuid) === t.node.uuid;
|
|
4329
4359
|
}
|
|
4330
4360
|
);
|
|
4331
4361
|
ts(
|
|
@@ -4339,12 +4369,12 @@ const Zo = {
|
|
|
4339
4369
|
},
|
|
4340
4370
|
{ flush: "post" }
|
|
4341
4371
|
);
|
|
4342
|
-
const u = (
|
|
4343
|
-
|
|
4344
|
-
}, h = (
|
|
4345
|
-
|
|
4346
|
-
}, d = (
|
|
4347
|
-
return (
|
|
4372
|
+
const u = (m) => {
|
|
4373
|
+
m.stopPropagation(), s("select", t.node);
|
|
4374
|
+
}, h = (m) => {
|
|
4375
|
+
m.stopPropagation(), s("delete", t.node);
|
|
4376
|
+
}, d = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", p = (m) => m.name || `${m.type} (${m.id})`;
|
|
4377
|
+
return (m, f) => {
|
|
4348
4378
|
const g = ns("TreeItem", !0);
|
|
4349
4379
|
return T(), R("div", {
|
|
4350
4380
|
class: "tree-node",
|
|
@@ -4361,7 +4391,7 @@ const Zo = {
|
|
|
4361
4391
|
onClick: f[0] || (f[0] = jt((x) => ss(o)(r.node.uuid), ["stop"]))
|
|
4362
4392
|
}, ie(a.value ? "▼" : "▶"), 1)) : (T(), R("span", Zo)),
|
|
4363
4393
|
b("span", Qo, ie(d(r.node)), 1),
|
|
4364
|
-
b("span", Jo, ie(
|
|
4394
|
+
b("span", Jo, ie(p(r.node)), 1),
|
|
4365
4395
|
b("button", {
|
|
4366
4396
|
class: "tree-delete",
|
|
4367
4397
|
onClick: jt(h, ["stop"])
|
|
@@ -4414,9 +4444,9 @@ const Zo = {
|
|
|
4414
4444
|
}
|
|
4415
4445
|
function c(h) {
|
|
4416
4446
|
let d = null;
|
|
4417
|
-
return h.traverse((
|
|
4418
|
-
if (
|
|
4419
|
-
const
|
|
4447
|
+
return h.traverse((p) => {
|
|
4448
|
+
if (p.type === "Mesh" && !d) {
|
|
4449
|
+
const m = p, f = Array.isArray(m.material) ? m.material : [m.material];
|
|
4420
4450
|
for (const g of f)
|
|
4421
4451
|
if (g && (g.type === "MeshStandardMaterial" || g.type === "MeshPhongMaterial")) {
|
|
4422
4452
|
const x = g;
|
|
@@ -4431,14 +4461,14 @@ const Zo = {
|
|
|
4431
4461
|
}), d;
|
|
4432
4462
|
}
|
|
4433
4463
|
function A(h, d) {
|
|
4434
|
-
let
|
|
4435
|
-
return h.traverse((
|
|
4436
|
-
if (
|
|
4437
|
-
const f =
|
|
4464
|
+
let p = !1;
|
|
4465
|
+
return h.traverse((m) => {
|
|
4466
|
+
if (m.type === "Mesh") {
|
|
4467
|
+
const f = m, g = Array.isArray(f.material) ? f.material : [f.material];
|
|
4438
4468
|
for (const x of g)
|
|
4439
|
-
x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0,
|
|
4469
|
+
x && (x.type === "MeshStandardMaterial" || x.type === "MeshPhongMaterial") && (d.metalness !== void 0 && (x.metalness = d.metalness), d.roughness !== void 0 && (x.roughness = d.roughness), d.opacity !== void 0 && (x.opacity = d.opacity, x.transparent = d.opacity < 1), x.needsUpdate = !0, p = !0);
|
|
4440
4470
|
}
|
|
4441
|
-
}),
|
|
4471
|
+
}), p;
|
|
4442
4472
|
}
|
|
4443
4473
|
function u() {
|
|
4444
4474
|
if (t.selectedObject) {
|
|
@@ -4467,7 +4497,7 @@ const Zo = {
|
|
|
4467
4497
|
d[14] || (d[14] = b("span", null, "X:", -1)),
|
|
4468
4498
|
E(b("input", {
|
|
4469
4499
|
type: "number",
|
|
4470
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
4500
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => r.transform.position.x = p),
|
|
4471
4501
|
step: "0.01",
|
|
4472
4502
|
onInput: n
|
|
4473
4503
|
}, null, 544), [
|
|
@@ -4481,7 +4511,7 @@ const Zo = {
|
|
|
4481
4511
|
d[15] || (d[15] = b("span", null, "Y:", -1)),
|
|
4482
4512
|
E(b("input", {
|
|
4483
4513
|
type: "number",
|
|
4484
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
4514
|
+
"onUpdate:modelValue": d[1] || (d[1] = (p) => r.transform.position.y = p),
|
|
4485
4515
|
step: "0.01",
|
|
4486
4516
|
onInput: n
|
|
4487
4517
|
}, null, 544), [
|
|
@@ -4495,7 +4525,7 @@ const Zo = {
|
|
|
4495
4525
|
d[16] || (d[16] = b("span", null, "Z:", -1)),
|
|
4496
4526
|
E(b("input", {
|
|
4497
4527
|
type: "number",
|
|
4498
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
4528
|
+
"onUpdate:modelValue": d[2] || (d[2] = (p) => r.transform.position.z = p),
|
|
4499
4529
|
step: "0.01",
|
|
4500
4530
|
onInput: n
|
|
4501
4531
|
}, null, 544), [
|
|
@@ -4514,7 +4544,7 @@ const Zo = {
|
|
|
4514
4544
|
d[18] || (d[18] = b("span", null, "X:", -1)),
|
|
4515
4545
|
E(b("input", {
|
|
4516
4546
|
type: "number",
|
|
4517
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
4547
|
+
"onUpdate:modelValue": d[3] || (d[3] = (p) => r.transform.rotation.x = p),
|
|
4518
4548
|
step: "0.01",
|
|
4519
4549
|
onInput: n
|
|
4520
4550
|
}, null, 544), [
|
|
@@ -4528,7 +4558,7 @@ const Zo = {
|
|
|
4528
4558
|
d[19] || (d[19] = b("span", null, "Y:", -1)),
|
|
4529
4559
|
E(b("input", {
|
|
4530
4560
|
type: "number",
|
|
4531
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
4561
|
+
"onUpdate:modelValue": d[4] || (d[4] = (p) => r.transform.rotation.y = p),
|
|
4532
4562
|
step: "0.01",
|
|
4533
4563
|
onInput: n
|
|
4534
4564
|
}, null, 544), [
|
|
@@ -4542,7 +4572,7 @@ const Zo = {
|
|
|
4542
4572
|
d[20] || (d[20] = b("span", null, "Z:", -1)),
|
|
4543
4573
|
E(b("input", {
|
|
4544
4574
|
type: "number",
|
|
4545
|
-
"onUpdate:modelValue": d[5] || (d[5] = (
|
|
4575
|
+
"onUpdate:modelValue": d[5] || (d[5] = (p) => r.transform.rotation.z = p),
|
|
4546
4576
|
step: "0.01",
|
|
4547
4577
|
onInput: n
|
|
4548
4578
|
}, null, 544), [
|
|
@@ -4561,7 +4591,7 @@ const Zo = {
|
|
|
4561
4591
|
d[22] || (d[22] = b("span", null, "X:", -1)),
|
|
4562
4592
|
E(b("input", {
|
|
4563
4593
|
type: "number",
|
|
4564
|
-
"onUpdate:modelValue": d[6] || (d[6] = (
|
|
4594
|
+
"onUpdate:modelValue": d[6] || (d[6] = (p) => r.transform.scale.x = p),
|
|
4565
4595
|
step: "0.01",
|
|
4566
4596
|
onInput: n
|
|
4567
4597
|
}, null, 544), [
|
|
@@ -4575,7 +4605,7 @@ const Zo = {
|
|
|
4575
4605
|
d[23] || (d[23] = b("span", null, "Y:", -1)),
|
|
4576
4606
|
E(b("input", {
|
|
4577
4607
|
type: "number",
|
|
4578
|
-
"onUpdate:modelValue": d[7] || (d[7] = (
|
|
4608
|
+
"onUpdate:modelValue": d[7] || (d[7] = (p) => r.transform.scale.y = p),
|
|
4579
4609
|
step: "0.01",
|
|
4580
4610
|
onInput: n
|
|
4581
4611
|
}, null, 544), [
|
|
@@ -4589,7 +4619,7 @@ const Zo = {
|
|
|
4589
4619
|
d[24] || (d[24] = b("span", null, "Z:", -1)),
|
|
4590
4620
|
E(b("input", {
|
|
4591
4621
|
type: "number",
|
|
4592
|
-
"onUpdate:modelValue": d[8] || (d[8] = (
|
|
4622
|
+
"onUpdate:modelValue": d[8] || (d[8] = (p) => r.transform.scale.z = p),
|
|
4593
4623
|
step: "0.01",
|
|
4594
4624
|
onInput: n
|
|
4595
4625
|
}, null, 544), [
|
|
@@ -4611,7 +4641,7 @@ const Zo = {
|
|
|
4611
4641
|
min: "0",
|
|
4612
4642
|
max: "10",
|
|
4613
4643
|
step: "0.1",
|
|
4614
|
-
"onUpdate:modelValue": d[9] || (d[9] = (
|
|
4644
|
+
"onUpdate:modelValue": d[9] || (d[9] = (p) => a.intensity = p),
|
|
4615
4645
|
onInput: l
|
|
4616
4646
|
}, null, 544), [
|
|
4617
4647
|
[
|
|
@@ -4626,7 +4656,7 @@ const Zo = {
|
|
|
4626
4656
|
min: "0",
|
|
4627
4657
|
max: "100",
|
|
4628
4658
|
step: "0.1",
|
|
4629
|
-
"onUpdate:modelValue": d[10] || (d[10] = (
|
|
4659
|
+
"onUpdate:modelValue": d[10] || (d[10] = (p) => a.intensity = p),
|
|
4630
4660
|
class: "intensity-input",
|
|
4631
4661
|
onInput: l
|
|
4632
4662
|
}, null, 544), [
|
|
@@ -4648,7 +4678,7 @@ const Zo = {
|
|
|
4648
4678
|
min: "0",
|
|
4649
4679
|
max: "1",
|
|
4650
4680
|
step: "0.01",
|
|
4651
|
-
"onUpdate:modelValue": d[11] || (d[11] = (
|
|
4681
|
+
"onUpdate:modelValue": d[11] || (d[11] = (p) => i.metalness = p),
|
|
4652
4682
|
onInput: u
|
|
4653
4683
|
}, null, 544), [
|
|
4654
4684
|
[
|
|
@@ -4667,7 +4697,7 @@ const Zo = {
|
|
|
4667
4697
|
min: "0",
|
|
4668
4698
|
max: "1",
|
|
4669
4699
|
step: "0.01",
|
|
4670
|
-
"onUpdate:modelValue": d[12] || (d[12] = (
|
|
4700
|
+
"onUpdate:modelValue": d[12] || (d[12] = (p) => i.roughness = p),
|
|
4671
4701
|
onInput: u
|
|
4672
4702
|
}, null, 544), [
|
|
4673
4703
|
[
|
|
@@ -4686,7 +4716,7 @@ const Zo = {
|
|
|
4686
4716
|
min: "0",
|
|
4687
4717
|
max: "1",
|
|
4688
4718
|
step: "0.01",
|
|
4689
|
-
"onUpdate:modelValue": d[13] || (d[13] = (
|
|
4719
|
+
"onUpdate:modelValue": d[13] || (d[13] = (p) => i.opacity = p),
|
|
4690
4720
|
onInput: u
|
|
4691
4721
|
}, null, 544), [
|
|
4692
4722
|
[
|
|
@@ -4712,10 +4742,10 @@ const Zo = {
|
|
|
4712
4742
|
}, Dr = { class: "ud-value-json-preview" }, Pr = ["onClick"], Tr = {
|
|
4713
4743
|
key: 0,
|
|
4714
4744
|
class: "ud-json-error"
|
|
4715
|
-
}, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"],
|
|
4745
|
+
}, Or = { class: "ud-json-actions" }, Er = ["onClick"], Rr = ["onClick"], Hr = {
|
|
4716
4746
|
key: 1,
|
|
4717
4747
|
class: "userdata-empty"
|
|
4718
|
-
},
|
|
4748
|
+
}, Sr = /* @__PURE__ */ be({
|
|
4719
4749
|
__name: "UserDataTab",
|
|
4720
4750
|
props: {
|
|
4721
4751
|
selectedObject: {}
|
|
@@ -4772,7 +4802,7 @@ const Zo = {
|
|
|
4772
4802
|
function d(C) {
|
|
4773
4803
|
return C.length <= 28 ? C : C.substring(0, 28) + "…";
|
|
4774
4804
|
}
|
|
4775
|
-
function
|
|
4805
|
+
function p(C) {
|
|
4776
4806
|
n.value = C;
|
|
4777
4807
|
const y = e.selectedObject;
|
|
4778
4808
|
if (!y) return;
|
|
@@ -4782,9 +4812,9 @@ const Zo = {
|
|
|
4782
4812
|
} catch {
|
|
4783
4813
|
i.value = String(w);
|
|
4784
4814
|
}
|
|
4785
|
-
|
|
4815
|
+
m();
|
|
4786
4816
|
}
|
|
4787
|
-
function
|
|
4817
|
+
function m() {
|
|
4788
4818
|
const C = i.value.trim();
|
|
4789
4819
|
if (!C) {
|
|
4790
4820
|
o.value = null;
|
|
@@ -4839,7 +4869,7 @@ const Zo = {
|
|
|
4839
4869
|
"onUpdate:modelValue": y[0] || (y[0] = (w) => t.value = w),
|
|
4840
4870
|
placeholder: "属性名",
|
|
4841
4871
|
class: "ud-input",
|
|
4842
|
-
onKeyup:
|
|
4872
|
+
onKeyup: Se(u, ["enter"])
|
|
4843
4873
|
}, null, 544), [
|
|
4844
4874
|
[N, t.value]
|
|
4845
4875
|
]),
|
|
@@ -4847,7 +4877,7 @@ const Zo = {
|
|
|
4847
4877
|
"onUpdate:modelValue": y[1] || (y[1] = (w) => s.value = w),
|
|
4848
4878
|
placeholder: "值",
|
|
4849
4879
|
class: "ud-input ud-textarea",
|
|
4850
|
-
onKeyup:
|
|
4880
|
+
onKeyup: Se(jt(u, ["prevent"]), ["enter"])
|
|
4851
4881
|
}, null, 40, xr), [
|
|
4852
4882
|
[N, s.value]
|
|
4853
4883
|
]),
|
|
@@ -4872,15 +4902,15 @@ const Zo = {
|
|
|
4872
4902
|
b("button", {
|
|
4873
4903
|
class: "ud-btn edit-json-btn",
|
|
4874
4904
|
title: "编辑对象",
|
|
4875
|
-
onClick: (
|
|
4905
|
+
onClick: (H) => p(w.key)
|
|
4876
4906
|
}, " ✎ ", 8, Pr)
|
|
4877
4907
|
], 64)) : (T(), R(ve, { key: 1 }, [
|
|
4878
4908
|
o.value ? (T(), R("div", Tr, " ⚠ " + ie(o.value), 1)) : X("", !0),
|
|
4879
4909
|
E(b("textarea", {
|
|
4880
|
-
"onUpdate:modelValue": y[2] || (y[2] = (
|
|
4910
|
+
"onUpdate:modelValue": y[2] || (y[2] = (H) => i.value = H),
|
|
4881
4911
|
class: se(["ud-json-textarea", { "has-error": o.value }]),
|
|
4882
4912
|
rows: "3",
|
|
4883
|
-
onInput:
|
|
4913
|
+
onInput: m
|
|
4884
4914
|
}, null, 34), [
|
|
4885
4915
|
[N, i.value]
|
|
4886
4916
|
]),
|
|
@@ -4888,7 +4918,7 @@ const Zo = {
|
|
|
4888
4918
|
b("button", {
|
|
4889
4919
|
class: "ud-btn apply-btn",
|
|
4890
4920
|
title: "应用修改",
|
|
4891
|
-
onClick: (
|
|
4921
|
+
onClick: (H) => f(w.key)
|
|
4892
4922
|
}, " ✓ ", 8, Er),
|
|
4893
4923
|
b("button", {
|
|
4894
4924
|
class: "ud-btn cancel-btn",
|
|
@@ -4901,11 +4931,11 @@ const Zo = {
|
|
|
4901
4931
|
key: 2,
|
|
4902
4932
|
class: "ud-btn del-btn",
|
|
4903
4933
|
title: "删除",
|
|
4904
|
-
onClick: (
|
|
4934
|
+
onClick: (H) => h(w.key)
|
|
4905
4935
|
}, " ✕ ", 8, Rr)) : X("", !0)
|
|
4906
4936
|
], 64)) : X("", !0)
|
|
4907
4937
|
], 2))), 128))
|
|
4908
|
-
])) : (T(), R("div",
|
|
4938
|
+
])) : (T(), R("div", Hr, "暂无自定义数据")),
|
|
4909
4939
|
b("button", {
|
|
4910
4940
|
class: "get-camera-btn",
|
|
4911
4941
|
onClick: x
|
|
@@ -4913,7 +4943,7 @@ const Zo = {
|
|
|
4913
4943
|
])
|
|
4914
4944
|
]));
|
|
4915
4945
|
}
|
|
4916
|
-
}), Lr = /* @__PURE__ */ Ie(
|
|
4946
|
+
}), Lr = /* @__PURE__ */ Ie(Sr, [["__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-section" }, Xr = { class: "dp-list" }, Br = ["onUpdate:modelValue"], Ur = ["onUpdate:modelValue"], Vr = ["onUpdate:modelValue"], Yr = ["onUpdate:modelValue"], Kr = ["onClick"], Zr = { class: "dp-add-row" }, Qr = /* @__PURE__ */ be({
|
|
4917
4947
|
__name: "DataPanelTab",
|
|
4918
4948
|
props: {
|
|
4919
4949
|
selectedObject: {}
|
|
@@ -4922,20 +4952,20 @@ const Zo = {
|
|
|
4922
4952
|
const e = r, t = j(""), s = j([]), n = j(!0), i = j(""), o = j(""), a = j(""), l = j("");
|
|
4923
4953
|
let c = u(), A = !1;
|
|
4924
4954
|
function u() {
|
|
4925
|
-
const
|
|
4926
|
-
return
|
|
4955
|
+
const m = e.selectedObject;
|
|
4956
|
+
return m ? Zt(xt(m)) : null;
|
|
4927
4957
|
}
|
|
4928
|
-
Me(n, (
|
|
4929
|
-
A || !c || (c.visible =
|
|
4958
|
+
Me(n, (m) => {
|
|
4959
|
+
A || !c || (c.visible = m);
|
|
4930
4960
|
});
|
|
4931
4961
|
function h() {
|
|
4932
4962
|
A || !c || (c.setTitle(t.value), c.setItems([...s.value]));
|
|
4933
4963
|
}
|
|
4934
4964
|
Me(t, () => h()), Me(s, () => h(), { deep: !0 });
|
|
4935
|
-
function d(
|
|
4936
|
-
s.value = s.value.filter((f, g) => g !==
|
|
4965
|
+
function d(m) {
|
|
4966
|
+
s.value = s.value.filter((f, g) => g !== m), h();
|
|
4937
4967
|
}
|
|
4938
|
-
function
|
|
4968
|
+
function p() {
|
|
4939
4969
|
!i.value.trim() || !o.value.trim() || (s.value = [
|
|
4940
4970
|
...s.value,
|
|
4941
4971
|
{
|
|
@@ -4954,7 +4984,7 @@ const Zo = {
|
|
|
4954
4984
|
}, 0);
|
|
4955
4985
|
},
|
|
4956
4986
|
{ immediate: !0 }
|
|
4957
|
-
), (
|
|
4987
|
+
), (m, f) => (T(), R("div", Nr, [
|
|
4958
4988
|
b("div", jr, [
|
|
4959
4989
|
f[10] || (f[10] = b("label", null, "📊 数据面板", -1)),
|
|
4960
4990
|
b("div", kr, [
|
|
@@ -5035,7 +5065,7 @@ const Zo = {
|
|
|
5035
5065
|
class: "dp-input dp-input-sm",
|
|
5036
5066
|
"onUpdate:modelValue": f[2] || (f[2] = (g) => i.value = g),
|
|
5037
5067
|
placeholder: "标签",
|
|
5038
|
-
onKeyup:
|
|
5068
|
+
onKeyup: Se(p, ["enter"])
|
|
5039
5069
|
}, null, 544), [
|
|
5040
5070
|
[N, i.value]
|
|
5041
5071
|
]),
|
|
@@ -5044,7 +5074,7 @@ const Zo = {
|
|
|
5044
5074
|
class: "dp-input dp-input-sm",
|
|
5045
5075
|
"onUpdate:modelValue": f[3] || (f[3] = (g) => o.value = g),
|
|
5046
5076
|
placeholder: "值",
|
|
5047
|
-
onKeyup:
|
|
5077
|
+
onKeyup: Se(p, ["enter"])
|
|
5048
5078
|
}, null, 544), [
|
|
5049
5079
|
[N, o.value]
|
|
5050
5080
|
]),
|
|
@@ -5053,7 +5083,7 @@ const Zo = {
|
|
|
5053
5083
|
class: "dp-input dp-input-xs",
|
|
5054
5084
|
"onUpdate:modelValue": f[4] || (f[4] = (g) => a.value = g),
|
|
5055
5085
|
placeholder: "单位",
|
|
5056
|
-
onKeyup:
|
|
5086
|
+
onKeyup: Se(p, ["enter"])
|
|
5057
5087
|
}, null, 544), [
|
|
5058
5088
|
[N, a.value]
|
|
5059
5089
|
]),
|
|
@@ -5062,13 +5092,13 @@ const Zo = {
|
|
|
5062
5092
|
class: "dp-input dp-input-xs",
|
|
5063
5093
|
"onUpdate:modelValue": f[5] || (f[5] = (g) => l.value = g),
|
|
5064
5094
|
placeholder: "编码",
|
|
5065
|
-
onKeyup:
|
|
5095
|
+
onKeyup: Se(p, ["enter"])
|
|
5066
5096
|
}, null, 544), [
|
|
5067
5097
|
[N, l.value]
|
|
5068
5098
|
]),
|
|
5069
5099
|
b("button", {
|
|
5070
5100
|
class: "dp-btn dp-btn-add",
|
|
5071
|
-
onClick:
|
|
5101
|
+
onClick: p,
|
|
5072
5102
|
title: "添加"
|
|
5073
5103
|
}, "+")
|
|
5074
5104
|
])
|
|
@@ -5122,65 +5152,65 @@ const $r = {
|
|
|
5122
5152
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
5123
5153
|
setup(r, { emit: e }) {
|
|
5124
5154
|
const t = r, s = e, n = j("translate");
|
|
5125
|
-
function i(
|
|
5126
|
-
n.value =
|
|
5155
|
+
function i(p) {
|
|
5156
|
+
n.value = p, s("transformModeChange", p);
|
|
5127
5157
|
}
|
|
5128
5158
|
const o = () => s("propertyChange"), a = j("transform"), l = Be(() => {
|
|
5129
|
-
var
|
|
5130
|
-
return !!(t.selectedObject && ((
|
|
5159
|
+
var p;
|
|
5160
|
+
return !!(t.selectedObject && ((p = t.selectedObject.userData) != null && p._hasDataPanel));
|
|
5131
5161
|
}), c = j(0), A = os(t, "selectedObject"), { expandedSet: u, toggleExpand: h } = _r(A);
|
|
5132
5162
|
rs("treeExpand", { expandedSet: u, toggleExpand: h });
|
|
5133
|
-
const d = (
|
|
5134
|
-
c.value++, s("treeDelete",
|
|
5163
|
+
const d = (p) => {
|
|
5164
|
+
c.value++, s("treeDelete", p);
|
|
5135
5165
|
};
|
|
5136
|
-
return (
|
|
5166
|
+
return (p, m) => r.transform ? (T(), R("div", $r, [
|
|
5137
5167
|
b("div", ea, [
|
|
5138
|
-
|
|
5168
|
+
m[7] || (m[7] = b("label", null, "场景物体", -1)),
|
|
5139
5169
|
b("div", ta, [
|
|
5140
5170
|
(T(!0), R(ve, null, wt(r.treeData, (f) => (T(), Ke(er, {
|
|
5141
5171
|
key: f.uuid,
|
|
5142
5172
|
node: f,
|
|
5143
5173
|
"selected-object": r.selectedObject,
|
|
5144
5174
|
version: c.value,
|
|
5145
|
-
onSelect:
|
|
5175
|
+
onSelect: m[0] || (m[0] = (g) => s("treeSelect", g)),
|
|
5146
5176
|
onDelete: d
|
|
5147
5177
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
5148
5178
|
r.treeData.length === 0 ? (T(), R("div", na, "暂无物体")) : X("", !0)
|
|
5149
5179
|
])
|
|
5150
5180
|
]),
|
|
5151
5181
|
b("div", sa, [
|
|
5152
|
-
|
|
5182
|
+
m[8] || (m[8] = b("label", null, "全局属性", -1)),
|
|
5153
5183
|
b("div", ia, [
|
|
5154
5184
|
b("button", {
|
|
5155
5185
|
class: se(["mode-btn", { active: n.value === "translate" }]),
|
|
5156
5186
|
title: "移动 (W)",
|
|
5157
|
-
onClick:
|
|
5187
|
+
onClick: m[1] || (m[1] = (f) => i("translate"))
|
|
5158
5188
|
}, " ↕ 移动 ", 2),
|
|
5159
5189
|
b("button", {
|
|
5160
5190
|
class: se(["mode-btn", { active: n.value === "rotate" }]),
|
|
5161
5191
|
title: "旋转 (E)",
|
|
5162
|
-
onClick:
|
|
5192
|
+
onClick: m[2] || (m[2] = (f) => i("rotate"))
|
|
5163
5193
|
}, " ↻ 旋转 ", 2),
|
|
5164
5194
|
b("button", {
|
|
5165
5195
|
class: se(["mode-btn", { active: n.value === "scale" }]),
|
|
5166
5196
|
title: "缩放 (R)",
|
|
5167
|
-
onClick:
|
|
5197
|
+
onClick: m[3] || (m[3] = (f) => i("scale"))
|
|
5168
5198
|
}, " ⤡ 缩放 ", 2)
|
|
5169
5199
|
])
|
|
5170
5200
|
]),
|
|
5171
5201
|
r.selectedObject ? (T(), R("div", oa, [
|
|
5172
5202
|
b("button", {
|
|
5173
5203
|
class: se(["tab-btn", { active: a.value === "transform" }]),
|
|
5174
|
-
onClick:
|
|
5204
|
+
onClick: m[4] || (m[4] = (f) => a.value = "transform")
|
|
5175
5205
|
}, " 🔄 变换 ", 2),
|
|
5176
5206
|
b("button", {
|
|
5177
5207
|
class: se(["tab-btn", { active: a.value === "userdata" }]),
|
|
5178
|
-
onClick:
|
|
5208
|
+
onClick: m[5] || (m[5] = (f) => a.value = "userdata")
|
|
5179
5209
|
}, " 📋 自定义数据 ", 2),
|
|
5180
5210
|
l.value ? (T(), R("button", {
|
|
5181
5211
|
key: 0,
|
|
5182
5212
|
class: se(["tab-btn", { active: a.value === "datapanel" }]),
|
|
5183
|
-
onClick:
|
|
5213
|
+
onClick: m[6] || (m[6] = (f) => a.value = "datapanel")
|
|
5184
5214
|
}, " 📊 数据面板 ", 2)) : X("", !0)
|
|
5185
5215
|
])) : X("", !0),
|
|
5186
5216
|
r.selectedObject ? (T(), R("div", ra, [
|
|
@@ -5198,7 +5228,7 @@ const $r = {
|
|
|
5198
5228
|
[De, a.value === "datapanel"]
|
|
5199
5229
|
])
|
|
5200
5230
|
])) : X("", !0)
|
|
5201
|
-
])) : (T(), R("div", aa, [...
|
|
5231
|
+
])) : (T(), R("div", aa, [...m[9] || (m[9] = [
|
|
5202
5232
|
b("p", null, "未选中任何模型", -1)
|
|
5203
5233
|
])]));
|
|
5204
5234
|
}
|
|
@@ -5207,19 +5237,19 @@ const $r = {
|
|
|
5207
5237
|
emits: ["addModel", "importModel"],
|
|
5208
5238
|
setup(r, { emit: e }) {
|
|
5209
5239
|
const t = j(!1), s = j(!1), n = j(!1), i = j(!1), o = e, a = j(null), l = () => {
|
|
5210
|
-
var
|
|
5211
|
-
return (
|
|
5212
|
-
}, c = (
|
|
5213
|
-
const f =
|
|
5240
|
+
var m;
|
|
5241
|
+
return (m = a.value) == null ? void 0 : m.click();
|
|
5242
|
+
}, c = (m) => {
|
|
5243
|
+
const f = m.target;
|
|
5214
5244
|
f.files && f.files.length > 0 && (o("importModel", f.files[0]), f.value = "");
|
|
5215
5245
|
}, A = () => console.log("撤销"), u = () => console.log("删除物体"), h = async () => {
|
|
5216
|
-
const
|
|
5217
|
-
console.log(JSON.parse(await
|
|
5246
|
+
const m = Ki();
|
|
5247
|
+
console.log(JSON.parse(await m));
|
|
5218
5248
|
}, d = () => {
|
|
5219
5249
|
if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
|
|
5220
5250
|
Ei(localStorage.getItem("test_id"));
|
|
5221
|
-
},
|
|
5222
|
-
return (
|
|
5251
|
+
}, p = () => qn();
|
|
5252
|
+
return (m, f) => (T(), R("div", ua, [
|
|
5223
5253
|
b("div", Aa, [
|
|
5224
5254
|
b("div", {
|
|
5225
5255
|
class: "dropdown-wrapper",
|
|
@@ -5303,7 +5333,7 @@ const $r = {
|
|
|
5303
5333
|
}, "镜头拉近"),
|
|
5304
5334
|
b("div", {
|
|
5305
5335
|
class: "menu-item",
|
|
5306
|
-
onClick:
|
|
5336
|
+
onClick: p
|
|
5307
5337
|
}, " 重置相机位置 ")
|
|
5308
5338
|
], 512), [
|
|
5309
5339
|
[De, t.value]
|
|
@@ -5349,7 +5379,7 @@ const $r = {
|
|
|
5349
5379
|
Ti((g) => {
|
|
5350
5380
|
t.value = g;
|
|
5351
5381
|
});
|
|
5352
|
-
const s =
|
|
5382
|
+
const s = $t(null), n = kt({
|
|
5353
5383
|
position: { x: 0, y: 0, z: 0 },
|
|
5354
5384
|
rotation: { x: 0, y: 0, z: 0 },
|
|
5355
5385
|
scale: { x: 1, y: 1, z: 1 }
|
|
@@ -5382,20 +5412,20 @@ const $r = {
|
|
|
5382
5412
|
} catch (x) {
|
|
5383
5413
|
console.error("导入失败:", x), alert("导入失败:" + x.message);
|
|
5384
5414
|
}
|
|
5385
|
-
}, A =
|
|
5415
|
+
}, A = $t([]);
|
|
5386
5416
|
Bi((g) => {
|
|
5387
5417
|
A.value = g;
|
|
5388
5418
|
});
|
|
5389
5419
|
const u = () => {
|
|
5390
5420
|
const g = Ui();
|
|
5391
5421
|
g && (A.value = g);
|
|
5392
|
-
}, h = (g) => Qt(g), d = (g) => Wi(g.uuid),
|
|
5422
|
+
}, h = (g) => Qt(g), d = (g) => Wi(g.uuid), p = (g) => {
|
|
5393
5423
|
Oi(g);
|
|
5394
|
-
},
|
|
5395
|
-
|
|
5424
|
+
}, m = j(null), f = () => {
|
|
5425
|
+
m.value && Ii(m.value, e.mode, e.sceneData), u();
|
|
5396
5426
|
};
|
|
5397
5427
|
return as(() => {
|
|
5398
|
-
f(),
|
|
5428
|
+
f(), m.value && fi(m.value);
|
|
5399
5429
|
}), ls(() => {
|
|
5400
5430
|
console.log("endset_three_editor destroy"), Qi();
|
|
5401
5431
|
}), (g, x) => (T(), R("div", Ca, [
|
|
@@ -5414,7 +5444,7 @@ const $r = {
|
|
|
5414
5444
|
b("div", {
|
|
5415
5445
|
class: se(`canvas canvas-mode-${r.mode}`),
|
|
5416
5446
|
ref_key: "containerRef",
|
|
5417
|
-
ref:
|
|
5447
|
+
ref: m
|
|
5418
5448
|
}, null, 2),
|
|
5419
5449
|
r.mode === "edit" ? (T(), Ke(ca, {
|
|
5420
5450
|
key: 0,
|
|
@@ -5424,17 +5454,17 @@ const $r = {
|
|
|
5424
5454
|
onPropertyChange: a,
|
|
5425
5455
|
onTreeSelect: h,
|
|
5426
5456
|
onTreeDelete: d,
|
|
5427
|
-
onTransformModeChange:
|
|
5457
|
+
onTransformModeChange: p
|
|
5428
5458
|
}, null, 8, ["transform", "tree-data", "selected-object"])) : X("", !0)
|
|
5429
5459
|
], 2),
|
|
5430
5460
|
r.mode === "edit" ? (T(), Ke(ya, { key: 2 })) : X("", !0)
|
|
5431
5461
|
]));
|
|
5432
5462
|
}
|
|
5433
|
-
}),
|
|
5463
|
+
}), Ha = /* @__PURE__ */ Ie(wa, [["__scopeId", "data-v-ffa5f5c1"]]);
|
|
5434
5464
|
export {
|
|
5435
5465
|
ya as BottomBar,
|
|
5436
|
-
|
|
5437
|
-
|
|
5466
|
+
Gn as DataPanel,
|
|
5467
|
+
Ha as DrawingBoard,
|
|
5438
5468
|
ca as PropertyPanel,
|
|
5439
5469
|
ga as TopBar,
|
|
5440
5470
|
er as TreeItem,
|
|
@@ -5449,7 +5479,7 @@ export {
|
|
|
5449
5479
|
Qi as destroyEditor,
|
|
5450
5480
|
gi as disposeCSS2DRenderer,
|
|
5451
5481
|
Ki as exportSceneToJSON,
|
|
5452
|
-
|
|
5482
|
+
Si as focusOnObject,
|
|
5453
5483
|
Ta as getCSS2DRenderer,
|
|
5454
5484
|
Yi as getCamera,
|
|
5455
5485
|
Zt as getDataPanel,
|
|
@@ -5458,7 +5488,7 @@ export {
|
|
|
5458
5488
|
Ui as getSceneObjects,
|
|
5459
5489
|
Vi as getSelectedObject,
|
|
5460
5490
|
Vo as importModelFromFile,
|
|
5461
|
-
|
|
5491
|
+
qn as initDefaultMainCamera,
|
|
5462
5492
|
Ii as initEditor,
|
|
5463
5493
|
Zi as loadSceneFromJSON,
|
|
5464
5494
|
Bi as onSceneObjectsChangeCallback,
|