Revert "Smooth collisions"

This reverts commit 5d0bd09139.
This commit is contained in:
Thomas FORGIONE 2015-05-28 15:07:56 +02:00
parent 5d0bd09139
commit 7f6daec0f4
1 changed files with 2 additions and 8 deletions

View File

@ -157,14 +157,8 @@ TutoCamera.prototype.normalMotion = function(time) {
normal.multiplyScalar(-1); normal.multiplyScalar(-1);
} }
// This is quite ugly, but it allows smooth collisions (well, quite smooth) normal.multiplyScalar(0.01);
this.position.add(direction); this.position.add(normal);
var dir = direction.clone();
dir.normalize();
this.position.add(Tools.mul(dir, 300*this.speed));
var move = (Tools.mul(normal,Tools.diff(vertices[face.a], this.position).dot(normal)));
this.position.add(move);
this.position.sub(Tools.mul(dir, 300*this.speed));
} else { } else {
this.position.add(direction); this.position.add(direction);
} }