diff --git a/matrix.hpp b/matrix.hpp index e5d8c02d..d6bf4502 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -245,6 +245,19 @@ namespace cruft { //template matrix<4,4,T> scale (T); template matrix<4,4,T> rotation (T angle, vector<3,T> about); + + /// Returns a matrix representing the rotation vector specifying the + /// concatentation of: {yaw,pitch,roll}. + template + constexpr + matrix<4,4,ValueT> + rotation_euler (vector<3,ValueT> angles) + { + return rotation (angles[1], {0,1,0}) * + rotation (angles[0], {1,0,0}) * + rotation (angles[2], {0,0,1}); + } + //template matrix<3,3,T> translation (vector<2,T>); //template matrix<3,3,T> scale (vector<2,T>);