Translation Class Reference

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

Functions

 Translation ()
 Default constructor. More...
 
 Translation (const Translation &translation)
 Copy constructor (deep copy). More...
 
 Translation (float t1, float t2, float t3)
 Constructor. More...
 
 Translation (float3 in)
 Constructor from an sl::float3. More...
 
Translation operator* (const Orientation &mat) const
 Multiplication operator by an Orientation. More...
 
void normalize ()
 Normalizes the current sl::Translation. More...
 
float & operator() (int x)
 Gets the value at specific position in the sl::Translation. More...
 
_FCT_CPU_GPU_ int size () const
 Return the size of the sl::Vector3. More...
 
_FCT_CPU_GPU_ const float * ptr () const
 Returns a pointer of the first component. More...
 
_FCT_CPU_GPU_ Vector3< float > & setValues (const float *b)
 Sets the components of the sl::Vector3 to the values of the argument. More...
 
_FCT_CPU_GPU_ float & operator[] (int i)
 Returns the i-th component. More...
 
_FCT_CPU_GPU_ float norm ()
 Returns the norm of the sl::Vector3. More...
 
_FCT_CPU_GPU_ float square ()
 Returns the squared norm of the sl::Vector3. More...
 
_FCT_CPU_GPU_ float sum ()
 Returns the sum of the components of the sl::Vector3. More...
 

Static Functions

static Translation normalize (const Translation &tr)
 Gets the normalized sl::Translation of a given sl::Translation. More...
 
static _FCT_CPU_GPU_ float dot (const Vector3< float > &a, const Vector3< float > &b)
 Returns the dot product of two sl::Vector3. More...
 
static _FCT_CPU_GPU_ float distance (const Vector3< float > &a, const Vector3< float > &b)
 Returns the distance between two sl::Vector3. More...
 
static _FCT_CPU_GPU_ Vector3< float > cross (const Vector3< float > &a, const Vector3< float > &b)
 Returns the cross product between two sl::Vector3. More...
 

Detailed Description

Class representing a translation for the positional tracking module.

sl::Translation is a vector as [tx, ty, tz].
You can access the data with the 't' ptr or by element name as : tx, ty, tz <-> | 0 1 2 |

Constructor and Destructor

◆ Translation() [1/4]

Default constructor.

Creates a null translation.

◆ Translation() [2/4]

Translation ( const Translation translation)

Copy constructor (deep copy).

Parameters
translation: sl::Translation to copy.

◆ Translation() [3/4]

Translation ( float  t1,
float  t2,
float  t3 
)

Constructor.

Parameters
t1: x component of the translation.
t2: y component of the translation.
t3: z component of the translation.

◆ Translation() [4/4]

Constructor from an sl::float3.

Parameters
in: sl::float3 to copy.

Functions

◆ operator*()

Translation operator* ( const Orientation mat) const

Multiplication operator by an Orientation.

Parameters
mat: Orientation.
Returns
The current Translation after being multiplied by the orientation.

◆ normalize() [1/2]

void normalize ( )

Normalizes the current sl::Translation.

◆ normalize() [2/2]

static Translation normalize ( const Translation tr)
static

Gets the normalized sl::Translation of a given sl::Translation.

Parameters
tr: sl::Translation to be get the normalized translation from.
Returns
Another sl::Translation object equal to tr.normalize().

◆ operator()()

float& operator() ( int  x)

Gets the value at specific position in the sl::Translation.

Parameters
x: Position of the value.
Returns
Value at the x position.

◆ size()

_FCT_CPU_GPU_ int size ( ) const
inlineinherited

Return the size of the sl::Vector3.

Returns
3

◆ ptr()

_FCT_CPU_GPU_ const float * ptr ( ) const
inlineinherited

Returns a pointer of the first component.

◆ setValues()

_FCT_CPU_GPU_ Vector3<float >& setValues ( const float *  b)
inlineinherited

Sets the components of the sl::Vector3 to the values of the argument.

◆ operator[]()

_FCT_CPU_GPU_ float & operator[] ( int  i)
inlineinherited

Returns the i-th component.

◆ norm()

_FCT_CPU_GPU_ float norm ( )
inlineinherited

Returns the norm of the sl::Vector3.

◆ square()

_FCT_CPU_GPU_ float square ( )
inlineinherited

Returns the squared norm of the sl::Vector3.

◆ sum()

_FCT_CPU_GPU_ float sum ( )
inlineinherited

Returns the sum of the components of the sl::Vector3.

◆ dot()

static _FCT_CPU_GPU_ float dot ( const Vector3< float > &  a,
const Vector3< float > &  b 
)
inlinestaticinherited

Returns the dot product of two sl::Vector3.

◆ distance()

static _FCT_CPU_GPU_ float distance ( const Vector3< float > &  a,
const Vector3< float > &  b 
)
inlinestaticinherited

Returns the distance between two sl::Vector3.

◆ cross()

static _FCT_CPU_GPU_ Vector3<float > cross ( const Vector3< float > &  a,
const Vector3< float > &  b 
)
inlinestaticinherited

Returns the cross product between two sl::Vector3.