Up / Down instead of Left / Right for U-turn

This commit is contained in:
Thomas FORGIONE 2015-05-12 16:26:24 +02:00
parent 2447cb5aa8
commit 7f8767d6db
1 changed files with 11 additions and 6 deletions

View File

@ -135,12 +135,17 @@ 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); var up = new THREE.Vector3(0,1,0);
if (mainCamera.position.y < this.position.y)
up.multiplyScalar(-1);
f0.add(Tools.mul(up,2));
} }
fp1.multiplyScalar(4); fp1.multiplyScalar(4);