From ec0eab56515ac4130df18537c415002d87d4676d Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Thu, 11 Jun 2015 11:49:42 +0200 Subject: [PATCH] Improved camera motion when laggy --- js/PointerCamera.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/PointerCamera.js b/js/PointerCamera.js index 52512d6..b0184aa 100644 --- a/js/PointerCamera.js +++ b/js/PointerCamera.js @@ -105,10 +105,10 @@ PointerCamera.prototype.hermiteMotion = function(time) { PointerCamera.prototype.normalMotion = function(time) { // Update angles - if (this.motion.increasePhi) {this.phi += this.sensitivity; this.changed = true; } - if (this.motion.decreasePhi) {this.phi -= this.sensitivity; this.changed = true; } - if (this.motion.increaseTheta) {this.theta += this.sensitivity; this.changed = true; } - if (this.motion.decreaseTheta) {this.theta -= this.sensitivity; this.changed = true; } + if (this.motion.increasePhi) {this.phi += this.sensitivity * time / 20; this.changed = true; } + if (this.motion.decreasePhi) {this.phi -= this.sensitivity * time / 20; this.changed = true; } + if (this.motion.increaseTheta) {this.theta += this.sensitivity * time / 20; this.changed = true; } + if (this.motion.decreaseTheta) {this.theta -= this.sensitivity * time / 20; this.changed = true; } if (this.dragging) { this.theta += this.mouseMove.x;