diff --git a/examples/jsm/controls/OrbitControls.js b/examples/jsm/controls/OrbitControls.js index 7360aab9b347eb..702bf4609d66f6 100644 --- a/examples/jsm/controls/OrbitControls.js +++ b/examples/jsm/controls/OrbitControls.js @@ -784,11 +784,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( 0, this.keyPanSpeed ); + if ( this.enablePan ) { + + this._pan( 0, this.keyPanSpeed ); + + } } @@ -799,11 +807,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( 0, - this.keyPanSpeed ); + if ( this.enablePan ) { + + this._pan( 0, - this.keyPanSpeed ); + + } } @@ -814,11 +830,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( this.keyPanSpeed, 0 ); + if ( this.enablePan ) { + + this._pan( this.keyPanSpeed, 0 ); + + } } @@ -829,11 +853,19 @@ class OrbitControls extends Controls { if ( event.ctrlKey || event.metaKey || event.shiftKey ) { - this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + if ( this.enableRotate ) { + + this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + + } } else { - this._pan( - this.keyPanSpeed, 0 ); + if ( this.enablePan ) { + + this._pan( - this.keyPanSpeed, 0 ); + + } } @@ -1340,7 +1372,7 @@ function onMouseWheel( event ) { function onKeyDown( event ) { - if ( this.enabled === false || this.enablePan === false ) return; + if ( this.enabled === false ) return; this._handleKeyDown( event );