home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 7 / Example 7.2 / skinnedMesh.h < prev   
Encoding:
C/C++ Source or Header  |  2006-07-27  |  902 b   |  42 lines

  1. #ifndef SKINNED_MESH
  2. #define SKINNED_MESH
  3.  
  4. #include <windows.h>
  5. #include <d3dx9.h>
  6. #include <string>
  7. #include <vector>
  8. #include "debug.h"
  9.  
  10. struct BONE: public D3DXFRAME
  11. {
  12.     D3DXMATRIX CombinedTransformationMatrix;
  13. };
  14.  
  15. struct BONEMESH: public D3DXMESHCONTAINER
  16. {
  17.     //More to come here later...
  18. };
  19.  
  20. class SKINNEDMESH
  21. {
  22.     public:
  23.         SKINNEDMESH();
  24.         ~SKINNEDMESH();
  25.         void Load(char fileName[], IDirect3DDevice9 *Dev);
  26.         void RenderSkeleton(BONE* bone, BONE *parent, D3DXMATRIX world);
  27.         void SetPose(D3DXMATRIX world, ID3DXAnimationController* animControl, float time);
  28.         void SetAnimation(char name[]);
  29.         std::vector<std::string> GetAnimations();
  30.  
  31.     private:        
  32.  
  33.         void UpdateMatrices(BONE* bone, D3DXMATRIX *parentMatrix);
  34.  
  35.         IDirect3DDevice9 *m_pDevice;
  36.         D3DXFRAME *m_pRootBone;
  37.         ID3DXAnimationController *m_pAnimControl;
  38.  
  39.         LPD3DXMESH m_pSphereMesh;
  40. };
  41.  
  42. #endif