From f19ff5d064150172449439c15e16fd32e5197c31 Mon Sep 17 00:00:00 2001 From: Sundaram Ramaswamy Date: Thu, 6 May 2021 23:47:03 +0530 Subject: [PATCH] Use scale for both cases --- include/cglm/quat.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/cglm/quat.h b/include/cglm/quat.h index 97b27ed..ece4a78 100644 --- a/include/cglm/quat.h +++ b/include/cglm/quat.h @@ -644,10 +644,7 @@ void glm_quat_nlerp(versor from, versor to, float t, versor dest) { float dot = glm_vec4_dot(from, to); versor target; - if (dot >= 0) - glm_quat_copy(to, target); - else - glm_vec4_negate_to(to, target); + glm_vec4_scale(to, (dot >= 0) ? 1 : -1, target); glm_quat_lerp(from, target, t, dest); glm_quat_normalize(dest); }