KFbxCharacterPose
#include<kfbxcharacterpose.h>

Inheritance diagram for KFbxCharacterPose:

Inheritance graph
[legend]

List of all members.

Detailed Description

A character pose is a character and an associated hierarchy of nodes.

Only the default position of the nodes is considered, the animation data is ignored.

You can access the content of a character pose, using the functionsKFbxCharacterPose::GetOffset(),KFbxCharacterPose::GetLocalPosition(), andKFbxCharacterPose::GetGlobalPosition(). Their source code is provided inline as examples on how to access the character pose data.

To create a character pose, You must first create a hierarchy of nodes under the root node provided by functionKFbxCharacterPose::GetRootNode(). Then, feed this hierarchy of nodes into the character returned by functionKFbxCharacterPose::GetCharacter(). Offsets are set in the character links. Local positions are set usingKFbxNode::SetDefaultT(),KFbxNode::SetDefaultR(), andKFbxNode::SetDefaultS().

To set local positions from global positions:

  1. Declare lCharacterPose as a valid pointer to aKFbxCharacterPose;
  2. Call lCharacterPose->GetRootNode()->SetLocalStateId(0, true);
  3. Call lCharacterPose->GetRootNode()->SetGlobalStateId(1, true);
  4. Call KFbxNode::SetGlobalState() for all nodes found in the hierarchy under lCharacterPose->GetRootNode();
  5. Call lCharacterPose->GetRootNode()->ComputeLocalState(1, true);
  6. Call lCharacterPose->GetRootNode()->SetCurrentTakeFromLocalState(KTIME_ZERO, true).

Definition at line86of filekfbxcharacterpose.h.


Public Member Functions

void Reset()
 Reset to an empty character pose.
KFbxNodeGetRootNode() const
 Get the root node.
KFbxCharacterGetCharacter() const
 Get the character.
bool GetOffset(ECharacterNodeId pCharacterNodeId,KFbxXMatrix&pOffset)
 Get offset matrix for a given character node.
bool GetLocalPosition(ECharacterNodeId pCharacterNodeId,KFbxVector4&pLocalT,KFbxVector4&pLocalR,KFbxVector4&pLocalS)
 Get local position for a given character node.
bool GetGlobalPosition(ECharacterNodeId pCharacterNodeId,KFbxXMatrix&pGlobalPosition)
 Get global position for a given character node.

Member Function Documentation

void Reset( ) 

Reset to an empty character pose.

KFbxNode* GetRootNode( ) const

Get the root node.

Returns:
Pointer to the root node.

KFbxCharacter* GetCharacter( ) const

Get the character.

Returns:
Pointer to the character.

bool GetOffset(ECharacterNodeId pCharacterNodeId,
KFbxXMatrixpOffset 
)[inline]

Get offset matrix for a given character node.

Parameters:
pCharacterNodeId Character Node ID.
pOffset Receives offset matrix.
Returns:
trueif successful,falseotherwise.

Definition at line109of filekfbxcharacterpose.h.

ReferencesKFbxCharacterLink::mOffsetR,KFbxCharacterLink::mOffsetS,KFbxCharacterLink::mOffsetT, andKFbxXMatrix::SetTRS().

bool GetLocalPosition(ECharacterNodeId pCharacterNodeId,
KFbxVector4pLocalT,
KFbxVector4pLocalR,
KFbxVector4pLocalS 
)[inline]

Get local position for a given character node.

Parameters:
pCharacterNodeId Character Node ID.
pLocalT Receives local translation vector.
pLocalR Receives local rotation vector.
pLocalS Receives local scaling vector.
Returns:
trueif successful,falseotherwise.

Definition at line129of filekfbxcharacterpose.h.

ReferencesKFbxNode::GetLocalRFromDefaultTake(),KFbxNode::GetLocalSFromDefaultTake(),KFbxNode::GetLocalTFromDefaultTake(), andKFbxCharacterLink::mNode.

bool GetGlobalPosition(ECharacterNodeId pCharacterNodeId,
KFbxXMatrixpGlobalPosition 
)[inline]

Get global position for a given character node.

Parameters:
pCharacterNodeId Character Node ID.
pGlobalPosition Receives global position.
Returns:
trueif successful,falseotherwise.

Definition at line149of filekfbxcharacterpose.h.

ReferencesKFbxNode::GetGlobalFromDefaultTake(), andKFbxCharacterLink::mNode.