Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

bsp: md3 model normal and vertex drawing functions. not working yet

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