class SG_EXPORT osg::Quat

A quaternion class.

Public Fields

[more]Vec4 _fv

Public Methods

[more]inline Quat()
[more]inline Quat( float x, float y, float z, float w )
[more]inline Quat( const Vec4& v )
[more]inline Quat( float angle, const Vec3& axis)
[more]inline Quat( float angle1, const Vec3& axis1, float angle2, const Vec3& axis2, float angle3, const Vec3& axis3)
[more]inline Vec4& asVec4()
[more]inline const Vec4& asVec4() const
[more]inline const Vec3 asVec3() const
[more]inline void set(float x, float y, float z, float w)
[more]inline void set(const osg::Vec4& v)
[more]inline float& operator [] (int i)
[more]inline float operator [] (int i) const
[more]inline float& x()
[more]inline float& y()
[more]inline float& z()
[more]inline float& w()
[more]inline float x() const
[more]inline float y() const
[more]inline float z() const
[more]inline float 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 * (float rhs) const
Multiply by scalar
[more]inline Quat& operator *= (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 / (float rhs) const
Divide by scalar
[more]inline Quat& operator /= (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]float length() const
Length of the quaternion = sqrt( vec .
[more]float 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( float angle, float x, float y, float z )
[more]void makeRotate( float angle, const Vec3& vec )
[more]void makeRotate( float angle1, const Vec3& axis1, float angle2, const Vec3& axis2, float angle3, const Vec3& axis3)
[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( float t, const Quat& from, const Quat& to)
Spherical Linear Interpolation.
[more]void set( const Matrix& m )
Set quaternion to be equivalent to specified matrix
[more]void get( Matrix& m ) const
Get the equivalent matrix for this quaternion
[more]Matrix getMatrix() 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

oinline Quat()

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

oinline Quat( const Vec4& v )

oinline Quat( float angle, const Vec3& axis)

oinline Quat( float angle1, const Vec3& axis1, float angle2, const Vec3& axis2, float angle3, const Vec3& axis3)

oinline Vec4& asVec4()

oinline const Vec4& asVec4() const

oinline const Vec3 asVec3() const

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

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

oinline float& operator [] (int i)

oinline float operator [] (int i) const

oinline float& x()

oinline float& y()

oinline float& z()

oinline float& w()

oinline float x() const

oinline float y() const

oinline float z() const

oinline float 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 * (float rhs) const
Multiply by scalar

oinline Quat& operator *= (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 / (float rhs) const
Divide by scalar

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

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

ofloat 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( float angle, float x, float y, float z )

ovoid makeRotate( float angle, const Vec3& vec )

ovoid makeRotate( float angle1, const Vec3& axis1, float angle2, const Vec3& axis2, float angle3, const Vec3& axis3)

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( 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 Matrix& m )
Set quaternion to be equivalent to specified matrix

ovoid get( Matrix& m ) const
Get the equivalent matrix for this quaternion

oMatrix getMatrix() 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++.