ss-component-new 1.1.537 → 1.1.539
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-vsk5-CdH.cjs → index-BKlPw_jN.cjs} +1 -1
- package/dist/{index-rwc1vjpW.js → index-CVX3TWb8.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-E6ojEdr-.cjs → threeModel-D8lqCKTF.cjs} +1 -1
- package/dist/{threeModel-BHjDgjRt.js → threeModel-aG5qpZ_h.js} +347 -347
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as T, computed as
|
|
2
|
-
import { C as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { ref as T, computed as st, watch as Pt, resolveComponent as jt, createElementBlock as B, openBlock as Z, createVNode as x, onMounted as It, onUnmounted as Zt, Fragment as Bt, renderList as $t, createElementVNode as y, createCommentVNode as ut, toDisplayString as J, defineComponent as Xt, normalizeStyle as Tt, normalizeClass as Ct, nextTick as St, onBeforeUnmount as Jt, withDirectives as tt, unref as N, withCtx as kt, createBlock as Gt, isRef as rt, vModelRadio as ht, vShow as gt } from "vue";
|
|
2
|
+
import { C as Wt, V as w, M as G, T as et, Q as At, S as zt, a as $, R as qt, P as pt, b as Qt, B as mt, c as te, d as ee, e as se, W as ie, f as oe, A as ne, g as ae, X as le, G as re, h as dt, i as he, j as Ft, k as ce, D as yt, H as ue, l as Rt, m as pe, n as de, E as vt, u as me } from "./threeModel.vue_vue_type_style_index_0_scoped_fa07a7ad_lang-BV7oq1Z4.js";
|
|
3
|
+
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const Lt = { type: "change" }, Mt = { type: "start" }, Nt = { type: "end" }, ct = new qt(), Ot = new pt(), fe = Math.cos(70 * Qt.DEG2RAD), j = new w(), K = 2 * Math.PI, D = {
|
|
5
5
|
NONE: -1,
|
|
6
6
|
ROTATE: 0,
|
|
7
7
|
DOLLY: 1,
|
|
@@ -10,19 +10,19 @@ const Le = { type: "change" }, Me = { type: "start" }, Ue = { type: "end" }, ce
|
|
|
10
10
|
TOUCH_PAN: 4,
|
|
11
11
|
TOUCH_DOLLY_PAN: 5,
|
|
12
12
|
TOUCH_DOLLY_ROTATE: 6
|
|
13
|
-
},
|
|
14
|
-
class
|
|
13
|
+
}, bt = 1e-6;
|
|
14
|
+
class _e extends Wt {
|
|
15
15
|
/**
|
|
16
16
|
* Constructs a new controls instance.
|
|
17
17
|
*
|
|
18
18
|
* @param {Object3D} object - The object that is managed by the controls.
|
|
19
19
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
20
20
|
*/
|
|
21
|
-
constructor(
|
|
22
|
-
super(
|
|
21
|
+
constructor(t, e = null) {
|
|
22
|
+
super(t, e), this.state = D.NONE, this.target = new w(), this.cursor = new w(), 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: G.ROTATE, MIDDLE: G.DOLLY, RIGHT: G.PAN }, this.touches = { ONE: et.ROTATE, TWO: et.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new At(), this._lastTargetPosition = new w(), this._quat = new At().setFromUnitVectors(t.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new zt(), this._sphericalDelta = new zt(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new $(), this._rotateEnd = new $(), this._rotateDelta = new $(), this._panStart = new $(), this._panEnd = new $(), this._panDelta = new $(), this._dollyStart = new $(), this._dollyEnd = new $(), this._dollyDelta = new $(), this._dollyDirection = new w(), this._mouse = new $(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ye.bind(this), this._onPointerDown = ge.bind(this), this._onPointerUp = ve.bind(this), this._onContextMenu = De.bind(this), this._onMouseWheel = Pe.bind(this), this._onKeyDown = Me.bind(this), this._onTouchStart = Ee.bind(this), this._onTouchMove = xe.bind(this), this._onMouseDown = be.bind(this), this._onMouseMove = we.bind(this), this._interceptControlDown = Te.bind(this), this._interceptControlUp = Ce.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
23
23
|
}
|
|
24
|
-
connect(
|
|
25
|
-
super.connect(
|
|
24
|
+
connect(t) {
|
|
25
|
+
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";
|
|
26
26
|
}
|
|
27
27
|
disconnect() {
|
|
28
28
|
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";
|
|
@@ -60,8 +60,8 @@ class _t extends We {
|
|
|
60
60
|
*
|
|
61
61
|
* @param {HTMLDOMElement} domElement - The DOM element
|
|
62
62
|
*/
|
|
63
|
-
listenToKeyEvents(
|
|
64
|
-
|
|
63
|
+
listenToKeyEvents(t) {
|
|
64
|
+
t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Removes the key event listener previously defined with `listenToKeyEvents()`.
|
|
@@ -80,11 +80,11 @@ class _t extends We {
|
|
|
80
80
|
* was called, or the initial state.
|
|
81
81
|
*/
|
|
82
82
|
reset() {
|
|
83
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
83
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Lt), this.update(), this.state = D.NONE;
|
|
84
84
|
}
|
|
85
|
-
update(
|
|
86
|
-
const
|
|
87
|
-
j.copy(
|
|
85
|
+
update(t = null) {
|
|
86
|
+
const e = this.object.position;
|
|
87
|
+
j.copy(e).sub(this.target), j.applyQuaternion(this._quat), this._spherical.setFromVector3(j), this.autoRotate && this.state === D.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);
|
|
88
88
|
let i = this.minAzimuthAngle, n = this.maxAzimuthAngle;
|
|
89
89
|
isFinite(i) && isFinite(n) && (i < -Math.PI ? i += K : i > Math.PI && (i -= K), n < -Math.PI ? n += K : n > Math.PI && (n -= K), 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);
|
|
90
90
|
let u = !1;
|
|
@@ -94,7 +94,7 @@ class _t extends We {
|
|
|
94
94
|
const f = this._spherical.radius;
|
|
95
95
|
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), u = f != this._spherical.radius;
|
|
96
96
|
}
|
|
97
|
-
if (j.setFromSpherical(this._spherical), j.applyQuaternion(this._quatInverse),
|
|
97
|
+
if (j.setFromSpherical(this._spherical), j.applyQuaternion(this._quatInverse), e.copy(this.target).add(j), 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
98
|
let f = null;
|
|
99
99
|
if (this.object.isPerspectiveCamera) {
|
|
100
100
|
const a = j.length();
|
|
@@ -110,193 +110,193 @@ class _t extends We {
|
|
|
110
110
|
M.unproject(this.object), this.object.position.sub(M).add(a), this.object.updateMatrixWorld(), f = j.length();
|
|
111
111
|
} else
|
|
112
112
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
113
|
-
f !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(f).add(this.object.position) : (
|
|
113
|
+
f !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(f).add(this.object.position) : (ct.origin.copy(this.object.position), ct.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(ct.direction)) < fe ? this.object.lookAt(this.target) : (Ot.setFromNormalAndCoplanarPoint(this.object.up, this.target), ct.intersectPlane(Ot, this.target))));
|
|
114
114
|
} else if (this.object.isOrthographicCamera) {
|
|
115
115
|
const f = this.object.zoom;
|
|
116
116
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), f !== this.object.zoom && (this.object.updateProjectionMatrix(), u = !0);
|
|
117
117
|
}
|
|
118
|
-
return this._scale = 1, this._performCursorZoom = !1, u || this._lastPosition.distanceToSquared(this.object.position) >
|
|
118
|
+
return this._scale = 1, this._performCursorZoom = !1, u || this._lastPosition.distanceToSquared(this.object.position) > bt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > bt || this._lastTargetPosition.distanceToSquared(this.target) > bt ? (this.dispatchEvent(Lt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
119
119
|
}
|
|
120
|
-
_getAutoRotationAngle(
|
|
121
|
-
return
|
|
120
|
+
_getAutoRotationAngle(t) {
|
|
121
|
+
return t !== null ? K / 60 * this.autoRotateSpeed * t : K / 60 / 60 * this.autoRotateSpeed;
|
|
122
122
|
}
|
|
123
|
-
_getZoomScale(
|
|
124
|
-
const
|
|
125
|
-
return Math.pow(0.95, this.zoomSpeed *
|
|
123
|
+
_getZoomScale(t) {
|
|
124
|
+
const e = Math.abs(t * 0.01);
|
|
125
|
+
return Math.pow(0.95, this.zoomSpeed * e);
|
|
126
126
|
}
|
|
127
|
-
_rotateLeft(
|
|
128
|
-
this._sphericalDelta.theta -=
|
|
127
|
+
_rotateLeft(t) {
|
|
128
|
+
this._sphericalDelta.theta -= t;
|
|
129
129
|
}
|
|
130
|
-
_rotateUp(
|
|
131
|
-
this._sphericalDelta.phi -=
|
|
130
|
+
_rotateUp(t) {
|
|
131
|
+
this._sphericalDelta.phi -= t;
|
|
132
132
|
}
|
|
133
|
-
_panLeft(
|
|
134
|
-
j.setFromMatrixColumn(
|
|
133
|
+
_panLeft(t, e) {
|
|
134
|
+
j.setFromMatrixColumn(e, 0), j.multiplyScalar(-t), this._panOffset.add(j);
|
|
135
135
|
}
|
|
136
|
-
_panUp(
|
|
137
|
-
this.screenSpacePanning === !0 ? j.setFromMatrixColumn(
|
|
136
|
+
_panUp(t, e) {
|
|
137
|
+
this.screenSpacePanning === !0 ? j.setFromMatrixColumn(e, 1) : (j.setFromMatrixColumn(e, 0), j.crossVectors(this.object.up, j)), j.multiplyScalar(t), this._panOffset.add(j);
|
|
138
138
|
}
|
|
139
139
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
140
|
-
_pan(
|
|
140
|
+
_pan(t, e) {
|
|
141
141
|
const i = this.domElement;
|
|
142
142
|
if (this.object.isPerspectiveCamera) {
|
|
143
143
|
const n = this.object.position;
|
|
144
144
|
j.copy(n).sub(this.target);
|
|
145
145
|
let u = j.length();
|
|
146
|
-
u *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 *
|
|
147
|
-
} else this.object.isOrthographicCamera ? (this._panLeft(
|
|
146
|
+
u *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * u / i.clientHeight, this.object.matrix), this._panUp(2 * e * u / i.clientHeight, this.object.matrix);
|
|
147
|
+
} 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);
|
|
148
148
|
}
|
|
149
|
-
_dollyOut(
|
|
150
|
-
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /=
|
|
149
|
+
_dollyOut(t) {
|
|
150
|
+
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);
|
|
151
151
|
}
|
|
152
|
-
_dollyIn(
|
|
153
|
-
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *=
|
|
152
|
+
_dollyIn(t) {
|
|
153
|
+
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);
|
|
154
154
|
}
|
|
155
|
-
_updateZoomParameters(
|
|
155
|
+
_updateZoomParameters(t, e) {
|
|
156
156
|
if (!this.zoomToCursor)
|
|
157
157
|
return;
|
|
158
158
|
this._performCursorZoom = !0;
|
|
159
|
-
const i = this.domElement.getBoundingClientRect(), n =
|
|
159
|
+
const i = this.domElement.getBoundingClientRect(), n = t - i.left, u = e - i.top, f = i.width, a = i.height;
|
|
160
160
|
this._mouse.x = n / f * 2 - 1, this._mouse.y = -(u / a) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
161
161
|
}
|
|
162
|
-
_clampDistance(
|
|
163
|
-
return Math.max(this.minDistance, Math.min(this.maxDistance,
|
|
162
|
+
_clampDistance(t) {
|
|
163
|
+
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
164
164
|
}
|
|
165
165
|
//
|
|
166
166
|
// event callbacks - update the object state
|
|
167
167
|
//
|
|
168
|
-
_handleMouseDownRotate(
|
|
169
|
-
this._rotateStart.set(
|
|
168
|
+
_handleMouseDownRotate(t) {
|
|
169
|
+
this._rotateStart.set(t.clientX, t.clientY);
|
|
170
170
|
}
|
|
171
|
-
_handleMouseDownDolly(
|
|
172
|
-
this._updateZoomParameters(
|
|
171
|
+
_handleMouseDownDolly(t) {
|
|
172
|
+
this._updateZoomParameters(t.clientX, t.clientX), this._dollyStart.set(t.clientX, t.clientY);
|
|
173
173
|
}
|
|
174
|
-
_handleMouseDownPan(
|
|
175
|
-
this._panStart.set(
|
|
174
|
+
_handleMouseDownPan(t) {
|
|
175
|
+
this._panStart.set(t.clientX, t.clientY);
|
|
176
176
|
}
|
|
177
|
-
_handleMouseMoveRotate(
|
|
178
|
-
this._rotateEnd.set(
|
|
179
|
-
const
|
|
180
|
-
this._rotateLeft(K * this._rotateDelta.x /
|
|
177
|
+
_handleMouseMoveRotate(t) {
|
|
178
|
+
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
179
|
+
const e = this.domElement;
|
|
180
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
181
181
|
}
|
|
182
|
-
_handleMouseMoveDolly(
|
|
183
|
-
this._dollyEnd.set(
|
|
182
|
+
_handleMouseMoveDolly(t) {
|
|
183
|
+
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();
|
|
184
184
|
}
|
|
185
|
-
_handleMouseMovePan(
|
|
186
|
-
this._panEnd.set(
|
|
185
|
+
_handleMouseMovePan(t) {
|
|
186
|
+
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();
|
|
187
187
|
}
|
|
188
|
-
_handleMouseWheel(
|
|
189
|
-
this._updateZoomParameters(
|
|
188
|
+
_handleMouseWheel(t) {
|
|
189
|
+
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();
|
|
190
190
|
}
|
|
191
|
-
_handleKeyDown(
|
|
192
|
-
let
|
|
193
|
-
switch (
|
|
191
|
+
_handleKeyDown(t) {
|
|
192
|
+
let e = !1;
|
|
193
|
+
switch (t.code) {
|
|
194
194
|
case this.keys.UP:
|
|
195
|
-
|
|
195
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), e = !0;
|
|
196
196
|
break;
|
|
197
197
|
case this.keys.BOTTOM:
|
|
198
|
-
|
|
198
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), e = !0;
|
|
199
199
|
break;
|
|
200
200
|
case this.keys.LEFT:
|
|
201
|
-
|
|
201
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), e = !0;
|
|
202
202
|
break;
|
|
203
203
|
case this.keys.RIGHT:
|
|
204
|
-
|
|
204
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), e = !0;
|
|
205
205
|
break;
|
|
206
206
|
}
|
|
207
|
-
|
|
207
|
+
e && (t.preventDefault(), this.update());
|
|
208
208
|
}
|
|
209
|
-
_handleTouchStartRotate(
|
|
209
|
+
_handleTouchStartRotate(t) {
|
|
210
210
|
if (this._pointers.length === 1)
|
|
211
|
-
this._rotateStart.set(
|
|
211
|
+
this._rotateStart.set(t.pageX, t.pageY);
|
|
212
212
|
else {
|
|
213
|
-
const
|
|
213
|
+
const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
|
|
214
214
|
this._rotateStart.set(i, n);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
_handleTouchStartPan(
|
|
217
|
+
_handleTouchStartPan(t) {
|
|
218
218
|
if (this._pointers.length === 1)
|
|
219
|
-
this._panStart.set(
|
|
219
|
+
this._panStart.set(t.pageX, t.pageY);
|
|
220
220
|
else {
|
|
221
|
-
const
|
|
221
|
+
const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
|
|
222
222
|
this._panStart.set(i, n);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
_handleTouchStartDolly(
|
|
226
|
-
const
|
|
225
|
+
_handleTouchStartDolly(t) {
|
|
226
|
+
const e = this._getSecondPointerPosition(t), i = t.pageX - e.x, n = t.pageY - e.y, u = Math.sqrt(i * i + n * n);
|
|
227
227
|
this._dollyStart.set(0, u);
|
|
228
228
|
}
|
|
229
|
-
_handleTouchStartDollyPan(
|
|
230
|
-
this.enableZoom && this._handleTouchStartDolly(
|
|
229
|
+
_handleTouchStartDollyPan(t) {
|
|
230
|
+
this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
|
|
231
231
|
}
|
|
232
|
-
_handleTouchStartDollyRotate(
|
|
233
|
-
this.enableZoom && this._handleTouchStartDolly(
|
|
232
|
+
_handleTouchStartDollyRotate(t) {
|
|
233
|
+
this.enableZoom && this._handleTouchStartDolly(t), this.enableRotate && this._handleTouchStartRotate(t);
|
|
234
234
|
}
|
|
235
|
-
_handleTouchMoveRotate(
|
|
235
|
+
_handleTouchMoveRotate(t) {
|
|
236
236
|
if (this._pointers.length == 1)
|
|
237
|
-
this._rotateEnd.set(
|
|
237
|
+
this._rotateEnd.set(t.pageX, t.pageY);
|
|
238
238
|
else {
|
|
239
|
-
const i = this._getSecondPointerPosition(
|
|
239
|
+
const i = this._getSecondPointerPosition(t), n = 0.5 * (t.pageX + i.x), u = 0.5 * (t.pageY + i.y);
|
|
240
240
|
this._rotateEnd.set(n, u);
|
|
241
241
|
}
|
|
242
242
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
243
|
-
const
|
|
244
|
-
this._rotateLeft(K * this._rotateDelta.x /
|
|
243
|
+
const e = this.domElement;
|
|
244
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
245
245
|
}
|
|
246
|
-
_handleTouchMovePan(
|
|
246
|
+
_handleTouchMovePan(t) {
|
|
247
247
|
if (this._pointers.length === 1)
|
|
248
|
-
this._panEnd.set(
|
|
248
|
+
this._panEnd.set(t.pageX, t.pageY);
|
|
249
249
|
else {
|
|
250
|
-
const
|
|
250
|
+
const e = this._getSecondPointerPosition(t), i = 0.5 * (t.pageX + e.x), n = 0.5 * (t.pageY + e.y);
|
|
251
251
|
this._panEnd.set(i, n);
|
|
252
252
|
}
|
|
253
253
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
254
254
|
}
|
|
255
|
-
_handleTouchMoveDolly(
|
|
256
|
-
const
|
|
255
|
+
_handleTouchMoveDolly(t) {
|
|
256
|
+
const e = this._getSecondPointerPosition(t), i = t.pageX - e.x, n = t.pageY - e.y, u = Math.sqrt(i * i + n * n);
|
|
257
257
|
this._dollyEnd.set(0, u), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
258
|
-
const f = (
|
|
258
|
+
const f = (t.pageX + e.x) * 0.5, a = (t.pageY + e.y) * 0.5;
|
|
259
259
|
this._updateZoomParameters(f, a);
|
|
260
260
|
}
|
|
261
|
-
_handleTouchMoveDollyPan(
|
|
262
|
-
this.enableZoom && this._handleTouchMoveDolly(
|
|
261
|
+
_handleTouchMoveDollyPan(t) {
|
|
262
|
+
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
263
263
|
}
|
|
264
|
-
_handleTouchMoveDollyRotate(
|
|
265
|
-
this.enableZoom && this._handleTouchMoveDolly(
|
|
264
|
+
_handleTouchMoveDollyRotate(t) {
|
|
265
|
+
this.enableZoom && this._handleTouchMoveDolly(t), this.enableRotate && this._handleTouchMoveRotate(t);
|
|
266
266
|
}
|
|
267
267
|
// pointers
|
|
268
|
-
_addPointer(
|
|
269
|
-
this._pointers.push(
|
|
268
|
+
_addPointer(t) {
|
|
269
|
+
this._pointers.push(t.pointerId);
|
|
270
270
|
}
|
|
271
|
-
_removePointer(
|
|
272
|
-
delete this._pointerPositions[
|
|
273
|
-
for (let
|
|
274
|
-
if (this._pointers[
|
|
275
|
-
this._pointers.splice(
|
|
271
|
+
_removePointer(t) {
|
|
272
|
+
delete this._pointerPositions[t.pointerId];
|
|
273
|
+
for (let e = 0; e < this._pointers.length; e++)
|
|
274
|
+
if (this._pointers[e] == t.pointerId) {
|
|
275
|
+
this._pointers.splice(e, 1);
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
_isTrackingPointer(
|
|
280
|
-
for (let
|
|
281
|
-
if (this._pointers[
|
|
279
|
+
_isTrackingPointer(t) {
|
|
280
|
+
for (let e = 0; e < this._pointers.length; e++)
|
|
281
|
+
if (this._pointers[e] == t.pointerId) return !0;
|
|
282
282
|
return !1;
|
|
283
283
|
}
|
|
284
|
-
_trackPointer(
|
|
285
|
-
let
|
|
286
|
-
|
|
284
|
+
_trackPointer(t) {
|
|
285
|
+
let e = this._pointerPositions[t.pointerId];
|
|
286
|
+
e === void 0 && (e = new $(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
|
|
287
287
|
}
|
|
288
|
-
_getSecondPointerPosition(
|
|
289
|
-
const
|
|
290
|
-
return this._pointerPositions[
|
|
288
|
+
_getSecondPointerPosition(t) {
|
|
289
|
+
const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
290
|
+
return this._pointerPositions[e];
|
|
291
291
|
}
|
|
292
292
|
//
|
|
293
|
-
_customWheelEvent(
|
|
294
|
-
const
|
|
295
|
-
clientX:
|
|
296
|
-
clientY:
|
|
297
|
-
deltaY:
|
|
293
|
+
_customWheelEvent(t) {
|
|
294
|
+
const e = t.deltaMode, i = {
|
|
295
|
+
clientX: t.clientX,
|
|
296
|
+
clientY: t.clientY,
|
|
297
|
+
deltaY: t.deltaY
|
|
298
298
|
};
|
|
299
|
-
switch (
|
|
299
|
+
switch (e) {
|
|
300
300
|
case 1:
|
|
301
301
|
i.deltaY *= 16;
|
|
302
302
|
break;
|
|
@@ -304,42 +304,42 @@ class _t extends We {
|
|
|
304
304
|
i.deltaY *= 100;
|
|
305
305
|
break;
|
|
306
306
|
}
|
|
307
|
-
return
|
|
307
|
+
return t.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function ge(o) {
|
|
311
311
|
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)));
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function ye(o) {
|
|
314
314
|
this.enabled !== !1 && (o.pointerType === "touch" ? this._onTouchMove(o) : this._onMouseMove(o));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function ve(o) {
|
|
317
317
|
switch (this._removePointer(o), this._pointers.length) {
|
|
318
318
|
case 0:
|
|
319
|
-
this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
319
|
+
this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Nt), this.state = D.NONE;
|
|
320
320
|
break;
|
|
321
321
|
case 1:
|
|
322
|
-
const
|
|
323
|
-
this._onTouchStart({ pointerId:
|
|
322
|
+
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
323
|
+
this._onTouchStart({ pointerId: t, pageX: e.x, pageY: e.y });
|
|
324
324
|
break;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let
|
|
327
|
+
function be(o) {
|
|
328
|
+
let t;
|
|
329
329
|
switch (o.button) {
|
|
330
330
|
case 0:
|
|
331
|
-
|
|
331
|
+
t = this.mouseButtons.LEFT;
|
|
332
332
|
break;
|
|
333
333
|
case 1:
|
|
334
|
-
|
|
334
|
+
t = this.mouseButtons.MIDDLE;
|
|
335
335
|
break;
|
|
336
336
|
case 2:
|
|
337
|
-
|
|
337
|
+
t = this.mouseButtons.RIGHT;
|
|
338
338
|
break;
|
|
339
339
|
default:
|
|
340
|
-
|
|
340
|
+
t = -1;
|
|
341
341
|
}
|
|
342
|
-
switch (
|
|
342
|
+
switch (t) {
|
|
343
343
|
case G.DOLLY:
|
|
344
344
|
if (this.enableZoom === !1) return;
|
|
345
345
|
this._handleMouseDownDolly(o), this.state = D.DOLLY;
|
|
@@ -365,9 +365,9 @@ function bt(o) {
|
|
|
365
365
|
default:
|
|
366
366
|
this.state = D.NONE;
|
|
367
367
|
}
|
|
368
|
-
this.state !== D.NONE && this.dispatchEvent(
|
|
368
|
+
this.state !== D.NONE && this.dispatchEvent(Mt);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function we(o) {
|
|
371
371
|
switch (this.state) {
|
|
372
372
|
case D.ROTATE:
|
|
373
373
|
if (this.enableRotate === !1) return;
|
|
@@ -383,21 +383,21 @@ function wt(o) {
|
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== D.NONE || (o.preventDefault(), this.dispatchEvent(
|
|
386
|
+
function Pe(o) {
|
|
387
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== D.NONE || (o.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Nt));
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Me(o) {
|
|
390
390
|
this.enabled !== !1 && this._handleKeyDown(o);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Ee(o) {
|
|
393
393
|
switch (this._trackPointer(o), this._pointers.length) {
|
|
394
394
|
case 1:
|
|
395
395
|
switch (this.touches.ONE) {
|
|
396
|
-
case
|
|
396
|
+
case et.ROTATE:
|
|
397
397
|
if (this.enableRotate === !1) return;
|
|
398
398
|
this._handleTouchStartRotate(o), this.state = D.TOUCH_ROTATE;
|
|
399
399
|
break;
|
|
400
|
-
case
|
|
400
|
+
case et.PAN:
|
|
401
401
|
if (this.enablePan === !1) return;
|
|
402
402
|
this._handleTouchStartPan(o), this.state = D.TOUCH_PAN;
|
|
403
403
|
break;
|
|
@@ -407,11 +407,11 @@ function Et(o) {
|
|
|
407
407
|
break;
|
|
408
408
|
case 2:
|
|
409
409
|
switch (this.touches.TWO) {
|
|
410
|
-
case
|
|
410
|
+
case et.DOLLY_PAN:
|
|
411
411
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
412
412
|
this._handleTouchStartDollyPan(o), this.state = D.TOUCH_DOLLY_PAN;
|
|
413
413
|
break;
|
|
414
|
-
case
|
|
414
|
+
case et.DOLLY_ROTATE:
|
|
415
415
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
416
416
|
this._handleTouchStartDollyRotate(o), this.state = D.TOUCH_DOLLY_ROTATE;
|
|
417
417
|
break;
|
|
@@ -422,9 +422,9 @@ function Et(o) {
|
|
|
422
422
|
default:
|
|
423
423
|
this.state = D.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !== D.NONE && this.dispatchEvent(
|
|
425
|
+
this.state !== D.NONE && this.dispatchEvent(Mt);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function xe(o) {
|
|
428
428
|
switch (this._trackPointer(o), this.state) {
|
|
429
429
|
case D.TOUCH_ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
@@ -446,29 +446,29 @@ function xt(o) {
|
|
|
446
446
|
this.state = D.NONE;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function De(o) {
|
|
450
450
|
this.enabled !== !1 && o.preventDefault();
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Te(o) {
|
|
453
453
|
o.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Ce(o) {
|
|
456
456
|
o.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
let
|
|
460
|
-
const M = T([]), C = T(new w()),
|
|
458
|
+
function Se(o) {
|
|
459
|
+
let t = null, e = null, i = null, n = null, u = null, f = null, a = null, P = null;
|
|
460
|
+
const M = T([]), C = T(new w()), U = T(new w()), A = () => {
|
|
461
461
|
if (!o.value) return;
|
|
462
|
-
|
|
462
|
+
t = new te(), t.background = new ee(15790320);
|
|
463
463
|
const d = o.value;
|
|
464
|
-
|
|
464
|
+
e = new se(75, d.clientWidth / d.clientHeight, 0.1, 1e4), e.position.set(8, -8, 6), e.up.set(0, 0, 1), e.lookAt(0, 0, 0), i = new ie({
|
|
465
465
|
antialias: !0,
|
|
466
466
|
alpha: !0
|
|
467
|
-
}), i.setSize(d.clientWidth, d.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type =
|
|
467
|
+
}), i.setSize(d.clientWidth, d.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = oe, i.toneMapping = ne, i.toneMappingExposure = 1, i.outputColorSpace = ae, d.appendChild(i.domElement), n = new _e(e, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
|
|
468
468
|
LEFT: G.ROTATE,
|
|
469
469
|
MIDDLE: G.PAN,
|
|
470
470
|
RIGHT: null
|
|
471
|
-
}, n.panSpeed = 0.7, u = new
|
|
471
|
+
}, n.panSpeed = 0.7, u = new le(e, i, {
|
|
472
472
|
container: d,
|
|
473
473
|
type: "cube",
|
|
474
474
|
placement: "top-right",
|
|
@@ -500,19 +500,19 @@ function St(o) {
|
|
|
500
500
|
}
|
|
501
501
|
}), u.attachControls(n), _(), s();
|
|
502
502
|
}, h = (d, l) => {
|
|
503
|
-
a && (
|
|
503
|
+
a && (t.remove(a), a.dispose()), P && (t.remove(P), P.geometry.dispose(), P.material.dispose());
|
|
504
504
|
const E = Math.min(Math.max(Math.floor(d / 20), 30), 40);
|
|
505
|
-
a = new
|
|
506
|
-
const H = new
|
|
505
|
+
a = new re(d, E, 13421772, 14540253), a.rotateX(Math.PI / 2), a.position.copy(l), t.add(a);
|
|
506
|
+
const H = new dt(d, d), r = new he({
|
|
507
507
|
opacity: 0.3,
|
|
508
508
|
// 阴影透明度
|
|
509
509
|
color: 0
|
|
510
510
|
});
|
|
511
|
-
P = new
|
|
511
|
+
P = new Ft(H, r), P.position.copy(l), P.position.z -= 0.01, P.receiveShadow = !0, t.add(P);
|
|
512
512
|
}, S = () => {
|
|
513
513
|
if (M.value.length === 0)
|
|
514
514
|
return;
|
|
515
|
-
const d = new
|
|
515
|
+
const d = new mt();
|
|
516
516
|
M.value.forEach((c) => {
|
|
517
517
|
d.expandByObject(c);
|
|
518
518
|
});
|
|
@@ -524,22 +524,22 @@ function St(o) {
|
|
|
524
524
|
);
|
|
525
525
|
h(r, g);
|
|
526
526
|
}, _ = () => {
|
|
527
|
-
const d = new
|
|
528
|
-
|
|
529
|
-
const l = new
|
|
530
|
-
l.position.set(10, 10, 8), l.castShadow = !0, l.shadow.mapSize.width = 4096, l.shadow.mapSize.height = 4096, l.shadow.camera.near = 0.5, l.shadow.camera.far = 50, l.shadow.camera.left = -50, l.shadow.camera.right = 50, l.shadow.camera.top = 50, l.shadow.camera.bottom = -50,
|
|
531
|
-
const E = new
|
|
532
|
-
E.position.set(-8, -8, 6),
|
|
533
|
-
const H = new
|
|
534
|
-
H.position.set(0, -15, 2),
|
|
535
|
-
const r = new
|
|
536
|
-
|
|
537
|
-
const g = new
|
|
538
|
-
g.position.set(15, 15, 15),
|
|
539
|
-
const c = new
|
|
540
|
-
c.position.set(-15, -15, 15),
|
|
527
|
+
const d = new ce(4210752, 0.6);
|
|
528
|
+
t.add(d);
|
|
529
|
+
const l = new yt(16777215, 2);
|
|
530
|
+
l.position.set(10, 10, 8), l.castShadow = !0, l.shadow.mapSize.width = 4096, l.shadow.mapSize.height = 4096, l.shadow.camera.near = 0.5, l.shadow.camera.far = 50, l.shadow.camera.left = -50, l.shadow.camera.right = 50, l.shadow.camera.top = 50, l.shadow.camera.bottom = -50, t.add(l);
|
|
531
|
+
const E = new yt(16777215, 0.8);
|
|
532
|
+
E.position.set(-8, -8, 6), t.add(E);
|
|
533
|
+
const H = new yt(16777215, 0.6);
|
|
534
|
+
H.position.set(0, -15, 2), t.add(H);
|
|
535
|
+
const r = new ue(16777215, 4473924, 0.8);
|
|
536
|
+
t.add(r);
|
|
537
|
+
const g = new Rt(16777215, 1, 50);
|
|
538
|
+
g.position.set(15, 15, 15), t.add(g);
|
|
539
|
+
const c = new Rt(16777215, 0.5, 50);
|
|
540
|
+
c.position.set(-15, -15, 15), t.add(c);
|
|
541
541
|
}, s = () => {
|
|
542
|
-
f = requestAnimationFrame(s), n && n.update(), i &&
|
|
542
|
+
f = requestAnimationFrame(s), n && n.update(), i && t && e && i.render(t, e), u && u.render();
|
|
543
543
|
}, p = (d) => {
|
|
544
544
|
[
|
|
545
545
|
"map",
|
|
@@ -567,40 +567,40 @@ function St(o) {
|
|
|
567
567
|
// 响应式数据
|
|
568
568
|
currentModels: M,
|
|
569
569
|
initialCameraPosition: C,
|
|
570
|
-
initialTargetPosition:
|
|
570
|
+
initialTargetPosition: U,
|
|
571
571
|
// 方法
|
|
572
572
|
initThreeJS: A,
|
|
573
573
|
handleResize: () => {
|
|
574
|
-
if (!o.value || !
|
|
574
|
+
if (!o.value || !e || !i || !u) return;
|
|
575
575
|
const d = o.value, l = d.clientWidth, E = d.clientHeight;
|
|
576
|
-
|
|
576
|
+
e.aspect = l / E, e.updateProjectionMatrix(), i.setSize(l, E), u.update();
|
|
577
577
|
},
|
|
578
578
|
fitCameraToAllModels: () => {
|
|
579
|
-
if (!
|
|
580
|
-
const d = new
|
|
579
|
+
if (!e || !n || M.value.length === 0) return;
|
|
580
|
+
const d = new mt();
|
|
581
581
|
M.value.forEach((c) => {
|
|
582
582
|
d.expandByObject(c);
|
|
583
583
|
});
|
|
584
584
|
const l = d.getSize(new w()), E = d.getCenter(new w()), r = Math.max(l.x, l.y, l.z) * 0.8, g = new w(E.x + r, E.y - r, E.z + r);
|
|
585
|
-
|
|
585
|
+
e.position.copy(g), e.lookAt(E), n.target.copy(E), n.update(), C.value.copy(g), U.value.copy(E), S();
|
|
586
586
|
},
|
|
587
587
|
getThreeJSObjects: () => ({
|
|
588
|
-
scene:
|
|
589
|
-
camera:
|
|
588
|
+
scene: t,
|
|
589
|
+
camera: e,
|
|
590
590
|
renderer: i,
|
|
591
591
|
controls: n,
|
|
592
592
|
gizmo: u
|
|
593
593
|
}),
|
|
594
594
|
clearAllModels: () => {
|
|
595
|
-
if (!
|
|
595
|
+
if (!t) return;
|
|
596
596
|
M.value.forEach((l) => {
|
|
597
|
-
|
|
597
|
+
t.remove(l), b(l);
|
|
598
598
|
});
|
|
599
599
|
const d = [];
|
|
600
|
-
|
|
600
|
+
t.children.forEach((l) => {
|
|
601
601
|
!l.isLight && !l.isCamera && l.type !== "GridHelper" && l !== P && d.push(l);
|
|
602
602
|
}), d.forEach((l) => {
|
|
603
|
-
|
|
603
|
+
t.remove(l), b(l);
|
|
604
604
|
}), M.value = [], S();
|
|
605
605
|
},
|
|
606
606
|
cleanup: () => {
|
|
@@ -609,10 +609,10 @@ function St(o) {
|
|
|
609
609
|
updateGridForModels: S
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
const
|
|
612
|
+
function ke(o, t) {
|
|
613
|
+
const e = T(!1);
|
|
614
614
|
let i = null, n = 12700, u = new w(), f = new w(), a = new w(), P = 0, M = null;
|
|
615
|
-
const C = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2,
|
|
615
|
+
const C = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, U = (s) => {
|
|
616
616
|
const p = new w(), b = P * 1.2, R = new w(a.x + b, a.y, a.z), Y = new w(a.x, a.y + b, a.z), F = new w(a.x, a.y - b, a.z);
|
|
617
617
|
if (s <= 0.567) {
|
|
618
618
|
const V = s / 0.567 * Math.PI * 2;
|
|
@@ -637,15 +637,15 @@ function kt(o, e) {
|
|
|
637
637
|
S();
|
|
638
638
|
return;
|
|
639
639
|
}
|
|
640
|
-
const Y =
|
|
640
|
+
const Y = U(R);
|
|
641
641
|
s.position.copy(Y), s.lookAt(a), p.target.copy(a), M = requestAnimationFrame(A);
|
|
642
642
|
}, h = () => {
|
|
643
|
-
if (
|
|
643
|
+
if (t.value.length === 0) return;
|
|
644
644
|
const { camera: s, controls: p } = o();
|
|
645
645
|
if (!s || !p) return;
|
|
646
646
|
u.copy(s.position), f.copy(p.target);
|
|
647
|
-
const b = new
|
|
648
|
-
|
|
647
|
+
const b = new mt();
|
|
648
|
+
t.value.forEach((l) => {
|
|
649
649
|
b.expandByObject(l);
|
|
650
650
|
});
|
|
651
651
|
const R = b.getSize(new w());
|
|
@@ -654,19 +654,19 @@ function kt(o, e) {
|
|
|
654
654
|
p.enabled = !1;
|
|
655
655
|
const F = s.position.clone(), O = 1e3, V = Date.now(), d = () => {
|
|
656
656
|
const l = Date.now() - V, E = Math.min(l / O, 1), H = C(E);
|
|
657
|
-
s.position.lerpVectors(F, Y, H), s.lookAt(a), p.target.copy(a), E < 1 ? requestAnimationFrame(d) : (
|
|
657
|
+
s.position.lerpVectors(F, Y, H), s.lookAt(a), p.target.copy(a), E < 1 ? requestAnimationFrame(d) : (e.value = !0, i = null, A());
|
|
658
658
|
};
|
|
659
659
|
d();
|
|
660
660
|
}, S = () => {
|
|
661
|
-
|
|
661
|
+
e.value = !1, i = null, M && (cancelAnimationFrame(M), M = null);
|
|
662
662
|
const { controls: s } = o();
|
|
663
663
|
s && (s.enabled = !0, s.target.copy(f));
|
|
664
664
|
};
|
|
665
665
|
return {
|
|
666
|
-
isAnimating:
|
|
666
|
+
isAnimating: e,
|
|
667
667
|
toggleAnimation: () => {
|
|
668
|
-
if (
|
|
669
|
-
|
|
668
|
+
if (e.value) {
|
|
669
|
+
e.value = !1, i = null, M && (cancelAnimationFrame(M), M = null);
|
|
670
670
|
const { camera: s, controls: p } = o();
|
|
671
671
|
if (!s || !p) return;
|
|
672
672
|
p.enabled = !0;
|
|
@@ -682,41 +682,41 @@ function kt(o, e) {
|
|
|
682
682
|
stopAnimation: S
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
function
|
|
686
|
-
const
|
|
687
|
-
let n = [], u = [], f = new
|
|
685
|
+
function Ae(o, t) {
|
|
686
|
+
const e = T(!1), i = T("none");
|
|
687
|
+
let n = [], u = [], f = new mt(), a = new w();
|
|
688
688
|
const P = () => {
|
|
689
689
|
n = [
|
|
690
|
-
new
|
|
690
|
+
new pt(new w(1, 0, 0), 0),
|
|
691
691
|
// X轴平面
|
|
692
|
-
new
|
|
692
|
+
new pt(new w(0, 1, 0), 0),
|
|
693
693
|
// Y轴平面
|
|
694
|
-
new
|
|
694
|
+
new pt(new w(0, 0, 1), 0)
|
|
695
695
|
// Z轴平面
|
|
696
696
|
];
|
|
697
697
|
}, M = () => {
|
|
698
|
-
f.makeEmpty(),
|
|
698
|
+
f.makeEmpty(), t.value.forEach((_) => {
|
|
699
699
|
f.expandByObject(_);
|
|
700
700
|
}), a = f.getCenter(new w());
|
|
701
701
|
}, C = (_) => {
|
|
702
702
|
const s = f.getSize(new w());
|
|
703
703
|
let p, b, R;
|
|
704
|
-
_ === "x" ? (p = new
|
|
705
|
-
const Y = new
|
|
704
|
+
_ === "x" ? (p = new dt(s.z * 1.2, s.y * 1.2), b = new w(a.x, a.y, a.z), R = new vt(0, Math.PI / 2, 0)) : _ === "y" ? (p = new dt(s.x * 1.2, s.z * 1.2), b = new w(a.x, a.y, a.z), R = new vt(Math.PI / 2, 0, 0)) : _ === "z" && (p = new dt(s.x * 1.2, s.y * 1.2), b = new w(a.x, a.y, a.z), R = new vt(0, 0, 0));
|
|
705
|
+
const Y = new pe({
|
|
706
706
|
color: 8900331,
|
|
707
707
|
transparent: !0,
|
|
708
708
|
opacity: 0.3,
|
|
709
|
-
side:
|
|
709
|
+
side: de,
|
|
710
710
|
depthWrite: !1
|
|
711
|
-
}), F = new
|
|
711
|
+
}), F = new Ft(p, Y);
|
|
712
712
|
return F.position.copy(b), F.rotation.copy(R), F;
|
|
713
|
-
},
|
|
713
|
+
}, U = () => {
|
|
714
714
|
if (A(), h(), i.value === "none")
|
|
715
715
|
return;
|
|
716
716
|
M();
|
|
717
717
|
let _ = null;
|
|
718
718
|
if (i.value === "x" ? (n[0].constant = -a.x, _ = n[0]) : i.value === "y" ? (n[1].constant = -a.y, _ = n[1]) : i.value === "z" && (n[2].constant = -a.z, _ = n[2]), _) {
|
|
719
|
-
|
|
719
|
+
t.value.forEach((p) => {
|
|
720
720
|
p.traverse((b) => {
|
|
721
721
|
b.isMesh && b.material && (Array.isArray(b.material) ? b.material.forEach((R) => {
|
|
722
722
|
R.clippingPlanes = [_];
|
|
@@ -730,7 +730,7 @@ function At(o, e) {
|
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
}, A = () => {
|
|
733
|
-
|
|
733
|
+
t.value.forEach((_) => {
|
|
734
734
|
_.traverse((s) => {
|
|
735
735
|
s.isMesh && s.material && (Array.isArray(s.material) ? s.material.forEach((p) => {
|
|
736
736
|
p.clippingPlanes = [];
|
|
@@ -744,17 +744,17 @@ function At(o, e) {
|
|
|
744
744
|
}), u = [];
|
|
745
745
|
};
|
|
746
746
|
return {
|
|
747
|
-
isClipping:
|
|
747
|
+
isClipping: e,
|
|
748
748
|
activeClippingAxis: i,
|
|
749
749
|
toggleClipping: () => {
|
|
750
|
-
|
|
750
|
+
e.value = !e.value, e.value ? (P(), t.value.length > 0 && M()) : (i.value = "none", A(), h());
|
|
751
751
|
},
|
|
752
|
-
updateClippingPlanes:
|
|
752
|
+
updateClippingPlanes: U,
|
|
753
753
|
clearClippingPlanes: A,
|
|
754
754
|
clearClippingMeshes: h
|
|
755
755
|
};
|
|
756
756
|
}
|
|
757
|
-
const
|
|
757
|
+
const ze = { class: "panel-content" }, Re = "id", Le = {
|
|
758
758
|
__name: "urdfTree",
|
|
759
759
|
props: {
|
|
760
760
|
model: Object,
|
|
@@ -769,8 +769,8 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
771
|
emits: ["nodeClick"],
|
|
772
|
-
setup(o, { emit:
|
|
773
|
-
const
|
|
772
|
+
setup(o, { emit: t }) {
|
|
773
|
+
const e = o, i = t, n = T([]), u = {
|
|
774
774
|
children: "children",
|
|
775
775
|
label: "label"
|
|
776
776
|
}, f = (h) => {
|
|
@@ -821,49 +821,49 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
821
821
|
_.push(...p);
|
|
822
822
|
}
|
|
823
823
|
}), _.slice(0, S + 1);
|
|
824
|
-
},
|
|
825
|
-
return
|
|
824
|
+
}, U = st(() => !n.value || n.value.length === 0 ? [] : e.expandStrategy === "firstLevel" ? C(n.value, e.maxExpandCount) : M(n.value, e.maxExpandCount)), A = st(() => e != null && e.model ? P(e.model) : []);
|
|
825
|
+
return Pt(
|
|
826
826
|
A,
|
|
827
827
|
(h) => {
|
|
828
828
|
n.value = JSON.parse(JSON.stringify(h));
|
|
829
829
|
},
|
|
830
830
|
{ immediate: !0 }
|
|
831
831
|
), (h, S) => {
|
|
832
|
-
const _ =
|
|
833
|
-
return Z(), B("div",
|
|
832
|
+
const _ = jt("el-tree");
|
|
833
|
+
return Z(), B("div", ze, [
|
|
834
834
|
x(_, {
|
|
835
835
|
data: n.value,
|
|
836
836
|
props: u,
|
|
837
|
-
"default-expanded-keys":
|
|
838
|
-
"node-key":
|
|
837
|
+
"default-expanded-keys": U.value,
|
|
838
|
+
"node-key": Re,
|
|
839
839
|
onNodeClick: f
|
|
840
840
|
}, null, 8, ["data", "default-expanded-keys"])
|
|
841
841
|
]);
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
|
-
},
|
|
844
|
+
}, Oe = /* @__PURE__ */ ft(Le, [["__scopeId", "data-v-290ff4e1"]]), je = { class: "panel-content" }, Ie = {
|
|
845
845
|
key: 0,
|
|
846
846
|
class: "joints-list"
|
|
847
|
-
},
|
|
847
|
+
}, Fe = { class: "joint-info-row" }, Ne = { class: "joint-left" }, Ue = { class: "joint-name" }, Ye = { class: "joint-range" }, Ve = { class: "joint-type" }, He = {
|
|
848
848
|
key: 0,
|
|
849
849
|
class: "joint-control-row"
|
|
850
|
-
},
|
|
850
|
+
}, Ke = { class: "slider-container" }, Ze = ["min", "max", "value", "onInput", "disabled"], Be = { class: "value-display" }, $e = { class: "joint-value" }, Xe = { class: "unit" }, Je = {
|
|
851
851
|
key: 1,
|
|
852
852
|
class: "empty-state"
|
|
853
|
-
},
|
|
853
|
+
}, Ge = 1e3, wt = 60, We = {
|
|
854
854
|
__name: "jointPanel",
|
|
855
855
|
props: {
|
|
856
856
|
model: Object,
|
|
857
857
|
scene: Object,
|
|
858
858
|
animationData: Array
|
|
859
859
|
},
|
|
860
|
-
setup(o, { expose:
|
|
861
|
-
const
|
|
860
|
+
setup(o, { expose: t }) {
|
|
861
|
+
const e = o;
|
|
862
862
|
T(!0);
|
|
863
|
-
const i = T([]), n = T(null), u = T(!1), f = T(!1), a = T(0), P = T(0), M = T(null), C = T(1),
|
|
863
|
+
const i = T([]), n = T(null), u = T(!1), f = T(!1), a = T(0), P = T(0), M = T(null), C = T(1), U = () => Ge / wt / C.value;
|
|
864
864
|
let A = [];
|
|
865
|
-
|
|
866
|
-
() =>
|
|
865
|
+
Pt(
|
|
866
|
+
() => e.animationData,
|
|
867
867
|
(r) => {
|
|
868
868
|
r && r.length > 0 && (A = r, R());
|
|
869
869
|
},
|
|
@@ -885,7 +885,7 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
885
885
|
upper: h(v._jointType, !0)
|
|
886
886
|
};
|
|
887
887
|
g.push({
|
|
888
|
-
name: c
|
|
888
|
+
name: c,
|
|
889
889
|
type: v._jointType || "unknown",
|
|
890
890
|
limit: I,
|
|
891
891
|
currentValue: v.angle || 0,
|
|
@@ -893,7 +893,7 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
893
893
|
});
|
|
894
894
|
}), g.sort((c, v) => c.name.localeCompare(v.name));
|
|
895
895
|
}, _ = (r, g) => {
|
|
896
|
-
const c = i.value.find((I) => I.name
|
|
896
|
+
const c = i.value.find((I) => I.name === r);
|
|
897
897
|
if (!c) return;
|
|
898
898
|
const v = parseFloat(g);
|
|
899
899
|
if (c.limit) {
|
|
@@ -901,11 +901,11 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
901
901
|
c.currentValue = I;
|
|
902
902
|
} else
|
|
903
903
|
c.currentValue = v;
|
|
904
|
-
|
|
904
|
+
e.model && e.model.setJointValue ? e.model.setJointValue(r, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
|
|
905
905
|
}, s = (r) => {
|
|
906
906
|
r && Object.keys(r).forEach((g) => {
|
|
907
|
-
const c = r[g], v = i.value.find((I) => I.name
|
|
908
|
-
v && (v.currentValue = c,
|
|
907
|
+
const c = r[g], v = i.value.find((I) => I.name === g);
|
|
908
|
+
v && (v.currentValue = c, e.model && e.model.setJointValue ? e.model.setJointValue(g, c) : v.urdfJoint && v.urdfJoint.setJointValue(c));
|
|
909
909
|
});
|
|
910
910
|
}, p = (r, g, c) => r + (g - r) * c, b = (r, g, c) => {
|
|
911
911
|
if (!r || !g) return r || g;
|
|
@@ -922,17 +922,17 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
922
922
|
console.log(232, 111), u.value = !0, f.value = !1;
|
|
923
923
|
const r = () => {
|
|
924
924
|
if (!u.value || f.value) return;
|
|
925
|
-
const g = P.value /
|
|
925
|
+
const g = P.value / wt, c = A[a.value], v = A[a.value + 1];
|
|
926
926
|
if (v) {
|
|
927
927
|
const I = b(c, v, g);
|
|
928
928
|
s(I);
|
|
929
929
|
} else
|
|
930
930
|
s(c);
|
|
931
|
-
if (P.value++, P.value >=
|
|
931
|
+
if (P.value++, P.value >= wt && (P.value = 0, a.value++, a.value >= A.length - 1)) {
|
|
932
932
|
F();
|
|
933
933
|
return;
|
|
934
934
|
}
|
|
935
|
-
M.value = setTimeout(r,
|
|
935
|
+
M.value = setTimeout(r, U());
|
|
936
936
|
};
|
|
937
937
|
r();
|
|
938
938
|
}, Y = () => {
|
|
@@ -940,7 +940,7 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
940
940
|
}, F = () => {
|
|
941
941
|
u.value = !1, f.value = !1, C.value = 1, M.value && (clearTimeout(M.value), M.value = null);
|
|
942
942
|
};
|
|
943
|
-
|
|
943
|
+
t({
|
|
944
944
|
startAnimation: R,
|
|
945
945
|
pauseAnimation: Y,
|
|
946
946
|
stopAnimation: F,
|
|
@@ -955,15 +955,15 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
955
955
|
fastBackward: () => {
|
|
956
956
|
C.value > 0.25 && (C.value = Math.max(0.25, C.value / 2));
|
|
957
957
|
}
|
|
958
|
-
}),
|
|
959
|
-
() =>
|
|
958
|
+
}), Pt(
|
|
959
|
+
() => e.model,
|
|
960
960
|
(r) => {
|
|
961
961
|
r ? i.value = S(r) : i.value = [];
|
|
962
962
|
},
|
|
963
963
|
{ immediate: !0 }
|
|
964
964
|
);
|
|
965
965
|
const l = () => {
|
|
966
|
-
!
|
|
966
|
+
!e.model || u.value && !f.value || i.value.forEach((r) => {
|
|
967
967
|
r.urdfJoint && r.urdfJoint.angle !== void 0 && (r.currentValue = r.urdfJoint.angle);
|
|
968
968
|
});
|
|
969
969
|
}, E = () => {
|
|
@@ -974,51 +974,51 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
974
974
|
}, H = () => {
|
|
975
975
|
n.value && (cancelAnimationFrame(n.value), n.value = null);
|
|
976
976
|
};
|
|
977
|
-
return
|
|
977
|
+
return It(() => {
|
|
978
978
|
E();
|
|
979
|
-
}),
|
|
979
|
+
}), Zt(() => {
|
|
980
980
|
H(), F();
|
|
981
|
-
}), (r, g) => (Z(), B("div",
|
|
982
|
-
i.value.length > 0 ? (Z(), B("div",
|
|
983
|
-
(Z(!0), B(
|
|
981
|
+
}), (r, g) => (Z(), B("div", je, [
|
|
982
|
+
i.value.length > 0 ? (Z(), B("div", Ie, [
|
|
983
|
+
(Z(!0), B(Bt, null, $t(i.value, (c) => {
|
|
984
984
|
var v, I, W, q;
|
|
985
985
|
return Z(), B("div", {
|
|
986
986
|
key: c.name,
|
|
987
987
|
class: "joint-item"
|
|
988
988
|
}, [
|
|
989
|
-
y("div",
|
|
990
|
-
y("div",
|
|
991
|
-
y("span",
|
|
992
|
-
y("span",
|
|
989
|
+
y("div", Fe, [
|
|
990
|
+
y("div", Ne, [
|
|
991
|
+
y("span", Ue, J(c.name), 1),
|
|
992
|
+
y("span", Ye, " [" + J(((v = c.limit) == null ? void 0 : v.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + J(((I = c.limit) == null ? void 0 : I.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
|
|
993
993
|
]),
|
|
994
|
-
y("span",
|
|
994
|
+
y("span", Ve, J(c.type), 1)
|
|
995
995
|
]),
|
|
996
|
-
c.type === "revolute" || c.type === "prismatic" ? (Z(), B("div",
|
|
997
|
-
y("div",
|
|
996
|
+
c.type === "revolute" || c.type === "prismatic" ? (Z(), B("div", He, [
|
|
997
|
+
y("div", Ke, [
|
|
998
998
|
y("input", {
|
|
999
999
|
type: "range",
|
|
1000
1000
|
min: ((W = c.limit) == null ? void 0 : W.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
|
|
1001
1001
|
max: ((q = c.limit) == null ? void 0 : q.upper) ?? (c.type === "revolute" ? Math.PI : 1),
|
|
1002
1002
|
step: 0.01,
|
|
1003
1003
|
value: c.currentValue,
|
|
1004
|
-
onInput: (
|
|
1004
|
+
onInput: (_t) => _(c.name, _t.target.value),
|
|
1005
1005
|
class: "joint-slider",
|
|
1006
1006
|
disabled: u.value && !f.value
|
|
1007
|
-
}, null, 40,
|
|
1007
|
+
}, null, 40, Ze)
|
|
1008
1008
|
]),
|
|
1009
|
-
y("div",
|
|
1010
|
-
y("span", $
|
|
1011
|
-
y("span",
|
|
1009
|
+
y("div", Be, [
|
|
1010
|
+
y("span", $e, J(c.currentValue.toFixed(3)), 1),
|
|
1011
|
+
y("span", Xe, J(c.type === "revolute" ? "rad" : "m"), 1)
|
|
1012
1012
|
])
|
|
1013
|
-
])) :
|
|
1013
|
+
])) : ut("", !0)
|
|
1014
1014
|
]);
|
|
1015
1015
|
}), 128))
|
|
1016
|
-
])) : (Z(), B("div",
|
|
1016
|
+
])) : (Z(), B("div", Je, g[0] || (g[0] = [
|
|
1017
1017
|
y("p", null, "未检测到可控制的关节", -1)
|
|
1018
1018
|
])))
|
|
1019
1019
|
]));
|
|
1020
1020
|
}
|
|
1021
|
-
},
|
|
1021
|
+
}, qe = /* @__PURE__ */ ft(We, [["__scopeId", "data-v-007cd1b2"]]), Qe = ["xlink:href"], ts = /* @__PURE__ */ Xt({
|
|
1022
1022
|
__name: "svgIcon",
|
|
1023
1023
|
props: {
|
|
1024
1024
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1029,12 +1029,12 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1029
1029
|
active: { type: Boolean, default: !1 }
|
|
1030
1030
|
},
|
|
1031
1031
|
setup(o) {
|
|
1032
|
-
const
|
|
1032
|
+
const t = o, e = st(
|
|
1033
1033
|
() => ({
|
|
1034
|
-
backgroundColor:
|
|
1034
|
+
backgroundColor: t.backgroundColor
|
|
1035
1035
|
})
|
|
1036
|
-
), i =
|
|
1037
|
-
const { size: u } =
|
|
1036
|
+
), i = st(() => `#${t.prefix}-${t.name}`), n = st(() => {
|
|
1037
|
+
const { size: u } = t;
|
|
1038
1038
|
let f = `${u}`;
|
|
1039
1039
|
return f = `${f.replace("px", "")}px`, {
|
|
1040
1040
|
width: f,
|
|
@@ -1042,19 +1042,19 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1042
1042
|
};
|
|
1043
1043
|
});
|
|
1044
1044
|
return (u, f) => (Z(), B("div", {
|
|
1045
|
-
class:
|
|
1046
|
-
style:
|
|
1045
|
+
class: Ct(["container", { active: u.active }]),
|
|
1046
|
+
style: Tt(e.value)
|
|
1047
1047
|
}, [
|
|
1048
1048
|
(Z(), B("svg", {
|
|
1049
|
-
class:
|
|
1050
|
-
style:
|
|
1049
|
+
class: Ct(["svg-icon", [u.$attrs.class, u.spin && "svg-icon-spin"]]),
|
|
1050
|
+
style: Tt(n.value),
|
|
1051
1051
|
"aria-hidden": "true"
|
|
1052
1052
|
}, [
|
|
1053
|
-
y("use", { "xlink:href": i.value }, null, 8,
|
|
1053
|
+
y("use", { "xlink:href": i.value }, null, 8, Qe)
|
|
1054
1054
|
], 6))
|
|
1055
1055
|
], 6));
|
|
1056
1056
|
}
|
|
1057
|
-
}), z = /* @__PURE__ */
|
|
1057
|
+
}), z = /* @__PURE__ */ ft(ts, [["__scopeId", "data-v-3150a90b"]]), es = { class: "obj-viewer-container" }, ss = { class: "buttonGroup-top" }, is = { class: "buttonGroup-topLeft" }, os = { class: "buttonGroup-left" }, ns = { class: "buttonGroup-right" }, as = { class: "buttonGroup-bottom" }, ls = { class: "left-panel" }, rs = { class: "panel-header" }, hs = {
|
|
1058
1058
|
key: 1,
|
|
1059
1059
|
class: "clipping-content"
|
|
1060
1060
|
}, cs = { class: "radio-group" }, us = { class: "radio-label" }, ps = { class: "radio-label" }, ds = { class: "radio-label" }, ms = { class: "radio-label" }, fs = { class: "right-panel" }, _s = { class: "panel-header" }, gs = {
|
|
@@ -1069,12 +1069,12 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
},
|
|
1071
1071
|
emits: ["getAnimationData"],
|
|
1072
|
-
setup(o, { expose:
|
|
1073
|
-
const i =
|
|
1072
|
+
setup(o, { expose: t, emit: e }) {
|
|
1073
|
+
const i = e, n = o;
|
|
1074
1074
|
let u = null, f = !1;
|
|
1075
1075
|
const a = T(null), P = T(!1), M = T("");
|
|
1076
1076
|
T(!1);
|
|
1077
|
-
const C = T(!1),
|
|
1077
|
+
const C = T(!1), U = T(!1), A = T(""), h = T(!1), S = T(""), _ = T(), {
|
|
1078
1078
|
currentModels: s,
|
|
1079
1079
|
initialCameraPosition: p,
|
|
1080
1080
|
initialTargetPosition: b,
|
|
@@ -1084,65 +1084,65 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1084
1084
|
getThreeJSObjects: O,
|
|
1085
1085
|
clearAllModels: V,
|
|
1086
1086
|
cleanup: d
|
|
1087
|
-
} =
|
|
1087
|
+
} = Se(a), { isAnimating: l, toggleAnimation: E, stopAnimation: H } = ke(O, s), { isClipping: r, activeClippingAxis: g, toggleClipping: c, updateClippingPlanes: v } = Ae(
|
|
1088
1088
|
O,
|
|
1089
1089
|
s
|
|
1090
|
-
), { addModelsFromUrls: I, loadModelByDefaultPath: W, urdfModel: q } =
|
|
1090
|
+
), { addModelsFromUrls: I, loadModelByDefaultPath: W, urdfModel: q } = me(
|
|
1091
1091
|
O,
|
|
1092
1092
|
s,
|
|
1093
1093
|
P,
|
|
1094
1094
|
M,
|
|
1095
1095
|
V
|
|
1096
|
-
),
|
|
1096
|
+
), _t = () => {
|
|
1097
1097
|
if (C.value || s.value.length === 0) return;
|
|
1098
1098
|
C.value = !0, l.value && H();
|
|
1099
1099
|
const { camera: L, controls: m } = O();
|
|
1100
1100
|
if (!L || !m) return;
|
|
1101
1101
|
m.enabled = !0;
|
|
1102
|
-
const X = (Q) => Q < 0.5 ? 4 * Q * Q * Q : 1 - Math.pow(-2 * Q + 2, 3) / 2,
|
|
1103
|
-
const Q = Date.now() -
|
|
1104
|
-
L.position.lerpVectors(
|
|
1102
|
+
const X = (Q) => Q < 0.5 ? 4 * Q * Q * Q : 1 - Math.pow(-2 * Q + 2, 3) / 2, ot = L.position.clone(), nt = m.target.clone(), at = 1500, lt = Date.now(), k = () => {
|
|
1103
|
+
const Q = Date.now() - lt, xt = Math.min(Q / at, 1), Dt = X(xt);
|
|
1104
|
+
L.position.lerpVectors(ot, p.value, Dt), m.target.lerpVectors(nt, b.value, Dt), xt < 1 ? requestAnimationFrame(k) : C.value = !1;
|
|
1105
1105
|
};
|
|
1106
1106
|
k();
|
|
1107
|
-
},
|
|
1107
|
+
}, Ut = async () => f ? Promise.resolve() : new Promise((L) => {
|
|
1108
1108
|
const m = () => {
|
|
1109
1109
|
f ? L() : requestAnimationFrame(m);
|
|
1110
1110
|
};
|
|
1111
1111
|
m();
|
|
1112
|
-
}),
|
|
1112
|
+
}), Et = async (L, m) => {
|
|
1113
1113
|
try {
|
|
1114
|
-
await
|
|
1114
|
+
await Ut(), l.value && H(), r.value && c();
|
|
1115
1115
|
const X = await m(L);
|
|
1116
1116
|
return F(), X;
|
|
1117
1117
|
} catch (X) {
|
|
1118
1118
|
throw console.error("加载模型失败:", X), X;
|
|
1119
1119
|
}
|
|
1120
|
-
},
|
|
1121
|
-
|
|
1122
|
-
},
|
|
1120
|
+
}, Yt = async (L) => Et(L, I), Vt = async (L) => Et(L, W), it = (L) => {
|
|
1121
|
+
U.value = !0, A.value = L, L === "剖面视图" && !r.value && c();
|
|
1122
|
+
}, Ht = (L) => {
|
|
1123
1123
|
h.value = !0, S.value = L;
|
|
1124
|
-
},
|
|
1125
|
-
i("getAnimationData"),
|
|
1124
|
+
}, Kt = () => {
|
|
1125
|
+
i("getAnimationData"), St(() => {
|
|
1126
1126
|
var L;
|
|
1127
1127
|
(L = _.value) == null || L.startAnimation();
|
|
1128
1128
|
});
|
|
1129
1129
|
};
|
|
1130
|
-
return
|
|
1131
|
-
await
|
|
1130
|
+
return It(async () => {
|
|
1131
|
+
await St();
|
|
1132
1132
|
try {
|
|
1133
1133
|
R(), u = O().scene, f = !0, window.addEventListener("resize", Y);
|
|
1134
1134
|
} catch (L) {
|
|
1135
1135
|
console.error("Three.js初始化失败:", L);
|
|
1136
1136
|
}
|
|
1137
|
-
}),
|
|
1137
|
+
}), Jt(() => {
|
|
1138
1138
|
f = !1, A.value = "", S.value = "", window.removeEventListener("resize", Y), l.value && H(), d();
|
|
1139
|
-
}),
|
|
1140
|
-
addModelsFromUrls:
|
|
1141
|
-
loadModelByDefaultPath:
|
|
1139
|
+
}), t({
|
|
1140
|
+
addModelsFromUrls: Yt,
|
|
1141
|
+
loadModelByDefaultPath: Vt
|
|
1142
1142
|
}), (L, m) => {
|
|
1143
|
-
var
|
|
1144
|
-
const X =
|
|
1145
|
-
return Z(), B("div",
|
|
1143
|
+
var ot, nt, at, lt;
|
|
1144
|
+
const X = jt("el-scrollbar");
|
|
1145
|
+
return Z(), B("div", es, [
|
|
1146
1146
|
y("div", {
|
|
1147
1147
|
ref_key: "threejsContainer",
|
|
1148
1148
|
ref: a,
|
|
@@ -1174,7 +1174,7 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1174
1174
|
x(z, {
|
|
1175
1175
|
name: "viewReset",
|
|
1176
1176
|
size: "24",
|
|
1177
|
-
onClick:
|
|
1177
|
+
onClick: _t,
|
|
1178
1178
|
title: "重置"
|
|
1179
1179
|
}),
|
|
1180
1180
|
x(z, {
|
|
@@ -1190,34 +1190,34 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1190
1190
|
x(z, {
|
|
1191
1191
|
name: "lookAround",
|
|
1192
1192
|
size: "24",
|
|
1193
|
-
onClick:
|
|
1194
|
-
title:
|
|
1193
|
+
onClick: N(E),
|
|
1194
|
+
title: N(l) ? "停止动画" : "动画视图"
|
|
1195
1195
|
}, null, 8, ["onClick", "title"])
|
|
1196
1196
|
]),
|
|
1197
1197
|
y("div", os, [
|
|
1198
1198
|
x(z, {
|
|
1199
1199
|
name: "jiegoushu",
|
|
1200
1200
|
size: "24",
|
|
1201
|
-
onClick: m[0] || (m[0] = (k) =>
|
|
1202
|
-
active:
|
|
1201
|
+
onClick: m[0] || (m[0] = (k) => it("场景树")),
|
|
1202
|
+
active: U.value && A.value === "场景树",
|
|
1203
1203
|
title: "场景树"
|
|
1204
1204
|
}, null, 8, ["active"]),
|
|
1205
1205
|
x(z, {
|
|
1206
1206
|
name: "clipping",
|
|
1207
1207
|
size: "24",
|
|
1208
|
-
onClick: m[1] || (m[1] = (k) =>
|
|
1209
|
-
active:
|
|
1208
|
+
onClick: m[1] || (m[1] = (k) => it("剖面视图")),
|
|
1209
|
+
active: U.value && A.value === "剖面视图",
|
|
1210
1210
|
title: "剖面视图"
|
|
1211
1211
|
}, null, 8, ["active"]),
|
|
1212
1212
|
x(z, {
|
|
1213
1213
|
name: "donghuafangzhen",
|
|
1214
1214
|
size: "24",
|
|
1215
|
-
onClick: m[2] || (m[2] = (k) =>
|
|
1215
|
+
onClick: m[2] || (m[2] = (k) => it("场景树3"))
|
|
1216
1216
|
}),
|
|
1217
1217
|
x(z, {
|
|
1218
1218
|
name: "donghuafangzhen",
|
|
1219
1219
|
size: "24",
|
|
1220
|
-
onClick: m[3] || (m[3] = (k) =>
|
|
1220
|
+
onClick: m[3] || (m[3] = (k) => it("场景4"))
|
|
1221
1221
|
})
|
|
1222
1222
|
]),
|
|
1223
1223
|
y("div", ns, [
|
|
@@ -1232,7 +1232,7 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1232
1232
|
x(z, {
|
|
1233
1233
|
name: "guanjiekongzhi",
|
|
1234
1234
|
size: "24",
|
|
1235
|
-
onClick: m[4] || (m[4] = (k) =>
|
|
1235
|
+
onClick: m[4] || (m[4] = (k) => Ht("关节控制")),
|
|
1236
1236
|
active: h.value && S.value === "关节控制",
|
|
1237
1237
|
title: "关节控制"
|
|
1238
1238
|
}, null, 8, ["active"]),
|
|
@@ -1255,110 +1255,110 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1255
1255
|
size: "24",
|
|
1256
1256
|
backgroundColor: "#ffffff",
|
|
1257
1257
|
title: "快退",
|
|
1258
|
-
onClick: (
|
|
1258
|
+
onClick: (ot = _.value) == null ? void 0 : ot.fastBackward
|
|
1259
1259
|
}, null, 8, ["onClick"]),
|
|
1260
1260
|
x(z, {
|
|
1261
1261
|
name: "bofang",
|
|
1262
1262
|
size: "24",
|
|
1263
1263
|
backgroundColor: "#ffffff",
|
|
1264
1264
|
title: "播放",
|
|
1265
|
-
onClick:
|
|
1265
|
+
onClick: Kt
|
|
1266
1266
|
}),
|
|
1267
1267
|
x(z, {
|
|
1268
1268
|
name: "kuaijin",
|
|
1269
1269
|
size: "24",
|
|
1270
1270
|
backgroundColor: "#ffffff",
|
|
1271
1271
|
title: "快进",
|
|
1272
|
-
onClick: (
|
|
1272
|
+
onClick: (nt = _.value) == null ? void 0 : nt.fastForward
|
|
1273
1273
|
}, null, 8, ["onClick"]),
|
|
1274
1274
|
x(z, {
|
|
1275
1275
|
name: "zanting",
|
|
1276
1276
|
size: "24",
|
|
1277
1277
|
backgroundColor: "#ffffff",
|
|
1278
1278
|
title: "暂停",
|
|
1279
|
-
onClick: (
|
|
1279
|
+
onClick: (at = _.value) == null ? void 0 : at.pauseAnimation
|
|
1280
1280
|
}, null, 8, ["onClick"]),
|
|
1281
1281
|
x(z, {
|
|
1282
1282
|
name: "zhongzhi",
|
|
1283
1283
|
size: "24",
|
|
1284
1284
|
backgroundColor: "#ffffff",
|
|
1285
1285
|
title: "停止",
|
|
1286
|
-
onClick: (
|
|
1286
|
+
onClick: (lt = _.value) == null ? void 0 : lt.resetAll
|
|
1287
1287
|
}, null, 8, ["onClick"])
|
|
1288
1288
|
]),
|
|
1289
|
-
|
|
1289
|
+
tt(y("div", ls, [
|
|
1290
1290
|
y("div", rs, [
|
|
1291
1291
|
y("span", null, J(A.value), 1),
|
|
1292
1292
|
y("span", {
|
|
1293
1293
|
class: "close",
|
|
1294
|
-
onClick: m[5] || (m[5] = (k) =>
|
|
1294
|
+
onClick: m[5] || (m[5] = (k) => U.value = !1)
|
|
1295
1295
|
}, " X ")
|
|
1296
1296
|
]),
|
|
1297
1297
|
x(X, { "max-height": "650px" }, {
|
|
1298
|
-
default:
|
|
1299
|
-
A.value === "场景树" ? (Z(),
|
|
1298
|
+
default: kt(() => [
|
|
1299
|
+
A.value === "场景树" ? (Z(), Gt(Oe, {
|
|
1300
1300
|
key: 0,
|
|
1301
|
-
model:
|
|
1302
|
-
}, null, 8, ["model"])) :
|
|
1301
|
+
model: N(q)
|
|
1302
|
+
}, null, 8, ["model"])) : ut("", !0),
|
|
1303
1303
|
A.value === "剖面视图" ? (Z(), B("div", hs, [
|
|
1304
1304
|
y("div", cs, [
|
|
1305
1305
|
y("label", us, [
|
|
1306
|
-
|
|
1306
|
+
tt(y("input", {
|
|
1307
1307
|
type: "radio",
|
|
1308
1308
|
name: "clipping-axis",
|
|
1309
1309
|
value: "none",
|
|
1310
|
-
"onUpdate:modelValue": m[6] || (m[6] = (k) =>
|
|
1311
|
-
onChange: m[7] || (m[7] = (...k) =>
|
|
1310
|
+
"onUpdate:modelValue": m[6] || (m[6] = (k) => rt(g) ? g.value = k : null),
|
|
1311
|
+
onChange: m[7] || (m[7] = (...k) => N(v) && N(v)(...k))
|
|
1312
1312
|
}, null, 544), [
|
|
1313
|
-
[
|
|
1313
|
+
[ht, N(g)]
|
|
1314
1314
|
]),
|
|
1315
1315
|
m[15] || (m[15] = y("span", { class: "radio-text" }, "无切割", -1))
|
|
1316
1316
|
]),
|
|
1317
1317
|
y("label", ps, [
|
|
1318
|
-
|
|
1318
|
+
tt(y("input", {
|
|
1319
1319
|
type: "radio",
|
|
1320
1320
|
name: "clipping-axis",
|
|
1321
1321
|
value: "x",
|
|
1322
|
-
"onUpdate:modelValue": m[8] || (m[8] = (k) =>
|
|
1323
|
-
onChange: m[9] || (m[9] = (...k) =>
|
|
1322
|
+
"onUpdate:modelValue": m[8] || (m[8] = (k) => rt(g) ? g.value = k : null),
|
|
1323
|
+
onChange: m[9] || (m[9] = (...k) => N(v) && N(v)(...k))
|
|
1324
1324
|
}, null, 544), [
|
|
1325
|
-
[
|
|
1325
|
+
[ht, N(g)]
|
|
1326
1326
|
]),
|
|
1327
1327
|
m[16] || (m[16] = y("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1328
1328
|
]),
|
|
1329
1329
|
y("label", ds, [
|
|
1330
|
-
|
|
1330
|
+
tt(y("input", {
|
|
1331
1331
|
type: "radio",
|
|
1332
1332
|
name: "clipping-axis",
|
|
1333
1333
|
value: "y",
|
|
1334
|
-
"onUpdate:modelValue": m[10] || (m[10] = (k) =>
|
|
1335
|
-
onChange: m[11] || (m[11] = (...k) =>
|
|
1334
|
+
"onUpdate:modelValue": m[10] || (m[10] = (k) => rt(g) ? g.value = k : null),
|
|
1335
|
+
onChange: m[11] || (m[11] = (...k) => N(v) && N(v)(...k))
|
|
1336
1336
|
}, null, 544), [
|
|
1337
|
-
[
|
|
1337
|
+
[ht, N(g)]
|
|
1338
1338
|
]),
|
|
1339
1339
|
m[17] || (m[17] = y("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1340
1340
|
]),
|
|
1341
1341
|
y("label", ms, [
|
|
1342
|
-
|
|
1342
|
+
tt(y("input", {
|
|
1343
1343
|
type: "radio",
|
|
1344
1344
|
name: "clipping-axis",
|
|
1345
1345
|
value: "z",
|
|
1346
|
-
"onUpdate:modelValue": m[12] || (m[12] = (k) =>
|
|
1347
|
-
onChange: m[13] || (m[13] = (...k) =>
|
|
1346
|
+
"onUpdate:modelValue": m[12] || (m[12] = (k) => rt(g) ? g.value = k : null),
|
|
1347
|
+
onChange: m[13] || (m[13] = (...k) => N(v) && N(v)(...k))
|
|
1348
1348
|
}, null, 544), [
|
|
1349
|
-
[
|
|
1349
|
+
[ht, N(g)]
|
|
1350
1350
|
]),
|
|
1351
1351
|
m[18] || (m[18] = y("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1352
1352
|
])
|
|
1353
1353
|
])
|
|
1354
|
-
])) :
|
|
1354
|
+
])) : ut("", !0)
|
|
1355
1355
|
]),
|
|
1356
1356
|
_: 1
|
|
1357
1357
|
})
|
|
1358
1358
|
], 512), [
|
|
1359
|
-
[
|
|
1359
|
+
[gt, U.value]
|
|
1360
1360
|
]),
|
|
1361
|
-
|
|
1361
|
+
tt(y("div", fs, [
|
|
1362
1362
|
y("div", _s, [
|
|
1363
1363
|
y("span", null, J(S.value), 1),
|
|
1364
1364
|
y("span", {
|
|
@@ -1367,30 +1367,30 @@ const zt = { class: "panel-content" }, Rt = "id", Lt = {
|
|
|
1367
1367
|
}, " X ")
|
|
1368
1368
|
]),
|
|
1369
1369
|
x(X, { "max-height": "650px" }, {
|
|
1370
|
-
default:
|
|
1371
|
-
|
|
1370
|
+
default: kt(() => [
|
|
1371
|
+
tt(x(qe, {
|
|
1372
1372
|
ref_key: "jointRef",
|
|
1373
1373
|
ref: _,
|
|
1374
|
-
model:
|
|
1375
|
-
scene:
|
|
1374
|
+
model: N(q),
|
|
1375
|
+
scene: N(u),
|
|
1376
1376
|
animationData: n == null ? void 0 : n.animationData
|
|
1377
1377
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1378
|
-
[
|
|
1378
|
+
[gt, S.value === "关节控制"]
|
|
1379
1379
|
])
|
|
1380
1380
|
]),
|
|
1381
1381
|
_: 1
|
|
1382
1382
|
})
|
|
1383
1383
|
], 512), [
|
|
1384
|
-
[
|
|
1384
|
+
[gt, h.value]
|
|
1385
1385
|
]),
|
|
1386
1386
|
P.value ? (Z(), B("div", gs, [
|
|
1387
1387
|
m[19] || (m[19] = y("div", { class: "loading-spinner" }, null, -1)),
|
|
1388
1388
|
y("p", null, J(M.value), 1)
|
|
1389
|
-
])) :
|
|
1389
|
+
])) : ut("", !0)
|
|
1390
1390
|
]);
|
|
1391
1391
|
};
|
|
1392
1392
|
}
|
|
1393
|
-
}, Ps = /* @__PURE__ */
|
|
1393
|
+
}, Ps = /* @__PURE__ */ ft(ys, [["__scopeId", "data-v-fa07a7ad"]]);
|
|
1394
1394
|
export {
|
|
1395
1395
|
Ps as default
|
|
1396
1396
|
};
|