I made a get_angle function inside my Vector3 class but I have a problem with it.
The Y angle is perfectly fine.
The pitch angle (X) it returns is slightly over my destination position when the base vector is over it (and when under the opposite is happening).
The amount of it being wrong is dependant on the height difference.
Angle get_angle(const Vector3f& v) const {
return Angle(
math::rad_to_deg(atan2(get_distance(v), v.z - z)) - 90.0f,
math::rad_to_deg(atan2(v.y - y, v.x - x)),
0.0f);
}
It's probably my maths that are bad here.