class SG_EXPORT osg::Quat

A quaternion class.

Public Fields

[more]Vec4 _fv

Public Methods

[more] Quat( void )
[more] Quat( float x, float y, float z, float w )
[more] Quat( const Vec4& vec )
[more]inline Vec4 asVec4( void ) const
[more]inline Vec3 asVec3( void ) const
[more]inline Quat operator * (const float& rhs) const
Multiply by scalar
[more]inline Quat& operator *= (const float& rhs)
Unary multiply by scalar
[more]inline Quat operator*(const Quat& rhs) const
Binary multiply
[more]inline Quat& operator*=(const Quat& rhs)
Unary multiply
[more]inline Quat operator / (const float& rhs) const
Divide by scalar
[more]inline Quat& operator /= (const float& rhs)
Unary divide by scalar
[more]inline Quat operator/(const Quat& denom) const
Binary divide
[more]inline Quat& operator/=(const Quat& denom)
Unary divide
[more]inline Quat operator + (const Quat& rhs) const
Binary addition
[more]inline Quat& operator += (const Quat& rhs)
Unary addition
[more]inline Quat operator - (const Quat& rhs) const
Binary subtraction
[more]inline Quat& operator -= (const Quat& rhs)
Unary subtraction
[more]inline Quat operator - () const
Negation operator - returns the negative of the quaternion.
[more]float length( void ) const
Length of the quaternion = sqrt( vec . vec )
[more]float length2( void ) const
Length of the quaternion = vec . vec
[more]inline Quat conj( void ) const
Conjugate
[more]inline Quat inverse( void ) const
Multiplicative inverse method: q^(-1) = q^*/(q.q^*)
[more]void makeRot( const float angle, const float x, const float y, const float z )
[more]void makeRot( const float angle, const Vec3& vec )
[more]void makeRot( const Vec3& vec1, const Vec3& vec2 )
Make a rotation Quat which will rotate vec1 to vec2.
[more]void getRot( float& angle, float& x, float& y, float& z ) const
Return the angle and vector components represented by the quaternion
[more]void getRot( 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
[more]inline friend ostream& operator << (ostream& output, const Quat& vec)


Documentation

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

o Quat( void )

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

o Quat( const Vec4& vec )

oinline Vec4 asVec4( void ) const

oinline Vec3 asVec3( void ) const

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ofloat length2( void ) const
Length of the quaternion = vec . vec

oinline Quat conj( void ) const
Conjugate

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

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

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

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

ovoid getRot( 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

oinline friend ostream& operator << (ostream& output, const Quat& vec)


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.