From a6f637223f32abe465b9b666ec4dc29c66d7f8d4 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Thu, 21 May 2015 11:13:16 +0200 Subject: [PATCH] Removed useless log, and fix previsualization on arrow --- posts/reset-clicked/index.js | 1 - static/js/prototype/raycasterTools.js | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/posts/reset-clicked/index.js b/posts/reset-clicked/index.js index 2d76a3f..bdb8985 100644 --- a/posts/reset-clicked/index.js +++ b/posts/reset-clicked/index.js @@ -15,7 +15,6 @@ module.exports.index = function(req, res) { req.body.time ], function(err, result) { - console.log(err); release(); } ); diff --git a/static/js/prototype/raycasterTools.js b/static/js/prototype/raycasterTools.js index 4ad2814..a16013f 100644 --- a/static/js/prototype/raycasterTools.js +++ b/static/js/prototype/raycasterTools.js @@ -47,8 +47,8 @@ CameraSelecter.prototype.pointedCamera = function() { return coins[coin]; } } - - return this.cameras.getByObject(intersects[bestIndex].object); + this.currentPointedCamera = this.cameras.getByObject(intersects[bestIndex].object); + return this.currentPointedCamera; // } } } @@ -60,11 +60,14 @@ CameraSelecter.prototype.update = function(event) { this.mouse.y = event.offsetY == undefined ? event.layerY : event.offsetY; } + var previousCamera = this.currentPointedCamera; var hovered = this.pointedCamera(event); if (hovered !== undefined && !(hovered instanceof Coin)) { - this.prev.x = this.mouse.x; - this.prev.y = this.mouse.y; + if (hovered !== previousCamera) { + this.prev.x = this.mouse.x; + this.prev.y = this.mouse.y; + } this.prev.camera = hovered; this.prev.go = true; } else {