@rubin-epo/epo-widget-lib 1.1.2 → 1.2.3
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 +4 -1
- package/dist/CameraFilter.cjs +1 -0
- package/dist/CameraFilter.d.ts +3 -0
- package/dist/CameraFilter.js +4 -0
- package/dist/OrbitalSim.cjs +1 -0
- package/dist/OrbitalSim.d.ts +3 -0
- package/dist/OrbitalSim.js +147 -0
- package/dist/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.cjs +1 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index3.cjs +1 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/react-is.development.cjs +1 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.cjs +1 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/atomic/ImageStack/styles.d.ts +4 -0
- package/dist/charts/Unit/Span.d.ts +10 -0
- package/dist/charts/Unit/StandardUnit.d.ts +12 -0
- package/dist/charts/Unit/StellarUnit.d.ts +12 -0
- package/dist/charts/Unit/Sub.d.ts +10 -0
- package/dist/charts/Unit/SvgSub.d.ts +10 -0
- package/dist/charts/Unit/TSpan.d.ts +10 -0
- package/dist/charts/Unit/index.d.ts +9 -0
- package/dist/charts/Unit/utilities.d.ts +25 -0
- package/dist/layout/Controls/index.d.ts +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +15 -11
- package/dist/localeStrings/en/epo-widget-lib.json +23 -0
- package/dist/localeStrings/es/epo-widget-lib.json +2 -1
- package/dist/node_modules/classnames/index.cjs +5 -0
- package/dist/node_modules/classnames/index.js +42 -0
- package/dist/node_modules/object-assign/index.cjs +5 -0
- package/dist/node_modules/object-assign/index.js +54 -0
- package/dist/node_modules/prop-types/checkPropTypes.cjs +1 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.cjs +1 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.cjs +2 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/dist/node_modules/prop-types/index.cjs +1 -0
- package/dist/node_modules/prop-types/index.js +15 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.cjs +1 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/has.cjs +1 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.cjs +8 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +95 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.cjs +8 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +78 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.cjs +1 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/three/examples/jsm/controls/OrbitControls.cjs +1 -0
- package/dist/node_modules/three/examples/jsm/controls/OrbitControls.js +458 -0
- package/dist/style.css +1 -0
- package/dist/widgets/CameraFilter/CameraFilter.cjs +1 -0
- package/dist/widgets/CameraFilter/CameraFilter.js +103 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.cjs +1 -0
- package/dist/widgets/CameraFilter/CondensedFilterRanges/CondensedFilterRanges.js +61 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/ColorLabels/ColorLabels.js +99 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumDisplay.js +97 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.cjs +1 -0
- package/dist/widgets/CameraFilter/SpectrumDisplay/SpectrumLabels/SpectrumLabels.js +58 -0
- package/dist/widgets/CameraFilter/data.cjs +1 -0
- package/dist/widgets/CameraFilter/data.js +84 -0
- package/dist/widgets/CameraFilter/styles.cjs +105 -0
- package/dist/widgets/CameraFilter/styles.js +128 -0
- package/dist/widgets/ColorTool/ImageComposite/styles.d.ts +4 -0
- package/dist/widgets/ColorTool/styles.d.ts +6 -0
- package/dist/widgets/OrbitalSim/Camera.cjs +1 -0
- package/dist/widgets/OrbitalSim/Camera.d.ts +10 -0
- package/dist/widgets/OrbitalSim/Camera.js +20 -0
- package/dist/widgets/OrbitalSim/CameraController.cjs +1 -0
- package/dist/widgets/OrbitalSim/CameraController.d.ts +12 -0
- package/dist/widgets/OrbitalSim/CameraController.js +31 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.cjs +1 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.d.ts +13 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.js +60 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.cjs +1 -0
- package/dist/widgets/OrbitalSim/Controls/PlaybackControls.module.css.js +7 -0
- package/dist/widgets/OrbitalSim/Observation.cjs +1 -0
- package/dist/widgets/OrbitalSim/Observation.d.ts +16 -0
- package/dist/widgets/OrbitalSim/Observation.js +60 -0
- package/dist/widgets/OrbitalSim/Observations.cjs +1 -0
- package/dist/widgets/OrbitalSim/Observations.d.ts +16 -0
- package/dist/widgets/OrbitalSim/Observations.js +38 -0
- package/dist/widgets/OrbitalSim/Orbital.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbital.d.ts +52 -0
- package/dist/widgets/OrbitalSim/Orbital.js +256 -0
- package/dist/widgets/OrbitalSim/OrbitalDetails.cjs +1 -0
- package/dist/widgets/OrbitalSim/OrbitalDetails.d.ts +14 -0
- package/dist/widgets/OrbitalSim/OrbitalDetails.js +56 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.cjs +1 -0
- package/dist/widgets/OrbitalSim/OrbitalSim.module.css.js +51 -0
- package/dist/widgets/OrbitalSim/Orbitals.cjs +1 -0
- package/dist/widgets/OrbitalSim/Orbitals.d.ts +48 -0
- package/dist/widgets/OrbitalSim/Orbitals.js +147 -0
- package/dist/widgets/OrbitalSim/PlaybackSpeed.cjs +1 -0
- package/dist/widgets/OrbitalSim/PlaybackSpeed.d.ts +16 -0
- package/dist/widgets/OrbitalSim/PlaybackSpeed.js +97 -0
- package/dist/widgets/OrbitalSim/PotentialOrbits.cjs +1 -0
- package/dist/widgets/OrbitalSim/PotentialOrbits.d.ts +16 -0
- package/dist/widgets/OrbitalSim/PotentialOrbits.js +59 -0
- package/dist/widgets/OrbitalSim/Sun.cjs +1 -0
- package/dist/widgets/OrbitalSim/Sun.d.ts +11 -0
- package/dist/widgets/OrbitalSim/Sun.js +35 -0
- package/dist/widgets/OrbitalSim/chartColors.module.css.cjs +1 -0
- package/dist/widgets/OrbitalSim/chartColors.module.css.js +4 -0
- package/dist/widgets/OrbitalSim/index.d.ts +23 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.cjs +1 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.d.ts +69 -0
- package/dist/widgets/OrbitalSim/orbitalUtilities.js +142 -0
- package/dist/widgets/SupernovaThreeVector/Histogram/index.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/styles.d.ts +8 -0
- package/package.json +11 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { __exports as r } from "../../../../../_virtual/react-is.production.min.js";
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
var _;
|
|
11
|
+
function g() {
|
|
12
|
+
if (_) return r;
|
|
13
|
+
_ = 1;
|
|
14
|
+
var t = typeof Symbol == "function" && Symbol.for, a = t ? Symbol.for("react.element") : 60103, b = t ? Symbol.for("react.portal") : 60106, n = t ? Symbol.for("react.fragment") : 60107, c = t ? Symbol.for("react.strict_mode") : 60108, f = t ? Symbol.for("react.profiler") : 60114, i = t ? Symbol.for("react.provider") : 60109, s = t ? Symbol.for("react.context") : 60110, d = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, y = t ? Symbol.for("react.forward_ref") : 60112, l = t ? Symbol.for("react.suspense") : 60113, x = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, p = t ? Symbol.for("react.lazy") : 60116, C = t ? Symbol.for("react.block") : 60121, M = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, w = t ? Symbol.for("react.scope") : 60119;
|
|
15
|
+
function o(e) {
|
|
16
|
+
if (typeof e == "object" && e !== null) {
|
|
17
|
+
var S = e.$$typeof;
|
|
18
|
+
switch (S) {
|
|
19
|
+
case a:
|
|
20
|
+
switch (e = e.type, e) {
|
|
21
|
+
case d:
|
|
22
|
+
case u:
|
|
23
|
+
case n:
|
|
24
|
+
case f:
|
|
25
|
+
case c:
|
|
26
|
+
case l:
|
|
27
|
+
return e;
|
|
28
|
+
default:
|
|
29
|
+
switch (e = e && e.$$typeof, e) {
|
|
30
|
+
case s:
|
|
31
|
+
case y:
|
|
32
|
+
case p:
|
|
33
|
+
case m:
|
|
34
|
+
case i:
|
|
35
|
+
return e;
|
|
36
|
+
default:
|
|
37
|
+
return S;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
case b:
|
|
41
|
+
return S;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function $(e) {
|
|
46
|
+
return o(e) === u;
|
|
47
|
+
}
|
|
48
|
+
return r.AsyncMode = d, r.ConcurrentMode = u, r.ContextConsumer = s, r.ContextProvider = i, r.Element = a, r.ForwardRef = y, r.Fragment = n, r.Lazy = p, r.Memo = m, r.Portal = b, r.Profiler = f, r.StrictMode = c, r.Suspense = l, r.isAsyncMode = function(e) {
|
|
49
|
+
return $(e) || o(e) === d;
|
|
50
|
+
}, r.isConcurrentMode = $, r.isContextConsumer = function(e) {
|
|
51
|
+
return o(e) === s;
|
|
52
|
+
}, r.isContextProvider = function(e) {
|
|
53
|
+
return o(e) === i;
|
|
54
|
+
}, r.isElement = function(e) {
|
|
55
|
+
return typeof e == "object" && e !== null && e.$$typeof === a;
|
|
56
|
+
}, r.isForwardRef = function(e) {
|
|
57
|
+
return o(e) === y;
|
|
58
|
+
}, r.isFragment = function(e) {
|
|
59
|
+
return o(e) === n;
|
|
60
|
+
}, r.isLazy = function(e) {
|
|
61
|
+
return o(e) === p;
|
|
62
|
+
}, r.isMemo = function(e) {
|
|
63
|
+
return o(e) === m;
|
|
64
|
+
}, r.isPortal = function(e) {
|
|
65
|
+
return o(e) === b;
|
|
66
|
+
}, r.isProfiler = function(e) {
|
|
67
|
+
return o(e) === f;
|
|
68
|
+
}, r.isStrictMode = function(e) {
|
|
69
|
+
return o(e) === c;
|
|
70
|
+
}, r.isSuspense = function(e) {
|
|
71
|
+
return o(e) === l;
|
|
72
|
+
}, r.isValidElementType = function(e) {
|
|
73
|
+
return typeof e == "string" || typeof e == "function" || e === n || e === u || e === f || e === c || e === l || e === x || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === m || e.$$typeof === i || e.$$typeof === s || e.$$typeof === y || e.$$typeof === M || e.$$typeof === v || e.$$typeof === w || e.$$typeof === C);
|
|
74
|
+
}, r.typeOf = o, r;
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
g as __require
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index2.cjs"),t=require("./cjs/react-is.production.min.cjs"),o=require("./cjs/react-is.development.cjs");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index2.js";
|
|
2
|
+
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
|
+
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
|
+
var r;
|
|
5
|
+
function p() {
|
|
6
|
+
return r ? e.exports : (r = 1, process.env.NODE_ENV === "production" ? e.exports = o() : e.exports = t(), e.exports);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
p as __require
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three"),y={type:"change"},m={type:"start"},g={type:"end"},_=new s.Ray,b=new s.Plane,E=Math.cos(70*s.MathUtils.DEG2RAD),h=new s.Vector3,l=2*Math.PI,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},u=1e-6;class P extends s.Controls{constructor(t,e=null){super(t,e),this.state=a.NONE,this.target=new s.Vector3,this.cursor=new s.Vector3,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=.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:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=D.bind(this),this._onPointerDown=T.bind(this),this._onPointerUp=M.bind(this),this._onContextMenu=L.bind(this),this._onMouseWheel=w.bind(this),this._onKeyDown=R.bind(this),this._onTouchStart=j.bind(this),this._onTouchMove=A.bind(this),this._onMouseDown=S.bind(this),this._onMouseMove=O.bind(this),this._interceptControlDown=C.bind(this),this._interceptControlUp=k.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){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"}disconnect(){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"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(y),this.update(),this.state=a.NONE}update(t=null){const e=this.object.position;h.copy(e).sub(this.target),h.applyQuaternion(this._quat),this._spherical.setFromVector3(h),this.autoRotate&&this.state===a.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);let o=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(o)&&isFinite(n)&&(o<-Math.PI?o+=l:o>Math.PI&&(o-=l),n<-Math.PI?n+=l:n>Math.PI&&(n-=l),o<=n?this._spherical.theta=Math.max(o,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(o+n)/2?Math.max(o,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const c=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=c!=this._spherical.radius}if(h.setFromSpherical(this._spherical),h.applyQuaternion(this._quatInverse),e.copy(this.target).add(h),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){let c=null;if(this.object.isPerspectiveCamera){const p=h.length();c=this._clampDistance(p*this._scale);const d=p-c;this.object.position.addScaledVector(this._dollyDirection,d),this.object.updateMatrixWorld(),r=!!d}else if(this.object.isOrthographicCamera){const p=new s.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const d=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=d!==this.object.zoom;const f=new s.Vector3(this._mouse.x,this._mouse.y,0);f.unproject(this.object),this.object.position.sub(f).add(p),this.object.updateMatrixWorld(),c=h.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;c!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(c).add(this.object.position):(_.origin.copy(this.object.position),_.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(_.direction))<E?this.object.lookAt(this.target):(b.setFromNormalAndCoplanarPoint(this.object.up,this.target),_.intersectPlane(b,this.target))))}else if(this.object.isOrthographicCamera){const c=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),c!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,r||this._lastPosition.distanceToSquared(this.object.position)>u||8*(1-this._lastQuaternion.dot(this.object.quaternion))>u||this._lastTargetPosition.distanceToSquared(this.target)>u?(this.dispatchEvent(y),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?l/60*this.autoRotateSpeed*t:l/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){h.setFromMatrixColumn(e,0),h.multiplyScalar(-t),this._panOffset.add(h)}_panUp(t,e){this.screenSpacePanning===!0?h.setFromMatrixColumn(e,1):(h.setFromMatrixColumn(e,0),h.crossVectors(this.object.up,h)),h.multiplyScalar(t),this._panOffset.add(h)}_pan(t,e){const o=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;h.copy(n).sub(this.target);let r=h.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/o.clientHeight,this.object.matrix),this._panUp(2*e*r/o.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/o.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/o.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){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)}_dollyIn(t){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)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const o=this.domElement.getBoundingClientRect(),n=t-o.left,r=e-o.top,c=o.width,p=o.height;this._mouse.x=n/c*2-1,this._mouse.y=-(r/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){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()}_handleMouseMovePan(t){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()}_handleMouseWheel(t){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()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-l*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._rotateStart.set(o,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panStart.set(o,n)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),n=.5*(t.pageX+o.x),r=.5*(t.pageY+o.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(l*this._rotateDelta.x/e.clientHeight),this._rotateUp(l*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),o=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);this._panEnd.set(o,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),o=t.pageX-e.x,n=t.pageY-e.y,r=Math.sqrt(o*o+n*n);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const c=(t.pageX+e.x)*.5,p=(t.pageY+e.y)*.5;this._updateZoomParameters(c,p)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];e===void 0&&(e=new s.Vector2,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,o={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:o.deltaY*=16;break;case 2:o.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(o.deltaY*=10),o}}function T(i){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)))}function D(i){this.enabled!==!1&&(i.pointerType==="touch"?this._onTouchMove(i):this._onMouseMove(i))}function M(i){switch(this._removePointer(i),this._pointers.length){case 0:this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(g),this.state=a.NONE;break;case 1:const t=this._pointers[0],e=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:e.x,pageY:e.y});break}}function S(i){let t;switch(i.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(i),this.state=a.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(i),this.state=a.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(i),this.state=a.PAN}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function O(i){switch(this.state){case a.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(i);break;case a.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(i);break;case a.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(i);break}}function w(i){this.enabled===!1||this.enableZoom===!1||this.state!==a.NONE||(i.preventDefault(),this.dispatchEvent(m),this._handleMouseWheel(this._customWheelEvent(i)),this.dispatchEvent(g))}function R(i){this.enabled!==!1&&this._handleKeyDown(i)}function j(i){switch(this._trackPointer(i),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(i),this.state=a.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(i),this.state=a.TOUCH_PAN;break;default:this.state=a.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(i),this.state=a.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(i),this.state=a.TOUCH_DOLLY_ROTATE;break;default:this.state=a.NONE}break;default:this.state=a.NONE}this.state!==a.NONE&&this.dispatchEvent(m)}function A(i){switch(this._trackPointer(i),this.state){case a.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(i),this.update();break;case a.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(i),this.update();break;case a.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(i),this.update();break;case a.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(i),this.update();break;default:this.state=a.NONE}}function L(i){this.enabled!==!1&&i.preventDefault()}function C(i){i.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function k(i){i.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}exports.OrbitControls=P;
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import { Ray as S, Plane as w, MathUtils as O, Vector3 as p, Controls as R, MOUSE as u, TOUCH as _, Quaternion as E, Spherical as P, Vector2 as c } from "three";
|
|
2
|
+
const D = { type: "change" }, b = { type: "start" }, M = { type: "end" }, f = new S(), T = new w(), j = Math.cos(70 * O.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 R {
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new controls instance.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object3D} object - The object that is managed by the controls.
|
|
17
|
+
* @param {?HTMLElement} 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 {HTMLElement} 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 OrbitControls
|
|
458
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--white: #ffffff;--black: #000000;--lightBlue: #bee7f5;--boldRed: #df0039;--ral5018HR: #087f80;--neutral10: #f3f3f3;--neutral20: #737373;--basePrimary: var(--ral5018HR);--error: var(--boldRed);--break40: 420px;--break100: 1284px;--minPadding: 20px;--containerMaxWidth: var(--break100);--offset: 300px;--regular: 400;--medium: 500;--duration: .2s;--durationSlow: .4s;--timing: ease;--siteProgressHeight: 26px;--siteToolbarHeight: 64px;--siteHeaderHeight: var(--siteProgressHeight) + var(--siteToolbarHeight);--pageNavHeight: 64px;--headingWithSpaceHeight: 90px;--tallestSquareWidget: calc(100vh - var(--pageNavHeight) - var(--siteHeaderHeight) - var(--headingWithSpaceHeight) - var(--minPadding))}._container_13gyh_35{position:relative;height:var(--tallestSquareWidget);min-height:var(--break40);background-color:var(--black);color-adjust:exact}._orbital-canvas_13gyh_43{position:relative;z-index:1}._playback-speed-slider-header_13gyh_48{position:absolute;top:34px;right:10px;z-index:2;width:110px;padding:5px;text-align:center;background-color:#fffc;border:1px solid --black;border-radius:10px}._playback-speed-title_13gyh_61{font-family:Roboto;font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black);margin:0}._playback-speed-slider-label_13gyh_72{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);font-size:12.5px}._playback-speed-slider-label-bottom_13gyh_83,._playback-speed-slider-label-top_13gyh_84{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);position:absolute;right:var(--minPadding) / 2;z-index:2;width:70px;padding:5px;color:var(--white);text-align:center;background-color:rgb(from var(--basePrimary) r g b / 80%);border:1px solid var(--black);border-radius:10px}._playback-speed-slider-label-bottom_13gyh_83{top:calc(40px + (var(--minPadding) + var(--tallestSquareWidget) - var(--offset)));right:10px}._playback-speed-slider-label-top_13gyh_84{right:10px;top:calc(80px + var(--minPadding))}._playback-speed-slider_13gyh_48{position:absolute;z-index:2;height:50px;top:25%;right:5rem;width:fit-content}._elapsed-time-container_13gyh_126{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;position:absolute;right:10px;bottom:100px;z-index:2;color:var(--black);text-align:center;background-color:rgb(from var(--white) r g b / 80%);border:1px solid var(--black);border-radius:10px}._elapsed-time-container_13gyh_126 ._elapsed-time-title_13gyh_145{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black);padding-top:5px}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156{display:flex;flex-flow:nowrap;align-items:center;justify-content:space-evenly;margin-top:5px;border-top:1px solid var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-divider_13gyh_165{display:block;width:1px;height:50px;background-color:var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172{width:50px}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172 ._elapsed-val_13gyh_176{font-family:Roboto;font-size:18px;font-weight:var(--regular);line-height:1.5;color:var(--black)}._elapsed-time-container_13gyh_126 ._elapsed-time-inner_13gyh_156 ._elapsed-time-block_13gyh_172 ._elapsed-label_13gyh_187{font-family:Roboto;font-size:14px;font-weight:var(--medium);line-height:1.333;color:var(--black)}._padded-drawer-inner_13gyh_198{width:(var(--containerMaxWidth) - var(--minPadding) / 2);padding:0 0 0 72px;outline:none}@media all and (max-width: 1284px){._padded-drawer-inner_13gyh_198{width:calc((100vw - 40px)/2)}}._nav-item_13gyh_209 ._md-list-tile_13gyh_209{background-color:var(--neutral10);transition:background-color var(--timing) var(--duration)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209 ._md-tile-addon_13gyh_214{color:var(--basePrimary);transition:color var(--timing) var(--duration)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover{background-color:var(--basePrimary)}._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-addon_13gyh_214,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-text--primary_13gyh_227,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-tile-text--primary_13gyh_227._md-text--theme-primary_13gyh_228,._nav-item_13gyh_209 ._md-list-tile_13gyh_209:hover ._md-text_13gyh_228{color:var(--white)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209{background-color:var(--basePrimary)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-addon_13gyh_214{color:var(--white)}._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-text--primary_13gyh_227,._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-tile-text--primary_13gyh_227._md-text--theme-primary_13gyh_228,._nav-item_13gyh_209._active-item_13gyh_233 ._md-list-tile_13gyh_209 ._md-text_13gyh_228{color:var(--white)!important}._label_13gyh_249{padding:2px 4px;margin-top:4px;font-weight:var(--medium);color:var(--black);background-color:color-mix(in srgb,var(--white) 40%,transparent);border:1px solid color-mix(in srgb,var(--white) 40%,transparent);border-radius:5px;color-adjust:exact}._obs-mesh_13gyh_260{cursor:pointer}._obs-label_13gyh_264{padding-top:-8px;font-size:16px;color:var(--white);cursor:pointer}._obs-label_13gyh_264._obs-answer_13gyh_271,._obs-label_13gyh_264._obs-hover_13gyh_272{font-size:18px;color:"blue"}._obs-label_13gyh_264._obs-active_13gyh_277{font-size:18px;color:"red"}._details_13gyh_288{position:absolute;top:0;right:0;left:0;z-index:2;max-width:0;overflow:hidden;transition:max-width var(--timing) var(--durationSlow)}._details_13gyh_288 ._details-table_13gyh_299{margin-top:calc(var(--minPadding) * 2 + 36px);background-color:var(--white)}._details_13gyh_288 ._details-table_13gyh_299 ._md-text_13gyh_228{overflow:hidden;white-space:nowrap}._details_13gyh_288._active-details_13gyh_309{width:100%;max-width:350px}._details_13gyh_288._active-details_13gyh_309 ._details-table_13gyh_299 ._md-text_13gyh_228{overflow:auto;white-space:normal}._details-toggle_13gyh_319{position:absolute;top:0;left:0;z-index:3;margin:var(--minPadding);color:var(--white)!important;background-color:var(--error)}._details-toggle_13gyh_319._disabled_13gyh_330{background-color:var(--neutral20)}._slideoutPanel_13gyh_334{background-color:var(--neutral10);display:flex;flex-direction:column;gap:1em;padding:1em;font-size:.75rem}._slideoutPanel_13gyh_334>*+*{margin-block-start:1em}._slideoutRow_13gyh_347{display:flex;gap:20px}._slideoutCol_13gyh_352{flex:1;padding:0 15px;border:1px solid #ccc;background-color:#ccc;border-radius:15px}._slideoutCol_13gyh_352[data-align=right]{text-align:right}._slideoutCol_13gyh_352[data-align=left]{font-weight:700}._slideout_13gyh_334 [data-testid=slideoutBackdrop]{display:none;opacity:0;pointer-events:none}._slideoutPanel_13gyh_334>h3{margin:0;text-align:center}:root{--black: #000000;--turquoise70: #058b8c;--brightGreen: #01bbbc;--mediumGreen: var(--turquoise70);--awRed: #ed4c4c;--awOrange: #fab364;--awYellow: #ffe266;--acPurple: #583671;--acGreen: #3cae3f;--acBlue: #1c81a4}:root :export{--chart0: var(--black);--chart1: var(--acBlue);--chart2: var(--awYellow);--chart3: var(--awRed);--chart4: var(--acGreen);--chart5: var(--awOrange);--chart6: var(--acPurple);--chart7: var(--mediumGreen);--chart8: var(--brightGreen)}._playbackControlsContainer_1f1sq_1{width:auto;display:flex;position:absolute;bottom:0;left:50%;transform:translate(-50%);z-index:2}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),v=require("react"),q=require("@rubin-epo/epo-react-lib/SelectListbox"),y=require("@rubin-epo/epo-react-lib/styles"),C=require("react-i18next"),S=require("use-resize-observer"),r=require("./data.cjs"),l=require("./styles.cjs"),R=require("./CondensedFilterRanges/CondensedFilterRanges.cjs"),L=require("./SpectrumDisplay/SpectrumDisplay.cjs"),x=i=>i&&i.__esModule?i:{default:i},M=x(q),O=x(S),m=()=>{const{t:i}=C.useTranslation(),{ref:h,width:j=1}=O.default(),[c,p]=v.useState(null),{BREAK_TABLET:b}=y.tokens,s=j<parseInt(b),{[s?"condensed":"default"]:{min:o,max:F,range:n}}=r.rangeConfig,d=r.filters[0].range[0],u=r.filters[r.filters.length-1].range[1]-d,f=r.filters.filter(({band:t})=>t),g=[{value:"none",label:i("camera_filter.labels.option",{context:"none"})}].concat(f.map(({band:t})=>({value:t,label:i("camera_filter.labels.option",{band:t})}))),_=r.filters.find(({band:t})=>t===c);return e.jsx(l.FilterWrapper,{ratio:5/4,children:e.jsxs(l.FilterContainer,{ref:h,children:[e.jsx(l.FilterTitle,{children:i("camera_filter.title")}),s&&e.jsx(R.default,{filters:f,min:o,spectrumRange:n}),e.jsxs(l.FilterTable,{style:{"--filter-table-margin-inline-start":`${((d-o)/n*100).toFixed(2)}%`,"--filter-table-width":`${(u/n*100).toFixed(2)}%`},"data-testid":"expanded-filters",children:[e.jsx("colgroup",{children:r.filters.map(({range:t})=>e.jsx("col",{style:{width:`${(t[1]-t[0])/u*100}%`}},t.join("")))}),e.jsx(l.FilterNames,{children:e.jsx("tr",{children:r.filters.map(({band:t},a)=>e.jsx(l.FilterName,{id:`${t}-name`,style:{"--filter-name-border":t?"solid #b2b2b2":"none"},scope:"col","aria-hidden":!t,children:t},a))})}),!s&&e.jsx(l.FilterRanges,{children:e.jsx("tr",{children:r.filters.map(({band:t,range:a})=>e.jsx(l.FilterRange,{"aria-hidden":!t,children:t&&e.jsxs(e.Fragment,{children:[a.join("–"),e.jsx("br",{}),e.jsx(l.Wavelength,{children:"nm"})]})},a.join()))})})]}),e.jsx(L.default,{min:o,max:F,range:n,isCondensed:s,activeFilter:_}),e.jsxs(l.SelectContainer,{children:[e.jsx(l.SelectLabel,{id:"filterSelectLabel",children:i("camera_filter.labels.select")}),e.jsx(M.default,{options:g,value:c,onChangeCallback:t=>p(t),width:"100%",maxWidth:"100%",labelledById:"filterSelectLabel"})]})]})})};m.displayName="Widgets.CameraFilter";const T=m;exports.default=T;
|