#include <Quat.h>
Inheritance diagram for Quat:

Public Methods | |
| virtual void | serialize (Archive &) |
| Serialize to or from a data archive. | |
| virtual void | parseXML (const char *cdata) |
| Internal method used by the XML parser. | |
| virtual std::string | asString () const |
| Standard representation string. | |
| virtual std::string | typeString () const |
| Return a string representation of the type. | |
| Quat () | |
| Construct a new quaternion. | |
| Quat (double x_, double y_, double z_, double w_) | |
| Construct a new quaternion. | |
| Quat (double angle, const Vector3 &axis) | |
| Construct a new quaternion representing a rotation. | |
| Quat (const Matrix3 &m) | |
| Construct a new quaternion representing a rotation. | |
| Quat (double angle1, const Vector3 &axis1, double angle2, const Vector3 &axis2, double angle3, const Vector3 &axis3) | |
| Construct a new quaternion representing a product of three rotations. | |
| const Vector3 | asVector3 () const |
| Return the 3-vector component of the quaternion (x,y,z). | |
| void | set (double x_, double y_, double z_, double w_) |
| Set the components. | |
| double & | operator[] (int i) |
| Access a component by index (0,1,2,3 = x,y,z,w). | |
| double | operator[] (int i) const |
| Get a component value by index (0,1,2,3 = x,y,z,w). | |
| double & | x () |
| X component accessor. | |
| double & | y () |
| Y component accessor. | |
| double & | z () |
| Z component accessor. | |
| double & | w () |
| W component accessor. | |
| double | x () const |
| X component const accessor. | |
| double | y () const |
| Y component const accessor. | |
| double | z () const |
| Z component const accessor. | |
| double | w () const |
| W component const accessor. | |
| bool | operator== (Quat const &rhs) const |
| Test equality. | |
| bool | operator!= (Quat const &rhs) const |
| Test inequality. | |
| bool | zeroRotation () const |
| Test if the quaternion is zero. | |
| 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 --- adjusted relative to osg for active transformations! | |
| Quat & | operator *= (const Quat &rhs) |
| Unary multiply --- adjusted relative to osg for active transformations! | |
| const 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 | length () const |
| Length of the quaternion = sqrt(vec . vec). | |
| double | length2 () const |
| Squared length of the quaternion = vec . vec. | |
| Quat | conj () const |
| Get conjugate. | |
| Quat | operator~ () const |
| Get conjugate. | |
| const Quat | inverse () const |
| Multiplicative inverse method: q^(-1) = q^*/(q.q^*). | |
| void | makeRotate (double angle, double x, double y, double z) |
| Set this Quat to represent a rotation about an axis. | |
| void | makeRotate (double angle, const Vector3 &vec) |
| Set this Quat to represent a rotation about an axis. | |
| void | makeRotate (double angle1, const Vector3 &axis1, double angle2, const Vector3 &axis2, double angle3, const Vector3 &axis3) |
| Set this Quat to represent a product of three rotations. | |
| void | makeRotate (const Vector3 &vec1, const Vector3 &vec2) |
| Set this Quat to represent a rotation that transforms vec1 to vec2. | |
| void | makeRotate (double roll, double pitch, double yaw) |
| Set this Quat to represent a rotation defined by Euler angles. | |
| void | getEulerAngles (double &roll, double &pitch, double &yaw) const |
| 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, Vector3 &vec) const |
| Return the angle and vector represented by the quaternion. | |
| void | slerp (double t, const Quat &from, const Quat &to) |
| Spherical Linear Interpolation. | |
| void | set (const Matrix3 &m) |
| Set quaternion to be equivalent to specified matrix. | |
| void | get (Matrix3 &m) const |
| Get the equivalent matrix for this quaternion. | |
| Matrix3 | getMatrix3 () const |
| Get the equivalent matrix for this quaternion. | |
| Vector3 | rotate (const Vector3 &v) const |
| Rotate a vector by this quaternion. | |
| Vector3 | invrotate (const Vector3 &v) const |
| Rotate a vector by the inverse of this quaternion. | |
| Quat | rotate (const Quat &q) const |
| Rotate another quaternion by this quaternion. | |
| Quat | invrotate (const Quat &q) const |
| Rotate another quaternion by the inverse of this quaternion. | |
| virtual void | convertXML () |
| Convert XML data to internal format prior to serialization. | |
Static Public Attributes | |
| const Quat | IDENTITY |
| The identity Quat = (0,0,0,1). | |
| const Quat | ZERO |
| The zero Quat = (0,0,0,0). | |
Friends | |
| std::ostream & | operator<< (std::ostream &output, const Quat &vec) |
| Format to an output stream. | |
| Quat | operator * (double lhs, const Quat &rhs) |
| Multiply a Quat by a scalar value on the left. | |
| Quat | operator * (Quat const &lhs, Vector3 const &rhs) |
| Multiply a Quat by a vector on the right. | |
| Quat | operator * (Vector3 const &lhs, Quat const &rhs) |
| Multiply a Quat by a vector on the left. | |
Quaternions are four dimensional objects that form a compact representation for rotations. Many thorough treatments of quaternions and their use in simulations can be readily found on the web.
|
|
Construct a new quaternion. Initialize to (0,0,0,0) |
|
||||||||||||||||||||
|
Construct a new quaternion. Specifiy the four real-valued components. |
|
||||||||||||
|
Construct a new quaternion representing a rotation.
|
|
|
Construct a new quaternion representing a rotation.
|
|
||||||||||||||||||||||||||||
|
Construct a new quaternion representing a product of three rotations.
|
|
|
Standard representation string.
Implements BaseType. |
|
|
Return the 3-vector component of the quaternion (x,y,z).
|
|
|
Get conjugate.
|
|
|
Convert XML data to internal format prior to serialization. This method is currently only called by the XML parser for Object classes. If another BaseType class requires this method, a call must be added to the appropriate XML handler in the parser. |
|
|
Get the equivalent matrix for this quaternion.
|
|
||||||||||||||||
|
|
|
|
Get the equivalent matrix for this quaternion.
|
|
||||||||||||
|
Return the angle and vector represented by the quaternion.
|
|
||||||||||||||||||||
|
Return the angle and vector components represented by the quaternion.
|
|
|
Multiplicative inverse method: q^(-1) = q^*/(q.q^*).
|
|
|
Rotate another quaternion by the inverse of this quaternion.
|
|
|
Rotate a vector by the inverse of this quaternion.
|
|
|
Length of the quaternion = sqrt(vec . vec).
|
|
|
Squared length of the quaternion = vec . vec.
|
|
||||||||||||||||
|
Set this Quat to represent a rotation defined by Euler angles.
|
|
||||||||||||
|
Set this Quat to represent a rotation that transforms vec1 to vec2.
|
|
||||||||||||||||||||||||||||
|
Set this Quat to represent a product of three rotations.
|
|
||||||||||||
|
Set this Quat to represent a rotation about an axis.
|
|
||||||||||||||||||||
|
Set this Quat to represent a rotation about an axis.
|
|
|
Binary multiply --- adjusted relative to osg for active transformations!
|
|
|
Multiply by scalar.
|
|
|
Unary multiply --- adjusted relative to osg for active transformations!
|
|
|
Unary multiply by scalar.
|
|
|
Test inequality.
|
|
|
Binary addition.
|
|
|
Unary addition.
|
|
|
Negation operator- returns the negative of the quaternion.
|
|
|
Binary subtraction.
|
|
|
Unary subtraction.
|
|
|
Binary divide.
|
|
|
Divide by scalar.
|
|
|
Unary divide.
|
|
|
Unary divide by scalar.
|
|
|
Test equality.
|
|
|
Get a component value by index (0,1,2,3 = x,y,z,w).
|
|
|
Access a component by index (0,1,2,3 = x,y,z,w).
|
|
|
Get conjugate.
|
|
|
Internal method used by the XML parser. The format for Quats is "X Y Z W" Reimplemented from BaseType. |
|
|
Rotate another quaternion by this quaternion.
|
|
|
Rotate a vector by this quaternion.
|
|
|
Serialize to or from a data archive.
Reimplemented from BaseType. |
|
|
Set quaternion to be equivalent to specified matrix.
|
|
||||||||||||||||||||
|
Set the components.
|
|
||||||||||||||||
|
Spherical Linear Interpolation. As t goes from 0 to 1, the Quat object goes from "from" to "to". |
|
|
Return a string representation of the type.
Implements BaseType. |
|
|
W component const accessor.
|
|
|
W component accessor.
|
|
|
X component const accessor.
|
|
|
X component accessor.
|
|
|
Y component const accessor.
|
|
|
Y component accessor.
|
|
|
Z component const accessor.
|
|
|
Z component accessor.
|
|
|
Test if the quaternion is zero. Zero rotations can generally be ignored in computations. |
|
||||||||||||
|
Multiply a Quat by a vector on the left.
|
|
||||||||||||
|
Multiply a Quat by a vector on the right.
|
|
||||||||||||
|
Multiply a Quat by a scalar value on the left.
|
|
||||||||||||
|
Format to an output stream.
|
|
|
The identity Quat = (0,0,0,1).
|
|
|
The zero Quat = (0,0,0,0).
|
|
SimData version pre-0.4.0. For more information on SimData, visit the SimData Homepage. Generated on Tue Oct 14 12:06:42 2003, using Doxygen 1.2.18. |