KFbxCluster
#include<kfbxcluster.h>

Inheritance diagram for KFbxCluster:

Inheritance graph
[legend]

List of all members.

Detailed Description

FBX SDK cluster class.

Definition at line63of filekfbxcluster.h.


Control Points

A link has an array of indices to control points and associated weights.

The indices refer to the control points in the instance of classKFbxGeometryowning the link. The weights are the influence of the link node over the displacement of the indexed control points.

void AddControlPointIndex(int pIndex, double pWeight)
 Add an element in both arrays of control point indices and weights.
int GetControlPointIndicesCount()
 Get the length of the arrays of control point indices and weights.
int * GetControlPointIndices()
 Get the array of control point indices.
double * GetControlPointWeights()
 Get the array of control point weights.

Transformation Matrices

A link has three transformation matrices:

  • Transform refers to the global initial position of the node containing the link
  • TransformLink refers to global initial position of the link node
  • TransformAssociateModel refers to the global initial position of the associate model
These matrices are used to set the positions where the influences of the link node and associate model over the control points are null.

void SetTransformMatrix(KFbxXMatrix&pMatrix)
 Set matrix associated with the node containing the link.
KFbxXMatrixGetTransformMatrix(KFbxXMatrix&pMatrix)
 Get matrix associated with the node containing the link.
void SetTransformLinkMatrix(KFbxXMatrix&pMatrix)
 Set matrix associated with the link node.
KFbxXMatrixGetTransformLinkMatrix(KFbxXMatrix&pMatrix)
 Get matrix associated with the link node.
void SetTransformAssociateModelMatrix(KFbxXMatrix&pMatrix)
 Set matrix associated with the associate model.
KFbxXMatrixGetTransformAssociateModelMatrix(KFbxXMatrix&pMatrix)
 Get matrix associated with the associate model.
void SetTransformParentMatrix(KFbxXMatrix&pMatrix)
 Set matrix associated with the parent node.
KFbxXMatrixGetTransformParentMatrix(KFbxXMatrix&pMatrix)
 Get matrix associated with the parent node.
bool IsTransformParentSet() const
 Get the Transform Parent set flag value.

Public Types

enum ELinkMode
 Link modes.More...

Public Member Functions

ESubDeformerType GetSubDeformerType()
 Get the type of the sub deformer.
void Reset()
 Restore the link to its initial state.
void SetLinkMode(ELinkModepMode)
 Set the link mode.
ELinkMode GetLinkMode() const
 Get the link mode.
void SetLink(KFbxNodeconst *pNode)
 Set the link node.
KFbxNodeGetLink()
 Get the link node.
void SetAssociateModel(KFbxNode*pNode)
 Set the associate model.
KFbxNodeGetAssociateModel() const
 Get the associate model.
KFbxClusteroperator=(KFbxClusterconst&pCluster)
 Assigment operator.

Member Enumeration Documentation

Link modes.

The link mode sets how the link influences the position of a control point and the relationship between the weights assigned to a control point. The weights assigned to a control point are distributed among the set of links associated with an instance of classKFbxGeometry.

  • eNORMALIZEIn mode eNORMALIZE, the sum of the weights assigned to a control point is normalized to 1.0. Setting the associate model in this mode is not relevant. The influence of the link is a function of the displacement of the link node relative to the node containing the control points.
  • eADDITIVEIn mode eADDITIVE, the sum of the weights assigned to a control point is kept as is. It is the only mode where setting the associate model is relevant. The influence of the link is a function of the displacement of the link node relative to the node containing the control points or, if set, the associate model. The weight gives the proportional displacement of a control point. For example, if the weight of a link over a control point is set to 2.0, a displacement of the link node of 1 unit in the X direction relative to the node containing the control points or, if set, the associate model, triggers a displacement of the control point of 2 units in the same direction.
  • eTOTAL1Mode eTOTAL1 is identical to mode eNORMALIZE except that the sum of the weights assigned to a control point is not normalized and must equal 1.0.

Definition at line104of filekfbxcluster.h.

Member Function Documentation

ESubDeformerTypeGetSubDeformerType( ) [inline, virtual]

Get the type of the sub deformer.

Returns:
SubDeformer type identifier.

Reimplemented fromKFbxSubDeformer.

Definition at line70of filekfbxcluster.h.

void Reset( ) 

Restore the link to its initial state.

Calling this function will clear the following:

  • pointer to linked node
  • pointer to associate model
  • control point indices and weights
  • transformation matrices

void SetLinkMode(ELinkMode pMode ) 

Set the link mode.

Parameters:
pMode The link mode.
Remarks:
All the links associated to an instance of classKFbxGeometrymust have the same link mode.

ELinkModeGetLinkMode( ) const

Get the link mode.

Returns:
The link mode.

void SetLink(KFbxNodeconst * pNode ) 

Set the link node.

Parameters:
pNode The link node.
Remarks:
The link node is the node which influences the displacement of the control points. Typically, the link node is the bone a skin is attached to.

KFbxNode* GetLink( ) 

Get the link node.

Returns:
The link node orNULLifKFbxCluster::SetLink()has not been called before.
Remarks:
The link node is the node which influences the displacement of the control points. Typically, the link node is the bone a skin is attached to.

void SetAssociateModel(KFbxNodepNode ) 

Set the associate model.

The associate model is optional. It is only relevant if the link mode is of type eADDITIVE.

Parameters:
pNode The associate model node.
Remarks:
If set, the associate model is the node used as a reference to measure the relative displacement of the link node. Otherwise, the displacement of the link node is measured relative to the node containing the control points. Typically, the associate model node is the parent of the bone a skin is attached to.

KFbxNode* GetAssociateModel( ) const

Get the associate model.

The associate model is optional. It is only relevant if the link mode is of type eADDITIVE.

Returns:
The associate model node orNULLifKFbxCluster::SetAssociateModel()has not been called before.
Remarks:
If set, the associate model is the node used as a reference to measure the relative displacement of the link node. Otherwise, the displacement of the link node is measured relative the the node containing the control points. Typically, the associate model node is the parent of the bone a skin is attached to.

void AddControlPointIndex(int pIndex,
double pWeight 
)

Add an element in both arrays of control point indices and weights.

Parameters:
pIndex The index of the control point.
pWeight The link weight.

int GetControlPointIndicesCount( ) 

Get the length of the arrays of control point indices and weights.

Returns:
Length of the arrays of control point indices and weights. Returns 0 if no control point indices have been added or the arrays have been reset.

int* GetControlPointIndices( ) 

Get the array of control point indices.

Returns:
Pointer to the array of control point indices.NULLif no control point indices have been added or the array has been reset.

double* GetControlPointWeights( ) 

Get the array of control point weights.

Returns:
Pointer to the array of control point weights.NULLif no control point indices have been added or the array has been reset.

void SetTransformMatrix(KFbxXMatrixpMatrix ) 

Set matrix associated with the node containing the link.

Parameters:
pMatrix Transformation matrix.

KFbxXMatrix&GetTransformMatrix(KFbxXMatrixpMatrix ) 

Get matrix associated with the node containing the link.

Parameters:
pMatrix Transformation matrix.
Returns:
Input parameter filled with appropriate data.

void SetTransformLinkMatrix(KFbxXMatrixpMatrix ) 

Set matrix associated with the link node.

Parameters:
pMatrix Transformation matrix.

KFbxXMatrix&GetTransformLinkMatrix(KFbxXMatrixpMatrix ) 

Get matrix associated with the link node.

Parameters:
pMatrix Transformation matrix.
Returns:
Input parameter filled with appropriate data.

void SetTransformAssociateModelMatrix(KFbxXMatrixpMatrix ) 

Set matrix associated with the associate model.

Parameters:
pMatrix Transformation matrix.

KFbxXMatrix&GetTransformAssociateModelMatrix(KFbxXMatrixpMatrix ) 

Get matrix associated with the associate model.

Parameters:
pMatrix Transformation matrix.
Returns:
Input parameter filled with appropriate data.

void SetTransformParentMatrix(KFbxXMatrixpMatrix ) 

Set matrix associated with the parent node.

Parameters:
pMatrix Transformation matrix.

KFbxXMatrix&GetTransformParentMatrix(KFbxXMatrixpMatrix ) 

Get matrix associated with the parent node.

Parameters:
pMatrix Transformation matrix.
Returns:
Input parameter filled with appropriate data.

bool IsTransformParentSet( ) const[inline]

Get the Transform Parent set flag value.

Returns:
trueif transform matrix associated with parent node is set.

Definition at line260of filekfbxcluster.h.

KFbxCluster&operator=(KFbxClusterconst& pCluster ) 

Assigment operator.

Parameters:
pCluster AnotherKFbxClusterassigned to this one.