diff --git a/source/maths/mtx_lookat.c b/source/maths/mtx_lookat.c index 318fd6c..112f8a8 100644 --- a/source/maths/mtx_lookat.c +++ b/source/maths/mtx_lookat.c @@ -8,7 +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 = FVec3_Normalize(FVec3_Subtract(cameraPosition, cameraTarget)); + zaxis = FVec3_Normalize(FVec3_New(cameraPosition.x - cameraTarget.x, cameraPosition.y - cameraTarget.y, cameraPosition.z - cameraTarget.z)); xaxis = FVec3_Normalize(FVec3_Cross(cameraUpVector, zaxis)); yaxis = FVec3_Cross(zaxis, xaxis);