Orientation Class Reference

Class representing an orientation/quaternion for the positional tracking module. More...

Functions

 Orientation ()
 Default constructor. More...
 
 Orientation (const Orientation &orientation)
 Copy constructor (deep copy). More...
 
 Orientation (const float4 &in)
 Copy constructor (deep copy). More...
 
 Orientation (const Rotation &rotation)
 Constructor from an sl::Rotation. More...
 
 Orientation (const Translation &tr1, const Translation &tr2)
 Constructor from a vector represented by two sl::Translation. More...
 
float operator() (int x)
 Gets the value at specific position in the sl::Orientation. More...
 
Orientation operator* (const Orientation &orientation) const
 Multiplication operator by an sl::Orientation. More...
 
void setRotationMatrix (const Rotation &rotation)
 Sets the sl::Orientation from an sl::Rotation. More...
 
Rotation getRotationMatrix () const
 Returns the current sl::Orientation as an sl::Rotation. More...
 
void setIdentity ()
 Sets the current sl::Orientation to identity. More...
 
void setZeros ()
 Fills the current sl::Orientation with zeros. More...
 
void normalise ()
 Normalizes the current sl::Orientation. More...
 
_FCT_CPU_GPU_ int size () const
 Return the size of the sl::Vector4. More...
 
_FCT_CPU_GPU_ const float * ptr () const
 Returns a pointer of the first component. More...
 
_FCT_CPU_GPU_ Vector4< float > & setValues (const float *b)
 Sets the components of the sl::Vector1 to the values of the argument. More...
 
_FCT_CPU_GPU_ float & operator[] (const unsigned int i)
 Returns the i-th component. More...
 
_FCT_CPU_GPU_ const float & operator[] (const unsigned int i) const
 Returns the i-th component. More...
 
_FCT_CPU_GPU_ void operator[] (const unsigned int i) &&=delete
 Prevent operator from being called by temporaries (such as rvalue) More...
 
_FCT_CPU_GPU_ float norm ()
 Returns the norm of the sl::Vector4. More...
 
_FCT_CPU_GPU_ float square ()
 Returns the squared norm of the sl::Vector4. More...
 
_FCT_CPU_GPU_ float sum ()
 Returns the sum of the components of the sl::Vector4. More...
 

Static Functions

static Orientation identity ()
 Creates an sl::Orientation initialized to identity. More...
 
static Orientation zeros ()
 Creates an sl::Orientation filled with zeros. More...
 
static Orientation normalise (const Orientation &orient)
 Gets the normalized sl::Orientation of a given sl::Orientation. More...
 
static _FCT_CPU_GPU_ float dot (const Vector4< float > &a, const Vector4< float > &b)
 Returns the dot product of two sl::Vector4. More...
 
static _FCT_CPU_GPU_ float distance (const Vector4< float > &a, const Vector4< float > &b)
 Returns the distance between two sl::Vector4. More...
 

Detailed Description

Class representing an orientation/quaternion for the positional tracking module.

sl::Orientation is a vector defined as [ox, oy, oz, ow].

Constructor and Destructor

◆ Orientation() [1/5]

Default constructor.

Creates an identity orientation.

◆ Orientation() [2/5]

Orientation ( const Orientation orientation)

Copy constructor (deep copy).

Parameters
orientation: sl::Orientation to copy.

◆ Orientation() [3/5]

Orientation ( const float4 &  in)

Copy constructor (deep copy).

Parameters
in: sl::float4 to copy.

◆ Orientation() [4/5]

Orientation ( const Rotation rotation)

Constructor from an sl::Rotation.

It converts the sl::Rotation representation to the sl::Orientation one.

Parameters
rotation: sl::Rotation to be used.

◆ Orientation() [5/5]

Orientation ( const Translation tr1,
const Translation tr2 
)

Constructor from a vector represented by two sl::Translation.

Parameters
tr1: First point of the vector.
tr2: Second point of the vector.

Functions

◆ operator()()

float operator() ( int  x)

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

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

◆ operator*()

Orientation operator* ( const Orientation orientation) const

Multiplication operator by an sl::Orientation.

Parameters
orientation: sl.Orientation to multiply the current one with.
Returns
The result of the multiplication between current sl.Orientation and the one given as input.

◆ setRotationMatrix()

void setRotationMatrix ( const Rotation rotation)

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

Parameters
rotation: sl::Rotation to be used.

◆ getRotationMatrix()

Rotation getRotationMatrix ( ) const

Returns the current sl::Orientation as an sl::Rotation.

Returns
The rotation computed from the orientation data.

◆ setIdentity()

void setIdentity ( )

Sets the current sl::Orientation to identity.

◆ identity()

static Orientation identity ( )
static

Creates an sl::Orientation initialized to identity.

Returns
Identity sl::Orientation.

◆ setZeros()

void setZeros ( )

Fills the current sl::Orientation with zeros.

◆ zeros()

static Orientation zeros ( )
static

Creates an sl::Orientation filled with zeros.

Returns
sl::Orientation filled with zeros.

◆ normalise() [1/2]

void normalise ( )

Normalizes the current sl::Orientation.

◆ normalise() [2/2]

static Orientation normalise ( const Orientation orient)
static

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

Parameters
orient: sl::Orientation to be get the normalized orientation from.
Returns
Another sl::Orientation object equal to orient.normalize().

◆ size()

_FCT_CPU_GPU_ int size ( ) const
inlineinherited

Return the size of the sl::Vector4.

Returns
4

◆ ptr()

_FCT_CPU_GPU_ const float * ptr ( ) const
inlineinherited

Returns a pointer of the first component.

◆ setValues()

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

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

◆ operator[]() [1/3]

_FCT_CPU_GPU_ float & operator[] ( const unsigned int  i)
inlineinherited

Returns the i-th component.

◆ operator[]() [2/3]

_FCT_CPU_GPU_ const float & operator[] ( const unsigned int  i) const
inlineinherited

Returns the i-th component.

◆ operator[]() [3/3]

_FCT_CPU_GPU_ void operator[] ( const unsigned int  i) &&
deleteinherited

Prevent operator from being called by temporaries (such as rvalue)

◆ norm()

_FCT_CPU_GPU_ float norm ( )
inlineinherited

Returns the norm of the sl::Vector4.

◆ square()

_FCT_CPU_GPU_ float square ( )
inlineinherited

Returns the squared norm of the sl::Vector4.

◆ sum()

_FCT_CPU_GPU_ float sum ( )
inlineinherited

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

◆ dot()

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

Returns the dot product of two sl::Vector4.

◆ distance()

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

Returns the distance between two sl::Vector4.