Quaternion. More...
#include <quaternion.h>
Public Member Functions | |
CL_Quaternionx () | |
CL_Quaternionx (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order) | |
CL_Quaternionx (const CL_Vec3< Type > &euler, CL_AngleUnit unit, CL_EulerOrder order) | |
CL_Quaternionx (Type euler_x, Type euler_y, Type euler_z, CL_AngleUnit unit, CL_EulerOrder order) | |
CL_Quaternionx (const CL_Quaternionx< Type > ©) | |
CL_Quaternionx (Type real, const CL_Vec3< Type > &imag) | |
CL_Quaternionx (Type real, Type i, Type j, Type k) | |
Attributes | |
CL_Mat4< Type > | to_matrix () const |
Convert the quaternion to a rotation matrix. | |
Type | magnitude () const |
Get the quaternion magnitude. | |
Operations | |
void | set (Type euler_x, Type euler_y, Type euler_z, CL_AngleUnit unit, CL_EulerOrder order) |
void | set (const CL_Vec3< Type > &euler, CL_AngleUnit unit, CL_EulerOrder order) |
void | set (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order) |
CL_Quaternionx< Type > & | multiply (const CL_Mat4< Type > &matrix) |
Multiply this quaternion by a specified matrix. | |
CL_Quaternionx< Type > & | multiply (const CL_Quaternionx< Type > &quaternion) |
Multiply this quaternion by another quaternion. | |
CL_Quaternionx< Type > & | rotate (const CL_Angle &angle, const CL_Vec3f &axis) |
CL_Quaternionx< Type > & | rotate (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order) |
CL_Quaternionx< Type > & | normalize () |
Normalizes this quaternion. | |
CL_Quaternionx< Type > & | inverse () |
Inverse this quaternion. | |
CL_Vec3< Type > | rotate_vector (const CL_Vec3< Type > &v) |
Rotates vector by this quaternion. | |
CL_Vec4< Type > | rotate_vector (const CL_Vec4< Type > &v) |
Operators | |
CL_Quaternionx< Type > | operator* (const CL_Quaternionx< Type > &mult) const |
Multiplication operator. | |
Static Public Member Functions | |
static CL_Quaternionx< Type > | axis_angle (const CL_Angle &angle, const CL_Vec3f &axis) |
static CL_Quaternionx< Type > | lerp (const CL_Quaternionx< Type > &quaternion_initial, const CL_Quaternionx< Type > &quaternion_final, Type lerp_time) |
Linear Quaternion Interpolation. | |
static CL_Quaternionx< Type > | multiply (const CL_Quaternionx< Type > &quaternion_1, const CL_Quaternionx< Type > &quaternion_2) |
static CL_Quaternionx< Type > | slerp (const CL_Quaternionx< Type > &quaternion_initial, const CL_Quaternionx< Type > &quaternion_final, Type slerp_time) |
Spherical Quaternion Interpolation. | |
Public Attributes | |
union { | |
Type i | |
Type x | |
}; | |
The imaginary vector part. | |
union { | |
Type j | |
Type y | |
}; | |
union { | |
Type k | |
Type z | |
}; | |
Type | w |
The real scalar part. |
Quaternion.
These quaternion templates are defined for: float (CL_Quaternionf), double (CL_Quaterniond)
CL_Quaternionx< Type >::CL_Quaternionx | ( | ) | [inline] |
CL_Quaternionx< Type >::CL_Quaternionx | ( | Type | real, | |
Type | i, | |||
Type | j, | |||
Type | k | |||
) | [inline] |
CL_Quaternionx< Type >::CL_Quaternionx | ( | Type | real, | |
const CL_Vec3< Type > & | imag | |||
) | [inline] |
CL_Quaternionx< Type >::CL_Quaternionx | ( | const CL_Quaternionx< Type > & | copy | ) | [inline] |
CL_Quaternionx< Type >::CL_Quaternionx | ( | Type | euler_x, | |
Type | euler_y, | |||
Type | euler_z, | |||
CL_AngleUnit | unit, | |||
CL_EulerOrder | order | |||
) |
CL_Quaternionx< Type >::CL_Quaternionx | ( | const CL_Vec3< Type > & | euler, | |
CL_AngleUnit | unit, | |||
CL_EulerOrder | order | |||
) |
CL_Quaternionx< Type >::CL_Quaternionx | ( | const CL_Angle & | euler_x, | |
const CL_Angle & | euler_y, | |||
const CL_Angle & | euler_z, | |||
CL_EulerOrder | order | |||
) |
static CL_Quaternionx<Type> CL_Quaternionx< Type >::axis_angle | ( | const CL_Angle & | angle, | |
const CL_Vec3f & | axis | |||
) | [static] |
CL_Quaternionx<Type>& CL_Quaternionx< Type >::inverse | ( | ) |
Inverse this quaternion.
This is the same as the conjugate of a quaternion
static CL_Quaternionx<Type> CL_Quaternionx< Type >::lerp | ( | const CL_Quaternionx< Type > & | quaternion_initial, | |
const CL_Quaternionx< Type > & | quaternion_final, | |||
Type | lerp_time | |||
) | [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 CL_Quaternionx< Type >::magnitude | ( | ) | const |
Get the quaternion magnitude.
static CL_Quaternionx<Type> CL_Quaternionx< Type >::multiply | ( | const CL_Quaternionx< Type > & | quaternion_1, | |
const CL_Quaternionx< Type > & | quaternion_2 | |||
) | [static] |
Referenced by CL_Quaternionx< float >::operator*().
CL_Quaternionx<Type>& CL_Quaternionx< Type >::multiply | ( | const CL_Mat4< Type > & | matrix | ) |
Multiply this quaternion by a specified matrix.
matrix | = Matrix to multiply |
CL_Quaternionx<Type>& CL_Quaternionx< Type >::multiply | ( | const CL_Quaternionx< Type > & | quaternion | ) |
Multiply this quaternion by another quaternion.
This multiplies the quaternion as follows: this = quaternion * this
quaternion | = Quaternion to multiply |
CL_Quaternionx<Type>& CL_Quaternionx< Type >::normalize | ( | ) |
Normalizes this quaternion.
CL_Quaternionx<Type> CL_Quaternionx< Type >::operator* | ( | const CL_Quaternionx< Type > & | mult | ) | const [inline] |
Multiplication operator.
CL_Quaternionx<Type>& CL_Quaternionx< Type >::rotate | ( | const CL_Angle & | euler_x, | |
const CL_Angle & | euler_y, | |||
const CL_Angle & | euler_z, | |||
CL_EulerOrder | order | |||
) |
CL_Quaternionx<Type>& CL_Quaternionx< Type >::rotate | ( | const CL_Angle & | angle, | |
const CL_Vec3f & | axis | |||
) |
CL_Vec4<Type> CL_Quaternionx< Type >::rotate_vector | ( | const CL_Vec4< Type > & | v | ) |
CL_Vec3<Type> CL_Quaternionx< Type >::rotate_vector | ( | const CL_Vec3< Type > & | v | ) |
Rotates vector by this quaternion.
v | = Vertex to rotate |
void CL_Quaternionx< Type >::set | ( | Type | euler_x, | |
Type | euler_y, | |||
Type | euler_z, | |||
CL_AngleUnit | unit, | |||
CL_EulerOrder | order | |||
) |
void CL_Quaternionx< Type >::set | ( | const CL_Angle & | euler_x, | |
const CL_Angle & | euler_y, | |||
const CL_Angle & | euler_z, | |||
CL_EulerOrder | order | |||
) |
void CL_Quaternionx< Type >::set | ( | const CL_Vec3< Type > & | euler, | |
CL_AngleUnit | unit, | |||
CL_EulerOrder | order | |||
) |
static CL_Quaternionx<Type> CL_Quaternionx< Type >::slerp | ( | const CL_Quaternionx< Type > & | quaternion_initial, | |
const CL_Quaternionx< Type > & | quaternion_final, | |||
Type | slerp_time | |||
) | [static] |
Spherical Quaternion Interpolation.
quaternion_initial | = Source quaternion | |
quaternion_final | = Destination quaternion | |
slerp_time | = Time in the range of 0.0 to 1.0 |
CL_Mat4<Type> CL_Quaternionx< Type >::to_matrix | ( | ) | const |
Convert the quaternion to a rotation matrix.
This function assumes that the quarternion is normalized.
union { ... } |
The imaginary vector part.
union { ... } |
union { ... } |
Type CL_Quaternionx< Type >::i |
Type CL_Quaternionx< Type >::j |
Type CL_Quaternionx< Type >::k |
Type CL_Quaternionx< Type >::w |
The real scalar part.
Type CL_Quaternionx< Type >::x |
Type CL_Quaternionx< Type >::y |
Type CL_Quaternionx< Type >::z |