|
@@ -12,6 +12,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
// API
|
|
|
|
|
|
+ this.enabled = true;
|
|
|
+
|
|
|
this.center = new THREE.Vector3();
|
|
|
|
|
|
this.userZoom = true;
|
|
@@ -215,7 +217,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
function onMouseDown( event ) {
|
|
|
|
|
|
- if ( !scope.userRotate ) return;
|
|
|
+ if ( scope.enabled === false ) return;
|
|
|
+ if ( scope.userRotate === false ) return;
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
@@ -244,6 +247,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
function onMouseMove( event ) {
|
|
|
|
|
|
+ if ( scope.enabled === false ) return;
|
|
|
+
|
|
|
event.preventDefault();
|
|
|
|
|
|
if ( state === STATE.ROTATE ) {
|
|
@@ -286,7 +291,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
function onMouseUp( event ) {
|
|
|
|
|
|
- if ( ! scope.userRotate ) return;
|
|
|
+ if ( scope.enabled === false ) return;
|
|
|
+ if ( scope.userRotate === false ) return;
|
|
|
|
|
|
document.removeEventListener( 'mousemove', onMouseMove, false );
|
|
|
document.removeEventListener( 'mouseup', onMouseUp, false );
|
|
@@ -297,7 +303,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
function onMouseWheel( event ) {
|
|
|
|
|
|
- if ( ! scope.userZoom ) return;
|
|
|
+ if ( scope.enabled === false ) return;
|
|
|
+ if ( scope.userZoom === false ) return;
|
|
|
|
|
|
var delta = 0;
|
|
|
|
|
@@ -325,7 +332,8 @@ THREE.OrbitControls = function ( object, domElement ) {
|
|
|
|
|
|
function onKeyDown( event ) {
|
|
|
|
|
|
- if ( ! scope.userPan ) return;
|
|
|
+ if ( scope.enabled === false ) return;
|
|
|
+ if ( scope.userPan === false ) return;
|
|
|
|
|
|
switch ( event.keyCode ) {
|
|
|
|