#include <AxisAngle.h>
Inheritance diagram for gmtl::AxisAngle:
Public Types | |
enum | Params { Size = 4 } |
Public Methods | |
AxisAngle () | |
default constructor. More... | |
AxisAngle (const AxisAngle &e) | |
copy constructor. More... | |
AxisAngle (const DATA_TYPE &rad_angle, const DATA_TYPE &x, const DATA_TYPE &y, const DATA_TYPE &z) | |
data constructor (angle/x,y,z). More... | |
AxisAngle (const DATA_TYPE &rad_angle, const Vec< DATA_TYPE, 3 > &axis) | |
data constructor (angle/Vec3). More... | |
void | set (const DATA_TYPE &rad_angle, const DATA_TYPE &x, const DATA_TYPE &y, const DATA_TYPE &z) |
set raw data. More... | |
void | set (const DATA_TYPE &rad_angle, const Vec< DATA_TYPE, 3 > &axis) |
set data. More... | |
void | setAxis (const Vec< DATA_TYPE, 3 > &axis) |
set the axis portion of the AxisAngle. More... | |
void | setAngle (const DATA_TYPE &rad_angle) |
set the angle (twist) part of the AxisAngle, as a radian value. More... | |
Vec< DATA_TYPE, 3 > | getAxis () const |
get the axis portion of the AxisAngle. More... | |
const DATA_TYPE & | getAngle () const |
get the angle (twist) part of the AxisAngle. More... |
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 64 of file AxisAngle.h.
|
Definition at line 67 of file AxisAngle.h.
00067 { Size = 4 }; |
|
default constructor. initializes to identity rotation (no rotation). Definition at line 70 of file AxisAngle.h. References gmtl::VecBase< DATA_TYPE, 4 >::VecBase. Referenced by AxisAngle.
00070 : 00071 VecBase<DATA_TYPE, 4>( (DATA_TYPE)0.0, (DATA_TYPE)1.0, 00072 (DATA_TYPE)0.0, (DATA_TYPE)0.0 ) 00073 { 00074 } |
|
copy constructor.
Definition at line 77 of file AxisAngle.h. References AxisAngle, and gmtl::VecBase< DATA_TYPE, 4 >::VecBase.
00077 : VecBase<DATA_TYPE, 4>( e ) 00078 { 00079 } |
|
data constructor (angle/x,y,z). angles are in radians. Definition at line 82 of file AxisAngle.h. References gmtl::VecBase< DATA_TYPE, 4 >::VecBase.
00083 : 00084 VecBase<DATA_TYPE, 4>( rad_angle, x, y, z ) 00085 { 00086 } |
|
data constructor (angle/Vec3). angles are in radians. Definition at line 89 of file AxisAngle.h. References gmtl::VecBase< DATA_TYPE, 4 >::VecBase.
00089 : 00090 VecBase<DATA_TYPE, 4>( rad_angle, axis[0], axis[1], axis[2] ) 00091 { 00092 } |
|
get the angle (twist) part of the AxisAngle.
Definition at line 140 of file AxisAngle.h.
00141 { 00142 return VecBase<DATA_TYPE, 4>::operator[]( 0 ); 00143 } |
|
get the axis portion of the AxisAngle.
Definition at line 130 of file AxisAngle.h.
00131 { 00132 return Vec<DATA_TYPE, 3>( VecBase<DATA_TYPE, 4>::operator[]( 1 ), 00133 VecBase<DATA_TYPE, 4>::operator[]( 2 ), 00134 VecBase<DATA_TYPE, 4>::operator[]( 3 ) ); 00135 } |
|
set data. angles are in radians. Definition at line 102 of file AxisAngle.h. References gmtl::set.
00103 { 00104 VecBase<DATA_TYPE, 4>::set( rad_angle, axis[0], axis[1], axis[2] ); 00105 } |
|
set raw data. angles are in radians. Reimplemented from gmtl::VecBase< DATA_TYPE, 4 >. Definition at line 95 of file AxisAngle.h. References gmtl::set.
00097 { 00098 VecBase<DATA_TYPE, 4>::set( rad_angle, x, y, z ); 00099 } |
|
set the angle (twist) part of the AxisAngle, as a radian value.
Definition at line 122 of file AxisAngle.h.
00123 { 00124 VecBase<DATA_TYPE, 4>::operator[]( 0 ) = rad_angle; 00125 } |
|
set the axis portion of the AxisAngle.
Definition at line 111 of file AxisAngle.h.
00112 { 00113 VecBase<DATA_TYPE, 4>::operator[]( 1 ) = axis[0]; 00114 VecBase<DATA_TYPE, 4>::operator[]( 2 ) = axis[1]; 00115 VecBase<DATA_TYPE, 4>::operator[]( 3 ) = axis[2]; 00116 } |