| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/quat.h>

Public Member Functions | |
| Quat () | |
| Quat (double x, double y, double z, double w) | |
| Quat (const Vector4d &v) | |
| Quat (double angle, const Vector &axis) | |
| Quat (double angle1, const Vector &axis1, double angle2, const Vector &axis2, double angle3, const Vector &axis3) | |
| bool | operator== (const Quat &v) const |
| bool | operator!= (const Quat &v) const |
| bool | operator< (const Quat &v) const |
| Vector | toVec3d () const |
| void | set (double x, double y, double z, double w) |
| void | set (const Matrix &matrix) |
| void | get (Matrix &matrix) const |
| void | set (const Vector &dir, const Vector &up) |
| void | get (Vector &dir, Vector &up) const |
| double & | x () |
| double & | y () |
| double & | z () |
| double & | w () |
| double | x () const |
| double | y () const |
| double | z () const |
| double | w () const |
| bool | zeroRotation () const |
| return true if the Quat represents a zero rotation, and therefore can be ignored in computations. | |
| const Quat | operator* (double rhs) const |
| Multiply by scalar. | |
| Quat & | operator*= (double rhs) |
| Unary multiply by scalar. | |
| const Quat | operator* (const Quat &rhs) const |
| Binary multiply. | |
| Quat & | operator*= (const Quat &rhs) |
| Unary multiply. | |
| Quat | operator/ (double rhs) const |
| Divide by scalar. | |
| Quat & | operator/= (double rhs) |
| Unary divide by scalar. | |
| const Quat | operator/ (const Quat &denom) const |
| Binary divide. | |
| Quat & | operator/= (const Quat &denom) |
| Unary divide. | |
| const Quat | operator+ (const Quat &rhs) const |
| Binary addition. | |
| Quat & | operator+= (const Quat &rhs) |
| Unary addition. | |
| const Quat | operator- (const Quat &rhs) const |
| Binary subtraction. | |
| Quat & | operator-= (const Quat &rhs) |
| Unary subtraction. | |
| const Quat | operator- () const |
| Negation operator - returns the negative of the quaternion. | |
| double | abs () const |
| Length of the quaternion = sqrt( vec . vec ). | |
| double | abs2 () const |
| Length of the quaternion = vec . vec. | |
| Quat | conj () const |
| Conjugate. | |
| const Quat | inverse () const |
| Multiplicative inverse method: q^(-1) = q^*/(q.q^*). | |
| void | makeRotate (double angle, double x, double y, double z) |
| void | makeRotate (double angle, const Vector &vec) |
| void | makeRotate (double angle1, const Vector &axis1, double angle2, const Vector &axis2, double angle3, const Vector &axis3) |
| void | makeRotate (const Vector &vec1, const Vector &vec2) |
| Make a rotation Quat which will rotate vec1 to vec2. | |
| void | getRotate (double &angle, double &x, double &y, double &z) const |
| Return the angle and vector components represented by the quaternion. | |
| void | getRotate (double &angle, Vector &vec) const |
| Return the angle and vector represented by the quaternion. | |
| void | slerp (double t, const Quat &from, const Quat &to) |
| Spherical Linear Interpolation. | |
| Vector | operator* (const Vector &v) const |
| Rotate a vector by this quaternion. | |
| VRS_SERIALIZABLE_NO_SO_CLASS (Quat) | |
Friends | |
| std::ostream & | operator<< (std::ostream &output, const Quat &vec) |
It can be used to represent an orientation in 3D space.
| VRS::Quat::Quat | ( | ) | [inline] |
| VRS::Quat::Quat | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | w | |||
| ) | [inline] |
| VRS::Quat::Quat | ( | const Vector4d & | v | ) | [inline] |
| VRS::Quat::Quat | ( | double | angle, | |
| const Vector & | axis | |||
| ) | [inline] |
| VRS::Quat::Quat | ( | double | angle1, | |
| const Vector & | axis1, | |||
| double | angle2, | |||
| const Vector & | axis2, | |||
| double | angle3, | |||
| const Vector & | axis3 | |||
| ) | [inline] |
| bool VRS::Quat::operator== | ( | const Quat & | v | ) | const [inline] |
| bool VRS::Quat::operator!= | ( | const Quat & | v | ) | const [inline] |
| bool VRS::Quat::operator< | ( | const Quat & | v | ) | const [inline] |
| Vector VRS::Quat::toVec3d | ( | ) | const [inline] |
| void VRS::Quat::set | ( | double | x, | |
| double | y, | |||
| double | z, | |||
| double | w | |||
| ) | [inline] |
| void VRS::Quat::set | ( | const Matrix & | matrix | ) |
| void VRS::Quat::get | ( | Matrix & | matrix | ) | const |
| double& VRS::Quat::x | ( | ) | [inline] |
| double& VRS::Quat::y | ( | ) | [inline] |
| double& VRS::Quat::z | ( | ) | [inline] |
| double& VRS::Quat::w | ( | ) | [inline] |
| double VRS::Quat::x | ( | ) | const [inline] |
| double VRS::Quat::y | ( | ) | const [inline] |
| double VRS::Quat::z | ( | ) | const [inline] |
| double VRS::Quat::w | ( | ) | const [inline] |
| bool VRS::Quat::zeroRotation | ( | ) | const [inline] |
return true if the Quat represents a zero rotation, and therefore can be ignored in computations.
| const Quat VRS::Quat::operator* | ( | double | rhs | ) | const [inline] |
Multiply by scalar.
| Quat& VRS::Quat::operator*= | ( | double | rhs | ) | [inline] |
Unary multiply by scalar.
| Quat VRS::Quat::operator/ | ( | double | rhs | ) | const [inline] |
Divide by scalar.
| Quat& VRS::Quat::operator/= | ( | double | rhs | ) | [inline] |
Unary divide by scalar.
| const Quat VRS::Quat::operator- | ( | ) | const [inline] |
Negation operator - returns the negative of the quaternion.
Basically just calls operator - () on the Vec4
| double VRS::Quat::abs | ( | ) | const [inline] |
Length of the quaternion = sqrt( vec . vec ).
| double VRS::Quat::abs2 | ( | ) | const [inline] |
Length of the quaternion = vec . vec.
| Quat VRS::Quat::conj | ( | ) | const [inline] |
Conjugate.
| const Quat VRS::Quat::inverse | ( | ) | const [inline] |
Multiplicative inverse method: q^(-1) = q^*/(q.q^*).
| void VRS::Quat::makeRotate | ( | double | angle, | |
| double | x, | |||
| double | y, | |||
| double | z | |||
| ) |
| void VRS::Quat::makeRotate | ( | double | angle, | |
| const Vector & | vec | |||
| ) |
| void VRS::Quat::makeRotate | ( | double | angle1, | |
| const Vector & | axis1, | |||
| double | angle2, | |||
| const Vector & | axis2, | |||
| double | angle3, | |||
| const Vector & | axis3 | |||
| ) |
Make a rotation Quat which will rotate vec1 to vec2.
Generally take adot product to get the angle between these and then use a cross product to get the rotation axis Watch out for the two special cases of when the vectors are co-incident or opposite in direction.
| void VRS::Quat::getRotate | ( | double & | angle, | |
| double & | x, | |||
| double & | y, | |||
| double & | z | |||
| ) | const |
Return the angle and vector components represented by the quaternion.
| void VRS::Quat::getRotate | ( | double & | angle, | |
| Vector & | vec | |||
| ) | const |
Return the angle and vector represented by the quaternion.
Spherical Linear Interpolation.
As t goes from 0 to 1, the Quat object goes from "from" to "to".
| VRS::Quat::VRS_SERIALIZABLE_NO_SO_CLASS | ( | Quat | ) |
| std::ostream& operator<< | ( | std::ostream & | output, | |
| const Quat & | vec | |||
| ) | [friend] |