From 2daf766901ef909621f1bcc7b75502f0cc16c7ff Mon Sep 17 00:00:00 2001 From: Reonu Date: Fri, 1 Oct 2021 16:47:18 +0300 Subject: [PATCH] fixed camera memes --- src/engine/math_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }