Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

bsp: all md3 submodels are now correctly drawn, fixed the bug. now trying to do some nicer drawing and right model assembling

File size: 1.8 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;
23class MD3AnimationCfg;
24
25struct MD3Normal;
26
27
28class MD3Model : public InteractiveModel
29{
30
31  public:
32    MD3Model(std::string filename, float scaling);
33    ~MD3Model();
34
35    virtual void setAnimation(int animNum, int playbackMode = 0) {}
36
37    virtual void tick(float dt);
38    virtual void draw() const;
39
40
41  private:
42
43    void autoAssemblePlayerModel(std::string filename, float scaling);
44
45    void draw(MD3Data* data) const;
46    void tick(float dt, MD3Data* data);
47
48    void drawMesh(MD3Mesh* mesh, sVec3D* frame) const;
49    void drawVertexNormals(sVec3D* frame, MD3Normal* normals) const;
50    void drawBoneFrame(MD3BoneFrame* frame) const;
51
52    MD3BoneFrame* interpolateBoneFrame(MD3Data* data, MD3BoneFrame* currBoneFrame, MD3BoneFrame* nextBoneFrame, float frac);
53    sVec3D* interpolateMeshFrame(MD3Data* data, sVec3D* currMeshFrame, sVec3D* nextMeshFrame, float frac, MD3Mesh* mesh, int i);
54    MD3Normal* interpolateVertexNormals(MD3Data* data, MD3Normal* curNormals, MD3Normal* nextNormals, float frac, MD3Mesh* mesh, int i);
55    float* interpolateTransformation(MD3Data* data, MD3Tag* currFrameTag, MD3Tag* nextFrameTag, float frac, int i);
56
57  private:
58    MD3Data*            md3Data;           //!< reference to the md3 model data
59
60    bool                bDrawBones;        //!< draws the bone frames too
61    bool                bDrawNormals;      //!< draw the normals
62
63    MD3AnimationCfg*    config;            //!< the config file parsed
64
65
66};
67
68}
69
70#endif /* _MD3_MODEL_H */
Note: See TracBrowser for help on using the repository browser.