This commit is contained in:
Thomas FORGIONE 2015-05-12 16:33:46 +02:00
parent 56ddff1ebf
commit 379c32e6c4
1 changed files with 13 additions and 6 deletions

View File

@ -135,12 +135,19 @@ ArrowCamera.prototype.regenerateArrow = function(mainCamera) {
if (fp1.dot(dir) < -0.5) { if (fp1.dot(dir) < -0.5) {
// Regen polynom with better stuff // Regen polynom with better stuff
var new_dir = Tools.cross(Tools.diff(this.position, mainCamera.position).normalize(), mainCamera.up); // 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.multiplyScalar(new_dir.dot(fp1) < 0 ? 1 : -1);
new_dir.add(dir); // new_dir.add(dir);
new_dir.add(dir); // new_dir.add(dir);
new_dir.multiplyScalar(2); // new_dir.multiplyScalar(2);
f0.add(new_dir); // 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); fp1.multiplyScalar(4);