瀏覽代碼

Merge pull request #7409 from shshaw/patch-2

Multitouch fixes
Mr.doob 9 年之前
父節點
當前提交
6e2a4d2afe
共有 1 個文件被更改,包括 3 次插入11 次删除
  1. 3 11
      examples/js/controls/TrackballControls.js

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

@@ -561,22 +561,14 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 
 			case 0:
 			case 0:
 				_state = STATE.NONE;
 				_state = STATE.NONE;
+				_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;
 				break;
 				break;
 
 
 			case 1:
 			case 1:
 				_state = STATE.TOUCH_ROTATE;
 				_state = STATE.TOUCH_ROTATE;
-				_movePrev.copy( _moveCurr );
-				_moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );
-				break;
-
-			default: // 2 or more
-				_state = STATE.TOUCH_ZOOM_PAN;
 				_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;
 				_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;
-
-				var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;
-				var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;
-				_panEnd.copy( getMouseOnScreen( x, y ) );
-				_panStart.copy( _panEnd );
+				_moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );
+				_movePrev.copy( _moveCurr );
 				break;
 				break;
 
 
 		}
 		}