Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SkinnedModel.h

00001 #ifndef SKINNEDMODEL_H_WNR262
00002 #define SKINNEDMODEL_H_WNR262
00003 
00004 #include "global.h"
00005 #include "Bone.h"
00006 
00013 class SkinnedModel {
00014   public:
00020     SkinnedModel( const std::string& fileName );
00021 
00025     ~SkinnedModel();
00026 
00032     Bone* getSkeleton();
00033 
00037     void setToReference();
00038     
00044     void render();
00045 
00053     void render( const Matrix& worldMat );
00054 
00059     static std::string getDXDataObjectName( LPDIRECTXFILEDATA xObj );
00060 
00061   protected:
00066     SkinnedModel();
00067 
00074     void loadSkeleton( LPDIRECTXFILEDATA xObj );
00075     
00076   private:
00077     void loadFrame( LPDIRECTXFILEDATA xObj, Bone* currBone );
00078     void processFrame( LPDIRECTXFILEDATA xObj, Bone* currBone );
00079     void loadMesh( LPDIRECTXFILEDATA xObj );
00080     void resolveBones();
00081 
00085     void cleanUp();
00086 
00087     ID3DXMesh* mesh;
00088     DWORD maxInfl; //max number of bones per vertex
00089     DWORD numComb; //number of bone combonations used for rendering
00090     LPD3DXBUFFER boneCombinationBuf; //Bone combinations buffer
00091 
00092     int numMats;
00093     D3DMATERIAL8* materials;
00094     Texture* textures;
00095 
00096     Bone* rootBone;
00097     BoneList boneList; //linear list of bones, that match the bone comb buf
00098 
00099     //temporary info
00100     LPD3DXBUFFER boneNamesBuf;
00101     int numBones;
00102     LPD3DXBUFFER boneOffMats; //offset matrices
00103 };
00104 
00105 #endif
00106 

Generated on Wed May 14 01:38:07 2003 for CG Skeletal Animation Project by doxygen1.2.18