diff --git a/js/PointerCamera.js b/js/PointerCamera.js index 1f6eafc..724d885 100644 --- a/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -243,7 +243,7 @@ PointerCamera.prototype.isColliding = function(direction) { var intersects = this.raycaster.intersectObjects(this.collidableObjects, true); for (var i in intersects) { - if (intersects[i].distance < 100*this.speed) { + if (intersects[i].distance < Tools.norm(direction)) { return true; } } diff --git a/js/TutoCamera.js b/js/TutoCamera.js index 493e9e0..c47556f 100644 --- a/js/TutoCamera.js +++ b/js/TutoCamera.js @@ -246,7 +246,7 @@ TutoCamera.prototype.isColliding = function(direction) { var intersects = this.raycaster.intersectObjects(this.collidableObjects, true); for (var i in intersects) { - if (intersects[i].distance < 100*this.speed) { + if (intersects[i].distance < Tools.norm(direction)) { return true; } }