Changeset 2348 for trunk/src/lol/math/vector.h
 Timestamp:
 Feb 4, 2013, 10:24:20 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/vector.h
r2346 r2348 937 937 LOL_MEMBER_OPS(Quat, w) 938 938 939 / /Angle in degree940 static Quat<T> rotate(T angle, T x, T y, T z);941 static Quat<T> rotate(T angle, Vec3<T> const &v);939 /* Create a unit quaternion representing a rotation around an axis. */ 940 static Quat<T> rotate(T degrees, T x, T y, T z); 941 static Quat<T> rotate(T degrees, Vec3<T> const &v); 942 942 943 943 /* Convert from Euler angles. The axes in fromeuler_xyx are 944 944 * x, then y', then x", ie. the axes are attached to the model. 945 945 * If you want to rotate around static axes, just reverse the order 946 * of the arguments. */946 * of the arguments. Angle values are in degrees. */ 947 947 static Quat<T> fromeuler_xyx(Vec3<T> const &v); 948 948 static Quat<T> fromeuler_xzx(Vec3<T> const &v); … … 962 962 * x, then y', then z", ie. the axes are attached to the model. 963 963 * If you want to apply yaw around x, pitch around y, and roll 964 * around z, use fromeuler_xyz. 964 * around z, use fromeuler_xyz. Angle values are in degrees. 965 965 * If you want to rotate around static axes, reverse the order in 966 966 * the function name (_zyx instead of _xyz) AND reverse the order … … 1481 1481 1482 1482 /* Helpers for transformation matrices */ 1483 //Angle in degree 1484 static Mat2<T> rotate(T angle); 1485 static inline Mat2<T> rotate(Mat2<T> mat, T angle) 1486 { 1487 return rotate(angle) * mat; 1483 static Mat2<T> rotate(T degrees); 1484 static inline Mat2<T> rotate(Mat2<T> mat, T degrees) 1485 { 1486 return rotate(degrees) * mat; 1488 1487 } 1489 1488 … … 1578 1577 static Mat3<T> scale(T x, T y, T z); 1579 1578 static Mat3<T> scale(Vec3<T> v); 1580 //Angle in degree 1581 static Mat3<T> rotate(T angle, T x, T y, T z); 1582 static Mat3<T> rotate(T angle, Vec3<T> v); 1579 static Mat3<T> rotate(T degrees, T x, T y, T z); 1580 static Mat3<T> rotate(T degrees, Vec3<T> v); 1583 1581 1584 1582 static Mat3<T> fromeuler_xyz(Vec3<T> const &v); … … 1608 1606 static Mat3<T> fromeuler_zyz(T phi, T theta, T psi); 1609 1607 1610 //Angle in degree 1611 static inline Mat3<T> rotate(Mat3<T> mat, T angle, Vec3<T> v) 1612 { 1613 return rotate(angle, v) * mat; 1608 static inline Mat3<T> rotate(Mat3<T> mat, T degrees, Vec3<T> v) 1609 { 1610 return rotate(degrees, v) * mat; 1614 1611 } 1615 1612 … … 1734 1731 } 1735 1732 1736 //Angle in degree 1737 static inline Mat4<T> rotate(T angle, T x, T y, T z) 1738 { 1739 return Mat4<T>(Mat3<T>::rotate(angle, x, y, z), (T)1); 1740 } 1741 1742 //Angle in degree 1743 static inline Mat4<T> rotate(T angle, Vec3<T> v) 1744 { 1745 return Mat4<T>(Mat3<T>::rotate(angle, v), (T)1); 1746 } 1747 1748 //Angle in degree 1749 static inline Mat4<T> rotate(Mat4<T> &mat, T angle, Vec3<T> v) 1750 { 1751 return rotate(angle, v) * mat; 1733 static inline Mat4<T> rotate(T degrees, T x, T y, T z) 1734 { 1735 return Mat4<T>(Mat3<T>::rotate(degrees, x, y, z), (T)1); 1736 } 1737 1738 static inline Mat4<T> rotate(T degrees, Vec3<T> v) 1739 { 1740 return Mat4<T>(Mat3<T>::rotate(degrees, v), (T)1); 1741 } 1742 1743 static inline Mat4<T> rotate(Mat4<T> &mat, T degrees, Vec3<T> v) 1744 { 1745 return rotate(degrees, v) * mat; 1752 1746 } 1753 1747
Note: See TracChangeset
for help on using the changeset viewer.