From 77804b8620e7c1b2277e22e93ff36d9300579559 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 31 May 2019 16:30:16 +0200 Subject: [PATCH] include/Spectre/Math/Matrix4.inl: in matrix vector multiplication. for some reason g++ was not happy with calling the constructor. this works. --- include/Spectre/Math/Matrix4.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/Spectre/Math/Matrix4.inl b/include/Spectre/Math/Matrix4.inl index 1ece4d4..04d51c7 100644 --- a/include/Spectre/Math/Matrix4.inl +++ b/include/Spectre/Math/Matrix4.inl @@ -34,7 +34,7 @@ inline Matrix4::Matrix4( } template -inline Matrix4::Matrix4(T *a) +inline Matrix4::Matrix4(T *a) { // Note. array is passed as row-major m[0][0] = a[0]; m[1][0] = a[1]; m[2][0] = a[2]; m[3][0] = a[3]; @@ -138,11 +138,11 @@ inline Matrix4& operator*=(Matrix4& a, const Matrix4& b) template inline Vector3 operator*(const Matrix4& mat, const Vector3& vec) { - return Vextor3( - mat.m[0][0] * vec.x + mat.m[1][0] * vec.y + mat[2][0] * vec.z, - mat.m[0][1] * vec.x + mat.m[1][1] * vec.y + mat[2][1] * vec.z, - mat.m[0][2] * vec.x + mat.m[1][2] * vec.y + mat[2][2] * vec.z, - ); + Vector3 r; + r.x = mat.m[0][0] * vec.x + mat.m[1][0] * vec.y + mat[2][0] * vec.z; + r.y = mat.m[0][1] * vec.x + mat.m[1][1] * vec.y + mat[2][1] * vec.z; + r.z = mat.m[0][2] * vec.x + mat.m[1][2] * vec.y + mat[2][2] * vec.z; + return r; }