Rotation Class Reference

Class representing a rotation for the positional tracking module. More...

Functions

 Rotation ()
 Default constructor. More...
 
 Rotation (const Rotation &rotation)
 Copy constructor (deep copy). More...
 
 Rotation (const Matrix3f &mat)
 sl::Rotation constructor from an sl::Matrix3f. More...
 
 Rotation (const Orientation &orientation)
 sl::Rotation constructor from an sl::Orientation. More...
 
 Rotation (const float angle, const Translation &axis)
 sl::Rotation constructor from an angle and an axis. More...
 
void setOrientation (const Orientation &orientation)
 Sets the sl::Rotation from an sl::Orientation. More...
 
Orientation getOrientation () const
 Returns the sl::Orientation corresponding to the current sl::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 sl::Rotation from a rotation vector (using Rodrigues' transformation). More...
 
float3 getEulerAngles (bool radian=true) const
 Converts the sl::Rotation into Euler angles. More...
 
void setEulerAngles (const float3 &euler_angles, bool radian=true)
 Sets the sl::Rotation from Euler angles. More...
 
Matrix3f operator* (const Matrix3f &mat) const
 Gives the result of the multiplication between two sl::Matrix3f. More...
 
Matrix3f operator* (const float &scalar) const
 Gives the result of the multiplication between a sl::Matrix3f and a scalar. More...
 
Matrix3f operator+ (const Matrix3f &mat) const
 Gives the result of the addition between two sl::Matrix3f. More...
 
Matrix3f operator+ (const float &scalar) const
 Gives the result of the addition between a sl::Matrix3f and a scalar. More...
 
Matrix3f operator- (const Matrix3f &mat) const
 Gives the result of the subtraction between two sl::Matrix3f. More...
 
Matrix3f operator- (const float &scalar) const
 Gives the result of the subtraction between a sl::Matrix3f and a scalar. More...
 
bool operator== (const Matrix3f &mat) const
 Test two sl::Matrix3f equality. More...
 
bool operator!= (const Matrix3f &mat) const
 Test two sl::Matrix3f inequality. More...
 
float & operator() (int u, int v)
 Gets access to a specific point in the sl::Matrix3f (read/write). More...
 
void inverse ()
 Sets the sl::Matrix3f to its inverse. More...
 
void transpose ()
 Sets the sl::Matrix3f to its transpose. More...
 
void setIdentity ()
 Sets the sl::Matrix3f to identity. More...
 
void setZeros ()
 Sets the sl::Matrix3f to zero. More...
 
String getInfos ()
 Returns the components of the sl::Matrix3f in a sl::String. More...
 

Static Functions

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

Attributes

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

Detailed Description

Class representing a rotation for the positional tracking module.

It inherits from the generic sl::Matrix3f class.

Constructor and Destructor

◆ Rotation() [1/5]

Rotation ( )

Default constructor.

Creates a null rotation.

◆ Rotation() [2/5]

Rotation ( const Rotation rotation)

Copy constructor (deep copy).

Parameters
rotation: sl::Rotation to copy.

◆ Rotation() [3/5]

Rotation ( const Matrix3f &  mat)

sl::Rotation constructor from an sl::Matrix3f.

Copies the sl::Matrix3f (deep copy).

Parameters
mat: sl::Matrix3f to copy.

◆ Rotation() [4/5]

Rotation ( const Orientation orientation)

sl::Rotation constructor from an sl::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 
)

sl::Rotation constructor from an angle and an axis.

Parameters
angle: Rotation angle in radian.
axis: 3D axis to rotate around.

Functions

◆ setOrientation()

void setOrientation ( const Orientation orientation)

Sets the sl::Rotation from an sl::Orientation.

Parameters
orientation: sl::Orientation containing the rotation to set.

◆ getOrientation()

Orientation getOrientation ( ) const

Returns the sl::Orientation corresponding to the current sl::Rotation.

Returns
Rotation of the current orientation.

◆ getRotationVector()

float3 getRotationVector ( )

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

Returns
Rotation vector created from the sl::Orientation values.

◆ setRotationVector()

void setRotationVector ( const float3 &  vec_rot)

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

Parameters
vec_rot: Vector containing the rotation value for each axis (rx, ry, rz).

◆ getEulerAngles()

float3 getEulerAngles ( bool  radian = true) const

Converts the sl::Rotation into Euler angles.

Parameters
radian: Whether the angle will be returned in radian or degree.
Returns
Euler angles created from the sl::Rotation values representing the rotations around the X, Y and Z axes using YZX convention.

◆ setEulerAngles()

void setEulerAngles ( const float3 &  euler_angles,
bool  radian = true 
)

Sets the sl::Rotation from Euler angles.

Parameters
euler_angles: Euler angles (as a sl::float3) to update the sl::Rotation.
radian: Whether the angle is in radian or degree.

◆ operator*() [1/2]

Matrix3f operator* ( const Matrix3f &  mat) const
inherited

Gives the result of the multiplication between two sl::Matrix3f.

◆ operator*() [2/2]

Matrix3f operator* ( const float &  scalar) const
inherited

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

◆ operator+() [1/2]

Matrix3f operator+ ( const Matrix3f &  mat) const
inherited

Gives the result of the addition between two sl::Matrix3f.

◆ operator+() [2/2]

Matrix3f operator+ ( const float &  scalar) const
inherited

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

◆ operator-() [1/2]

Matrix3f operator- ( const Matrix3f &  mat) const
inherited

Gives the result of the subtraction between two sl::Matrix3f.

◆ operator-() [2/2]

Matrix3f operator- ( const float &  scalar) const
inherited

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

◆ operator==()

bool operator== ( const Matrix3f &  mat) const
inherited

Test two sl::Matrix3f equality.

◆ operator!=()

bool operator!= ( const Matrix3f &  mat) const
inherited

Test two sl::Matrix3f inequality.

◆ operator()()

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

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

Parameters
u: Row to get the value from.
v: Column to get the value from.
Returns
The value at the u, v coordinates.

◆ inverse() [1/2]

void inverse ( )
inherited

Sets the sl::Matrix3f to its inverse.

◆ inverse() [2/2]

static Matrix3f inverse ( const Matrix3f &  rotation)
staticinherited

Returns the inverse of a sl::Matrix3f.

Parameters
rotation: sl::Matrix3f to compute the inverse from.
Returns
The inverse of the sl::Matrix3f given as input.

◆ transpose() [1/2]

void transpose ( )
inherited

Sets the sl::Matrix3f to its transpose.

◆ transpose() [2/2]

static Matrix3f transpose ( const Matrix3f &  rotation)
staticinherited

Returns the transpose of a sl::Matrix3f.

Parameters
rotation: sl::Matrix3f to compute the transpose from.
Returns
The transpose of the sl::Matrix3f given as input.

◆ setIdentity()

void setIdentity ( )
inherited

Sets the sl::Matrix3f to identity.

◆ identity()

static Matrix3f identity ( )
staticinherited

Creates an identity sl::Matrix3f.

Returns
A sl::Matrix3f set to identity.

◆ setZeros()

void setZeros ( )
inherited

Sets the sl::Matrix3f to zero.

◆ zeros()

static Matrix3f zeros ( )
staticinherited

Creates a sl::Matrix3f filled with zeros.

Returns
A sl::Matrix3f filled with zeros.

◆ getInfos()

String getInfos ( )
inherited

Returns the components of the sl::Matrix3f in a sl::String.

Returns
A sl::String containing the components of the current sl::Matrix3f.

Variables

◆ matrix_name

String matrix_name
inherited

Name of the matrix (optional).