2
0
Эх сурвалжийг харах

Deleted unnecessary branch indenting.

This is a formatting commit, it removes an unnecessary else branch.
Daniel Cousens 12 жил өмнө
parent
commit
8c53e156f9

+ 18 - 21
examples/js/controls/FirstPersonControls.js

@@ -187,45 +187,42 @@ THREE.FirstPersonControls = function ( object, domElement ) {
 	};
 
 	this.update = function( delta ) {
-		var actualMoveSpeed = 0;
 
 		if ( this.freeze ) {
 
 			return;
 
-		} else {
+		}
 
-			if ( this.heightSpeed ) {
+		if ( this.heightSpeed ) {
 
-				var y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax );
-				var heightDelta = y - this.heightMin;
+			var y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax );
+			var heightDelta = y - this.heightMin;
 
-				this.autoSpeedFactor = delta * ( heightDelta * this.heightCoef );
+			this.autoSpeedFactor = delta * ( heightDelta * this.heightCoef );
 
-			} else {
+		} else {
 
-				this.autoSpeedFactor = 0.0;
+			this.autoSpeedFactor = 0.0;
 
-			}
-
-			actualMoveSpeed = delta * this.movementSpeed;
+		}
 
-			if ( this.moveForward || ( this.autoForward && !this.moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this.autoSpeedFactor ) );
-			if ( this.moveBackward ) this.object.translateZ( actualMoveSpeed );
+		var actualMoveSpeed = delta * this.movementSpeed;
 
-			if ( this.moveLeft ) this.object.translateX( - actualMoveSpeed );
-			if ( this.moveRight ) this.object.translateX( actualMoveSpeed );
+		if ( this.moveForward || ( this.autoForward && !this.moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this.autoSpeedFactor ) );
+		if ( this.moveBackward ) this.object.translateZ( actualMoveSpeed );
 
-			if ( this.moveUp ) this.object.translateY( actualMoveSpeed );
-			if ( this.moveDown ) this.object.translateY( - actualMoveSpeed );
+		if ( this.moveLeft ) this.object.translateX( - actualMoveSpeed );
+		if ( this.moveRight ) this.object.translateX( actualMoveSpeed );
 
-			var actualLookSpeed = delta * this.lookSpeed;
+		if ( this.moveUp ) this.object.translateY( actualMoveSpeed );
+		if ( this.moveDown ) this.object.translateY( - actualMoveSpeed );
 
-			if ( !this.activeLook ) {
+		var actualLookSpeed = delta * this.lookSpeed;
 
-				actualLookSpeed = 0;
+		if ( !this.activeLook ) {
 
-			}
+			actualLookSpeed = 0;
 
 		}