My Project
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CBoneAnimProvider Class Reference

Supplying external animation loaded from ParaX or BVH files. More...

#include <BoneAnimProvider.h>

Public Types

enum  MergeMode { MergeMode_ReplaceExisting, MergeMode_ReplaceALL }
 how bone animation is meant to be used with a parax model. More...
 

Public Member Functions

 CBoneAnimProvider (int nAnimID, const char *name, const char *filename)
 new an animation provider from file. More...
 
int GetAnimID ()
 get the animation ID
 
const string & GetAnimName ()
 get the animation name
 
const string & GetAnimFileName ()
 get the animation file name
 
bool HasBone (KNOWN_BONE_NODES KnownBoneID)
 check by Bone id
 
BoneGetBone (KNOWN_BONE_NODES KnownBoneID)
 get bone by Bone id
 
BoneGetBoneByIndex (int nIndex)
 get bone by index. More...
 
MergeMode GetMergeMode ()
 how bone animation is meant to be used with a parax model. More...
 
int GetSubAnimID ()
 sub animation ID. More...
 
void SetSubAnimID (int nID)
 sub animation ID. More...
 
AnimIndex GetAnimIndex (int nSubAnimID=0)
 
void GetAnimMoveSpeed (float *pSpeed, int nSubAnimID=0)
 get the character move speed in the animation. More...
 

Static Public Member Functions

static CBoneAnimProviderGetProviderByID (int id)
 get the provider by its ID. More...
 
static int GetProviderIDByName (const char *sName)
 Get provider id by name. More...
 
static CBoneAnimProviderCreateProvider (int nAnimID, const char *name, const char *filename, bool bOverwrite=false)
 Create an animation provider from file. More...
 
static bool DeleteProvider (int nAnimID)
 delete a provider by ID. More...
 
static bool CleanupAllProviders ()
 delete all providers. More...
 

Detailed Description

Supplying external animation loaded from ParaX or BVH files.

Such animation can be shared by any animation instances. Providers can also be loaded dynamically; some special animation provider can be composed by user at runtime; some may be automatically generated from the physics engine.

Note
: each instance of CBoneAnimProvider has two keys, one is id(primary and unique), the other is name(optional)

Member Enumeration Documentation

§ MergeMode

how bone animation is meant to be used with a parax model.

Enumerator
MergeMode_ReplaceExisting 

replace the target model with all existing bones defined in the provider

MergeMode_ReplaceALL 

replace the target model with all bones.

Constructor & Destructor Documentation

§ CBoneAnimProvider()

CBoneAnimProvider::CBoneAnimProvider ( int  nAnimID,
const char *  name,
const char *  filename 
)

new an animation provider from file.

Parameters
nAnimID-1 if one wants it to be automatically assigned. otherwise one can manually specify one. Please note, if there is already a provider with the same ID, the old one is automatically released and replaced with the new one.
nameoptional key. Allowing user to query by a user friendly name. This can be NULL.
filenamefrom which file the animation data is loaded. It can be a ParaX animation file or BVH file.

Member Function Documentation

§ CleanupAllProviders()

bool ParaEngine::CBoneAnimProvider::CleanupAllProviders ( )
static

delete all providers.

§ CreateProvider()

CBoneAnimProvider * ParaEngine::CBoneAnimProvider::CreateProvider ( int  nAnimID,
const char *  name,
const char *  filename,
bool  bOverwrite = false 
)
static

Create an animation provider from file.

Parameters
nAnimID-1 if one wants it to be automatically assigned. otherwise one can manually specify one. Please note, if there is already a provider with the same ID, the old one is automatically released and replaced with the new one.
nameoptional key. Allowing user to query by a user friendly name. This can be NULL.
filenamefrom which file the animation data is loaded. It can be a ParaX animation file or BVH file.
bOverwritewhether to overwrite existing with the same nAnimID or name

§ DeleteProvider()

bool ParaEngine::CBoneAnimProvider::DeleteProvider ( int  nAnimID)
static

delete a provider by ID.

Returns
: return true if succeed.

§ GetAnimIndex()

AnimIndex CBoneAnimProvider::GetAnimIndex ( int  nSubAnimID = 0)
Parameters
nSubAnimIDin most cases this is 0

§ GetAnimMoveSpeed()

void CBoneAnimProvider::GetAnimMoveSpeed ( float *  pSpeed,
int  nSubAnimID = 0 
)

get the character move speed in the animation.

Parameters
nSubAnimIDin most cases this is 0
pSpeedout value

§ GetBoneByIndex()

Bone * ParaEngine::CBoneAnimProvider::GetBoneByIndex ( int  nIndex)

get bone by index.

return NULL if no bones at the index

§ GetMergeMode()

ParaEngine::CBoneAnimProvider::MergeMode ParaEngine::CBoneAnimProvider::GetMergeMode ( )

how bone animation is meant to be used with a parax model.

§ GetProviderByID()

CBoneAnimProvider * ParaEngine::CBoneAnimProvider::GetProviderByID ( int  id)
static

get the provider by its ID.

function may return NULL if the ID does not exist.

§ GetProviderIDByName()

int ParaEngine::CBoneAnimProvider::GetProviderIDByName ( const char *  sName)
static

Get provider id by name.

Name is used when creating the provider instance. It is usually the same as the file path from which animation data is loaded. return -1 if not found

§ GetSubAnimID()

int ParaEngine::CBoneAnimProvider::GetSubAnimID ( )

sub animation ID.

default to 0. In most cases, a bone animation provider contains only one animation sequence whose ID is 0. however, some provider may contain multiple animation ID.

§ SetSubAnimID()

void ParaEngine::CBoneAnimProvider::SetSubAnimID ( int  nID)

sub animation ID.

default to 0. In most cases, a bone animation provider contains only one animation sequence whose ID is 0. however, some provider may contain multiple animation ID.


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