diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 9d28e113..da90615c 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -936,6 +936,7 @@ template struct Quat LOL_MEMBER_OPS(Quat, w) + //Angle in degree static Quat rotate(T angle, T x, T y, T z); static Quat rotate(T angle, Vec3 const &v); @@ -1479,8 +1480,8 @@ template struct Mat2 inline Vec2 const& operator[](size_t n) const { return (&v0)[n]; } /* Helpers for transformation matrices */ + //Angle in degree static Mat2 rotate(T angle); - static inline Mat2 rotate(Mat2 mat, T angle) { return rotate(angle) * mat; @@ -1576,6 +1577,7 @@ template struct Mat3 static Mat3 scale(T x); static Mat3 scale(T x, T y, T z); static Mat3 scale(Vec3 v); + //Angle in degree static Mat3 rotate(T angle, T x, T y, T z); static Mat3 rotate(T angle, Vec3 v); @@ -1605,6 +1607,7 @@ template struct Mat3 static Mat3 fromeuler_zxz(T phi, T theta, T psi); static Mat3 fromeuler_zyz(T phi, T theta, T psi); + //Angle in degree static inline Mat3 rotate(Mat3 mat, T angle, Vec3 v) { return rotate(angle, v) * mat; @@ -1730,16 +1733,19 @@ template struct Mat4 return translate(v) * mat; } + //Angle in degree static inline Mat4 rotate(T angle, T x, T y, T z) { return Mat4(Mat3::rotate(angle, x, y, z), (T)1); } + //Angle in degree static inline Mat4 rotate(T angle, Vec3 v) { return Mat4(Mat3::rotate(angle, v), (T)1); } + //Angle in degree static inline Mat4 rotate(Mat4 &mat, T angle, Vec3 v) { return rotate(angle, v) * mat;