Skip to content

Commit

Permalink
Add CameraSpinControls.setEnableRotate function
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Jun 20, 2021
1 parent d3ca5e2 commit 30cb494
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CameraSpinControls.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author qiao / https://github.com/qiao
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
Expand Down Expand Up @@ -65,9 +65,8 @@ CameraSpinControls = function ( camera, domElement ) {
this.enableZoom = true;
this.zoomSpeed = 1.0;

// Set to false to disable rotating
// Use setEnableRotate(isEnabled) function
this.enableRotate = true;
this.rotateSpeed = 1.0;

// Set to false to disable panning
this.enablePan = true;
Expand Down Expand Up @@ -95,6 +94,13 @@ CameraSpinControls = function ( camera, domElement ) {
// public methods
//

this.setEnableRotate = function (isEnabled) {

scope.enableRotate = isEnabled;
scope.spinControl.enabled = isEnabled;

};

this.saveState = function () {

scope.target0.copy( scope.target );
Expand Down

0 comments on commit 30cb494

Please sign in to comment.