From 379c32e6c41cc3cf4f039a308d6bfa770c8b4cb1 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 12 May 2015 16:33:46 +0200 Subject: [PATCH] Commit --- static/js/prototype/ArrowCamera.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/static/js/prototype/ArrowCamera.js b/static/js/prototype/ArrowCamera.js index 7c19e40..3ff5e5f 100644 --- a/static/js/prototype/ArrowCamera.js +++ b/static/js/prototype/ArrowCamera.js @@ -135,12 +135,19 @@ ArrowCamera.prototype.regenerateArrow = function(mainCamera) { if (fp1.dot(dir) < -0.5) { // Regen polynom with better stuff - var new_dir = Tools.cross(Tools.diff(this.position, mainCamera.position).normalize(), mainCamera.up); - new_dir.multiplyScalar(new_dir.dot(fp1) < 0 ? 1 : -1); - new_dir.add(dir); - new_dir.add(dir); - new_dir.multiplyScalar(2); - f0.add(new_dir); + // var new_dir = Tools.cross(Tools.diff(this.position, mainCamera.position).normalize(), mainCamera.up); + // new_dir.multiplyScalar(new_dir.dot(fp1) < 0 ? 1 : -1); + // new_dir.add(dir); + // new_dir.add(dir); + // new_dir.multiplyScalar(2); + // f0.add(new_dir); + + if (mainCamera.position.y > this.position.y) { + f0.add(new THREE.Vector3(0,2,0)); + } else { + f0.add(new THREE.Vector3(0,-2,0)); + } + } fp1.multiplyScalar(4);