- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# CXFileEntity Class Reference

Loads a .x file and maintains the heirarchy. More...

`#include <XFileEntity.h>`

Collaboration diagram for CXFileEntity:

[legend]

List of all members.

## 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.

## Detailed Description

Loads a .x file and maintains the heirarchy.

Author:
  Keith Ditchburn

Date:
  17 July 2005

## Constructor & Destructor Documentation

CXFileEntity::CXFileEntity | ( | void |  | ) |

Constructor.

Author:
  Keith Ditchburn

Date:
  17 July 2005

CXFileEntity::~CXFileEntity | ( | void |  | ) |

Destructor.

Author:
  Keith Ditchburn

Date:
  17 July 2005

## Member Function Documentation

void CXFileEntity::UpdateFrameMatrices | ( | const D3DXFRAME * | frameBase,
|  | const D3DXMATRIX * | parentMatrix |
| ) |  |  |

Called to update the frame matrices in the hierarchy to reflect current animation stage.

Parameters:

  | frameBase | - frame being looked at
  | parentMatrix | - the matrix of our parent (if we have one)

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::DrawFrame | ( | LPDIRECT3DDEVICE9 | device,
|  | LPD3DXFRAME | frame |
| ) |  |  | const

Called to render a frame in the hierarchy.

Parameters:

  | device | - the Direct3D device object
  | frame | - frame to render

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::DrawMeshContainer | ( | LPDIRECT3DDEVICE9 | device,
|  | LPD3DXMESHCONTAINER | meshContainerBase,
|  | LPD3DXFRAME | frameBase |
| ) |  |  | const

Called to render a mesh.

Parameters:

  | device | - the Direct3D device object
  | meshContainerBase | - the mesh container
  | frameBase | - frame containing the mesh

Author:
  Keith Ditchburn

Date:
  18 July 2005

HRESULT CXFileEntity::LoadXFile | ( | LPDIRECT3DDEVICE9 | device,
|  | const WCHAR * | filename |
| ) |  |  |

Loads the x file.

Parameters:

  | device | - the Direct3D device object
  | filename | - the file to load

Returns:
  HRESULT indicating success

Author:
  Keith Ditchburn

Date:
  17 July 2005

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

Parameters:

  | device | - the Direct3D device object
  | pFrame | - current frame
  | pParentMatrix | - the parent frame matrix

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::OnFrameMove | ( | LPDIRECT3DDEVICE9 | device,
|  | float | elapsedTime,
|  | const D3DXMATRIX * | matWorld |
| ) |  |  |

Called each frame update with the time and the current world matrix.

Parameters:

  | elapsedTime | - time passed
  | matWorld | - current world matrix for the model

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::Render | ( | LPDIRECT3DDEVICE9 | device | ) | const

Render our mesh. Call the DrawFrame recursive fn on render with the root frame (see notes diagram).

Parameters:

  | device | - the Direct3D device object

Author:
  Keith Ditchburn

Date:
  18 July 2005

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.

Parameters:

  | index | - new animation set index

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::NextAnimation | ( |  | ) |

Go to the next animation.

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::AnimateFaster | ( |  | ) |

Speed up animation.

Author:
  Keith Ditchburn

Date:
  18 July 2005

void CXFileEntity::AnimateSlower | ( |  | ) |

Slow down animation.

Author:
  Keith Ditchburn

Date:
  18 July 2005

const char * CXFileEntity::GetAnimationSetName | ( | UINT | index | ) |

Get the name of the animation.

Parameters:

  | index | - the animation set index

Returns:
  the name

Author:
  Keith Ditchburn

Date:
  18 July 2005

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

- My Documents/TS2/inc/XFileEntity.h
- My Documents/TS2/src/XFileEntity.cpp