Matrix4f Class Reference

Represents a generic fourth-dimensional matrix. More...

Functions

def init_matrix (self, Matrix4f matrix)
 Creates a Matrix4f from another Matrix4f (deep copy) More...
 
def inverse (self)
 Inverses the matrix.
 
def inverse_mat (self, Matrix4f rotation)
 Inverses the Matrix4f passed as a parameter. More...
 
def transpose (self)
 Sets the Matrix4f to its transpose.
 
def transpose_mat (self, Matrix4f rotation)
 Returns the transpose of a Matrix4f. More...
 
def set_identity (self)
 Sets the Matrix4f to identity. More...
 
def identity (self)
 Creates an identity Matrix4f. More...
 
def set_zeros (self)
 Sets the Matrix4f to zero.
 
def zeros (self)
 Creates a Matrix4f filled with zeros. More...
 
def get_infos (self)
 Returns the components of the Matrix4f in a string. More...
 
def set_sub_matrix3f (self, Matrix3f input, row=0, column=0)
 Sets a 3x3 Matrix inside the Matrix4f. More...
 
def set_sub_vector3f (self, float input0, float input1, float input2, column=3)
 Sets a 3x1 Vector inside the Matrix4f at the specifided column index. More...
 
def set_sub_vector4f (self, float input0, float input1, float input2, float input3, column=3)
 Sets a 4x1 Vector inside the Matrix4f at the specifided column index. More...
 
def matrix_name (self)
 Returns the name of the matrix (optional).
 
def m (self)
 Access to the content of the Matrix4f as a numpy array or list.
 

Detailed Description

Represents a generic fourth-dimensional 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 by the 'm' ptr or by the element attribute.

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

Functions

◆ init_matrix()

def init_matrix (   self,
Matrix4f  matrix 
)

Creates a Matrix4f from another Matrix4f (deep copy)

Parameters
matrix: the Matrix4f to copy

Reimplemented in Transform.

◆ inverse_mat()

def inverse_mat (   self,
Matrix4f  rotation 
)

Inverses the Matrix4f passed as a parameter.

Parameters
rotation: the Matrix4f to inverse
Returns
the inversed Matrix4f

◆ transpose_mat()

def transpose_mat (   self,
Matrix4f  rotation 
)

Returns the transpose of a Matrix4f.

Parameters
rotation: the Matrix4f to compute the transpose from.
Returns
the transposed Matrix4f

◆ set_identity()

def set_identity (   self)

Sets the Matrix4f to identity.

Returns
itself

◆ identity()

def identity (   self)

Creates an identity Matrix4f.

Returns
A Matrix4f set to identity

◆ zeros()

def zeros (   self)

Creates a Matrix4f filled with zeros.

Returns
A Matrix4f filled with zeros.

◆ get_infos()

def get_infos (   self)

Returns the components of the Matrix4f in a string.

Returns
A string containing the components of the current Matrix4f

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

◆ set_sub_matrix3f()

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

Sets a 3x3 Matrix inside the Matrix4f.

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

◆ set_sub_vector3f()

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

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

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

◆ set_sub_vector4f()

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

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

Parameters
input0: first value of the 4x1 Vector to put inside the Matrix4f
input1: second value of the 4x1 Vector to put inside the Matrix4f
input2: third value of the 4x1 Vector to put inside the Matrix4f
input3: fourth value of the 4x1 Vector to put inside the Matrix4f
column: index of the column to start the 3x3 block. By default, it is the last column (translation for a Pose ).
Returns
ERROR_CODE.SUCCESS if everything went well, ERROR_CODE.FAILURE otherwise.