Explorar o código

OrbitControls: Removed another unneeded needUpdate.

Mr.doob %!s(int64=11) %!d(string=hai) anos
pai
achega
2f65008a53
Modificáronse 1 ficheiros con 3 adicións e 11 borrados
  1. 3 11
      examples/js/controls/OrbitControls.js

+ 3 - 11
examples/js/controls/OrbitControls.js

@@ -492,8 +492,6 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 		var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
 
-		var needUpdate = false;
-
 		switch ( event.touches.length ) {
 
 			case 1: // one-fingered touch: rotate
@@ -510,7 +508,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 				rotateStart.copy( rotateEnd );
 
-				needUpdate = true;
+				scope.update();
 				break;
 
 			case 2: // two-fingered touch: dolly
@@ -536,7 +534,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 				dollyStart.copy( dollyEnd );
 
-				needUpdate = true;
+				scope.update();
 				break;
 
 			case 3: // three-fingered touch: pan
@@ -550,7 +548,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 				panStart.copy( panEnd );
 
-				needUpdate = true;
+				scope.update();
 				break;
 
 			default:
@@ -558,12 +556,6 @@ THREE.OrbitControls = function ( object, domElement ) {
 
 		}
 
-		if ( needUpdate ) {
-
-			scope.update();
-
-		}
-
 	}
 
 	function touchend( /* event */ ) {