AxisAngle: Represents a "twist about an axis" AxisAngle is used to specify a rotation in 3-space. More...
#include <AxisAngle.h>
Public Types | |
enum | Params { Size = 4 } |
The number of components this VecB has. More... | |
Public Member Functions | |
AxisAngle () | |
default constructor. | |
AxisAngle (const AxisAngle &e) | |
copy constructor. | |
AxisAngle (const DATA_TYPE &rad_angle, const DATA_TYPE &x, const DATA_TYPE &y, const DATA_TYPE &z) | |
data constructor (angle/x,y,z). | |
AxisAngle (const DATA_TYPE &rad_angle, const Vec< DATA_TYPE, 3 > &axis) | |
data constructor (angle/Vec3). | |
void | set (const DATA_TYPE &rad_angle, const DATA_TYPE &x, const DATA_TYPE &y, const DATA_TYPE &z) |
set raw data. | |
void | set (const DATA_TYPE &rad_angle, const Vec< DATA_TYPE, 3 > &axis) |
set data. | |
void | setAxis (const Vec< DATA_TYPE, 3 > &axis) |
set the axis portion of the AxisAngle | |
void | setAngle (const DATA_TYPE &rad_angle) |
set the angle (twist) part of the AxisAngle, as a radian value. | |
Vec< DATA_TYPE, 3 > | getAxis () const |
get the axis portion of the AxisAngle | |
const DATA_TYPE & | getAngle () const |
get the angle (twist) part of the AxisAngle. |
AxisAngle: Represents a "twist about an axis" AxisAngle is used to specify a rotation in 3-space.
To some people this rotation format can be more intuitive to specify than Matrix, Quat, or EulerAngle formatted rotation.
AxisAngle is very similar to Quat, except it is human readable. For efficiency, you should use Quat instead (Quat or Matrix are preferred).
The internal data format is an array of 4 DATA_TYPE values. Angle is first, the axis is the last 3.
Definition at line 35 of file AxisAngle.h.
enum gmtl::AxisAngle::Params |
The number of components this VecB has.
Reimplemented from gmtl::VecBase< DATA_TYPE, 4 >.
Definition at line 38 of file AxisAngle.h.
{ Size = 4 };
gmtl::AxisAngle< DATA_TYPE >::AxisAngle | ( | ) | [inline] |
default constructor.
initializes to identity rotation (no rotation).
Definition at line 41 of file AxisAngle.h.
: VecBase<DATA_TYPE, 4>( (DATA_TYPE)0.0, (DATA_TYPE)1.0, (DATA_TYPE)0.0, (DATA_TYPE)0.0 ) { }
gmtl::AxisAngle< DATA_TYPE >::AxisAngle | ( | const AxisAngle< DATA_TYPE > & | e | ) | [inline] |
gmtl::AxisAngle< DATA_TYPE >::AxisAngle | ( | const DATA_TYPE & | rad_angle, | |
const DATA_TYPE & | x, | |||
const DATA_TYPE & | y, | |||
const DATA_TYPE & | z | |||
) | [inline] |
data constructor (angle/x,y,z).
angles are in radians.
Definition at line 53 of file AxisAngle.h.
: VecBase<DATA_TYPE, 4>( rad_angle, x, y, z ) { }
gmtl::AxisAngle< DATA_TYPE >::AxisAngle | ( | const DATA_TYPE & | rad_angle, | |
const Vec< DATA_TYPE, 3 > & | axis | |||
) | [inline] |
data constructor (angle/Vec3).
angles are in radians.
Definition at line 60 of file AxisAngle.h.
: VecBase<DATA_TYPE, 4>( rad_angle, axis[0], axis[1], axis[2] ) { }
const DATA_TYPE& gmtl::AxisAngle< DATA_TYPE >::getAngle | ( | ) | const [inline] |
get the angle (twist) part of the AxisAngle.
Definition at line 111 of file AxisAngle.h.
{ return VecBase<DATA_TYPE, 4>::operator[]( 0 ); }
Vec<DATA_TYPE, 3> gmtl::AxisAngle< DATA_TYPE >::getAxis | ( | ) | const [inline] |
get the axis portion of the AxisAngle
Definition at line 101 of file AxisAngle.h.
{ return Vec<DATA_TYPE, 3>( VecBase<DATA_TYPE, 4>::operator[]( 1 ), VecBase<DATA_TYPE, 4>::operator[]( 2 ), VecBase<DATA_TYPE, 4>::operator[]( 3 ) ); }
void gmtl::AxisAngle< DATA_TYPE >::set | ( | const DATA_TYPE & | rad_angle, | |
const Vec< DATA_TYPE, 3 > & | axis | |||
) | [inline] |
set data.
angles are in radians.
Definition at line 73 of file AxisAngle.h.
{ VecBase<DATA_TYPE, 4>::set( rad_angle, axis[0], axis[1], axis[2] ); }
void gmtl::AxisAngle< DATA_TYPE >::set | ( | const DATA_TYPE & | rad_angle, | |
const DATA_TYPE & | x, | |||
const DATA_TYPE & | y, | |||
const DATA_TYPE & | z | |||
) | [inline] |
set raw data.
angles are in radians.
Definition at line 66 of file AxisAngle.h.
{ VecBase<DATA_TYPE, 4>::set( rad_angle, x, y, z ); }
void gmtl::AxisAngle< DATA_TYPE >::setAngle | ( | const DATA_TYPE & | rad_angle | ) | [inline] |
set the angle (twist) part of the AxisAngle, as a radian value.
rad_angle | the desired twist angle, in radians |
Definition at line 93 of file AxisAngle.h.
{ VecBase<DATA_TYPE, 4>::operator[]( 0 ) = rad_angle; }
void gmtl::AxisAngle< DATA_TYPE >::setAxis | ( | const Vec< DATA_TYPE, 3 > & | axis | ) | [inline] |
set the axis portion of the AxisAngle
axis | the desired 3D vector axis to rotate about |
Definition at line 82 of file AxisAngle.h.
{ VecBase<DATA_TYPE, 4>::operator[]( 1 ) = axis[0]; VecBase<DATA_TYPE, 4>::operator[]( 2 ) = axis[1]; VecBase<DATA_TYPE, 4>::operator[]( 3 ) = axis[2]; }