Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2016. The current version is 1.91.0.
#include <boost/qvm/quat_operations.hpp>
namespace boost
{
namespace qvm
{
//Only enabled if:
// is_quat<R>::value && is_quat<A>::value
template <class R,class A>
R convert_to( A const & a );
//Only enabled if:
// is_quat<R>::value && is_mat<A>::value &&
// mat_traits<A>::rows==3 && mat_traits<A>::cols==3
template <class R,class A>
R convert_to( A const & m );
}
}
R must be copyable.
The first overload is equivalent to: R r; assign(r,a); return r;
The second overload assumes that m is an orthonormal rotation matrix and converts it to a quaternion that performs the same rotation.