ss-component-new 1.1.587 → 1.1.588

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.
@@ -1,8 +1,8 @@
1
- import { ref as D, watch as xe, createElementBlock as J, openBlock as B, createBlock as Ze, computed as ue, resolveComponent as Ke, createVNode as T, onMounted as Be, onUnmounted as We, Fragment as qe, renderList as Qe, createElementVNode as g, createCommentVNode as we, toDisplayString as ie, defineComponent as et, normalizeStyle as Le, normalizeClass as je, nextTick as Ie, onBeforeUnmount as tt, withDirectives as ne, unref as U, withCtx as Fe, isRef as ge, vModelRadio as ye, vShow as ve } from "vue";
2
- import { C as st, V as y, M as ae, T as ce, Q as Ne, D as Ue, E as ee, R as it, P as Pe, F as $e, G as Ee, H as ot, J as nt, K as at, W as lt, L as rt, N as ht, O as ct, X as ut, U as pt, Y as Me, Z as dt, _ as Xe, $ as mt, a0 as Te, a1 as ft, a2 as Ye, a3 as _t, a4 as gt, a5 as Ce, B as yt, a6 as Se, a7 as vt, a8 as bt, a9 as wt } from "./index-Bqwsx3he.js";
3
- import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import { c as Ge } from "./menu-Qw1eGtzq.js";
5
- const Ve = { type: "change" }, Re = { type: "start" }, Je = { type: "end" }, be = new it(), He = new Pe(), Pt = Math.cos(70 * $e.DEG2RAD), N = new y(), X = 2 * Math.PI, S = {
1
+ import { ref as D, watch as Et, createElementBlock as J, openBlock as B, createBlock as Zt, computed as ut, resolveComponent as Kt, createVNode as T, onMounted as Bt, onUnmounted as Wt, Fragment as qt, renderList as Qt, createElementVNode as g, createCommentVNode as wt, toDisplayString as it, defineComponent as te, normalizeStyle as Lt, normalizeClass as jt, nextTick as It, onBeforeUnmount as ee, withDirectives as nt, unref as V, withCtx as Ft, isRef as gt, vModelRadio as yt, vShow as vt } from "vue";
2
+ import { C as se, V as y, M as at, T as ct, Q as Nt, D as Ut, E as tt, R as ie, P as Pt, F as $t, G as xt, H as oe, J as ne, K as ae, W as le, L as re, N as he, O as ce, X as ue, U as pe, Y as Mt, Z as de, _ as Xt, $ as me, a0 as Tt, a1 as fe, a2 as Vt, a3 as _e, a4 as ge, a5 as Ct, B as ye, a6 as St, a7 as ve, a8 as be, a9 as we } from "./index-Bqwsx3he.js";
3
+ import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import { c as Gt } from "./menu-Qw1eGtzq.js";
5
+ const Yt = { type: "change" }, Rt = { type: "start" }, Jt = { type: "end" }, bt = new ie(), Ht = new Pt(), Pe = Math.cos(70 * $t.DEG2RAD), U = new y(), X = 2 * Math.PI, S = {
6
6
  NONE: -1,
7
7
  ROTATE: 0,
8
8
  DOLLY: 1,
@@ -11,19 +11,19 @@ const Ve = { type: "change" }, Re = { type: "start" }, Je = { type: "end" }, be
11
11
  TOUCH_PAN: 4,
12
12
  TOUCH_DOLLY_PAN: 5,
13
13
  TOUCH_DOLLY_ROTATE: 6
14
- }, ke = 1e-6;
15
- class Mt extends st {
14
+ }, kt = 1e-6;
15
+ class Me extends se {
16
16
  /**
17
17
  * Constructs a new controls instance.
18
18
  *
19
19
  * @param {Object3D} object - The object that is managed by the controls.
20
20
  * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
21
21
  */
22
- constructor(e, t = null) {
23
- super(e, t), this.state = S.NONE, this.target = new y(), this.cursor = new y(), 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: ae.ROTATE, MIDDLE: ae.DOLLY, RIGHT: ae.PAN }, this.touches = { ONE: ce.ROTATE, TWO: ce.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new y(), this._lastQuaternion = new Ne(), this._lastTargetPosition = new y(), this._quat = new Ne().setFromUnitVectors(e.up, new y(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ue(), this._sphericalDelta = new Ue(), this._scale = 1, this._panOffset = new y(), this._rotateStart = new ee(), this._rotateEnd = new ee(), this._rotateDelta = new ee(), this._panStart = new ee(), this._panEnd = new ee(), this._panDelta = new ee(), this._dollyStart = new ee(), this._dollyEnd = new ee(), this._dollyDelta = new ee(), this._dollyDirection = new y(), this._mouse = new ee(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Et.bind(this), this._onPointerDown = xt.bind(this), this._onPointerUp = Dt.bind(this), this._onContextMenu = Rt.bind(this), this._onMouseWheel = St.bind(this), this._onKeyDown = kt.bind(this), this._onTouchStart = At.bind(this), this._onTouchMove = zt.bind(this), this._onMouseDown = Tt.bind(this), this._onMouseMove = Ct.bind(this), this._interceptControlDown = Ot.bind(this), this._interceptControlUp = Lt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
22
+ constructor(t, e = null) {
23
+ super(t, e), this.state = S.NONE, this.target = new y(), this.cursor = new y(), 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: at.ROTATE, MIDDLE: at.DOLLY, RIGHT: at.PAN }, this.touches = { ONE: ct.ROTATE, TWO: ct.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new y(), this._lastQuaternion = new Nt(), this._lastTargetPosition = new y(), this._quat = new Nt().setFromUnitVectors(t.up, new y(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ut(), this._sphericalDelta = new Ut(), this._scale = 1, this._panOffset = new y(), this._rotateStart = new tt(), this._rotateEnd = new tt(), this._rotateDelta = new tt(), this._panStart = new tt(), this._panEnd = new tt(), this._panDelta = new tt(), this._dollyStart = new tt(), this._dollyEnd = new tt(), this._dollyDelta = new tt(), this._dollyDirection = new y(), this._mouse = new tt(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = xe.bind(this), this._onPointerDown = Ee.bind(this), this._onPointerUp = De.bind(this), this._onContextMenu = Re.bind(this), this._onMouseWheel = Se.bind(this), this._onKeyDown = ke.bind(this), this._onTouchStart = Ae.bind(this), this._onTouchMove = ze.bind(this), this._onMouseDown = Te.bind(this), this._onMouseMove = Ce.bind(this), this._interceptControlDown = Oe.bind(this), this._interceptControlUp = Le.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
24
24
  }
25
- connect(e) {
26
- super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
25
+ connect(t) {
26
+ super.connect(t), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
27
27
  }
28
28
  disconnect() {
29
29
  this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.domElement.removeEventListener("pointercancel", this._onPointerUp), this.domElement.removeEventListener("wheel", this._onMouseWheel), this.domElement.removeEventListener("contextmenu", this._onContextMenu), this.stopListenToKeyEvents(), this.domElement.getRootNode().removeEventListener("keydown", this._interceptControlDown, { capture: !0 }), this.domElement.style.touchAction = "auto";
@@ -61,8 +61,8 @@ class Mt extends st {
61
61
  *
62
62
  * @param {HTMLDOMElement} domElement - The DOM element
63
63
  */
64
- listenToKeyEvents(e) {
65
- e.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = e;
64
+ listenToKeyEvents(t) {
65
+ t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
66
66
  }
67
67
  /**
68
68
  * Removes the key event listener previously defined with `listenToKeyEvents()`.
@@ -81,11 +81,11 @@ class Mt extends st {
81
81
  * was called, or the initial state.
82
82
  */
83
83
  reset() {
84
- this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ve), this.update(), this.state = S.NONE;
84
+ this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Yt), this.update(), this.state = S.NONE;
85
85
  }
86
- update(e = null) {
87
- const t = this.object.position;
88
- N.copy(t).sub(this.target), N.applyQuaternion(this._quat), this._spherical.setFromVector3(N), 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);
86
+ update(t = null) {
87
+ const e = this.object.position;
88
+ U.copy(e).sub(this.target), U.applyQuaternion(this._quat), this._spherical.setFromVector3(U), this.autoRotate && this.state === S.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), 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);
89
89
  let i = this.minAzimuthAngle, n = this.maxAzimuthAngle;
90
90
  isFinite(i) && isFinite(n) && (i < -Math.PI ? i += X : i > Math.PI && (i -= X), n < -Math.PI ? n += X : n > Math.PI && (n -= X), i <= n ? this._spherical.theta = Math.max(i, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + n) / 2 ? Math.max(i, 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);
91
91
  let d = !1;
@@ -95,209 +95,209 @@ class Mt extends st {
95
95
  const m = this._spherical.radius;
96
96
  this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), d = m != this._spherical.radius;
97
97
  }
98
- if (N.setFromSpherical(this._spherical), N.applyQuaternion(this._quatInverse), t.copy(this.target).add(N), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
98
+ if (U.setFromSpherical(this._spherical), U.applyQuaternion(this._quatInverse), e.copy(this.target).add(U), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
99
99
  let m = null;
100
100
  if (this.object.isPerspectiveCamera) {
101
- const a = N.length();
101
+ const a = U.length();
102
102
  m = this._clampDistance(a * this._scale);
103
- const b = a - m;
104
- this.object.position.addScaledVector(this._dollyDirection, b), this.object.updateMatrixWorld(), d = !!b;
103
+ const w = a - m;
104
+ this.object.position.addScaledVector(this._dollyDirection, w), this.object.updateMatrixWorld(), d = !!w;
105
105
  } else if (this.object.isOrthographicCamera) {
106
106
  const a = new y(this._mouse.x, this._mouse.y, 0);
107
107
  a.unproject(this.object);
108
- const b = this.object.zoom;
109
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), d = b !== this.object.zoom;
108
+ const w = this.object.zoom;
109
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), d = w !== this.object.zoom;
110
110
  const P = new y(this._mouse.x, this._mouse.y, 0);
111
- P.unproject(this.object), this.object.position.sub(P).add(a), this.object.updateMatrixWorld(), m = N.length();
111
+ P.unproject(this.object), this.object.position.sub(P).add(a), this.object.updateMatrixWorld(), m = U.length();
112
112
  } else
113
113
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
114
- m !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(m).add(this.object.position) : (be.origin.copy(this.object.position), be.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(be.direction)) < Pt ? this.object.lookAt(this.target) : (He.setFromNormalAndCoplanarPoint(this.object.up, this.target), be.intersectPlane(He, this.target))));
114
+ m !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(m).add(this.object.position) : (bt.origin.copy(this.object.position), bt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(bt.direction)) < Pe ? this.object.lookAt(this.target) : (Ht.setFromNormalAndCoplanarPoint(this.object.up, this.target), bt.intersectPlane(Ht, this.target))));
115
115
  } else if (this.object.isOrthographicCamera) {
116
116
  const m = this.object.zoom;
117
117
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), m !== this.object.zoom && (this.object.updateProjectionMatrix(), d = !0);
118
118
  }
119
- return this._scale = 1, this._performCursorZoom = !1, d || this._lastPosition.distanceToSquared(this.object.position) > ke || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > ke || this._lastTargetPosition.distanceToSquared(this.target) > ke ? (this.dispatchEvent(Ve), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
119
+ return this._scale = 1, this._performCursorZoom = !1, d || this._lastPosition.distanceToSquared(this.object.position) > kt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > kt || this._lastTargetPosition.distanceToSquared(this.target) > kt ? (this.dispatchEvent(Yt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
120
120
  }
121
- _getAutoRotationAngle(e) {
122
- return e !== null ? X / 60 * this.autoRotateSpeed * e : X / 60 / 60 * this.autoRotateSpeed;
121
+ _getAutoRotationAngle(t) {
122
+ return t !== null ? X / 60 * this.autoRotateSpeed * t : X / 60 / 60 * this.autoRotateSpeed;
123
123
  }
124
- _getZoomScale(e) {
125
- const t = Math.abs(e * 0.01);
126
- return Math.pow(0.95, this.zoomSpeed * t);
124
+ _getZoomScale(t) {
125
+ const e = Math.abs(t * 0.01);
126
+ return Math.pow(0.95, this.zoomSpeed * e);
127
127
  }
128
- _rotateLeft(e) {
129
- this._sphericalDelta.theta -= e;
128
+ _rotateLeft(t) {
129
+ this._sphericalDelta.theta -= t;
130
130
  }
131
- _rotateUp(e) {
132
- this._sphericalDelta.phi -= e;
131
+ _rotateUp(t) {
132
+ this._sphericalDelta.phi -= t;
133
133
  }
134
- _panLeft(e, t) {
135
- N.setFromMatrixColumn(t, 0), N.multiplyScalar(-e), this._panOffset.add(N);
134
+ _panLeft(t, e) {
135
+ U.setFromMatrixColumn(e, 0), U.multiplyScalar(-t), this._panOffset.add(U);
136
136
  }
137
- _panUp(e, t) {
138
- this.screenSpacePanning === !0 ? N.setFromMatrixColumn(t, 1) : (N.setFromMatrixColumn(t, 0), N.crossVectors(this.object.up, N)), N.multiplyScalar(e), this._panOffset.add(N);
137
+ _panUp(t, e) {
138
+ this.screenSpacePanning === !0 ? U.setFromMatrixColumn(e, 1) : (U.setFromMatrixColumn(e, 0), U.crossVectors(this.object.up, U)), U.multiplyScalar(t), this._panOffset.add(U);
139
139
  }
140
140
  // deltaX and deltaY are in pixels; right and down are positive
141
- _pan(e, t) {
141
+ _pan(t, e) {
142
142
  const i = this.domElement;
143
143
  if (this.object.isPerspectiveCamera) {
144
144
  const n = this.object.position;
145
- N.copy(n).sub(this.target);
146
- let d = N.length();
147
- d *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * d / i.clientHeight, this.object.matrix), this._panUp(2 * t * d / i.clientHeight, this.object.matrix);
148
- } else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
145
+ U.copy(n).sub(this.target);
146
+ let d = U.length();
147
+ d *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * d / i.clientHeight, this.object.matrix), this._panUp(2 * e * d / i.clientHeight, this.object.matrix);
148
+ } else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(e * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
149
149
  }
150
- _dollyOut(e) {
151
- this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
150
+ _dollyOut(t) {
151
+ this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
152
152
  }
153
- _dollyIn(e) {
154
- this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
153
+ _dollyIn(t) {
154
+ this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
155
155
  }
156
- _updateZoomParameters(e, t) {
156
+ _updateZoomParameters(t, e) {
157
157
  if (!this.zoomToCursor)
158
158
  return;
159
159
  this._performCursorZoom = !0;
160
- const i = this.domElement.getBoundingClientRect(), n = e - i.left, d = t - i.top, m = i.width, a = i.height;
160
+ const i = this.domElement.getBoundingClientRect(), n = t - i.left, d = e - i.top, m = i.width, a = i.height;
161
161
  this._mouse.x = n / m * 2 - 1, this._mouse.y = -(d / a) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
162
162
  }
163
- _clampDistance(e) {
164
- return Math.max(this.minDistance, Math.min(this.maxDistance, e));
163
+ _clampDistance(t) {
164
+ return Math.max(this.minDistance, Math.min(this.maxDistance, t));
165
165
  }
166
166
  //
167
167
  // event callbacks - update the object state
168
168
  //
169
- _handleMouseDownRotate(e) {
170
- this._rotateStart.set(e.clientX, e.clientY);
169
+ _handleMouseDownRotate(t) {
170
+ this._rotateStart.set(t.clientX, t.clientY);
171
171
  }
172
- _handleMouseDownDolly(e) {
173
- this._updateZoomParameters(e.clientX, e.clientX), this._dollyStart.set(e.clientX, e.clientY);
172
+ _handleMouseDownDolly(t) {
173
+ this._updateZoomParameters(t.clientX, t.clientX), this._dollyStart.set(t.clientX, t.clientY);
174
174
  }
175
- _handleMouseDownPan(e) {
176
- this._panStart.set(e.clientX, e.clientY);
175
+ _handleMouseDownPan(t) {
176
+ this._panStart.set(t.clientX, t.clientY);
177
177
  }
178
- _handleMouseMoveRotate(e) {
179
- this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
180
- const t = this.domElement;
181
- this._rotateLeft(X * this._rotateDelta.x / t.clientHeight), this._rotateUp(X * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
178
+ _handleMouseMoveRotate(t) {
179
+ this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
180
+ const e = this.domElement;
181
+ this._rotateLeft(X * this._rotateDelta.x / e.clientHeight), this._rotateUp(X * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
182
182
  }
183
- _handleMouseMoveDolly(e) {
184
- this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
183
+ _handleMouseMoveDolly(t) {
184
+ this._dollyEnd.set(t.clientX, t.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
185
185
  }
186
- _handleMouseMovePan(e) {
187
- this._panEnd.set(e.clientX, e.clientY), this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd), this.update();
186
+ _handleMouseMovePan(t) {
187
+ this._panEnd.set(t.clientX, t.clientY), this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd), this.update();
188
188
  }
189
- _handleMouseWheel(e) {
190
- this._updateZoomParameters(e.clientX, e.clientY), e.deltaY < 0 ? this._dollyIn(this._getZoomScale(e.deltaY)) : e.deltaY > 0 && this._dollyOut(this._getZoomScale(e.deltaY)), this.update();
189
+ _handleMouseWheel(t) {
190
+ this._updateZoomParameters(t.clientX, t.clientY), t.deltaY < 0 ? this._dollyIn(this._getZoomScale(t.deltaY)) : t.deltaY > 0 && this._dollyOut(this._getZoomScale(t.deltaY)), this.update();
191
191
  }
192
- _handleKeyDown(e) {
193
- let t = !1;
194
- switch (e.code) {
192
+ _handleKeyDown(t) {
193
+ let e = !1;
194
+ switch (t.code) {
195
195
  case this.keys.UP:
196
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
196
+ t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), e = !0;
197
197
  break;
198
198
  case this.keys.BOTTOM:
199
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
199
+ t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), e = !0;
200
200
  break;
201
201
  case this.keys.LEFT:
202
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
202
+ t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), e = !0;
203
203
  break;
204
204
  case this.keys.RIGHT:
205
- e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
205
+ t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-X * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), e = !0;
206
206
  break;
207
207
  }
208
- t && (e.preventDefault(), this.update());
208
+ e && (t.preventDefault(), this.update());
209
209
  }
210
- _handleTouchStartRotate(e) {
210
+ _handleTouchStartRotate(t) {
211
211
  if (this._pointers.length === 1)
212
- this._rotateStart.set(e.pageX, e.pageY);
212
+ this._rotateStart.set(t.pageX, t.pageY);
213
213
  else {
214
- const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
214
+ const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
215
215
  this._rotateStart.set(i, n);
216
216
  }
217
217
  }
218
- _handleTouchStartPan(e) {
218
+ _handleTouchStartPan(t) {
219
219
  if (this._pointers.length === 1)
220
- this._panStart.set(e.pageX, e.pageY);
220
+ this._panStart.set(t.pageX, t.pageY);
221
221
  else {
222
- const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
222
+ const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
223
223
  this._panStart.set(i, n);
224
224
  }
225
225
  }
226
- _handleTouchStartDolly(e) {
227
- const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, n = e.pageY - t.y, d = Math.sqrt(i * i + n * n);
226
+ _handleTouchStartDolly(t) {
227
+ const e = this._getSecondPointerPosition(t), i = t.pageX - e.x, n = t.pageY - e.y, d = Math.sqrt(i * i + n * n);
228
228
  this._dollyStart.set(0, d);
229
229
  }
230
- _handleTouchStartDollyPan(e) {
231
- this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
230
+ _handleTouchStartDollyPan(t) {
231
+ this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
232
232
  }
233
- _handleTouchStartDollyRotate(e) {
234
- this.enableZoom && this._handleTouchStartDolly(e), this.enableRotate && this._handleTouchStartRotate(e);
233
+ _handleTouchStartDollyRotate(t) {
234
+ this.enableZoom && this._handleTouchStartDolly(t), this.enableRotate && this._handleTouchStartRotate(t);
235
235
  }
236
- _handleTouchMoveRotate(e) {
236
+ _handleTouchMoveRotate(t) {
237
237
  if (this._pointers.length == 1)
238
- this._rotateEnd.set(e.pageX, e.pageY);
238
+ this._rotateEnd.set(t.pageX, t.pageY);
239
239
  else {
240
- const i = this._getSecondPointerPosition(e), n = 0.5 * (e.pageX + i.x), d = 0.5 * (e.pageY + i.y);
240
+ const i = this._getSecondPointerPosition(t), n = 0.5 * (t.pageX + i.x), d = 0.5 * (t.pageY + i.y);
241
241
  this._rotateEnd.set(n, d);
242
242
  }
243
243
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
244
- const t = this.domElement;
245
- this._rotateLeft(X * this._rotateDelta.x / t.clientHeight), this._rotateUp(X * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
244
+ const e = this.domElement;
245
+ this._rotateLeft(X * this._rotateDelta.x / e.clientHeight), this._rotateUp(X * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd);
246
246
  }
247
- _handleTouchMovePan(e) {
247
+ _handleTouchMovePan(t) {
248
248
  if (this._pointers.length === 1)
249
- this._panEnd.set(e.pageX, e.pageY);
249
+ this._panEnd.set(t.pageX, t.pageY);
250
250
  else {
251
- const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
251
+ const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
252
252
  this._panEnd.set(i, n);
253
253
  }
254
254
  this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
255
255
  }
256
- _handleTouchMoveDolly(e) {
257
- const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, n = e.pageY - t.y, d = Math.sqrt(i * i + n * n);
256
+ _handleTouchMoveDolly(t) {
257
+ const e = this._getSecondPointerPosition(t), i = t.pageX - e.x, n = t.pageY - e.y, d = Math.sqrt(i * i + n * n);
258
258
  this._dollyEnd.set(0, d), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
259
- const m = (e.pageX + t.x) * 0.5, a = (e.pageY + t.y) * 0.5;
259
+ const m = (t.pageX + e.x) * 0.5, a = (t.pageY + e.y) * 0.5;
260
260
  this._updateZoomParameters(m, a);
261
261
  }
262
- _handleTouchMoveDollyPan(e) {
263
- this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
262
+ _handleTouchMoveDollyPan(t) {
263
+ this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
264
264
  }
265
- _handleTouchMoveDollyRotate(e) {
266
- this.enableZoom && this._handleTouchMoveDolly(e), this.enableRotate && this._handleTouchMoveRotate(e);
265
+ _handleTouchMoveDollyRotate(t) {
266
+ this.enableZoom && this._handleTouchMoveDolly(t), this.enableRotate && this._handleTouchMoveRotate(t);
267
267
  }
268
268
  // pointers
269
- _addPointer(e) {
270
- this._pointers.push(e.pointerId);
269
+ _addPointer(t) {
270
+ this._pointers.push(t.pointerId);
271
271
  }
272
- _removePointer(e) {
273
- delete this._pointerPositions[e.pointerId];
274
- for (let t = 0; t < this._pointers.length; t++)
275
- if (this._pointers[t] == e.pointerId) {
276
- this._pointers.splice(t, 1);
272
+ _removePointer(t) {
273
+ delete this._pointerPositions[t.pointerId];
274
+ for (let e = 0; e < this._pointers.length; e++)
275
+ if (this._pointers[e] == t.pointerId) {
276
+ this._pointers.splice(e, 1);
277
277
  return;
278
278
  }
279
279
  }
280
- _isTrackingPointer(e) {
281
- for (let t = 0; t < this._pointers.length; t++)
282
- if (this._pointers[t] == e.pointerId) return !0;
280
+ _isTrackingPointer(t) {
281
+ for (let e = 0; e < this._pointers.length; e++)
282
+ if (this._pointers[e] == t.pointerId) return !0;
283
283
  return !1;
284
284
  }
285
- _trackPointer(e) {
286
- let t = this._pointerPositions[e.pointerId];
287
- t === void 0 && (t = new ee(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
285
+ _trackPointer(t) {
286
+ let e = this._pointerPositions[t.pointerId];
287
+ e === void 0 && (e = new tt(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
288
288
  }
289
- _getSecondPointerPosition(e) {
290
- const t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
291
- return this._pointerPositions[t];
289
+ _getSecondPointerPosition(t) {
290
+ const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
291
+ return this._pointerPositions[e];
292
292
  }
293
293
  //
294
- _customWheelEvent(e) {
295
- const t = e.deltaMode, i = {
296
- clientX: e.clientX,
297
- clientY: e.clientY,
298
- deltaY: e.deltaY
294
+ _customWheelEvent(t) {
295
+ const e = t.deltaMode, i = {
296
+ clientX: t.clientX,
297
+ clientY: t.clientY,
298
+ deltaY: t.deltaY
299
299
  };
300
- switch (t) {
300
+ switch (e) {
301
301
  case 1:
302
302
  i.deltaY *= 16;
303
303
  break;
@@ -305,47 +305,47 @@ class Mt extends st {
305
305
  i.deltaY *= 100;
306
306
  break;
307
307
  }
308
- return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
308
+ return t.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
309
309
  }
310
310
  }
311
- function xt(o) {
311
+ function Ee(o) {
312
312
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(o.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(o) && (this._addPointer(o), o.pointerType === "touch" ? this._onTouchStart(o) : this._onMouseDown(o)));
313
313
  }
314
- function Et(o) {
314
+ function xe(o) {
315
315
  this.enabled !== !1 && (o.pointerType === "touch" ? this._onTouchMove(o) : this._onMouseMove(o));
316
316
  }
317
- function Dt(o) {
317
+ function De(o) {
318
318
  switch (this._removePointer(o), this._pointers.length) {
319
319
  case 0:
320
- this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Je), this.state = S.NONE;
320
+ this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Jt), this.state = S.NONE;
321
321
  break;
322
322
  case 1:
323
- const e = this._pointers[0], t = this._pointerPositions[e];
324
- this._onTouchStart({ pointerId: e, pageX: t.x, pageY: t.y });
323
+ const t = this._pointers[0], e = this._pointerPositions[t];
324
+ this._onTouchStart({ pointerId: t, pageX: e.x, pageY: e.y });
325
325
  break;
326
326
  }
327
327
  }
328
- function Tt(o) {
329
- let e;
328
+ function Te(o) {
329
+ let t;
330
330
  switch (o.button) {
331
331
  case 0:
332
- e = this.mouseButtons.LEFT;
332
+ t = this.mouseButtons.LEFT;
333
333
  break;
334
334
  case 1:
335
- e = this.mouseButtons.MIDDLE;
335
+ t = this.mouseButtons.MIDDLE;
336
336
  break;
337
337
  case 2:
338
- e = this.mouseButtons.RIGHT;
338
+ t = this.mouseButtons.RIGHT;
339
339
  break;
340
340
  default:
341
- e = -1;
341
+ t = -1;
342
342
  }
343
- switch (e) {
344
- case ae.DOLLY:
343
+ switch (t) {
344
+ case at.DOLLY:
345
345
  if (this.enableZoom === !1) return;
346
346
  this._handleMouseDownDolly(o), this.state = S.DOLLY;
347
347
  break;
348
- case ae.ROTATE:
348
+ case at.ROTATE:
349
349
  if (o.ctrlKey || o.metaKey || o.shiftKey) {
350
350
  if (this.enablePan === !1) return;
351
351
  this._handleMouseDownPan(o), this.state = S.PAN;
@@ -354,7 +354,7 @@ function Tt(o) {
354
354
  this._handleMouseDownRotate(o), this.state = S.ROTATE;
355
355
  }
356
356
  break;
357
- case ae.PAN:
357
+ case at.PAN:
358
358
  if (o.ctrlKey || o.metaKey || o.shiftKey) {
359
359
  if (this.enableRotate === !1) return;
360
360
  this._handleMouseDownRotate(o), this.state = S.ROTATE;
@@ -366,9 +366,9 @@ function Tt(o) {
366
366
  default:
367
367
  this.state = S.NONE;
368
368
  }
369
- this.state !== S.NONE && this.dispatchEvent(Re);
369
+ this.state !== S.NONE && this.dispatchEvent(Rt);
370
370
  }
371
- function Ct(o) {
371
+ function Ce(o) {
372
372
  switch (this.state) {
373
373
  case S.ROTATE:
374
374
  if (this.enableRotate === !1) return;
@@ -384,21 +384,21 @@ function Ct(o) {
384
384
  break;
385
385
  }
386
386
  }
387
- function St(o) {
388
- this.enabled === !1 || this.enableZoom === !1 || this.state !== S.NONE || (o.preventDefault(), this.dispatchEvent(Re), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Je));
387
+ function Se(o) {
388
+ this.enabled === !1 || this.enableZoom === !1 || this.state !== S.NONE || (o.preventDefault(), this.dispatchEvent(Rt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Jt));
389
389
  }
390
- function kt(o) {
390
+ function ke(o) {
391
391
  this.enabled !== !1 && this._handleKeyDown(o);
392
392
  }
393
- function At(o) {
393
+ function Ae(o) {
394
394
  switch (this._trackPointer(o), this._pointers.length) {
395
395
  case 1:
396
396
  switch (this.touches.ONE) {
397
- case ce.ROTATE:
397
+ case ct.ROTATE:
398
398
  if (this.enableRotate === !1) return;
399
399
  this._handleTouchStartRotate(o), this.state = S.TOUCH_ROTATE;
400
400
  break;
401
- case ce.PAN:
401
+ case ct.PAN:
402
402
  if (this.enablePan === !1) return;
403
403
  this._handleTouchStartPan(o), this.state = S.TOUCH_PAN;
404
404
  break;
@@ -408,11 +408,11 @@ function At(o) {
408
408
  break;
409
409
  case 2:
410
410
  switch (this.touches.TWO) {
411
- case ce.DOLLY_PAN:
411
+ case ct.DOLLY_PAN:
412
412
  if (this.enableZoom === !1 && this.enablePan === !1) return;
413
413
  this._handleTouchStartDollyPan(o), this.state = S.TOUCH_DOLLY_PAN;
414
414
  break;
415
- case ce.DOLLY_ROTATE:
415
+ case ct.DOLLY_ROTATE:
416
416
  if (this.enableZoom === !1 && this.enableRotate === !1) return;
417
417
  this._handleTouchStartDollyRotate(o), this.state = S.TOUCH_DOLLY_ROTATE;
418
418
  break;
@@ -423,9 +423,9 @@ function At(o) {
423
423
  default:
424
424
  this.state = S.NONE;
425
425
  }
426
- this.state !== S.NONE && this.dispatchEvent(Re);
426
+ this.state !== S.NONE && this.dispatchEvent(Rt);
427
427
  }
428
- function zt(o) {
428
+ function ze(o) {
429
429
  switch (this._trackPointer(o), this.state) {
430
430
  case S.TOUCH_ROTATE:
431
431
  if (this.enableRotate === !1) return;
@@ -447,29 +447,29 @@ function zt(o) {
447
447
  this.state = S.NONE;
448
448
  }
449
449
  }
450
- function Rt(o) {
450
+ function Re(o) {
451
451
  this.enabled !== !1 && o.preventDefault();
452
452
  }
453
- function Ot(o) {
453
+ function Oe(o) {
454
454
  o.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
455
455
  }
456
- function Lt(o) {
456
+ function Le(o) {
457
457
  o.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
458
458
  }
459
- function jt(o) {
460
- let e = null, t = null, i = null, n = null, d = null, m = null, a = null, b = null;
459
+ function je(o) {
460
+ let t = null, e = null, i = null, n = null, d = null, m = null, a = null, w = null;
461
461
  const P = D([]), O = D(new y()), L = D(new y()), j = () => {
462
462
  if (!o.value) return;
463
- e = new ot(), e.background = new nt(15790320);
463
+ t = new oe(), t.background = new ne(15790320);
464
464
  const p = o.value;
465
- t = new at(75, p.clientWidth / p.clientHeight, 0.1, 1e4), t.position.set(8, -8, 6), t.up.set(0, 0, 1), t.lookAt(0, 0, 0), i = new lt({
465
+ e = new ae(75, p.clientWidth / p.clientHeight, 0.1, 1e4), e.position.set(8, -8, 6), e.up.set(0, 0, 1), e.lookAt(0, 0, 0), i = new le({
466
466
  antialias: !0,
467
467
  alpha: !0
468
- }), i.setSize(p.clientWidth, p.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = rt, i.toneMapping = ht, i.toneMappingExposure = 1, i.outputColorSpace = ct, p.appendChild(i.domElement), n = new Mt(t, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
469
- LEFT: ae.ROTATE,
470
- MIDDLE: ae.PAN,
468
+ }), i.setSize(p.clientWidth, p.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = re, i.toneMapping = he, i.toneMappingExposure = 1, i.outputColorSpace = ce, p.appendChild(i.domElement), n = new Me(e, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
469
+ LEFT: at.ROTATE,
470
+ MIDDLE: at.PAN,
471
471
  RIGHT: null
472
- }, n.panSpeed = 0.7, d = new ut(t, i, {
472
+ }, n.panSpeed = 0.7, d = new ue(e, i, {
473
473
  container: p,
474
474
  type: "cube",
475
475
  placement: "top-right",
@@ -501,19 +501,19 @@ function jt(o) {
501
501
  }
502
502
  }), d.attachControls(n), f(), s();
503
503
  }, l = (p, r) => {
504
- a && (e.remove(a), a.dispose()), b && (e.remove(b), b.geometry.dispose(), b.material.dispose());
504
+ a && (t.remove(a), a.dispose()), w && (t.remove(w), w.geometry.dispose(), w.material.dispose());
505
505
  const M = Math.min(Math.max(Math.floor(p / 20), 30), 40);
506
- a = new pt(p, M, 13421772, 14540253), a.rotateX(Math.PI / 2), a.position.copy(r), e.add(a);
507
- const $ = new Me(p, p), G = new dt({
506
+ a = new pe(p, M, 13421772, 14540253), a.rotateX(Math.PI / 2), a.position.copy(r), t.add(a);
507
+ const $ = new Mt(p, p), G = new de({
508
508
  opacity: 0.3,
509
509
  // 阴影透明度
510
510
  color: 0
511
511
  });
512
- b = new Xe($, G), b.position.copy(r), b.position.z -= 0.01, b.receiveShadow = !0, e.add(b);
512
+ w = new Xt($, G), w.position.copy(r), w.position.z -= 0.01, w.receiveShadow = !0, t.add(w);
513
513
  }, k = () => {
514
514
  if (P.value.length === 0)
515
515
  return;
516
- const p = new Ee();
516
+ const p = new xt();
517
517
  P.value.forEach((W) => {
518
518
  p.expandByObject(W);
519
519
  });
@@ -525,22 +525,22 @@ function jt(o) {
525
525
  );
526
526
  l(G, I);
527
527
  }, f = () => {
528
- const p = new mt(4210752, 0.6);
529
- e.add(p);
530
- const r = new Te(16777215, 2);
531
- r.position.set(10, 10, 8), r.castShadow = !0, r.shadow.mapSize.width = 4096, r.shadow.mapSize.height = 4096, r.shadow.camera.near = 0.5, r.shadow.camera.far = 50, r.shadow.camera.left = -50, r.shadow.camera.right = 50, r.shadow.camera.top = 50, r.shadow.camera.bottom = -50, e.add(r);
532
- const M = new Te(16777215, 0.8);
533
- M.position.set(-8, -8, 6), e.add(M);
534
- const $ = new Te(16777215, 0.6);
535
- $.position.set(0, -15, 2), e.add($);
536
- const G = new ft(16777215, 4473924, 0.8);
537
- e.add(G);
538
- const I = new Ye(16777215, 1, 50);
539
- I.position.set(15, 15, 15), e.add(I);
540
- const W = new Ye(16777215, 0.5, 50);
541
- W.position.set(-15, -15, 15), e.add(W);
528
+ const p = new me(4210752, 0.6);
529
+ t.add(p);
530
+ const r = new Tt(16777215, 2);
531
+ r.position.set(10, 10, 8), r.castShadow = !0, r.shadow.mapSize.width = 4096, r.shadow.mapSize.height = 4096, r.shadow.camera.near = 0.5, r.shadow.camera.far = 50, r.shadow.camera.left = -50, r.shadow.camera.right = 50, r.shadow.camera.top = 50, r.shadow.camera.bottom = -50, t.add(r);
532
+ const M = new Tt(16777215, 0.8);
533
+ M.position.set(-8, -8, 6), t.add(M);
534
+ const $ = new Tt(16777215, 0.6);
535
+ $.position.set(0, -15, 2), t.add($);
536
+ const G = new fe(16777215, 4473924, 0.8);
537
+ t.add(G);
538
+ const I = new Vt(16777215, 1, 50);
539
+ I.position.set(15, 15, 15), t.add(I);
540
+ const W = new Vt(16777215, 0.5, 50);
541
+ W.position.set(-15, -15, 15), t.add(W);
542
542
  }, s = () => {
543
- m = requestAnimationFrame(s), n && n.update(), i && e && t && i.render(e, t), d && d.render();
543
+ m = requestAnimationFrame(s), n && n.update(), i && t && e && i.render(t, e), d && d.render();
544
544
  }, u = (p) => {
545
545
  [
546
546
  "map",
@@ -557,7 +557,7 @@ function jt(o) {
557
557
  ].forEach((M) => {
558
558
  p[M] && p[M].dispose && p[M].dispose();
559
559
  }), p.dispose && p.dispose();
560
- }, v = (p) => {
560
+ }, b = (p) => {
561
561
  p == null || p.traverse((r) => {
562
562
  r.geometry && r.geometry.dispose(), r.material && (Array.isArray(r.material) ? r.material.forEach((M) => {
563
563
  u(M);
@@ -572,108 +572,108 @@ function jt(o) {
572
572
  // 方法
573
573
  initThreeJS: j,
574
574
  handleResize: () => {
575
- if (!o.value || !t || !i || !d) return;
575
+ if (!o.value || !e || !i || !d) return;
576
576
  const p = o.value, r = p.clientWidth, M = p.clientHeight;
577
- t.aspect = r / M, t.updateProjectionMatrix(), i.setSize(r, M), d.update();
577
+ e.aspect = r / M, e.updateProjectionMatrix(), i.setSize(r, M), d.update();
578
578
  },
579
579
  fitCameraToAllModels: () => {
580
- if (!t || !n || P.value.length === 0) return;
581
- const p = new Ee();
580
+ if (!e || !n || P.value.length === 0) return;
581
+ const p = new xt();
582
582
  P.value.forEach((W) => {
583
583
  p.expandByObject(W);
584
584
  });
585
585
  const r = p.getSize(new y()), M = p.getCenter(new y()), G = Math.max(r.x, r.y, r.z) * 0.8, I = new y(M.x + G, M.y - G, M.z + G);
586
- t.position.copy(I), t.lookAt(M), n.target.copy(M), n.update(), O.value.copy(I), L.value.copy(M), k();
586
+ e.position.copy(I), e.lookAt(M), n.target.copy(M), n.update(), O.value.copy(I), L.value.copy(M), k();
587
587
  },
588
588
  getThreeJSObjects: () => ({
589
- scene: e,
590
- camera: t,
589
+ scene: t,
590
+ camera: e,
591
591
  renderer: i,
592
592
  controls: n,
593
593
  gizmo: d
594
594
  }),
595
595
  clearAllModels: () => {
596
- if (!e) return;
596
+ if (!t) return;
597
597
  P.value.forEach((r) => {
598
- e.remove(r), v(r);
598
+ t.remove(r), b(r);
599
599
  });
600
600
  const p = [];
601
- e.children.forEach((r) => {
602
- !r.isLight && !r.isCamera && r.type !== "GridHelper" && r !== b && p.push(r);
601
+ t.children.forEach((r) => {
602
+ !r.isLight && !r.isCamera && r.type !== "GridHelper" && r !== w && p.push(r);
603
603
  }), p.forEach((r) => {
604
- e.remove(r), v(r);
604
+ t.remove(r), b(r);
605
605
  }), P.value = [], k();
606
606
  },
607
607
  cleanup: () => {
608
- m && cancelAnimationFrame(m), a && a.dispose(), b && (b.geometry.dispose(), b.material.dispose()), i && i.dispose(), n && n.dispose(), d && d.dispose();
608
+ m && cancelAnimationFrame(m), a && a.dispose(), w && (w.geometry.dispose(), w.material.dispose()), i && i.dispose(), n && n.dispose(), d && d.dispose();
609
609
  },
610
610
  updateGridForModels: k
611
611
  };
612
612
  }
613
- function It(o, e) {
614
- const t = D(!1);
615
- let i = null, n = 12700, d = new y(), m = new y(), a = new y(), b = 0, P = null;
613
+ function Ie(o, t) {
614
+ const e = D(!1);
615
+ let i = null, n = 12700, d = new y(), m = new y(), a = new y(), w = 0, P = null;
616
616
  const O = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, L = (s) => {
617
- const u = new y(), v = b * 1.2, R = new y(a.x + v, a.y, a.z), V = new y(a.x, a.y + v, a.z), H = new y(a.x, a.y - v, a.z);
617
+ const u = new y(), b = w * 1.2, R = new y(a.x + b, a.y, a.z), H = new y(a.x, a.y + b, a.z), Z = new y(a.x, a.y - b, a.z);
618
618
  if (s <= 0.567) {
619
619
  const Y = s / 0.567 * Math.PI * 2;
620
- u.x = a.x + Math.cos(Y) * v, u.z = a.z + Math.sin(Y) * v, u.y = a.y;
620
+ u.x = a.x + Math.cos(Y) * b, u.z = a.z + Math.sin(Y) * b, u.y = a.y;
621
621
  } else if (s <= 0.724) {
622
622
  const F = (s - 0.567) / 0.157, Y = O(F);
623
- u.lerpVectors(R, V, Y);
623
+ u.lerpVectors(R, H, Y);
624
624
  } else if (s <= 0.881) {
625
625
  const F = (s - 0.724) / 0.157, p = O(F) * Math.PI;
626
- u.x = a.x + Math.sin(p) * v, u.y = a.y + Math.cos(p) * v, u.z = a.z;
626
+ u.x = a.x + Math.sin(p) * b, u.y = a.y + Math.cos(p) * b, u.z = a.z;
627
627
  } else {
628
628
  const F = (s - 0.881) / 0.119, Y = O(F);
629
- u.lerpVectors(H, d, Y);
629
+ u.lerpVectors(Z, d, Y);
630
630
  }
631
631
  return u;
632
632
  }, j = () => {
633
633
  const { camera: s, controls: u } = o();
634
634
  if (!s || !u) return;
635
635
  i || (i = Date.now());
636
- const v = Date.now() - i, R = Math.min(v / n, 1);
636
+ const b = Date.now() - i, R = Math.min(b / n, 1);
637
637
  if (R >= 1) {
638
638
  k();
639
639
  return;
640
640
  }
641
- const V = L(R);
642
- s.position.copy(V), s.lookAt(a), u.target.copy(a), P = requestAnimationFrame(j);
641
+ const H = L(R);
642
+ s.position.copy(H), s.lookAt(a), u.target.copy(a), P = requestAnimationFrame(j);
643
643
  }, l = () => {
644
- if (e.value.length === 0) return;
644
+ if (t.value.length === 0) return;
645
645
  const { camera: s, controls: u } = o();
646
646
  if (!s || !u) return;
647
647
  d.copy(s.position), m.copy(u.target);
648
- const v = new Ee();
649
- e.value.forEach((r) => {
650
- v.expandByObject(r);
648
+ const b = new xt();
649
+ t.value.forEach((r) => {
650
+ b.expandByObject(r);
651
651
  });
652
- const R = v.getSize(new y());
653
- a = v.getCenter(new y()), b = Math.max(R.x, R.y, R.z) * 1.2;
654
- const V = new y(a.x + b * 1.2, a.y, a.z);
652
+ const R = b.getSize(new y());
653
+ a = b.getCenter(new y()), w = Math.max(R.x, R.y, R.z) * 1.2;
654
+ const H = new y(a.x + w * 1.2, a.y, a.z);
655
655
  u.enabled = !1;
656
- const H = s.position.clone(), F = 1e3, Y = Date.now(), p = () => {
656
+ const Z = s.position.clone(), F = 1e3, Y = Date.now(), p = () => {
657
657
  const r = Date.now() - Y, M = Math.min(r / F, 1), $ = O(M);
658
- s.position.lerpVectors(H, V, $), s.lookAt(a), u.target.copy(a), M < 1 ? requestAnimationFrame(p) : (t.value = !0, i = null, j());
658
+ s.position.lerpVectors(Z, H, $), s.lookAt(a), u.target.copy(a), M < 1 ? requestAnimationFrame(p) : (e.value = !0, i = null, j());
659
659
  };
660
660
  p();
661
661
  }, k = () => {
662
- t.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
662
+ e.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
663
663
  const { controls: s } = o();
664
664
  s && (s.enabled = !0, s.target.copy(m));
665
665
  };
666
666
  return {
667
- isAnimating: t,
667
+ isAnimating: e,
668
668
  toggleAnimation: () => {
669
- if (t.value) {
670
- t.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
669
+ if (e.value) {
670
+ e.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
671
671
  const { camera: s, controls: u } = o();
672
672
  if (!s || !u) return;
673
673
  u.enabled = !0;
674
- const v = s.position.clone(), R = u.target.clone(), V = 1500, H = Date.now(), F = () => {
675
- const Y = Date.now() - H, p = Math.min(Y / V, 1), r = O(p);
676
- s.position.lerpVectors(v, d, r), u.target.lerpVectors(R, m, r), p < 1 && requestAnimationFrame(F);
674
+ const b = s.position.clone(), R = u.target.clone(), H = 1500, Z = Date.now(), F = () => {
675
+ const Y = Date.now() - Z, p = Math.min(Y / H, 1), r = O(p);
676
+ s.position.lerpVectors(b, d, r), u.target.lerpVectors(R, m, r), p < 1 && requestAnimationFrame(F);
677
677
  };
678
678
  F();
679
679
  } else
@@ -683,45 +683,45 @@ function It(o, e) {
683
683
  stopAnimation: k
684
684
  };
685
685
  }
686
- function Ft(o, e) {
687
- const t = D(!1), i = D("none");
688
- let n = [], d = [], m = new Ee(), a = new y();
689
- const b = () => {
686
+ function Fe(o, t) {
687
+ const e = D(!1), i = D("none");
688
+ let n = [], d = [], m = new xt(), a = new y();
689
+ const w = () => {
690
690
  n = [
691
- new Pe(new y(1, 0, 0), 0),
691
+ new Pt(new y(1, 0, 0), 0),
692
692
  // X轴平面
693
- new Pe(new y(0, 1, 0), 0),
693
+ new Pt(new y(0, 1, 0), 0),
694
694
  // Y轴平面
695
- new Pe(new y(0, 0, 1), 0)
695
+ new Pt(new y(0, 0, 1), 0)
696
696
  // Z轴平面
697
697
  ];
698
698
  }, P = () => {
699
- m.makeEmpty(), e.value.forEach((f) => {
699
+ m.makeEmpty(), t.value.forEach((f) => {
700
700
  m.expandByObject(f);
701
701
  }), a = m.getCenter(new y());
702
702
  }, O = (f) => {
703
703
  const s = m.getSize(new y());
704
- let u, v, R;
705
- f === "x" ? (u = new Me(s.z * 1.2, s.y * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(0, Math.PI / 2, 0)) : f === "y" ? (u = new Me(s.x * 1.2, s.z * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(Math.PI / 2, 0, 0)) : f === "z" && (u = new Me(s.x * 1.2, s.y * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(0, 0, 0));
706
- const V = new _t({
704
+ let u, b, R;
705
+ f === "x" ? (u = new Mt(s.z * 1.2, s.y * 1.2), b = new y(a.x, a.y, a.z), R = new Ct(0, Math.PI / 2, 0)) : f === "y" ? (u = new Mt(s.x * 1.2, s.z * 1.2), b = new y(a.x, a.y, a.z), R = new Ct(Math.PI / 2, 0, 0)) : f === "z" && (u = new Mt(s.x * 1.2, s.y * 1.2), b = new y(a.x, a.y, a.z), R = new Ct(0, 0, 0));
706
+ const H = new _e({
707
707
  color: 8900331,
708
708
  transparent: !0,
709
709
  opacity: 0.3,
710
- side: gt,
710
+ side: ge,
711
711
  depthWrite: !1
712
- }), H = new Xe(u, V);
713
- return H.position.copy(v), H.rotation.copy(R), H;
712
+ }), Z = new Xt(u, H);
713
+ return Z.position.copy(b), Z.rotation.copy(R), Z;
714
714
  }, L = () => {
715
715
  if (j(), l(), i.value === "none")
716
716
  return;
717
717
  P();
718
718
  let f = null;
719
719
  if (i.value === "x" ? (n[0].constant = -a.x, f = n[0]) : i.value === "y" ? (n[1].constant = -a.y, f = n[1]) : i.value === "z" && (n[2].constant = -a.z, f = n[2]), f) {
720
- e.value.forEach((u) => {
721
- u.traverse((v) => {
722
- v.isMesh && v.material && (Array.isArray(v.material) ? v.material.forEach((R) => {
720
+ t.value.forEach((u) => {
721
+ u.traverse((b) => {
722
+ b.isMesh && b.material && (Array.isArray(b.material) ? b.material.forEach((R) => {
723
723
  R.clippingPlanes = [f];
724
- }) : v.material.clippingPlanes = [f]);
724
+ }) : b.material.clippingPlanes = [f]);
725
725
  });
726
726
  });
727
727
  const { scene: s } = o();
@@ -731,7 +731,7 @@ function Ft(o, e) {
731
731
  }
732
732
  }
733
733
  }, j = () => {
734
- e.value.forEach((f) => {
734
+ t.value.forEach((f) => {
735
735
  f.traverse((s) => {
736
736
  s.isMesh && s.material && (Array.isArray(s.material) ? s.material.forEach((u) => {
737
737
  u.clippingPlanes = [];
@@ -745,47 +745,47 @@ function Ft(o, e) {
745
745
  }), d = [];
746
746
  };
747
747
  return {
748
- isClipping: t,
748
+ isClipping: e,
749
749
  activeClippingAxis: i,
750
750
  toggleClipping: () => {
751
- t.value = !t.value, t.value ? (b(), e.value.length > 0 && P()) : (i.value = "none", j(), l());
751
+ e.value = !e.value, e.value ? (w(), t.value.length > 0 && P()) : (i.value = "none", j(), l());
752
752
  },
753
753
  updateClippingPlanes: L,
754
754
  clearClippingPlanes: j,
755
755
  clearClippingMeshes: l
756
756
  };
757
757
  }
758
- const Nt = { class: "panel-content" }, Ut = {
758
+ const Ne = { class: "panel-content" }, Ue = {
759
759
  __name: "animationTable",
760
760
  props: {
761
761
  animationData: Object,
762
762
  model: Object
763
763
  },
764
764
  setup(o) {
765
- const e = o;
765
+ const t = o;
766
766
  D();
767
- const t = D();
768
- return xe(
769
- () => [e == null ? void 0 : e.animationData],
767
+ const e = D();
768
+ return Et(
769
+ () => [t == null ? void 0 : t.animationData],
770
770
  () => {
771
771
  var n;
772
- let i = ((n = Ge(e == null ? void 0 : e.animationData)) == null ? void 0 : n.动画输出Content) ?? [];
773
- i && (t.value = i);
772
+ let i = ((n = Gt(t == null ? void 0 : t.animationData)) == null ? void 0 : n.动画输出Content) ?? [];
773
+ i && (e.value = i);
774
774
  },
775
775
  { deep: !0, immediate: !0 }
776
776
  ), (i, n) => {
777
777
  var d, m, a;
778
- return B(), J("div", Nt, [
779
- (B(), Ze(yt, {
780
- itemData: (d = t.value) == null ? void 0 : d.compData,
781
- key: (m = t.value) == null ? void 0 : m.id,
782
- index: (a = t.value) == null ? void 0 : a.id,
778
+ return B(), J("div", Ne, [
779
+ (B(), Zt(ye, {
780
+ itemData: (d = e.value) == null ? void 0 : d.compData,
781
+ key: (m = e.value) == null ? void 0 : m.id,
782
+ index: (a = e.value) == null ? void 0 : a.id,
783
783
  showHeader: !1
784
784
  }, null, 8, ["itemData", "index"]))
785
785
  ]);
786
786
  };
787
787
  }
788
- }, Yt = /* @__PURE__ */ fe(Ut, [["__scopeId", "data-v-02b89b4b"]]), Vt = { class: "panel-content" }, Ht = "id", Zt = {
788
+ }, Ve = /* @__PURE__ */ ft(Ue, [["__scopeId", "data-v-02b89b4b"]]), Ye = { class: "panel-content" }, He = "id", Ze = {
789
789
  __name: "urdfTree",
790
790
  props: {
791
791
  model: Object,
@@ -800,8 +800,8 @@ const Nt = { class: "panel-content" }, Ut = {
800
800
  }
801
801
  },
802
802
  emits: ["nodeClick"],
803
- setup(o, { emit: e }) {
804
- const t = o, i = e, n = D([]), d = {
803
+ setup(o, { emit: t }) {
804
+ const e = o, i = t, n = D([]), d = {
805
805
  children: "children",
806
806
  label: "label"
807
807
  }, m = (l) => {
@@ -825,7 +825,7 @@ const Nt = { class: "panel-content" }, Ut = {
825
825
  f.push(u);
826
826
  }
827
827
  }), f;
828
- }, b = (l) => l ? [{
828
+ }, w = (l) => l ? [{
829
829
  name: l == null ? void 0 : l.name,
830
830
  label: l == null ? void 0 : l.name,
831
831
  show: !0,
@@ -848,143 +848,143 @@ const Nt = { class: "panel-content" }, Ut = {
848
848
  return l.forEach((s) => {
849
849
  if (s.children && s.children.length > 0) {
850
850
  f.push(s.id);
851
- const u = s.children.filter((v) => v.children && v.children.length > 0).slice(0, k).map((v) => v.id);
851
+ const u = s.children.filter((b) => b.children && b.children.length > 0).slice(0, k).map((b) => b.id);
852
852
  f.push(...u);
853
853
  }
854
854
  }), f.slice(0, k + 1);
855
- }, L = ue(() => !n.value || n.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? O(n.value, t.maxExpandCount) : P(n.value, t.maxExpandCount)), j = ue(() => t != null && t.model ? b(t.model) : []);
856
- return xe(
855
+ }, L = ut(() => !n.value || n.value.length === 0 ? [] : e.expandStrategy === "firstLevel" ? O(n.value, e.maxExpandCount) : P(n.value, e.maxExpandCount)), j = ut(() => e != null && e.model ? w(e.model) : []);
856
+ return Et(
857
857
  j,
858
858
  (l) => {
859
859
  n.value = JSON.parse(JSON.stringify(l));
860
860
  },
861
861
  { immediate: !0 }
862
862
  ), (l, k) => {
863
- const f = Ke("el-tree");
864
- return B(), J("div", Vt, [
863
+ const f = Kt("el-tree");
864
+ return B(), J("div", Ye, [
865
865
  T(f, {
866
866
  data: n.value,
867
867
  props: d,
868
868
  "default-expanded-keys": L.value,
869
- "node-key": Ht,
869
+ "node-key": He,
870
870
  onNodeClick: m
871
871
  }, null, 8, ["data", "default-expanded-keys"])
872
872
  ]);
873
873
  };
874
874
  }
875
- }, Kt = /* @__PURE__ */ fe(Zt, [["__scopeId", "data-v-290ff4e1"]]), Bt = { class: "panel-content" }, $t = {
875
+ }, Ke = /* @__PURE__ */ ft(Ze, [["__scopeId", "data-v-290ff4e1"]]), Be = { class: "panel-content" }, $e = {
876
876
  key: 0,
877
877
  class: "joints-list"
878
- }, Xt = { class: "joint-info-row" }, Gt = { class: "joint-left" }, Jt = { class: "joint-name" }, Wt = { class: "joint-range" }, qt = { class: "joint-type" }, Qt = {
878
+ }, Xe = { class: "joint-info-row" }, Ge = { class: "joint-left" }, Je = { class: "joint-name" }, We = { class: "joint-range" }, qe = { class: "joint-type" }, Qe = {
879
879
  key: 0,
880
880
  class: "joint-control-row"
881
- }, es = { class: "slider-container" }, ts = ["min", "max", "value", "onInput", "disabled"], ss = { class: "value-display" }, is = { class: "joint-value" }, os = { class: "unit" }, ns = {
881
+ }, ts = { class: "slider-container" }, es = ["min", "max", "value", "onInput", "disabled"], ss = { class: "value-display" }, is = { class: "joint-value" }, os = { class: "unit" }, ns = {
882
882
  key: 1,
883
883
  class: "empty-state"
884
- }, Ae = 1e-3, as = 1e3, ze = 60, ls = {
884
+ }, At = 1e-3, as = 1e3, zt = 60, ls = {
885
885
  __name: "jointPanel",
886
886
  props: {
887
887
  model: Object,
888
888
  scene: Object,
889
889
  animationData: Object
890
890
  },
891
- setup(o, { expose: e }) {
892
- const t = o;
891
+ setup(o, { expose: t }) {
892
+ const e = o;
893
893
  D(!0);
894
894
  const i = D([]), n = D(null), d = D(12.5), m = D();
895
895
  D(1302);
896
- const a = D(!1), b = D(!1), P = D(0), O = D(0), L = D(null), j = $e.degToRad, l = D(1), k = () => as / ze / l.value;
896
+ const a = D(!1), w = D(!1), P = D(0), O = D(0), L = D(null), j = $t.degToRad, l = D(1), k = () => as / zt / l.value;
897
897
  let f = [];
898
- xe(
899
- () => t.animationData,
898
+ Et(
899
+ () => e.animationData,
900
900
  (_) => {
901
901
  var c;
902
- let x = ((c = Ge(_)) == null ? void 0 : c.动画输出) ?? [];
903
- x && x.length > 0 && (f = x, p());
902
+ let E = ((c = Gt(_)) == null ? void 0 : c.动画输出) ?? [];
903
+ E && E.length > 0 && (f = E, p());
904
904
  },
905
905
  { deep: !0 }
906
906
  );
907
- const s = ue(() => f.length > 0), u = (_, x = !1) => _ === "revolute" ? x ? Math.PI : -Math.PI : _ === "prismatic" ? x ? 1 : -1 : 0, v = (_) => {
907
+ const s = ut(() => f.length > 0), u = (_, E = !1) => _ === "revolute" ? E ? Math.PI : -Math.PI : _ === "prismatic" ? E ? 1 : -1 : 0, b = (_) => {
908
908
  if (!_ || !_.joints)
909
909
  return console.warn("URDF模型没有关节信息"), [];
910
- let x = null;
911
- if (_.traverse((E) => {
912
- E.name === "Pipe_Link" && !x && (x = E);
913
- }), x)
914
- m.value = x;
910
+ let E = null;
911
+ if (_.traverse((x) => {
912
+ x.name === "Pipe_Link" && !E && (E = x);
913
+ }), E)
914
+ m.value = E;
915
915
  else
916
916
  return console.warn("未找到管子模型"), [];
917
917
  const c = [];
918
- return Object.keys(_.joints).forEach((E) => {
919
- const w = _.joints[E];
920
- if (w._jointType === "fixed")
918
+ return Object.keys(_.joints).forEach((x) => {
919
+ const v = _.joints[x];
920
+ if (v._jointType === "fixed")
921
921
  return;
922
- const Z = w.limit ? {
923
- lower: w.limit.lower ?? u(w._jointType, !1),
924
- upper: w.limit.upper ?? u(w._jointType, !0)
922
+ const N = v.limit ? {
923
+ lower: v.limit.lower ?? u(v._jointType, !1),
924
+ upper: v.limit.upper ?? u(v._jointType, !0)
925
925
  } : {
926
- lower: u(w._jointType, !1),
927
- upper: u(w._jointType, !0)
926
+ lower: u(v._jointType, !1),
927
+ upper: u(v._jointType, !0)
928
928
  };
929
929
  c.push({
930
- name: E,
931
- type: w._jointType || "unknown",
932
- limit: Z,
933
- currentValue: w.angle || 0,
934
- urdfJoint: w
930
+ name: x,
931
+ type: v._jointType || "unknown",
932
+ limit: N,
933
+ currentValue: v.angle || 0,
934
+ urdfJoint: v
935
935
  });
936
- }), c.sort((E, w) => E.name.localeCompare(w.name));
937
- }, R = (_, x) => {
938
- const c = i.value.find((w) => w.name === _);
936
+ }), c.sort((x, v) => x.name.localeCompare(v.name));
937
+ }, R = (_, E) => {
938
+ const c = i.value.find((v) => v.name === _);
939
939
  if (!c) return;
940
- const E = parseFloat(x);
940
+ const x = parseFloat(E);
941
941
  if (c.limit) {
942
- const w = Math.max(c.limit.lower, Math.min(c.limit.upper, E));
943
- c.currentValue = w;
942
+ const v = Math.max(c.limit.lower, Math.min(c.limit.upper, x));
943
+ c.currentValue = v;
944
944
  } else
945
- c.currentValue = E;
946
- t.model && t.model.setJointValue ? t.model.setJointValue(_, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
947
- }, V = (_) => {
945
+ c.currentValue = x;
946
+ e.model && e.model.setJointValue ? e.model.setJointValue(_, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
947
+ }, H = (_) => {
948
948
  if (!m.value || !s.value) return;
949
- const x = f.slice(0, _ + 1), c = [];
950
- let E = new y(0, 0, 0), w = new y(0, 1, 0), Z = new y(1, 0, 0);
951
- c.push(E.clone());
952
- for (const K of x) {
953
- const q = K.Y ?? 0, pe = K.B ?? 0, de = K.C ?? 0, A = K.R ?? 0;
954
- if (pe !== 0) {
955
- const h = new Se().makeRotationAxis(w, j(pe));
956
- Z.applyMatrix4(h);
949
+ const E = f.slice(0, _ + 1), c = [];
950
+ let x = new y(0, 0, 0), v = new y(0, 1, 0), N = new y(1, 0, 0);
951
+ c.push(x.clone());
952
+ for (const K of E) {
953
+ const q = K.Y ?? 0, pt = K.B ?? 0, dt = K.C ?? 0, A = K.R ?? 0;
954
+ if (pt !== 0) {
955
+ const h = new St().makeRotationAxis(v, j(pt));
956
+ N.applyMatrix4(h);
957
957
  }
958
958
  if (q > 0) {
959
- const h = w.clone().multiplyScalar(q * Ae);
960
- E.add(h), c.push(E.clone());
959
+ const h = v.clone().multiplyScalar(q * At);
960
+ x.add(h), c.push(x.clone());
961
961
  }
962
- if (de > 0 && A > 0) {
963
- const h = j(de), Q = A * Ae, le = Math.max(16, Math.ceil(de / 5)), re = E.clone().add(
964
- Z.clone().multiplyScalar(-Q)
962
+ if (dt > 0 && A > 0) {
963
+ const h = j(dt), Q = A * At, lt = Math.max(16, Math.ceil(dt / 5)), rt = x.clone().add(
964
+ N.clone().multiplyScalar(-Q)
965
965
  );
966
- for (let oe = 1; oe <= le; oe++) {
967
- const C = oe / le, se = h * C, _e = new Se().makeRotationAxis(
968
- w.clone().cross(Z).normalize(),
969
- se
970
- ), me = E.clone().sub(re);
971
- me.applyMatrix4(_e);
972
- const Oe = re.clone().add(me);
973
- c.push(Oe), E.copy(Oe);
966
+ for (let ot = 1; ot <= lt; ot++) {
967
+ const C = ot / lt, st = h * C, _t = new St().makeRotationAxis(
968
+ v.clone().cross(N).normalize(),
969
+ st
970
+ ), mt = x.clone().sub(rt);
971
+ mt.applyMatrix4(_t);
972
+ const Ot = rt.clone().add(mt);
973
+ c.push(Ot), x.copy(Ot);
974
974
  }
975
- const he = new Se().makeRotationAxis(
976
- w.clone().cross(Z).normalize(),
975
+ const ht = new St().makeRotationAxis(
976
+ v.clone().cross(N).normalize(),
977
977
  h
978
978
  );
979
- Z.applyMatrix4(he);
979
+ N.applyMatrix4(ht);
980
980
  }
981
981
  }
982
982
  c.length < 2 && c.push(new y(0, 1e-3, 0));
983
983
  try {
984
- const K = new vt(c), q = new bt(
984
+ const K = new ve(c), q = new be(
985
985
  K,
986
986
  Math.max(2, c.length * 4),
987
- d.value * Ae,
987
+ d.value * At,
988
988
  18,
989
989
  !1
990
990
  );
@@ -992,35 +992,33 @@ const Nt = { class: "panel-content" }, Ut = {
992
992
  } catch (K) {
993
993
  console.error("更新管子几何体失败:", K);
994
994
  }
995
- }, H = (_) => {
996
- _ && (Object.keys(_).forEach((x) => {
997
- const c = _[x], E = i.value.find((w) => w.name === x);
998
- E && (E.currentValue = c, t.model && t.model.setJointValue ? t.model.setJointValue(x, c) : E.urdfJoint && E.urdfJoint.setJointValue(c));
999
- }), console.log(232, index), V(index));
1000
- }, F = (_, x, c) => _ + (x - _) * c, Y = (_, x, c) => {
1001
- if (!_ || !x) return _ || x;
1002
- const E = {};
1003
- return Object.keys(_).forEach((w) => {
1004
- const Z = _[w], K = x[w];
1005
- E[w] = F(Z, K || Z, c);
1006
- }), E;
995
+ }, Z = (_, E) => {
996
+ _ && (Object.keys(_).forEach((c) => {
997
+ const x = _[c], v = i.value.find((N) => N.name === c);
998
+ v && (v.currentValue = x, e.model && e.model.setJointValue ? e.model.setJointValue(c, x) : v.urdfJoint && v.urdfJoint.setJointValue(x));
999
+ }), console.log(232, E), H(E));
1000
+ }, F = (_, E, c) => _ + (E - _) * c, Y = (_, E, c) => {
1001
+ if (!_ || !E) return _ || E;
1002
+ const x = {};
1003
+ return Object.keys(_).forEach((v) => {
1004
+ const N = _[v], K = E[v];
1005
+ x[v] = F(N, K || N, c);
1006
+ }), x;
1007
1007
  }, p = () => {
1008
1008
  if (f.length === 0) {
1009
1009
  console.warn("没有动画数据");
1010
1010
  return;
1011
1011
  }
1012
- a.value = !0, b.value = !1;
1012
+ a.value = !0, w.value = !1;
1013
1013
  const _ = () => {
1014
- if (!a.value || b.value) return;
1015
- const x = O.value / ze;
1016
- P.value;
1017
- const c = f[P.value], E = f[P.value + 1];
1018
- if (E) {
1019
- const w = Y(c, E, x);
1020
- H(w);
1014
+ if (!a.value || w.value) return;
1015
+ const E = O.value / zt, c = P.value, x = f[P.value], v = f[P.value + 1];
1016
+ if (v) {
1017
+ const N = Y(x, v, E);
1018
+ Z(N, c);
1021
1019
  } else
1022
- H(c);
1023
- if (O.value++, O.value >= ze && (O.value = 0, P.value++, P.value >= f.length - 1)) {
1020
+ Z(x, c);
1021
+ if (O.value++, O.value >= zt && (O.value = 0, P.value++, P.value >= f.length - 1)) {
1024
1022
  M();
1025
1023
  return;
1026
1024
  }
@@ -1028,11 +1026,11 @@ const Nt = { class: "panel-content" }, Ut = {
1028
1026
  };
1029
1027
  _();
1030
1028
  }, r = () => {
1031
- b.value = !0, L.value && (clearTimeout(L.value), L.value = null);
1029
+ w.value = !0, L.value && (clearTimeout(L.value), L.value = null);
1032
1030
  }, M = () => {
1033
- a.value = !1, b.value = !1, l.value = 1, L.value && (clearTimeout(L.value), L.value = null);
1031
+ a.value = !1, w.value = !1, l.value = 1, L.value && (clearTimeout(L.value), L.value = null);
1034
1032
  };
1035
- e({
1033
+ t({
1036
1034
  startAnimation: p,
1037
1035
  pauseAnimation: r,
1038
1036
  stopAnimation: M,
@@ -1047,70 +1045,70 @@ const Nt = { class: "panel-content" }, Ut = {
1047
1045
  fastBackward: () => {
1048
1046
  l.value > 0.25 && (l.value = Math.max(0.25, l.value / 2));
1049
1047
  }
1050
- }), xe(
1051
- () => t.model,
1048
+ }), Et(
1049
+ () => e.model,
1052
1050
  (_) => {
1053
- _ ? i.value = v(_) : i.value = [];
1051
+ _ ? i.value = b(_) : i.value = [];
1054
1052
  },
1055
1053
  { immediate: !0 }
1056
1054
  );
1057
1055
  const W = () => {
1058
- !t.model || a.value && !b.value || i.value.forEach((_) => {
1056
+ !e.model || a.value && !w.value || i.value.forEach((_) => {
1059
1057
  _.urdfJoint && _.urdfJoint.angle !== void 0 && (_.currentValue = _.urdfJoint.angle);
1060
1058
  });
1061
- }, te = () => {
1059
+ }, et = () => {
1062
1060
  const _ = () => {
1063
1061
  W(), n.value = requestAnimationFrame(_);
1064
1062
  };
1065
1063
  _();
1066
- }, De = () => {
1064
+ }, Dt = () => {
1067
1065
  n.value && (cancelAnimationFrame(n.value), n.value = null);
1068
1066
  };
1069
- return Be(() => {
1070
- te();
1071
- }), We(() => {
1072
- De(), M();
1073
- }), (_, x) => (B(), J("div", Bt, [
1074
- i.value.length > 0 ? (B(), J("div", $t, [
1075
- (B(!0), J(qe, null, Qe(i.value, (c) => {
1076
- var E, w, Z, K;
1067
+ return Bt(() => {
1068
+ et();
1069
+ }), Wt(() => {
1070
+ Dt(), M();
1071
+ }), (_, E) => (B(), J("div", Be, [
1072
+ i.value.length > 0 ? (B(), J("div", $e, [
1073
+ (B(!0), J(qt, null, Qt(i.value, (c) => {
1074
+ var x, v, N, K;
1077
1075
  return B(), J("div", {
1078
1076
  key: c.name,
1079
1077
  class: "joint-item"
1080
1078
  }, [
1081
- g("div", Xt, [
1082
- g("div", Gt, [
1083
- g("span", Jt, ie(c.name), 1),
1084
- g("span", Wt, " [" + ie(((E = c.limit) == null ? void 0 : E.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ie(((w = c.limit) == null ? void 0 : w.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
1079
+ g("div", Xe, [
1080
+ g("div", Ge, [
1081
+ g("span", Je, it(c.name), 1),
1082
+ g("span", We, " [" + it(((x = c.limit) == null ? void 0 : x.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + it(((v = c.limit) == null ? void 0 : v.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
1085
1083
  ]),
1086
- g("span", qt, ie(c.type), 1)
1084
+ g("span", qe, it(c.type), 1)
1087
1085
  ]),
1088
- c.type === "revolute" || c.type === "prismatic" ? (B(), J("div", Qt, [
1089
- g("div", es, [
1086
+ c.type === "revolute" || c.type === "prismatic" ? (B(), J("div", Qe, [
1087
+ g("div", ts, [
1090
1088
  g("input", {
1091
1089
  type: "range",
1092
- min: ((Z = c.limit) == null ? void 0 : Z.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
1090
+ min: ((N = c.limit) == null ? void 0 : N.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
1093
1091
  max: ((K = c.limit) == null ? void 0 : K.upper) ?? (c.type === "revolute" ? Math.PI : 1),
1094
1092
  step: 0.01,
1095
1093
  value: c.currentValue,
1096
1094
  onInput: (q) => R(c.name, q.target.value),
1097
1095
  class: "joint-slider",
1098
- disabled: a.value && !b.value
1099
- }, null, 40, ts)
1096
+ disabled: a.value && !w.value
1097
+ }, null, 40, es)
1100
1098
  ]),
1101
1099
  g("div", ss, [
1102
- g("span", is, ie(c.currentValue.toFixed(3)), 1),
1103
- g("span", os, ie(c.type === "revolute" ? "rad" : "m"), 1)
1100
+ g("span", is, it(c.currentValue.toFixed(3)), 1),
1101
+ g("span", os, it(c.type === "revolute" ? "rad" : "m"), 1)
1104
1102
  ])
1105
- ])) : we("", !0)
1103
+ ])) : wt("", !0)
1106
1104
  ]);
1107
1105
  }), 128))
1108
- ])) : (B(), J("div", ns, x[0] || (x[0] = [
1106
+ ])) : (B(), J("div", ns, E[0] || (E[0] = [
1109
1107
  g("p", null, "未检测到可控制的关节", -1)
1110
1108
  ])))
1111
1109
  ]));
1112
1110
  }
1113
- }, rs = /* @__PURE__ */ fe(ls, [["__scopeId", "data-v-1d84cea4"]]), hs = ["xlink:href"], cs = /* @__PURE__ */ et({
1111
+ }, rs = /* @__PURE__ */ ft(ls, [["__scopeId", "data-v-2d6f518b"]]), hs = ["xlink:href"], cs = /* @__PURE__ */ te({
1114
1112
  __name: "svgIcon",
1115
1113
  props: {
1116
1114
  backgroundColor: { default: "#f0f0f0" },
@@ -1121,12 +1119,12 @@ const Nt = { class: "panel-content" }, Ut = {
1121
1119
  active: { type: Boolean, default: !1 }
1122
1120
  },
1123
1121
  setup(o) {
1124
- const e = o, t = ue(
1122
+ const t = o, e = ut(
1125
1123
  () => ({
1126
- backgroundColor: e.backgroundColor
1124
+ backgroundColor: t.backgroundColor
1127
1125
  })
1128
- ), i = ue(() => `#${e.prefix}-${e.name}`), n = ue(() => {
1129
- const { size: d } = e;
1126
+ ), i = ut(() => `#${t.prefix}-${t.name}`), n = ut(() => {
1127
+ const { size: d } = t;
1130
1128
  let m = `${d}`;
1131
1129
  return m = `${m.replace("px", "")}px`, {
1132
1130
  width: m,
@@ -1134,22 +1132,22 @@ const Nt = { class: "panel-content" }, Ut = {
1134
1132
  };
1135
1133
  });
1136
1134
  return (d, m) => (B(), J("div", {
1137
- class: je(["container", { active: d.active }]),
1138
- style: Le(t.value)
1135
+ class: jt(["container", { active: d.active }]),
1136
+ style: Lt(e.value)
1139
1137
  }, [
1140
1138
  (B(), J("svg", {
1141
- class: je(["svg-icon", [d.$attrs.class, d.spin && "svg-icon-spin"]]),
1142
- style: Le(n.value),
1139
+ class: jt(["svg-icon", [d.$attrs.class, d.spin && "svg-icon-spin"]]),
1140
+ style: Lt(n.value),
1143
1141
  "aria-hidden": "true"
1144
1142
  }, [
1145
1143
  g("use", { "xlink:href": i.value }, null, 8, hs)
1146
1144
  ], 6))
1147
1145
  ], 6));
1148
1146
  }
1149
- }), z = /* @__PURE__ */ fe(cs, [["__scopeId", "data-v-3150a90b"]]), us = { class: "obj-viewer-container" }, ps = { class: "buttonGroup-top" }, ds = { class: "buttonGroup-topLeft" }, ms = { class: "buttonGroup-left" }, fs = { class: "buttonGroup-right" }, _s = { class: "buttonGroup-bottom" }, gs = { class: "left-panel" }, ys = { class: "panel-header" }, vs = {
1147
+ }), z = /* @__PURE__ */ ft(cs, [["__scopeId", "data-v-3150a90b"]]), us = { class: "obj-viewer-container" }, ps = { class: "buttonGroup-top" }, ds = { class: "buttonGroup-topLeft" }, ms = { class: "buttonGroup-left" }, fs = { class: "buttonGroup-right" }, _s = { class: "buttonGroup-bottom" }, gs = { class: "left-panel" }, ys = { class: "panel-header" }, vs = {
1150
1148
  key: 1,
1151
1149
  class: "clipping-content"
1152
- }, bs = { class: "radio-group" }, ws = { class: "radio-label" }, Ps = { class: "radio-label" }, Ms = { class: "radio-label" }, xs = { class: "radio-label" }, Es = { class: "right-panel" }, Ds = { class: "panel-header" }, Ts = {
1150
+ }, bs = { class: "radio-group" }, ws = { class: "radio-label" }, Ps = { class: "radio-label" }, Ms = { class: "radio-label" }, Es = { class: "radio-label" }, xs = { class: "right-panel" }, Ds = { class: "panel-header" }, Ts = {
1153
1151
  key: 0,
1154
1152
  class: "loading-overlay"
1155
1153
  }, Cs = {
@@ -1162,28 +1160,28 @@ const Nt = { class: "panel-content" }, Ut = {
1162
1160
  }
1163
1161
  },
1164
1162
  emits: ["getAnimationData"],
1165
- setup(o, { expose: e, emit: t }) {
1166
- const i = t, n = o;
1163
+ setup(o, { expose: t, emit: e }) {
1164
+ const i = e, n = o;
1167
1165
  let d = null, m = !1;
1168
- const a = D(null), b = D(!1), P = D("");
1166
+ const a = D(null), w = D(!1), P = D("");
1169
1167
  D(!1);
1170
1168
  const O = D(!1), L = D(!1), j = D(""), l = D(!1), k = D(""), f = D(), {
1171
1169
  currentModels: s,
1172
1170
  initialCameraPosition: u,
1173
- initialTargetPosition: v,
1171
+ initialTargetPosition: b,
1174
1172
  initThreeJS: R,
1175
- handleResize: V,
1176
- fitCameraToAllModels: H,
1173
+ handleResize: H,
1174
+ fitCameraToAllModels: Z,
1177
1175
  getThreeJSObjects: F,
1178
1176
  clearAllModels: Y,
1179
1177
  cleanup: p
1180
- } = jt(a), { isAnimating: r, toggleAnimation: M, stopAnimation: $ } = It(F, s), { isClipping: G, activeClippingAxis: I, toggleClipping: W, updateClippingPlanes: te } = Ft(
1178
+ } = je(a), { isAnimating: r, toggleAnimation: M, stopAnimation: $ } = Ie(F, s), { isClipping: G, activeClippingAxis: I, toggleClipping: W, updateClippingPlanes: et } = Fe(
1181
1179
  F,
1182
1180
  s
1183
- ), { addModelsFromUrls: De, loadModelByDefaultPath: _, urdfModel: x } = wt(
1181
+ ), { addModelsFromUrls: Dt, loadModelByDefaultPath: _, urdfModel: E } = we(
1184
1182
  F,
1185
1183
  s,
1186
- b,
1184
+ w,
1187
1185
  P,
1188
1186
  Y
1189
1187
  ), c = () => {
@@ -1192,49 +1190,49 @@ const Nt = { class: "panel-content" }, Ut = {
1192
1190
  const { camera: A, controls: h } = F();
1193
1191
  if (!A || !h) return;
1194
1192
  h.enabled = !0;
1195
- const Q = (se) => se < 0.5 ? 4 * se * se * se : 1 - Math.pow(-2 * se + 2, 3) / 2, le = A.position.clone(), re = h.target.clone(), he = 1500, oe = Date.now(), C = () => {
1196
- const se = Date.now() - oe, _e = Math.min(se / he, 1), me = Q(_e);
1197
- A.position.lerpVectors(le, u.value, me), h.target.lerpVectors(re, v.value, me), _e < 1 ? requestAnimationFrame(C) : O.value = !1;
1193
+ const Q = (st) => st < 0.5 ? 4 * st * st * st : 1 - Math.pow(-2 * st + 2, 3) / 2, lt = A.position.clone(), rt = h.target.clone(), ht = 1500, ot = Date.now(), C = () => {
1194
+ const st = Date.now() - ot, _t = Math.min(st / ht, 1), mt = Q(_t);
1195
+ A.position.lerpVectors(lt, u.value, mt), h.target.lerpVectors(rt, b.value, mt), _t < 1 ? requestAnimationFrame(C) : O.value = !1;
1198
1196
  };
1199
1197
  C();
1200
- }, E = async () => m ? Promise.resolve() : new Promise((A) => {
1198
+ }, x = async () => m ? Promise.resolve() : new Promise((A) => {
1201
1199
  const h = () => {
1202
1200
  m ? A() : requestAnimationFrame(h);
1203
1201
  };
1204
1202
  h();
1205
- }), w = async (A, h) => {
1203
+ }), v = async (A, h) => {
1206
1204
  try {
1207
- await E(), r.value && $(), G.value && W();
1205
+ await x(), r.value && $(), G.value && W();
1208
1206
  const Q = await h(A);
1209
- return H(), Q;
1207
+ return Z(), Q;
1210
1208
  } catch (Q) {
1211
1209
  throw console.error("加载模型失败:", Q), Q;
1212
1210
  }
1213
- }, Z = async (A) => w(A, De), K = async (A) => w(A, _), q = (A) => {
1211
+ }, N = async (A) => v(A, Dt), K = async (A) => v(A, _), q = (A) => {
1214
1212
  L.value = !0, j.value = A, A === "剖面视图" && !G.value && W();
1215
- }, pe = (A) => {
1213
+ }, pt = (A) => {
1216
1214
  l.value = !0, k.value = A;
1217
- }, de = () => {
1218
- i("getAnimationData"), Ie(() => {
1215
+ }, dt = () => {
1216
+ i("getAnimationData"), It(() => {
1219
1217
  var A;
1220
1218
  (A = f.value) == null || A.startAnimation();
1221
1219
  });
1222
1220
  };
1223
- return Be(async () => {
1224
- await Ie();
1221
+ return Bt(async () => {
1222
+ await It();
1225
1223
  try {
1226
- R(), d = F().scene, m = !0, window.addEventListener("resize", V);
1224
+ R(), d = F().scene, m = !0, window.addEventListener("resize", H);
1227
1225
  } catch (A) {
1228
1226
  console.error("Three.js初始化失败:", A);
1229
1227
  }
1230
- }), tt(() => {
1231
- m = !1, j.value = "", k.value = "", window.removeEventListener("resize", V), r.value && $(), p();
1232
- }), e({
1233
- addModelsFromUrls: Z,
1228
+ }), ee(() => {
1229
+ m = !1, j.value = "", k.value = "", window.removeEventListener("resize", H), r.value && $(), p();
1230
+ }), t({
1231
+ addModelsFromUrls: N,
1234
1232
  loadModelByDefaultPath: K
1235
1233
  }), (A, h) => {
1236
- var le, re, he, oe;
1237
- const Q = Ke("el-scrollbar");
1234
+ var lt, rt, ht, ot;
1235
+ const Q = Kt("el-scrollbar");
1238
1236
  return B(), J("div", us, [
1239
1237
  g("div", {
1240
1238
  ref_key: "threejsContainer",
@@ -1283,8 +1281,8 @@ const Nt = { class: "panel-content" }, Ut = {
1283
1281
  T(z, {
1284
1282
  name: "lookAround",
1285
1283
  size: "24",
1286
- onClick: U(M),
1287
- title: U(r) ? "停止动画" : "动画视图"
1284
+ onClick: V(M),
1285
+ title: V(r) ? "停止动画" : "动画视图"
1288
1286
  }, null, 8, ["onClick", "title"])
1289
1287
  ]),
1290
1288
  g("div", ms, [
@@ -1325,7 +1323,7 @@ const Nt = { class: "panel-content" }, Ut = {
1325
1323
  T(z, {
1326
1324
  name: "guanjiekongzhi",
1327
1325
  size: "24",
1328
- onClick: h[4] || (h[4] = (C) => pe("关节控制")),
1326
+ onClick: h[4] || (h[4] = (C) => pt("关节控制")),
1329
1327
  active: l.value && k.value === "关节控制",
1330
1328
  title: "关节控制"
1331
1329
  }, null, 8, ["active"]),
@@ -1333,7 +1331,7 @@ const Nt = { class: "panel-content" }, Ut = {
1333
1331
  name: "DongHuaFangZhen",
1334
1332
  size: "24",
1335
1333
  title: "动画仿真",
1336
- onClick: h[5] || (h[5] = (C) => pe("动画仿真")),
1334
+ onClick: h[5] || (h[5] = (C) => pt("动画仿真")),
1337
1335
  active: l.value && k.value === "动画仿真"
1338
1336
  }, null, 8, ["active"]),
1339
1337
  T(z, {
@@ -1351,147 +1349,147 @@ const Nt = { class: "panel-content" }, Ut = {
1351
1349
  size: "24",
1352
1350
  backgroundColor: "#ffffff",
1353
1351
  title: "快退",
1354
- onClick: (le = f.value) == null ? void 0 : le.fastBackward
1352
+ onClick: (lt = f.value) == null ? void 0 : lt.fastBackward
1355
1353
  }, null, 8, ["onClick"]),
1356
1354
  T(z, {
1357
1355
  name: "bofang",
1358
1356
  size: "24",
1359
1357
  backgroundColor: "#ffffff",
1360
1358
  title: "播放",
1361
- onClick: de
1359
+ onClick: dt
1362
1360
  }),
1363
1361
  T(z, {
1364
1362
  name: "kuaijin",
1365
1363
  size: "24",
1366
1364
  backgroundColor: "#ffffff",
1367
1365
  title: "快进",
1368
- onClick: (re = f.value) == null ? void 0 : re.fastForward
1366
+ onClick: (rt = f.value) == null ? void 0 : rt.fastForward
1369
1367
  }, null, 8, ["onClick"]),
1370
1368
  T(z, {
1371
1369
  name: "zanting",
1372
1370
  size: "24",
1373
1371
  backgroundColor: "#ffffff",
1374
1372
  title: "暂停",
1375
- onClick: (he = f.value) == null ? void 0 : he.pauseAnimation
1373
+ onClick: (ht = f.value) == null ? void 0 : ht.pauseAnimation
1376
1374
  }, null, 8, ["onClick"]),
1377
1375
  T(z, {
1378
1376
  name: "zhongzhi",
1379
1377
  size: "24",
1380
1378
  backgroundColor: "#ffffff",
1381
1379
  title: "停止",
1382
- onClick: (oe = f.value) == null ? void 0 : oe.resetAll
1380
+ onClick: (ot = f.value) == null ? void 0 : ot.resetAll
1383
1381
  }, null, 8, ["onClick"])
1384
1382
  ]),
1385
- ne(g("div", gs, [
1383
+ nt(g("div", gs, [
1386
1384
  g("div", ys, [
1387
- g("span", null, ie(j.value), 1),
1385
+ g("span", null, it(j.value), 1),
1388
1386
  g("span", {
1389
1387
  class: "close",
1390
1388
  onClick: h[6] || (h[6] = (C) => L.value = !1)
1391
1389
  }, " X ")
1392
1390
  ]),
1393
1391
  T(Q, { "max-height": "650px" }, {
1394
- default: Fe(() => [
1395
- j.value === "场景树" ? (B(), Ze(Kt, {
1392
+ default: Ft(() => [
1393
+ j.value === "场景树" ? (B(), Zt(Ke, {
1396
1394
  key: 0,
1397
- model: U(x)
1398
- }, null, 8, ["model"])) : we("", !0),
1395
+ model: V(E)
1396
+ }, null, 8, ["model"])) : wt("", !0),
1399
1397
  j.value === "剖面视图" ? (B(), J("div", vs, [
1400
1398
  g("div", bs, [
1401
1399
  g("label", ws, [
1402
- ne(g("input", {
1400
+ nt(g("input", {
1403
1401
  type: "radio",
1404
1402
  name: "clipping-axis",
1405
1403
  value: "none",
1406
- "onUpdate:modelValue": h[7] || (h[7] = (C) => ge(I) ? I.value = C : null),
1407
- onChange: h[8] || (h[8] = (...C) => U(te) && U(te)(...C))
1404
+ "onUpdate:modelValue": h[7] || (h[7] = (C) => gt(I) ? I.value = C : null),
1405
+ onChange: h[8] || (h[8] = (...C) => V(et) && V(et)(...C))
1408
1406
  }, null, 544), [
1409
- [ye, U(I)]
1407
+ [yt, V(I)]
1410
1408
  ]),
1411
1409
  h[16] || (h[16] = g("span", { class: "radio-text" }, "无切割", -1))
1412
1410
  ]),
1413
1411
  g("label", Ps, [
1414
- ne(g("input", {
1412
+ nt(g("input", {
1415
1413
  type: "radio",
1416
1414
  name: "clipping-axis",
1417
1415
  value: "x",
1418
- "onUpdate:modelValue": h[9] || (h[9] = (C) => ge(I) ? I.value = C : null),
1419
- onChange: h[10] || (h[10] = (...C) => U(te) && U(te)(...C))
1416
+ "onUpdate:modelValue": h[9] || (h[9] = (C) => gt(I) ? I.value = C : null),
1417
+ onChange: h[10] || (h[10] = (...C) => V(et) && V(et)(...C))
1420
1418
  }, null, 544), [
1421
- [ye, U(I)]
1419
+ [yt, V(I)]
1422
1420
  ]),
1423
1421
  h[17] || (h[17] = g("span", { class: "radio-text" }, "X轴切割", -1))
1424
1422
  ]),
1425
1423
  g("label", Ms, [
1426
- ne(g("input", {
1424
+ nt(g("input", {
1427
1425
  type: "radio",
1428
1426
  name: "clipping-axis",
1429
1427
  value: "y",
1430
- "onUpdate:modelValue": h[11] || (h[11] = (C) => ge(I) ? I.value = C : null),
1431
- onChange: h[12] || (h[12] = (...C) => U(te) && U(te)(...C))
1428
+ "onUpdate:modelValue": h[11] || (h[11] = (C) => gt(I) ? I.value = C : null),
1429
+ onChange: h[12] || (h[12] = (...C) => V(et) && V(et)(...C))
1432
1430
  }, null, 544), [
1433
- [ye, U(I)]
1431
+ [yt, V(I)]
1434
1432
  ]),
1435
1433
  h[18] || (h[18] = g("span", { class: "radio-text" }, "Y轴切割", -1))
1436
1434
  ]),
1437
- g("label", xs, [
1438
- ne(g("input", {
1435
+ g("label", Es, [
1436
+ nt(g("input", {
1439
1437
  type: "radio",
1440
1438
  name: "clipping-axis",
1441
1439
  value: "z",
1442
- "onUpdate:modelValue": h[13] || (h[13] = (C) => ge(I) ? I.value = C : null),
1443
- onChange: h[14] || (h[14] = (...C) => U(te) && U(te)(...C))
1440
+ "onUpdate:modelValue": h[13] || (h[13] = (C) => gt(I) ? I.value = C : null),
1441
+ onChange: h[14] || (h[14] = (...C) => V(et) && V(et)(...C))
1444
1442
  }, null, 544), [
1445
- [ye, U(I)]
1443
+ [yt, V(I)]
1446
1444
  ]),
1447
1445
  h[19] || (h[19] = g("span", { class: "radio-text" }, "Z轴切割", -1))
1448
1446
  ])
1449
1447
  ])
1450
- ])) : we("", !0)
1448
+ ])) : wt("", !0)
1451
1449
  ]),
1452
1450
  _: 1
1453
1451
  })
1454
1452
  ], 512), [
1455
- [ve, L.value]
1453
+ [vt, L.value]
1456
1454
  ]),
1457
- ne(g("div", Es, [
1455
+ nt(g("div", xs, [
1458
1456
  g("div", Ds, [
1459
- g("span", null, ie(k.value), 1),
1457
+ g("span", null, it(k.value), 1),
1460
1458
  g("span", {
1461
1459
  class: "close",
1462
1460
  onClick: h[15] || (h[15] = (C) => l.value = !1)
1463
1461
  }, " X ")
1464
1462
  ]),
1465
1463
  T(Q, { "max-height": "650px" }, {
1466
- default: Fe(() => [
1467
- ne(T(rs, {
1464
+ default: Ft(() => [
1465
+ nt(T(rs, {
1468
1466
  ref_key: "jointRef",
1469
1467
  ref: f,
1470
- model: U(x),
1471
- scene: U(d),
1468
+ model: V(E),
1469
+ scene: V(d),
1472
1470
  animationData: n == null ? void 0 : n.animationData
1473
1471
  }, null, 8, ["model", "scene", "animationData"]), [
1474
- [ve, k.value === "关节控制"]
1472
+ [vt, k.value === "关节控制"]
1475
1473
  ]),
1476
- ne(T(Yt, {
1474
+ nt(T(Ve, {
1477
1475
  animationData: n == null ? void 0 : n.animationData
1478
1476
  }, null, 8, ["animationData"]), [
1479
- [ve, k.value === "动画仿真"]
1477
+ [vt, k.value === "动画仿真"]
1480
1478
  ])
1481
1479
  ]),
1482
1480
  _: 1
1483
1481
  })
1484
1482
  ], 512), [
1485
- [ve, l.value]
1483
+ [vt, l.value]
1486
1484
  ]),
1487
- b.value ? (B(), J("div", Ts, [
1485
+ w.value ? (B(), J("div", Ts, [
1488
1486
  h[20] || (h[20] = g("div", { class: "loading-spinner" }, null, -1)),
1489
- g("p", null, ie(P.value), 1)
1490
- ])) : we("", !0)
1487
+ g("p", null, it(P.value), 1)
1488
+ ])) : wt("", !0)
1491
1489
  ]);
1492
1490
  };
1493
1491
  }
1494
- }, Rs = /* @__PURE__ */ fe(Cs, [["__scopeId", "data-v-14112288"]]);
1492
+ }, Rs = /* @__PURE__ */ ft(Cs, [["__scopeId", "data-v-14112288"]]);
1495
1493
  export {
1496
1494
  Rs as default
1497
1495
  };