Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h @ 4079

Last change on this file since 4079 was 4079, checked in by patrick, 19 years ago

orxonox/branches/md2_loader: implemented importMD2 header function

File size: 3.3 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Patrick Boenzli
13   co-programmer:
14*/
15
16/*!
17    \file abstract_model.h
18    \brief Definition of an abstract model. containing all needed for other model
19*/
20
21#ifndef _ABSTRACT_MODEL_H
22#define _ABSTRACT_MODEL_H
23
24#include "stdincl.h"
25#include "base_object.h"
26
27template<class T> class tList;
28
29
30//! This is our 3D point class.  CONFLICTING with Vector.cc
31class CVector3
32{
33public:
34        float x, y, z;
35};
36
37//! This is our 2D point class.  CONFLICTING with Vector.cc
38class CVector2
39{
40public:
41        float x, y;
42};
43
44// CONFLICTING with model.h
45struct tFace
46{
47        int vertIndex[3];                       // indicies for the verts that make up this triangle
48        int coordIndex[3];                      // indicies for the tex coords to texture this face
49};
50
51// CONFLICTING with material.cc, there are some small differences, i will use this struct and switch over later
52struct tMaterialInfo
53{
54        char  strName[255];                     // The texture name
55        char  strFile[255];                     // The texture file name (If this is set it's a texture map)
56        byte  color[3]; // The color of the object (R, G, B)
57        int   texureId;                         // the texture ID
58        float uTile;                            // u tiling of texture 
59        float vTile;                            // v tiling of texture 
60        float uOffset;                      // u offset of texture
61        float vOffset;                          // v offset of texture
62} ;
63
64//! properties of a 3D object
65struct t3DObject
66{
67        int  numOfVerts;                        // The number of verts in the model
68        int  numOfFaces;                        // The number of faces in the model
69        int  numTexVertex;                      // The number of texture coordinates
70        int  materialID;                        // The texture ID to use, which is the index into our texture array
71        bool bHasTexture;                       // This is TRUE if there is a texture map for this object
72        char strName[255];                      // The name of the object
73        CVector3  *pVerts;                      // The object's vertices
74        CVector3  *pNormals;            // The object's normals
75        CVector2  *pTexVerts;           // The texture's UV coordinates
76        tFace *pFaces;                          // The faces information of the object
77};
78
79// CONFLICTING with animation.cc
80struct tAnimationInfo
81{
82        char strName[255];                      // This stores the name of the animation (Jump, Pain, etc..)
83        int startFrame;                         // This stores the first frame number for this animation
84        int endFrame;                           // This stores the last frame number for this animation
85};
86
87// CONFLICTING with animation.cc and vector.cc
88struct t3DModel
89{
90        int numOfObjects;                                       // The number of objects in the model
91        int numOfMaterials;                                     // The number of materials for the model
92        int numOfAnimations;                            // The number of animations in this model (NEW)
93        int currentAnim;                                        // The current index into pAnimations list (NEW)
94        int currentFrame;                                       // The current frame of the current animation (NEW)
95        tList<tAnimationInfo>* animationList; // The list of animations (NEW)
96        tList<tMaterialInfo>* materialList;     // The list of material information (Textures and colors)
97        tList<t3DObject>* objectList;                   // The object list for our model
98};
99
100
101
102//! This class defines the basic components of a model
103class AbstractModel : public BaseObject {
104
105 public:
106  AbstractModel() {}
107  virtual ~AbstractModel() {}
108};
109
110#endif /* _ABSTRACT_MODEL_H */
Note: See TracBrowser for help on using the repository browser.