TDME2 1.9.121
|
Quaternion class. More...
#include <tdme/math/Quaternion.h>
Public Member Functions | |
Quaternion (const Quaternion &q) | |
Public constructor. More... | |
Quaternion (float x, float y, float z, float w) | |
Public constructor. More... | |
Quaternion (const Vector3 &v, float w) | |
Public constructor. More... | |
Quaternion & | set (float x, float y, float z, float w) |
Set up this quaternion by components. More... | |
Quaternion & | set (const Quaternion &q) |
Sets up this quaternion by quaternion q. More... | |
Quaternion & | set (const Vector3 &v, float w) |
Set quaternion. More... | |
float | getX () const |
Quaternion & | setX (float x) |
Set X. More... | |
float | getY () const |
Quaternion & | setY (float y) |
Set Y. More... | |
float | getZ () const |
Quaternion & | setZ (float z) |
Set Z. More... | |
float | getW () const |
Quaternion & | setW (float w) |
Set W. More... | |
Quaternion & | identity () |
Set up quaternion identity. More... | |
Quaternion & | invert () |
Inverts this quaternion. More... | |
Quaternion & | rotate (const Vector3 &axis, float angle) |
Creates a rotation quaternion. More... | |
Quaternion & | normalize () |
Normalize quaternion. More... | |
Quaternion & | multiply (const Quaternion q) |
Multiplies this quaternion with quaternion q. More... | |
Quaternion & | add (const Quaternion &q) |
Adds given quaternion q to this quaternion. More... | |
Quaternion & | sub (const Quaternion &q) |
Subtracts given quaternion q from this quaternion. More... | |
Quaternion & | scale (float value) |
Scales this quaternion with given value. More... | |
Vector3 | multiply (const Vector3 &v) const |
Multiplies a quaternion with given vector v. More... | |
Matrix4x4 | computeMatrix () const |
Computes a matrix from given. More... | |
array< float, 4 > & | getArray () const |
Returns array data. More... | |
float & | operator[] (int i) |
Array access operator. More... | |
const float & | operator[] (int i) const |
Const array access operator. More... | |
Quaternion | operator+ (const Quaternion &q) const |
Operator +. More... | |
Quaternion | operator- (const Quaternion &q) const |
Operator -. More... | |
Quaternion | operator* (const float f) const |
Operator * (float) More... | |
Quaternion | operator* (const Quaternion &q) const |
Operator * (Quaternion&) More... | |
Vector3 | operator* (const Vector3 &v) const |
Operattor * (Vector&) More... | |
Quaternion | operator/ (const float f) const |
Operator / (f) More... | |
Quaternion | operator/ (const Quaternion &q) const |
Operator / (Quaternion&) More... | |
Quaternion & | operator+= (const Quaternion &q) |
Operator +=. More... | |
Quaternion & | operator-= (Quaternion &q) |
Operator -=. More... | |
Quaternion & | operator*= (Quaternion &q) |
Operator *=. More... | |
Quaternion & | operator/= (Quaternion &q) |
Operator /=. More... | |
bool | operator== (const Quaternion &q) const |
Equality comparison operator. More... | |
bool | operator!= (const Quaternion &q) const |
Non equality comparison operator. More... | |
Quaternion | clone () const |
Clones the quaternion. More... | |
bool | equals (const Quaternion &q) const |
Compares this quaternion with given quaternion. More... | |
bool | equals (const Quaternion &q, float tolerance) const |
Compares this quaternion with given quaternion. More... | |
Quaternion () | |
Public constructor. More... | |
Private Attributes | |
array< float, 4 > | data |
Quaternion class.
Definition at line 21 of file Quaternion.h.
|
inline |
|
inline |
|
inline |
|
inline |
Public constructor.
Definition at line 509 of file Quaternion.h.
|
inline |
Adds given quaternion q to this quaternion.
q | quaterion q |
Definition at line 242 of file Quaternion.h.
|
inline |
|
inline |
|
inline |
Compares this quaternion with given quaternion.
q | quaternion q |
Definition at line 486 of file Quaternion.h.
|
inline |
Compares this quaternion with given quaternion.
q | quaternion q |
tolerance | tolerance per component(x, y, z) |
Definition at line 496 of file Quaternion.h.
|
inline |
|
inline |
Definition at line 153 of file Quaternion.h.
|
inline |
Definition at line 102 of file Quaternion.h.
|
inline |
Definition at line 119 of file Quaternion.h.
|
inline |
Definition at line 136 of file Quaternion.h.
|
inline |
|
inline |
|
inline |
Multiplies this quaternion with quaternion q.
q | quaterion q |
Definition at line 227 of file Quaternion.h.
Multiplies a quaternion with given vector v.
v | vector v |
Definition at line 281 of file Quaternion.h.
|
inline |
Normalize quaternion.
Definition at line 213 of file Quaternion.h.
|
inline |
Non equality comparison operator.
q | quaternion to compare to |
Definition at line 469 of file Quaternion.h.
|
inline |
Operator * (float)
f | value to multiply by |
Definition at line 371 of file Quaternion.h.
|
inline |
Operator * (Quaternion&)
q | quaternion to multiply by |
Definition at line 381 of file Quaternion.h.
Operattor * (Vector&)
v | vector to multiply by |
Definition at line 391 of file Quaternion.h.
|
inline |
Operator *=.
q | quaternion to multiply by |
Definition at line 439 of file Quaternion.h.
|
inline |
Operator +.
q | quaternion to add |
Definition at line 351 of file Quaternion.h.
|
inline |
Operator +=.
q | quaternion to add |
Definition at line 421 of file Quaternion.h.
|
inline |
Operator -.
q | quaternion to subtrct |
Definition at line 361 of file Quaternion.h.
|
inline |
Operator -=.
q | quaternion to substract |
Definition at line 430 of file Quaternion.h.
|
inline |
Operator / (f)
q | value to divide by |
Definition at line 400 of file Quaternion.h.
|
inline |
Operator / (Quaternion&)
q | quaternion to divide by |
Definition at line 410 of file Quaternion.h.
|
inline |
Operator /=.
q | quaternion to devide by |
Definition at line 448 of file Quaternion.h.
|
inline |
Equality comparison operator.
q | quaternion to compare to |
Definition at line 459 of file Quaternion.h.
|
inline |
Array access operator.
i | index |
Definition at line 333 of file Quaternion.h.
|
inline |
Const array access operator.
i | index |
Definition at line 342 of file Quaternion.h.
|
inline |
Creates a rotation quaternion.
axis | axis |
angle | angle |
Definition at line 196 of file Quaternion.h.
|
inline |
Scales this quaternion with given value.
value | value |
Definition at line 268 of file Quaternion.h.
|
inline |
Sets up this quaternion by quaternion q.
q | q |
Definition at line 81 of file Quaternion.h.
|
inline |
|
inline |
Set up this quaternion by components.
x | x |
y | y |
z | z |
w | w |
Definition at line 68 of file Quaternion.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Subtracts given quaternion q from this quaternion.
q | quaterion q |
Definition at line 255 of file Quaternion.h.
|
private |
Definition at line 25 of file Quaternion.h.