Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeetienne committed Dec 10, 2011
1 parent 6175925 commit f7a6e8e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 11 additions & 17 deletions js/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,17 @@ Marble.Camera.prototype.tick = function()
var player = gameLevel.player();

camera.position.add( player.mesh().position, this._relativePos);
//camera.lookAt( player.mesh().position );

if( player.fpsControl().isActivated() ){
var angleY = player.fpsControl().angleY();
camera.rotation.y = angleY;
camera.position.copy( player.mesh().position );
camera.position.y += 1.2*Marble.tileSize/2;
return;
}
camera.lookAt( player.mesh().position );

if( player.fpsControl().isActivated() ){
camera.position.copy( player.mesh().position );
camera.position.y += 1*Marble.tileSize/2;

if(false){
var target = player.mesh().position.clone();
var direction = Math.PI/2;
var distance = 500;
target.x += Math.cos(direction)*distance;
target.z -= Math.sin(direction)*distance;
camera.lookAt( target );
}
var direction = player.fpsControl().angleY();
var target = camera.position.clone();
target.x += Math.cos(direction);
target.z -= Math.sin(direction);
camera.lookAt( target );
}
}

2 changes: 1 addition & 1 deletion js/gameLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Marble.GameLevel = function()
this._enemies.push( new Marble.Enemy() );
}

//this.visualFxAdd(new Marble.VisualFxSparks());
this.visualFxAdd(new Marble.VisualFxSparks());

this._timeoutCtor();
}
Expand Down

0 comments on commit f7a6e8e

Please sign in to comment.