i6engine
1.0
|
Class describing a 3d rotation. More...
#include <D:/Projekte/i6engine/libs/i6engine-math/include/i6engine/math/i6eQuaternion.h>
Public Member Functions | |
i6eQuaternion () | |
Creates a new vector with all values set to 0. More... | |
i6eQuaternion (const double w, const double x, const double y, const double z) | |
Creates a new vector with given values. Be careful with the ordering. i6eQuaternion expects W first, Bullet-Quaternion expects W last. More... | |
i6eQuaternion (const i6eVector &axis, const double angle) | |
Constructor for easy rotations. More... | |
i6eQuaternion (const Ogre::Quaternion &ogre) | |
Copy constructor with vector from Ogre. More... | |
i6eQuaternion (const btQuaternion &bullet) | |
Copy constructor with vector from Bullet. More... | |
i6eQuaternion (const std::map< std::string, std::string > ¶ms, const std::string &prefix) | |
i6eQuaternion (const std::string &str) | |
~i6eQuaternion () | |
Empty. More... | |
double | getW () const |
getters for the values of the quaternion More... | |
double | getX () const |
double | getY () const |
double | getZ () const |
void | setW (const double w) |
setters for the values of the quaternion More... | |
void | setX (const double x) |
void | setY (const double y) |
void | setZ (const double z) |
i6eQuaternion | operator+ (const i6eQuaternion &b) const |
Operator '+' for Quaternions. More... | |
i6eQuaternion | operator- (const i6eQuaternion &b) const |
Operator '-' for Quaternions. More... | |
i6eQuaternion | operator* (const i6eQuaternion &q) const |
Operator '*' for Quaternions. More... | |
i6eQuaternion | operator* (const double &v) const |
multiplies a quaternion with a scalar More... | |
i6eQuaternion | operator/ (const double &v) const |
divides a quaternion by a scalar More... | |
i6eQuaternion | operator+= (const i6eQuaternion &b) |
Operator '+=' for Quaternions. More... | |
void | insertInMap (const std::string &prefix, std::map< std::string, std::string > &map) const |
inserts this quaternion into an attributeMap using the given prefix More... | |
i6eQuaternion | inverse () const |
return the inverted vector of the quaternion More... | |
double | length () const |
return the length of the quaternion More... | |
i6eQuaternion | normalize () const |
normalieses Quaternion to length 1 More... | |
bool | equals (const i6eQuaternion &q, double eps=i6eQuaternion::EPSILON) const |
compares this and q More... | |
void | toAxisAngle (i6eVector &axis, double &angle) const |
converts the quaternion to an angle / axis representation More... | |
bool | operator== (const i6eQuaternion &b) const |
Operator '==' for Quaternions. More... | |
bool | operator!= (const i6eQuaternion &b) const |
Operator '!=' for Quaternions. More... | |
i6eVector | toVector () const |
creates a 3D vector containing x, y and z More... | |
Ogre::Quaternion | toOgre () const |
Convert whole vector to Ogre. More... | |
btQuaternion | toBullet () const |
Convert whole vector to Bullet. More... | |
std::string | toString () const |
generates a string containing a readable version of the quaternion More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
serialize method for quaternion; More... | |
Static Public Attributes | |
static const i6eQuaternion | IDENTITY |
Class describing a 3d rotation.
Descibes a 3d rotation with 4-dimensional vectors. Conversion of vectors from Ogre and Bullet possible. Implementation identical to i6eVector4.
Bullet stores X first, Ogre stores W first... not binary compatible.
Definition at line 58 of file i6eQuaternion.h.
|
inline |
Creates a new vector with all values set to 0.
Definition at line 67 of file i6eQuaternion.h.
|
inline |
Creates a new vector with given values. Be careful with the ordering. i6eQuaternion expects W first, Bullet-Quaternion expects W last.
Definition at line 74 of file i6eQuaternion.h.
i6e::math::i6eQuaternion::i6eQuaternion | ( | const i6eVector & | axis, |
const double | angle | ||
) |
Constructor for easy rotations.
[in] | axis | the axis around which the Object should be rotated |
[in] | angle | angle by which the object should be rotated using in radians |
|
explicit |
Copy constructor with vector from Ogre.
[in] | ogre | Vector to copy |
|
explicit |
Copy constructor with vector from Bullet.
[in] | bullet | Vector to copy |
i6e::math::i6eQuaternion::i6eQuaternion | ( | const std::map< std::string, std::string > & | params, |
const std::string & | prefix | ||
) |
|
explicit |
|
inline |
bool i6e::math::i6eQuaternion::equals | ( | const i6eQuaternion & | q, |
double | eps = i6eQuaternion::EPSILON |
||
) | const |
compares this and q
[in] | q | Quaternion to compare with |
|
inline |
getters for the values of the quaternion
Definition at line 122 of file i6eQuaternion.h.
|
inline |
Definition at line 123 of file i6eQuaternion.h.
|
inline |
Definition at line 124 of file i6eQuaternion.h.
|
inline |
Definition at line 125 of file i6eQuaternion.h.
void i6e::math::i6eQuaternion::insertInMap | ( | const std::string & | prefix, |
std::map< std::string, std::string > & | map | ||
) | const |
inserts this quaternion into an attributeMap using the given prefix
|
inline |
return the inverted vector of the quaternion
Definition at line 193 of file i6eQuaternion.h.
double i6e::math::i6eQuaternion::length | ( | ) | const |
return the length of the quaternion
i6eQuaternion i6e::math::i6eQuaternion::normalize | ( | ) | const |
normalieses Quaternion to length 1
|
inline |
Operator '!=' for Quaternions.
Definition at line 229 of file i6eQuaternion.h.
|
inline |
Operator '*' for Quaternions.
Definition at line 152 of file i6eQuaternion.h.
|
inline |
multiplies a quaternion with a scalar
Definition at line 163 of file i6eQuaternion.h.
|
inline |
Operator '+' for Quaternions.
Definition at line 138 of file i6eQuaternion.h.
|
inline |
Operator '+=' for Quaternions.
Definition at line 177 of file i6eQuaternion.h.
|
inline |
Operator '-' for Quaternions.
Definition at line 145 of file i6eQuaternion.h.
|
inline |
divides a quaternion by a scalar
Definition at line 170 of file i6eQuaternion.h.
bool i6e::math::i6eQuaternion::operator== | ( | const i6eQuaternion & | b | ) | const |
Operator '==' for Quaternions.
|
inline |
serialize method for quaternion;
Definition at line 262 of file i6eQuaternion.h.
|
inline |
setters for the values of the quaternion
Definition at line 130 of file i6eQuaternion.h.
|
inline |
Definition at line 131 of file i6eQuaternion.h.
|
inline |
Definition at line 132 of file i6eQuaternion.h.
|
inline |
Definition at line 133 of file i6eQuaternion.h.
void i6e::math::i6eQuaternion::toAxisAngle | ( | i6eVector & | axis, |
double & | angle | ||
) | const |
converts the quaternion to an angle / axis representation
[out] | angle | rotation by this angle |
[out] | axis | around this axis |
btQuaternion i6e::math::i6eQuaternion::toBullet | ( | ) | const |
Convert whole vector to Bullet.
Ogre::Quaternion i6e::math::i6eQuaternion::toOgre | ( | ) | const |
Convert whole vector to Ogre.
std::string i6e::math::i6eQuaternion::toString | ( | ) | const |
generates a string containing a readable version of the quaternion
i6eVector i6e::math::i6eQuaternion::toVector | ( | ) | const |
creates a 3D vector containing x, y and z
|
static |
Definition at line 62 of file i6eQuaternion.h.