A quaternion represented by a 3D rotation axis and an angle. More...
#include <NRE_Quaternion.hpp>
Public Member Functions | |
constexpr | Quaternion ()=default |
template<class K , class L , class N , class M > | |
constexpr | Quaternion (K x, L y, N z, M w) |
template<class K , class L , class N > | |
Quaternion (K x, L y, N z, Angle w) | |
template<class K , class L > | |
constexpr | Quaternion (Vector3D< K > const &ax, L an) |
template<class K > | |
Quaternion (Vector3D< K > const &ax, Angle an) | |
constexpr | Quaternion (Quaternion const &q)=default |
constexpr | Quaternion (Quaternion &&q)=default |
template<class K > | |
constexpr | Quaternion (Quaternion< K > const &q) |
~Quaternion ()=default | |
constexpr T | getX () const |
constexpr T | getY () const |
constexpr T | getZ () const |
constexpr T | getW () const |
constexpr Vector3D< T > | getAxis () const |
constexpr Vector4D< T > const & | getQuaternion () const |
template<class K > | |
constexpr void | setX (K x) |
template<class K > | |
constexpr void | setY (K y) |
template<class K > | |
constexpr void | setZ (K z) |
template<class K > | |
constexpr void | setW (K w) |
template<class K > | |
void | setAngleAxis (Vector3D< K > const &axis, Angle w) |
constexpr void | setIdentity () |
long double | norm () const |
constexpr T | normSquared () const |
Quaternion | normalize () |
constexpr const T * | value () const |
constexpr Quaternion & | operator= (Quaternion const &q)=default |
constexpr Quaternion & | operator= (Quaternion &&q)=default |
template<class K > | |
constexpr Quaternion & | operator= (Quaternion< K > const &q) |
template<class K > | |
constexpr Quaternion & | operator= (Quaternion< K > &&q) |
template<class K > | |
constexpr Quaternion & | operator*= (Quaternion< K > const &q) |
template<class K > | |
constexpr Quaternion< std::common_type_t< T, K > > | operator* (Quaternion< K > const &q) const |
Utility::String | toString () const |
A quaternion represented by a 3D rotation axis and an angle.
|
default |
The internal quaternion Construct the identity quaternion
constexpr NRE::Math::Quaternion< T >::Quaternion | ( | K | x, |
L | y, | ||
N | z, | ||
M | w | ||
) |
Construct a quaternion with direct assignment
x | the x coordinate |
y | the y coordinate |
z | the z coordinate |
w | the w coordinate |
NRE::Math::Quaternion< T >::Quaternion | ( | K | x, |
L | y, | ||
N | z, | ||
Angle | w | ||
) |
Construct a quaternion from angle-axis construction
x | the x coordinate |
y | the y coordinate |
z | the z coordinate |
w | the rotation's angle |
constexpr NRE::Math::Quaternion< T >::Quaternion | ( | Vector3D< K > const & | ax, |
L | an | ||
) |
Construct a quaternion with direct assignment
ax | the rotation's axis |
an | the rotation's angle |
NRE::Math::Quaternion< T >::Quaternion | ( | Vector3D< K > const & | ax, |
Angle | an | ||
) |
Construct a quaternion from angle-axis construction
ax | the rotation's axis |
an | the rotation's angle |
|
default |
Copy q into this
q | the object to copy |
|
default |
Move q into this
q | the object to move |
constexpr NRE::Math::Quaternion< T >::Quaternion | ( | Quaternion< K > const & | q | ) |
Convert a K-type quaternion into a T-type quaternion
q | the K-type quaternion to convert |
|
default |
Quaternion Deconstructor
constexpr Vector3D<T> NRE::Math::Quaternion< T >::getAxis | ( | ) | const |
constexpr Vector4D<T> const& NRE::Math::Quaternion< T >::getQuaternion | ( | ) | const |
constexpr T NRE::Math::Quaternion< T >::getW | ( | ) | const |
constexpr T NRE::Math::Quaternion< T >::getX | ( | ) | const |
constexpr T NRE::Math::Quaternion< T >::getY | ( | ) | const |
constexpr T NRE::Math::Quaternion< T >::getZ | ( | ) | const |
long double NRE::Math::Quaternion< T >::norm | ( | ) | const |
Quaternion NRE::Math::Quaternion< T >::normalize | ( | ) |
Normalize the quaternion
constexpr T NRE::Math::Quaternion< T >::normSquared | ( | ) | const |
constexpr Quaternion<std::common_type_t<T, K> > NRE::Math::Quaternion< T >::operator* | ( | Quaternion< K > const & | q | ) | const |
Compute the quaternion resulting in the multiplication of this and q
q | the second quaternion |
constexpr Quaternion& NRE::Math::Quaternion< T >::operator*= | ( | Quaternion< K > const & | q | ) |
Multiply 2 quaternions together
q | the second quaternion |
|
default |
Copy q into this
q | the object to copy into this |
|
default |
Move q into this
q | the object to move into this |
constexpr Quaternion& NRE::Math::Quaternion< T >::operator= | ( | Quaternion< K > const & | q | ) |
Copy q into this
q | the object to copy into this |
constexpr Quaternion& NRE::Math::Quaternion< T >::operator= | ( | Quaternion< K > && | q | ) |
Move q into this
q | the object to move into this |
|
inline |
Angle axis setter
axis | the new rotation's axis |
w | the new rotation's angle |
constexpr void NRE::Math::Quaternion< T >::setIdentity | ( | ) |
Set the quaternion to the identity quaternion
W setter
w | the new value for w |
X setter
x | the new value for x |
Y setter
y | the new value for y |
Z setter
z | the new value for z |
Utility::String NRE::Math::Quaternion< T >::toString | ( | ) | const |
Convert the quaternion into a string
constexpr const T* NRE::Math::Quaternion< T >::value | ( | ) | const |