From 718e6f88b809dacbe1682b153685e995706ef506 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 27 May 2015 15:20:08 +0200 Subject: [PATCH] =?UTF-8?q?Collision=20is=20now=20robust=20(=E3=81=82?= =?UTF-8?q?=E3=82=8A=E3=81=8C=E3=81=A8=E3=81=86=E3=83=81=E3=82=A7=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=81=95=E3=82=93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/PointerCamera.js | 2 +- js/TutoCamera.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } }