Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/branches/md2_laoder: changed to vector container, since its faster for this application. there are compile errors

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
26#include "base_object.h"
27
28//template<class T> class tList;
29template<class T> class vector;
30
31//! This is our 3D point class.  CONFLICTING with Vector.cc
32class CVector3
33{
34public:
35        float x, y, z;
36};
37
38//! This is our 2D point class.  CONFLICTING with Vector.cc
39class CVector2
40{
41public:
42        float x, y;
43};
44
45// CONFLICTING with model.h
46struct tFace
47{
48        int vertIndex[3];                       // indicies for the verts that make up this triangle
49        int coordIndex[3];                      // indicies for the tex coords to texture this face
50};
51
52// CONFLICTING with material.cc, there are some small differences, i will use this struct and switch over later
53struct tMaterialInfo
54{
55        char  strName[255];                     // The texture name
56        char  strFile[255];                     // The texture file name (If this is set it's a texture map)
57        byte  color[3]; // The color of the object (R, G, B)
58        int   texureId;                         // the texture ID
59        float uTile;                            // u tiling of texture 
60        float vTile;                            // v tiling of texture 
61        float uOffset;                      // u offset of texture
62        float vOffset;                          // v offset of texture
63} ;
64
65//! properties of a 3D object
66struct t3DObject
67{
68        int  numOfVerts;                        // The number of verts in the model
69        int  numOfFaces;                        // The number of faces in the model
70        int  numTexVertex;                      // The number of texture coordinates
71        int  materialID;                        // The texture ID to use, which is the index into our texture array
72        bool bHasTexture;                       // This is TRUE if there is a texture map for this object
73        char strName[255];                      // The name of the object
74        CVector3  *pVerts;                      // The object's vertices
75        CVector3  *pNormals;            // The object's normals
76        CVector2  *pTexVerts;           // The texture's UV coordinates
77        tFace *pFaces;                          // The faces information of the object
78};
79
80// CONFLICTING with animation.cc
81struct tAnimationInfo
82{
83        char strName[255];                      // This stores the name of the animation (Jump, Pain, etc..)
84        int startFrame;                         // This stores the first frame number for this animation
85        int endFrame;                           // This stores the last frame number for this animation
86};
87
88// CONFLICTING with animation.cc and vector.cc
89struct t3DModel
90{
91        int numOfObjects;                                       // The number of objects in the model
92        int numOfMaterials;                                     // The number of materials for the model
93        int numOfAnimations;                            // The number of animations in this model (NEW)
94        int currentAnim;                                        // The current index into pAnimations list (NEW)
95        int currentFrame;                                       // The current frame of the current animation (NEW)
96        vector<tAnimationInfo>* animationList; // The list of animations (NEW)
97        vector<tMaterialInfo>* materialList;    // The list of material information (Textures and colors)
98        vector<t3DObject>* objectList;                  // The object list for our model
99};
100
101
102
103//! This class defines the basic components of a model
104class AbstractModel : public BaseObject {
105
106 public:
107  AbstractModel() {}
108  virtual ~AbstractModel() {}
109};
110
111#endif /* _ABSTRACT_MODEL_H */
Note: See TracBrowser for help on using the repository browser.