LinearAlgebra
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
a3d::Rotation< T, M > Struct Template Reference

A rotation struct. More...

Collaboration diagram for a3d::Rotation< T, M >:
Collaboration graph
[legend]

Public Member Functions

 Rotation ()
 Creates an uninitialized rotation. More...
 
 Rotation (int i)
 Creates a rotation initialized to zero rotation. More...
 
template<class S , class T2 , class M2 >
 Rotation (S a, const Vector3< T2, M2 > &v)
 Creates a rotation from an axis and angle. More...
 
template<class S , class T2 , class M2 >
 Rotation (const Vector3< T2, M2 > &v, S a)
 Creates a rotation from an axis and angle. More...
 
template<class T2 , class M2 >
 Rotation (const Rotation< T2, M2 > &r)
 Copies a rotation. More...
 
template<class T2 , class M2 >
 Rotation (const Quaternion< T2, M2 > &q)
 Creates a rotation from a quaternion (cast). More...
 
Rotation< T, M > & operator= (const Rotation< T, M > &r)
 Copy operator. More...
 
template<class T2 , class M2 >
Rotation< T, M > & operator= (const Rotation< T2, M2 > &r)
 Copy operator. More...
 
getAngleInDegrees () const
 Returns the angle of this rotation, in degrees. More...
 
Vector3< T, M > toRotationVector () const
 Create a vector representation of the rotation. More...
 

Static Public Member Functions

template<class T2 , class M2 >
static Rotation< T, M > fromRotationVector (const Vector3< T2, M2 > &v)
 Create the rotation from a vector representation of the rotation. More...
 

Public Attributes

a
 Rotation angle in radians. More...
 
Vector3< T, M > v
 Axis of rotation. More...
 

Detailed Description

template<class T, class M = Math<T>>
struct a3d::Rotation< T, M >

A rotation struct.

Use this to set glRotate. The angle is still in radians, though, so remember to convert it to degrees when applying to glRotate.

Constructor & Destructor Documentation

template<class T, class M = Math<T>>
a3d::Rotation< T, M >::Rotation ( )
inline

Creates an uninitialized rotation.

template<class T, class M = Math<T>>
a3d::Rotation< T, M >::Rotation ( int  i)
inlineexplicit

Creates a rotation initialized to zero rotation.

template<class T, class M = Math<T>>
template<class S , class T2 , class M2 >
a3d::Rotation< T, M >::Rotation ( a,
const Vector3< T2, M2 > &  v 
)
inline

Creates a rotation from an axis and angle.

template<class T, class M = Math<T>>
template<class S , class T2 , class M2 >
a3d::Rotation< T, M >::Rotation ( const Vector3< T2, M2 > &  v,
a 
)
inline

Creates a rotation from an axis and angle.

template<class T, class M = Math<T>>
template<class T2 , class M2 >
a3d::Rotation< T, M >::Rotation ( const Rotation< T2, M2 > &  r)
inline

Copies a rotation.

template<class T, class M = Math<T>>
template<class T2 , class M2 >
a3d::Rotation< T, M >::Rotation ( const Quaternion< T2, M2 > &  q)
inlineexplicit

Creates a rotation from a quaternion (cast).

References a3d::Rotation< T, M >::v, and a3d::Quaternion< T, M >::v.

Member Function Documentation

template<class T, class M = Math<T>>
template<class T2 , class M2 >
static Rotation<T,M> a3d::Rotation< T, M >::fromRotationVector ( const Vector3< T2, M2 > &  v)
inlinestatic

Create the rotation from a vector representation of the rotation.

The vector length represents the angle, in radians, and the vector orientation represents the axis.

References a3d::Vector3< T, M >::length().

Here is the call graph for this function:

template<class T, class M = Math<T>>
T a3d::Rotation< T, M >::getAngleInDegrees ( ) const
inline

Returns the angle of this rotation, in degrees.

References a3d::Rotation< T, M >::a.

template<class T, class M = Math<T>>
Rotation<T,M>& a3d::Rotation< T, M >::operator= ( const Rotation< T, M > &  r)
inline

Copy operator.

References a3d::Rotation< T, M >::a, and a3d::Rotation< T, M >::v.

template<class T, class M = Math<T>>
template<class T2 , class M2 >
Rotation<T,M>& a3d::Rotation< T, M >::operator= ( const Rotation< T2, M2 > &  r)
inline

Copy operator.

References a3d::Rotation< T, M >::a, and a3d::Rotation< T, M >::v.

template<class T, class M = Math<T>>
Vector3<T,M> a3d::Rotation< T, M >::toRotationVector ( ) const
inline

Create a vector representation of the rotation.

The vector length represents the angle, in radians, and the vector orientation represents the axis.

References a3d::Rotation< T, M >::a, and a3d::Rotation< T, M >::v.

Member Data Documentation

template<class T, class M = Math<T>>
T a3d::Rotation< T, M >::a
template<class T, class M = Math<T>>
Vector3<T,M> a3d::Rotation< T, M >::v