diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 40c9139f..260430d5 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -1434,6 +1434,16 @@ template struct Mat3 v1((T)0, val, (T)0), v2((T)0, (T)0, val) {} + explicit inline Mat3(Mat2 mat) + : v0(mat[0], (T)0), + v1(mat[1], (T)0), + v2((T)0, (T)0, (T)0) {} + + explicit inline Mat3(Mat2 mat, T val) + : v0(Vec3(mat[0], (T)0)), + v1(Vec3(mat[1], (T)0)), + v2((T)0, (T)0, val) {} + explicit inline Mat3(Mat4 const &mat) : v0(mat[0].xyz), v1(mat[1].xyz), @@ -1521,6 +1531,30 @@ template struct Mat4 v2((T)0, (T)0, val, (T)0), v3((T)0, (T)0, (T)0, val) {} + explicit inline Mat4(Mat2 mat) + : v0(mat[0], (T)0, (T)0), + v1(mat[1], (T)0, (T)0), + v2((T)0, (T)0, (T)0, (T)0), + v3((T)0, (T)0, (T)0, (T)0) {} + + explicit inline Mat4(Mat2 mat, T val1, T val2) + : v0(mat[0], (T)0, (T)0), + v1(mat[1], (T)0, (T)0), + v2((T)0, (T)0, val1, (T)0), + v3((T)0, (T)0, (T)0, val2) {} + + explicit inline Mat4(Mat3 mat) + : v0(mat[0], (T)0), + v1(mat[1], (T)0), + v2(mat[2], (T)0), + v3((T)0, (T)0, (T)0, (T)0) {} + + explicit inline Mat4(Mat3 mat, T val) + : v0(mat[0], (T)0), + v1(mat[1], (T)0), + v2(mat[2], (T)0), + v3((T)0, (T)0, (T)0, val) {} + inline Vec4& operator[](size_t n) { return (&v0)[n]; } inline Vec4 const& operator[](size_t n) const { return (&v0)[n]; }