From 44be431b65b10f37545467f3d5536705d8408536 Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Sun, 28 Aug 2016 23:27:24 -0500 Subject: [PATCH] Fix issues that came up in testing Refs #25 --- HandmadeMath.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HandmadeMath.h b/HandmadeMath.h index 860bea6..c3783b7 100644 --- a/HandmadeMath.h +++ b/HandmadeMath.h @@ -857,7 +857,7 @@ HMM_MultiplyVec3(hmm_vec3 Left, hmm_vec3 Right) { hmm_vec3 Result = {0}; - Result.X = Left.Z * Right.X; + Result.X = Left.X * Right.X; Result.Y = Left.Y * Right.Y; Result.Z = Left.Z * Right.Z; @@ -1095,7 +1095,7 @@ HMM_MultiplyMat4ByVec4(hmm_mat4 Matrix, hmm_vec4 Vector) float Sum = 0; for(Columns = 0; Columns < 4; ++Columns) { - Sum += Matrix.Elements[Rows][Columns] * Vector.Elements[Columns]; + Sum += Matrix.Elements[Columns][Rows] * Vector.Elements[Columns]; } Result.Elements[Rows] = Sum; @@ -1160,9 +1160,9 @@ HMM_Translate(hmm_vec3 Translation) { hmm_mat4 Result = HMM_Mat4d(1.0f); - Result.Elements[0][3] = Translation.X; - Result.Elements[1][3] = Translation.Y; - Result.Elements[2][3] = Translation.Z; + Result.Elements[3][0] = Translation.X; + Result.Elements[3][1] = Translation.Y; + Result.Elements[3][2] = Translation.Z; return (Result); }