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