diff --git a/docs/examples/en/controls/OrbitControls.html b/docs/examples/en/controls/OrbitControls.html index 680e7ef3f8bc2c..78fb9d661d771a 100644 --- a/docs/examples/en/controls/OrbitControls.html +++ b/docs/examples/en/controls/OrbitControls.html @@ -141,6 +141,11 @@
+ How fast to rotate the camera when the keyboard is used. Default is 1. +
+This object contains references to the keycodes for controlling camera panning. Default is the 4 arrow keys. diff --git a/examples/jsm/controls/OrbitControls.js b/examples/jsm/controls/OrbitControls.js index 702bf4609d66f6..5bd62d6640b883 100644 --- a/examples/jsm/controls/OrbitControls.js +++ b/examples/jsm/controls/OrbitControls.js @@ -92,6 +92,7 @@ class OrbitControls extends Controls { // Set to false to disable rotating this.enableRotate = true; this.rotateSpeed = 1.0; + this.keyRotateSpeed = 1.0; // Set to false to disable panning this.enablePan = true; @@ -786,7 +787,7 @@ class OrbitControls extends Controls { if ( this.enableRotate ) { - this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + this._rotateUp( _twoPI * this.keyRotateSpeed / this.domElement.clientHeight ); } @@ -809,7 +810,7 @@ class OrbitControls extends Controls { if ( this.enableRotate ) { - this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + this._rotateUp( - _twoPI * this.keyRotateSpeed / this.domElement.clientHeight ); } @@ -832,7 +833,7 @@ class OrbitControls extends Controls { if ( this.enableRotate ) { - this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + this._rotateLeft( _twoPI * this.keyRotateSpeed / this.domElement.clientHeight ); } @@ -855,7 +856,7 @@ class OrbitControls extends Controls { if ( this.enableRotate ) { - this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight ); + this._rotateLeft( - _twoPI * this.keyRotateSpeed / this.domElement.clientHeight ); }