ss-component-new 1.3.617 → 1.3.618
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/JSEncrypt-B36c1iN5.js +1983 -0
- package/dist/{MTLLoader-B6ottYFV.js → MTLLoader-5pQpbMEZ.js} +2 -2
- package/dist/{URDFLoader-CH-7Pzmq.js → URDFLoader-BO26K5-d.js} +584 -589
- package/dist/{animationData-F0z3GN7j.js → animationData-rL2nYHqW.js} +3 -3
- package/dist/{array-CQiszLQE.js → array-CV1ac-qs.js} +48 -47
- package/dist/{clone-MyfSNInd.js → clone-ESeDvnJv.js} +1 -1
- package/dist/{eleIcon-BoKZ_PzU.js → eleIcon-C7Pz9jha.js} +2 -2
- package/dist/{iconfont-BJYdStg5.js → iconfont-BIrta5vE.js} +837 -346
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-BvtOLltL.js → index-B0M1YCUY.js} +7 -7
- package/dist/{index-aTEfnfYn.js → index-B8XrhVMF.js} +40 -36
- package/dist/{index-CT1LWsrT.js → index-BBBCr4Oo.js} +2 -2
- package/dist/{index-dD-mKgue.js → index-BHtNKL1L.js} +2 -2
- package/dist/{index-0zQirLAy.js → index-BJ62OMmt.js} +8 -8
- package/dist/{index-DcPtyCDm.js → index-BUqviBFi.js} +35 -29
- package/dist/{index-B2LYEScO.js → index-BXh02EAd.js} +4 -4
- package/dist/{index-CkO7j_i1.js → index-B_fRppeJ.js} +8 -8
- package/dist/{index-6qXeMn6b.js → index-BvkIoiVW.js} +3 -3
- package/dist/{index-BODochNh.js → index-C0ceRI6G.js} +8 -8
- package/dist/{index-DIVct0z6.js → index-C3pboX9W.js} +5 -5
- package/dist/{index-hg0CdgKe.js → index-CEdE_NSq.js} +4 -4
- package/dist/{index-BkkvdZXm.js → index-CPW7tdrA.js} +20 -17
- package/dist/{index-BybrpYzx.js → index-CX8Apbo7.js} +1 -1
- package/dist/{index-8OmAlKII.js → index-CdbnlHGB.js} +4 -4
- package/dist/index-Cf6SLhmv.js +572 -0
- package/dist/{index-DIzunSUT.js → index-ChruDgJI.js} +20 -18
- package/dist/index-CqGc8ooA.js +10808 -0
- package/dist/{index-D2BpwRDj.js → index-CuRoGT8n.js} +157 -148
- package/dist/{index-DmILGKv9.js → index-D1E8EPxn.js} +61 -57
- package/dist/{index-B8NQAdR4.js → index-D8UY4uNQ.js} +967 -966
- package/dist/{index-CYjsE5Gs.js → index-D9xMYIes.js} +3 -3
- package/dist/{index-BHtLrI43.js → index-Df4Jvijp.js} +5 -5
- package/dist/{index-CvZcm-Tt.js → index-DlQXFCw8.js} +8 -7
- package/dist/{index-BvyM6d06.js → index-DsdWSuDi.js} +483 -482
- package/dist/{index-D43kQTBs.js → index-EbR-4CPv.js} +6436 -6878
- package/dist/{index-D56uKIwO.js → index-EzodkyTQ.js} +62 -60
- package/dist/{index-DCY5J8nu.js → index-XvX6TMzr.js} +1 -1
- package/dist/{index-B4NcYIuS.js → index-YvUJL9Us.js} +1 -1
- package/dist/{index-CXqqIuf-.js → index-ZdNvgZn9.js} +3 -3
- package/dist/{index-CAMjP0It.js → index-cV2MbLaG.js} +3 -3
- package/dist/{index-CnCBS4CT.js → index-esEiuhw9.js} +16231 -16121
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-CM6aWexA.js → index-tMqKF2l6.js} +2 -2
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js → index.vue_vue_type_script_setup_true_lang-DRzriV-s.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-CoMb-4Xy.js} +27734 -27759
- package/dist/isString-BlNsHiyU.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-BDvWHXas.js → main-BXrtPogM.js} +9 -9
- package/dist/{menuIndex-BiUB7t5q.js → menuIndex-DAW9B-9g.js} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{request-BfrhYBTM.js → request-B1c8BUkR.js} +3075 -3493
- package/dist/ss-component.css +3 -3
- package/dist/ss-component.js +14 -14
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/{threeModel-B7guecMM.js → threeModel-D1B4oDe9.js} +205 -205
- package/dist/{threePreview-CpcrqmFS.js → threePreview-CVU8RHxm.js} +14 -15
- package/dist/{threeSceneView-CWTmvCY4.js → threeSceneView-BSOa5dbR.js} +26 -26
- package/dist/{threeSceneViewForCPMPIP-VzWmr9CP.js → threeSceneViewForCPMPIP-UwWWK-ZK.js} +19 -19
- package/dist/{threeTrackPathView-Bw6e-quT.js → threeTrackPathView-DB61-HKo.js} +9 -10
- package/dist/{threeViewerHost-DIiGjw_8.js → threeViewerHost-CKaC5HSQ.js} +4 -4
- package/dist/{urdfTree-DU02c_91.js → urdfTree-BTnijMjA.js} +9 -9
- package/dist/{workpieceTreePanel-XH9mYAT2.js → workpieceTreePanel-Cmcj8MOA.js} +60 -56
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/OrbitControls-BFVKU7s-.js +0 -458
- package/dist/index-DSrPdLF-.js +0 -10849
- package/dist/index-mjGbAjJz.js +0 -2623
- package/dist/isString-Dxm3W5iX.js +0 -8
- package/dist/svgIcon-4m2zaZkj.js +0 -42
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
import { bj as S, V as p, M as u, bk as _, at as E, bl as P, ap as c, bm as w, m as O, p as R } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js";
|
|
2
|
-
const D = { type: "change" }, b = { type: "start" }, M = { type: "end" }, f = new w(), T = new O(), j = Math.cos(70 * R.DEG2RAD), n = new p(), r = 2 * Math.PI, o = {
|
|
3
|
-
NONE: -1,
|
|
4
|
-
ROTATE: 0,
|
|
5
|
-
DOLLY: 1,
|
|
6
|
-
PAN: 2,
|
|
7
|
-
TOUCH_ROTATE: 3,
|
|
8
|
-
TOUCH_PAN: 4,
|
|
9
|
-
TOUCH_DOLLY_PAN: 5,
|
|
10
|
-
TOUCH_DOLLY_ROTATE: 6
|
|
11
|
-
}, y = 1e-6;
|
|
12
|
-
class X extends S {
|
|
13
|
-
/**
|
|
14
|
-
* Constructs a new controls instance.
|
|
15
|
-
*
|
|
16
|
-
* @param {Object3D} object - The object that is managed by the controls.
|
|
17
|
-
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
18
|
-
*/
|
|
19
|
-
constructor(t, e = null) {
|
|
20
|
-
super(t, e), this.state = o.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: u.ROTATE, MIDDLE: u.DOLLY, RIGHT: u.PAN }, this.touches = { ONE: _.ROTATE, TWO: _.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 E(), this._lastTargetPosition = new p(), this._quat = new E().setFromUnitVectors(t.up, new p(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new P(), this._sphericalDelta = new P(), this._scale = 1, this._panOffset = new p(), this._rotateStart = new c(), this._rotateEnd = new c(), this._rotateDelta = new c(), this._panStart = new c(), this._panEnd = new c(), this._panDelta = new c(), this._dollyStart = new c(), this._dollyEnd = new c(), this._dollyDelta = new c(), this._dollyDirection = new p(), this._mouse = new c(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = L.bind(this), this._onPointerDown = A.bind(this), this._onPointerUp = k.bind(this), this._onContextMenu = Z.bind(this), this._onMouseWheel = N.bind(this), this._onKeyDown = Y.bind(this), this._onTouchStart = I.bind(this), this._onTouchMove = U.bind(this), this._onMouseDown = x.bind(this), this._onMouseMove = C.bind(this), this._interceptControlDown = z.bind(this), this._interceptControlUp = K.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
21
|
-
}
|
|
22
|
-
connect(t) {
|
|
23
|
-
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";
|
|
24
|
-
}
|
|
25
|
-
disconnect() {
|
|
26
|
-
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";
|
|
27
|
-
}
|
|
28
|
-
dispose() {
|
|
29
|
-
this.disconnect();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get the current vertical rotation, in radians.
|
|
33
|
-
*
|
|
34
|
-
* @return {number} The current vertical rotation, in radians.
|
|
35
|
-
*/
|
|
36
|
-
getPolarAngle() {
|
|
37
|
-
return this._spherical.phi;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get the current horizontal rotation, in radians.
|
|
41
|
-
*
|
|
42
|
-
* @return {number} The current horizontal rotation, in radians.
|
|
43
|
-
*/
|
|
44
|
-
getAzimuthalAngle() {
|
|
45
|
-
return this._spherical.theta;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns the distance from the camera to the target.
|
|
49
|
-
*
|
|
50
|
-
* @return {number} The distance from the camera to the target.
|
|
51
|
-
*/
|
|
52
|
-
getDistance() {
|
|
53
|
-
return this.object.position.distanceTo(this.target);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Adds key event listeners to the given DOM element.
|
|
57
|
-
* `window` is a recommended argument for using this method.
|
|
58
|
-
*
|
|
59
|
-
* @param {HTMLDOMElement} domElement - The DOM element
|
|
60
|
-
*/
|
|
61
|
-
listenToKeyEvents(t) {
|
|
62
|
-
t.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = t;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Removes the key event listener previously defined with `listenToKeyEvents()`.
|
|
66
|
-
*/
|
|
67
|
-
stopListenToKeyEvents() {
|
|
68
|
-
this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Save the current state of the controls. This can later be recovered with `reset()`.
|
|
72
|
-
*/
|
|
73
|
-
saveState() {
|
|
74
|
-
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Reset the controls to their state from either the last time the `saveState()`
|
|
78
|
-
* was called, or the initial state.
|
|
79
|
-
*/
|
|
80
|
-
reset() {
|
|
81
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(D), this.update(), this.state = o.NONE;
|
|
82
|
-
}
|
|
83
|
-
update(t = null) {
|
|
84
|
-
const e = this.object.position;
|
|
85
|
-
n.copy(e).sub(this.target), n.applyQuaternion(this._quat), this._spherical.setFromVector3(n), this.autoRotate && this.state === o.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);
|
|
86
|
-
let s = this.minAzimuthAngle, a = this.maxAzimuthAngle;
|
|
87
|
-
isFinite(s) && isFinite(a) && (s < -Math.PI ? s += r : s > Math.PI && (s -= r), a < -Math.PI ? a += r : a > Math.PI && (a -= r), 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);
|
|
88
|
-
let h = !1;
|
|
89
|
-
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
90
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
91
|
-
else {
|
|
92
|
-
const l = this._spherical.radius;
|
|
93
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), h = l != this._spherical.radius;
|
|
94
|
-
}
|
|
95
|
-
if (n.setFromSpherical(this._spherical), n.applyQuaternion(this._quatInverse), e.copy(this.target).add(n), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
96
|
-
let l = null;
|
|
97
|
-
if (this.object.isPerspectiveCamera) {
|
|
98
|
-
const d = n.length();
|
|
99
|
-
l = this._clampDistance(d * this._scale);
|
|
100
|
-
const m = d - l;
|
|
101
|
-
this.object.position.addScaledVector(this._dollyDirection, m), this.object.updateMatrixWorld(), h = !!m;
|
|
102
|
-
} else if (this.object.isOrthographicCamera) {
|
|
103
|
-
const d = new p(this._mouse.x, this._mouse.y, 0);
|
|
104
|
-
d.unproject(this.object);
|
|
105
|
-
const m = this.object.zoom;
|
|
106
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), h = m !== this.object.zoom;
|
|
107
|
-
const g = new p(this._mouse.x, this._mouse.y, 0);
|
|
108
|
-
g.unproject(this.object), this.object.position.sub(g).add(d), this.object.updateMatrixWorld(), l = n.length();
|
|
109
|
-
} else
|
|
110
|
-
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
111
|
-
l !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(l).add(this.object.position) : (f.origin.copy(this.object.position), f.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(f.direction)) < j ? this.object.lookAt(this.target) : (T.setFromNormalAndCoplanarPoint(this.object.up, this.target), f.intersectPlane(T, this.target))));
|
|
112
|
-
} else if (this.object.isOrthographicCamera) {
|
|
113
|
-
const l = this.object.zoom;
|
|
114
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), l !== this.object.zoom && (this.object.updateProjectionMatrix(), h = !0);
|
|
115
|
-
}
|
|
116
|
-
return this._scale = 1, this._performCursorZoom = !1, h || this._lastPosition.distanceToSquared(this.object.position) > y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > y || this._lastTargetPosition.distanceToSquared(this.target) > y ? (this.dispatchEvent(D), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
117
|
-
}
|
|
118
|
-
_getAutoRotationAngle(t) {
|
|
119
|
-
return t !== null ? r / 60 * this.autoRotateSpeed * t : r / 60 / 60 * this.autoRotateSpeed;
|
|
120
|
-
}
|
|
121
|
-
_getZoomScale(t) {
|
|
122
|
-
const e = Math.abs(t * 0.01);
|
|
123
|
-
return Math.pow(0.95, this.zoomSpeed * e);
|
|
124
|
-
}
|
|
125
|
-
_rotateLeft(t) {
|
|
126
|
-
this._sphericalDelta.theta -= t;
|
|
127
|
-
}
|
|
128
|
-
_rotateUp(t) {
|
|
129
|
-
this._sphericalDelta.phi -= t;
|
|
130
|
-
}
|
|
131
|
-
_panLeft(t, e) {
|
|
132
|
-
n.setFromMatrixColumn(e, 0), n.multiplyScalar(-t), this._panOffset.add(n);
|
|
133
|
-
}
|
|
134
|
-
_panUp(t, e) {
|
|
135
|
-
this.screenSpacePanning === !0 ? n.setFromMatrixColumn(e, 1) : (n.setFromMatrixColumn(e, 0), n.crossVectors(this.object.up, n)), n.multiplyScalar(t), this._panOffset.add(n);
|
|
136
|
-
}
|
|
137
|
-
// deltaX and deltaY are in pixels; right and down are positive
|
|
138
|
-
_pan(t, e) {
|
|
139
|
-
const s = this.domElement;
|
|
140
|
-
if (this.object.isPerspectiveCamera) {
|
|
141
|
-
const a = this.object.position;
|
|
142
|
-
n.copy(a).sub(this.target);
|
|
143
|
-
let h = n.length();
|
|
144
|
-
h *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * h / s.clientHeight, this.object.matrix), this._panUp(2 * e * h / s.clientHeight, this.object.matrix);
|
|
145
|
-
} 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);
|
|
146
|
-
}
|
|
147
|
-
_dollyOut(t) {
|
|
148
|
-
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);
|
|
149
|
-
}
|
|
150
|
-
_dollyIn(t) {
|
|
151
|
-
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
152
|
-
}
|
|
153
|
-
_updateZoomParameters(t, e) {
|
|
154
|
-
if (!this.zoomToCursor)
|
|
155
|
-
return;
|
|
156
|
-
this._performCursorZoom = !0;
|
|
157
|
-
const s = this.domElement.getBoundingClientRect(), a = t - s.left, h = e - s.top, l = s.width, d = s.height;
|
|
158
|
-
this._mouse.x = a / l * 2 - 1, this._mouse.y = -(h / d) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
159
|
-
}
|
|
160
|
-
_clampDistance(t) {
|
|
161
|
-
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
162
|
-
}
|
|
163
|
-
//
|
|
164
|
-
// event callbacks - update the object state
|
|
165
|
-
//
|
|
166
|
-
_handleMouseDownRotate(t) {
|
|
167
|
-
this._rotateStart.set(t.clientX, t.clientY);
|
|
168
|
-
}
|
|
169
|
-
_handleMouseDownDolly(t) {
|
|
170
|
-
this._updateZoomParameters(t.clientX, t.clientX), this._dollyStart.set(t.clientX, t.clientY);
|
|
171
|
-
}
|
|
172
|
-
_handleMouseDownPan(t) {
|
|
173
|
-
this._panStart.set(t.clientX, t.clientY);
|
|
174
|
-
}
|
|
175
|
-
_handleMouseMoveRotate(t) {
|
|
176
|
-
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
177
|
-
const e = this.domElement;
|
|
178
|
-
this._rotateLeft(r * this._rotateDelta.x / e.clientHeight), this._rotateUp(r * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
179
|
-
}
|
|
180
|
-
_handleMouseMoveDolly(t) {
|
|
181
|
-
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();
|
|
182
|
-
}
|
|
183
|
-
_handleMouseMovePan(t) {
|
|
184
|
-
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();
|
|
185
|
-
}
|
|
186
|
-
_handleMouseWheel(t) {
|
|
187
|
-
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();
|
|
188
|
-
}
|
|
189
|
-
_handleKeyDown(t) {
|
|
190
|
-
let e = !1;
|
|
191
|
-
switch (t.code) {
|
|
192
|
-
case this.keys.UP:
|
|
193
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(r * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), e = !0;
|
|
194
|
-
break;
|
|
195
|
-
case this.keys.BOTTOM:
|
|
196
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-r * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), e = !0;
|
|
197
|
-
break;
|
|
198
|
-
case this.keys.LEFT:
|
|
199
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(r * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), e = !0;
|
|
200
|
-
break;
|
|
201
|
-
case this.keys.RIGHT:
|
|
202
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-r * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), e = !0;
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
e && (t.preventDefault(), this.update());
|
|
206
|
-
}
|
|
207
|
-
_handleTouchStartRotate(t) {
|
|
208
|
-
if (this._pointers.length === 1)
|
|
209
|
-
this._rotateStart.set(t.pageX, t.pageY);
|
|
210
|
-
else {
|
|
211
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
212
|
-
this._rotateStart.set(s, a);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
_handleTouchStartPan(t) {
|
|
216
|
-
if (this._pointers.length === 1)
|
|
217
|
-
this._panStart.set(t.pageX, t.pageY);
|
|
218
|
-
else {
|
|
219
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
220
|
-
this._panStart.set(s, a);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
_handleTouchStartDolly(t) {
|
|
224
|
-
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, h = Math.sqrt(s * s + a * a);
|
|
225
|
-
this._dollyStart.set(0, h);
|
|
226
|
-
}
|
|
227
|
-
_handleTouchStartDollyPan(t) {
|
|
228
|
-
this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
|
|
229
|
-
}
|
|
230
|
-
_handleTouchStartDollyRotate(t) {
|
|
231
|
-
this.enableZoom && this._handleTouchStartDolly(t), this.enableRotate && this._handleTouchStartRotate(t);
|
|
232
|
-
}
|
|
233
|
-
_handleTouchMoveRotate(t) {
|
|
234
|
-
if (this._pointers.length == 1)
|
|
235
|
-
this._rotateEnd.set(t.pageX, t.pageY);
|
|
236
|
-
else {
|
|
237
|
-
const s = this._getSecondPointerPosition(t), a = 0.5 * (t.pageX + s.x), h = 0.5 * (t.pageY + s.y);
|
|
238
|
-
this._rotateEnd.set(a, h);
|
|
239
|
-
}
|
|
240
|
-
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
241
|
-
const e = this.domElement;
|
|
242
|
-
this._rotateLeft(r * this._rotateDelta.x / e.clientHeight), this._rotateUp(r * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
243
|
-
}
|
|
244
|
-
_handleTouchMovePan(t) {
|
|
245
|
-
if (this._pointers.length === 1)
|
|
246
|
-
this._panEnd.set(t.pageX, t.pageY);
|
|
247
|
-
else {
|
|
248
|
-
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
249
|
-
this._panEnd.set(s, a);
|
|
250
|
-
}
|
|
251
|
-
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
252
|
-
}
|
|
253
|
-
_handleTouchMoveDolly(t) {
|
|
254
|
-
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, h = Math.sqrt(s * s + a * a);
|
|
255
|
-
this._dollyEnd.set(0, h), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
256
|
-
const l = (t.pageX + e.x) * 0.5, d = (t.pageY + e.y) * 0.5;
|
|
257
|
-
this._updateZoomParameters(l, d);
|
|
258
|
-
}
|
|
259
|
-
_handleTouchMoveDollyPan(t) {
|
|
260
|
-
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
261
|
-
}
|
|
262
|
-
_handleTouchMoveDollyRotate(t) {
|
|
263
|
-
this.enableZoom && this._handleTouchMoveDolly(t), this.enableRotate && this._handleTouchMoveRotate(t);
|
|
264
|
-
}
|
|
265
|
-
// pointers
|
|
266
|
-
_addPointer(t) {
|
|
267
|
-
this._pointers.push(t.pointerId);
|
|
268
|
-
}
|
|
269
|
-
_removePointer(t) {
|
|
270
|
-
delete this._pointerPositions[t.pointerId];
|
|
271
|
-
for (let e = 0; e < this._pointers.length; e++)
|
|
272
|
-
if (this._pointers[e] == t.pointerId) {
|
|
273
|
-
this._pointers.splice(e, 1);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
_isTrackingPointer(t) {
|
|
278
|
-
for (let e = 0; e < this._pointers.length; e++)
|
|
279
|
-
if (this._pointers[e] == t.pointerId) return !0;
|
|
280
|
-
return !1;
|
|
281
|
-
}
|
|
282
|
-
_trackPointer(t) {
|
|
283
|
-
let e = this._pointerPositions[t.pointerId];
|
|
284
|
-
e === void 0 && (e = new c(), this._pointerPositions[t.pointerId] = e), e.set(t.pageX, t.pageY);
|
|
285
|
-
}
|
|
286
|
-
_getSecondPointerPosition(t) {
|
|
287
|
-
const e = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
288
|
-
return this._pointerPositions[e];
|
|
289
|
-
}
|
|
290
|
-
//
|
|
291
|
-
_customWheelEvent(t) {
|
|
292
|
-
const e = t.deltaMode, s = {
|
|
293
|
-
clientX: t.clientX,
|
|
294
|
-
clientY: t.clientY,
|
|
295
|
-
deltaY: t.deltaY
|
|
296
|
-
};
|
|
297
|
-
switch (e) {
|
|
298
|
-
case 1:
|
|
299
|
-
s.deltaY *= 16;
|
|
300
|
-
break;
|
|
301
|
-
case 2:
|
|
302
|
-
s.deltaY *= 100;
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function A(i) {
|
|
309
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
|
|
310
|
-
}
|
|
311
|
-
function L(i) {
|
|
312
|
-
this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
|
|
313
|
-
}
|
|
314
|
-
function k(i) {
|
|
315
|
-
switch (this._removePointer(i), this._pointers.length) {
|
|
316
|
-
case 0:
|
|
317
|
-
this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(M), this.state = o.NONE;
|
|
318
|
-
break;
|
|
319
|
-
case 1:
|
|
320
|
-
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
321
|
-
this._onTouchStart({ pointerId: t, pageX: e.x, pageY: e.y });
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
function x(i) {
|
|
326
|
-
let t;
|
|
327
|
-
switch (i.button) {
|
|
328
|
-
case 0:
|
|
329
|
-
t = this.mouseButtons.LEFT;
|
|
330
|
-
break;
|
|
331
|
-
case 1:
|
|
332
|
-
t = this.mouseButtons.MIDDLE;
|
|
333
|
-
break;
|
|
334
|
-
case 2:
|
|
335
|
-
t = this.mouseButtons.RIGHT;
|
|
336
|
-
break;
|
|
337
|
-
default:
|
|
338
|
-
t = -1;
|
|
339
|
-
}
|
|
340
|
-
switch (t) {
|
|
341
|
-
case u.DOLLY:
|
|
342
|
-
if (this.enableZoom === !1) return;
|
|
343
|
-
this._handleMouseDownDolly(i), this.state = o.DOLLY;
|
|
344
|
-
break;
|
|
345
|
-
case u.ROTATE:
|
|
346
|
-
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
347
|
-
if (this.enablePan === !1) return;
|
|
348
|
-
this._handleMouseDownPan(i), this.state = o.PAN;
|
|
349
|
-
} else {
|
|
350
|
-
if (this.enableRotate === !1) return;
|
|
351
|
-
this._handleMouseDownRotate(i), this.state = o.ROTATE;
|
|
352
|
-
}
|
|
353
|
-
break;
|
|
354
|
-
case u.PAN:
|
|
355
|
-
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
356
|
-
if (this.enableRotate === !1) return;
|
|
357
|
-
this._handleMouseDownRotate(i), this.state = o.ROTATE;
|
|
358
|
-
} else {
|
|
359
|
-
if (this.enablePan === !1) return;
|
|
360
|
-
this._handleMouseDownPan(i), this.state = o.PAN;
|
|
361
|
-
}
|
|
362
|
-
break;
|
|
363
|
-
default:
|
|
364
|
-
this.state = o.NONE;
|
|
365
|
-
}
|
|
366
|
-
this.state !== o.NONE && this.dispatchEvent(b);
|
|
367
|
-
}
|
|
368
|
-
function C(i) {
|
|
369
|
-
switch (this.state) {
|
|
370
|
-
case o.ROTATE:
|
|
371
|
-
if (this.enableRotate === !1) return;
|
|
372
|
-
this._handleMouseMoveRotate(i);
|
|
373
|
-
break;
|
|
374
|
-
case o.DOLLY:
|
|
375
|
-
if (this.enableZoom === !1) return;
|
|
376
|
-
this._handleMouseMoveDolly(i);
|
|
377
|
-
break;
|
|
378
|
-
case o.PAN:
|
|
379
|
-
if (this.enablePan === !1) return;
|
|
380
|
-
this._handleMouseMovePan(i);
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
function N(i) {
|
|
385
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== o.NONE || (i.preventDefault(), this.dispatchEvent(b), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(M));
|
|
386
|
-
}
|
|
387
|
-
function Y(i) {
|
|
388
|
-
this.enabled !== !1 && this._handleKeyDown(i);
|
|
389
|
-
}
|
|
390
|
-
function I(i) {
|
|
391
|
-
switch (this._trackPointer(i), this._pointers.length) {
|
|
392
|
-
case 1:
|
|
393
|
-
switch (this.touches.ONE) {
|
|
394
|
-
case _.ROTATE:
|
|
395
|
-
if (this.enableRotate === !1) return;
|
|
396
|
-
this._handleTouchStartRotate(i), this.state = o.TOUCH_ROTATE;
|
|
397
|
-
break;
|
|
398
|
-
case _.PAN:
|
|
399
|
-
if (this.enablePan === !1) return;
|
|
400
|
-
this._handleTouchStartPan(i), this.state = o.TOUCH_PAN;
|
|
401
|
-
break;
|
|
402
|
-
default:
|
|
403
|
-
this.state = o.NONE;
|
|
404
|
-
}
|
|
405
|
-
break;
|
|
406
|
-
case 2:
|
|
407
|
-
switch (this.touches.TWO) {
|
|
408
|
-
case _.DOLLY_PAN:
|
|
409
|
-
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
410
|
-
this._handleTouchStartDollyPan(i), this.state = o.TOUCH_DOLLY_PAN;
|
|
411
|
-
break;
|
|
412
|
-
case _.DOLLY_ROTATE:
|
|
413
|
-
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
414
|
-
this._handleTouchStartDollyRotate(i), this.state = o.TOUCH_DOLLY_ROTATE;
|
|
415
|
-
break;
|
|
416
|
-
default:
|
|
417
|
-
this.state = o.NONE;
|
|
418
|
-
}
|
|
419
|
-
break;
|
|
420
|
-
default:
|
|
421
|
-
this.state = o.NONE;
|
|
422
|
-
}
|
|
423
|
-
this.state !== o.NONE && this.dispatchEvent(b);
|
|
424
|
-
}
|
|
425
|
-
function U(i) {
|
|
426
|
-
switch (this._trackPointer(i), this.state) {
|
|
427
|
-
case o.TOUCH_ROTATE:
|
|
428
|
-
if (this.enableRotate === !1) return;
|
|
429
|
-
this._handleTouchMoveRotate(i), this.update();
|
|
430
|
-
break;
|
|
431
|
-
case o.TOUCH_PAN:
|
|
432
|
-
if (this.enablePan === !1) return;
|
|
433
|
-
this._handleTouchMovePan(i), this.update();
|
|
434
|
-
break;
|
|
435
|
-
case o.TOUCH_DOLLY_PAN:
|
|
436
|
-
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
437
|
-
this._handleTouchMoveDollyPan(i), this.update();
|
|
438
|
-
break;
|
|
439
|
-
case o.TOUCH_DOLLY_ROTATE:
|
|
440
|
-
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
441
|
-
this._handleTouchMoveDollyRotate(i), this.update();
|
|
442
|
-
break;
|
|
443
|
-
default:
|
|
444
|
-
this.state = o.NONE;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
function Z(i) {
|
|
448
|
-
this.enabled !== !1 && i.preventDefault();
|
|
449
|
-
}
|
|
450
|
-
function z(i) {
|
|
451
|
-
i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
452
|
-
}
|
|
453
|
-
function K(i) {
|
|
454
|
-
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
455
|
-
}
|
|
456
|
-
export {
|
|
457
|
-
X as O
|
|
458
|
-
};
|