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.
- package/dist/{index-oIRe8j9f.cjs → index-BYHxFFyo.cjs} +1 -1
- package/dist/{index-D9XuBLBf.js → index-DV3sHEK_.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +1 -1
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/dist/{threeModel-DTfSO1TZ.js → threeModel-B3GFVYtO.js} +473 -475
- package/dist/{threeModel-l2JuUHQ8.cjs → threeModel-CkKNGhkF.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as D, watch as
|
|
2
|
-
import { C as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
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
|
-
},
|
|
15
|
-
class
|
|
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(
|
|
23
|
-
super(
|
|
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(
|
|
26
|
-
super.connect(
|
|
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(
|
|
65
|
-
|
|
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(
|
|
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(
|
|
87
|
-
const
|
|
88
|
-
|
|
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 (
|
|
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 =
|
|
101
|
+
const a = U.length();
|
|
102
102
|
m = this._clampDistance(a * this._scale);
|
|
103
|
-
const
|
|
104
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
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
|
|
109
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), d =
|
|
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 =
|
|
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) : (
|
|
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) >
|
|
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(
|
|
122
|
-
return
|
|
121
|
+
_getAutoRotationAngle(t) {
|
|
122
|
+
return t !== null ? X / 60 * this.autoRotateSpeed * t : X / 60 / 60 * this.autoRotateSpeed;
|
|
123
123
|
}
|
|
124
|
-
_getZoomScale(
|
|
125
|
-
const
|
|
126
|
-
return Math.pow(0.95, this.zoomSpeed *
|
|
124
|
+
_getZoomScale(t) {
|
|
125
|
+
const e = Math.abs(t * 0.01);
|
|
126
|
+
return Math.pow(0.95, this.zoomSpeed * e);
|
|
127
127
|
}
|
|
128
|
-
_rotateLeft(
|
|
129
|
-
this._sphericalDelta.theta -=
|
|
128
|
+
_rotateLeft(t) {
|
|
129
|
+
this._sphericalDelta.theta -= t;
|
|
130
130
|
}
|
|
131
|
-
_rotateUp(
|
|
132
|
-
this._sphericalDelta.phi -=
|
|
131
|
+
_rotateUp(t) {
|
|
132
|
+
this._sphericalDelta.phi -= t;
|
|
133
133
|
}
|
|
134
|
-
_panLeft(
|
|
135
|
-
|
|
134
|
+
_panLeft(t, e) {
|
|
135
|
+
U.setFromMatrixColumn(e, 0), U.multiplyScalar(-t), this._panOffset.add(U);
|
|
136
136
|
}
|
|
137
|
-
_panUp(
|
|
138
|
-
this.screenSpacePanning === !0 ?
|
|
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(
|
|
141
|
+
_pan(t, e) {
|
|
142
142
|
const i = this.domElement;
|
|
143
143
|
if (this.object.isPerspectiveCamera) {
|
|
144
144
|
const n = this.object.position;
|
|
145
|
-
|
|
146
|
-
let d =
|
|
147
|
-
d *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 *
|
|
148
|
-
} else this.object.isOrthographicCamera ? (this._panLeft(
|
|
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(
|
|
151
|
-
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /=
|
|
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(
|
|
154
|
-
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *=
|
|
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(
|
|
156
|
+
_updateZoomParameters(t, e) {
|
|
157
157
|
if (!this.zoomToCursor)
|
|
158
158
|
return;
|
|
159
159
|
this._performCursorZoom = !0;
|
|
160
|
-
const i = this.domElement.getBoundingClientRect(), n =
|
|
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(
|
|
164
|
-
return Math.max(this.minDistance, Math.min(this.maxDistance,
|
|
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(
|
|
170
|
-
this._rotateStart.set(
|
|
169
|
+
_handleMouseDownRotate(t) {
|
|
170
|
+
this._rotateStart.set(t.clientX, t.clientY);
|
|
171
171
|
}
|
|
172
|
-
_handleMouseDownDolly(
|
|
173
|
-
this._updateZoomParameters(
|
|
172
|
+
_handleMouseDownDolly(t) {
|
|
173
|
+
this._updateZoomParameters(t.clientX, t.clientX), this._dollyStart.set(t.clientX, t.clientY);
|
|
174
174
|
}
|
|
175
|
-
_handleMouseDownPan(
|
|
176
|
-
this._panStart.set(
|
|
175
|
+
_handleMouseDownPan(t) {
|
|
176
|
+
this._panStart.set(t.clientX, t.clientY);
|
|
177
177
|
}
|
|
178
|
-
_handleMouseMoveRotate(
|
|
179
|
-
this._rotateEnd.set(
|
|
180
|
-
const
|
|
181
|
-
this._rotateLeft(X * this._rotateDelta.x /
|
|
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(
|
|
184
|
-
this._dollyEnd.set(
|
|
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(
|
|
187
|
-
this._panEnd.set(
|
|
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(
|
|
190
|
-
this._updateZoomParameters(
|
|
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(
|
|
193
|
-
let
|
|
194
|
-
switch (
|
|
192
|
+
_handleKeyDown(t) {
|
|
193
|
+
let e = !1;
|
|
194
|
+
switch (t.code) {
|
|
195
195
|
case this.keys.UP:
|
|
196
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
208
|
+
e && (t.preventDefault(), this.update());
|
|
209
209
|
}
|
|
210
|
-
_handleTouchStartRotate(
|
|
210
|
+
_handleTouchStartRotate(t) {
|
|
211
211
|
if (this._pointers.length === 1)
|
|
212
|
-
this._rotateStart.set(
|
|
212
|
+
this._rotateStart.set(t.pageX, t.pageY);
|
|
213
213
|
else {
|
|
214
|
-
const
|
|
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(
|
|
218
|
+
_handleTouchStartPan(t) {
|
|
219
219
|
if (this._pointers.length === 1)
|
|
220
|
-
this._panStart.set(
|
|
220
|
+
this._panStart.set(t.pageX, t.pageY);
|
|
221
221
|
else {
|
|
222
|
-
const
|
|
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(
|
|
227
|
-
const
|
|
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(
|
|
231
|
-
this.enableZoom && this._handleTouchStartDolly(
|
|
230
|
+
_handleTouchStartDollyPan(t) {
|
|
231
|
+
this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
|
|
232
232
|
}
|
|
233
|
-
_handleTouchStartDollyRotate(
|
|
234
|
-
this.enableZoom && this._handleTouchStartDolly(
|
|
233
|
+
_handleTouchStartDollyRotate(t) {
|
|
234
|
+
this.enableZoom && this._handleTouchStartDolly(t), this.enableRotate && this._handleTouchStartRotate(t);
|
|
235
235
|
}
|
|
236
|
-
_handleTouchMoveRotate(
|
|
236
|
+
_handleTouchMoveRotate(t) {
|
|
237
237
|
if (this._pointers.length == 1)
|
|
238
|
-
this._rotateEnd.set(
|
|
238
|
+
this._rotateEnd.set(t.pageX, t.pageY);
|
|
239
239
|
else {
|
|
240
|
-
const i = this._getSecondPointerPosition(
|
|
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
|
|
245
|
-
this._rotateLeft(X * this._rotateDelta.x /
|
|
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(
|
|
247
|
+
_handleTouchMovePan(t) {
|
|
248
248
|
if (this._pointers.length === 1)
|
|
249
|
-
this._panEnd.set(
|
|
249
|
+
this._panEnd.set(t.pageX, t.pageY);
|
|
250
250
|
else {
|
|
251
|
-
const
|
|
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(
|
|
257
|
-
const
|
|
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 = (
|
|
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(
|
|
263
|
-
this.enableZoom && this._handleTouchMoveDolly(
|
|
262
|
+
_handleTouchMoveDollyPan(t) {
|
|
263
|
+
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
264
264
|
}
|
|
265
|
-
_handleTouchMoveDollyRotate(
|
|
266
|
-
this.enableZoom && this._handleTouchMoveDolly(
|
|
265
|
+
_handleTouchMoveDollyRotate(t) {
|
|
266
|
+
this.enableZoom && this._handleTouchMoveDolly(t), this.enableRotate && this._handleTouchMoveRotate(t);
|
|
267
267
|
}
|
|
268
268
|
// pointers
|
|
269
|
-
_addPointer(
|
|
270
|
-
this._pointers.push(
|
|
269
|
+
_addPointer(t) {
|
|
270
|
+
this._pointers.push(t.pointerId);
|
|
271
271
|
}
|
|
272
|
-
_removePointer(
|
|
273
|
-
delete this._pointerPositions[
|
|
274
|
-
for (let
|
|
275
|
-
if (this._pointers[
|
|
276
|
-
this._pointers.splice(
|
|
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(
|
|
281
|
-
for (let
|
|
282
|
-
if (this._pointers[
|
|
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(
|
|
286
|
-
let
|
|
287
|
-
|
|
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(
|
|
290
|
-
const
|
|
291
|
-
return this._pointerPositions[
|
|
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(
|
|
295
|
-
const
|
|
296
|
-
clientX:
|
|
297
|
-
clientY:
|
|
298
|
-
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 (
|
|
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
|
|
308
|
+
return t.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
function
|
|
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
|
|
314
|
+
function xe(o) {
|
|
315
315
|
this.enabled !== !1 && (o.pointerType === "touch" ? this._onTouchMove(o) : this._onMouseMove(o));
|
|
316
316
|
}
|
|
317
|
-
function
|
|
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(
|
|
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
|
|
324
|
-
this._onTouchStart({ pointerId:
|
|
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
|
|
329
|
-
let
|
|
328
|
+
function Te(o) {
|
|
329
|
+
let t;
|
|
330
330
|
switch (o.button) {
|
|
331
331
|
case 0:
|
|
332
|
-
|
|
332
|
+
t = this.mouseButtons.LEFT;
|
|
333
333
|
break;
|
|
334
334
|
case 1:
|
|
335
|
-
|
|
335
|
+
t = this.mouseButtons.MIDDLE;
|
|
336
336
|
break;
|
|
337
337
|
case 2:
|
|
338
|
-
|
|
338
|
+
t = this.mouseButtons.RIGHT;
|
|
339
339
|
break;
|
|
340
340
|
default:
|
|
341
|
-
|
|
341
|
+
t = -1;
|
|
342
342
|
}
|
|
343
|
-
switch (
|
|
344
|
-
case
|
|
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
|
|
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
|
|
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(
|
|
369
|
+
this.state !== S.NONE && this.dispatchEvent(Rt);
|
|
370
370
|
}
|
|
371
|
-
function
|
|
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
|
|
388
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== S.NONE || (o.preventDefault(), this.dispatchEvent(
|
|
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
|
|
390
|
+
function ke(o) {
|
|
391
391
|
this.enabled !== !1 && this._handleKeyDown(o);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
426
|
+
this.state !== S.NONE && this.dispatchEvent(Rt);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
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
|
|
450
|
+
function Re(o) {
|
|
451
451
|
this.enabled !== !1 && o.preventDefault();
|
|
452
452
|
}
|
|
453
|
-
function
|
|
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
|
|
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
|
|
460
|
-
let
|
|
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
|
-
|
|
463
|
+
t = new oe(), t.background = new ne(15790320);
|
|
464
464
|
const p = o.value;
|
|
465
|
-
|
|
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 =
|
|
469
|
-
LEFT:
|
|
470
|
-
MIDDLE:
|
|
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
|
|
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 && (
|
|
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
|
|
507
|
-
const $ = new
|
|
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
|
-
|
|
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
|
|
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
|
|
529
|
-
|
|
530
|
-
const r = new
|
|
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,
|
|
532
|
-
const M = new
|
|
533
|
-
M.position.set(-8, -8, 6),
|
|
534
|
-
const $ = new
|
|
535
|
-
$.position.set(0, -15, 2),
|
|
536
|
-
const G = new
|
|
537
|
-
|
|
538
|
-
const I = new
|
|
539
|
-
I.position.set(15, 15, 15),
|
|
540
|
-
const W = new
|
|
541
|
-
W.position.set(-15, -15, 15),
|
|
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 &&
|
|
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
|
-
},
|
|
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 || !
|
|
575
|
+
if (!o.value || !e || !i || !d) return;
|
|
576
576
|
const p = o.value, r = p.clientWidth, M = p.clientHeight;
|
|
577
|
-
|
|
577
|
+
e.aspect = r / M, e.updateProjectionMatrix(), i.setSize(r, M), d.update();
|
|
578
578
|
},
|
|
579
579
|
fitCameraToAllModels: () => {
|
|
580
|
-
if (!
|
|
581
|
-
const p = new
|
|
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
|
-
|
|
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:
|
|
590
|
-
camera:
|
|
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 (!
|
|
596
|
+
if (!t) return;
|
|
597
597
|
P.value.forEach((r) => {
|
|
598
|
-
|
|
598
|
+
t.remove(r), b(r);
|
|
599
599
|
});
|
|
600
600
|
const p = [];
|
|
601
|
-
|
|
602
|
-
!r.isLight && !r.isCamera && r.type !== "GridHelper" && 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
|
-
|
|
604
|
+
t.remove(r), b(r);
|
|
605
605
|
}), P.value = [], k();
|
|
606
606
|
},
|
|
607
607
|
cleanup: () => {
|
|
608
|
-
m && cancelAnimationFrame(m), a && a.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
|
|
614
|
-
const
|
|
615
|
-
let i = null, n = 12700, d = new y(), m = new y(), a = new y(),
|
|
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(),
|
|
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) *
|
|
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,
|
|
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) *
|
|
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(
|
|
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
|
|
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
|
|
642
|
-
s.position.copy(
|
|
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 (
|
|
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
|
|
649
|
-
|
|
650
|
-
|
|
648
|
+
const b = new xt();
|
|
649
|
+
t.value.forEach((r) => {
|
|
650
|
+
b.expandByObject(r);
|
|
651
651
|
});
|
|
652
|
-
const R =
|
|
653
|
-
a =
|
|
654
|
-
const
|
|
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
|
|
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(
|
|
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
|
-
|
|
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:
|
|
667
|
+
isAnimating: e,
|
|
668
668
|
toggleAnimation: () => {
|
|
669
|
-
if (
|
|
670
|
-
|
|
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
|
|
675
|
-
const Y = Date.now() -
|
|
676
|
-
s.position.lerpVectors(
|
|
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
|
|
687
|
-
const
|
|
688
|
-
let n = [], d = [], m = new
|
|
689
|
-
const
|
|
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
|
|
691
|
+
new Pt(new y(1, 0, 0), 0),
|
|
692
692
|
// X轴平面
|
|
693
|
-
new
|
|
693
|
+
new Pt(new y(0, 1, 0), 0),
|
|
694
694
|
// Y轴平面
|
|
695
|
-
new
|
|
695
|
+
new Pt(new y(0, 0, 1), 0)
|
|
696
696
|
// Z轴平面
|
|
697
697
|
];
|
|
698
698
|
}, P = () => {
|
|
699
|
-
m.makeEmpty(),
|
|
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,
|
|
705
|
-
f === "x" ? (u = new
|
|
706
|
-
const
|
|
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:
|
|
710
|
+
side: ge,
|
|
711
711
|
depthWrite: !1
|
|
712
|
-
}),
|
|
713
|
-
return
|
|
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
|
-
|
|
721
|
-
u.traverse((
|
|
722
|
-
|
|
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
|
-
}) :
|
|
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
|
-
|
|
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:
|
|
748
|
+
isClipping: e,
|
|
749
749
|
activeClippingAxis: i,
|
|
750
750
|
toggleClipping: () => {
|
|
751
|
-
|
|
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
|
|
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
|
|
765
|
+
const t = o;
|
|
766
766
|
D();
|
|
767
|
-
const
|
|
768
|
-
return
|
|
769
|
-
() => [
|
|
767
|
+
const e = D();
|
|
768
|
+
return Et(
|
|
769
|
+
() => [t == null ? void 0 : t.animationData],
|
|
770
770
|
() => {
|
|
771
771
|
var n;
|
|
772
|
-
let i = ((n =
|
|
773
|
-
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",
|
|
779
|
-
(B(),
|
|
780
|
-
itemData: (d =
|
|
781
|
-
key: (m =
|
|
782
|
-
index: (a =
|
|
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
|
-
},
|
|
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:
|
|
804
|
-
const
|
|
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
|
-
},
|
|
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((
|
|
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 =
|
|
856
|
-
return
|
|
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 =
|
|
864
|
-
return B(), J("div",
|
|
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":
|
|
869
|
+
"node-key": He,
|
|
870
870
|
onNodeClick: m
|
|
871
871
|
}, null, 8, ["data", "default-expanded-keys"])
|
|
872
872
|
]);
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
},
|
|
875
|
+
}, Ke = /* @__PURE__ */ ft(Ze, [["__scopeId", "data-v-290ff4e1"]]), Be = { class: "panel-content" }, $e = {
|
|
876
876
|
key: 0,
|
|
877
877
|
class: "joints-list"
|
|
878
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
892
|
-
const
|
|
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),
|
|
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
|
-
|
|
899
|
-
() =>
|
|
898
|
+
Et(
|
|
899
|
+
() => e.animationData,
|
|
900
900
|
(_) => {
|
|
901
901
|
var c;
|
|
902
|
-
let
|
|
903
|
-
|
|
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 =
|
|
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
|
|
911
|
-
if (_.traverse((
|
|
912
|
-
|
|
913
|
-
}),
|
|
914
|
-
m.value =
|
|
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((
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
918
|
+
return Object.keys(_.joints).forEach((x) => {
|
|
919
|
+
const v = _.joints[x];
|
|
920
|
+
if (v._jointType === "fixed")
|
|
921
921
|
return;
|
|
922
|
-
const
|
|
923
|
-
lower:
|
|
924
|
-
upper:
|
|
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(
|
|
927
|
-
upper: u(
|
|
926
|
+
lower: u(v._jointType, !1),
|
|
927
|
+
upper: u(v._jointType, !0)
|
|
928
928
|
};
|
|
929
929
|
c.push({
|
|
930
|
-
name:
|
|
931
|
-
type:
|
|
932
|
-
limit:
|
|
933
|
-
currentValue:
|
|
934
|
-
urdfJoint:
|
|
930
|
+
name: x,
|
|
931
|
+
type: v._jointType || "unknown",
|
|
932
|
+
limit: N,
|
|
933
|
+
currentValue: v.angle || 0,
|
|
934
|
+
urdfJoint: v
|
|
935
935
|
});
|
|
936
|
-
}), c.sort((
|
|
937
|
-
}, R = (_,
|
|
938
|
-
const c = i.value.find((
|
|
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
|
|
940
|
+
const x = parseFloat(E);
|
|
941
941
|
if (c.limit) {
|
|
942
|
-
const
|
|
943
|
-
c.currentValue =
|
|
942
|
+
const v = Math.max(c.limit.lower, Math.min(c.limit.upper, x));
|
|
943
|
+
c.currentValue = v;
|
|
944
944
|
} else
|
|
945
|
-
c.currentValue =
|
|
946
|
-
|
|
947
|
-
},
|
|
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
|
|
950
|
-
let
|
|
951
|
-
c.push(
|
|
952
|
-
for (const K of
|
|
953
|
-
const q = K.Y ?? 0,
|
|
954
|
-
if (
|
|
955
|
-
const h = new
|
|
956
|
-
|
|
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 =
|
|
960
|
-
|
|
959
|
+
const h = v.clone().multiplyScalar(q * At);
|
|
960
|
+
x.add(h), c.push(x.clone());
|
|
961
961
|
}
|
|
962
|
-
if (
|
|
963
|
-
const h = j(
|
|
964
|
-
|
|
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
|
|
967
|
-
const C =
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
),
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
c.push(
|
|
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
|
|
976
|
-
|
|
975
|
+
const ht = new St().makeRotationAxis(
|
|
976
|
+
v.clone().cross(N).normalize(),
|
|
977
977
|
h
|
|
978
978
|
);
|
|
979
|
-
|
|
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
|
|
984
|
+
const K = new ve(c), q = new be(
|
|
985
985
|
K,
|
|
986
986
|
Math.max(2, c.length * 4),
|
|
987
|
-
d.value *
|
|
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
|
-
},
|
|
996
|
-
_ && (Object.keys(_).forEach((
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
}), console.log(232,
|
|
1000
|
-
}, F = (_,
|
|
1001
|
-
if (!_ || !
|
|
1002
|
-
const
|
|
1003
|
-
return Object.keys(_).forEach((
|
|
1004
|
-
const
|
|
1005
|
-
|
|
1006
|
-
}),
|
|
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,
|
|
1012
|
+
a.value = !0, w.value = !1;
|
|
1013
1013
|
const _ = () => {
|
|
1014
|
-
if (!a.value ||
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
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
|
-
|
|
1023
|
-
if (O.value++, O.value >=
|
|
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
|
-
|
|
1029
|
+
w.value = !0, L.value && (clearTimeout(L.value), L.value = null);
|
|
1032
1030
|
}, M = () => {
|
|
1033
|
-
a.value = !1,
|
|
1031
|
+
a.value = !1, w.value = !1, l.value = 1, L.value && (clearTimeout(L.value), L.value = null);
|
|
1034
1032
|
};
|
|
1035
|
-
|
|
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
|
-
}),
|
|
1051
|
-
() =>
|
|
1048
|
+
}), Et(
|
|
1049
|
+
() => e.model,
|
|
1052
1050
|
(_) => {
|
|
1053
|
-
_ ? i.value =
|
|
1051
|
+
_ ? i.value = b(_) : i.value = [];
|
|
1054
1052
|
},
|
|
1055
1053
|
{ immediate: !0 }
|
|
1056
1054
|
);
|
|
1057
1055
|
const W = () => {
|
|
1058
|
-
!
|
|
1056
|
+
!e.model || a.value && !w.value || i.value.forEach((_) => {
|
|
1059
1057
|
_.urdfJoint && _.urdfJoint.angle !== void 0 && (_.currentValue = _.urdfJoint.angle);
|
|
1060
1058
|
});
|
|
1061
|
-
},
|
|
1059
|
+
}, et = () => {
|
|
1062
1060
|
const _ = () => {
|
|
1063
1061
|
W(), n.value = requestAnimationFrame(_);
|
|
1064
1062
|
};
|
|
1065
1063
|
_();
|
|
1066
|
-
},
|
|
1064
|
+
}, Dt = () => {
|
|
1067
1065
|
n.value && (cancelAnimationFrame(n.value), n.value = null);
|
|
1068
1066
|
};
|
|
1069
|
-
return
|
|
1070
|
-
|
|
1071
|
-
}),
|
|
1072
|
-
|
|
1073
|
-
}), (_,
|
|
1074
|
-
i.value.length > 0 ? (B(), J("div", $
|
|
1075
|
-
(B(!0), J(
|
|
1076
|
-
var
|
|
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",
|
|
1082
|
-
g("div",
|
|
1083
|
-
g("span",
|
|
1084
|
-
g("span",
|
|
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",
|
|
1084
|
+
g("span", qe, it(c.type), 1)
|
|
1087
1085
|
]),
|
|
1088
|
-
c.type === "revolute" || c.type === "prismatic" ? (B(), J("div",
|
|
1089
|
-
g("div",
|
|
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: ((
|
|
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 && !
|
|
1099
|
-
}, null, 40,
|
|
1096
|
+
disabled: a.value && !w.value
|
|
1097
|
+
}, null, 40, es)
|
|
1100
1098
|
]),
|
|
1101
1099
|
g("div", ss, [
|
|
1102
|
-
g("span", is,
|
|
1103
|
-
g("span", os,
|
|
1100
|
+
g("span", is, it(c.currentValue.toFixed(3)), 1),
|
|
1101
|
+
g("span", os, it(c.type === "revolute" ? "rad" : "m"), 1)
|
|
1104
1102
|
])
|
|
1105
|
-
])) :
|
|
1103
|
+
])) : wt("", !0)
|
|
1106
1104
|
]);
|
|
1107
1105
|
}), 128))
|
|
1108
|
-
])) : (B(), J("div", ns,
|
|
1106
|
+
])) : (B(), J("div", ns, E[0] || (E[0] = [
|
|
1109
1107
|
g("p", null, "未检测到可控制的关节", -1)
|
|
1110
1108
|
])))
|
|
1111
1109
|
]));
|
|
1112
1110
|
}
|
|
1113
|
-
}, rs = /* @__PURE__ */
|
|
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
|
|
1122
|
+
const t = o, e = ut(
|
|
1125
1123
|
() => ({
|
|
1126
|
-
backgroundColor:
|
|
1124
|
+
backgroundColor: t.backgroundColor
|
|
1127
1125
|
})
|
|
1128
|
-
), i =
|
|
1129
|
-
const { size: d } =
|
|
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:
|
|
1138
|
-
style:
|
|
1135
|
+
class: jt(["container", { active: d.active }]),
|
|
1136
|
+
style: Lt(e.value)
|
|
1139
1137
|
}, [
|
|
1140
1138
|
(B(), J("svg", {
|
|
1141
|
-
class:
|
|
1142
|
-
style:
|
|
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__ */
|
|
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" },
|
|
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:
|
|
1166
|
-
const i =
|
|
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),
|
|
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:
|
|
1171
|
+
initialTargetPosition: b,
|
|
1174
1172
|
initThreeJS: R,
|
|
1175
|
-
handleResize:
|
|
1176
|
-
fitCameraToAllModels:
|
|
1173
|
+
handleResize: H,
|
|
1174
|
+
fitCameraToAllModels: Z,
|
|
1177
1175
|
getThreeJSObjects: F,
|
|
1178
1176
|
clearAllModels: Y,
|
|
1179
1177
|
cleanup: p
|
|
1180
|
-
} =
|
|
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:
|
|
1181
|
+
), { addModelsFromUrls: Dt, loadModelByDefaultPath: _, urdfModel: E } = we(
|
|
1184
1182
|
F,
|
|
1185
1183
|
s,
|
|
1186
|
-
|
|
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 = (
|
|
1196
|
-
const
|
|
1197
|
-
A.position.lerpVectors(
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
1203
|
+
}), v = async (A, h) => {
|
|
1206
1204
|
try {
|
|
1207
|
-
await
|
|
1205
|
+
await x(), r.value && $(), G.value && W();
|
|
1208
1206
|
const Q = await h(A);
|
|
1209
|
-
return
|
|
1207
|
+
return Z(), Q;
|
|
1210
1208
|
} catch (Q) {
|
|
1211
1209
|
throw console.error("加载模型失败:", Q), Q;
|
|
1212
1210
|
}
|
|
1213
|
-
},
|
|
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
|
-
},
|
|
1213
|
+
}, pt = (A) => {
|
|
1216
1214
|
l.value = !0, k.value = A;
|
|
1217
|
-
},
|
|
1218
|
-
i("getAnimationData"),
|
|
1215
|
+
}, dt = () => {
|
|
1216
|
+
i("getAnimationData"), It(() => {
|
|
1219
1217
|
var A;
|
|
1220
1218
|
(A = f.value) == null || A.startAnimation();
|
|
1221
1219
|
});
|
|
1222
1220
|
};
|
|
1223
|
-
return
|
|
1224
|
-
await
|
|
1221
|
+
return Bt(async () => {
|
|
1222
|
+
await It();
|
|
1225
1223
|
try {
|
|
1226
|
-
R(), d = F().scene, m = !0, window.addEventListener("resize",
|
|
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
|
-
}),
|
|
1231
|
-
m = !1, j.value = "", k.value = "", window.removeEventListener("resize",
|
|
1232
|
-
}),
|
|
1233
|
-
addModelsFromUrls:
|
|
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
|
|
1237
|
-
const Q =
|
|
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:
|
|
1287
|
-
title:
|
|
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) =>
|
|
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) =>
|
|
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: (
|
|
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:
|
|
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: (
|
|
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: (
|
|
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: (
|
|
1380
|
+
onClick: (ot = f.value) == null ? void 0 : ot.resetAll
|
|
1383
1381
|
}, null, 8, ["onClick"])
|
|
1384
1382
|
]),
|
|
1385
|
-
|
|
1383
|
+
nt(g("div", gs, [
|
|
1386
1384
|
g("div", ys, [
|
|
1387
|
-
g("span", null,
|
|
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:
|
|
1395
|
-
j.value === "场景树" ? (B(),
|
|
1392
|
+
default: Ft(() => [
|
|
1393
|
+
j.value === "场景树" ? (B(), Zt(Ke, {
|
|
1396
1394
|
key: 0,
|
|
1397
|
-
model:
|
|
1398
|
-
}, null, 8, ["model"])) :
|
|
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
|
-
|
|
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) =>
|
|
1407
|
-
onChange: h[8] || (h[8] = (...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
|
-
[
|
|
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
|
-
|
|
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) =>
|
|
1419
|
-
onChange: h[10] || (h[10] = (...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
|
-
[
|
|
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
|
-
|
|
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) =>
|
|
1431
|
-
onChange: h[12] || (h[12] = (...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
|
-
[
|
|
1431
|
+
[yt, V(I)]
|
|
1434
1432
|
]),
|
|
1435
1433
|
h[18] || (h[18] = g("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1436
1434
|
]),
|
|
1437
|
-
g("label",
|
|
1438
|
-
|
|
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) =>
|
|
1443
|
-
onChange: h[14] || (h[14] = (...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
|
-
[
|
|
1443
|
+
[yt, V(I)]
|
|
1446
1444
|
]),
|
|
1447
1445
|
h[19] || (h[19] = g("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1448
1446
|
])
|
|
1449
1447
|
])
|
|
1450
|
-
])) :
|
|
1448
|
+
])) : wt("", !0)
|
|
1451
1449
|
]),
|
|
1452
1450
|
_: 1
|
|
1453
1451
|
})
|
|
1454
1452
|
], 512), [
|
|
1455
|
-
[
|
|
1453
|
+
[vt, L.value]
|
|
1456
1454
|
]),
|
|
1457
|
-
|
|
1455
|
+
nt(g("div", xs, [
|
|
1458
1456
|
g("div", Ds, [
|
|
1459
|
-
g("span", null,
|
|
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:
|
|
1467
|
-
|
|
1464
|
+
default: Ft(() => [
|
|
1465
|
+
nt(T(rs, {
|
|
1468
1466
|
ref_key: "jointRef",
|
|
1469
1467
|
ref: f,
|
|
1470
|
-
model:
|
|
1471
|
-
scene:
|
|
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
|
-
[
|
|
1472
|
+
[vt, k.value === "关节控制"]
|
|
1475
1473
|
]),
|
|
1476
|
-
|
|
1474
|
+
nt(T(Ve, {
|
|
1477
1475
|
animationData: n == null ? void 0 : n.animationData
|
|
1478
1476
|
}, null, 8, ["animationData"]), [
|
|
1479
|
-
[
|
|
1477
|
+
[vt, k.value === "动画仿真"]
|
|
1480
1478
|
])
|
|
1481
1479
|
]),
|
|
1482
1480
|
_: 1
|
|
1483
1481
|
})
|
|
1484
1482
|
], 512), [
|
|
1485
|
-
[
|
|
1483
|
+
[vt, l.value]
|
|
1486
1484
|
]),
|
|
1487
|
-
|
|
1485
|
+
w.value ? (B(), J("div", Ts, [
|
|
1488
1486
|
h[20] || (h[20] = g("div", { class: "loading-spinner" }, null, -1)),
|
|
1489
|
-
g("p", null,
|
|
1490
|
-
])) :
|
|
1487
|
+
g("p", null, it(P.value), 1)
|
|
1488
|
+
])) : wt("", !0)
|
|
1491
1489
|
]);
|
|
1492
1490
|
};
|
|
1493
1491
|
}
|
|
1494
|
-
}, Rs = /* @__PURE__ */
|
|
1492
|
+
}, Rs = /* @__PURE__ */ ft(Cs, [["__scopeId", "data-v-14112288"]]);
|
|
1495
1493
|
export {
|
|
1496
1494
|
Rs as default
|
|
1497
1495
|
};
|