Quaternion. More...
#include <mat4.h>
Public Member Functions | |
| Quaternionx () | |
| Constructs a quaternion. More... | |
| Quaternionx (const Quaternionx &other) | |
| Quaternionx (Type x, Type y, Type z, Type w) | |
| Quaternionx (const Vec4< Type > &quat) | |
| Quaternionx (const Mat4< Type > &rotation_matrix) | |
| Quaternionx< Type > & | inverse () |
| Inverse this quaternion. More... | |
| Type | magnitude () const |
| Get the quaternion magnitude. More... | |
| Quaternionx< Type > & | normalize () |
| Normalizes this quaternion. More... | |
| operator Vec4< Type > () const | |
| bool | operator!= (const Quaternionx< Type > &other) const |
| Not equal operator. More... | |
| Quaternionx< Type > | operator* (const Quaternionx< Type > &mult) const |
| Multiplication operator. More... | |
| Quaternionx< Type > | operator* (const Mat4< Type > &matrix) const |
| Vec3< Type > | operator* (const Vec3< Type > &v) const |
| Vec4< Type > | operator* (const Vec4< Type > &v) const |
| bool | operator< (const Quaternionx< Type > &other) const |
| Less operator. More... | |
| bool | operator<= (const Quaternionx< Type > &other) const |
| Less equal operator. More... | |
| bool | operator== (const Quaternionx< Type > &other) const |
| Equal operator. More... | |
| bool | operator> (const Quaternionx< Type > &other) const |
| Greater operator. More... | |
| bool | operator>= (const Quaternionx< Type > &other) const |
| Greater equal operator. More... | |
| Quaternionx< Type > & | rotate (Type angle, const Vec3f &axis) |
| Quaternionx< Type > & | rotate (Type euler_x, Type euler_y, Type euler_z, EulerOrder order) |
| Vec3< Type > | rotate_vector (const Vec3< Type > &v) const |
| Rotates vector by this quaternion. More... | |
| Vec4< Type > | rotate_vector (const Vec4< Type > &v) const |
| Mat4< Type > | to_matrix () const |
| Convert the quaternion to a rotation matrix. More... | |
| Vec4< Type > | to_vec4 () const |
| Return quaternion as a vector. More... | |
Static Public Member Functions | |
| static Quaternionx< Type > | axis_angle (Type angle, const Vec3f &axis) |
| static Quaternionx< Type > | euler (Type x, Type y, Type z, EulerOrder order=EulerOrder::yxz) |
| static Quaternionx< Type > | euler (const Vec3< Type > &xyz, EulerOrder order=EulerOrder::yxz) |
| static Quaternionx< Type > | inverse (Quaternionx< Type > q) |
| Inverse this quaternion. More... | |
| static Quaternionx< Type > | lerp (const Quaternionx< Type > &quaternion_initial, const Quaternionx< Type > &quaternion_final, Type lerp_time) |
| Linear Quaternion Interpolation. More... | |
| static Quaternionx< Type > | multiply (const Quaternionx< Type > &quaternion_1, const Quaternionx< Type > &quaternion_2) |
| static Quaternionx< Type > | normalize (Quaternionx< Type > q) |
| Normalizes this quaternion. More... | |
| static Quaternionx< Type > | rotation_between (Vec3< Type > v0, Vec3< Type > v1) |
| Calculates the shortest arc quaternion between two vectors. More... | |
| static Quaternionx< Type > | rotation_between (Vec4< Type > v0, Vec4< Type > v1) |
| Calculates the shortest arc quaternion between two vectors. More... | |
| static Quaternionx< Type > | slerp (const Quaternionx< Type > &quaternion_initial, const Quaternionx< Type > &quaternion_final, Type slerp_time) |
| Spherical Quaternion Interpolation. More... | |
Public Attributes | |
| Type | w = Type(1) |
| The real scalar part. More... | |
| Type | x = Type(0) |
| The imaginary vector part. More... | |
| Type | y = Type(0) |
| Type | z = Type(0) |
Quaternion.
These quaternion templates are defined for: float (Quaternionf), double (Quaterniond)
|
inline |
Constructs a quaternion.
|
inline |
|
inline |
|
inline |
|
explicit |
|
static |
|
static |
|
static |
| Quaternionx<Type>& uicore::Quaternionx< Type >::inverse | ( | ) |
Inverse this quaternion.
This is the same as the conjugate of a quaternion
|
inlinestatic |
Inverse this quaternion.
This is the same as the conjugate of a quaternion
|
static |
Linear Quaternion Interpolation.
| quaternion_initial | = Source quaternion |
| quaternion_final | = Destination quaternion |
| lerp_time | = Time in the range of 0.0 to 1.0 |
| Type uicore::Quaternionx< Type >::magnitude | ( | ) | const |
Get the quaternion magnitude.
|
static |
Referenced by uicore::Quaternionx< Type >::operator*().
| Quaternionx<Type>& uicore::Quaternionx< Type >::normalize | ( | ) |
Normalizes this quaternion.
|
inlinestatic |
Normalizes this quaternion.
|
inline |
References uicore::Quaternionx< Type >::to_vec4().
|
inline |
Not equal operator.
|
inline |
Multiplication operator.
References uicore::Quaternionx< Type >::multiply().
| Quaternionx<Type> uicore::Quaternionx< Type >::operator* | ( | const Mat4< Type > & | matrix | ) | const |
|
inline |
References uicore::Quaternionx< Type >::rotate_vector().
|
inline |
References uicore::Quaternionx< Type >::rotate_vector().
|
inline |
Less operator.
|
inline |
Less equal operator.
|
inline |
Equal operator.
|
inline |
Greater operator.
|
inline |
Greater equal operator.
| Quaternionx<Type>& uicore::Quaternionx< Type >::rotate | ( | Type | angle, |
| const Vec3f & | axis | ||
| ) |
| Quaternionx<Type>& uicore::Quaternionx< Type >::rotate | ( | Type | euler_x, |
| Type | euler_y, | ||
| Type | euler_z, | ||
| EulerOrder | order | ||
| ) |
| Vec3<Type> uicore::Quaternionx< Type >::rotate_vector | ( | const Vec3< Type > & | v | ) | const |
Rotates vector by this quaternion.
| v | = Vertex to rotate |
Referenced by uicore::Quaternionx< Type >::operator*().
| Vec4<Type> uicore::Quaternionx< Type >::rotate_vector | ( | const Vec4< Type > & | v | ) | const |
|
static |
Calculates the shortest arc quaternion between two vectors.
|
static |
Calculates the shortest arc quaternion between two vectors.
|
static |
Spherical Quaternion Interpolation.
| quaternion_initial | = Source quaternion |
| quaternion_final | = Destination quaternion |
| slerp_time | = Time in the range of 0.0 to 1.0 |
| Mat4<Type> uicore::Quaternionx< Type >::to_matrix | ( | ) | const |
Convert the quaternion to a rotation matrix.
This function assumes that the quarternion is normalized.
|
inline |
Return quaternion as a vector.
References uicore::Quaternionx< Type >::w, uicore::Quaternionx< Type >::x, uicore::Quaternionx< Type >::y, and uicore::Quaternionx< Type >::z.
Referenced by uicore::Quaternionx< Type >::operator Vec4< Type >().
| Type uicore::Quaternionx< Type >::w = Type(1) |
The real scalar part.
Referenced by uicore::Quaternionx< Type >::to_vec4().
| Type uicore::Quaternionx< Type >::x = Type(0) |
The imaginary vector part.
Referenced by uicore::Quaternionx< Type >::to_vec4().
| Type uicore::Quaternionx< Type >::y = Type(0) |
Referenced by uicore::Quaternionx< Type >::to_vec4().
| Type uicore::Quaternionx< Type >::z = Type(0) |
Referenced by uicore::Quaternionx< Type >::to_vec4().