1
0
Fork 0

include/Spectre/Math/Matrix4.inl: in matrix vector multiplication. for some reason g++ was not happy with calling the constructor. this works.

This commit is contained in:
Henrik Hautakoski 2019-05-31 16:30:16 +02:00
parent 6b8c766702
commit 77804b8620

View file

@ -138,11 +138,11 @@ inline Matrix4<T>& operator*=(Matrix4<T>& a, const Matrix4<T>& b)
template <typename T> template <typename T>
inline Vector3<T> operator*(const Matrix4<T>& mat, const Vector3<T>& vec) inline Vector3<T> operator*(const Matrix4<T>& mat, const Vector3<T>& vec)
{ {
return Vextor3<T>( Vector3<T> r;
mat.m[0][0] * vec.x + mat.m[1][0] * vec.y + mat[2][0] * vec.z, r.x = 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, r.y = 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, r.z = mat.m[0][2] * vec.x + mat.m[1][2] * vec.y + mat[2][2] * vec.z;
); return r;
} }