A quaternion class.
Public Fields
-
value_type _v[4]
Public Methods
-
inline Quat()
-
inline Quat( value_type x, value_type y, value_type z, value_type w )
-
inline Quat( const Vec4f& v )
-
inline Quat( const Vec4d& v )
-
inline Quat( value_type angle, const Vec3f& axis)
-
inline Quat( value_type angle, const Vec3d& axis)
-
inline Quat( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
-
inline Quat( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
-
inline bool operator == (const Quat& v) const
-
inline bool operator != (const Quat& v) const
-
inline bool operator < (const Quat& v) const
-
inline Vec4d asVec4() const
-
inline Vec3d asVec3() const
-
inline void set(value_type x, value_type y, value_type z, value_type w)
-
inline void set(const osg::Vec4f& v)
-
inline void set(const osg::Vec4d& v)
-
void set(const Matrixf& matrix)
-
void set(const Matrixd& matrix)
-
void get(Matrixf& matrix) const
-
void get(Matrixd& matrix) const
-
inline value_type& operator [] (int i)
-
inline value_type operator [] (int i) const
-
inline value_type& x()
-
inline value_type& y()
-
inline value_type& z()
-
inline value_type& w()
-
inline value_type x() const
-
inline value_type y() const
-
inline value_type z() const
-
inline value_type w() const
-
bool zeroRotation() const
- return true if the Quat represents a zero rotation, and therefore can be ignored in computations
-
inline const Quat operator * (value_type rhs) const
- Multiply by scalar
-
inline Quat& operator *= (value_type rhs)
- Unary multiply by scalar
-
inline const Quat operator*(const Quat& rhs) const
- Binary multiply
-
inline Quat& operator*=(const Quat& rhs)
- Unary multiply
-
inline Quat operator / (value_type rhs) const
- Divide by scalar
-
inline Quat& operator /= (value_type rhs)
- Unary divide by scalar
-
inline const Quat operator/(const Quat& denom) const
- Binary divide
-
inline Quat& operator/=(const Quat& denom)
- Unary divide
-
inline const Quat operator + (const Quat& rhs) const
- Binary addition
-
inline Quat& operator += (const Quat& rhs)
- Unary addition
-
inline const Quat operator - (const Quat& rhs) const
- Binary subtraction
-
inline Quat& operator -= (const Quat& rhs)
- Unary subtraction
-
inline const Quat operator - () const
- Negation operator - returns the negative of the quaternion.
-
value_type length() const
- Length of the quaternion = sqrt( vec .
-
value_type length2() const
- Length of the quaternion = vec .
-
inline Quat conj() const
- Conjugate
-
inline const Quat inverse() const
- Multiplicative inverse method: q^(-1) = q^*/(qq^*)
-
void makeRotate( value_type angle, value_type x, value_type y, value_type z )
-
void makeRotate( value_type angle, const Vec3f& vec )
-
void makeRotate( value_type angle, const Vec3d& vec )
-
void makeRotate( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
-
void makeRotate( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
-
void makeRotate( const Vec3f& vec1, const Vec3f& vec2 )
- Make a rotation Quat which will rotate vec1 to vec2.
-
void makeRotate( const Vec3d& vec1, const Vec3d& vec2 )
- Make a rotation Quat which will rotate vec1 to vec2.
-
void getRotate( value_type & angle, value_type & x, value_type & y, value_type & z ) const
- Return the angle and vector components represented by the quaternion
-
void getRotate( value_type & angle, Vec3f& vec ) const
- Return the angle and vector represented by the quaternion
-
void getRotate( value_type & angle, Vec3d& vec ) const
- Return the angle and vector represented by the quaternion
-
void slerp( value_type t, const Quat& from, const Quat& to)
- Spherical Linear Interpolation.
-
Vec3f operator* (const Vec3f& v) const
- Rotate a vector by this quaternion
-
Vec3d operator* (const Vec3d& v) const
- Rotate a vector by this quaternion
Public
-
typedef double value_type
Documentation
A quaternion class. It can be used to represent an orientation in 3D space.
- typedef double value_type
- value_type _v[4]
- inline Quat()
- inline Quat( value_type x, value_type y, value_type z, value_type w )
- inline Quat( const Vec4f& v )
- inline Quat( const Vec4d& v )
- inline Quat( value_type angle, const Vec3f& axis)
- inline Quat( value_type angle, const Vec3d& axis)
- inline Quat( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
- inline Quat( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
- inline bool operator == (const Quat& v) const
- inline bool operator != (const Quat& v) const
- inline bool operator < (const Quat& v) const
- inline Vec4d asVec4() const
- inline Vec3d asVec3() const
- inline void set(value_type x, value_type y, value_type z, value_type w)
- inline void set(const osg::Vec4f& v)
- inline void set(const osg::Vec4d& v)
- void set(const Matrixf& matrix)
- void set(const Matrixd& matrix)
- void get(Matrixf& matrix) const
- void get(Matrixd& matrix) const
- inline value_type& operator [] (int i)
- inline value_type operator [] (int i) const
- inline value_type& x()
- inline value_type& y()
- inline value_type& z()
- inline value_type& w()
- inline value_type x() const
- inline value_type y() const
- inline value_type z() const
- inline value_type w() const
- bool zeroRotation() const
- return true if the Quat represents a zero rotation, and therefore can be ignored in computations
- inline const Quat operator * (value_type rhs) const
- Multiply by scalar
- inline Quat& operator *= (value_type rhs)
- Unary multiply by scalar
- inline const Quat operator*(const Quat& rhs) const
- Binary multiply
- inline Quat& operator*=(const Quat& rhs)
- Unary multiply
- inline Quat operator / (value_type rhs) const
- Divide by scalar
- inline Quat& operator /= (value_type rhs)
- Unary divide by scalar
- inline const Quat operator/(const Quat& denom) const
- Binary divide
- inline Quat& operator/=(const Quat& denom)
- Unary divide
- inline const Quat operator + (const Quat& rhs) const
- Binary addition
- inline Quat& operator += (const Quat& rhs)
- Unary addition
- inline const Quat operator - (const Quat& rhs) const
- Binary subtraction
- inline Quat& operator -= (const Quat& rhs)
- Unary subtraction
- inline const Quat operator - () const
- Negation operator - returns the negative of the quaternion.
Basically just calls operator - () on the Vec4
- value_type length() const
- Length of the quaternion = sqrt( vec . vec )
- value_type length2() const
- Length of the quaternion = vec . vec
- inline Quat conj() const
- Conjugate
- inline const Quat inverse() const
- Multiplicative inverse method: q^(-1) = q^*/(qq^*)
- void makeRotate( value_type angle, value_type x, value_type y, value_type z )
- void makeRotate( value_type angle, const Vec3f& vec )
- void makeRotate( value_type angle, const Vec3d& vec )
- void makeRotate( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
- void makeRotate( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
- void makeRotate( const Vec3f& vec1, const Vec3f& vec2 )
- 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 makeRotate( const Vec3d& vec1, const Vec3d& vec2 )
- 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 getRotate( value_type & angle, value_type & x, value_type & y, value_type & z ) const
- Return the angle and vector components represented by the quaternion
- void getRotate( value_type & angle, Vec3f& vec ) const
- Return the angle and vector represented by the quaternion
- void getRotate( value_type & angle, Vec3d& vec ) const
- Return the angle and vector represented by the quaternion
- void slerp( value_type t, const Quat& from, const Quat& to)
- Spherical Linear Interpolation.
As t goes from 0 to 1, the Quat object goes from "from" to "to".
- Vec3f operator* (const Vec3f& v) const
- Rotate a vector by this quaternion
- Vec3d operator* (const Vec3d& v) const
- Rotate a vector by this quaternion
- This class has no child classes.
- Friends:
- inline std::ostream& operator << (std::ostream& output, const Quat& vec)
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.