浏览代码

Merge remote-tracking branch 'kyleshay/master' into dev

Mr.doob 13 年之前
父节点
当前提交
cdafb8cbce
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/extras/controls/FirstPersonControls.js

+ 3 - 1
src/extras/controls/FirstPersonControls.js

@@ -17,6 +17,7 @@ THREE.FirstPersonControls = function ( object, domElement ) {
 	this.noFly = false;
 	this.noFly = false;
 	this.lookVertical = true;
 	this.lookVertical = true;
 	this.autoForward = false;
 	this.autoForward = false;
+	this.invertVertical = false;
 
 
 	this.activeLook = true;
 	this.activeLook = true;
 
 
@@ -211,7 +212,8 @@ THREE.FirstPersonControls = function ( object, domElement ) {
 			}
 			}
 
 
 			this.lon += this.mouseX * actualLookSpeed;
 			this.lon += this.mouseX * actualLookSpeed;
-			if( this.lookVertical ) this.lat -= this.mouseY * actualLookSpeed;
+			if( this.lookVertical ) this.lat -= 
+				this.mouseY * actualLookSpeed * this.invertVertical?-1:1;
 
 
 			this.lat = Math.max( - 85, Math.min( 85, this.lat ) );
 			this.lat = Math.max( - 85, Math.min( 85, this.lat ) );
 			this.phi = ( 90 - this.lat ) * Math.PI / 180;
 			this.phi = ( 90 - this.lat ) * Math.PI / 180;