Transform Class Reference

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

General 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 setRotation (const Rotation &rotation)
 Sets the rotation of the current Transform from an Rotation. More...
 
Rotation getRotation () 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 ( )

Transform default constructor.

Transform ( const Transform motion)

Transform copy constructor (deep copy).

Parameters
motion: the Transform to copy.
Transform ( const Matrix4f mat)

Transform copy constructor (deep copy).

Parameters
mat: the Matrix4f to copy.
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 ( 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

void setRotationMatrix ( const Rotation rotation)

Sets the rotation of the current Transform from an Rotation.

Parameters
rotation: the Rotation to be used.
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.
void setRotation ( const Rotation rotation)
inline

Sets the rotation of the current Transform from an Rotation.

Parameters
rotation: the Rotation to be used.
Deprecated:
See setRotationMatrix
Rotation getRotation ( ) const
inline

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.
Deprecated:
See getRotationMatrix
void setTranslation ( const Translation translation)

Sets the translation of the current Transform from an Translation.

Parameters
translation: the Translation to be used.
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.
void setOrientation ( const Orientation orientation)

Sets the orientation of the current Transform from an Orientation.

Parameters
orientation: the Orientation to be used.
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.
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 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).
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 arround the X, Y and Z axes.
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 (x=roll, y=pitch, z=yaw)
radian: Define if the angle in is radian or degree
Matrix4f operator* ( const Matrix4f mat) const
inherited

brief Gives the result of the multiplication between two Matrix4f.

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

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

Matrix4f operator* ( const float &  scalar) const
inherited

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

Matrix4f operator+ ( const Matrix4f mat) const
inherited

brief Gives the result of the addition between two Matrix4f.

Matrix4f operator+ ( const float &  scalar) const
inherited

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

Matrix4f operator- ( const Matrix4f mat) const
inherited

brief Gives the result of the subtraction between two Matrix4f.

Matrix4f operator- ( const float &  scalar) const
inherited

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

bool operator== ( const Matrix4f mat) const
inherited

brief Tests two Matrix4f equality.

bool operator!= ( const Matrix4f mat) const
inherited

brief Tests two Matrix4f inequality.

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.
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).
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.
void transpose ( )
inherited

Sets the Matrix4f to its transpose.

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.
void setIdentity ( )
inherited

Sets the Matrix4f to identity.

static Matrix4f identity ( )
staticinherited

Creates an identity Matrix4f.

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

Sets the Matrix4f to zero.

static Matrix4f zeros ( )
staticinherited

Creates a Matrix4f filled with zeros.

Returns
A Matrix4f set to zero.
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.
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.
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.
String getInfos ( )
inherited

Returns the components of the Matrix4f in a String.

Returns
A String containing the components of the current Matrix4f.

Variables

String matrix_name
inherited

Name of the matrix (optional).