Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/assets/threejs/r73/OrbitControls.js
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/**6* @author qiao / https://github.com/qiao7* @author mrdoob / http://mrdoob.com8* @author alteredq / http://alteredqualia.com/9* @author WestLangley / http://github.com/WestLangley10* @author erich666 / http://erichaines.com11*/12/*global THREE, console */1314( function () {1516function OrbitConstraint ( object ) {1718this.object = object;1920// "target" sets the location of focus, where the object orbits around21// and where it pans with respect to.22this.target = new THREE.Vector3();2324// Limits to how far you can dolly in and out ( PerspectiveCamera only )25this.minDistance = 0;26this.maxDistance = Infinity;2728// Limits to how far you can zoom in and out ( OrthographicCamera only )29this.minZoom = 0;30this.maxZoom = Infinity;3132// How far you can orbit vertically, upper and lower limits.33// Range is 0 to Math.PI radians.34this.minPolarAngle = 0; // radians35this.maxPolarAngle = Math.PI; // radians3637// How far you can orbit horizontally, upper and lower limits.38// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].39this.minAzimuthAngle = - Infinity; // radians40this.maxAzimuthAngle = Infinity; // radians4142// Set to true to enable damping (inertia)43// If damping is enabled, you must call controls.update() in your animation loop44this.enableDamping = false;45this.dampingFactor = 0.25;4647////////////48// internals4950var scope = this;5152var EPS = 0.000001;5354// Current position in spherical coordinate system.55var theta;56var phi;5758// Pending changes59var phiDelta = 0;60var thetaDelta = 0;61var scale = 1;62var panOffset = new THREE.Vector3();63var zoomChanged = false;6465// API6667this.getPolarAngle = function () {6869return phi;7071};7273this.getAzimuthalAngle = function () {7475return theta;7677};7879this.rotateLeft = function ( angle ) {8081thetaDelta -= angle;8283};8485this.rotateUp = function ( angle ) {8687phiDelta -= angle;8889};9091// pass in distance in world space to move left92this.panLeft = function() {9394var v = new THREE.Vector3();9596return function panLeft ( distance ) {9798var te = this.object.matrix.elements;99100// get X column of matrix101v.set( te[ 0 ], te[ 1 ], te[ 2 ] );102v.multiplyScalar( - distance );103104panOffset.add( v );105106};107108}();109110// pass in distance in world space to move up111this.panUp = function() {112113var v = new THREE.Vector3();114115return function panUp ( distance ) {116117var te = this.object.matrix.elements;118119// get Y column of matrix120v.set( te[ 4 ], te[ 5 ], te[ 6 ] );121v.multiplyScalar( distance );122123panOffset.add( v );124125};126127}();128129// pass in x,y of change desired in pixel space,130// right and down are positive131this.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {132133if ( scope.object instanceof THREE.PerspectiveCamera ) {134135// perspective136var position = scope.object.position;137var offset = position.clone().sub( scope.target );138var targetDistance = offset.length();139140// half of the fov is center to top of screen141targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );142143// we actually don't use screenWidth, since perspective camera is fixed to screen height144scope.panLeft( 2 * deltaX * targetDistance / screenHeight );145scope.panUp( 2 * deltaY * targetDistance / screenHeight );146147} else if ( scope.object instanceof THREE.OrthographicCamera ) {148149// orthographic150scope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );151scope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );152153} else {154155// camera neither orthographic or perspective156console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );157158}159160};161162this.dollyIn = function ( dollyScale ) {163164if ( scope.object instanceof THREE.PerspectiveCamera ) {165166scale /= dollyScale;167168} else if ( scope.object instanceof THREE.OrthographicCamera ) {169170scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );171scope.object.updateProjectionMatrix();172zoomChanged = true;173174} else {175176console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );177178}179180};181182this.dollyOut = function ( dollyScale ) {183184if ( scope.object instanceof THREE.PerspectiveCamera ) {185186scale *= dollyScale;187188} else if ( scope.object instanceof THREE.OrthographicCamera ) {189190scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );191scope.object.updateProjectionMatrix();192zoomChanged = true;193194} else {195196console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );197198}199200};201202this.update = function() {203204var offset = new THREE.Vector3();205206// so camera.up is the orbit axis207var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );208var quatInverse = quat.clone().inverse();209210var lastPosition = new THREE.Vector3();211var lastQuaternion = new THREE.Quaternion();212213return function () {214215var position = this.object.position;216217offset.copy( position ).sub( this.target );218219// rotate offset to "y-axis-is-up" space220offset.applyQuaternion( quat );221222// angle from z-axis around y-axis223224theta = Math.atan2( offset.x, offset.z );225226// angle from y-axis227228phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );229230theta += thetaDelta;231phi += phiDelta;232233// restrict theta to be between desired limits234theta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );235236// restrict phi to be between desired limits237phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );238239// restrict phi to be between EPS and PI-EPS240phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );241242var radius = offset.length() * scale;243244// restrict radius to be between desired limits245radius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );246247// move target to panned location248this.target.add( panOffset );249250offset.x = radius * Math.sin( phi ) * Math.sin( theta );251offset.y = radius * Math.cos( phi );252offset.z = radius * Math.sin( phi ) * Math.cos( theta );253254// rotate offset back to "camera-up-vector-is-up" space255offset.applyQuaternion( quatInverse );256257position.copy( this.target ).add( offset );258259this.object.lookAt( this.target );260261if ( this.enableDamping === true ) {262263thetaDelta *= ( 1 - this.dampingFactor );264phiDelta *= ( 1 - this.dampingFactor );265266} else {267268thetaDelta = 0;269phiDelta = 0;270271}272273scale = 1;274panOffset.set( 0, 0, 0 );275276// update condition is:277// min(camera displacement, camera rotation in radians)^2 > EPS278// using small-angle approximation cos(x/2) = 1 - x^2 / 8279280if ( zoomChanged ||281lastPosition.distanceToSquared( this.object.position ) > EPS ||2828 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {283284lastPosition.copy( this.object.position );285lastQuaternion.copy( this.object.quaternion );286zoomChanged = false;287288return true;289290}291292return false;293294};295296}();297298};299300301// This set of controls performs orbiting, dollying (zooming), and panning. It maintains302// the "up" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is303// supported.304//305// Orbit - left mouse / touch: one finger move306// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish307// Pan - right mouse, or arrow keys / touch: three finter swipe308309THREE.OrbitControls = function ( object, domElement ) {310311var constraint = new OrbitConstraint( object );312313this.domElement = ( domElement !== undefined ) ? domElement : document;314315// API316317Object.defineProperty( this, 'constraint', {318319get: function() {320321return constraint;322323}324325} );326327this.getPolarAngle = function () {328329return constraint.getPolarAngle();330331};332333this.getAzimuthalAngle = function () {334335return constraint.getAzimuthalAngle();336337};338339// Set to false to disable this control340this.enabled = true;341342// center is old, deprecated; use "target" instead343this.center = this.target;344345// This option actually enables dollying in and out; left as "zoom" for346// backwards compatibility.347// Set to false to disable zooming348this.enableZoom = true;349this.zoomSpeed = 1.0;350351// Set to false to disable rotating352this.enableRotate = true;353this.rotateSpeed = 1.0;354355// Set to false to disable panning356this.enablePan = true;357this.keyPanSpeed = 7.0; // pixels moved per arrow key push358359// Set to true to automatically rotate around the target360// If auto-rotate is enabled, you must call controls.update() in your animation loop361this.autoRotate = false;362this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60363364// Set to false to disable use of the keys365this.enableKeys = true;366367// The four arrow keys368this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };369370// Mouse buttons371this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };372373////////////374// internals375376var scope = this;377378var rotateStart = new THREE.Vector2();379var rotateEnd = new THREE.Vector2();380var rotateDelta = new THREE.Vector2();381382var panStart = new THREE.Vector2();383var panEnd = new THREE.Vector2();384var panDelta = new THREE.Vector2();385386var dollyStart = new THREE.Vector2();387var dollyEnd = new THREE.Vector2();388var dollyDelta = new THREE.Vector2();389390var STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };391392var state = STATE.NONE;393394// for reset395396this.target0 = this.target.clone();397this.position0 = this.object.position.clone();398this.zoom0 = this.object.zoom;399400// events401402var changeEvent = { type: 'change' };403var startEvent = { type: 'start' };404var endEvent = { type: 'end' };405406// pass in x,y of change desired in pixel space,407// right and down are positive408function pan( deltaX, deltaY ) {409410var element = scope.domElement === document ? scope.domElement.body : scope.domElement;411412constraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );413414}415416this.update = function () {417418if ( this.autoRotate && state === STATE.NONE ) {419420constraint.rotateLeft( getAutoRotationAngle() );421422}423424if ( constraint.update() === true ) {425426this.dispatchEvent( changeEvent );427428}429430};431432this.reset = function () {433434state = STATE.NONE;435436this.target.copy( this.target0 );437this.object.position.copy( this.position0 );438this.object.zoom = this.zoom0;439440this.object.updateProjectionMatrix();441this.dispatchEvent( changeEvent );442443this.update();444445};446447function getAutoRotationAngle() {448449return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;450451}452453function getZoomScale() {454455return Math.pow( 0.95, scope.zoomSpeed );456457}458459function onMouseDown( event ) {460461if ( scope.enabled === false ) return;462463event.preventDefault();464465if ( event.button === scope.mouseButtons.ORBIT ) {466467if ( scope.enableRotate === false ) return;468469state = STATE.ROTATE;470471rotateStart.set( event.clientX, event.clientY );472473} else if ( event.button === scope.mouseButtons.ZOOM ) {474475if ( scope.enableZoom === false ) return;476477state = STATE.DOLLY;478479dollyStart.set( event.clientX, event.clientY );480481} else if ( event.button === scope.mouseButtons.PAN ) {482483if ( scope.enablePan === false ) return;484485state = STATE.PAN;486487panStart.set( event.clientX, event.clientY );488489}490491if ( state !== STATE.NONE ) {492493document.addEventListener( 'mousemove', onMouseMove, false );494document.addEventListener( 'mouseup', onMouseUp, false );495scope.dispatchEvent( startEvent );496497}498499}500501function onMouseMove( event ) {502503if ( scope.enabled === false ) return;504505event.preventDefault();506507var element = scope.domElement === document ? scope.domElement.body : scope.domElement;508509if ( state === STATE.ROTATE ) {510511if ( scope.enableRotate === false ) return;512513rotateEnd.set( event.clientX, event.clientY );514rotateDelta.subVectors( rotateEnd, rotateStart );515516// rotating across whole screen goes 360 degrees around517constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );518519// rotating up and down along whole screen attempts to go 360, but limited to 180520constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );521522rotateStart.copy( rotateEnd );523524} else if ( state === STATE.DOLLY ) {525526if ( scope.enableZoom === false ) return;527528dollyEnd.set( event.clientX, event.clientY );529dollyDelta.subVectors( dollyEnd, dollyStart );530531if ( dollyDelta.y > 0 ) {532533constraint.dollyIn( getZoomScale() );534535} else if ( dollyDelta.y < 0 ) {536537constraint.dollyOut( getZoomScale() );538539}540541dollyStart.copy( dollyEnd );542543} else if ( state === STATE.PAN ) {544545if ( scope.enablePan === false ) return;546547panEnd.set( event.clientX, event.clientY );548panDelta.subVectors( panEnd, panStart );549550pan( panDelta.x, panDelta.y );551552panStart.copy( panEnd );553554}555556if ( state !== STATE.NONE ) scope.update();557558}559560function onMouseUp( /* event */ ) {561562if ( scope.enabled === false ) return;563564document.removeEventListener( 'mousemove', onMouseMove, false );565document.removeEventListener( 'mouseup', onMouseUp, false );566scope.dispatchEvent( endEvent );567state = STATE.NONE;568569}570571function onMouseWheel( event ) {572573if ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;574575event.preventDefault();576event.stopPropagation();577578var delta = 0;579580if ( event.wheelDelta !== undefined ) {581582// WebKit / Opera / Explorer 9583584delta = event.wheelDelta;585586} else if ( event.detail !== undefined ) {587588// Firefox589590delta = - event.detail;591592}593594if ( delta > 0 ) {595596constraint.dollyOut( getZoomScale() );597598} else if ( delta < 0 ) {599600constraint.dollyIn( getZoomScale() );601602}603604scope.update();605scope.dispatchEvent( startEvent );606scope.dispatchEvent( endEvent );607608}609610function onKeyDown( event ) {611612if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;613614switch ( event.keyCode ) {615616case scope.keys.UP:617pan( 0, scope.keyPanSpeed );618scope.update();619break;620621case scope.keys.BOTTOM:622pan( 0, - scope.keyPanSpeed );623scope.update();624break;625626case scope.keys.LEFT:627pan( scope.keyPanSpeed, 0 );628scope.update();629break;630631case scope.keys.RIGHT:632pan( - scope.keyPanSpeed, 0 );633scope.update();634break;635636}637638}639640function touchstart( event ) {641642if ( scope.enabled === false ) return;643644switch ( event.touches.length ) {645646case 1: // one-fingered touch: rotate647648if ( scope.enableRotate === false ) return;649650state = STATE.TOUCH_ROTATE;651652rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );653break;654655case 2: // two-fingered touch: dolly656657if ( scope.enableZoom === false ) return;658659state = STATE.TOUCH_DOLLY;660661var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;662var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;663var distance = Math.sqrt( dx * dx + dy * dy );664dollyStart.set( 0, distance );665break;666667case 3: // three-fingered touch: pan668669if ( scope.enablePan === false ) return;670671state = STATE.TOUCH_PAN;672673panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );674break;675676default:677678state = STATE.NONE;679680}681682if ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );683684}685686function touchmove( event ) {687688if ( scope.enabled === false ) return;689690event.preventDefault();691event.stopPropagation();692693var element = scope.domElement === document ? scope.domElement.body : scope.domElement;694695switch ( event.touches.length ) {696697case 1: // one-fingered touch: rotate698699if ( scope.enableRotate === false ) return;700if ( state !== STATE.TOUCH_ROTATE ) return;701702rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );703rotateDelta.subVectors( rotateEnd, rotateStart );704705// rotating across whole screen goes 360 degrees around706constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );707// rotating up and down along whole screen attempts to go 360, but limited to 180708constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );709710rotateStart.copy( rotateEnd );711712scope.update();713break;714715case 2: // two-fingered touch: dolly716717if ( scope.enableZoom === false ) return;718if ( state !== STATE.TOUCH_DOLLY ) return;719720var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;721var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;722var distance = Math.sqrt( dx * dx + dy * dy );723724dollyEnd.set( 0, distance );725dollyDelta.subVectors( dollyEnd, dollyStart );726727if ( dollyDelta.y > 0 ) {728729constraint.dollyOut( getZoomScale() );730731} else if ( dollyDelta.y < 0 ) {732733constraint.dollyIn( getZoomScale() );734735}736737dollyStart.copy( dollyEnd );738739scope.update();740break;741742case 3: // three-fingered touch: pan743744if ( scope.enablePan === false ) return;745if ( state !== STATE.TOUCH_PAN ) return;746747panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );748panDelta.subVectors( panEnd, panStart );749750pan( panDelta.x, panDelta.y );751752panStart.copy( panEnd );753754scope.update();755break;756757default:758759state = STATE.NONE;760761}762763}764765function touchend( /* event */ ) {766767if ( scope.enabled === false ) return;768769scope.dispatchEvent( endEvent );770state = STATE.NONE;771772}773774function contextmenu( event ) {775776event.preventDefault();777778}779780this.dispose = function() {781782this.domElement.removeEventListener( 'contextmenu', contextmenu, false );783this.domElement.removeEventListener( 'mousedown', onMouseDown, false );784this.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );785this.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox786787this.domElement.removeEventListener( 'touchstart', touchstart, false );788this.domElement.removeEventListener( 'touchend', touchend, false );789this.domElement.removeEventListener( 'touchmove', touchmove, false );790791document.removeEventListener( 'mousemove', onMouseMove, false );792document.removeEventListener( 'mouseup', onMouseUp, false );793794window.removeEventListener( 'keydown', onKeyDown, false );795796};797798this.domElement.addEventListener( 'contextmenu', contextmenu, false );799800this.domElement.addEventListener( 'mousedown', onMouseDown, false );801this.domElement.addEventListener( 'mousewheel', onMouseWheel, false );802this.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox803804this.domElement.addEventListener( 'touchstart', touchstart, false );805this.domElement.addEventListener( 'touchend', touchend, false );806this.domElement.addEventListener( 'touchmove', touchmove, false );807808window.addEventListener( 'keydown', onKeyDown, false );809810// force an update at start811this.update();812813};814815THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );816THREE.OrbitControls.prototype.constructor = THREE.OrbitControls;817818Object.defineProperties( THREE.OrbitControls.prototype, {819820object: {821822get: function () {823824return this.constraint.object;825826}827828},829830target: {831832get: function () {833834return this.constraint.target;835836},837838set: function ( value ) {839840console.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );841this.constraint.target.copy( value );842843}844845},846847minDistance : {848849get: function () {850851return this.constraint.minDistance;852853},854855set: function ( value ) {856857this.constraint.minDistance = value;858859}860861},862863maxDistance : {864865get: function () {866867return this.constraint.maxDistance;868869},870871set: function ( value ) {872873this.constraint.maxDistance = value;874875}876877},878879minZoom : {880881get: function () {882883return this.constraint.minZoom;884885},886887set: function ( value ) {888889this.constraint.minZoom = value;890891}892893},894895maxZoom : {896897get: function () {898899return this.constraint.maxZoom;900901},902903set: function ( value ) {904905this.constraint.maxZoom = value;906907}908909},910911minPolarAngle : {912913get: function () {914915return this.constraint.minPolarAngle;916917},918919set: function ( value ) {920921this.constraint.minPolarAngle = value;922923}924925},926927maxPolarAngle : {928929get: function () {930931return this.constraint.maxPolarAngle;932933},934935set: function ( value ) {936937this.constraint.maxPolarAngle = value;938939}940941},942943minAzimuthAngle : {944945get: function () {946947return this.constraint.minAzimuthAngle;948949},950951set: function ( value ) {952953this.constraint.minAzimuthAngle = value;954955}956957},958959maxAzimuthAngle : {960961get: function () {962963return this.constraint.maxAzimuthAngle;964965},966967set: function ( value ) {968969this.constraint.maxAzimuthAngle = value;970971}972973},974975enableDamping : {976977get: function () {978979return this.constraint.enableDamping;980981},982983set: function ( value ) {984985this.constraint.enableDamping = value;986987}988989},990991dampingFactor : {992993get: function () {994995return this.constraint.dampingFactor;996997},998999set: function ( value ) {10001001this.constraint.dampingFactor = value;10021003}10041005},10061007// backward compatibility10081009noZoom: {10101011get: function () {10121013console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );1014return ! this.enableZoom;10151016},10171018set: function ( value ) {10191020console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );1021this.enableZoom = ! value;10221023}10241025},10261027noRotate: {10281029get: function () {10301031console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );1032return ! this.enableRotate;10331034},10351036set: function ( value ) {10371038console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );1039this.enableRotate = ! value;10401041}10421043},10441045noPan: {10461047get: function () {10481049console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );1050return ! this.enablePan;10511052},10531054set: function ( value ) {10551056console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );1057this.enablePan = ! value;10581059}10601061},10621063noKeys: {10641065get: function () {10661067console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );1068return ! this.enableKeys;10691070},10711072set: function ( value ) {10731074console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );1075this.enableKeys = ! value;10761077}10781079},10801081staticMoving : {10821083get: function () {10841085console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );1086return ! this.constraint.enableDamping;10871088},10891090set: function ( value ) {10911092console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );1093this.constraint.enableDamping = ! value;10941095}10961097},10981099dynamicDampingFactor : {11001101get: function () {11021103console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );1104return this.constraint.dampingFactor;11051106},11071108set: function ( value ) {11091110console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );1111this.constraint.dampingFactor = value;11121113}11141115}11161117} );11181119}() );112011211122