can now properly calculate angles below horizon
parent
a3c7044620
commit
655b3e1850
|
@ -16,6 +16,8 @@ public class ArtyMath {
|
||||||
public static double calculateElevation(Vector vector){
|
public static double calculateElevation(Vector vector){
|
||||||
//TODO: Rewrite this method using math from scratch instead of another method
|
//TODO: Rewrite this method using math from scratch instead of another method
|
||||||
Vector groundProjection = new Vector(vector.getX(), 0, vector.getZ());
|
Vector groundProjection = new Vector(vector.getX(), 0, vector.getZ());
|
||||||
|
double angle = groundProjection.angle(vector);
|
||||||
|
if(vector.getY() < 0) return -angle;
|
||||||
return groundProjection.angle(vector);
|
return groundProjection.angle(vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue