Matrix3f Class Reference

Represents a generic 3*3 matrix. More...

Functions

 Matrix3f ()
 Matrix3f default constructor. More...
 
 Matrix3f (float data[])
 Matrix3f copy constructor (deep copy). More...
 
 Matrix3f (const Matrix3f &mat)
 Matrix3f copy constructor (deep copy). More...
 
Matrix3f operator* (const Matrix3f &mat) const
 Gives the result of the multiplication between two Matrix3f. More...
 
Matrix3f operator* (const float &scalar) const
 Gives the result of the multiplication between a Matrix3f and a scalar. More...
 
Matrix3f operator+ (const Matrix3f &mat) const
 Gives the result of the addition between two Matrix3f. More...
 
Matrix3f operator+ (const float &scalar) const
 Gives the result of the addition between a Matrix3f and a scalar. More...
 
Matrix3f operator- (const Matrix3f &mat) const
 Gives the result of the subtraction between two Matrix3f. More...
 
Matrix3f operator- (const float &scalar) const
 Gives the result of the subtraction between a Matrix3f and a scalar. More...
 
bool operator== (const Matrix3f &mat) const
 Test two Matrix3f equality. More...
 
bool operator!= (const Matrix3f &mat) const
 Test two Matrix3f inequality. More...
 
float & operator() (int u, int v)
 Gets access to a specific point in the Matrix3f (read / write). More...
 
void inverse ()
 Sets the Matrix3f to its inverse. More...
 
void transpose ()
 Sets the Matrix3f to its transpose. More...
 
void setIdentity ()
 Sets the Matrix3f to identity. More...
 
void setZeros ()
 Sets the Matrix3f to zero. More...
 
String getInfos ()
 Returns the components of the Matrix3f in a String. More...
 

Static Functions

static Matrix3f inverse (const Matrix3f &rotation)
 Returns the inverse of a Matrix3f. More...
 
static Matrix3f transpose (const Matrix3f &rotation)
 Returns the transpose of a Matrix3f. More...
 
static Matrix3f identity ()
 Creates an identity Matrix3f. More...
 
static Matrix3f zeros ()
 Creates a Matrix3f filled with zeros. More...
 

Attributes

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

Detailed Description

Represents 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. You can access the data with the 'r' ptr or by element attribute.

r00 r01 r02
r10 r11 r12
r20 r21 r22

Constructor and Destructor

◆ Matrix3f() [1/3]

Matrix3f ( )

Matrix3f default constructor.

◆ Matrix3f() [2/3]

Matrix3f ( float  data[])

Matrix3f copy constructor (deep copy).

◆ Matrix3f() [3/3]

Matrix3f ( const Matrix3f mat)

Matrix3f copy constructor (deep copy).

Parameters
mat: the Matrix3f to copy.

Functions

◆ operator*() [1/2]

Matrix3f operator* ( const Matrix3f mat) const

Gives the result of the multiplication between two Matrix3f.

◆ operator*() [2/2]

Matrix3f operator* ( const float &  scalar) const

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

◆ operator+() [1/2]

Matrix3f operator+ ( const Matrix3f mat) const

Gives the result of the addition between two Matrix3f.

◆ operator+() [2/2]

Matrix3f operator+ ( const float &  scalar) const

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

◆ operator-() [1/2]

Matrix3f operator- ( const Matrix3f mat) const

Gives the result of the subtraction between two Matrix3f.

◆ operator-() [2/2]

Matrix3f operator- ( const float &  scalar) const

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

◆ operator==()

bool operator== ( const Matrix3f mat) const

Test two Matrix3f equality.

◆ operator!=()

bool operator!= ( const Matrix3f mat) const

Test two Matrix3f inequality.

◆ operator()()

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

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

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

◆ inverse() [1/2]

void inverse ( )

Sets the Matrix3f to its inverse.

◆ inverse() [2/2]

static Matrix3f inverse ( const Matrix3f rotation)
static

Returns the inverse of a Matrix3f.

Parameters
rotation: the Matrix3f to compute the inverse from.
Returns
The inverse of the given Matrix3f

◆ transpose() [1/2]

void transpose ( )

Sets the Matrix3f to its transpose.

◆ transpose() [2/2]

static Matrix3f transpose ( const Matrix3f rotation)
static

Returns the transpose of a Matrix3f.

Parameters
rotation: the Matrix3f to compute the transpose from.
Returns
The transpose of the given Matrix3f

◆ setIdentity()

void setIdentity ( )

Sets the Matrix3f to identity.

◆ identity()

static Matrix3f identity ( )
static

Creates an identity Matrix3f.

Returns
A Matrix3f set to identity.

◆ setZeros()

void setZeros ( )

Sets the Matrix3f to zero.

◆ zeros()

static Matrix3f zeros ( )
static

Creates a Matrix3f filled with zeros.

Returns
A Matrix3f set to zero.

◆ getInfos()

String getInfos ( )

Returns the components of the Matrix3f in a String.

Returns
A String containing the components of the current Matrix3f.

Variables

◆ matrix_name

String matrix_name

Name of the matrix (optional).