exploria-ui 2026.2.31 → 2026.3.2
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/README.md +240 -16
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/basic/ECard/ECard.vue.d.ts +27 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +60 -19368
- package/dist/directives/EDrag.d.ts +3 -1
- package/dist/directives/index.js +4 -23
- package/dist/index.css +1 -1
- package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +1111 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/controls/OrbitControls.js +424 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSCurve.js +31 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSUtils.js +115 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/libs/fflate.module.js +250 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/FBXLoader.js +1385 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/FontLoader.js +69 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1346 -0
- package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +23 -0
- package/dist/packages/exploria-ui/src/components/advanced/EParallaxScrolling/EParallaxScrolling.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/advanced/EParallaxScrolling/EParallaxScrolling.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/packages/exploria-ui/src/components/advanced/ERollingFollow/ERollingFollow.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/advanced/ERollingFollow/ERollingFollow.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/packages/exploria-ui/src/components/advanced/EVirtualList/EVirtualList.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/advanced/EVirtualList/EVirtualList.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/packages/exploria-ui/src/components/advanced/EWatermark/EWatermark.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/advanced/EWatermark/EWatermark.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/packages/exploria-ui/src/components/basic/EButton/EButton.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/basic/EButton/EButton.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/packages/exploria-ui/src/components/basic/EButton/loading.gif.js +4 -0
- package/dist/packages/exploria-ui/src/components/basic/ECard/ECard.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/basic/ECard/ECard.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/packages/exploria-ui/src/components/basic/ESvgIcon/ESvgIcon.vue.js +5 -0
- package/dist/packages/exploria-ui/src/components/basic/ESvgIcon/ESvgIcon.vue_vue_type_script_setup_true_lang.js +11 -0
- package/dist/packages/exploria-ui/src/components/basic/EUnderLine/EUnderLine.vue.js +11 -0
- package/dist/packages/exploria-ui/src/components/data/EAvatar/EAvatar.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/EAvatar/EAvatar.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/packages/exploria-ui/src/components/data/ECalendar.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ECalendar.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarousel.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarousel.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarouselItem.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ECarousel/ECarouselItem.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/packages/exploria-ui/src/components/data/ECodeCollapse/ECodeCollapse.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ECodeCollapse/ECodeCollapse.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/packages/exploria-ui/src/components/data/ECollapse/ECollapse.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ECollapse/ECollapse.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/packages/exploria-ui/src/components/data/EImage.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/EImage.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/packages/exploria-ui/src/components/data/EList.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/EList.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.js +36 -0
- package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/EMediaViewer/EMediaViewer.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/packages/exploria-ui/src/components/data/EProgress.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/EProgress.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/packages/exploria-ui/src/components/data/ERollingPagination.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ERollingPagination.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/packages/exploria-ui/src/components/data/ESkeleton/ESkeleton.vue.js +14 -0
- package/dist/packages/exploria-ui/src/components/data/ETable/ETable.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ETable/ETable.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/packages/exploria-ui/src/components/data/ETable/ETableColumn.vue.js +5 -0
- package/dist/packages/exploria-ui/src/components/data/ETable/ETableColumn.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/packages/exploria-ui/src/components/data/ETable/no_data.svg.js +4 -0
- package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimeline.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimeline.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimelineItem.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/data/ETimeline/ETimelineItem.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/packages/exploria-ui/src/components/feedback/EDialog/EDialog.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/EDialog/EDialog.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/packages/exploria-ui/src/components/feedback/EDrawer/EDrawer.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/EDrawer/EDrawer.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.js +56 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessage/EMessage.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessage/loading.gif.js +4 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.js +31 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/EMessageBox/EMessageBox.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.js +141 -0
- package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/ENotification/ENotification.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/packages/exploria-ui/src/components/feedback/EPopover.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/EPopover.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/packages/exploria-ui/src/components/feedback/ETooltip.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/feedback/ETooltip.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/packages/exploria-ui/src/components/form/ECheckbox.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/ECheckbox.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/packages/exploria-ui/src/components/form/EColorPicker.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EColorPicker.vue_vue_type_script_setup_true_lang.js +149 -0
- package/dist/packages/exploria-ui/src/components/form/EConditionGroup/EConditionGroup.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EConditionGroup/EConditionGroup.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/packages/exploria-ui/src/components/form/EFileSelector.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EFileSelector.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/packages/exploria-ui/src/components/form/EForm.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EForm.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/packages/exploria-ui/src/components/form/EFormItem.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EFormItem.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/packages/exploria-ui/src/components/form/EInput/EInput.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/EInput/EInput.vue_vue_type_script_setup_true_lang.js +165 -0
- package/dist/packages/exploria-ui/src/components/form/ERadio.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/ERadio.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/packages/exploria-ui/src/components/form/ESelect/ESelect.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/ESelect/ESelect.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/packages/exploria-ui/src/components/form/ESlider.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/ESlider.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/packages/exploria-ui/src/components/form/ETimePicker.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/form/ETimePicker.vue_vue_type_script_setup_true_lang.js +89 -0
- package/dist/packages/exploria-ui/src/components/geometry/ECube.vue.js +11 -0
- package/dist/packages/exploria-ui/src/components/hooks/usePosition.js +42 -0
- package/dist/packages/exploria-ui/src/components/layout/EContainerWithScrollbar.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/layout/EContainerWithScrollbar.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/packages/exploria-ui/src/components/layout/EDivider.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/layout/EDivider.vue_vue_type_script_setup_true_lang.js +15 -0
- package/dist/packages/exploria-ui/src/components/layout/EScrollX.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/layout/EScrollX.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/packages/exploria-ui/src/components/layout/EScrollbar.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/layout/EScrollbar.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/packages/exploria-ui/src/components/navigation/EDropdown.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/navigation/EDropdown.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabPane.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabPane.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabs.vue.js +7 -0
- package/dist/packages/exploria-ui/src/components/navigation/ETabs/ETabs.vue_vue_type_script_setup_true_lang.js +90 -0
- package/dist/packages/exploria-ui/src/directives/EDrag.js +27 -0
- package/dist/packages/exploria-ui/src/directives/ESizeOb.js +23 -0
- package/dist/packages/exploria-ui/src/directives/ESlideIn.js +24 -0
- package/dist/packages/exploria-ui/src/utils/EAnimateCSSUtil.js +13 -0
- package/dist/packages/exploria-ui/src/utils/EClipboardUtil.js +19 -0
- package/dist/packages/exploria-ui/src/utils/EDomUtil.js +9 -0
- package/dist/packages/exploria-ui/src/utils/EEchartsUtil.js +23 -0
- package/dist/packages/exploria-ui/src/utils/EImageUtil.js +26 -0
- package/dist/packages/exploria-ui/src/utils/ELocalStorageUtil.js +15 -0
- package/dist/packages/exploria-ui/src/utils/EMediaQueryUtil.js +28 -0
- package/dist/packages/exploria-ui/src/utils/EStringUtil.js +11 -0
- package/dist/packages/exploria-ui/src/utils/EThreeUtil.js +40 -0
- package/dist/packages/exploria-ui/src/utils/EUUIDUtil.js +11 -0
- package/dist/utils/EAnimateCSSUtil.d.ts +6 -0
- package/dist/utils/EClipboardUtil.d.ts +3 -0
- package/dist/utils/EDomUtil.d.ts +5 -0
- package/dist/utils/EEchartsUtil.d.ts +12 -0
- package/dist/utils/EEventBus.d.ts +8 -0
- package/dist/utils/EImageUtil.d.ts +3 -0
- package/dist/utils/EJSONUtil.d.ts +3 -0
- package/dist/utils/ELocalStorageUtil.d.ts +5 -0
- package/dist/utils/EMediaQueryUtil.d.ts +6 -0
- package/dist/utils/EStringUtil.d.ts +22 -0
- package/dist/utils/EThreeUtil.d.ts +21 -0
- package/dist/utils/ETimeUtil.d.ts +5 -0
- package/dist/utils/EUUIDUtil.d.ts +3 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -2
- package/package.json +25 -13
- package/src/plugins/EPreloadImageBuilder.ts +1 -1
- package/src/plugins/ESvgSpriteBuilder.ts +4 -5
- package/src/plugins/index.ts +3 -3
- package/dist/EDomUtil-Bm3Zqw96.js +0 -65
- package/dist/ESizeOb-VeHF4XTz.js +0 -44
- package/dist/plugins/EPreloadImageBuilder.d.ts +0 -5
- package/dist/plugins/ESvgPolyfill.d.ts +0 -3
- package/dist/plugins/ESvgSpriteBuilder.d.ts +0 -6
- package/dist/plugins/index.d.ts +0 -4
- package/dist/plugins/index.js +0 -3127
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { Controls as e, MOUSE as t, MathUtils as n, Plane as r, Quaternion as i, Ray as a, Spherical as o, TOUCH as s, Vector2 as c, Vector3 as l } from "three";
|
|
2
|
+
//#region ../../node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/controls/OrbitControls.js
|
|
3
|
+
var u = { type: "change" }, d = { type: "start" }, f = { type: "end" }, p = new a(), m = new r(), h = Math.cos(70 * n.DEG2RAD), g = new l(), _ = 2 * Math.PI, v = {
|
|
4
|
+
NONE: -1,
|
|
5
|
+
ROTATE: 0,
|
|
6
|
+
DOLLY: 1,
|
|
7
|
+
PAN: 2,
|
|
8
|
+
TOUCH_ROTATE: 3,
|
|
9
|
+
TOUCH_PAN: 4,
|
|
10
|
+
TOUCH_DOLLY_PAN: 5,
|
|
11
|
+
TOUCH_DOLLY_ROTATE: 6
|
|
12
|
+
}, y = 1e-6, b = class extends e {
|
|
13
|
+
constructor(e, n = null) {
|
|
14
|
+
super(e, n), this.state = v.NONE, this.target = new l(), this.cursor = new l(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minTargetRadius = 0, this.maxTargetRadius = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .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 = {
|
|
15
|
+
LEFT: "ArrowLeft",
|
|
16
|
+
UP: "ArrowUp",
|
|
17
|
+
RIGHT: "ArrowRight",
|
|
18
|
+
BOTTOM: "ArrowDown"
|
|
19
|
+
}, this.mouseButtons = {
|
|
20
|
+
LEFT: t.ROTATE,
|
|
21
|
+
MIDDLE: t.DOLLY,
|
|
22
|
+
RIGHT: t.PAN
|
|
23
|
+
}, this.touches = {
|
|
24
|
+
ONE: s.ROTATE,
|
|
25
|
+
TWO: s.DOLLY_PAN
|
|
26
|
+
}, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new l(), this._lastQuaternion = new i(), this._lastTargetPosition = new l(), this._quat = new i().setFromUnitVectors(e.up, new l(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new o(), this._sphericalDelta = new o(), this._scale = 1, this._panOffset = new l(), 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 l(), this._mouse = new c(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = S.bind(this), this._onPointerDown = x.bind(this), this._onPointerUp = C.bind(this), this._onContextMenu = A.bind(this), this._onMouseWheel = E.bind(this), this._onKeyDown = D.bind(this), this._onTouchStart = O.bind(this), this._onTouchMove = k.bind(this), this._onMouseDown = w.bind(this), this._onMouseMove = T.bind(this), this._interceptControlDown = j.bind(this), this._interceptControlUp = M.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
27
|
+
}
|
|
28
|
+
connect(e) {
|
|
29
|
+
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, {
|
|
30
|
+
passive: !0,
|
|
31
|
+
capture: !0
|
|
32
|
+
}), this.domElement.style.touchAction = "none";
|
|
33
|
+
}
|
|
34
|
+
disconnect() {
|
|
35
|
+
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";
|
|
36
|
+
}
|
|
37
|
+
dispose() {
|
|
38
|
+
this.disconnect();
|
|
39
|
+
}
|
|
40
|
+
getPolarAngle() {
|
|
41
|
+
return this._spherical.phi;
|
|
42
|
+
}
|
|
43
|
+
getAzimuthalAngle() {
|
|
44
|
+
return this._spherical.theta;
|
|
45
|
+
}
|
|
46
|
+
getDistance() {
|
|
47
|
+
return this.object.position.distanceTo(this.target);
|
|
48
|
+
}
|
|
49
|
+
listenToKeyEvents(e) {
|
|
50
|
+
e.addEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = e;
|
|
51
|
+
}
|
|
52
|
+
stopListenToKeyEvents() {
|
|
53
|
+
this._domElementKeyEvents !== null && (this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown), this._domElementKeyEvents = null);
|
|
54
|
+
}
|
|
55
|
+
saveState() {
|
|
56
|
+
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
57
|
+
}
|
|
58
|
+
reset() {
|
|
59
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(u), this.update(), this.state = v.NONE;
|
|
60
|
+
}
|
|
61
|
+
update(e = null) {
|
|
62
|
+
let t = this.object.position;
|
|
63
|
+
g.copy(t).sub(this.target), g.applyQuaternion(this._quat), this._spherical.setFromVector3(g), this.autoRotate && this.state === v.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
64
|
+
let n = this.minAzimuthAngle, r = this.maxAzimuthAngle;
|
|
65
|
+
isFinite(n) && isFinite(r) && (n < -Math.PI ? n += _ : n > Math.PI && (n -= _), r < -Math.PI ? r += _ : r > Math.PI && (r -= _), n <= r ? this._spherical.theta = Math.max(n, Math.min(r, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + r) / 2 ? Math.max(n, this._spherical.theta) : Math.min(r, 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);
|
|
66
|
+
let i = !1;
|
|
67
|
+
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera) this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
68
|
+
else {
|
|
69
|
+
let e = this._spherical.radius;
|
|
70
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), i = e != this._spherical.radius;
|
|
71
|
+
}
|
|
72
|
+
if (g.setFromSpherical(this._spherical), g.applyQuaternion(this._quatInverse), t.copy(this.target).add(g), 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) {
|
|
73
|
+
let e = null;
|
|
74
|
+
if (this.object.isPerspectiveCamera) {
|
|
75
|
+
let t = g.length();
|
|
76
|
+
e = this._clampDistance(t * this._scale);
|
|
77
|
+
let n = t - e;
|
|
78
|
+
this.object.position.addScaledVector(this._dollyDirection, n), this.object.updateMatrixWorld(), i = !!n;
|
|
79
|
+
} else if (this.object.isOrthographicCamera) {
|
|
80
|
+
let t = new l(this._mouse.x, this._mouse.y, 0);
|
|
81
|
+
t.unproject(this.object);
|
|
82
|
+
let n = this.object.zoom;
|
|
83
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), i = n !== this.object.zoom;
|
|
84
|
+
let r = new l(this._mouse.x, this._mouse.y, 0);
|
|
85
|
+
r.unproject(this.object), this.object.position.sub(r).add(t), this.object.updateMatrixWorld(), e = g.length();
|
|
86
|
+
} else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
87
|
+
e !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position) : (p.origin.copy(this.object.position), p.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(p.direction)) < h ? this.object.lookAt(this.target) : (m.setFromNormalAndCoplanarPoint(this.object.up, this.target), p.intersectPlane(m, this.target))));
|
|
88
|
+
} else if (this.object.isOrthographicCamera) {
|
|
89
|
+
let e = this.object.zoom;
|
|
90
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), e !== this.object.zoom && (this.object.updateProjectionMatrix(), i = !0);
|
|
91
|
+
}
|
|
92
|
+
return this._scale = 1, this._performCursorZoom = !1, i || this._lastPosition.distanceToSquared(this.object.position) > y || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > y || this._lastTargetPosition.distanceToSquared(this.target) > y ? (this.dispatchEvent(u), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
93
|
+
}
|
|
94
|
+
_getAutoRotationAngle(e) {
|
|
95
|
+
return e === null ? _ / 60 / 60 * this.autoRotateSpeed : _ / 60 * this.autoRotateSpeed * e;
|
|
96
|
+
}
|
|
97
|
+
_getZoomScale(e) {
|
|
98
|
+
let t = Math.abs(e * .01);
|
|
99
|
+
return .95 ** (this.zoomSpeed * t);
|
|
100
|
+
}
|
|
101
|
+
_rotateLeft(e) {
|
|
102
|
+
this._sphericalDelta.theta -= e;
|
|
103
|
+
}
|
|
104
|
+
_rotateUp(e) {
|
|
105
|
+
this._sphericalDelta.phi -= e;
|
|
106
|
+
}
|
|
107
|
+
_panLeft(e, t) {
|
|
108
|
+
g.setFromMatrixColumn(t, 0), g.multiplyScalar(-e), this._panOffset.add(g);
|
|
109
|
+
}
|
|
110
|
+
_panUp(e, t) {
|
|
111
|
+
this.screenSpacePanning === !0 ? g.setFromMatrixColumn(t, 1) : (g.setFromMatrixColumn(t, 0), g.crossVectors(this.object.up, g)), g.multiplyScalar(e), this._panOffset.add(g);
|
|
112
|
+
}
|
|
113
|
+
_pan(e, t) {
|
|
114
|
+
let n = this.domElement;
|
|
115
|
+
if (this.object.isPerspectiveCamera) {
|
|
116
|
+
let r = this.object.position;
|
|
117
|
+
g.copy(r).sub(this.target);
|
|
118
|
+
let i = g.length();
|
|
119
|
+
i *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * i / n.clientHeight, this.object.matrix), this._panUp(2 * t * i / n.clientHeight, this.object.matrix);
|
|
120
|
+
} else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / n.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / n.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
121
|
+
}
|
|
122
|
+
_dollyOut(e) {
|
|
123
|
+
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
124
|
+
}
|
|
125
|
+
_dollyIn(e) {
|
|
126
|
+
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
127
|
+
}
|
|
128
|
+
_updateZoomParameters(e, t) {
|
|
129
|
+
if (!this.zoomToCursor) return;
|
|
130
|
+
this._performCursorZoom = !0;
|
|
131
|
+
let n = this.domElement.getBoundingClientRect(), r = e - n.left, i = t - n.top, a = n.width, o = n.height;
|
|
132
|
+
this._mouse.x = r / a * 2 - 1, this._mouse.y = -(i / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
133
|
+
}
|
|
134
|
+
_clampDistance(e) {
|
|
135
|
+
return Math.max(this.minDistance, Math.min(this.maxDistance, e));
|
|
136
|
+
}
|
|
137
|
+
_handleMouseDownRotate(e) {
|
|
138
|
+
this._rotateStart.set(e.clientX, e.clientY);
|
|
139
|
+
}
|
|
140
|
+
_handleMouseDownDolly(e) {
|
|
141
|
+
this._updateZoomParameters(e.clientX, e.clientX), this._dollyStart.set(e.clientX, e.clientY);
|
|
142
|
+
}
|
|
143
|
+
_handleMouseDownPan(e) {
|
|
144
|
+
this._panStart.set(e.clientX, e.clientY);
|
|
145
|
+
}
|
|
146
|
+
_handleMouseMoveRotate(e) {
|
|
147
|
+
this._rotateEnd.set(e.clientX, e.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
148
|
+
let t = this.domElement;
|
|
149
|
+
this._rotateLeft(_ * this._rotateDelta.x / t.clientHeight), this._rotateUp(_ * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
150
|
+
}
|
|
151
|
+
_handleMouseMoveDolly(e) {
|
|
152
|
+
this._dollyEnd.set(e.clientX, e.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
153
|
+
}
|
|
154
|
+
_handleMouseMovePan(e) {
|
|
155
|
+
this._panEnd.set(e.clientX, e.clientY), this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd), this.update();
|
|
156
|
+
}
|
|
157
|
+
_handleMouseWheel(e) {
|
|
158
|
+
this._updateZoomParameters(e.clientX, e.clientY), e.deltaY < 0 ? this._dollyIn(this._getZoomScale(e.deltaY)) : e.deltaY > 0 && this._dollyOut(this._getZoomScale(e.deltaY)), this.update();
|
|
159
|
+
}
|
|
160
|
+
_handleKeyDown(e) {
|
|
161
|
+
let t = !1;
|
|
162
|
+
switch (e.code) {
|
|
163
|
+
case this.keys.UP:
|
|
164
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(_ * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), t = !0;
|
|
165
|
+
break;
|
|
166
|
+
case this.keys.BOTTOM:
|
|
167
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateUp(-_ * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), t = !0;
|
|
168
|
+
break;
|
|
169
|
+
case this.keys.LEFT:
|
|
170
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(_ * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), t = !0;
|
|
171
|
+
break;
|
|
172
|
+
case this.keys.RIGHT:
|
|
173
|
+
e.ctrlKey || e.metaKey || e.shiftKey ? this.enableRotate && this._rotateLeft(-_ * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), t = !0;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
t && (e.preventDefault(), this.update());
|
|
177
|
+
}
|
|
178
|
+
_handleTouchStartRotate(e) {
|
|
179
|
+
if (this._pointers.length === 1) this._rotateStart.set(e.pageX, e.pageY);
|
|
180
|
+
else {
|
|
181
|
+
let t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
|
|
182
|
+
this._rotateStart.set(n, r);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
_handleTouchStartPan(e) {
|
|
186
|
+
if (this._pointers.length === 1) this._panStart.set(e.pageX, e.pageY);
|
|
187
|
+
else {
|
|
188
|
+
let t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
|
|
189
|
+
this._panStart.set(n, r);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
_handleTouchStartDolly(e) {
|
|
193
|
+
let t = this._getSecondPointerPosition(e), n = e.pageX - t.x, r = e.pageY - t.y, i = Math.sqrt(n * n + r * r);
|
|
194
|
+
this._dollyStart.set(0, i);
|
|
195
|
+
}
|
|
196
|
+
_handleTouchStartDollyPan(e) {
|
|
197
|
+
this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
|
|
198
|
+
}
|
|
199
|
+
_handleTouchStartDollyRotate(e) {
|
|
200
|
+
this.enableZoom && this._handleTouchStartDolly(e), this.enableRotate && this._handleTouchStartRotate(e);
|
|
201
|
+
}
|
|
202
|
+
_handleTouchMoveRotate(e) {
|
|
203
|
+
if (this._pointers.length == 1) this._rotateEnd.set(e.pageX, e.pageY);
|
|
204
|
+
else {
|
|
205
|
+
let t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
|
|
206
|
+
this._rotateEnd.set(n, r);
|
|
207
|
+
}
|
|
208
|
+
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
209
|
+
let t = this.domElement;
|
|
210
|
+
this._rotateLeft(_ * this._rotateDelta.x / t.clientHeight), this._rotateUp(_ * this._rotateDelta.y / t.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
211
|
+
}
|
|
212
|
+
_handleTouchMovePan(e) {
|
|
213
|
+
if (this._pointers.length === 1) this._panEnd.set(e.pageX, e.pageY);
|
|
214
|
+
else {
|
|
215
|
+
let t = this._getSecondPointerPosition(e), n = .5 * (e.pageX + t.x), r = .5 * (e.pageY + t.y);
|
|
216
|
+
this._panEnd.set(n, r);
|
|
217
|
+
}
|
|
218
|
+
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
219
|
+
}
|
|
220
|
+
_handleTouchMoveDolly(e) {
|
|
221
|
+
let t = this._getSecondPointerPosition(e), n = e.pageX - t.x, r = e.pageY - t.y, i = Math.sqrt(n * n + r * r);
|
|
222
|
+
this._dollyEnd.set(0, i), this._dollyDelta.set(0, (this._dollyEnd.y / this._dollyStart.y) ** +this.zoomSpeed), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
223
|
+
let a = (e.pageX + t.x) * .5, o = (e.pageY + t.y) * .5;
|
|
224
|
+
this._updateZoomParameters(a, o);
|
|
225
|
+
}
|
|
226
|
+
_handleTouchMoveDollyPan(e) {
|
|
227
|
+
this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
|
|
228
|
+
}
|
|
229
|
+
_handleTouchMoveDollyRotate(e) {
|
|
230
|
+
this.enableZoom && this._handleTouchMoveDolly(e), this.enableRotate && this._handleTouchMoveRotate(e);
|
|
231
|
+
}
|
|
232
|
+
_addPointer(e) {
|
|
233
|
+
this._pointers.push(e.pointerId);
|
|
234
|
+
}
|
|
235
|
+
_removePointer(e) {
|
|
236
|
+
delete this._pointerPositions[e.pointerId];
|
|
237
|
+
for (let t = 0; t < this._pointers.length; t++) if (this._pointers[t] == e.pointerId) {
|
|
238
|
+
this._pointers.splice(t, 1);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
_isTrackingPointer(e) {
|
|
243
|
+
for (let t = 0; t < this._pointers.length; t++) if (this._pointers[t] == e.pointerId) return !0;
|
|
244
|
+
return !1;
|
|
245
|
+
}
|
|
246
|
+
_trackPointer(e) {
|
|
247
|
+
let t = this._pointerPositions[e.pointerId];
|
|
248
|
+
t === void 0 && (t = new c(), this._pointerPositions[e.pointerId] = t), t.set(e.pageX, e.pageY);
|
|
249
|
+
}
|
|
250
|
+
_getSecondPointerPosition(e) {
|
|
251
|
+
let t = e.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
252
|
+
return this._pointerPositions[t];
|
|
253
|
+
}
|
|
254
|
+
_customWheelEvent(e) {
|
|
255
|
+
let t = e.deltaMode, n = {
|
|
256
|
+
clientX: e.clientX,
|
|
257
|
+
clientY: e.clientY,
|
|
258
|
+
deltaY: e.deltaY
|
|
259
|
+
};
|
|
260
|
+
switch (t) {
|
|
261
|
+
case 1:
|
|
262
|
+
n.deltaY *= 16;
|
|
263
|
+
break;
|
|
264
|
+
case 2:
|
|
265
|
+
n.deltaY *= 100;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
function x(e) {
|
|
272
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(e.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(e) && (this._addPointer(e), e.pointerType === "touch" ? this._onTouchStart(e) : this._onMouseDown(e)));
|
|
273
|
+
}
|
|
274
|
+
function S(e) {
|
|
275
|
+
this.enabled !== !1 && (e.pointerType === "touch" ? this._onTouchMove(e) : this._onMouseMove(e));
|
|
276
|
+
}
|
|
277
|
+
function C(e) {
|
|
278
|
+
switch (this._removePointer(e), this._pointers.length) {
|
|
279
|
+
case 0:
|
|
280
|
+
this.domElement.releasePointerCapture(e.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(f), this.state = v.NONE;
|
|
281
|
+
break;
|
|
282
|
+
case 1:
|
|
283
|
+
let t = this._pointers[0], n = this._pointerPositions[t];
|
|
284
|
+
this._onTouchStart({
|
|
285
|
+
pointerId: t,
|
|
286
|
+
pageX: n.x,
|
|
287
|
+
pageY: n.y
|
|
288
|
+
});
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function w(e) {
|
|
293
|
+
let n;
|
|
294
|
+
switch (e.button) {
|
|
295
|
+
case 0:
|
|
296
|
+
n = this.mouseButtons.LEFT;
|
|
297
|
+
break;
|
|
298
|
+
case 1:
|
|
299
|
+
n = this.mouseButtons.MIDDLE;
|
|
300
|
+
break;
|
|
301
|
+
case 2:
|
|
302
|
+
n = this.mouseButtons.RIGHT;
|
|
303
|
+
break;
|
|
304
|
+
default: n = -1;
|
|
305
|
+
}
|
|
306
|
+
switch (n) {
|
|
307
|
+
case t.DOLLY:
|
|
308
|
+
if (this.enableZoom === !1) return;
|
|
309
|
+
this._handleMouseDownDolly(e), this.state = v.DOLLY;
|
|
310
|
+
break;
|
|
311
|
+
case t.ROTATE:
|
|
312
|
+
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
313
|
+
if (this.enablePan === !1) return;
|
|
314
|
+
this._handleMouseDownPan(e), this.state = v.PAN;
|
|
315
|
+
} else {
|
|
316
|
+
if (this.enableRotate === !1) return;
|
|
317
|
+
this._handleMouseDownRotate(e), this.state = v.ROTATE;
|
|
318
|
+
}
|
|
319
|
+
break;
|
|
320
|
+
case t.PAN:
|
|
321
|
+
if (e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
322
|
+
if (this.enableRotate === !1) return;
|
|
323
|
+
this._handleMouseDownRotate(e), this.state = v.ROTATE;
|
|
324
|
+
} else {
|
|
325
|
+
if (this.enablePan === !1) return;
|
|
326
|
+
this._handleMouseDownPan(e), this.state = v.PAN;
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
default: this.state = v.NONE;
|
|
330
|
+
}
|
|
331
|
+
this.state !== v.NONE && this.dispatchEvent(d);
|
|
332
|
+
}
|
|
333
|
+
function T(e) {
|
|
334
|
+
switch (this.state) {
|
|
335
|
+
case v.ROTATE:
|
|
336
|
+
if (this.enableRotate === !1) return;
|
|
337
|
+
this._handleMouseMoveRotate(e);
|
|
338
|
+
break;
|
|
339
|
+
case v.DOLLY:
|
|
340
|
+
if (this.enableZoom === !1) return;
|
|
341
|
+
this._handleMouseMoveDolly(e);
|
|
342
|
+
break;
|
|
343
|
+
case v.PAN:
|
|
344
|
+
if (this.enablePan === !1) return;
|
|
345
|
+
this._handleMouseMovePan(e);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function E(e) {
|
|
350
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== v.NONE || (e.preventDefault(), this.dispatchEvent(d), this._handleMouseWheel(this._customWheelEvent(e)), this.dispatchEvent(f));
|
|
351
|
+
}
|
|
352
|
+
function D(e) {
|
|
353
|
+
this.enabled !== !1 && this._handleKeyDown(e);
|
|
354
|
+
}
|
|
355
|
+
function O(e) {
|
|
356
|
+
switch (this._trackPointer(e), this._pointers.length) {
|
|
357
|
+
case 1:
|
|
358
|
+
switch (this.touches.ONE) {
|
|
359
|
+
case s.ROTATE:
|
|
360
|
+
if (this.enableRotate === !1) return;
|
|
361
|
+
this._handleTouchStartRotate(e), this.state = v.TOUCH_ROTATE;
|
|
362
|
+
break;
|
|
363
|
+
case s.PAN:
|
|
364
|
+
if (this.enablePan === !1) return;
|
|
365
|
+
this._handleTouchStartPan(e), this.state = v.TOUCH_PAN;
|
|
366
|
+
break;
|
|
367
|
+
default: this.state = v.NONE;
|
|
368
|
+
}
|
|
369
|
+
break;
|
|
370
|
+
case 2:
|
|
371
|
+
switch (this.touches.TWO) {
|
|
372
|
+
case s.DOLLY_PAN:
|
|
373
|
+
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
374
|
+
this._handleTouchStartDollyPan(e), this.state = v.TOUCH_DOLLY_PAN;
|
|
375
|
+
break;
|
|
376
|
+
case s.DOLLY_ROTATE:
|
|
377
|
+
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
378
|
+
this._handleTouchStartDollyRotate(e), this.state = v.TOUCH_DOLLY_ROTATE;
|
|
379
|
+
break;
|
|
380
|
+
default: this.state = v.NONE;
|
|
381
|
+
}
|
|
382
|
+
break;
|
|
383
|
+
default: this.state = v.NONE;
|
|
384
|
+
}
|
|
385
|
+
this.state !== v.NONE && this.dispatchEvent(d);
|
|
386
|
+
}
|
|
387
|
+
function k(e) {
|
|
388
|
+
switch (this._trackPointer(e), this.state) {
|
|
389
|
+
case v.TOUCH_ROTATE:
|
|
390
|
+
if (this.enableRotate === !1) return;
|
|
391
|
+
this._handleTouchMoveRotate(e), this.update();
|
|
392
|
+
break;
|
|
393
|
+
case v.TOUCH_PAN:
|
|
394
|
+
if (this.enablePan === !1) return;
|
|
395
|
+
this._handleTouchMovePan(e), this.update();
|
|
396
|
+
break;
|
|
397
|
+
case v.TOUCH_DOLLY_PAN:
|
|
398
|
+
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
399
|
+
this._handleTouchMoveDollyPan(e), this.update();
|
|
400
|
+
break;
|
|
401
|
+
case v.TOUCH_DOLLY_ROTATE:
|
|
402
|
+
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
403
|
+
this._handleTouchMoveDollyRotate(e), this.update();
|
|
404
|
+
break;
|
|
405
|
+
default: this.state = v.NONE;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function A(e) {
|
|
409
|
+
this.enabled !== !1 && e.preventDefault();
|
|
410
|
+
}
|
|
411
|
+
function j(e) {
|
|
412
|
+
e.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, {
|
|
413
|
+
passive: !0,
|
|
414
|
+
capture: !0
|
|
415
|
+
}));
|
|
416
|
+
}
|
|
417
|
+
function M(e) {
|
|
418
|
+
e.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, {
|
|
419
|
+
passive: !0,
|
|
420
|
+
capture: !0
|
|
421
|
+
}));
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
export { b as OrbitControls };
|
package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSCurve.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { calcBSplinePoint as e, calcNURBSDerivatives as t } from "./NURBSUtils.js";
|
|
2
|
+
import { Curve as n, Vector3 as r, Vector4 as i } from "three";
|
|
3
|
+
//#region ../../node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSCurve.js
|
|
4
|
+
var a = class extends n {
|
|
5
|
+
constructor(e, t, n, r, a) {
|
|
6
|
+
super();
|
|
7
|
+
let o = t ? t.length - 1 : 0, s = n ? n.length : 0;
|
|
8
|
+
this.degree = e, this.knots = t, this.controlPoints = [], this.startKnot = r || 0, this.endKnot = a || o;
|
|
9
|
+
for (let e = 0; e < s; ++e) {
|
|
10
|
+
let t = n[e];
|
|
11
|
+
this.controlPoints[e] = new i(t.x, t.y, t.z, t.w);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
getPoint(t, n = new r()) {
|
|
15
|
+
let i = n, a = this.knots[this.startKnot] + t * (this.knots[this.endKnot] - this.knots[this.startKnot]), o = e(this.degree, this.knots, this.controlPoints, a);
|
|
16
|
+
return o.w !== 1 && o.divideScalar(o.w), i.set(o.x, o.y, o.z);
|
|
17
|
+
}
|
|
18
|
+
getTangent(e, n = new r()) {
|
|
19
|
+
let i = n, a = this.knots[0] + e * (this.knots[this.knots.length - 1] - this.knots[0]), o = t(this.degree, this.knots, this.controlPoints, a, 1);
|
|
20
|
+
return i.copy(o[1]).normalize(), i;
|
|
21
|
+
}
|
|
22
|
+
toJSON() {
|
|
23
|
+
let e = super.toJSON();
|
|
24
|
+
return e.degree = this.degree, e.knots = [...this.knots], e.controlPoints = this.controlPoints.map((e) => e.toArray()), e.startKnot = this.startKnot, e.endKnot = this.endKnot, e;
|
|
25
|
+
}
|
|
26
|
+
fromJSON(e) {
|
|
27
|
+
return super.fromJSON(e), this.degree = e.degree, this.knots = [...e.knots], this.controlPoints = e.controlPoints.map((e) => new i(e[0], e[1], e[2], e[3])), this.startKnot = e.startKnot, this.endKnot = e.endKnot, this;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { a as NURBSCurve };
|
package/dist/node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSUtils.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Vector3 as e, Vector4 as t } from "three";
|
|
2
|
+
//#region ../../node_modules/.pnpm/three@0.180.0/node_modules/three/examples/jsm/curves/NURBSUtils.js
|
|
3
|
+
function n(e, t, n) {
|
|
4
|
+
let r = n.length - e - 1;
|
|
5
|
+
if (t >= n[r]) return r - 1;
|
|
6
|
+
if (t <= n[e]) return e;
|
|
7
|
+
let i = e, a = r, o = Math.floor((i + a) / 2);
|
|
8
|
+
for (; t < n[o] || t >= n[o + 1];) t < n[o] ? a = o : i = o, o = Math.floor((i + a) / 2);
|
|
9
|
+
return o;
|
|
10
|
+
}
|
|
11
|
+
function r(e, t, n, r) {
|
|
12
|
+
let i = [], a = [], o = [];
|
|
13
|
+
i[0] = 1;
|
|
14
|
+
for (let s = 1; s <= n; ++s) {
|
|
15
|
+
a[s] = t - r[e + 1 - s], o[s] = r[e + s] - t;
|
|
16
|
+
let n = 0;
|
|
17
|
+
for (let e = 0; e < s; ++e) {
|
|
18
|
+
let t = o[e + 1], r = a[s - e], c = i[e] / (t + r);
|
|
19
|
+
i[e] = n + t * c, n = r * c;
|
|
20
|
+
}
|
|
21
|
+
i[s] = n;
|
|
22
|
+
}
|
|
23
|
+
return i;
|
|
24
|
+
}
|
|
25
|
+
function i(e, i, a, o) {
|
|
26
|
+
let s = n(e, o, i), c = r(s, o, e, i), l = new t(0, 0, 0, 0);
|
|
27
|
+
for (let t = 0; t <= e; ++t) {
|
|
28
|
+
let n = a[s - e + t], r = c[t], i = n.w * r;
|
|
29
|
+
l.x += n.x * i, l.y += n.y * i, l.z += n.z * i, l.w += n.w * r;
|
|
30
|
+
}
|
|
31
|
+
return l;
|
|
32
|
+
}
|
|
33
|
+
function a(e, t, n, r, i) {
|
|
34
|
+
let a = [];
|
|
35
|
+
for (let e = 0; e <= n; ++e) a[e] = 0;
|
|
36
|
+
let o = [];
|
|
37
|
+
for (let e = 0; e <= r; ++e) o[e] = a.slice(0);
|
|
38
|
+
let s = [];
|
|
39
|
+
for (let e = 0; e <= n; ++e) s[e] = a.slice(0);
|
|
40
|
+
s[0][0] = 1;
|
|
41
|
+
let c = a.slice(0), l = a.slice(0);
|
|
42
|
+
for (let r = 1; r <= n; ++r) {
|
|
43
|
+
c[r] = t - i[e + 1 - r], l[r] = i[e + r] - t;
|
|
44
|
+
let n = 0;
|
|
45
|
+
for (let e = 0; e < r; ++e) {
|
|
46
|
+
let t = l[e + 1], i = c[r - e];
|
|
47
|
+
s[r][e] = t + i;
|
|
48
|
+
let a = s[e][r - 1] / s[r][e];
|
|
49
|
+
s[e][r] = n + t * a, n = i * a;
|
|
50
|
+
}
|
|
51
|
+
s[r][r] = n;
|
|
52
|
+
}
|
|
53
|
+
for (let e = 0; e <= n; ++e) o[0][e] = s[e][n];
|
|
54
|
+
for (let e = 0; e <= n; ++e) {
|
|
55
|
+
let t = 0, i = 1, c = [];
|
|
56
|
+
for (let e = 0; e <= n; ++e) c[e] = a.slice(0);
|
|
57
|
+
c[0][0] = 1;
|
|
58
|
+
for (let a = 1; a <= r; ++a) {
|
|
59
|
+
let r = 0, l = e - a, u = n - a;
|
|
60
|
+
e >= a && (c[i][0] = c[t][0] / s[u + 1][l], r = c[i][0] * s[l][u]);
|
|
61
|
+
let d = l >= -1 ? 1 : -l, f = e - 1 <= u ? a - 1 : n - e;
|
|
62
|
+
for (let e = d; e <= f; ++e) c[i][e] = (c[t][e] - c[t][e - 1]) / s[u + 1][l + e], r += c[i][e] * s[l + e][u];
|
|
63
|
+
e <= u && (c[i][a] = -c[t][a - 1] / s[u + 1][e], r += c[i][a] * s[e][u]), o[a][e] = r;
|
|
64
|
+
let p = t;
|
|
65
|
+
t = i, i = p;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let u = n;
|
|
69
|
+
for (let e = 1; e <= r; ++e) {
|
|
70
|
+
for (let t = 0; t <= n; ++t) o[e][t] *= u;
|
|
71
|
+
u *= n - e;
|
|
72
|
+
}
|
|
73
|
+
return o;
|
|
74
|
+
}
|
|
75
|
+
function o(e, r, i, o, s) {
|
|
76
|
+
let c = s < e ? s : e, l = [], u = n(e, o, r), d = a(u, o, e, c, r), f = [];
|
|
77
|
+
for (let e = 0; e < i.length; ++e) {
|
|
78
|
+
let t = i[e].clone(), n = t.w;
|
|
79
|
+
t.x *= n, t.y *= n, t.z *= n, f[e] = t;
|
|
80
|
+
}
|
|
81
|
+
for (let t = 0; t <= c; ++t) {
|
|
82
|
+
let n = f[u - e].clone().multiplyScalar(d[t][0]);
|
|
83
|
+
for (let r = 1; r <= e; ++r) n.add(f[u - e + r].clone().multiplyScalar(d[t][r]));
|
|
84
|
+
l[t] = n;
|
|
85
|
+
}
|
|
86
|
+
for (let e = c + 1; e <= s + 1; ++e) l[e] = new t(0, 0, 0);
|
|
87
|
+
return l;
|
|
88
|
+
}
|
|
89
|
+
function s(e, t) {
|
|
90
|
+
let n = 1;
|
|
91
|
+
for (let t = 2; t <= e; ++t) n *= t;
|
|
92
|
+
let r = 1;
|
|
93
|
+
for (let e = 2; e <= t; ++e) r *= e;
|
|
94
|
+
for (let n = 2; n <= e - t; ++n) r *= n;
|
|
95
|
+
return n / r;
|
|
96
|
+
}
|
|
97
|
+
function c(t) {
|
|
98
|
+
let n = t.length, r = [], i = [];
|
|
99
|
+
for (let a = 0; a < n; ++a) {
|
|
100
|
+
let n = t[a];
|
|
101
|
+
r[a] = new e(n.x, n.y, n.z), i[a] = n.w;
|
|
102
|
+
}
|
|
103
|
+
let a = [];
|
|
104
|
+
for (let e = 0; e < n; ++e) {
|
|
105
|
+
let t = r[e].clone();
|
|
106
|
+
for (let n = 1; n <= e; ++n) t.sub(a[e - n].clone().multiplyScalar(s(e, n) * i[n]));
|
|
107
|
+
a[e] = t.divideScalar(i[0]);
|
|
108
|
+
}
|
|
109
|
+
return a;
|
|
110
|
+
}
|
|
111
|
+
function l(e, t, n, r, i) {
|
|
112
|
+
return c(o(e, t, n, r, i));
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { i as calcBSplinePoint, l as calcNURBSDerivatives };
|