diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 02c823a8..751fff0c 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -776,7 +776,7 @@ void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, f32 *dist, s16 *pitch, s16 * register f32 xs = x * x; register f32 zs = z * z; - *dist = sqrtf(xs + zs); + *dist = sqrtf(xs + zs + y * y) *pitch = atan2s(sqrtf(xs + zs), y); *yaw = atan2s(z, x); }