class SG_EXPORT osg::Quat

A quaternion class.

Public Fields

[more]value_type _v[4]

Public Methods

[more]inline Quat()
[more]inline Quat( value_type x, value_type y, value_type z, value_type w )
[more]inline Quat( const Vec4f& v )
[more]inline Quat( const Vec4d& v )
[more]inline Quat( value_type angle, const Vec3f& axis)
[more]inline Quat( value_type angle, const Vec3d& axis)
[more]inline Quat( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
[more]inline Quat( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
[more]inline bool operator == (const Quat& v) const
[more]inline bool operator != (const Quat& v) const
[more]inline bool operator < (const Quat& v) const
[more]inline Vec4d asVec4() const
[more]inline Vec3d asVec3() const
[more]inline void set(value_type x, value_type y, value_type z, value_type w)
[more]inline void set(const osg::Vec4f& v)
[more]inline void set(const osg::Vec4d& v)
[more]void set(const Matrixf& matrix)
[more]void set(const Matrixd& matrix)
[more]void get(Matrixf& matrix) const
[more]void get(Matrixd& matrix) const
[more]inline value_type& operator [] (int i)
[more]inline value_type operator [] (int i) const
[more]inline value_type& x()
[more]inline value_type& y()
[more]inline value_type& z()
[more]inline value_type& w()
[more]inline value_type x() const
[more]inline value_type y() const
[more]inline value_type z() const
[more]inline value_type w() const
[more]bool zeroRotation() const
return true if the Quat represents a zero rotation, and therefore can be ignored in computations
[more]inline const Quat operator * (value_type rhs) const
Multiply by scalar
[more]inline Quat& operator *= (value_type rhs)
Unary multiply by scalar
[more]inline const Quat operator*(const Quat& rhs) const
Binary multiply
[more]inline Quat& operator*=(const Quat& rhs)
Unary multiply
[more]inline Quat operator / (value_type rhs) const
Divide by scalar
[more]inline Quat& operator /= (value_type rhs)
Unary divide by scalar
[more]inline const Quat operator/(const Quat& denom) const
Binary divide
[more]inline Quat& operator/=(const Quat& denom)
Unary divide
[more]inline const Quat operator + (const Quat& rhs) const
Binary addition
[more]inline Quat& operator += (const Quat& rhs)
Unary addition
[more]inline const Quat operator - (const Quat& rhs) const
Binary subtraction
[more]inline Quat& operator -= (const Quat& rhs)
Unary subtraction
[more]inline const Quat operator - () const
Negation operator - returns the negative of the quaternion.
[more]value_type length() const
Length of the quaternion = sqrt( vec .
[more]value_type length2() const
Length of the quaternion = vec .
[more]inline Quat conj() const
Conjugate
[more]inline const Quat inverse() const
Multiplicative inverse method: q^(-1) = q^*/(qq^*)
[more]void makeRotate( value_type angle, value_type x, value_type y, value_type z )
[more]void makeRotate( value_type angle, const Vec3f& vec )
[more]void makeRotate( value_type angle, const Vec3d& vec )
[more]void makeRotate( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)
[more]void makeRotate( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)
[more]void makeRotate( const Vec3f& vec1, const Vec3f& vec2 )
Make a rotation Quat which will rotate vec1 to vec2.
[more]void makeRotate( const Vec3d& vec1, const Vec3d& vec2 )
Make a rotation Quat which will rotate vec1 to vec2.
[more]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
[more]void getRotate( value_type & angle, Vec3f& vec ) const
Return the angle and vector represented by the quaternion
[more]void getRotate( value_type & angle, Vec3d& vec ) const
Return the angle and vector represented by the quaternion
[more]void slerp( value_type t, const Quat& from, const Quat& to)
Spherical Linear Interpolation.
[more]Vec3f operator* (const Vec3f& v) const
Rotate a vector by this quaternion
[more]Vec3d operator* (const Vec3d& v) const
Rotate a vector by this quaternion

Public

[more]typedef double value_type


Documentation

A quaternion class. It can be used to represent an orientation in 3D space.
otypedef double value_type

ovalue_type _v[4]

oinline Quat()

oinline Quat( value_type x, value_type y, value_type z, value_type w )

oinline Quat( const Vec4f& v )

oinline Quat( const Vec4d& v )

oinline Quat( value_type angle, const Vec3f& axis)

oinline Quat( value_type angle, const Vec3d& axis)

oinline Quat( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)

oinline Quat( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)

oinline bool operator == (const Quat& v) const

oinline bool operator != (const Quat& v) const

oinline bool operator < (const Quat& v) const

oinline Vec4d asVec4() const

oinline Vec3d asVec3() const

oinline void set(value_type x, value_type y, value_type z, value_type w)

oinline void set(const osg::Vec4f& v)

oinline void set(const osg::Vec4d& v)

ovoid set(const Matrixf& matrix)

ovoid set(const Matrixd& matrix)

ovoid get(Matrixf& matrix) const

ovoid get(Matrixd& matrix) const

oinline value_type& operator [] (int i)

oinline value_type operator [] (int i) const

oinline value_type& x()

oinline value_type& y()

oinline value_type& z()

oinline value_type& w()

oinline value_type x() const

oinline value_type y() const

oinline value_type z() const

oinline value_type w() const

obool zeroRotation() const
return true if the Quat represents a zero rotation, and therefore can be ignored in computations

oinline const Quat operator * (value_type rhs) const
Multiply by scalar

oinline Quat& operator *= (value_type rhs)
Unary multiply by scalar

oinline const Quat operator*(const Quat& rhs) const
Binary multiply

oinline Quat& operator*=(const Quat& rhs)
Unary multiply

oinline Quat operator / (value_type rhs) const
Divide by scalar

oinline Quat& operator /= (value_type rhs)
Unary divide by scalar

oinline const Quat operator/(const Quat& denom) const
Binary divide

oinline Quat& operator/=(const Quat& denom)
Unary divide

oinline const Quat operator + (const Quat& rhs) const
Binary addition

oinline Quat& operator += (const Quat& rhs)
Unary addition

oinline const Quat operator - (const Quat& rhs) const
Binary subtraction

oinline Quat& operator -= (const Quat& rhs)
Unary subtraction

oinline const Quat operator - () const
Negation operator - returns the negative of the quaternion. Basically just calls operator - () on the Vec4

ovalue_type length() const
Length of the quaternion = sqrt( vec . vec )

ovalue_type length2() const
Length of the quaternion = vec . vec

oinline Quat conj() const
Conjugate

oinline const Quat inverse() const
Multiplicative inverse method: q^(-1) = q^*/(qq^*)

ovoid makeRotate( value_type angle, value_type x, value_type y, value_type z )

ovoid makeRotate( value_type angle, const Vec3f& vec )

ovoid makeRotate( value_type angle, const Vec3d& vec )

ovoid makeRotate( value_type angle1, const Vec3f& axis1, value_type angle2, const Vec3f& axis2, value_type angle3, const Vec3f& axis3)

ovoid makeRotate( value_type angle1, const Vec3d& axis1, value_type angle2, const Vec3d& axis2, value_type angle3, const Vec3d& axis3)

ovoid 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.

ovoid 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.

ovoid getRotate( value_type & angle, value_type & x, value_type & y, value_type & z ) const
Return the angle and vector components represented by the quaternion

ovoid getRotate( value_type & angle, Vec3f& vec ) const
Return the angle and vector represented by the quaternion

ovoid getRotate( value_type & angle, Vec3d& vec ) const
Return the angle and vector represented by the quaternion

ovoid 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".

oVec3f operator* (const Vec3f& v) const
Rotate a vector by this quaternion

oVec3d 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++.