![]() |
SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
Quaternion class for angle-axis rotation representation. More...
#include <SLQuat4.h>
Public Member Functions | |
SLQuat4 () | |
SLQuat4 (T x, T y, T z, T w) | |
SLQuat4 (const SLMat3< T > &m) | |
SLQuat4 (T angleDEG, const SLVec3< T > &axis) | |
SLQuat4 (const SLVec3< T > &v0, const SLVec3< T > &v1) | |
SLQuat4 (const T xRotRAD, const T yRotRAD, const T zRotRAD) | |
T | x () const |
T | y () const |
T | z () const |
T | w () const |
void | set (T x, T y, T z, T w) |
void | fromMat3 (const SLMat3< T > &m) |
void | fromAngleAxis (T angleRAD, T axisX, T axisY, T axisZ) |
void | fromEulerAngles (const T xRotRAD, const T yRotRAD, const T zRotRAD) |
void | fromVec3 (const SLVec3< T > &v0, const SLVec3< T > &v1) |
SLMat3< T > | toMat3 () const |
SLMat4< T > | toMat4 () const |
SLVec4< T > | toVec4 () const |
void | toAngleAxis (T &angleDEG, SLVec3< T > &axis) const |
void | toEulerAnglesXYZ (T &xRotRAD, T &yRotRAD, T &zRotRAD) const |
void | toEulerAnglesZYX (T &zRotRAD, T &yRotRAD, T &xRotRAD) const |
void | toEulerAnglesZXY (T &zRotRAD, T &xRotRAD, T &yRotRAD) const |
T | dot (const SLQuat4< T > &q) const |
T | length () const |
SLQuat4< T > | normalized () const |
T | normalize () |
SLQuat4< T > | inverted () const |
void | invert () |
SLQuat4< T > | conjugated () const |
void | conjugate () |
SLQuat4< T > | rotated (const SLQuat4< T > &b) const |
void | rotate (const SLQuat4< T > &q) |
SLVec3< T > | rotate (const SLVec3< T > &vec) const |
SLQuat4< T > | scaled (T scale) const |
void | scale (T scale) |
SLQuat4< T > | lerp (const SLQuat4< T > &q2, T t) const |
Linear interpolation. More... | |
void | lerp (const SLQuat4< T > &q1, const SLQuat4< T > &q2, T t) |
Linear interpolation. More... | |
SLQuat4< T > | slerp (const SLQuat4< T > &q2, T t) const |
void | slerp (const SLQuat4< T > &q1, const SLQuat4< T > &q2, T t) |
Spherical linear interpolation. More... | |
SLQuat4< T > & | operator= (SLQuat4< T > q) |
SLQuat4< T > | operator- (const SLQuat4< T > &q) const |
SLQuat4< T > | operator+ (const SLQuat4< T > &q) const |
SLQuat4< T > | operator* (const SLQuat4< T > &q) const |
SLQuat4< T > | operator* (T s) const |
SLVec3< T > | operator* (const SLVec3< T > &v) const |
SLbool | operator== (const SLQuat4< T > &q) const |
SLbool | operator!= (const SLQuat4< T > &q) const |
SLQuat4< T > & | operator*= (const SLQuat4< T > &q2) |
SLQuat4< T > & | operator*= (T s) |
Static Public Member Functions | |
static SLQuat4< T > | fromLookRotation (const SLVec3< T > &forward, const SLVec3< T > &up) |
Static Public Attributes | |
static SLQuat4 | IDENTITY = SLQuat4<T>(0.0f, 0.0f, 0.0f, 1.0f) |
Private Attributes | |
T | _x |
T | _y |
T | _z |
T | _w |
Quaternion class for angle-axis rotation representation.
Quaternion class for angle-axis rotation representation. For rotations quaternions must have unit length. See http://en.wikipedia.org/wiki/Quaternion Quaternions can be interpolated at low cost with the method lerp or slerp.
Definition at line 119 of file SLQuat4.h.
Definition at line 126 of file SLQuat4.h.
|
inline |
Definition at line 133 of file SLQuat4.h.
void SLQuat4< T >::fromEulerAngles | ( | const T | xRotRAD, |
const T | yRotRAD, | ||
const T | zRotRAD | ||
) |
Sets the quaternion from 3 Euler angles in radians Source: Essential Mathematics for Games and Interactive Applications A Programmer's Guide 2nd edition by James M. Van Verth and Lars M. Bishop
|
static |
Definition at line 190 of file SLQuat4.h.
|
inline |
|
inline |
|
inline |
void SLQuat4< T >::toEulerAnglesXYZ | ( | T & | xRotRAD, |
T & | yRotRAD, | ||
T & | zRotRAD | ||
) | const |
void SLQuat4< T >::toEulerAnglesZXY | ( | T & | zRotRAD, |
T & | xRotRAD, | ||
T & | yRotRAD | ||
) | const |
void SLQuat4< T >::toEulerAnglesZYX | ( | T & | zRotRAD, |
T & | yRotRAD, | ||
T & | xRotRAD | ||
) | const |
|
inline |
|
inline |
|
inline |
|
inline |