From 09e2ea7cbd4c56c974a38d4263c7d238bdc81a38 Mon Sep 17 00:00:00 2001 From: bkleiner Date: Thu, 21 Dec 2023 00:59:47 +0100 Subject: [PATCH] vec3_magnitude: use sqrtf --- src/util/vector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/vector.c b/src/util/vector.c index f48398ed2..5a45dc9dc 100644 --- a/src/util/vector.c +++ b/src/util/vector.c @@ -1,5 +1,7 @@ #include "vector.h" +#include + #include "cbor_helper.h" cbor_result_t cbor_encode_vec3_t(cbor_value_t *enc, const vec3_t *vec) { @@ -32,7 +34,7 @@ float vec3_magnitude(vec3_t *v) { for (uint8_t axis = 0; axis < 3; axis++) { max += v->axis[axis] * v->axis[axis]; } - return 1.0f / Q_rsqrt(max); + return sqrtf(max); } cbor_result_t cbor_encode_compact_vec3_t(cbor_value_t *enc, const compact_vec3_t *vec) {