From c2e1416a2a3b2a9d9f2cd7149caf0c9d460b48de Mon Sep 17 00:00:00 2001 From: Thompson Lee Date: Thu, 11 Aug 2016 12:19:32 -0400 Subject: [PATCH] Optimizing code, because Quat_FromAxisAngle() will normalize the axis vector. No need to normalize again. --- source/maths/quat_lookat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/maths/quat_lookat.c b/source/maths/quat_lookat.c index d04c718..034108e 100644 --- a/source/maths/quat_lookat.c +++ b/source/maths/quat_lookat.c @@ -10,6 +10,6 @@ C3D_FQuat Quat_LookAt(C3D_FVec source, C3D_FVec target, C3D_FVec forwardVector, if (dot - 1.0f < -FLT_EPSILON) return Quat_Identity(); float rotationAngle = acosf(dot); - C3D_FVec rotationAxis = FVec3_Normalize(FVec3_Cross(forwardVector, forward)); + C3D_FVec rotationAxis = FVec3_Cross(forwardVector, forward); return Quat_FromAxisAngle(rotationAxis, rotationAngle); }