KFbxXMatrix
#include<kfbxxmatrix.h>

Inherits fbxVectorTemplate4.

List of all members.

Detailed Description

FBX SDK affine matrix class.

Matrices are defined using the Column Major scheme. When aKFbxXMatrixrepresents a transformation (translation, rotation and scale), the last row of the matrix represents the translation part of the transformation.

Remarks:
It is important to realize that an affine matrix must respect a certain structure. To be sure the structure is respected, use SetT, SetR, SetS, SetQ, SetTRS or SetTQS. If by mistake bad data is entered in this affine matrix, some functions such asInverse()will yield wrong results. If a matrix is needed to hold values that aren't associate with an affine matrix, please useKFbxMatrixinstead.

Definition at line63of filekfbxxmatrix.h.


Constructors and Destructor

 KFbxXMatrix()
 Constructor.
 KFbxXMatrix(constKFbxXMatrix&pXMatrix)
 Copy constructor.
 KFbxXMatrix(KFbxVector4&pT,KFbxVector4&pR,KFbxVector4&pS)
 Constructor.
 ~KFbxXMatrix()
 Destructor.

Access

double Get(int pY, int pX) const
 Retrieve matrix element.
KFbxVector4 GetT()
 Extract translation vector.
KFbxVector4 GetR()
 Extract rotation vector.
KFbxQuaternion GetQ()
 Extract quaternion vector.
KFbxVector4 GetS()
 Extract scale vector.
KFbxVector4 GetRow(int pY)
 Extract a row vector.
KFbxVector4 GetColumn(int pX)
 Extract a column vector.
void SetIdentity()
 Set matrix to identity.
void SetT(KFbxVector4&pT)
 Set matrix's translation.
void SetR(KFbxVector4&pR)
 Set matrix's Euler rotation.
void SetQ(KFbxQuaternion&pQ)
 Set matrix's quaternion.
void SetS(KFbxVector4&pS)
 Set matrix's scale.
void SetTRS(KFbxVector4&pT,KFbxVector4&pR,KFbxVector4&pS)
 Set matrix.
void SetTQS(KFbxVector4&pT,KFbxQuaternion&pQ,KFbxVector4&pS)
 Set matrix.
KFbxXMatrixoperator=(constKFbxXMatrix&pM)
 Assignment operator.

Scalar Operations

KFbxXMatrix operator*(double pValue)
 Multiply matrix by a scalar value.
KFbxXMatrix operator/(double pValue)
 Divide matrix by a scalar value.
KFbxXMatrixoperator*=(double pValue)
 Multiply matrix by a scalar value.
KFbxXMatrixoperator/=(double pValue)
 Divide matrix by a scalar value.

Vector Operations

KFbxVector4 MultT(KFbxVector4&pVector4)
 Multiply matrix by a translation vector.
KFbxVector4 MultR(KFbxVector4&pVector4)
 Multiply matrix by an Euler rotation vector.
KFbxQuaternion MultQ(KFbxQuaternion&pQuaternion)
 Multiply matrix by a quaternion.
KFbxVector4 MultS(KFbxVector4&pVector4)
 Multiply matrix by a scale vector.

Matrix Operations

KFbxXMatrix operator-()
 Unary minus operator.
KFbxXMatrix operator*(KFbxXMatrix&pXMatrix)
 Multiply two matrices together.
KFbxXMatrixoperator*=(KFbxXMatrix&pXMatrix)
 Multiply two matrices together.
KFbxXMatrix Inverse()
 Calculate the matrix inverse.
KFbxXMatrix Transpose()
 Calculate the matrix transpose.

Boolean Operations

bool operator==(KFbxXMatrix&pXMatrix)
 Equivalence operator.
bool operator==(KFbxXMatrixconst&pXMatrix) const
 Equivalence operator.
bool operator!=(KFbxXMatrix&pXMatrix)
 Non-equivalence operator.
bool operator!=(KFbxXMatrixconst&pXMatrix) const
 Non-equivalence operator.

Casting

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

Constructor&Destructor Documentation

Constructor.

KFbxXMatrix(constKFbxXMatrixpXMatrix ) 

Copy constructor.

Parameters:
pXMatrix KFbxXMatrixcopied to this one.

Constructor.

Parameters:
pT Translation vector.
pR Euler rotation vector.
pS Scale vector.

Destructor.

Member Function Documentation

double Get(int pY,
int pX 
)const

Retrieve matrix element.

Parameters:
pY Row index.
pX Column index.
Returns:
Cell [ pX, pY ] value.

KFbxVector4GetT( ) 

Extract translation vector.

Returns:
Translation vector.

KFbxVector4GetR( ) 

Extract rotation vector.

Returns:
Rotation vector.

KFbxQuaternionGetQ( ) 

Extract quaternion vector.

Returns:
Quaternion vector.

KFbxVector4GetS( ) 

Extract scale vector.

Returns:
Scale vector.

KFbxVector4GetRow(int pY ) 

Extract a row vector.

Parameters:
pY Row index.
Returns:
The row vector.

KFbxVector4GetColumn(int pX ) 

Extract a column vector.

Parameters:
pX Column index.
Returns:
The column vector.

void SetIdentity( ) 

Set matrix to identity.

void SetT(KFbxVector4pT ) 

Set matrix's translation.

Parameters:
pT Translation vector.

void SetR(KFbxVector4pR ) 

Set matrix's Euler rotation.

Parameters:
pR X, Y and Z rotation values expressed as a vector.

void SetQ(KFbxQuaternionpQ ) 

Set matrix's quaternion.

Parameters:
pQ The new quaternion.

void SetS(KFbxVector4pS ) 

Set matrix's scale.

Parameters:
pS X, Y and Z scaling factors expressed as a vector.

void SetTRS(KFbxVector4pT,
KFbxVector4pR,
KFbxVector4pS 
)

Set matrix.

Parameters:
pT Translation vector.
pR Rotation vector.
pS Scale vector.

Referenced byKFbxCharacterPose::GetOffset().

void SetTQS(KFbxVector4pT,
KFbxQuaternionpQ,
KFbxVector4pS 
)

Set matrix.

Parameters:
pT Translation vector.
pQ Quaternion vector.
pS Scale vector.

KFbxXMatrix&operator=(constKFbxXMatrixpM ) 

Assignment operator.

Parameters:
pM KFbxXMatrixassigned to this one.

KFbxXMatrixoperator*(double pValue ) 

Multiply matrix by a scalar value.

Parameters:
pValue Scalar value.
Returns:
The scaled matrix.
Remarks:
The passed value is not checked. This operator operates on the first three rows and columns of the matrix. So only the rotation and scaling are scaled, not the translation part. After operation, the translation vector will be set as (0,0,0,1);

KFbxXMatrixoperator/(double pValue ) 

Divide matrix by a scalar value.

Parameters:
pValue Scalar value.
Returns:
The divided matrix.
Remarks:
The passed value is not checked. This operator operates on the first three rows and columns of the matrix. So only the rotation and scaling are scaled, not the translation part. After operation, the translation vector will be set as (0,0,0,1);

KFbxXMatrix&operator*=(double pValue ) 

Multiply matrix by a scalar value.

Parameters:
pValue Scalar value.
Returns:
thisupdated with the result of the multipication.
Remarks:
The passed value is not checked. This operator operates on the first three rows and columns of the matrix. So only the rotation and scaling are scaled, not the translation part. After operation, the translation vector will keep original value.

KFbxXMatrix&operator/=(double pValue ) 

Divide matrix by a scalar value.

Parameters:
pValue Scalar value.
Returns:
thisupdated with the result of the division.
Remarks:
The passed value is not checked. This operator operates on the first three rows and columns of the matrix. So only the rotation and scaling are scaled, not the translation part. After operation, the translation vector will keep original value.

KFbxVector4MultT(KFbxVector4pVector4 ) 

Multiply matrix by a translation vector.

Parameters:
pVector4 Translation vector.
Returns:
t' = M * t

KFbxVector4MultR(KFbxVector4pVector4 ) 

Multiply matrix by an Euler rotation vector.

Parameters:
pVector4 Euler Rotation vector.
Returns:
r' = M * r

KFbxQuaternionMultQ(KFbxQuaternionpQuaternion ) 

Multiply matrix by a quaternion.

Parameters:
pQuaternion Rotation value.
Returns:
q' = M * q

KFbxVector4MultS(KFbxVector4pVector4 ) 

Multiply matrix by a scale vector.

Parameters:
pVector4 Scaling vector.
Returns:
s' = M * s

KFbxXMatrixoperator-( ) 

Unary minus operator.

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

KFbxXMatrixoperator*(KFbxXMatrixpXMatrix ) 

Multiply two matrices together.

Parameters:
pXMatrix A Matrix.
Returns:
this * pMatrix.

KFbxXMatrix&operator*=(KFbxXMatrixpXMatrix ) 

Multiply two matrices together.

Parameters:
pXMatrix A Matrix.
Returns:
thisupdated with the result of the multiplication.

KFbxXMatrixInverse( ) 

Calculate the matrix inverse.

Returns:
The inverse matrix ofthis.

KFbxXMatrixTranspose( ) 

Calculate the matrix transpose.

Returns:
The transposed matrix ofthis.

bool operator==(KFbxXMatrixpXMatrix ) 

Equivalence operator.

Parameters:
pXMatrix The matrix to be compared tothis.
Returns:
trueif the two matrices are equal (each element is within a 1.0e-6 tolerance) andfalseotherwise.

bool operator==(KFbxXMatrixconst& pXMatrix ) const

Equivalence operator.

Parameters:
pXMatrix The matrix to be compared tothis.
Returns:
trueif the two matrices are equal (each element is within a 1.0e-6 tolerance) andfalseotherwise.

bool operator!=(KFbxXMatrixpXMatrix ) 

Non-equivalence operator.

Parameters:
pXMatrix The matrix to be compared tothis.
Returns:
falseif the two matrices are equal (each element is within a 1.0e-6 tolerance) andtrueotherwise.

bool operator!=(KFbxXMatrixconst& pXMatrix ) const

Non-equivalence operator.

Parameters:
pXMatrix The matrix to be compared tothis.
Returns:
falseif the two matrices are equal (each element is within a 1.0e-6 tolerance) andtrueotherwise.

operator double *( ) 

Cast the matrix in a double pointer.

typedef const double(kDouble44  ) 

Define 4*4 array as a new type.

kDouble44&Double44( ) const[inline]

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

Definition at line339of filekfbxxmatrix.h.