|
| GMathQuaternion (void) |
| Default constructor. Creates an identity quaternion.
|
|
IX_TMPLT | GMathQuaternion (const U &s, const GMathVec3< U > &v) |
| Construct from a real and imaginary parts.
|
|
IX_TMPLT | GMathQuaternion (const GMathQuaternion< U > &q) |
| Copy constructor.
|
|
T & | operator[] (unsigned int index) |
|
const T & | operator[] (unsigned int index) const |
|
GMathQuaternion & | operator= (const GMathQuaternion &q)=default |
|
GMathQuaternion | operator* (const GMathQuaternion &q) const |
|
GMathQuaternion | operator+ (const GMathQuaternion &q) const |
|
GMathQuaternion | operator- (const GMathQuaternion &q) const |
|
GMathQuaternion | operator- () const |
|
GMathQuaternion | operator* (const double &d) const |
|
GMathQuaternion & | operator*= (const double &d) |
|
GMathQuaternion & | operator/= (const double &d) |
|
bool | is_equal_to (const GMathQuaternion &q, const double &epsilon=gmath_epsilon) const |
| Check equality with another quaternion q within an epsilon .
|
|
bool | operator== (const GMathQuaternion &q) const |
| Equality operator.
|
|
bool | operator!= (const GMathQuaternion &q) const |
| Inequality operator.
|
|
double | get_w (void) const |
|
GMathVec3d | get_xyz (void) const |
|
double | get_sqr_norm (void) const |
|
double | get_length (void) const |
|
IX_TMPLT GMathQuaternion & | set_rotation (const U &m) |
|
GMathQuaternion & | set_rotation (const double &angle, const GMathVec3d &axis) |
| Set the quaternion from an angle/axis rotation.
|
|
GMathQuaternion & | set_rotation (const GMathVec3d &a, const GMathVec3d &b) |
|
void | get_rotation (double &angle, GMathVec3d &axis) const |
| Extract the rotation as an angle/axis rotation.
|
|
IX_TMPLT void | get_rotation (GMathMatrix3x3< U > &m) const |
| Computes the rotation matrix represented by a unit quaternion.
|
|
IX_TMPLT void | get_rotation (GMathMatrix4x4< U > &m) const |
| Computes the rotation matrix represented by a unit quaternion.
|
|
void | conjugate (void) |
|
GMathQuaternion | conjugated (void) const |
|
void | invert (void) |
| Computes the inverse of this quaternion.
|
|
GMathQuaternion | inverse (void) const |
|
void | normalize (void) |
|
GMathQuaternion | normalized (void) const |
|
double | dot (const GMathQuaternion &q) const |
|
void | rotate (GMathVec3d &v) |
| Rotates the vector by this quaternion.
|
|
void | swing_twist_decomposition (const GMathVec3d &direction, GMathQuaternion &swing, GMathQuaternion &twist) |
| Decompose the rotation on to 2 parts. The rotation can be composed back as q = twist * swing.
|
|
void | slerp (const GMathQuaternion &q0, const GMathQuaternion &q1, const double &t) |
|
void | slerp (const GMathQuaternion &q, const double &t) |
|
const CoreClassInfo & | get_class_info (void) const |
|
bool | is_kindof (const CoreClassInfo &cinfo) const |
|
template<typename T>
class GMathQuaternion< T >
Quaternion rotation class. Use the specialized classes GMathQuath, GMathQuatf and GMathQuatd.
- Template Parameters
-
T | The underlying data type. |