Collision is now robust (ありがとうチェリーさん)

This commit is contained in:
Thomas FORGIONE 2015-05-27 15:20:08 +02:00
parent dbd823c066
commit 718e6f88b8
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}