From 7f6daec0f47214796dbc706c005d96db7b4e9cf5 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Thu, 28 May 2015 15:07:56 +0200 Subject: [PATCH] Revert "Smooth collisions" This reverts commit 5d0bd09139295208c037f3c9947541d023aefe6c. --- js/TutoCamera.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/js/TutoCamera.js b/js/TutoCamera.js index ae4d034..4264472 100644 --- a/js/TutoCamera.js +++ b/js/TutoCamera.js @@ -157,14 +157,8 @@ TutoCamera.prototype.normalMotion = function(time) { normal.multiplyScalar(-1); } - // This is quite ugly, but it allows smooth collisions (well, quite smooth) - this.position.add(direction); - 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)); + normal.multiplyScalar(0.01); + this.position.add(normal); } else { this.position.add(direction); }