/*! * @file md3_model.h * * Code heavely inspired by: JAVA MD3 Model Viewer - A Java based Quake 3 model viewer * Copyright (C) 1999 Erwin 'KLR8' Vervaet */ #ifndef _MD3_MODEL_H #define _MD3_MODEL_H #include #include "interactive_model.h" namespace md3 { class MD3Data; class MD3BoneFrame; class MD3Mesh; struct MD3Normal; class MD3Model : public InteractiveModel { public: MD3Model(std::string filename, float scaling); ~MD3Model(); virtual void setAnimation(int animNum, int playbackMode = 0) {} virtual void tick(float dt) {} virtual void draw(); private: void draw(MD3Data* data); void drawMesh(MD3Mesh* mesh, sVec3D* frame); void drawVertexNormals(sVec3D* frame, MD3Normal* normals); MD3BoneFrame* interpolateBoneFrame(MD3BoneFrame* currBoneFrame, MD3BoneFrame* nextBoneFrame, float frac); void drawBoneFrame(MD3BoneFrame* frame); sVec3D* interpolateMeshFrame(MD3Mesh* mesh, int startFrame, int nextMeshFrame, float frac); MD3Normal* interpolateVertexNormals(MD3Normal* curNormals, MD3Normal* nextNormals, float frac); private: MD3Data* md3Data; //!< reference to the md3 model data bool bDrawBones; //!< draws the bone frames too bool bDrawNormals; //!< draw the normals }; } #endif /* _MD3_MODEL_H */