From b3d7d2743750e8b181980e86a8154342e1a27702 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 13 May 2015 09:33:49 +0200 Subject: [PATCH] Should be better --- static/js/prototype/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/prototype/main.js b/static/js/prototype/main.js index 9234996..7292422 100644 --- a/static/js/prototype/main.js +++ b/static/js/prototype/main.js @@ -197,7 +197,6 @@ function stopFullscreen() { } function render() { - var currentTime = Date.now() - previousTime; cameraSelecter.update(); // Update recommendations (set raycastable if shown) @@ -216,12 +215,13 @@ function render() { coins.forEach(function(coin) { coin.update(); }); // Update main camera - cameras.updateMainCamera(currentTime); + var currentTime = Date.now() - previousTime; + cameras.updateMainCamera(isNaN(currentTime) ? 20 : currentTime); + previousTime = Date.now(); // Update the recommendations cameras.update(cameras.mainCamera()); - previousTime = Date.now(); // Set current position of camera cameras.look();