class SG_EXPORT osg::Quat

A quaternion class.

Public Fields

[more]Vec4 _fv

Public Methods

[more] Quat()
[more] Quat( float x, float y, float z, float w )
[more] Quat( const Vec4& v )
[more]inline Vec4& asVec4()
[more]inline const Vec4& asVec4() const
[more]inline const Vec3 asVec3() const
[more]inline void set(const float x, const float y, const float z, const float w)
[more]inline void set(const osg::Vec4& v)
[more]inline const Quat operator * (const float& rhs) const
Multiply by scalar
[more]inline Quat& operator *= (const float& 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 const Quat operator / (const float& rhs) const
Divide by scalar
[more]inline Quat& operator /= (const float& 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]const float length() const
Length of the quaternion = sqrt( vec .
[more]const float length2() const
Length of the quaternion = vec .
[more]inline const Quat conj() const
Conjugate
[more]inline const Quat inverse() const
Multiplicative inverse method: q^(-1) = q^*/(qq^*)
[more]void makeRotate( const float angle, const float x, const float y, const float z )
[more]void makeRotate( const float angle, const Vec3& vec )
[more]void makeRotate( const Vec3& vec1, const Vec3& vec2 )
Make a rotation Quat which will rotate vec1 to vec2.
[more]void getRotate( float& angle, float& x, float& y, float& z ) const
Return the angle and vector components represented by the quaternion
[more]void getRotate( float& angle, Vec3& vec ) const
Return the angle and vector represented by the quaternion
[more]void slerp( const float t, const Quat& from, const Quat& to)
Spherical Linear Interpolation.
[more]void set( const osg::Matrix& m )
Set quaternion to be equivalent to specified matrix
[more]void get( osg::Matrix& m ) const
Get the equivalent matrix for this quaternion


Documentation

A quaternion class. It can be used to represent an orientation in 3D space.
oVec4 _fv

o Quat()

o Quat( float x, float y, float z, float w )

o Quat( const Vec4& v )

oinline Vec4& asVec4()

oinline const Vec4& asVec4() const

oinline const Vec3 asVec3() const

oinline void set(const float x, const float y, const float z, const float w)

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

oinline const Quat operator * (const float& rhs) const
Multiply by scalar

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

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

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

oinline const Quat operator / (const float& rhs) const
Divide by scalar

oinline Quat& operator /= (const float& 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

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

oconst float length2() const
Length of the quaternion = vec . vec

oinline const Quat conj() const
Conjugate

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

ovoid makeRotate( const float angle, const float x, const float y, const float z )

ovoid makeRotate( const float angle, const Vec3& vec )

ovoid makeRotate( const Vec3& vec1, const Vec3& 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( float& angle, float& x, float& y, float& z ) const
Return the angle and vector components represented by the quaternion

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

ovoid slerp( const float 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".

ovoid set( const osg::Matrix& m )
Set quaternion to be equivalent to specified matrix

ovoid get( osg::Matrix& m ) const
Get the equivalent matrix for 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++.