#include <quaternion.h>
Collaboration diagram for math::quaternion:
Public Methods | |
quaternion (void) | |
Default Constructor. More... | |
quaternion (const math::vector3 &v_, real_t w_) | |
Constructor to set x y z w. More... | |
quaternion (real_t x_, real_t y_, real_t z_, real_t w_) | |
Constructor to set a x y z w. More... | |
quaternion (const math::quaternion &p) | |
Copy Constructor. | |
math::quaternion & | operator= (const math::quaternion &p) |
Assignment Operator. | |
real_t | w (void) const |
Returns a copy of w. | |
real_t | x (void) const |
Returns a copy of x. | |
real_t | y (void) const |
Returns a copy of y. | |
real_t | z (void) const |
Returns a copy of z. | |
math::vector3 | v (void) const |
Returns a copy of x y z. More... | |
math::vector3 | vec (void) const |
Returns a copy of x y z. More... | |
real_t | scalar (void) const |
Returns a copy of w. More... | |
void | set (real_t x_, real_t y_, real_t z_, real_t w_) |
Sets the quaternion. More... | |
void | set (const math::vector3 &v_, real_t w_) |
Sets the quaternion. More... | |
math::quaternion | conjugate (void) const |
Returns the conjugate of the quaternion. More... | |
math::quaternion | operator! (void) const |
Returns the inverse of the quaternion. More... | |
double | magnitude (void) const |
Returns the magnitude of the quaternion. More... | |
void | normalize (void) |
Normalizes the quaternion. More... | |
void | set_identity (void) |
Sets the quaternion to the identity quaternion. More... | |
math::matrix4 | get_rotation_matrix (void) const |
Returns the rotation matrix that describes this quaternion. More... | |
void | get_rotation_matrix (math::matrix4 &m) const |
Sets a rotation matrix that describes this quaternion. More... | |
math::matrix4 | get_transposed_rotation_matrix (void) const |
Returns the transposed rotation matrix that describes this quaternion. More... | |
void | get_transposed_rotation_matrix (math::matrix4 &m) const |
Sets transposed rotation matrix that describes this quaternion. More... | |
math::quaternion | operator * (const math::quaternion &rhs) const |
Quaternion Multiplication. | |
math::vector3 | operator * (const math::vector3 &rhs) const |
Quaternion Vector Multiplication. More... | |
void | from_angle_axis (real_t radians, const math::vector3 &axis) |
Creates a rotation matrix given around an arbitrary axis. More... | |
void | get_angle_axis (real_t &radians, math::vector3 &axis) const |
Returns the angle and axis the quaternion describes. More... | |
Static Public Methods | |
math::quaternion | slerp (real_t percent, const math::quaternion &qa, const math::quaternion &qb) |
Spherical Linear Interpretation. More... | |
Static Public Attributes | |
const math::quaternion | IDENTITY |
The identity quaternion. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const math::quaternion &vec) |
stream output operator. More... |
Quaternions take on the form:
Definition at line 25 of file quaternion.h.
|
Default Constructor. Sets quaternion to . Definition at line 41 of file quaternion.h. |
|
Constructor to set x y z w.
Definition at line 49 of file quaternion.h. References real_t. |
|
Constructor to set a x y z w.
Definition at line 59 of file quaternion.h. References real_t. |
|
Returns the conjugate of the quaternion. The conjugate of the quaternion is defined as:
Definition at line 149 of file quaternion.h. |
|
Creates a rotation matrix given around an arbitrary axis. Given an axis and an angle, this method will create a set this quaternion as the quaternion that describes the rotation around the axis by angle.
Definition at line 142 of file quaternion.cpp. References math::vector3::length, and real_t. |
|
Returns the angle and axis the quaternion describes.
Definition at line 154 of file quaternion.cpp. References math::equals, magnitude, real_t, math::vector3::set, math::vector3::x, math::vector3::y, and math::vector3::z. |
|
Sets a rotation matrix that describes this quaternion.
Definition at line 15 of file quaternion.cpp. References real_t, math::matrix4::set, math::vector3::x, math::vector3::y, and math::vector3::z. |
|
Returns the rotation matrix that describes this quaternion.
Definition at line 56 of file quaternion.cpp. Referenced by operator *. |
|
Sets transposed rotation matrix that describes this quaternion.
Definition at line 65 of file quaternion.cpp. References real_t, math::matrix4::set, math::vector3::x, math::vector3::y, and math::vector3::z. |
|
Returns the transposed rotation matrix that describes this quaternion.
Definition at line 106 of file quaternion.cpp. |
|
Returns the magnitude of the quaternion. The magnitude of the quaternion is defined as:
Definition at line 169 of file quaternion.h. Referenced by get_angle_axis. |
|
Normalizes the quaternion. \warn If the quaternion has zero magnitude, a divide by zero may be possible. Definition at line 178 of file quaternion.h. References math::vector3::x, math::vector3::y, and math::vector3::z. |
|
Quaternion Vector Multiplication. Multiplies the matrix that this quaternion describes by the vector rhs. Definition at line 132 of file quaternion.cpp. References get_rotation_matrix. |
|
Returns the inverse of the quaternion. The inverse of a normalized quaternion is defined as:
Definition at line 159 of file quaternion.h. |
|
Returns a copy of w.
Definition at line 116 of file quaternion.h. References real_t. |
|
Sets the quaternion.
Definition at line 138 of file quaternion.h. References real_t. |
|
Sets the quaternion.
Definition at line 127 of file quaternion.h. References real_t, and math::vector3::set. |
|
Sets the quaternion to the identity quaternion. The identity quaternion is defined as:
Definition at line 192 of file quaternion.h. References math::vector3::set. |
|
Spherical Linear Interpretation. Interprets the between the two rotations that qa and qb describe.
Definition at line 180 of file quaternion.cpp. |
|
Returns a copy of x y z.
Definition at line 99 of file quaternion.h. Referenced by slerp. |
|
Returns a copy of x y z.
Definition at line 108 of file quaternion.h. |
|
Outputs quaternion as x y z w. Definition at line 207 of file quaternion.cpp. |
|
The identity quaternion. The identity quaternion is described as:
|