Matrix3f Class Reference

Class representing a generic 3*3 matrix. More...

Functions

 Matrix3f ()
 Default constructor. More...
 
 Matrix3f (float data[])
 Copy constructor (deep copy). More...
 
 Matrix3f (const Matrix3f &mat)
 Cpy constructor (deep copy). 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 generic 3*3 matrix.

It is defined in a row-major order, it means that, in the value buffer, the entire first row is stored first, followed by the entire second row, and so on.
The data value of the matrix can be accessed with the 'r' ptr or by element attribute.

r00 r01 r02
r10 r11 r12
r20 r21 r22

Constructor and Destructor

◆ Matrix3f() [1/3]

Matrix3f ( )

Default constructor.

◆ Matrix3f() [2/3]

Matrix3f ( float  data[])

Copy constructor (deep copy).

◆ Matrix3f() [3/3]

Matrix3f ( const Matrix3f mat)

Cpy constructor (deep copy).

Parameters
mat: sl::Matrix3f to copy.

Functions

◆ operator*() [1/2]

Matrix3f operator* ( const Matrix3f mat) const

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

◆ operator*() [2/2]

Matrix3f operator* ( const float &  scalar) const

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

◆ operator+() [1/2]

Matrix3f operator+ ( const Matrix3f mat) const

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

◆ operator+() [2/2]

Matrix3f operator+ ( const float &  scalar) const

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

◆ operator-() [1/2]

Matrix3f operator- ( const Matrix3f mat) const

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

◆ operator-() [2/2]

Matrix3f operator- ( const float &  scalar) const

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

◆ operator==()

bool operator== ( const Matrix3f mat) const

Test two sl::Matrix3f equality.

◆ operator!=()

bool operator!= ( const Matrix3f mat) const

Test two sl::Matrix3f inequality.

◆ operator()()

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

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 ( )

Sets the sl::Matrix3f to its inverse.

◆ inverse() [2/2]

static Matrix3f inverse ( const Matrix3f rotation)
static

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 ( )

Sets the sl::Matrix3f to its transpose.

◆ transpose() [2/2]

static Matrix3f transpose ( const Matrix3f rotation)
static

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 ( )

Sets the sl::Matrix3f to identity.

◆ identity()

static Matrix3f identity ( )
static

Creates an identity sl::Matrix3f.

Returns
A sl::Matrix3f set to identity.

◆ setZeros()

void setZeros ( )

Sets the sl::Matrix3f to zero.

◆ zeros()

static Matrix3f zeros ( )
static

Creates a sl::Matrix3f filled with zeros.

Returns
A sl::Matrix3f filled with zeros.

◆ getInfos()

String getInfos ( )

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

Name of the matrix (optional).