Rev | Line | |
---|
[8342] | 1 | /*! |
---|
[8343] | 2 | * @file md3_model.h |
---|
| 3 | * |
---|
| 4 | * Code heavely inspired by: JAVA MD3 Model Viewer - A Java based Quake 3 model viewer |
---|
| 5 | * Copyright (C) 1999 Erwin 'KLR8' Vervaet |
---|
| 6 | */ |
---|
[8342] | 7 | |
---|
[8343] | 8 | #ifndef _MD3_MODEL_H |
---|
| 9 | #define _MD3_MODEL_H |
---|
[8342] | 10 | |
---|
[8343] | 11 | #include <string> |
---|
[8439] | 12 | #include "interactive_model.h" |
---|
[8342] | 13 | |
---|
| 14 | |
---|
[8351] | 15 | namespace md3 |
---|
| 16 | { |
---|
| 17 | |
---|
[8354] | 18 | |
---|
[8357] | 19 | class MD3Data; |
---|
[8551] | 20 | class MD3BoneFrame; |
---|
[8552] | 21 | class MD3Mesh; |
---|
[8553] | 22 | class MD3Tag; |
---|
| 23 | |
---|
[8552] | 24 | struct MD3Normal; |
---|
[8357] | 25 | |
---|
[8552] | 26 | |
---|
[8439] | 27 | class MD3Model : public InteractiveModel |
---|
[8342] | 28 | { |
---|
| 29 | |
---|
[8343] | 30 | public: |
---|
[8353] | 31 | MD3Model(std::string filename, float scaling); |
---|
[8343] | 32 | ~MD3Model(); |
---|
[8342] | 33 | |
---|
[8439] | 34 | virtual void setAnimation(int animNum, int playbackMode = 0) {} |
---|
[8342] | 35 | |
---|
[8549] | 36 | virtual void tick(float dt) {} |
---|
| 37 | |
---|
| 38 | virtual void draw(); |
---|
| 39 | |
---|
[8550] | 40 | |
---|
[8343] | 41 | private: |
---|
[8550] | 42 | void draw(MD3Data* data); |
---|
| 43 | |
---|
[8552] | 44 | void drawMesh(MD3Mesh* mesh, sVec3D* frame); |
---|
| 45 | void drawVertexNormals(sVec3D* frame, MD3Normal* normals); |
---|
| 46 | |
---|
| 47 | |
---|
[8551] | 48 | MD3BoneFrame* interpolateBoneFrame(MD3BoneFrame* currBoneFrame, MD3BoneFrame* nextBoneFrame, float frac); |
---|
| 49 | void drawBoneFrame(MD3BoneFrame* frame); |
---|
[8550] | 50 | |
---|
[8552] | 51 | sVec3D* interpolateMeshFrame(MD3Mesh* mesh, int startFrame, int nextMeshFrame, float frac); |
---|
| 52 | MD3Normal* interpolateVertexNormals(MD3Normal* curNormals, MD3Normal* nextNormals, float frac); |
---|
[8553] | 53 | float* interpolateTransformation(MD3Tag* currFrameTag, MD3Tag* nextFrameTag, float frac); |
---|
[8552] | 54 | |
---|
[8550] | 55 | private: |
---|
[8354] | 56 | MD3Data* md3Data; //!< reference to the md3 model data |
---|
[8549] | 57 | |
---|
| 58 | bool bDrawBones; //!< draws the bone frames too |
---|
[8552] | 59 | bool bDrawNormals; //!< draw the normals |
---|
[8556] | 60 | |
---|
| 61 | MD3BoneFrame* tmpBoneFrame; //!< a temporary bone frame |
---|
[8357] | 62 | }; |
---|
[8354] | 63 | |
---|
[8351] | 64 | } |
---|
[8342] | 65 | |
---|
[8343] | 66 | #endif /* _MD3_MODEL_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.