Changed to atan2

This commit is contained in:
Thomas FORGIONE 2015-04-08 14:38:53 +02:00
parent 729aaa09c2
commit ed5df6949c
1 changed files with 4 additions and 4 deletions

View File

@ -68,9 +68,9 @@ PointerCamera.prototype.update = function() {
this.phi = Math.asin(forward.z); this.phi = Math.asin(forward.z);
// Don't know why this line works... But thanks Thierry-san because // Don't know why this line works... But thanks Thierry-san and
// it seems to work... // Bastien because it seems to work...
this.theta = Math.atan(forward.y / forward.x) + Math.PI; this.theta = Math.atan2(forward.y, forward.x);
} }