From: hgn Date: Mon, 17 Jul 2023 22:07:28 +0000 (+0100) Subject: fixed mistake in quaternion normalize X-Git-Url: https://harrygodden.com/git/?p=vg.git;a=commitdiff_plain;h=51a168e586d5cb911b95dc9e9037421452b4cb8c fixed mistake in quaternion normalize --- diff --git a/vg_m.h b/vg_m.h index 0ded4e1..8b354d6 100644 --- a/vg_m.h +++ b/vg_m.h @@ -628,11 +628,11 @@ static inline void q_inv( v4f q, v4f d ) d[3] = q[3]*s; } -static inline void q_nlerp( v4f a, v4f b, f32 t, v4f d ) -{ +static inline void q_nlerp( v4f a, v4f b, f32 t, v4f d ){ if( v4_dot(a,b) < 0.0f ){ - v4_muls( b, -1.0f, d ); - v4_lerp( a, d, t, d ); + v4f c; + v4_muls( b, -1.0f, c ); + v4_lerp( a, c, t, d ); } else v4_lerp( a, b, t, d );