My Project
Public Member Functions | List of all members
ParaEngine::XRefAnimInstance Class Reference

animated animation instance referenced in model object. More...

#include <XRefObject.h>

Inheritance diagram for ParaEngine::XRefAnimInstance:
ParaEngine::XRefObject

Public Member Functions

 XRefAnimInstance (CMeshObject *pParent, AssetEntity *pModel, const Vector3 &vOrigin, const Matrix4 &mxLocalTransform)
 
virtual bool SetParamsFromAsset ()
 return true if asset effect type is known. More...
 
CAnimInstanceBaseGetAnimInstance ()
 get the animation instance. More...
 
CParaXAnimInstanceGetParaXAnimInstance ()
 get the ParaX animation instance. More...
 
void DeleteAnimInstance ()
 delete AnimInstance
 
CharModelInstanceGetCharModelInstance ()
 get the character model instance. More...
 
virtual void Animate (double dTimeDelta, int nRenderNumber=0)
 animate the model More...
 
virtual HRESULT Draw (SceneState *sceneState)
 draw the model
 
virtual HRESULT DrawInner (SceneState *sceneState, const Matrix4 *pMxWorld=0, float fCameraToObjectDist=0.f)
 
virtual bool SetReplaceableTexture (int ReplaceableTextureID, TextureEntity *pTextureEntity)
 reset replaceable texture
 
virtual Matrix4GetAttachmentMatrix (Matrix4 &pOut, int nAttachmentID=0, int nRenderNumber=0)
 Get the specified attachment matrix of the current model. More...
 
virtual void SetAnimation (int nAnimID)
 Set the current animation id. More...
 
virtual int GetAnimation ()
 get the scaling. More...
 
virtual void SetAnimFrame (int nFrame)
 set the current animation frame number relative to the beginning of current animation. More...
 
virtual int GetAnimFrame ()
 get the current animation frame number relative to the beginning of current animation. More...
 
virtual void SetUseGlobalTime (bool bUseGlobalTime)
 whether to use global time to sync animation. More...
 
virtual bool IsUseGlobalTime ()
 whether to use global time to sync animation. More...
 
- Public Member Functions inherited from ParaEngine::XRefObject
 XRefObject (CMeshObject *pParent, AssetEntity *pModel, const Vector3 &vOrigin, const Matrix4 &mxLocalTransform)
 
CMeshObjectGetParent ()
 Get the parent object associated with this object.
 
AssetEntityGetModelAsset ()
 return the model asset associated with this object
 
Matrix4GetRenderMatrix (Matrix4 &mxWorld, const Matrix4 *pMxParent=NULL, int nRenderNumber=0)
 get matrix for rendering More...
 
Matrix4GetLocalMatrix ()
 get local matrix
 
Matrix4GetMatrix (Matrix4 &mxWorld, const Matrix4 *pMatParent)
 get matrix relative to a parent matrix
 
virtual int GetPrimaryTechniqueHandle ()
 when batch-rendering a group of objects, objects are usually sorted by their render techniques and then by their primary asset. More...
 
virtual void SetPrimaryTechniqueHandle (int nHandle)
 Set a new render technique handle. More...
 

Additional Inherited Members

- Protected Attributes inherited from ParaEngine::XRefObject
asset_ptr< AssetEntitym_pModelEntity
 
Vector3 m_vOrigin
 the xrefed model's origin relative to its parent model. More...
 
Matrix4 m_mxLocalTransform
 animated local transform: this is usually a const read from the model file
 
int m_nTechniqueHandle
 the primary technique handle
 
CMeshObjectm_pParent
 parent object
 

Detailed Description

animated animation instance referenced in model object.

Parent(StaticMesh)–>Several Child(CParaXAnimInstance) V V MeshObject-------—>Several Child(XRefAnimInstance)

Member Function Documentation

§ Animate()

void XRefAnimInstance::Animate ( double  dTimeDelta,
int  nRenderNumber = 0 
)
virtual

animate the model

For animation instance.

Reimplemented from ParaEngine::XRefObject.

§ GetAnimation()

int ParaEngine::XRefAnimInstance::GetAnimation ( )
virtual

get the scaling.

Reimplemented from ParaEngine::XRefObject.

§ GetAnimFrame()

int ParaEngine::XRefAnimInstance::GetAnimFrame ( )
virtual

get the current animation frame number relative to the beginning of current animation.

Reimplemented from ParaEngine::XRefObject.

§ GetAnimInstance()

CAnimInstanceBase * XRefAnimInstance::GetAnimInstance ( )

get the animation instance.

the size and speed of the animation and the biped object is not synchronized.

you need to manually get the current size and speed from the animation instance so that the biped and its animation instance could synchronize in action.

load the default animation

§ GetAttachmentMatrix()

Matrix4 * ParaEngine::XRefAnimInstance::GetAttachmentMatrix ( Matrix4 pOut,
int  nAttachmentID = 0,
int  nRenderNumber = 0 
)
virtual

Get the specified attachment matrix of the current model.

this is usually for getting the mount point on a certain model, such as horses. It also works for static mesh with xrefed mountable objects.

Parameters
pOutoutput result
nAttachmentIDsee ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points
nRenderNumberif it is bigger than current calculated render number, the value will be recalculated.
Returns
: NULL if not attachment found, otherwise it is pOut.

Reimplemented from ParaEngine::XRefObject.

§ GetCharModelInstance()

CharModelInstance * XRefAnimInstance::GetCharModelInstance ( )

get the character model instance.

This function will return NULL, if there is not a character model instance associated with this node

§ GetParaXAnimInstance()

CParaXAnimInstance * XRefAnimInstance::GetParaXAnimInstance ( )

get the ParaX animation instance.

This function will return NULL, if it is not a ParaX AnimInstance one can then check whether the model has mount point.

§ IsUseGlobalTime()

bool ParaEngine::XRefAnimInstance::IsUseGlobalTime ( )
virtual

whether to use global time to sync animation.

Default to false. if true, all characters plays exactly the same frames if they are using the same animation file at all times, if false, each character advances its time frame separately according to their visibility in the scene.

Note
: animation is always looped once use global time

Reimplemented from ParaEngine::XRefObject.

§ SetAnimation()

void ParaEngine::XRefAnimInstance::SetAnimation ( int  nAnimID)
virtual

Set the current animation id.

Parameters
nAnimID0 is default standing animation. 4 is walking, 5 is running. more information, please see AnimationID

Reimplemented from ParaEngine::XRefObject.

§ SetAnimFrame()

void ParaEngine::XRefAnimInstance::SetAnimFrame ( int  nFrame)
virtual

set the current animation frame number relative to the beginning of current animation.

Parameters
nFrame0 means beginning. if nFrame is longer than the current animation length, it will wrap (modulate the length).

Reimplemented from ParaEngine::XRefObject.

§ SetParamsFromAsset()

bool XRefAnimInstance::SetParamsFromAsset ( )
virtual

return true if asset effect type is known.

and false in case the asset is not loaded yet.

load the default animation

load the default animation

Reimplemented from ParaEngine::XRefObject.

§ SetUseGlobalTime()

void ParaEngine::XRefAnimInstance::SetUseGlobalTime ( bool  bUseGlobalTime)
virtual

whether to use global time to sync animation.

Default to false. if true, all characters plays exactly the same frames if they are using the same animation file at all times, if false, each character advances its time frame separately according to their visibility in the scene.

Note
: animation is always looped once use global time

Reimplemented from ParaEngine::XRefObject.


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