FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxMatrix Class Reference

#include <fbxmatrix.h>

Class Description

FBX SDK basic 4x4 double matrix class.

Examples:
ExportScene01/main.cxx, ImportScene/DisplayPose.cxx, SwitchBinding/main.cxx, and ViewScene/GetPosition.cxx.

Definition at line 27 of file fbxmatrix.h.

+ Inheritance diagram for FbxMatrix:

Constructors and Destructor

 FbxMatrix ()
 Constructor (initialize to an identity matrix) More...
 
 FbxMatrix (const FbxMatrix &pM)
 Copy constructor. More...
 
 FbxMatrix (const FbxAMatrix &pM)
 Copy constructor for affine matrix. More...
 
 FbxMatrix (const FbxVector4 &pT, const FbxVector4 &pR, const FbxVector4 &pS)
 TRS Constructor. More...
 
 FbxMatrix (const FbxVector4 &pT, const FbxQuaternion &pQ, const FbxVector4 &pS)
 TQS Constructor. More...
 
 FbxMatrix (const double p00, const double p10, const double p20, const double p30, const double p01, const double p11, const double p21, const double p31, const double p02, const double p12, const double p22, const double p32, const double p03, const double p13, const double p23, const double p33)
 16 double constructor. More...
 
 ~FbxMatrix ()
 Destructor. More...
 

Access

double Get (int pY, int pX) const
 Retrieve matrix element. More...
 
FbxVector4 GetRow (int pY) const
 Extract a row vector. More...
 
FbxVector4 GetColumn (int pX) const
 Extract a column vector. More...
 
void Set (int pY, int pX, double pValue)
 Set matrix element. More...
 
void SetTRS (const FbxVector4 &pT, const FbxVector4 &pR, const FbxVector4 &pS)
 Set matrix. More...
 
void SetTQS (const FbxVector4 &pT, const FbxQuaternion &pQ, const FbxVector4 &pS)
 Set matrix. More...
 
void SetRow (int pY, const FbxVector4 &pRow)
 Set a matrix row. More...
 
void SetColumn (int pX, const FbxVector4 &pColumn)
 Set a matrix column. More...
 
void GetElements (FbxVector4 &pTranslation, FbxQuaternion &pRotation, FbxVector4 &pShearing, FbxVector4 &pScaling, double &pSign) const
 Decompose the affine matrix into elements of translation, rotation, shearing, scaling and sign of determinant. More...
 
void GetElements (FbxVector4 &pTranslation, FbxVector4 &pRotation, FbxVector4 &pShearing, FbxVector4 &pScaling, double &pSign) const
 Decompose the affine matrix into elements of translation, rotation, shearing, scaling and sign of determinant. More...
 

Operators

FbxMatrixoperator= (const FbxMatrix &pMatrix)
 Assignment operator. More...
 
FbxMatrix operator- () const
 Unary minus operator. More...
 
FbxMatrix operator+ (const FbxMatrix &pMatrix) const
 Add two matrices together. More...
 
FbxMatrix operator- (const FbxMatrix &pMatrix) const
 Subtract a matrix from another matrix. More...
 
FbxMatrix operator* (const FbxMatrix &pMatrix) const
 Multiply two matrices. More...
 
FbxMatrixoperator+= (const FbxMatrix &pMatrix)
 Add two matrices together. More...
 
FbxMatrixoperator-= (const FbxMatrix &pMatrix)
 Subtract a matrix from another matrix. More...
 
FbxMatrixoperator*= (const FbxMatrix &pMatrix)
 Multiply two matrices. More...
 
bool operator== (const FbxMatrix &pM) const
 Equivalence operator. More...
 
bool operator== (const FbxAMatrix &pM) const
 Equivalence operator. More...
 
bool operator!= (const FbxMatrix &pM) const
 Non-equivalence operator. More...
 
bool operator!= (const FbxAMatrix &pM) const
 Non-equivalence operator. More...
 

Casting

typedef const double(kDouble44)[4][4]
 Define 4*4 array as a new type. More...
 
 operator double * ()
 Cast the vector in a double pointer. More...
 
 operator const double * () const
 Cast the vector in a const double pointer. More...
 
kDouble44 & Double44 () const
 Cast the matrix in a reference to a 4*4 array. More...
 

Math Operations

FbxMatrix Inverse () const
 Calculate the matrix inverse. More...
 
FbxMatrix Transpose () const
 Calculate the matrix transpose. More...
 
void SetIdentity ()
 Set matrix to identity. More...
 
void SetLookToLH (const FbxVector4 &pEyePosition, const FbxVector4 &pEyeDirection, const FbxVector4 &pUpDirection)
 Set the matrix to a "Look To" left handed. More...
 
void SetLookToRH (const FbxVector4 &pEyePosition, const FbxVector4 &pEyeDirection, const FbxVector4 &pUpDirection)
 Set the matrix to a "Look To" right handed. More...
 
void SetLookAtLH (const FbxVector4 &pEyePosition, const FbxVector4 &pLookAt, const FbxVector4 &pUpDirection)
 Set the matrix to a "Look At" left handed. More...
 
void SetLookAtRH (const FbxVector4 &pEyePosition, const FbxVector4 &pLookAt, const FbxVector4 &pUpDirection)
 Set the matrix values as a "Look At" right handed. More...
 
FbxVector4 MultNormalize (const FbxVector4 &pVector) const
 Multiply this matrix by pVector, the w component is normalized to 1. More...
 

Additional Inherited Members

- Public Member Functions inherited from FbxVectorTemplate4< T >
 FbxVectorTemplate4 ()
 
 FbxVectorTemplate4 (T pValue)
 
 FbxVectorTemplate4 (T pData0, T pData1, T pData2, T pData3)
 
 ~FbxVectorTemplate4 ()
 
T & operator[] (int pIndex)
 
const T & operator[] (int pIndex) const
 
 operator FbxVectorTemplate3< T > & () const
 
FbxVectorTemplate4< T > & operator= (const T &pValue)
 
FbxVectorTemplate4< T > & operator= (const FbxVectorTemplate3< T > &pValue)
 
FbxVectorTemplate4< T > & operator= (const FbxVectorTemplate4< T > &pVector)
 
bool operator== (const FbxVectorTemplate4< T > &pVector) const
 
bool operator!= (const FbxVectorTemplate4< T > &pVector) const
 
T * Buffer ()
 
const T * Buffer () const
 
- Public Attributes inherited from FbxVectorTemplate4< T >
mData [4]
 

Member Typedef Documentation

◆ double

typedef const double(kDouble44)[4][4]

Define 4*4 array as a new type.

Definition at line 214 of file fbxmatrix.h.

Constructor & Destructor Documentation

◆ FbxMatrix() [1/6]

FbxMatrix ( )

Constructor (initialize to an identity matrix)

◆ FbxMatrix() [2/6]

FbxMatrix ( const FbxMatrix pM)

Copy constructor.

Parameters
pMAnother FbxMatrix object copied to this one.

◆ FbxMatrix() [3/6]

FbxMatrix ( const FbxAMatrix pM)

Copy constructor for affine matrix.

Parameters
pMAffine matrix

◆ FbxMatrix() [4/6]

FbxMatrix ( const FbxVector4 pT,
const FbxVector4 pR,
const FbxVector4 pS 
)

TRS Constructor.

Parameters
pTTranslation vector.
pREuler rotation vector.
pSScale vector.

◆ FbxMatrix() [5/6]

FbxMatrix ( const FbxVector4 pT,
const FbxQuaternion pQ,
const FbxVector4 pS 
)

TQS Constructor.

Parameters
pTTranslation vector.
pQQuaternion.
pSScale vector.

◆ FbxMatrix() [6/6]

FbxMatrix ( const double  p00,
const double  p10,
const double  p20,
const double  p30,
const double  p01,
const double  p11,
const double  p21,
const double  p31,
const double  p02,
const double  p12,
const double  p22,
const double  p32,
const double  p03,
const double  p13,
const double  p23,
const double  p33 
)

16 double constructor.

Parameters
p00Value at column 0 row 0.
p10Value at column 1 row 0.
p20Value at column 2 row 0.
p30Value at column 3 row 0.
p01Value at column 0 row 1.
p11Value at column 1 row 1.
p21Value at column 2 row 1.
p31Value at column 3 row 1.
p02Value at column 0 row 2.
p12Value at column 1 row 2.
p22Value at column 2 row 2.
p32Value at column 3 row 2.
p03Value at column 0 row 3.
p13Value at column 1 row 3.
p23Value at column 2 row 3.
p33Value at column 3 row 3.

◆ ~FbxMatrix()

~FbxMatrix ( )

Destructor.

Member Function Documentation

◆ Get()

double Get ( int  pY,
int  pX 
) const

Retrieve matrix element.

Parameters
pYRow index.
pXColumn index.
Returns
Value at element [ pX, pY ] of the matrix.

◆ GetRow()

FbxVector4 GetRow ( int  pY) const

Extract a row vector.

Parameters
pYRow index.
Returns
The row vector.
Examples:
ImportScene/DisplayPose.cxx.

◆ GetColumn()

FbxVector4 GetColumn ( int  pX) const

Extract a column vector.

Parameters
pXColumn index.
Returns
The column vector.

◆ Set()

void Set ( int  pY,
int  pX,
double  pValue 
)

Set matrix element.

Parameters
pYRow index.
pXColumn index.
pValueNew component value.

◆ SetTRS()

void SetTRS ( const FbxVector4 pT,
const FbxVector4 pR,
const FbxVector4 pS 
)

Set matrix.

Parameters
pTTranslation vector.
pREuler rotation vector.
pSScale vector.
Examples:
ExportScene01/main.cxx.

◆ SetTQS()

void SetTQS ( const FbxVector4 pT,
const FbxQuaternion pQ,
const FbxVector4 pS 
)

Set matrix.

Parameters
pTTranslation vector.
pQQuaternion.
pSScale vector.

◆ SetRow()

void SetRow ( int  pY,
const FbxVector4 pRow 
)

Set a matrix row.

Parameters
pYRow index.
pRowRow vector.

◆ SetColumn()

void SetColumn ( int  pX,
const FbxVector4 pColumn 
)

Set a matrix column.

Parameters
pXColumn index.
pColumnColumn vector.

◆ GetElements() [1/2]

void GetElements ( FbxVector4 pTranslation,
FbxQuaternion pRotation,
FbxVector4 pShearing,
FbxVector4 pScaling,
double pSign 
) const

Decompose the affine matrix into elements of translation, rotation, shearing, scaling and sign of determinant.

Parameters
pTranslationTranslation element.
pRotationRotation element.
pShearingShearing element.
pScalingScaling element.
pSignSign of determinant.

◆ GetElements() [2/2]

void GetElements ( FbxVector4 pTranslation,
FbxVector4 pRotation,
FbxVector4 pShearing,
FbxVector4 pScaling,
double pSign 
) const

Decompose the affine matrix into elements of translation, rotation, shearing, scaling and sign of determinant.

Parameters
pTranslationTranslation element.
pRotationRotation element.
pShearingShearing element.
pScalingScaling element.
pSignSign of determinant.

◆ operator=()

FbxMatrix& operator= ( const FbxMatrix pMatrix)

Assignment operator.

Parameters
pMatrixSource matrix.

◆ operator-() [1/2]

FbxMatrix operator- ( ) const

Unary minus operator.

Returns
A matrix where each element is multiplied by -1.

◆ operator+()

FbxMatrix operator+ ( const FbxMatrix pMatrix) const

Add two matrices together.

Parameters
pMatrixA matrix.
Returns
The result of this matrix + pMatrix.

◆ operator-() [2/2]

FbxMatrix operator- ( const FbxMatrix pMatrix) const

Subtract a matrix from another matrix.

Parameters
pMatrixA matrix.
Returns
The result of this matrix - pMatrix.

◆ operator*()

FbxMatrix operator* ( const FbxMatrix pMatrix) const

Multiply two matrices.

Parameters
pMatrixA matrix.
Returns
The result of this matrix * pMatrix.

◆ operator+=()

FbxMatrix& operator+= ( const FbxMatrix pMatrix)

Add two matrices together.

Parameters
pMatrixA matrix.
Returns
The result of this matrix + pMatrix, replacing this matrix.

◆ operator-=()

FbxMatrix& operator-= ( const FbxMatrix pMatrix)

Subtract a matrix from another matrix.

Parameters
pMatrixA matrix.
Returns
The result of this matrix - pMatrix, replacing this matrix.

◆ operator*=()

FbxMatrix& operator*= ( const FbxMatrix pMatrix)

Multiply two matrices.

Parameters
pMatrixA matrix.
Returns
The result of this matrix * pMatrix, replacing this matrix.

◆ operator==() [1/2]

bool operator== ( const FbxMatrix pM) const

Equivalence operator.

Parameters
pMThe matrix to be compared against this matrix.
Returns
true if the two matrices are equal (each element is within a FBXSDK_TOLERANCE tolerance), false otherwise.

◆ operator==() [2/2]

bool operator== ( const FbxAMatrix pM) const

Equivalence operator.

Parameters
pMThe affine matrix to be compared against this matrix.
Returns
true if the two matrices are equal (each element is within a FBXSDK_TOLERANCE tolerance), false otherwise.

◆ operator!=() [1/2]

bool operator!= ( const FbxMatrix pM) const

Non-equivalence operator.

Parameters
pMThe matrix to be compared against this matrix.
Returns
false if the two matrices are equal (each element is within a FBXSDK_TOLERANCE tolerance), true otherwise.

◆ operator!=() [2/2]

bool operator!= ( const FbxAMatrix pM) const

Non-equivalence operator.

Parameters
pMThe affine matrix to be compared against this matrix.
Returns
false if the two matrices are equal (each element is within a FBXSDK_TOLERANCE tolerance), true otherwise.

◆ operator double *()

operator double * ( )

Cast the vector in a double pointer.

◆ operator const double *()

operator const double * ( ) const

Cast the vector in a const double pointer.

◆ Double44()

kDouble44& Double44 ( ) const
inline

Cast the matrix in a reference to a 4*4 array.

Definition at line 217 of file fbxmatrix.h.

217 { return *((kDouble44 *)&mData[0][0]); }

◆ Inverse()

FbxMatrix Inverse ( ) const

Calculate the matrix inverse.

Returns
The inverse matrix.

◆ Transpose()

FbxMatrix Transpose ( ) const

Calculate the matrix transpose.

Returns
This matrix transposed.

◆ SetIdentity()

void SetIdentity ( )

Set matrix to identity.

◆ SetLookToLH()

void SetLookToLH ( const FbxVector4 pEyePosition,
const FbxVector4 pEyeDirection,
const FbxVector4 pUpDirection 
)

Set the matrix to a "Look To" left handed.

Parameters
pEyePositionThe position of the eye.
pEyeDirectionThe direction of the eye.
pUpDirectionThe up direction of the eye.

◆ SetLookToRH()

void SetLookToRH ( const FbxVector4 pEyePosition,
const FbxVector4 pEyeDirection,
const FbxVector4 pUpDirection 
)

Set the matrix to a "Look To" right handed.

Parameters
pEyePositionThe position of the eye.
pEyeDirectionThe direction of the eye.
pUpDirectionThe up direction of the eye.

◆ SetLookAtLH()

void SetLookAtLH ( const FbxVector4 pEyePosition,
const FbxVector4 pLookAt,
const FbxVector4 pUpDirection 
)

Set the matrix to a "Look At" left handed.

Parameters
pEyePositionThe position of the eye.
pLookAtThe look at position of the eye focus.
pUpDirectionThe up direction of the eye.

◆ SetLookAtRH()

void SetLookAtRH ( const FbxVector4 pEyePosition,
const FbxVector4 pLookAt,
const FbxVector4 pUpDirection 
)

Set the matrix values as a "Look At" right handed.

Parameters
pEyePositionThe position of the eye.
pLookAtThe look at position of the eye focus.
pUpDirectionThe up direction of the eye.

◆ MultNormalize()

FbxVector4 MultNormalize ( const FbxVector4 pVector) const

Multiply this matrix by pVector, the w component is normalized to 1.

Parameters
pVectorA vector.
Returns
The result of this matrix * pVector.

The documentation for this class was generated from the following file: