Rotation Class Reference

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

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
 Converts 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 Matrix3f 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() [1/5]

Rotation ( )

empty Rotation default constructor.

◆ Rotation() [2/5]

Rotation ( const Rotation rotation)

Rotation copy constructor (deep copy).

Parameters
rotation: the Rotation to copy.

◆ Rotation() [3/5]

Rotation ( const Matrix3f mat)

Rotation copy constructor (deep copy).

Parameters
mat: the mat to copy.

◆ Rotation() [4/5]

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() [5/5]

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

◆ setOrientation()

void setOrientation ( const Orientation orientation)

Sets the Rotation from an Orientation.

Parameters
orientation: the Orientation containing the rotation to set.

◆ getOrientation()

Orientation getOrientation ( ) const

Returns the Orientation corresponding to the current Rotation.

Returns
The rotation of the current orientation.

◆ getRotationVector()

float3 getRotationVector ( )

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

Returns
The rotation vector.

◆ setRotationVector()

void setRotationVector ( const float3 vec_rot)

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

Parameters
vec_rot: the rotation Vector.

◆ getEulerAngles()

float3 getEulerAngles ( bool  radian = true) const

Converts the Rotation as Euler angles.

Parameters
radian: Defines if the angle in is radian or degree
Returns
The Euler angles, as a float3 representing the rotations around the X, Y and Z axes. (YZX convention)

◆ setEulerAngles()

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
radian: Defines if the angle in is radian or degree

◆ operator*() [1/2]

Matrix3f operator* ( const Matrix3f mat) const
inherited

Gives the result of the multiplication between two Matrix3f.

◆ operator*() [2/2]

Matrix3f operator* ( const float &  scalar) const
inherited

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

◆ operator+() [1/2]

Matrix3f operator+ ( const Matrix3f mat) const
inherited

Gives the result of the addition between two Matrix3f.

◆ operator+() [2/2]

Matrix3f operator+ ( const float &  scalar) const
inherited

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

◆ operator-() [1/2]

Matrix3f operator- ( const Matrix3f mat) const
inherited

Gives the result of the subtraction between two Matrix3f.

◆ operator-() [2/2]

Matrix3f operator- ( const float &  scalar) const
inherited

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

◆ operator==()

bool operator== ( const Matrix3f mat) const
inherited

Test two Matrix3f equality.

◆ operator!=()

bool operator!= ( const Matrix3f mat) const
inherited

Test two Matrix3f inequality.

◆ operator()()

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.

◆ inverse() [1/2]

void inverse ( )
inherited

Sets the Matrix3f to its inverse.

◆ inverse() [2/2]

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

◆ transpose() [1/2]

void transpose ( )
inherited

Sets the Matrix3f to its transpose.

◆ transpose() [2/2]

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

◆ setIdentity()

void setIdentity ( )
inherited

Sets the Matrix3f to identity.

◆ identity()

static Matrix3f identity ( )
staticinherited

Creates an identity Matrix3f.

Returns
A Matrix3f set to identity.

◆ setZeros()

void setZeros ( )
inherited

Sets the Matrix3f to zero.

◆ zeros()

static Matrix3f zeros ( )
staticinherited

Creates a Matrix3f filled with zeros.

Returns
A Matrix3f set to zero.

◆ getInfos()

String getInfos ( )
inherited

Returns the components of the Matrix3f in a String.

Returns
A String containing the components of the current Matrix3f.

Variables

◆ matrix_name

String matrix_name
inherited

Name of the matrix (optional).