Matrix4f Class Reference

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

Functions

None init_matrix (self, Matrix4f matrix)
 Copy the values from another sl.Matrix4f. More...
 
ERROR_CODE inverse (self)
 Sets the sl.Matrix4f to its inverse. More...
 
Matrix4f inverse_mat (self, Matrix4f rotation)
 Returns the inverse of a sl.Matrix4f. More...
 
None transpose (self)
 Sets the sl.Matrix4f to its transpose.
 
Matrix4f transpose_mat (self, Matrix4f rotation)
 Returns the transpose of a sl.Matrix4f. More...
 
Matrix4f set_identity (self)
 Sets the sl.Matrix4f to identity. More...
 
Matrix4f identity (self)
 Creates an identity sl.Matrix4f. More...
 
None set_zeros (self)
 Sets the sl.Matrix4f to zero.
 
Matrix4f zeros (self)
 Creates a sl.Matrix4f filled with zeros. More...
 
str get_infos (self)
 Returns the components of the sl.Matrix4f in a string. More...
 
ERROR_CODE set_sub_matrix3f (self, Matrix3f input, row=0, column=0)
 Sets a sl.Matrix3f inside the sl.Matrix4f. More...
 
ERROR_CODE set_sub_vector3f (self, float input0, float input1, float input2, column=3)
 Sets a 3x1 Vector inside the sl.Matrix4f at the specified column index. More...
 
ERROR_CODE set_sub_vector4f (self, float input0, float input1, float input2, float input3, column=3)
 Sets a 4x1 Vector inside the sl.Matrix4f at the specified column index. More...
 
str matrix_name (self)
 Returns the name of the matrix (optional).
 
np.numpy[float][float] m (self)
 4*4 numpy array of inner data.
 

Detailed Description

Class representing a generic 4*4 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() method.

r00 r01 r02 tx
r10 r11 r12 ty
r20 r21 r22 tz
m30 m31 m32 m33

Functions

◆ init_matrix()

None init_matrix (   self,
Matrix4f  matrix 
)

Copy the values from another sl.Matrix4f.

Parameters
matrix: sl.Matrix4f to copy.

Reimplemented in Transform.

◆ inverse()

ERROR_CODE inverse (   self)

Sets the sl.Matrix4f to its inverse.

Returns
sl.ERROR_CODE.SUCCESS if the inverse has been computed, sl.ERROR_CODE.FAILURE is not (det = 0).

◆ inverse_mat()

Matrix4f inverse_mat (   self,
Matrix4f  rotation 
)

Returns the inverse of a sl.Matrix4f.

Parameters
rotation: sl.Matrix4f to compute the inverse from.
Returns
The inverse of the sl.Matrix4f given as input.

◆ transpose_mat()

Matrix4f transpose_mat (   self,
Matrix4f  rotation 
)

Returns the transpose of a sl.Matrix4f.

Parameters
rotation: sl.Matrix4f to compute the transpose from.
Returns
The transpose of the sl.Matrix4f given as input.

◆ set_identity()

Matrix4f set_identity (   self)

Sets the sl.Matrix4f to identity.

Returns
itself

◆ identity()

Matrix4f identity (   self)

Creates an identity sl.Matrix4f.

Returns
A sl.Matrix3f set to identity.

◆ zeros()

Matrix4f zeros (   self)

Creates a sl.Matrix4f filled with zeros.

Returns
A sl.Matrix4f filled with zeros.

◆ get_infos()

str get_infos (   self)

Returns the components of the sl.Matrix4f in a string.

Returns
A string containing the components of the current sl.Matrix4f.

Referenced by Matrix4f.m(), and Mat.verbose().

◆ set_sub_matrix3f()

ERROR_CODE set_sub_matrix3f (   self,
Matrix3f  input,
  row = 0,
  column = 0 
)

Sets a sl.Matrix3f inside the sl.Matrix4f.

Note
Can be used to set the rotation matrix when the sl.Matrix4f is a pose or an isometric matrix.
Parameters
input: Sub-matrix to put inside the sl.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
sl.ERROR_CODE.SUCCESS if everything went well, sl.ERROR_CODE.FAILURE otherwise.

◆ set_sub_vector3f()

ERROR_CODE set_sub_vector3f (   self,
float  input0,
float  input1,
float  input2,
  column = 3 
)

Sets a 3x1 Vector inside the sl.Matrix4f at the specified column index.

Note
Can be used to set the translation/position matrix when the sl.Matrix4f is a pose or an isometry.
Parameters
input0: First value of the 3x1 Vector to put inside the sl.Matrix4f.
input1: Second value of the 3x1 Vector to put inside the sl.Matrix4f.
input2: Third value of the 3x1 Vector to put inside the sl.Matrix4f.
column: Index of the column to start the 3x3 block. By default, it is the last column (translation for a sl.Pose).
Returns
sl.ERROR_CODE.SUCCESS if everything went well, sl.ERROR_CODE.FAILURE otherwise.

◆ set_sub_vector4f()

ERROR_CODE set_sub_vector4f (   self,
float  input0,
float  input1,
float  input2,
float  input3,
  column = 3 
)

Sets a 4x1 Vector inside the sl.Matrix4f at the specified column index.

Parameters
input0: First value of the 4x1 Vector to put inside the sl.Matrix4f.
input1: Second value of the 4x1 Vector to put inside the sl.Matrix4f.
input2: Third value of the 4x1 Vector to put inside the sl.Matrix4f.
input3: Fourth value of the 4x1 Vector to put inside the sl.Matrix4f.
column: Index of the column to start the 3x3 block. By default, it is the last column (translation for a sl.Pose).
Returns
sl.ERROR_CODE.SUCCESS if everything went well, sl.ERROR_CODE.FAILURE otherwise.