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