Rotation Class Reference

Designed to contain rotation data of the positional tracking. It inherits from the generic Matrix3f. More...

General Functions

 Rotation ()
 empty Rotation default constructor. More...
 
 Rotation (const Rotation &rotation)
 Rotation copy constructor (deep copy). More...
 
 Rotation (const Matrix3f &mat)
 Rotation copy constructor (deep copy). More...
 
 Rotation (const Orientation &orientation)
 Rotation constructor from an Orientation. More...
 
 Rotation (const float angle, const Translation &axis)
 Creates a Rotation representing the 3D rotation of angle around an arbitrary 3D axis. More...
 
void setOrientation (const Orientation &orientation)
 Sets the Rotation from an Orientation. More...
 
Orientation getOrientation () const
 Returns the Orientation corresponding to the current Rotation. More...
 
float3 getRotationVector ()
 Returns the 3x1 rotation vector obtained from 3x3 rotation matrix using Rodrigues formula. More...
 
void setRotationVector (const float3 &vec_rot)
 Sets the Rotation from a rotation vector (using Rodrigues' transformation). More...
 
float3 getEulerAngles (bool radian=true) const
 Convert the Rotation as Euler angles. More...
 
void setEulerAngles (const float3 &euler_angles, bool radian=true)
 Sets the Rotation from the Euler angles. More...
 
Matrix3f operator* (const Matrix3f &mat) const
 Gives the result of the multiplication between two Matrix3f. More...
 
Matrix3f operator* (const float &scalar) const
 Gives the result of the multiplication between a Matrix3f and a scalar. More...
 
Matrix3f operator+ (const Matrix3f &mat) const
 Gives the result of the addition between two Matrix3f. More...
 
Matrix3f operator+ (const float &scalar) const
 Gives the result of the addition between a Matrix3f and a scalar. More...
 
Matrix3f operator- (const Matrix3f &mat) const
 Gives the result of the subtraction between two Matrix3f. More...
 
Matrix3f operator- (const float &scalar) const
 Gives the result of the subtraction between a Matrix3f and a scalar. More...
 
bool operator== (const Matrix3f &mat) const
 Test two Matrix3f equality. More...
 
bool operator!= (const Matrix3f &mat) const
 Test two Matrix3f inequality. More...
 
float & operator() (int u, int v)
 Gets access to a specific point in the Matrix3f (read / write). More...
 
void inverse ()
 Sets the Matrix3f to its inverse. More...
 
void transpose ()
 Sets the RotationArray to its transpose. More...
 
void setIdentity ()
 Sets the Matrix3f to identity. More...
 
void setZeros ()
 Sets the Matrix3f to zero. More...
 
String getInfos ()
 Returns the components of the Matrix3f in a String. More...
 

Static Functions

static Matrix3f inverse (const Matrix3f &rotation)
 Returns the inverse of a Matrix3f. More...
 
static Matrix3f transpose (const Matrix3f &rotation)
 Returns the transpose of a Matrix3f. More...
 
static Matrix3f identity ()
 Creates an identity Matrix3f. More...
 
static Matrix3f zeros ()
 Creates a Matrix3f filled with zeros. More...
 

Attributes

String matrix_name
 Name of the matrix (optional). More...
 

Detailed Description

Designed to contain rotation data of the positional tracking. It inherits from the generic Matrix3f.

Constructor and Destructor

Rotation ( )

empty Rotation default constructor.

Rotation ( const Rotation rotation)

Rotation copy constructor (deep copy).

Parameters
rotation: the Rotation to copy.
Rotation ( const Matrix3f mat)

Rotation copy constructor (deep copy).

Parameters
mat: the mat to copy.
Rotation ( const Orientation orientation)

Rotation constructor from an Orientation.

It converts the Orientation representation to the Rotation one.

Parameters
orientation: the Orientation to be used.
Rotation ( const float  angle,
const Translation axis 
)

Creates a Rotation representing the 3D rotation of angle around an arbitrary 3D axis.

Parameters
angle: the rotation angle in rad.
axis: the 3D axis to rotate around.

Functions

void setOrientation ( const Orientation orientation)

Sets the Rotation from an Orientation.

Parameters
orientation: the Orientation containing the rotation to set.
Orientation getOrientation ( ) const

Returns the Orientation corresponding to the current Rotation.

Returns
The rotation of the current orientation.
float3 getRotationVector ( )

Returns the 3x1 rotation vector obtained from 3x3 rotation matrix using Rodrigues formula.

Returns
The rotation vector.
void setRotationVector ( const float3 vec_rot)

Sets the Rotation from a rotation vector (using Rodrigues' transformation).

Parameters
vec_rot: the Rotation Vector.
float3 getEulerAngles ( bool  radian = true) const

Convert the Rotation as Euler angles.

Parameters
radian: Define if the angle in is radian or degree
Returns
The Euler angles, as a float3 representing the rotations arround the X, Y and Z axes.
void setEulerAngles ( const float3 euler_angles,
bool  radian = true 
)

Sets the Rotation from the Euler angles.

Parameters
euler_angles: The Euler angles, as a float3 (x=roll, y=pitch, z=yaw)
radian: Define if the angle in is radian or degree
Matrix3f operator* ( const Matrix3f mat) const
inherited

Gives the result of the multiplication between two Matrix3f.

Matrix3f operator* ( const float &  scalar) const
inherited

Gives the result of the multiplication between a Matrix3f and a scalar.

Matrix3f operator+ ( const Matrix3f mat) const
inherited

Gives the result of the addition between two Matrix3f.

Matrix3f operator+ ( const float &  scalar) const
inherited

Gives the result of the addition between a Matrix3f and a scalar.

Matrix3f operator- ( const Matrix3f mat) const
inherited

Gives the result of the subtraction between two Matrix3f.

Matrix3f operator- ( const float &  scalar) const
inherited

Gives the result of the subtraction between a Matrix3f and a scalar.

bool operator== ( const Matrix3f mat) const
inherited

Test two Matrix3f equality.

bool operator!= ( const Matrix3f mat) const
inherited

Test two Matrix3f inequality.

float& operator() ( int  u,
int  v 
)
inherited

Gets access to a specific point in the Matrix3f (read / write).

Parameters
u: specify the row
v: specify the column
Returns
The value at the u, v coordinates.
void inverse ( )
inherited

Sets the Matrix3f to its inverse.

static Matrix3f inverse ( const Matrix3f rotation)
staticinherited

Returns the inverse of a Matrix3f.

Parameters
rotation: the Matrix3f to compute the inverse from.
Returns
The inverse of the given Matrix3f
void transpose ( )
inherited

Sets the RotationArray to its transpose.

static Matrix3f transpose ( const Matrix3f rotation)
staticinherited

Returns the transpose of a Matrix3f.

Parameters
rotation: the Matrix3f to compute the transpose from.
Returns
The transpose of the given Matrix3f
void setIdentity ( )
inherited

Sets the Matrix3f to identity.

static Matrix3f identity ( )
staticinherited

Creates an identity Matrix3f.

Returns
A Matrix3f set to identity.
void setZeros ( )
inherited

Sets the Matrix3f to zero.

static Matrix3f zeros ( )
staticinherited

Creates a Matrix3f filled with zeros.

Returns
A Matrix3f set to zero.

Referenced by Camera::isOpened().

String getInfos ( )
inherited

Returns the components of the Matrix3f in a String.

Returns
A String containing the components of the current Matix3f.

Variables

String matrix_name
inherited

Name of the matrix (optional).