From 408eb102f74a89d6f73e343dd2aae7e0336a6792 Mon Sep 17 00:00:00 2001 From: Thompson Lee Date: Thu, 4 Aug 2016 10:21:38 -0400 Subject: [PATCH] Addressing feedback: <@mtheall> alternatively, zaxis = FVec3_Normalize(FVec3_Subtract(cameraPosition, cameraTarget)); --- source/maths/mtx_lookat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/maths/mtx_lookat.c b/source/maths/mtx_lookat.c index 3244c61..318fd6c 100644 --- a/source/maths/mtx_lookat.c +++ b/source/maths/mtx_lookat.c @@ -8,10 +8,7 @@ void Mtx_LookAt(C3D_Mtx* out, C3D_FVec cameraPosition, C3D_FVec cameraTarget, C3 C3D_FVec xaxis, yaxis, zaxis; //Order of operations is crucial. - zaxis.x = cameraPosition.x - cameraTarget.x; - zaxis.y = cameraPosition.y - cameraTarget.y; - zaxis.z = cameraPosition.z - cameraTarget.z; - zaxis = FVec3_Normalize(zaxis); + zaxis = FVec3_Normalize(FVec3_Subtract(cameraPosition, cameraTarget)); xaxis = FVec3_Normalize(FVec3_Cross(cameraUpVector, zaxis)); yaxis = FVec3_Cross(zaxis, xaxis);