ss-component-new 1.1.554 → 1.1.556
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-DnU4tt9j.js → index-A9vxRWRJ.js} +1 -1
- package/dist/{index-BIqrhoc3.js → index-B0KEc4se.js} +3 -3
- package/dist/{index-BXuzdNd8.js → index-B0zewoKU.js} +1 -1
- package/dist/{index-DGtegmw2.cjs → index-B4sdpTyS.cjs} +1 -1
- package/dist/{index-DGA3OWJM.js → index-B8H4YhbP.js} +5 -6
- package/dist/{index-BG1OEOyl.js → index-BBU7IP4E.js} +1 -1
- package/dist/{index-D6aOs9h0.cjs → index-BGxaEDzd.cjs} +1 -1
- package/dist/{threeModel.vue_vue_type_style_index_0_scoped_14112288_lang-BV7oq1Z4.js → index-BRSajVMs.js} +10989 -9490
- package/dist/{index-CTL7xS-L.js → index-BbArPHI_.js} +3 -3
- package/dist/{index-B5DP9GHv.js → index-BjpzOnQV.js} +77 -78
- package/dist/{index-j0138X4A.js → index-C0fQaxj0.js} +10 -11
- package/dist/index-CQ4Fra8B.cjs +1 -0
- package/dist/{index-CYj1gF5q.cjs → index-CQUG7LOj.cjs} +1 -1
- package/dist/{index-CUmF1cOi.cjs → index-Cc936HCy.cjs} +1 -1
- package/dist/{index-BT2f4FLq.js → index-CrHUNEBr.js} +2 -2
- package/dist/index-CxnxDX6H.cjs +15 -0
- package/dist/index-DGYkSeKR.cjs +1 -0
- package/dist/{index-gBugMNnB.js → index-DKfJ4aOY.js} +1 -1
- package/dist/{index-CsCuCAbN.js → index-DN3mTV37.js} +1 -1
- package/dist/{index-BWR-wioX.js → index-DOcT5e2z.js} +1 -1
- package/dist/{index-D6OLOdzT.cjs → index-DdBP0Wqm.cjs} +1 -1
- package/dist/{index-B3OgUMxZ.cjs → index-DdvfxWm4.cjs} +1 -1
- package/dist/{index-Ca4GQBZm.cjs → index-DgovG-d1.cjs} +1 -1
- package/dist/{index-BvsQ93Dk.cjs → index-Dh1bXLMt.cjs} +1 -1
- package/dist/{index-BxnDBGDC.cjs → index-Dh_dKOHK.cjs} +1 -1
- package/dist/{index-w-MJfuW8.cjs → index-DiVZz6Oe.cjs} +1 -1
- package/dist/index-DsIoySp6.cjs +1 -0
- package/dist/index-DtFsiCW3.cjs +4207 -0
- package/dist/{index-DNmz0vZR.js → index-F0D-IvSv.js} +2 -2
- package/dist/{index-BsItO9KY.cjs → index-PZTeRkmZ.cjs} +1 -1
- package/dist/{index-CpsSJGyI.js → index-VTSBaqt5.js} +1 -1
- package/dist/{index-CcbZfGsJ.js → index-ffDSB4Kw.js} +1239 -1212
- package/dist/{index.vue_vue_type_style_index_0_scoped_d65464db_lang-CfknFSZO.js → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-BMrXZat4.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_d65464db_lang-CMsstxHC.cjs → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-CyuSo2v_.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_d888ede3_lang-bRTgUmAd.js → index.vue_vue_type_style_index_0_scoped_d888ede3_lang-Bst45l6S.js} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_d888ede3_lang-BlwV7pHr.cjs → index.vue_vue_type_style_index_0_scoped_d888ede3_lang-SrVKwnka.cjs} +1 -1
- package/dist/{main-BwaV15pa.js → main-DqytzL3P.js} +2 -2
- package/dist/{main-BKy8Vv3Z.cjs → main-v-FR4zPs.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/threeModel-CmuTBluh.cjs +1 -0
- package/dist/{threeModel-BJjMjU46.js → threeModel-WrnyyU3X.js} +299 -288
- package/package.json +1 -1
- package/dist/index-C2UyEyuW.cjs +0 -1
- package/dist/index-C8DwyrtS.cjs +0 -1
- package/dist/index-CFs5XhDB.cjs +0 -15
- package/dist/index-CZ6afBwK.cjs +0 -1
- package/dist/index-CiZ2YAhq.js +0 -1506
- package/dist/index-Csb_gyiA.cjs +0 -1
- package/dist/index-NzNwF1Bc.cjs +0 -1
- package/dist/index-nuI9V5ye.js +0 -31
- package/dist/threeModel-CMXrjPQi.cjs +0 -1
- package/dist/threeModel.vue_vue_type_style_index_0_scoped_14112288_lang-DCn4bomb.cjs +0 -4207
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ref as x, watch as _t, createElementBlock as
|
|
2
|
-
import { C as qt, V as
|
|
3
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BPJ7Cu30.js";
|
|
4
|
-
import "./index-BHtNKL1L.js";
|
|
1
|
+
import { ref as x, watch as _t, createElementBlock as $, openBlock as H, createBlock as It, computed as it, resolveComponent as Ft, createVNode as D, onMounted as Nt, onUnmounted as Bt, Fragment as Xt, renderList as Jt, createElementVNode as y, createCommentVNode as dt, toDisplayString as J, defineComponent as Gt, normalizeStyle as Ct, normalizeClass as St, nextTick as kt, onBeforeUnmount as Wt, withDirectives as G, unref as N, withCtx as At, isRef as ht, vModelRadio as ct, vShow as ut } from "vue";
|
|
2
|
+
import { C as qt, V as P, M as W, T as et, Q as zt, D as Ot, E as B, R as Qt, P as mt, F as te, G as gt, H as ee, J as ie, K as se, W as oe, L as ae, N as ne, O as le, X as re, U as he, Y as ft, Z as ce, _ as Ut, $ as ue, a0 as vt, a1 as pe, a2 as Rt, a3 as de, a4 as me, a5 as bt, B as fe, a6 as _e } from "./index-BRSajVMs.js";
|
|
5
3
|
import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import { c as
|
|
7
|
-
const Lt = { type: "change" }, Mt = { type: "start" },
|
|
4
|
+
import { c as Yt } from "./menu-DV47UKJo.js";
|
|
5
|
+
const Lt = { type: "change" }, Mt = { type: "start" }, Vt = { type: "end" }, pt = new Qt(), jt = new mt(), ge = Math.cos(70 * te.DEG2RAD), j = new P(), K = 2 * Math.PI, T = {
|
|
8
6
|
NONE: -1,
|
|
9
7
|
ROTATE: 0,
|
|
10
8
|
DOLLY: 1,
|
|
@@ -14,7 +12,7 @@ const Lt = { type: "change" }, Mt = { type: "start" }, Yt = { type: "end" }, pt
|
|
|
14
12
|
TOUCH_DOLLY_PAN: 5,
|
|
15
13
|
TOUCH_DOLLY_ROTATE: 6
|
|
16
14
|
}, wt = 1e-6;
|
|
17
|
-
class
|
|
15
|
+
class ye extends qt {
|
|
18
16
|
/**
|
|
19
17
|
* Constructs a new controls instance.
|
|
20
18
|
*
|
|
@@ -22,7 +20,7 @@ class ge extends qt {
|
|
|
22
20
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
23
21
|
*/
|
|
24
22
|
constructor(t, e = null) {
|
|
25
|
-
super(t, e), this.state = T.NONE, this.target = new
|
|
23
|
+
super(t, e), this.state = T.NONE, this.target = new P(), this.cursor = new P(), 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: W.ROTATE, MIDDLE: W.DOLLY, RIGHT: W.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 P(), this._lastQuaternion = new zt(), this._lastTargetPosition = new P(), this._quat = new zt().setFromUnitVectors(t.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ot(), this._sphericalDelta = new Ot(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new B(), this._rotateEnd = new B(), this._rotateDelta = new B(), this._panStart = new B(), this._panEnd = new B(), this._panDelta = new B(), this._dollyStart = new B(), this._dollyEnd = new B(), this._dollyDelta = new B(), this._dollyDirection = new P(), this._mouse = new B(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = be.bind(this), this._onPointerDown = ve.bind(this), this._onPointerUp = we.bind(this), this._onContextMenu = Ce.bind(this), this._onMouseWheel = Ee.bind(this), this._onKeyDown = De.bind(this), this._onTouchStart = xe.bind(this), this._onTouchMove = Te.bind(this), this._onMouseDown = Pe.bind(this), this._onMouseMove = Me.bind(this), this._interceptControlDown = Se.bind(this), this._interceptControlUp = ke.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
26
24
|
}
|
|
27
25
|
connect(t) {
|
|
28
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";
|
|
@@ -88,40 +86,40 @@ class ge extends qt {
|
|
|
88
86
|
update(t = null) {
|
|
89
87
|
const e = this.object.position;
|
|
90
88
|
j.copy(e).sub(this.target), j.applyQuaternion(this._quat), this._spherical.setFromVector3(j), this.autoRotate && this.state === T.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);
|
|
91
|
-
let s = this.minAzimuthAngle,
|
|
92
|
-
isFinite(s) && isFinite(
|
|
89
|
+
let s = this.minAzimuthAngle, a = this.maxAzimuthAngle;
|
|
90
|
+
isFinite(s) && isFinite(a) && (s < -Math.PI ? s += K : s > Math.PI && (s -= K), a < -Math.PI ? a += K : a > Math.PI && (a -= K), s <= a ? this._spherical.theta = Math.max(s, Math.min(a, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + a) / 2 ? Math.max(s, this._spherical.theta) : Math.min(a, 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);
|
|
93
91
|
let u = !1;
|
|
94
92
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
95
93
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
96
94
|
else {
|
|
97
|
-
const
|
|
98
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), u =
|
|
95
|
+
const f = this._spherical.radius;
|
|
96
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), u = f != this._spherical.radius;
|
|
99
97
|
}
|
|
100
98
|
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) {
|
|
101
|
-
let
|
|
99
|
+
let f = null;
|
|
102
100
|
if (this.object.isPerspectiveCamera) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
101
|
+
const n = j.length();
|
|
102
|
+
f = this._clampDistance(n * this._scale);
|
|
103
|
+
const b = n - f;
|
|
104
|
+
this.object.position.addScaledVector(this._dollyDirection, b), this.object.updateMatrixWorld(), u = !!b;
|
|
107
105
|
} else if (this.object.isOrthographicCamera) {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), u =
|
|
112
|
-
const M = new
|
|
113
|
-
M.unproject(this.object), this.object.position.sub(M).add(
|
|
106
|
+
const n = new P(this._mouse.x, this._mouse.y, 0);
|
|
107
|
+
n.unproject(this.object);
|
|
108
|
+
const b = this.object.zoom;
|
|
109
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), u = b !== this.object.zoom;
|
|
110
|
+
const M = new P(this._mouse.x, this._mouse.y, 0);
|
|
111
|
+
M.unproject(this.object), this.object.position.sub(M).add(n), this.object.updateMatrixWorld(), f = j.length();
|
|
114
112
|
} else
|
|
115
113
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
116
|
-
|
|
114
|
+
f !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(f).add(this.object.position) : (pt.origin.copy(this.object.position), pt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(pt.direction)) < ge ? this.object.lookAt(this.target) : (jt.setFromNormalAndCoplanarPoint(this.object.up, this.target), pt.intersectPlane(jt, this.target))));
|
|
117
115
|
} else if (this.object.isOrthographicCamera) {
|
|
118
|
-
const
|
|
119
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
|
|
116
|
+
const f = this.object.zoom;
|
|
117
|
+
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);
|
|
120
118
|
}
|
|
121
119
|
return this._scale = 1, this._performCursorZoom = !1, u || this._lastPosition.distanceToSquared(this.object.position) > wt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > wt || this._lastTargetPosition.distanceToSquared(this.target) > wt ? (this.dispatchEvent(Lt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
122
120
|
}
|
|
123
121
|
_getAutoRotationAngle(t) {
|
|
124
|
-
return t !== null ?
|
|
122
|
+
return t !== null ? K / 60 * this.autoRotateSpeed * t : K / 60 / 60 * this.autoRotateSpeed;
|
|
125
123
|
}
|
|
126
124
|
_getZoomScale(t) {
|
|
127
125
|
const e = Math.abs(t * 0.01);
|
|
@@ -143,8 +141,8 @@ class ge extends qt {
|
|
|
143
141
|
_pan(t, e) {
|
|
144
142
|
const s = this.domElement;
|
|
145
143
|
if (this.object.isPerspectiveCamera) {
|
|
146
|
-
const
|
|
147
|
-
j.copy(
|
|
144
|
+
const a = this.object.position;
|
|
145
|
+
j.copy(a).sub(this.target);
|
|
148
146
|
let u = j.length();
|
|
149
147
|
u *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * u / s.clientHeight, this.object.matrix), this._panUp(2 * e * u / s.clientHeight, this.object.matrix);
|
|
150
148
|
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(e * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
@@ -159,8 +157,8 @@ class ge extends qt {
|
|
|
159
157
|
if (!this.zoomToCursor)
|
|
160
158
|
return;
|
|
161
159
|
this._performCursorZoom = !0;
|
|
162
|
-
const s = this.domElement.getBoundingClientRect(),
|
|
163
|
-
this._mouse.x =
|
|
160
|
+
const s = this.domElement.getBoundingClientRect(), a = t - s.left, u = e - s.top, f = s.width, n = s.height;
|
|
161
|
+
this._mouse.x = a / f * 2 - 1, this._mouse.y = -(u / n) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
164
162
|
}
|
|
165
163
|
_clampDistance(t) {
|
|
166
164
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -180,7 +178,7 @@ class ge extends qt {
|
|
|
180
178
|
_handleMouseMoveRotate(t) {
|
|
181
179
|
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
182
180
|
const e = this.domElement;
|
|
183
|
-
this._rotateLeft(
|
|
181
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
184
182
|
}
|
|
185
183
|
_handleMouseMoveDolly(t) {
|
|
186
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();
|
|
@@ -195,16 +193,16 @@ class ge extends qt {
|
|
|
195
193
|
let e = !1;
|
|
196
194
|
switch (t.code) {
|
|
197
195
|
case this.keys.UP:
|
|
198
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(
|
|
196
|
+
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
197
|
break;
|
|
200
198
|
case this.keys.BOTTOM:
|
|
201
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-
|
|
199
|
+
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;
|
|
202
200
|
break;
|
|
203
201
|
case this.keys.LEFT:
|
|
204
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(
|
|
202
|
+
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
203
|
break;
|
|
206
204
|
case this.keys.RIGHT:
|
|
207
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-
|
|
205
|
+
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;
|
|
208
206
|
break;
|
|
209
207
|
}
|
|
210
208
|
e && (t.preventDefault(), this.update());
|
|
@@ -213,20 +211,20 @@ class ge extends qt {
|
|
|
213
211
|
if (this._pointers.length === 1)
|
|
214
212
|
this._rotateStart.set(t.pageX, t.pageY);
|
|
215
213
|
else {
|
|
216
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x),
|
|
217
|
-
this._rotateStart.set(s,
|
|
214
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
215
|
+
this._rotateStart.set(s, a);
|
|
218
216
|
}
|
|
219
217
|
}
|
|
220
218
|
_handleTouchStartPan(t) {
|
|
221
219
|
if (this._pointers.length === 1)
|
|
222
220
|
this._panStart.set(t.pageX, t.pageY);
|
|
223
221
|
else {
|
|
224
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x),
|
|
225
|
-
this._panStart.set(s,
|
|
222
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
223
|
+
this._panStart.set(s, a);
|
|
226
224
|
}
|
|
227
225
|
}
|
|
228
226
|
_handleTouchStartDolly(t) {
|
|
229
|
-
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x,
|
|
227
|
+
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, u = Math.sqrt(s * s + a * a);
|
|
230
228
|
this._dollyStart.set(0, u);
|
|
231
229
|
}
|
|
232
230
|
_handleTouchStartDollyPan(t) {
|
|
@@ -239,27 +237,27 @@ class ge extends qt {
|
|
|
239
237
|
if (this._pointers.length == 1)
|
|
240
238
|
this._rotateEnd.set(t.pageX, t.pageY);
|
|
241
239
|
else {
|
|
242
|
-
const s = this._getSecondPointerPosition(t),
|
|
243
|
-
this._rotateEnd.set(
|
|
240
|
+
const s = this._getSecondPointerPosition(t), a = 0.5 * (t.pageX + s.x), u = 0.5 * (t.pageY + s.y);
|
|
241
|
+
this._rotateEnd.set(a, u);
|
|
244
242
|
}
|
|
245
243
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
246
244
|
const e = this.domElement;
|
|
247
|
-
this._rotateLeft(
|
|
245
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
248
246
|
}
|
|
249
247
|
_handleTouchMovePan(t) {
|
|
250
248
|
if (this._pointers.length === 1)
|
|
251
249
|
this._panEnd.set(t.pageX, t.pageY);
|
|
252
250
|
else {
|
|
253
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x),
|
|
254
|
-
this._panEnd.set(s,
|
|
251
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
252
|
+
this._panEnd.set(s, a);
|
|
255
253
|
}
|
|
256
254
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
257
255
|
}
|
|
258
256
|
_handleTouchMoveDolly(t) {
|
|
259
|
-
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x,
|
|
257
|
+
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, u = Math.sqrt(s * s + a * a);
|
|
260
258
|
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);
|
|
261
|
-
const
|
|
262
|
-
this._updateZoomParameters(
|
|
259
|
+
const f = (t.pageX + e.x) * 0.5, n = (t.pageY + e.y) * 0.5;
|
|
260
|
+
this._updateZoomParameters(f, n);
|
|
263
261
|
}
|
|
264
262
|
_handleTouchMoveDollyPan(t) {
|
|
265
263
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -286,7 +284,7 @@ class ge extends qt {
|
|
|
286
284
|
}
|
|
287
285
|
_trackPointer(t) {
|
|
288
286
|
let e = this._pointerPositions[t.pointerId];
|
|
289
|
-
e === void 0 && (e = new
|
|
287
|
+
e === void 0 && (e = new B(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
|
|
290
288
|
}
|
|
291
289
|
_getSecondPointerPosition(t) {
|
|
292
290
|
const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -310,16 +308,16 @@ class ge extends qt {
|
|
|
310
308
|
return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
311
309
|
}
|
|
312
310
|
}
|
|
313
|
-
function
|
|
311
|
+
function ve(o) {
|
|
314
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)));
|
|
315
313
|
}
|
|
316
|
-
function
|
|
314
|
+
function be(o) {
|
|
317
315
|
this.enabled !== !1 && (o.pointerType === "touch" ? this._onTouchMove(o) : this._onMouseMove(o));
|
|
318
316
|
}
|
|
319
|
-
function
|
|
317
|
+
function we(o) {
|
|
320
318
|
switch (this._removePointer(o), this._pointers.length) {
|
|
321
319
|
case 0:
|
|
322
|
-
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(Vt), this.state = T.NONE;
|
|
323
321
|
break;
|
|
324
322
|
case 1:
|
|
325
323
|
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
@@ -327,7 +325,7 @@ function be(o) {
|
|
|
327
325
|
break;
|
|
328
326
|
}
|
|
329
327
|
}
|
|
330
|
-
function
|
|
328
|
+
function Pe(o) {
|
|
331
329
|
let t;
|
|
332
330
|
switch (o.button) {
|
|
333
331
|
case 0:
|
|
@@ -370,7 +368,7 @@ function we(o) {
|
|
|
370
368
|
}
|
|
371
369
|
this.state !== T.NONE && this.dispatchEvent(Mt);
|
|
372
370
|
}
|
|
373
|
-
function
|
|
371
|
+
function Me(o) {
|
|
374
372
|
switch (this.state) {
|
|
375
373
|
case T.ROTATE:
|
|
376
374
|
if (this.enableRotate === !1) return;
|
|
@@ -386,13 +384,13 @@ function Pe(o) {
|
|
|
386
384
|
break;
|
|
387
385
|
}
|
|
388
386
|
}
|
|
389
|
-
function Me(o) {
|
|
390
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== T.NONE || (o.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Yt));
|
|
391
|
-
}
|
|
392
387
|
function Ee(o) {
|
|
393
|
-
this.enabled
|
|
388
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== T.NONE || (o.preventDefault(), this.dispatchEvent(Mt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Vt));
|
|
394
389
|
}
|
|
395
390
|
function De(o) {
|
|
391
|
+
this.enabled !== !1 && this._handleKeyDown(o);
|
|
392
|
+
}
|
|
393
|
+
function xe(o) {
|
|
396
394
|
switch (this._trackPointer(o), this._pointers.length) {
|
|
397
395
|
case 1:
|
|
398
396
|
switch (this.touches.ONE) {
|
|
@@ -427,7 +425,7 @@ function De(o) {
|
|
|
427
425
|
}
|
|
428
426
|
this.state !== T.NONE && this.dispatchEvent(Mt);
|
|
429
427
|
}
|
|
430
|
-
function
|
|
428
|
+
function Te(o) {
|
|
431
429
|
switch (this._trackPointer(o), this.state) {
|
|
432
430
|
case T.TOUCH_ROTATE:
|
|
433
431
|
if (this.enableRotate === !1) return;
|
|
@@ -449,29 +447,29 @@ function xe(o) {
|
|
|
449
447
|
this.state = T.NONE;
|
|
450
448
|
}
|
|
451
449
|
}
|
|
452
|
-
function
|
|
450
|
+
function Ce(o) {
|
|
453
451
|
this.enabled !== !1 && o.preventDefault();
|
|
454
452
|
}
|
|
455
|
-
function
|
|
453
|
+
function Se(o) {
|
|
456
454
|
o.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
457
455
|
}
|
|
458
|
-
function
|
|
456
|
+
function ke(o) {
|
|
459
457
|
o.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
460
458
|
}
|
|
461
|
-
function
|
|
462
|
-
let t = null, e = null, s = null,
|
|
463
|
-
const M = x([]), k = x(new
|
|
459
|
+
function Ae(o) {
|
|
460
|
+
let t = null, e = null, s = null, a = null, u = null, f = null, n = null, b = null;
|
|
461
|
+
const M = x([]), k = x(new P()), U = x(new P()), A = () => {
|
|
464
462
|
if (!o.value) return;
|
|
465
463
|
t = new ee(), t.background = new ie(15790320);
|
|
466
464
|
const m = o.value;
|
|
467
465
|
e = new se(75, m.clientWidth / m.clientHeight, 0.1, 1e4), e.position.set(8, -8, 6), e.up.set(0, 0, 1), e.lookAt(0, 0, 0), s = new oe({
|
|
468
466
|
antialias: !0,
|
|
469
467
|
alpha: !0
|
|
470
|
-
}), s.setSize(m.clientWidth, m.clientHeight), s.localClippingEnabled = !0, s.shadowMap.enabled = !0, s.shadowMap.type =
|
|
468
|
+
}), s.setSize(m.clientWidth, m.clientHeight), s.localClippingEnabled = !0, s.shadowMap.enabled = !0, s.shadowMap.type = ae, s.toneMapping = ne, s.toneMappingExposure = 1, s.outputColorSpace = le, m.appendChild(s.domElement), a = new ye(e, s.domElement), a.enableDamping = !0, a.dampingFactor = 0.05, a.mouseButtons = {
|
|
471
469
|
LEFT: W.ROTATE,
|
|
472
470
|
MIDDLE: W.PAN,
|
|
473
471
|
RIGHT: null
|
|
474
|
-
},
|
|
472
|
+
}, a.panSpeed = 0.7, u = new re(e, s, {
|
|
475
473
|
container: m,
|
|
476
474
|
type: "cube",
|
|
477
475
|
placement: "top-right",
|
|
@@ -501,17 +499,17 @@ function ke(o) {
|
|
|
501
499
|
back: {
|
|
502
500
|
label: "Bottom"
|
|
503
501
|
}
|
|
504
|
-
}), u.attachControls(
|
|
502
|
+
}), u.attachControls(a), g(), i();
|
|
505
503
|
}, r = (m, l) => {
|
|
506
|
-
|
|
504
|
+
n && (t.remove(n), n.dispose()), b && (t.remove(b), b.geometry.dispose(), b.material.dispose());
|
|
507
505
|
const E = Math.min(Math.max(Math.floor(m / 20), 30), 40);
|
|
508
|
-
|
|
509
|
-
const
|
|
506
|
+
n = new he(m, E, 13421772, 14540253), n.rotateX(Math.PI / 2), n.position.copy(l), t.add(n);
|
|
507
|
+
const Z = new ft(m, m), c = new ce({
|
|
510
508
|
opacity: 0.3,
|
|
511
509
|
// 阴影透明度
|
|
512
510
|
color: 0
|
|
513
511
|
});
|
|
514
|
-
|
|
512
|
+
b = new Ut(Z, c), b.position.copy(l), b.position.z -= 0.01, b.receiveShadow = !0, t.add(b);
|
|
515
513
|
}, C = () => {
|
|
516
514
|
if (M.value.length === 0)
|
|
517
515
|
return;
|
|
@@ -519,13 +517,13 @@ function ke(o) {
|
|
|
519
517
|
M.value.forEach((h) => {
|
|
520
518
|
m.expandByObject(h);
|
|
521
519
|
});
|
|
522
|
-
const l = m.getSize(new
|
|
520
|
+
const l = m.getSize(new P()), E = m.getCenter(new P()), Z = Math.max(l.x, l.y, l.z), c = Math.max(Z * 8, 50), _ = new P(
|
|
523
521
|
E.x,
|
|
524
522
|
E.y,
|
|
525
523
|
m.min.z
|
|
526
524
|
// 模型的最底部
|
|
527
525
|
);
|
|
528
|
-
r(c,
|
|
526
|
+
r(c, _);
|
|
529
527
|
}, g = () => {
|
|
530
528
|
const m = new ue(4210752, 0.6);
|
|
531
529
|
t.add(m);
|
|
@@ -533,16 +531,16 @@ function ke(o) {
|
|
|
533
531
|
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);
|
|
534
532
|
const E = new vt(16777215, 0.8);
|
|
535
533
|
E.position.set(-8, -8, 6), t.add(E);
|
|
536
|
-
const
|
|
537
|
-
|
|
534
|
+
const Z = new vt(16777215, 0.6);
|
|
535
|
+
Z.position.set(0, -15, 2), t.add(Z);
|
|
538
536
|
const c = new pe(16777215, 4473924, 0.8);
|
|
539
537
|
t.add(c);
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
const h = new
|
|
538
|
+
const _ = new Rt(16777215, 1, 50);
|
|
539
|
+
_.position.set(15, 15, 15), t.add(_);
|
|
540
|
+
const h = new Rt(16777215, 0.5, 50);
|
|
543
541
|
h.position.set(-15, -15, 15), t.add(h);
|
|
544
542
|
}, i = () => {
|
|
545
|
-
|
|
543
|
+
f = requestAnimationFrame(i), a && a.update(), s && t && e && s.render(t, e), u && u.render();
|
|
546
544
|
}, d = (m) => {
|
|
547
545
|
[
|
|
548
546
|
"map",
|
|
@@ -559,7 +557,7 @@ function ke(o) {
|
|
|
559
557
|
].forEach((E) => {
|
|
560
558
|
m[E] && m[E].dispose && m[E].dispose();
|
|
561
559
|
}), m.dispose && m.dispose();
|
|
562
|
-
},
|
|
560
|
+
}, w = (m) => {
|
|
563
561
|
m == null || m.traverse((l) => {
|
|
564
562
|
l.geometry && l.geometry.dispose(), l.material && (Array.isArray(l.material) ? l.material.forEach((E) => {
|
|
565
563
|
d(E);
|
|
@@ -579,53 +577,53 @@ function ke(o) {
|
|
|
579
577
|
e.aspect = l / E, e.updateProjectionMatrix(), s.setSize(l, E), u.update();
|
|
580
578
|
},
|
|
581
579
|
fitCameraToAllModels: () => {
|
|
582
|
-
if (!e || !
|
|
580
|
+
if (!e || !a || M.value.length === 0) return;
|
|
583
581
|
const m = new gt();
|
|
584
582
|
M.value.forEach((h) => {
|
|
585
583
|
m.expandByObject(h);
|
|
586
584
|
});
|
|
587
|
-
const l = m.getSize(new
|
|
588
|
-
e.position.copy(
|
|
585
|
+
const l = m.getSize(new P()), E = m.getCenter(new P()), c = Math.max(l.x, l.y, l.z) * 0.8, _ = new P(E.x + c, E.y - c, E.z + c);
|
|
586
|
+
e.position.copy(_), e.lookAt(E), a.target.copy(E), a.update(), k.value.copy(_), U.value.copy(E), C();
|
|
589
587
|
},
|
|
590
588
|
getThreeJSObjects: () => ({
|
|
591
589
|
scene: t,
|
|
592
590
|
camera: e,
|
|
593
591
|
renderer: s,
|
|
594
|
-
controls:
|
|
592
|
+
controls: a,
|
|
595
593
|
gizmo: u
|
|
596
594
|
}),
|
|
597
595
|
clearAllModels: () => {
|
|
598
596
|
if (!t) return;
|
|
599
597
|
M.value.forEach((l) => {
|
|
600
|
-
t.remove(l),
|
|
598
|
+
t.remove(l), w(l);
|
|
601
599
|
});
|
|
602
600
|
const m = [];
|
|
603
601
|
t.children.forEach((l) => {
|
|
604
|
-
!l.isLight && !l.isCamera && l.type !== "GridHelper" && l !==
|
|
602
|
+
!l.isLight && !l.isCamera && l.type !== "GridHelper" && l !== b && m.push(l);
|
|
605
603
|
}), m.forEach((l) => {
|
|
606
|
-
t.remove(l),
|
|
604
|
+
t.remove(l), w(l);
|
|
607
605
|
}), M.value = [], C();
|
|
608
606
|
},
|
|
609
607
|
cleanup: () => {
|
|
610
|
-
|
|
608
|
+
f && cancelAnimationFrame(f), n && n.dispose(), b && (b.geometry.dispose(), b.material.dispose()), s && s.dispose(), a && a.dispose(), u && u.dispose();
|
|
611
609
|
},
|
|
612
610
|
updateGridForModels: C
|
|
613
611
|
};
|
|
614
612
|
}
|
|
615
|
-
function
|
|
613
|
+
function ze(o, t) {
|
|
616
614
|
const e = x(!1);
|
|
617
|
-
let s = null,
|
|
615
|
+
let s = null, a = 12700, u = new P(), f = new P(), n = new P(), b = 0, M = null;
|
|
618
616
|
const k = (i) => i < 0.5 ? 4 * i * i * i : 1 - Math.pow(-2 * i + 2, 3) / 2, U = (i) => {
|
|
619
|
-
const d = new
|
|
617
|
+
const d = new P(), w = b * 1.2, O = new P(n.x + w, n.y, n.z), Y = new P(n.x, n.y + w, n.z), F = new P(n.x, n.y - w, n.z);
|
|
620
618
|
if (i <= 0.567) {
|
|
621
619
|
const V = i / 0.567 * Math.PI * 2;
|
|
622
|
-
d.x =
|
|
620
|
+
d.x = n.x + Math.cos(V) * w, d.z = n.z + Math.sin(V) * w, d.y = n.y;
|
|
623
621
|
} else if (i <= 0.724) {
|
|
624
622
|
const L = (i - 0.567) / 0.157, V = k(L);
|
|
625
|
-
d.lerpVectors(
|
|
623
|
+
d.lerpVectors(O, Y, V);
|
|
626
624
|
} else if (i <= 0.881) {
|
|
627
625
|
const L = (i - 0.724) / 0.157, m = k(L) * Math.PI;
|
|
628
|
-
d.x =
|
|
626
|
+
d.x = n.x + Math.sin(m) * w, d.y = n.y + Math.cos(m) * w, d.z = n.z;
|
|
629
627
|
} else {
|
|
630
628
|
const L = (i - 0.881) / 0.119, V = k(L);
|
|
631
629
|
d.lerpVectors(F, u, V);
|
|
@@ -635,35 +633,35 @@ function Ae(o, t) {
|
|
|
635
633
|
const { camera: i, controls: d } = o();
|
|
636
634
|
if (!i || !d) return;
|
|
637
635
|
s || (s = Date.now());
|
|
638
|
-
const
|
|
639
|
-
if (
|
|
636
|
+
const w = Date.now() - s, O = Math.min(w / a, 1);
|
|
637
|
+
if (O >= 1) {
|
|
640
638
|
C();
|
|
641
639
|
return;
|
|
642
640
|
}
|
|
643
|
-
const Y = U(
|
|
644
|
-
i.position.copy(Y), i.lookAt(
|
|
641
|
+
const Y = U(O);
|
|
642
|
+
i.position.copy(Y), i.lookAt(n), d.target.copy(n), M = requestAnimationFrame(A);
|
|
645
643
|
}, r = () => {
|
|
646
644
|
if (t.value.length === 0) return;
|
|
647
645
|
const { camera: i, controls: d } = o();
|
|
648
646
|
if (!i || !d) return;
|
|
649
|
-
u.copy(i.position),
|
|
650
|
-
const
|
|
647
|
+
u.copy(i.position), f.copy(d.target);
|
|
648
|
+
const w = new gt();
|
|
651
649
|
t.value.forEach((l) => {
|
|
652
|
-
|
|
650
|
+
w.expandByObject(l);
|
|
653
651
|
});
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
const Y = new
|
|
652
|
+
const O = w.getSize(new P());
|
|
653
|
+
n = w.getCenter(new P()), b = Math.max(O.x, O.y, O.z) * 1.2;
|
|
654
|
+
const Y = new P(n.x + b * 1.2, n.y, n.z);
|
|
657
655
|
d.enabled = !1;
|
|
658
656
|
const F = i.position.clone(), L = 1e3, V = Date.now(), m = () => {
|
|
659
|
-
const l = Date.now() - V, E = Math.min(l / L, 1),
|
|
660
|
-
i.position.lerpVectors(F, Y,
|
|
657
|
+
const l = Date.now() - V, E = Math.min(l / L, 1), Z = k(E);
|
|
658
|
+
i.position.lerpVectors(F, Y, Z), i.lookAt(n), d.target.copy(n), E < 1 ? requestAnimationFrame(m) : (e.value = !0, s = null, A());
|
|
661
659
|
};
|
|
662
660
|
m();
|
|
663
661
|
}, C = () => {
|
|
664
662
|
e.value = !1, s = null, M && (cancelAnimationFrame(M), M = null);
|
|
665
663
|
const { controls: i } = o();
|
|
666
|
-
i && (i.enabled = !0, i.target.copy(
|
|
664
|
+
i && (i.enabled = !0, i.target.copy(f));
|
|
667
665
|
};
|
|
668
666
|
return {
|
|
669
667
|
isAnimating: e,
|
|
@@ -673,9 +671,9 @@ function Ae(o, t) {
|
|
|
673
671
|
const { camera: i, controls: d } = o();
|
|
674
672
|
if (!i || !d) return;
|
|
675
673
|
d.enabled = !0;
|
|
676
|
-
const
|
|
674
|
+
const w = i.position.clone(), O = d.target.clone(), Y = 1500, F = Date.now(), L = () => {
|
|
677
675
|
const V = Date.now() - F, m = Math.min(V / Y, 1), l = k(m);
|
|
678
|
-
i.position.lerpVectors(
|
|
676
|
+
i.position.lerpVectors(w, u, l), d.target.lerpVectors(O, f, l), m < 1 && requestAnimationFrame(L);
|
|
679
677
|
};
|
|
680
678
|
L();
|
|
681
679
|
} else
|
|
@@ -685,45 +683,45 @@ function Ae(o, t) {
|
|
|
685
683
|
stopAnimation: C
|
|
686
684
|
};
|
|
687
685
|
}
|
|
688
|
-
function
|
|
686
|
+
function Oe(o, t) {
|
|
689
687
|
const e = x(!1), s = x("none");
|
|
690
|
-
let
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
new mt(new
|
|
688
|
+
let a = [], u = [], f = new gt(), n = new P();
|
|
689
|
+
const b = () => {
|
|
690
|
+
a = [
|
|
691
|
+
new mt(new P(1, 0, 0), 0),
|
|
694
692
|
// X轴平面
|
|
695
|
-
new mt(new
|
|
693
|
+
new mt(new P(0, 1, 0), 0),
|
|
696
694
|
// Y轴平面
|
|
697
|
-
new mt(new
|
|
695
|
+
new mt(new P(0, 0, 1), 0)
|
|
698
696
|
// Z轴平面
|
|
699
697
|
];
|
|
700
698
|
}, M = () => {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}),
|
|
699
|
+
f.makeEmpty(), t.value.forEach((g) => {
|
|
700
|
+
f.expandByObject(g);
|
|
701
|
+
}), n = f.getCenter(new P());
|
|
704
702
|
}, k = (g) => {
|
|
705
|
-
const i =
|
|
706
|
-
let d,
|
|
707
|
-
g === "x" ? (d = new ft(i.z * 1.2, i.y * 1.2),
|
|
703
|
+
const i = f.getSize(new P());
|
|
704
|
+
let d, w, O;
|
|
705
|
+
g === "x" ? (d = new ft(i.z * 1.2, i.y * 1.2), w = new P(n.x, n.y, n.z), O = new bt(0, Math.PI / 2, 0)) : g === "y" ? (d = new ft(i.x * 1.2, i.z * 1.2), w = new P(n.x, n.y, n.z), O = new bt(Math.PI / 2, 0, 0)) : g === "z" && (d = new ft(i.x * 1.2, i.y * 1.2), w = new P(n.x, n.y, n.z), O = new bt(0, 0, 0));
|
|
708
706
|
const Y = new de({
|
|
709
707
|
color: 8900331,
|
|
710
708
|
transparent: !0,
|
|
711
709
|
opacity: 0.3,
|
|
712
710
|
side: me,
|
|
713
711
|
depthWrite: !1
|
|
714
|
-
}), F = new
|
|
715
|
-
return F.position.copy(
|
|
712
|
+
}), F = new Ut(d, Y);
|
|
713
|
+
return F.position.copy(w), F.rotation.copy(O), F;
|
|
716
714
|
}, U = () => {
|
|
717
715
|
if (A(), r(), s.value === "none")
|
|
718
716
|
return;
|
|
719
717
|
M();
|
|
720
718
|
let g = null;
|
|
721
|
-
if (s.value === "x" ? (
|
|
719
|
+
if (s.value === "x" ? (a[0].constant = -n.x, g = a[0]) : s.value === "y" ? (a[1].constant = -n.y, g = a[1]) : s.value === "z" && (a[2].constant = -n.z, g = a[2]), g) {
|
|
722
720
|
t.value.forEach((d) => {
|
|
723
|
-
d.traverse((
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}) :
|
|
721
|
+
d.traverse((w) => {
|
|
722
|
+
w.isMesh && w.material && (Array.isArray(w.material) ? w.material.forEach((O) => {
|
|
723
|
+
O.clippingPlanes = [g];
|
|
724
|
+
}) : w.material.clippingPlanes = [g]);
|
|
727
725
|
});
|
|
728
726
|
});
|
|
729
727
|
const { scene: i } = o();
|
|
@@ -750,14 +748,14 @@ function ze(o, t) {
|
|
|
750
748
|
isClipping: e,
|
|
751
749
|
activeClippingAxis: s,
|
|
752
750
|
toggleClipping: () => {
|
|
753
|
-
e.value = !e.value, e.value ? (
|
|
751
|
+
e.value = !e.value, e.value ? (b(), t.value.length > 0 && M()) : (s.value = "none", A(), r());
|
|
754
752
|
},
|
|
755
753
|
updateClippingPlanes: U,
|
|
756
754
|
clearClippingPlanes: A,
|
|
757
755
|
clearClippingMeshes: r
|
|
758
756
|
};
|
|
759
757
|
}
|
|
760
|
-
const Re = { class: "panel-content" },
|
|
758
|
+
const Re = { class: "panel-content" }, Le = {
|
|
761
759
|
__name: "animationTable",
|
|
762
760
|
props: {
|
|
763
761
|
animationData: Object,
|
|
@@ -765,17 +763,30 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
765
763
|
},
|
|
766
764
|
setup(o) {
|
|
767
765
|
const t = o;
|
|
768
|
-
|
|
766
|
+
x();
|
|
767
|
+
const e = x();
|
|
768
|
+
return _t(
|
|
769
769
|
() => [t == null ? void 0 : t.animationData],
|
|
770
770
|
() => {
|
|
771
|
-
var
|
|
772
|
-
let
|
|
773
|
-
|
|
771
|
+
var a;
|
|
772
|
+
let s = ((a = Yt(t == null ? void 0 : t.animationData)) == null ? void 0 : a.动画输出Content) ?? [];
|
|
773
|
+
s && s.length > 0 && (e.value = s);
|
|
774
774
|
},
|
|
775
775
|
{ deep: !0, immediate: !0 }
|
|
776
|
-
), (
|
|
776
|
+
), (s, a) => {
|
|
777
|
+
var u, f, n, b;
|
|
778
|
+
return H(), $("div", Re, [
|
|
779
|
+
(H(), It(fe, {
|
|
780
|
+
compName: e.value.name,
|
|
781
|
+
itemData: (u = e.value) == null ? void 0 : u.compData,
|
|
782
|
+
childItemData: (f = s.item) == null ? void 0 : f.itemChildData,
|
|
783
|
+
key: (n = e.value) == null ? void 0 : n.id,
|
|
784
|
+
index: (b = e.value) == null ? void 0 : b.id
|
|
785
|
+
}, null, 8, ["compName", "itemData", "childItemData", "index"]))
|
|
786
|
+
]);
|
|
787
|
+
};
|
|
777
788
|
}
|
|
778
|
-
},
|
|
789
|
+
}, je = /* @__PURE__ */ st(Le, [["__scopeId", "data-v-d400f99f"]]), Ie = { class: "panel-content" }, Fe = "id", Ne = {
|
|
779
790
|
__name: "urdfTree",
|
|
780
791
|
props: {
|
|
781
792
|
model: Object,
|
|
@@ -791,12 +802,12 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
791
802
|
},
|
|
792
803
|
emits: ["nodeClick"],
|
|
793
804
|
setup(o, { emit: t }) {
|
|
794
|
-
const e = o, s = t,
|
|
805
|
+
const e = o, s = t, a = x([]), u = {
|
|
795
806
|
children: "children",
|
|
796
807
|
label: "label"
|
|
797
|
-
},
|
|
808
|
+
}, f = (r) => {
|
|
798
809
|
s("nodeClick", r);
|
|
799
|
-
},
|
|
810
|
+
}, n = (r, C = 0) => {
|
|
800
811
|
const g = [];
|
|
801
812
|
return Array.isArray(r) && (r == null ? void 0 : r.length) > 0 && r.forEach((i) => {
|
|
802
813
|
if (!(i != null && i.isMesh) && ((i == null ? void 0 : i.type) === "URDFJoint" || (i == null ? void 0 : i.type) === "URDFLink")) {
|
|
@@ -809,13 +820,13 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
809
820
|
type: i == null ? void 0 : i.type,
|
|
810
821
|
id: i == null ? void 0 : i.id,
|
|
811
822
|
limit: (i == null ? void 0 : i.limit) ?? "",
|
|
812
|
-
children:
|
|
823
|
+
children: n(i == null ? void 0 : i.children, C + 1),
|
|
813
824
|
path: i == null ? void 0 : i.name
|
|
814
825
|
};
|
|
815
826
|
g.push(d);
|
|
816
827
|
}
|
|
817
828
|
}), g;
|
|
818
|
-
},
|
|
829
|
+
}, b = (r) => r ? [{
|
|
819
830
|
name: r == null ? void 0 : r.name,
|
|
820
831
|
label: r == null ? void 0 : r.name,
|
|
821
832
|
show: !0,
|
|
@@ -824,7 +835,7 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
824
835
|
type: r == null ? void 0 : r.type,
|
|
825
836
|
id: r == null ? void 0 : r.id,
|
|
826
837
|
limit: (r == null ? void 0 : r.limit) ?? "",
|
|
827
|
-
children:
|
|
838
|
+
children: n(r == null ? void 0 : r.children, 1),
|
|
828
839
|
path: r == null ? void 0 : r.name
|
|
829
840
|
}] : [], M = (r, C) => {
|
|
830
841
|
const g = [], i = [...r];
|
|
@@ -838,40 +849,40 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
838
849
|
return r.forEach((i) => {
|
|
839
850
|
if (i.children && i.children.length > 0) {
|
|
840
851
|
g.push(i.id);
|
|
841
|
-
const d = i.children.filter((
|
|
852
|
+
const d = i.children.filter((w) => w.children && w.children.length > 0).slice(0, C).map((w) => w.id);
|
|
842
853
|
g.push(...d);
|
|
843
854
|
}
|
|
844
855
|
}), g.slice(0, C + 1);
|
|
845
|
-
}, U = it(() => !
|
|
856
|
+
}, U = it(() => !a.value || a.value.length === 0 ? [] : e.expandStrategy === "firstLevel" ? k(a.value, e.maxExpandCount) : M(a.value, e.maxExpandCount)), A = it(() => e != null && e.model ? b(e.model) : []);
|
|
846
857
|
return _t(
|
|
847
858
|
A,
|
|
848
859
|
(r) => {
|
|
849
|
-
|
|
860
|
+
a.value = JSON.parse(JSON.stringify(r));
|
|
850
861
|
},
|
|
851
862
|
{ immediate: !0 }
|
|
852
863
|
), (r, C) => {
|
|
853
|
-
const g =
|
|
854
|
-
return
|
|
864
|
+
const g = Ft("el-tree");
|
|
865
|
+
return H(), $("div", Ie, [
|
|
855
866
|
D(g, {
|
|
856
|
-
data:
|
|
867
|
+
data: a.value,
|
|
857
868
|
props: u,
|
|
858
869
|
"default-expanded-keys": U.value,
|
|
859
|
-
"node-key":
|
|
860
|
-
onNodeClick:
|
|
870
|
+
"node-key": Fe,
|
|
871
|
+
onNodeClick: f
|
|
861
872
|
}, null, 8, ["data", "default-expanded-keys"])
|
|
862
873
|
]);
|
|
863
874
|
};
|
|
864
875
|
}
|
|
865
|
-
},
|
|
876
|
+
}, Ue = /* @__PURE__ */ st(Ne, [["__scopeId", "data-v-290ff4e1"]]), Ye = { class: "panel-content" }, Ve = {
|
|
866
877
|
key: 0,
|
|
867
878
|
class: "joints-list"
|
|
868
|
-
},
|
|
879
|
+
}, Ze = { class: "joint-info-row" }, He = { class: "joint-left" }, Ke = { class: "joint-name" }, $e = { class: "joint-range" }, Be = { class: "joint-type" }, Xe = {
|
|
869
880
|
key: 0,
|
|
870
881
|
class: "joint-control-row"
|
|
871
|
-
},
|
|
882
|
+
}, Je = { class: "slider-container" }, Ge = ["min", "max", "value", "onInput", "disabled"], We = { class: "value-display" }, qe = { class: "joint-value" }, Qe = { class: "unit" }, ti = {
|
|
872
883
|
key: 1,
|
|
873
884
|
class: "empty-state"
|
|
874
|
-
},
|
|
885
|
+
}, ei = 1e3, Pt = 60, ii = {
|
|
875
886
|
__name: "jointPanel",
|
|
876
887
|
props: {
|
|
877
888
|
model: Object,
|
|
@@ -881,21 +892,21 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
881
892
|
setup(o, { expose: t }) {
|
|
882
893
|
const e = o;
|
|
883
894
|
x(!0);
|
|
884
|
-
const s = x([]),
|
|
895
|
+
const s = x([]), a = x(null), u = x(!1), f = x(!1), n = x(0), b = x(0), M = x(null), k = x(1), U = () => ei / Pt / k.value;
|
|
885
896
|
let A = [];
|
|
886
897
|
_t(
|
|
887
898
|
() => e.animationData,
|
|
888
899
|
(c) => {
|
|
889
900
|
var h;
|
|
890
|
-
let
|
|
891
|
-
|
|
901
|
+
let _ = ((h = Yt(c)) == null ? void 0 : h.动画输出) ?? [];
|
|
902
|
+
_ && _.length > 0 && (A = _, O());
|
|
892
903
|
},
|
|
893
904
|
{ deep: !0 }
|
|
894
905
|
);
|
|
895
|
-
const r = (c,
|
|
906
|
+
const r = (c, _ = !1) => c === "revolute" ? _ ? Math.PI : -Math.PI : c === "prismatic" ? _ ? 1 : -1 : 0, C = (c) => {
|
|
896
907
|
if (!c || !c.joints)
|
|
897
908
|
return console.warn("URDF模型没有关节信息"), [];
|
|
898
|
-
const
|
|
909
|
+
const _ = [];
|
|
899
910
|
return Object.keys(c.joints).forEach((h) => {
|
|
900
911
|
const v = c.joints[h];
|
|
901
912
|
if (v._jointType === "fixed")
|
|
@@ -907,18 +918,18 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
907
918
|
lower: r(v._jointType, !1),
|
|
908
919
|
upper: r(v._jointType, !0)
|
|
909
920
|
};
|
|
910
|
-
|
|
921
|
+
_.push({
|
|
911
922
|
name: h,
|
|
912
923
|
type: v._jointType || "unknown",
|
|
913
924
|
limit: I,
|
|
914
925
|
currentValue: v.angle || 0,
|
|
915
926
|
urdfJoint: v
|
|
916
927
|
});
|
|
917
|
-
}),
|
|
918
|
-
}, g = (c,
|
|
928
|
+
}), _.sort((h, v) => h.name.localeCompare(v.name));
|
|
929
|
+
}, g = (c, _) => {
|
|
919
930
|
const h = s.value.find((I) => I.name === c);
|
|
920
931
|
if (!h) return;
|
|
921
|
-
const v = parseFloat(
|
|
932
|
+
const v = parseFloat(_);
|
|
922
933
|
if (h.limit) {
|
|
923
934
|
const I = Math.max(h.limit.lower, Math.min(h.limit.upper, v));
|
|
924
935
|
h.currentValue = I;
|
|
@@ -926,32 +937,32 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
926
937
|
h.currentValue = v;
|
|
927
938
|
e.model && e.model.setJointValue ? e.model.setJointValue(c, h.currentValue) : h.urdfJoint && h.urdfJoint.setJointValue(h.currentValue);
|
|
928
939
|
}, i = (c) => {
|
|
929
|
-
c && Object.keys(c).forEach((
|
|
930
|
-
const h = c[
|
|
931
|
-
v && (v.currentValue = h, e.model && e.model.setJointValue ? e.model.setJointValue(
|
|
940
|
+
c && Object.keys(c).forEach((_) => {
|
|
941
|
+
const h = c[_], v = s.value.find((I) => I.name === _);
|
|
942
|
+
v && (v.currentValue = h, e.model && e.model.setJointValue ? e.model.setJointValue(_, h) : v.urdfJoint && v.urdfJoint.setJointValue(h));
|
|
932
943
|
});
|
|
933
|
-
}, d = (c,
|
|
934
|
-
if (!c || !
|
|
944
|
+
}, d = (c, _, h) => c + (_ - c) * h, w = (c, _, h) => {
|
|
945
|
+
if (!c || !_) return c || _;
|
|
935
946
|
const v = {};
|
|
936
947
|
return Object.keys(c).forEach((I) => {
|
|
937
|
-
const q = c[I], Q =
|
|
948
|
+
const q = c[I], Q = _[I];
|
|
938
949
|
v[I] = d(q, Q || q, h);
|
|
939
950
|
}), v;
|
|
940
|
-
},
|
|
951
|
+
}, O = () => {
|
|
941
952
|
if (A.length === 0) {
|
|
942
953
|
console.warn("没有动画数据");
|
|
943
954
|
return;
|
|
944
955
|
}
|
|
945
|
-
u.value = !0,
|
|
956
|
+
u.value = !0, f.value = !1;
|
|
946
957
|
const c = () => {
|
|
947
|
-
if (!u.value ||
|
|
948
|
-
const
|
|
958
|
+
if (!u.value || f.value) return;
|
|
959
|
+
const _ = b.value / Pt, h = A[n.value], v = A[n.value + 1];
|
|
949
960
|
if (v) {
|
|
950
|
-
const I =
|
|
961
|
+
const I = w(h, v, _);
|
|
951
962
|
i(I);
|
|
952
963
|
} else
|
|
953
964
|
i(h);
|
|
954
|
-
if (
|
|
965
|
+
if (b.value++, b.value >= Pt && (b.value = 0, n.value++, n.value >= A.length - 1)) {
|
|
955
966
|
F();
|
|
956
967
|
return;
|
|
957
968
|
}
|
|
@@ -959,16 +970,16 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
959
970
|
};
|
|
960
971
|
c();
|
|
961
972
|
}, Y = () => {
|
|
962
|
-
|
|
973
|
+
f.value = !0, M.value && (clearTimeout(M.value), M.value = null);
|
|
963
974
|
}, F = () => {
|
|
964
|
-
u.value = !1,
|
|
975
|
+
u.value = !1, f.value = !1, k.value = 1, M.value && (clearTimeout(M.value), M.value = null);
|
|
965
976
|
};
|
|
966
977
|
t({
|
|
967
|
-
startAnimation:
|
|
978
|
+
startAnimation: O,
|
|
968
979
|
pauseAnimation: Y,
|
|
969
980
|
stopAnimation: F,
|
|
970
981
|
resetAll: () => {
|
|
971
|
-
F(),
|
|
982
|
+
F(), n.value = 0, b.value = 0, s.value.forEach((c) => {
|
|
972
983
|
(c.type === "revolute" || c.type === "prismatic") && g(c.name, 0);
|
|
973
984
|
});
|
|
974
985
|
},
|
|
@@ -986,38 +997,38 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
986
997
|
{ immediate: !0 }
|
|
987
998
|
);
|
|
988
999
|
const l = () => {
|
|
989
|
-
!e.model || u.value && !
|
|
1000
|
+
!e.model || u.value && !f.value || s.value.forEach((c) => {
|
|
990
1001
|
c.urdfJoint && c.urdfJoint.angle !== void 0 && (c.currentValue = c.urdfJoint.angle);
|
|
991
1002
|
});
|
|
992
1003
|
}, E = () => {
|
|
993
1004
|
const c = () => {
|
|
994
|
-
l(),
|
|
1005
|
+
l(), a.value = requestAnimationFrame(c);
|
|
995
1006
|
};
|
|
996
1007
|
c();
|
|
997
|
-
},
|
|
998
|
-
|
|
1008
|
+
}, Z = () => {
|
|
1009
|
+
a.value && (cancelAnimationFrame(a.value), a.value = null);
|
|
999
1010
|
};
|
|
1000
|
-
return
|
|
1011
|
+
return Nt(() => {
|
|
1001
1012
|
E();
|
|
1002
1013
|
}), Bt(() => {
|
|
1003
|
-
|
|
1004
|
-
}), (c,
|
|
1005
|
-
s.value.length > 0 ? (
|
|
1006
|
-
(
|
|
1014
|
+
Z(), F();
|
|
1015
|
+
}), (c, _) => (H(), $("div", Ye, [
|
|
1016
|
+
s.value.length > 0 ? (H(), $("div", Ve, [
|
|
1017
|
+
(H(!0), $(Xt, null, Jt(s.value, (h) => {
|
|
1007
1018
|
var v, I, q, Q;
|
|
1008
|
-
return
|
|
1019
|
+
return H(), $("div", {
|
|
1009
1020
|
key: h.name,
|
|
1010
1021
|
class: "joint-item"
|
|
1011
1022
|
}, [
|
|
1012
|
-
y("div",
|
|
1023
|
+
y("div", Ze, [
|
|
1013
1024
|
y("div", He, [
|
|
1014
|
-
y("span",
|
|
1015
|
-
y("span",
|
|
1025
|
+
y("span", Ke, J(h.name), 1),
|
|
1026
|
+
y("span", $e, " [" + J(((v = h.limit) == null ? void 0 : v.lower.toFixed(2)) ?? (h.type === "revolute" ? "-3.14" : "-1.00")) + ", " + J(((I = h.limit) == null ? void 0 : I.upper.toFixed(2)) ?? (h.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
|
|
1016
1027
|
]),
|
|
1017
1028
|
y("span", Be, J(h.type), 1)
|
|
1018
1029
|
]),
|
|
1019
|
-
h.type === "revolute" || h.type === "prismatic" ? (
|
|
1020
|
-
y("div",
|
|
1030
|
+
h.type === "revolute" || h.type === "prismatic" ? (H(), $("div", Xe, [
|
|
1031
|
+
y("div", Je, [
|
|
1021
1032
|
y("input", {
|
|
1022
1033
|
type: "range",
|
|
1023
1034
|
min: ((q = h.limit) == null ? void 0 : q.lower) ?? (h.type === "revolute" ? -Math.PI : -1),
|
|
@@ -1026,22 +1037,22 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1026
1037
|
value: h.currentValue,
|
|
1027
1038
|
onInput: (yt) => g(h.name, yt.target.value),
|
|
1028
1039
|
class: "joint-slider",
|
|
1029
|
-
disabled: u.value && !
|
|
1030
|
-
}, null, 40,
|
|
1040
|
+
disabled: u.value && !f.value
|
|
1041
|
+
}, null, 40, Ge)
|
|
1031
1042
|
]),
|
|
1032
|
-
y("div",
|
|
1033
|
-
y("span",
|
|
1034
|
-
y("span",
|
|
1043
|
+
y("div", We, [
|
|
1044
|
+
y("span", qe, J(h.currentValue.toFixed(3)), 1),
|
|
1045
|
+
y("span", Qe, J(h.type === "revolute" ? "rad" : "m"), 1)
|
|
1035
1046
|
])
|
|
1036
1047
|
])) : dt("", !0)
|
|
1037
1048
|
]);
|
|
1038
1049
|
}), 128))
|
|
1039
|
-
])) : (
|
|
1050
|
+
])) : (H(), $("div", ti, _[0] || (_[0] = [
|
|
1040
1051
|
y("p", null, "未检测到可控制的关节", -1)
|
|
1041
1052
|
])))
|
|
1042
1053
|
]));
|
|
1043
1054
|
}
|
|
1044
|
-
},
|
|
1055
|
+
}, si = /* @__PURE__ */ st(ii, [["__scopeId", "data-v-603b87bc"]]), oi = ["xlink:href"], ai = /* @__PURE__ */ Gt({
|
|
1045
1056
|
__name: "svgIcon",
|
|
1046
1057
|
props: {
|
|
1047
1058
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1056,34 +1067,34 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1056
1067
|
() => ({
|
|
1057
1068
|
backgroundColor: t.backgroundColor
|
|
1058
1069
|
})
|
|
1059
|
-
), s = it(() => `#${t.prefix}-${t.name}`),
|
|
1070
|
+
), s = it(() => `#${t.prefix}-${t.name}`), a = it(() => {
|
|
1060
1071
|
const { size: u } = t;
|
|
1061
|
-
let
|
|
1062
|
-
return
|
|
1063
|
-
width:
|
|
1064
|
-
height:
|
|
1072
|
+
let f = `${u}`;
|
|
1073
|
+
return f = `${f.replace("px", "")}px`, {
|
|
1074
|
+
width: f,
|
|
1075
|
+
height: f
|
|
1065
1076
|
};
|
|
1066
1077
|
});
|
|
1067
|
-
return (u,
|
|
1078
|
+
return (u, f) => (H(), $("div", {
|
|
1068
1079
|
class: St(["container", { active: u.active }]),
|
|
1069
1080
|
style: Ct(e.value)
|
|
1070
1081
|
}, [
|
|
1071
|
-
(
|
|
1082
|
+
(H(), $("svg", {
|
|
1072
1083
|
class: St(["svg-icon", [u.$attrs.class, u.spin && "svg-icon-spin"]]),
|
|
1073
|
-
style: Ct(
|
|
1084
|
+
style: Ct(a.value),
|
|
1074
1085
|
"aria-hidden": "true"
|
|
1075
1086
|
}, [
|
|
1076
|
-
y("use", { "xlink:href": s.value }, null, 8,
|
|
1087
|
+
y("use", { "xlink:href": s.value }, null, 8, oi)
|
|
1077
1088
|
], 6))
|
|
1078
1089
|
], 6));
|
|
1079
1090
|
}
|
|
1080
|
-
}), z = /* @__PURE__ */ st(
|
|
1091
|
+
}), z = /* @__PURE__ */ st(ai, [["__scopeId", "data-v-3150a90b"]]), ni = { class: "obj-viewer-container" }, li = { class: "buttonGroup-top" }, ri = { class: "buttonGroup-topLeft" }, hi = { class: "buttonGroup-left" }, ci = { class: "buttonGroup-right" }, ui = { class: "buttonGroup-bottom" }, pi = { class: "left-panel" }, di = { class: "panel-header" }, mi = {
|
|
1081
1092
|
key: 1,
|
|
1082
1093
|
class: "clipping-content"
|
|
1083
|
-
},
|
|
1094
|
+
}, fi = { class: "radio-group" }, _i = { class: "radio-label" }, gi = { class: "radio-label" }, yi = { class: "radio-label" }, vi = { class: "radio-label" }, bi = { class: "right-panel" }, wi = { class: "panel-header" }, Pi = {
|
|
1084
1095
|
key: 0,
|
|
1085
1096
|
class: "loading-overlay"
|
|
1086
|
-
},
|
|
1097
|
+
}, Mi = {
|
|
1087
1098
|
__name: "threeModel",
|
|
1088
1099
|
props: {
|
|
1089
1100
|
animationData: {
|
|
@@ -1094,85 +1105,85 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1094
1105
|
},
|
|
1095
1106
|
emits: ["getAnimationData"],
|
|
1096
1107
|
setup(o, { expose: t, emit: e }) {
|
|
1097
|
-
const s = e,
|
|
1098
|
-
let u = null,
|
|
1099
|
-
const
|
|
1108
|
+
const s = e, a = o;
|
|
1109
|
+
let u = null, f = !1;
|
|
1110
|
+
const n = x(null), b = x(!1), M = x("");
|
|
1100
1111
|
x(!1);
|
|
1101
1112
|
const k = x(!1), U = x(!1), A = x(""), r = x(!1), C = x(""), g = x(), {
|
|
1102
1113
|
currentModels: i,
|
|
1103
1114
|
initialCameraPosition: d,
|
|
1104
|
-
initialTargetPosition:
|
|
1105
|
-
initThreeJS:
|
|
1115
|
+
initialTargetPosition: w,
|
|
1116
|
+
initThreeJS: O,
|
|
1106
1117
|
handleResize: Y,
|
|
1107
1118
|
fitCameraToAllModels: F,
|
|
1108
1119
|
getThreeJSObjects: L,
|
|
1109
1120
|
clearAllModels: V,
|
|
1110
1121
|
cleanup: m
|
|
1111
|
-
} =
|
|
1122
|
+
} = Ae(n), { isAnimating: l, toggleAnimation: E, stopAnimation: Z } = ze(L, i), { isClipping: c, activeClippingAxis: _, toggleClipping: h, updateClippingPlanes: v } = Oe(
|
|
1112
1123
|
L,
|
|
1113
1124
|
i
|
|
1114
|
-
), { addModelsFromUrls: I, loadModelByDefaultPath: q, urdfModel: Q } =
|
|
1125
|
+
), { addModelsFromUrls: I, loadModelByDefaultPath: q, urdfModel: Q } = _e(
|
|
1115
1126
|
L,
|
|
1116
1127
|
i,
|
|
1117
|
-
|
|
1128
|
+
b,
|
|
1118
1129
|
M,
|
|
1119
1130
|
V
|
|
1120
1131
|
), yt = () => {
|
|
1121
1132
|
if (k.value || i.value.length === 0) return;
|
|
1122
|
-
k.value = !0, l.value &&
|
|
1123
|
-
const { camera:
|
|
1124
|
-
if (!
|
|
1133
|
+
k.value = !0, l.value && Z();
|
|
1134
|
+
const { camera: R, controls: p } = L();
|
|
1135
|
+
if (!R || !p) return;
|
|
1125
1136
|
p.enabled = !0;
|
|
1126
|
-
const X = (tt) => tt < 0.5 ? 4 * tt * tt * tt : 1 - Math.pow(-2 * tt + 2, 3) / 2,
|
|
1137
|
+
const X = (tt) => tt < 0.5 ? 4 * tt * tt * tt : 1 - Math.pow(-2 * tt + 2, 3) / 2, at = R.position.clone(), nt = p.target.clone(), lt = 1500, rt = Date.now(), S = () => {
|
|
1127
1138
|
const tt = Date.now() - rt, xt = Math.min(tt / lt, 1), Tt = X(xt);
|
|
1128
|
-
|
|
1139
|
+
R.position.lerpVectors(at, d.value, Tt), p.target.lerpVectors(nt, w.value, Tt), xt < 1 ? requestAnimationFrame(S) : k.value = !1;
|
|
1129
1140
|
};
|
|
1130
1141
|
S();
|
|
1131
|
-
},
|
|
1142
|
+
}, Zt = async () => f ? Promise.resolve() : new Promise((R) => {
|
|
1132
1143
|
const p = () => {
|
|
1133
|
-
|
|
1144
|
+
f ? R() : requestAnimationFrame(p);
|
|
1134
1145
|
};
|
|
1135
1146
|
p();
|
|
1136
|
-
}), Et = async (
|
|
1147
|
+
}), Et = async (R, p) => {
|
|
1137
1148
|
try {
|
|
1138
|
-
await
|
|
1139
|
-
const X = await p(
|
|
1149
|
+
await Zt(), l.value && Z(), c.value && h();
|
|
1150
|
+
const X = await p(R);
|
|
1140
1151
|
return F(), X;
|
|
1141
1152
|
} catch (X) {
|
|
1142
1153
|
throw console.error("加载模型失败:", X), X;
|
|
1143
1154
|
}
|
|
1144
|
-
}, Ht = async (
|
|
1145
|
-
U.value = !0, A.value =
|
|
1146
|
-
}, Dt = (
|
|
1147
|
-
r.value = !0, C.value =
|
|
1148
|
-
},
|
|
1155
|
+
}, Ht = async (R) => Et(R, I), Kt = async (R) => Et(R, q), ot = (R) => {
|
|
1156
|
+
U.value = !0, A.value = R, R === "剖面视图" && !c.value && h();
|
|
1157
|
+
}, Dt = (R) => {
|
|
1158
|
+
r.value = !0, C.value = R;
|
|
1159
|
+
}, $t = () => {
|
|
1149
1160
|
s("getAnimationData"), kt(() => {
|
|
1150
|
-
var
|
|
1151
|
-
(
|
|
1161
|
+
var R;
|
|
1162
|
+
(R = g.value) == null || R.startAnimation();
|
|
1152
1163
|
});
|
|
1153
1164
|
};
|
|
1154
|
-
return
|
|
1165
|
+
return Nt(async () => {
|
|
1155
1166
|
await kt();
|
|
1156
1167
|
try {
|
|
1157
|
-
|
|
1158
|
-
} catch (
|
|
1159
|
-
console.error("Three.js初始化失败:",
|
|
1168
|
+
O(), u = L().scene, f = !0, window.addEventListener("resize", Y);
|
|
1169
|
+
} catch (R) {
|
|
1170
|
+
console.error("Three.js初始化失败:", R);
|
|
1160
1171
|
}
|
|
1161
|
-
}),
|
|
1162
|
-
|
|
1172
|
+
}), Wt(() => {
|
|
1173
|
+
f = !1, A.value = "", C.value = "", window.removeEventListener("resize", Y), l.value && Z(), m();
|
|
1163
1174
|
}), t({
|
|
1164
1175
|
addModelsFromUrls: Ht,
|
|
1165
|
-
loadModelByDefaultPath:
|
|
1166
|
-
}), (
|
|
1167
|
-
var
|
|
1168
|
-
const X =
|
|
1169
|
-
return
|
|
1176
|
+
loadModelByDefaultPath: Kt
|
|
1177
|
+
}), (R, p) => {
|
|
1178
|
+
var at, nt, lt, rt;
|
|
1179
|
+
const X = Ft("el-scrollbar");
|
|
1180
|
+
return H(), $("div", ni, [
|
|
1170
1181
|
y("div", {
|
|
1171
1182
|
ref_key: "threejsContainer",
|
|
1172
|
-
ref:
|
|
1183
|
+
ref: n,
|
|
1173
1184
|
class: "threejs-container"
|
|
1174
1185
|
}, null, 512),
|
|
1175
|
-
y("div",
|
|
1186
|
+
y("div", li, [
|
|
1176
1187
|
D(z, {
|
|
1177
1188
|
name: "guanjianjiexi",
|
|
1178
1189
|
size: "34"
|
|
@@ -1194,7 +1205,7 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1194
1205
|
size: "34"
|
|
1195
1206
|
})
|
|
1196
1207
|
]),
|
|
1197
|
-
y("div",
|
|
1208
|
+
y("div", ri, [
|
|
1198
1209
|
D(z, {
|
|
1199
1210
|
name: "viewReset",
|
|
1200
1211
|
size: "24",
|
|
@@ -1218,7 +1229,7 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1218
1229
|
title: N(l) ? "停止动画" : "动画视图"
|
|
1219
1230
|
}, null, 8, ["onClick", "title"])
|
|
1220
1231
|
]),
|
|
1221
|
-
y("div",
|
|
1232
|
+
y("div", hi, [
|
|
1222
1233
|
D(z, {
|
|
1223
1234
|
name: "jiegoushu",
|
|
1224
1235
|
size: "24",
|
|
@@ -1244,7 +1255,7 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1244
1255
|
onClick: p[3] || (p[3] = (S) => ot("场景4"))
|
|
1245
1256
|
})
|
|
1246
1257
|
]),
|
|
1247
|
-
y("div",
|
|
1258
|
+
y("div", ci, [
|
|
1248
1259
|
D(z, {
|
|
1249
1260
|
name: "donghuafangzhen",
|
|
1250
1261
|
size: "24"
|
|
@@ -1276,27 +1287,27 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1276
1287
|
size: "24"
|
|
1277
1288
|
})
|
|
1278
1289
|
]),
|
|
1279
|
-
y("div",
|
|
1290
|
+
y("div", ui, [
|
|
1280
1291
|
D(z, {
|
|
1281
1292
|
name: "kuaitui",
|
|
1282
1293
|
size: "24",
|
|
1283
1294
|
backgroundColor: "#ffffff",
|
|
1284
1295
|
title: "快退",
|
|
1285
|
-
onClick: (
|
|
1296
|
+
onClick: (at = g.value) == null ? void 0 : at.fastBackward
|
|
1286
1297
|
}, null, 8, ["onClick"]),
|
|
1287
1298
|
D(z, {
|
|
1288
1299
|
name: "bofang",
|
|
1289
1300
|
size: "24",
|
|
1290
1301
|
backgroundColor: "#ffffff",
|
|
1291
1302
|
title: "播放",
|
|
1292
|
-
onClick:
|
|
1303
|
+
onClick: $t
|
|
1293
1304
|
}),
|
|
1294
1305
|
D(z, {
|
|
1295
1306
|
name: "kuaijin",
|
|
1296
1307
|
size: "24",
|
|
1297
1308
|
backgroundColor: "#ffffff",
|
|
1298
1309
|
title: "快进",
|
|
1299
|
-
onClick: (
|
|
1310
|
+
onClick: (nt = g.value) == null ? void 0 : nt.fastForward
|
|
1300
1311
|
}, null, 8, ["onClick"]),
|
|
1301
1312
|
D(z, {
|
|
1302
1313
|
name: "zanting",
|
|
@@ -1313,8 +1324,8 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1313
1324
|
onClick: (rt = g.value) == null ? void 0 : rt.resetAll
|
|
1314
1325
|
}, null, 8, ["onClick"])
|
|
1315
1326
|
]),
|
|
1316
|
-
G(y("div",
|
|
1317
|
-
y("div",
|
|
1327
|
+
G(y("div", pi, [
|
|
1328
|
+
y("div", di, [
|
|
1318
1329
|
y("span", null, J(A.value), 1),
|
|
1319
1330
|
y("span", {
|
|
1320
1331
|
class: "close",
|
|
@@ -1323,57 +1334,57 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1323
1334
|
]),
|
|
1324
1335
|
D(X, { "max-height": "650px" }, {
|
|
1325
1336
|
default: At(() => [
|
|
1326
|
-
A.value === "场景树" ? (
|
|
1337
|
+
A.value === "场景树" ? (H(), It(Ue, {
|
|
1327
1338
|
key: 0,
|
|
1328
1339
|
model: N(Q)
|
|
1329
1340
|
}, null, 8, ["model"])) : dt("", !0),
|
|
1330
|
-
A.value === "剖面视图" ? (
|
|
1331
|
-
y("div",
|
|
1332
|
-
y("label",
|
|
1341
|
+
A.value === "剖面视图" ? (H(), $("div", mi, [
|
|
1342
|
+
y("div", fi, [
|
|
1343
|
+
y("label", _i, [
|
|
1333
1344
|
G(y("input", {
|
|
1334
1345
|
type: "radio",
|
|
1335
1346
|
name: "clipping-axis",
|
|
1336
1347
|
value: "none",
|
|
1337
|
-
"onUpdate:modelValue": p[7] || (p[7] = (S) => ht(
|
|
1348
|
+
"onUpdate:modelValue": p[7] || (p[7] = (S) => ht(_) ? _.value = S : null),
|
|
1338
1349
|
onChange: p[8] || (p[8] = (...S) => N(v) && N(v)(...S))
|
|
1339
1350
|
}, null, 544), [
|
|
1340
|
-
[ct, N(
|
|
1351
|
+
[ct, N(_)]
|
|
1341
1352
|
]),
|
|
1342
1353
|
p[16] || (p[16] = y("span", { class: "radio-text" }, "无切割", -1))
|
|
1343
1354
|
]),
|
|
1344
|
-
y("label",
|
|
1355
|
+
y("label", gi, [
|
|
1345
1356
|
G(y("input", {
|
|
1346
1357
|
type: "radio",
|
|
1347
1358
|
name: "clipping-axis",
|
|
1348
1359
|
value: "x",
|
|
1349
|
-
"onUpdate:modelValue": p[9] || (p[9] = (S) => ht(
|
|
1360
|
+
"onUpdate:modelValue": p[9] || (p[9] = (S) => ht(_) ? _.value = S : null),
|
|
1350
1361
|
onChange: p[10] || (p[10] = (...S) => N(v) && N(v)(...S))
|
|
1351
1362
|
}, null, 544), [
|
|
1352
|
-
[ct, N(
|
|
1363
|
+
[ct, N(_)]
|
|
1353
1364
|
]),
|
|
1354
1365
|
p[17] || (p[17] = y("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1355
1366
|
]),
|
|
1356
|
-
y("label",
|
|
1367
|
+
y("label", yi, [
|
|
1357
1368
|
G(y("input", {
|
|
1358
1369
|
type: "radio",
|
|
1359
1370
|
name: "clipping-axis",
|
|
1360
1371
|
value: "y",
|
|
1361
|
-
"onUpdate:modelValue": p[11] || (p[11] = (S) => ht(
|
|
1372
|
+
"onUpdate:modelValue": p[11] || (p[11] = (S) => ht(_) ? _.value = S : null),
|
|
1362
1373
|
onChange: p[12] || (p[12] = (...S) => N(v) && N(v)(...S))
|
|
1363
1374
|
}, null, 544), [
|
|
1364
|
-
[ct, N(
|
|
1375
|
+
[ct, N(_)]
|
|
1365
1376
|
]),
|
|
1366
1377
|
p[18] || (p[18] = y("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1367
1378
|
]),
|
|
1368
|
-
y("label",
|
|
1379
|
+
y("label", vi, [
|
|
1369
1380
|
G(y("input", {
|
|
1370
1381
|
type: "radio",
|
|
1371
1382
|
name: "clipping-axis",
|
|
1372
1383
|
value: "z",
|
|
1373
|
-
"onUpdate:modelValue": p[13] || (p[13] = (S) => ht(
|
|
1384
|
+
"onUpdate:modelValue": p[13] || (p[13] = (S) => ht(_) ? _.value = S : null),
|
|
1374
1385
|
onChange: p[14] || (p[14] = (...S) => N(v) && N(v)(...S))
|
|
1375
1386
|
}, null, 544), [
|
|
1376
|
-
[ct, N(
|
|
1387
|
+
[ct, N(_)]
|
|
1377
1388
|
]),
|
|
1378
1389
|
p[19] || (p[19] = y("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1379
1390
|
])
|
|
@@ -1385,8 +1396,8 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1385
1396
|
], 512), [
|
|
1386
1397
|
[ut, U.value]
|
|
1387
1398
|
]),
|
|
1388
|
-
G(y("div",
|
|
1389
|
-
y("div",
|
|
1399
|
+
G(y("div", bi, [
|
|
1400
|
+
y("div", wi, [
|
|
1390
1401
|
y("span", null, J(C.value), 1),
|
|
1391
1402
|
y("span", {
|
|
1392
1403
|
class: "close",
|
|
@@ -1395,17 +1406,17 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1395
1406
|
]),
|
|
1396
1407
|
D(X, { "max-height": "650px" }, {
|
|
1397
1408
|
default: At(() => [
|
|
1398
|
-
G(D(
|
|
1409
|
+
G(D(si, {
|
|
1399
1410
|
ref_key: "jointRef",
|
|
1400
1411
|
ref: g,
|
|
1401
1412
|
model: N(Q),
|
|
1402
1413
|
scene: N(u),
|
|
1403
|
-
animationData:
|
|
1414
|
+
animationData: a == null ? void 0 : a.animationData
|
|
1404
1415
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1405
1416
|
[ut, C.value === "关节控制"]
|
|
1406
1417
|
]),
|
|
1407
|
-
G(D(
|
|
1408
|
-
animationData:
|
|
1418
|
+
G(D(je, {
|
|
1419
|
+
animationData: a == null ? void 0 : a.animationData
|
|
1409
1420
|
}, null, 8, ["animationData"]), [
|
|
1410
1421
|
[ut, C.value === "动画仿真"]
|
|
1411
1422
|
])
|
|
@@ -1415,14 +1426,14 @@ const Re = { class: "panel-content" }, Oe = {
|
|
|
1415
1426
|
], 512), [
|
|
1416
1427
|
[ut, r.value]
|
|
1417
1428
|
]),
|
|
1418
|
-
|
|
1429
|
+
b.value ? (H(), $("div", Pi, [
|
|
1419
1430
|
p[20] || (p[20] = y("div", { class: "loading-spinner" }, null, -1)),
|
|
1420
1431
|
y("p", null, J(M.value), 1)
|
|
1421
1432
|
])) : dt("", !0)
|
|
1422
1433
|
]);
|
|
1423
1434
|
};
|
|
1424
1435
|
}
|
|
1425
|
-
},
|
|
1436
|
+
}, Ci = /* @__PURE__ */ st(Mi, [["__scopeId", "data-v-14112288"]]);
|
|
1426
1437
|
export {
|
|
1427
|
-
|
|
1438
|
+
Ci as default
|
|
1428
1439
|
};
|