From 29fbf15bb13755da6de10e2098216dbecb41fc60 Mon Sep 17 00:00:00 2001 From: Thompson Lee Date: Thu, 4 Aug 2016 06:40:22 -0400 Subject: [PATCH] Removed unwanted comments, and made them more clear. --- source/maths/mtx_lookat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/maths/mtx_lookat.c b/source/maths/mtx_lookat.c index bbb1a8e..539e8b3 100644 --- a/source/maths/mtx_lookat.c +++ b/source/maths/mtx_lookat.c @@ -2,8 +2,9 @@ void Mtx_LookAt(C3D_Mtx* out, C3D_FVec cameraPosition, C3D_FVec cameraTarget, C3D_FVec cameraUpVector, bool isLeftHanded) { - //Left-handed Look-At matrix is a DirectX implementation. - //https://msdn.microsoft.com/en-us/library/windows/desktop/bb281710 + //Left-handed and Right-handed Look-At matrix functions are DirectX implementations. + //Left-handed: https://msdn.microsoft.com/en-us/library/windows/desktop/bb281710 + //Right-handed: https://msdn.microsoft.com/en-us/library/windows/desktop/bb281711 C3D_FVec xaxis, yaxis, zaxis; //Order of operations is crucial. @@ -18,26 +19,24 @@ void Mtx_LookAt(C3D_Mtx* out, C3D_FVec cameraPosition, C3D_FVec cameraTarget, C3 if (isLeftHanded) { - //Notice in LH matrix, the Y is in Row 2 of 4. In RH matrix, the Z is in Row 2 of 4. + //In LH matrix, the Y is in Row 2 of 4 and the Z is in Row 3 of 4. out->r[1].x = xaxis.y; out->r[1].y = yaxis.y; out->r[1].z = zaxis.y; out->r[1].w = 0.0f; - //Notice in LH matrix, the Z is in Row 3 of 4. In RH matrix, the Y is in Row 3 of 4. out->r[2].x = xaxis.z; out->r[2].y = yaxis.z; out->r[2].z = zaxis.z; out->r[2].w = 0.0f; } else { - //Notice in LH matrix, the Y is in Row 2 of 4. In RH matrix, the Z is in Row 2 of 4. + //In RH matrix, the Z is in Row 2 of 4, and the Y is in Row 3 of 4. out->r[1].x = xaxis.z; out->r[1].y = yaxis.z; out->r[1].z = zaxis.z; out->r[1].w = 0.0f; - //Notice in LH matrix, the Z is in Row 3 of 4. In RH matrix, the Y is in Row 3 of 4. out->r[2].x = xaxis.y; out->r[2].y = yaxis.y; out->r[2].z = zaxis.y;