aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar gingerBill 2020-11-18 12:04:35 +0000
committerGravatar GitHub 2020-11-18 12:04:35 +0000
commitfe41e2b5cf2a3d48f93e8d635e24c42a33c3537d (patch)
tree5759b47798ef870553e10351aeb12f2491500417
parentMerge pull request #42 from sjml/patch-1 (diff)
parentfix: vector transforms (diff)
Merge pull request #44 from tszirr/master
fix: vector transforms
-rw-r--r--gb_math.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/gb_math.h b/gb_math.h
index 7b97f20..9f405c6 100644
--- a/gb_math.h
+++ b/gb_math.h
@@ -1356,8 +1356,8 @@ void gb_float22_mul(float (*out)[2], float (*mat1)[2], float (*mat2)[2]) {
}
void gb_float22_mul_vec2(gbVec2 *out, float m[2][2], gbVec2 v) {
- out->x = m[0][0]*v.x + m[0][1]*v.y;
- out->y = m[1][0]*v.x + m[1][1]*v.y;
+ out->x = m[0][0]*v.x + m[1][0]*v.y;
+ out->y = m[0][1]*v.x + m[1][1]*v.y;
}
float gb_mat2_determinate(gbMat2 *m) {
@@ -1427,9 +1427,9 @@ void gb_float33_mul(float (*out)[3], float (*mat1)[3], float (*mat2)[3]) {
}
void gb_float33_mul_vec3(gbVec3 *out, float m[3][3], gbVec3 v) {
- out->x = m[0][0]*v.x + m[0][1]*v.y + m[0][2]*v.z;
- out->y = m[1][0]*v.x + m[1][1]*v.y + m[1][2]*v.z;
- out->z = m[2][0]*v.x + m[2][1]*v.y + m[2][2]*v.z;
+ out->x = m[0][0]*v.x + m[1][0]*v.y + m[2][0]*v.z;
+ out->y = m[0][1]*v.x + m[1][1]*v.y + m[2][1]*v.z;
+ out->z = m[0][2]*v.x + m[1][2]*v.y + m[2][2]*v.z;
}