Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h @ 8556

Last change on this file since 8556 was 8556, checked in by patrick, 18 years ago

bsp: bone interpolation written

File size: 1.5 KB
Line 
1/*!
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 */
7
8#ifndef _MD3_MODEL_H
9#define _MD3_MODEL_H
10
11#include <string>
12#include "interactive_model.h"
13
14
15namespace md3
16{
17
18
19class MD3Data;
20class MD3BoneFrame;
21class MD3Mesh;
22class MD3Tag;
23
24struct MD3Normal;
25
26
27class MD3Model : public InteractiveModel
28{
29
30  public:
31    MD3Model(std::string filename, float scaling);
32    ~MD3Model();
33
34    virtual void setAnimation(int animNum, int playbackMode = 0) {}
35
36    virtual void tick(float dt) {}
37
38    virtual void draw();
39
40
41  private:
42    void draw(MD3Data* data);
43
44    void drawMesh(MD3Mesh* mesh, sVec3D* frame);
45    void drawVertexNormals(sVec3D* frame, MD3Normal* normals);
46
47
48    MD3BoneFrame* interpolateBoneFrame(MD3BoneFrame* currBoneFrame, MD3BoneFrame* nextBoneFrame, float frac);
49    void drawBoneFrame(MD3BoneFrame* frame);
50
51    sVec3D* interpolateMeshFrame(MD3Mesh* mesh, int startFrame, int nextMeshFrame, float frac);
52    MD3Normal* interpolateVertexNormals(MD3Normal* curNormals, MD3Normal* nextNormals, float frac);
53    float* interpolateTransformation(MD3Tag* currFrameTag, MD3Tag* nextFrameTag, float frac);
54
55  private:
56    MD3Data*            md3Data;           //!< reference to the md3 model data
57
58    bool                bDrawBones;        //!< draws the bone frames too
59    bool                bDrawNormals;      //!< draw the normals
60
61    MD3BoneFrame*       tmpBoneFrame;      //!< a temporary bone frame
62};
63
64}
65
66#endif /* _MD3_MODEL_H */
Note: See TracBrowser for help on using the repository browser.