Python Reference Guide
 
Loading...
Searching...
No Matches
FBMatrix Class Reference

FBMatrix class. More...

#include <pyfbsdk.h>

Inheritance diagram for FBMatrix:

Public Member Functions

 FBMatrix (list pValue)
 Constructor.
 
 FBMatrix (FBMatrix pMatrix)
 Copy Constructor.
 
 Identity ()
 Load identity matrix.
 
 Set (list pValue)
 Set matrix from an array.
 
int __len__ ()
 Returns the number of elements.
 
float __getitem__ (int pIndex)
 Returns the ith component Corresponds to python: print matrix[1].
 
 __setitem__ (int pIndex, float pComponentValue)
 Sets the ith components Corresponds to python: color[1] = 0.5.
 
 FBMatrix ()
 Constructor Initializes matrix to identity.
 
 FBMatrix (list pValue)
 Constructor.
 
 FBMatrix (FBMatrix pMatrix)
 Copy Constructor.
 
FBMatrix Inverse ()
 Get Inversed matrix.
 
FBMatrix InverseProduct (FBMatrix pMatrix)
 InverseProduct Matrix.
 
FBMatrix Transpose ()
 Get Transposed matrix.
 
bool Validate ()
 Validated matrix.
 

Detailed Description

FBMatrix class.

Four x Four (double) Matrix.

This class creates a list like object, which can be modified using the list protocol method. But unlike lists, its length is fixed: it always contain 16 floating point values. Thus it does not support the any list methods that would affect its length. The values within can be changed, usually via the bracket operator.

# Supported list protocol methods:
mat = FBMatrix()
len(mat)
print mat[13]
mat[12] = 1.0
FBMatrix()
Constructor Initializes matrix to identity.
Warning
The implementation of this 4x4 matrix uses a simple list of 16 elements, not a list of 4 vectors of 4 elements.*
Slicing is not supported by this object.


See samples: Matrix.py, FreezeLocalRotation.py.

Constructor & Destructor Documentation

◆ FBMatrix() [1/5]

FBMatrix ( list  pValue)

Constructor.


Parameters
pValueArray to intialize matrix from.

◆ FBMatrix() [2/5]

FBMatrix ( FBMatrix  pMatrix)

Copy Constructor.


Parameters
pMatrixMatrix to copy.

◆ FBMatrix() [3/5]

FBMatrix ( )

Constructor Initializes matrix to identity.

◆ FBMatrix() [4/5]

FBMatrix ( list  pValue)

Constructor.

Parameters
pValueArray to intialize matrix from.

◆ FBMatrix() [5/5]

FBMatrix ( FBMatrix  pMatrix)

Copy Constructor.

Parameters
pMatrixMatrix to copy.

Member Function Documentation

◆ __getitem__()

float __getitem__ ( int  pIndex)

Returns the ith component Corresponds to python: print matrix[1].

Parameters
pIndexIndex of the components to get (0 to 15)
Returns
Matrix element value

◆ __len__()

int __len__ ( )

Returns the number of elements.

Corresponds to python: len(object)

◆ __setitem__()

__setitem__ ( int  pIndex,
float  pComponentValue 
)

Sets the ith components Corresponds to python: color[1] = 0.5.

Parameters
pIndexIndex of the components to set (0 to 15)
pComponentValueValue of component to set

◆ Identity()

Identity ( )

Load identity matrix.


◆ Inverse()

FBMatrix Inverse ( )

Get Inversed matrix.

Returns
the matrix Inversed.

◆ InverseProduct()

FBMatrix InverseProduct ( FBMatrix  pMatrix)

InverseProduct Matrix.

Parameters
pMatrixMatrix to Product.
Returns
result matrix.

◆ Set()

Set ( list  pValue)

Set matrix from an array.


Parameters
pValueArray to intialize matrix from.

◆ Transpose()

FBMatrix Transpose ( )

Get Transposed matrix.

Returns
the matrix Transposed.

◆ Validate()

bool Validate ( )

Validated matrix.

Returns
true if matrix Validated.