MercuryDPM
Alpha
|
#include <Quarternion.h>
Public Member Functions | |
Quarternion () | |
Constructs a basic Quarternion. More... | |
Quarternion (const Quarternion &other) | |
Copy constructor. More... | |
Quarternion (double x, double y, double z, double w) | |
Constructs a a Quarternion using its four components. More... | |
Quarternion (Vec3D axis, double angle) | |
Constructs a Quarternion using a rotation around an axis. More... | |
void | getAxisAndAngle (Vec3D &axis, double &angle) const |
Returns the orientation as represented by a rotation around an axis. More... | |
Matrix3D | getRotationMatrix () const |
void | reset () |
Resets a the Quarternion. More... | |
void | normalise () |
Normalises the Quarternion. More... | |
Quarternion | operator* (const Quarternion &other) const |
Multiplication operator. More... | |
void | integrate (const Vec3D &omega, double timeStep) |
Integration of the Quarternion using rotational velocity and timestep. More... | |
Quarternion (const Vec3D &a) | |
Constructs a Quaternion using the lab x-y-z sequence, where the object is. More... | |
Vec3D | get3DAngles () const |
Constructs a representation of the quarternion using 3 rotations in the lab x-y-z sequence, where the object is first rotated along lab X-axis then rotated along lab Y-axis then rotated along lab Z-axis. More... | |
Private Attributes | |
Mdouble | w_ |
Mdouble | x_ |
Mdouble | y_ |
Mdouble | z_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Quarternion &q) |
std::istream & | operator>> (std::istream &is, Quarternion &q) |
Definition at line 36 of file Quarternion.h.
Quarternion::Quarternion | ( | ) |
Quarternion::Quarternion | ( | const Quarternion & | other | ) |
Quarternion::Quarternion | ( | double | x, |
double | y, | ||
double | z, | ||
double | w | ||
) |
Constructs a a Quarternion using its four components.
Definition at line 45 of file Quarternion.cc.
References w_, x_, y_, and z_.
Quarternion::Quarternion | ( | Vec3D | axis, |
double | angle | ||
) |
Constructs a Quarternion using a rotation around an axis.
Definition at line 53 of file Quarternion.cc.
References mathsFunc::cos(), Vec3D::normalize(), mathsFunc::sin(), w_, Vec3D::X, x_, Vec3D::Y, y_, Vec3D::Z, and z_.
Quarternion::Quarternion | ( | const Vec3D & | a | ) |
Constructs a Quaternion using the lab x-y-z sequence, where the object is.
first rotated along lab X-axis then rotated along lab Y-axis then rotated along lab Z-axis
Definition at line 63 of file Quarternion.cc.
References mathsFunc::cos(), mathsFunc::sin(), w_, Vec3D::X, x_, Vec3D::Y, y_, Vec3D::Z, and z_.
Vec3D Quarternion::get3DAngles | ( | ) | const |
Constructs a representation of the quarternion using 3 rotations in the lab x-y-z sequence, where the object is first rotated along lab X-axis then rotated along lab Y-axis then rotated along lab Z-axis.
Definition at line 143 of file Quarternion.cc.
References constants::pi, w_, x_, y_, and z_.
void Quarternion::getAxisAndAngle | ( | Vec3D & | axis, |
double & | angle | ||
) | const |
Matrix3D Quarternion::getRotationMatrix | ( | ) | const |
void Quarternion::integrate | ( | const Vec3D & | omega, |
double | timeStep | ||
) |
Integration of the Quarternion using rotational velocity and timestep.
Definition at line 118 of file Quarternion.cc.
References mathsFunc::cos(), Vec3D::getLengthSquared(), mathsFunc::sin(), w_, Vec3D::X, x_, Vec3D::Y, y_, Vec3D::Z, and z_.
void Quarternion::normalise | ( | ) |
Normalises the Quarternion.
Definition at line 99 of file Quarternion.cc.
References w_, x_, y_, and z_.
Quarternion Quarternion::operator* | ( | const Quarternion & | other | ) | const |
Multiplication operator.
Definition at line 108 of file Quarternion.cc.
References w_, x_, y_, and z_.
void Quarternion::reset | ( | ) |
Resets a the Quarternion.
Definition at line 91 of file Quarternion.cc.
References w_, x_, y_, and z_.
Referenced by Quarternion().
|
friend |
Definition at line 173 of file Quarternion.cc.
|
friend |
Definition at line 179 of file Quarternion.cc.
|
private |
Definition at line 114 of file Quarternion.h.
Referenced by get3DAngles(), getAxisAndAngle(), getRotationMatrix(), integrate(), normalise(), operator*(), operator<<(), operator>>(), Quarternion(), and reset().
|
private |
Definition at line 114 of file Quarternion.h.
Referenced by get3DAngles(), getAxisAndAngle(), getRotationMatrix(), integrate(), normalise(), operator*(), operator<<(), operator>>(), Quarternion(), and reset().
|
private |
Definition at line 114 of file Quarternion.h.
Referenced by get3DAngles(), getAxisAndAngle(), getRotationMatrix(), integrate(), normalise(), operator*(), operator<<(), operator>>(), Quarternion(), and reset().
|
private |
Definition at line 114 of file Quarternion.h.
Referenced by get3DAngles(), getAxisAndAngle(), getRotationMatrix(), integrate(), normalise(), operator*(), operator<<(), operator>>(), Quarternion(), and reset().