Transform Class Reference

Designed to contain translation and rotation data of the positional tracking. More...

Functions

 Transform ()
 Transform default constructor. More...
 
 Transform (const Transform &motion)
 Transform copy constructor (deep copy). More...
 
 Transform (const Matrix4f &mat)
 Transform copy constructor (deep copy). More...
 
 Transform (const Rotation &rotation, const Translation &translation)
 Transform constructor from a Rotation and a Translation. More...
 
 Transform (const Orientation &orientation, const Translation &translation)
 Transform constructor from an Orientation and a Translation. More...
 
void setRotationMatrix (const Rotation &rotation)
 Sets the rotation of the current Transform from an Rotation. More...
 
Rotation getRotationMatrix () const
 Returns the Rotation of the current Transform. More...
 
void setTranslation (const Translation &translation)
 Sets the translation of the current Transform from an Translation. More...
 
Translation getTranslation () const
 Returns the Translation of the current Transform. More...
 
void setOrientation (const Orientation &orientation)
 Sets the orientation of the current Transform from an Orientation. More...
 
Orientation getOrientation () const
 Returns the Orientation of the current Transform. 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 3x3 of the Transform with a 3x1 rotation vector (using Rodrigues' transformation). More...
 
float3 getEulerAngles (bool radian=true) const
 Convert the Rotation of the Transform as Euler angles. More...
 
void setEulerAngles (const float3 &euler_angles, bool radian=true)
 Sets the Rotation of the Transform from the Euler angles. More...
 
Matrix4f operator* (const Matrix4f &mat) const
 
Matrix4f operator* (const Vector4< float > &vect) const
 
Matrix4f operator* (const float &scalar) const
 
Matrix4f operator+ (const Matrix4f &mat) const
 
Matrix4f operator+ (const float &scalar) const
 
Matrix4f operator- (const Matrix4f &mat) const
 
Matrix4f operator- (const float &scalar) const
 
bool operator== (const Matrix4f &mat) const
 
bool operator!= (const Matrix4f &mat) const
 
float & operator() (int u, int v)
 Gets access to a specific point in the Matrix4f (read / write). More...
 
ERROR_CODE inverse ()
 Sets the Matrix4f to its inverse. More...
 
void transpose ()
 Sets the Matrix4f to its transpose. More...
 
void setIdentity ()
 Sets the Matrix4f to identity. More...
 
void setZeros ()
 Sets the Matrix4f to zero. More...
 
ERROR_CODE setSubMatrix3f (Matrix3f input, int row=0, int column=0)
 Sets a 3x3 Matrix inside the Matrix4f. More...
 
ERROR_CODE setSubVector3f (Vector3< float > input, int column=3)
 Sets a 3x1 Vector inside the Matrix4f at the specified column index. More...
 
ERROR_CODE setSubVector4f (Vector4< float > input, int column=3)
 Sets a 4x1 Vector inside the Matrix4f at the specified column index. More...
 
String getInfos ()
 Returns the components of the Matrix4f in a String. More...
 

Static Functions

static Matrix4f inverse (const Matrix4f &mat)
 Creates the inverse of a Matrix4f. More...
 
static Matrix4f transpose (const Matrix4f &mat)
 Creates the transpose of a Matrix4f. More...
 
static Matrix4f identity ()
 Creates an identity Matrix4f. More...
 
static Matrix4f zeros ()
 Creates a Matrix4f filled with zeros. More...
 

Attributes

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

Detailed Description

Designed to contain translation and rotation data of the positional tracking.

It contains the orientation as well. It can be used to create any type of Matrix4x4 or Matrix4f that must be specifically used for handling a rotation and position information (OpenGL, Tracking...) It inherits from the generic Matrix4f

Constructor and Destructor

◆ Transform() [1/5]

Transform ( )

Transform default constructor.

◆ Transform() [2/5]

Transform ( const Transform motion)

Transform copy constructor (deep copy).

Parameters
motion: the Transform to copy.

◆ Transform() [3/5]

Transform ( const Matrix4f mat)

Transform copy constructor (deep copy).

Parameters
mat: the Matrix4f to copy.

◆ Transform() [4/5]

Transform ( const Rotation rotation,
const Translation translation 
)

Transform constructor from a Rotation and a Translation.

Parameters
rotation: the Rotation to copy.
translation: the Translation to copy.

◆ Transform() [5/5]

Transform ( const Orientation orientation,
const Translation translation 
)

Transform constructor from an Orientation and a Translation.

Parameters
orientation: the Orientation to copy.
translation: the Translation to copy.

Functions

◆ setRotationMatrix()

void setRotationMatrix ( const Rotation rotation)

Sets the rotation of the current Transform from an Rotation.

Parameters
rotation: the Rotation to be used.

◆ getRotationMatrix()

Rotation getRotationMatrix ( ) const

Returns the Rotation of the current Transform.

Returns
The Rotation created from the Transform values.
Warning
The given Rotation contains a copy of the Transform values. Not references.

◆ setTranslation()

void setTranslation ( const Translation translation)

Sets the translation of the current Transform from an Translation.

Parameters
translation: the Translation to be used.

◆ getTranslation()

Translation getTranslation ( ) const

Returns the Translation of the current Transform.

Returns
The Translation created from the Transform values.
Warning
The given Translation contains a copy of the Transform values. Not references.

◆ setOrientation()

void setOrientation ( const Orientation orientation)

Sets the orientation of the current Transform from an Orientation.

Parameters
orientation: the Orientation to be used.

◆ getOrientation()

Orientation getOrientation ( ) const

Returns the Orientation of the current Transform.

Returns
The Orientation created from the Transform values.
Warning
The given Orientation contains a copy of the Transform values. Not references.

◆ 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 3x3 of the Transform with a 3x1 rotation vector (using Rodrigues' transformation).

Parameters
vec_rot: vector that contains the rotation value for each axis (rx,ry,rz).

◆ getEulerAngles()

float3 getEulerAngles ( bool  radian = true) const

Convert the Rotation of the Transform as Euler angles.

Parameters
radian: Define 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 of the Transform from the Euler angles.

Parameters
euler_angles: The Euler angles, as a float3
radian: Define if the angle in is radian or degree

◆ operator*() [1/3]

Matrix4f operator* ( const Matrix4f mat) const
inherited

brief Gives the result of the multiplication between two Matrix4f.

◆ operator*() [2/3]

Matrix4f operator* ( const Vector4< float > &  vect) const
inherited

brief Gives the result of the multiplication between a Matrix4f and a float4.

◆ operator*() [3/3]

Matrix4f operator* ( const float &  scalar) const
inherited

brief Gives the result of the multiplication between a Matrix4f and a scalar.

◆ operator+() [1/2]

Matrix4f operator+ ( const Matrix4f mat) const
inherited

brief Gives the result of the addition between two Matrix4f.

◆ operator+() [2/2]

Matrix4f operator+ ( const float &  scalar) const
inherited

brief Gives the result of the addition between a Matrix4f and a scalar.

◆ operator-() [1/2]

Matrix4f operator- ( const Matrix4f mat) const
inherited

brief Gives the result of the subtraction between two Matrix4f.

◆ operator-() [2/2]

Matrix4f operator- ( const float &  scalar) const
inherited

brief Gives the result of the subtraction between a Matrix4f and a scalar.

◆ operator==()

bool operator== ( const Matrix4f mat) const
inherited

brief Tests two Matrix4f equality.

◆ operator!=()

bool operator!= ( const Matrix4f mat) const
inherited

brief Tests two Matrix4f inequality.

◆ operator()()

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

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

Parameters
u: specify the row.
v: specify the column.
Returns
The value at the u, v coordinates.

◆ inverse() [1/2]

ERROR_CODE inverse ( )
inherited

Sets the Matrix4f to its inverse.

Returns
SUCCESS if the inverse has been computed, ERROR_CODE.FAILURE is not (det = 0).

◆ inverse() [2/2]

static Matrix4f inverse ( const Matrix4f mat)
staticinherited

Creates the inverse of a Matrix4f.

Parameters
mat: the Matrix4f to compute the inverse from.
Returns
The inverse of the given Matrix4f.

◆ transpose() [1/2]

void transpose ( )
inherited

Sets the Matrix4f to its transpose.

◆ transpose() [2/2]

static Matrix4f transpose ( const Matrix4f mat)
staticinherited

Creates the transpose of a Matrix4f.

Parameters
mat: the Matrix4f to compute the transpose from.
Returns
The transpose of the given Matrix4f.

◆ setIdentity()

void setIdentity ( )
inherited

Sets the Matrix4f to identity.

◆ identity()

static Matrix4f identity ( )
staticinherited

Creates an identity Matrix4f.

Returns
A Matrix4f set to identity.

◆ setZeros()

void setZeros ( )
inherited

Sets the Matrix4f to zero.

◆ zeros()

static Matrix4f zeros ( )
staticinherited

Creates a Matrix4f filled with zeros.

Returns
A Matrix4f set to zero.

◆ setSubMatrix3f()

ERROR_CODE setSubMatrix3f ( Matrix3f  input,
int  row = 0,
int  column = 0 
)
inherited

Sets a 3x3 Matrix inside the Matrix4f.

Note
Can be used to set the rotation matrix when the matrix4f is a pose or an isometric matrix.
Parameters
input: sub matrix to put inside the Matrix4f.
row: index of the row to start the 3x3 block. Must be 0 or 1.
column: index of the column to start the 3x3 block. Must be 0 or 1.
Returns
SUCCESS if everything went well, ERROR_CODE_FAILURE otherwise.

◆ setSubVector3f()

ERROR_CODE setSubVector3f ( Vector3< float >  input,
int  column = 3 
)
inherited

Sets a 3x1 Vector inside the Matrix4f at the specified column index.

Note
Can be used to set the Translation/Position matrix when the matrix4f is a pose or an isometry.
Parameters
input: sub vector to put inside the Matrix4f.
column: index of the column to start the 3x3 block. By default, it is the last column (translation for a Pose).
Returns
SUCCESS if everything went well, ERROR_CODE_FAILURE otherwise.

◆ setSubVector4f()

ERROR_CODE setSubVector4f ( Vector4< float >  input,
int  column = 3 
)
inherited

Sets a 4x1 Vector inside the Matrix4f at the specified column index.

Note
Can be used to set the Translation/Position matrix when the matrix4f is a pose or an isometry.
Parameters
input: sub vector to put inside the Matrix4f.
column: index of the column to start the 3x3 block. By default, it is the last column (translation for a Pose).
Returns
SUCCESS if everything went well, ERROR_CODE_FAILURE otherwise.

◆ getInfos()

String getInfos ( )
inherited

Returns the components of the Matrix4f in a String.

Returns
A String containing the components of the current Matrix4f.

Variables

◆ matrix_name

String matrix_name
inherited

Name of the matrix (optional).