ClanLib
2.3.7
|
Quaternion. More...
#include <quaternion.h>
Public Member Functions | |
CL_Quaternionx () | |
CL_Quaternionx (Type real, Type i, Type j, Type k) | |
CL_Quaternionx (Type real, const CL_Vec3< Type > &imag) | |
CL_Quaternionx (const CL_Quaternionx< Type > ©) | |
CL_Quaternionx (Type euler_x, Type euler_y, Type euler_z, CL_AngleUnit unit, CL_EulerOrder order) | |
CL_Quaternionx (const CL_Vec3< Type > &euler, CL_AngleUnit unit, CL_EulerOrder order) | |
CL_Quaternionx (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order) | |
Attributes | |
CL_Mat4< Type > | to_matrix () const |
Convert the quaternion to a rotation matrix. More... | |
Type | magnitude () const |
Get the quaternion magnitude. More... | |
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. More... | |
CL_Quaternionx< Type > & | multiply (const CL_Quaternionx< Type > &quaternion) |
Multiply this quaternion by another quaternion. More... | |
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. More... | |
CL_Quaternionx< Type > & | inverse () |
Inverse this quaternion. More... | |
CL_Vec3< Type > | rotate_vector (const CL_Vec3< Type > &v) |
Rotates vector by this quaternion. More... | |
CL_Vec4< Type > | rotate_vector (const CL_Vec4< Type > &v) |
Operators | |
CL_Quaternionx< Type > | operator* (const CL_Quaternionx< Type > &mult) const |
Multiplication operator. More... | |
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. More... | |
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. More... | |
Public Attributes | |
union { | |
Type i | |
Type x | |
}; | |
The imaginary vector part. More... | |
union { | |
Type j | |
Type y | |
}; | |
union { | |
Type k | |
Type z | |
}; | |
Type | w |
The real scalar part. More... | |
Quaternion.
These quaternion templates are defined for: float (CL_Quaternionf), double (CL_Quaterniond)
|
inline |
|
inline |
|
inline |
|
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 >::inverse | ( | ) |
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 CL_Quaternionx< Type >::magnitude | ( | ) | const |
Get the quaternion magnitude.
|
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.
|
inline |
Multiplication operator.
CL_Quaternionx<Type>& CL_Quaternionx< Type >::rotate | ( | const CL_Angle & | angle, |
const CL_Vec3f & | axis | ||
) |
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_Vec3<Type> CL_Quaternionx< Type >::rotate_vector | ( | const CL_Vec3< Type > & | v) |
Rotates vector by this quaternion.
v | = Vertex to rotate |
CL_Vec4<Type> CL_Quaternionx< Type >::rotate_vector | ( | const CL_Vec4< Type > & | v) |
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_Vec3< Type > & | euler, |
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 | ||
) |
|
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 |