提交 8c53e156 编写于 作者: D Daniel Cousens

Deleted unnecessary branch indenting.

This is a formatting commit, it removes an unnecessary else branch.
上级 97ced7ec
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册