#include <XFileEntity.h>
Public Member Functions | |
void | UpdateFrameMatrices (const D3DXFRAME *frameBase, const D3DXMATRIX *parentMatrix) |
Called to update the frame matrices in the hierarchy to reflect current animation stage. | |
void | DrawFrame (LPDIRECT3DDEVICE9 device, LPD3DXFRAME frame) const |
Called to render a frame in the hierarchy. | |
void | DrawMeshContainer (LPDIRECT3DDEVICE9 device, LPD3DXMESHCONTAINER meshContainerBase, LPD3DXFRAME frameBase) const |
Called to render a mesh. | |
CXFileEntity (void) | |
Constructor. | |
~CXFileEntity (void) | |
Destructor. | |
HRESULT | LoadXFile (LPDIRECT3DDEVICE9 device, const WCHAR *filename) |
Loads the x file. | |
void | SetupBoneMatrices (LPDIRECT3DDEVICE9 device, D3DXFRAME_EXTENDED *pFrame, LPD3DXMATRIX pParentMatrix) |
we need to go through the hierarchy and set the combined matrices calls itself recursively as it tareverses the hierarchy | |
void | OnFrameMove (LPDIRECT3DDEVICE9 device, float elapsedTime, const D3DXMATRIX *matWorld) |
Called each frame update with the time and the current world matrix. | |
void | Render (LPDIRECT3DDEVICE9 device) const |
Render our mesh. Call the DrawFrame recursive fn on render with the root frame (see notes diagram). | |
void | SetAnimationSet (UINT index) |
Change to a different animation set Handles transitions between animations to make it smooth and not a sudden jerk to a new position. | |
void | NextAnimation () |
Go to the next animation. | |
void | AnimateFaster () |
Speed up animation. | |
void | AnimateSlower () |
Slow down animation. | |
const char * | GetAnimationSetName (UINT index) |
Get the name of the animation. |
CXFileEntity::CXFileEntity | ( | void | ) |
Constructor.
CXFileEntity::~CXFileEntity | ( | void | ) |
Destructor.
void CXFileEntity::UpdateFrameMatrices | ( | const D3DXFRAME * | frameBase, | |
const D3DXMATRIX * | parentMatrix | |||
) |
Called to update the frame matrices in the hierarchy to reflect current animation stage.
frameBase | - frame being looked at | |
parentMatrix | - the matrix of our parent (if we have one) |
void CXFileEntity::DrawFrame | ( | LPDIRECT3DDEVICE9 | device, | |
LPD3DXFRAME | frame | |||
) | const |
Called to render a frame in the hierarchy.
device | - the Direct3D device object | |
frame | - frame to render |
void CXFileEntity::DrawMeshContainer | ( | LPDIRECT3DDEVICE9 | device, | |
LPD3DXMESHCONTAINER | meshContainerBase, | |||
LPD3DXFRAME | frameBase | |||
) | const |
Called to render a mesh.
device | - the Direct3D device object | |
meshContainerBase | - the mesh container | |
frameBase | - frame containing the mesh |
HRESULT CXFileEntity::LoadXFile | ( | LPDIRECT3DDEVICE9 | device, | |
const WCHAR * | filename | |||
) |
Loads the x file.
device | - the Direct3D device object | |
filename | - the file to load |
void CXFileEntity::SetupBoneMatrices | ( | LPDIRECT3DDEVICE9 | device, | |
D3DXFRAME_EXTENDED * | pFrame, | |||
LPD3DXMATRIX | pParentMatrix | |||
) |
we need to go through the hierarchy and set the combined matrices calls itself recursively as it tareverses the hierarchy
device | - the Direct3D device object | |
pFrame | - current frame | |
pParentMatrix | - the parent frame matrix |
void CXFileEntity::OnFrameMove | ( | LPDIRECT3DDEVICE9 | device, | |
float | elapsedTime, | |||
const D3DXMATRIX * | matWorld | |||
) |
Called each frame update with the time and the current world matrix.
elapsedTime | - time passed | |
matWorld | - current world matrix for the model |
void CXFileEntity::Render | ( | LPDIRECT3DDEVICE9 | device | ) | const |
Render our mesh. Call the DrawFrame recursive fn on render with the root frame (see notes diagram).
device | - the Direct3D device object |
void CXFileEntity::SetAnimationSet | ( | UINT | index | ) |
Change to a different animation set Handles transitions between animations to make it smooth and not a sudden jerk to a new position.
index | - new animation set index |
void CXFileEntity::NextAnimation | ( | ) |
Go to the next animation.
void CXFileEntity::AnimateFaster | ( | ) |
Speed up animation.
void CXFileEntity::AnimateSlower | ( | ) |
Slow down animation.
const char * CXFileEntity::GetAnimationSetName | ( | UINT | index | ) |
Get the name of the animation.
index | - the animation set index |