X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2Fcml%2Fmathlib%2Fmatrix_rotation.h;fp=src%2FMoof%2Fcml%2Fmathlib%2Fmatrix_rotation.h;h=872edffb5937d2c9e731e6cc3d7282592c0c1857;hp=2298c224eefad0c9271456c432b0acfb86077be2;hb=40755d4c6251206c18ce4784967d3a910cee096f;hpb=d08114d4e7315636ff62127845150273e0cbf66f diff --git a/src/Moof/cml/mathlib/matrix_rotation.h b/src/Moof/cml/mathlib/matrix_rotation.h index 2298c22..872edff 100644 --- a/src/Moof/cml/mathlib/matrix_rotation.h +++ b/src/Moof/cml/mathlib/matrix_rotation.h @@ -281,8 +281,6 @@ matrix_rotation_euler_derivatives( /* Checking */ detail::CheckMatLinear3D(m); - identity_transform(m); - size_t i, j, k; bool odd, repeat; detail::unpack_euler_order(order, i, j, k, odd, repeat); @@ -952,6 +950,20 @@ void matrix_to_euler( } } +/** Convenience function to return a 3D vector containing the Euler angles + * in the requested order. + */ +template < class MatT, typename Real > vector< Real, fixed<3> > +matrix_to_euler( + const MatT& m, + EulerOrder order, + Real tolerance = epsilon::placeholder()) +{ + Real e0, e1, e2; + matrix_to_euler(m, e0, e1, e2, order, tolerance); + return vector< Real, fixed<3> >(e0, e1, e2); +} + /** Convert a 2D rotation matrix to a rotation angle */ template < class MatT > typename MatT::value_type matrix_to_rotation_2D(const MatT& m)