Changeset 4577 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer/model.h
- Timestamp:
- Jun 10, 2005, 2:32:13 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.h
r4529 r4577 7 7 #define _MODEL_H 8 8 9 #include "base_object.h" 9 10 #include "material.h" 10 11 #include "glincl.h" 12 #include "array.h" 13 11 14 12 15 // FORWARD DEFINITION // … … 19 22 MODEL_DISPLAY_LIST means, that a DisplayList will be built out of the model. This model will be STATIC, meaning it cannot be changed after initialisation. 20 23 MODEL_VERTEX_ARRAY means, that a VertexArray will be built out of the model. This moel will be DYNAMIX, meaning that one can change the properties from outside of the model. 24 * \todo implement this stuff 21 25 */ 22 26 typedef enum MODEL_TYPE {MODEL_DISPLAY_LIST, 23 27 MODEL_VERTEX_ARRAY}; 24 28 25 29 … … 30 34 31 35 //! an enumerator for VERTEX_FORMAT 32 typedef enum VERTEX_FORMAT { VERTEX_ONLY = VERTEX,33 34 35 VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};36 typedef enum VERTEX_FORMAT { VERTEX_ONLY = VERTEX, 37 VERTEX_NORMAL = NORMAL, 38 VERTEX_TEXCOORD = TEXCOORD, 39 VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD }; 36 40 37 41 //////////////////// … … 45 49 ~ModelFaceElement(); 46 50 47 int vertexNumber; //!< The number of the Vertex out of the Array* vertices, this vertex points to.48 int normalNumber; //!< The number of the Normal out of the Array* normals, this vertex points to.49 int texCoordNumber; //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.51 int vertexNumber; //!< The number of the Vertex out of the Array* vertices, this vertex points to. 52 int normalNumber; //!< The number of the Normal out of the Array* normals, this vertex points to. 53 int texCoordNumber; //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to. 50 54 51 ModelFaceElement* next; //!< Point to the next FaceElement in this List.55 ModelFaceElement* next; //!< Point to the next FaceElement in this List. 52 56 }; 53 57 … … 58 62 ModelFace(); 59 63 ~ModelFace(); 60 61 intvertexCount; //!< The Count of vertices this Face has.64 65 unsigned int vertexCount; //!< The Count of vertices this Face has. 62 66 ModelFaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face. 63 67 Material* material; //!< The Material to use. 64 68 65 69 ModelFace* next; //!< Pointer to the next Face. 66 }; 70 }; 67 71 68 72 //! Group to handle multiple Models per obj-file. … … 82 86 int faceMode; //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material, 3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM... 83 87 int faceCount; //!< The Number of Faces this Group holds. 84 88 85 89 ModelGroup* next; //!< Pointer to the next Group. 86 90 }; … … 91 95 92 96 //! Class that handles 3D-Models. it can also read them in and display them. 93 class Model 97 class Model : public BaseObject 94 98 { 95 99 public: … … 97 101 virtual ~Model(void); 98 102 99 void setName(const char* name);100 /** \returns the Name of the Model */101 inline const char* getName() {return this->name;}102 103 103 void draw(void) const; 104 104 void draw(int groupNumber) const; … … 106 106 107 107 /** \returns Count of the Models (Groups) in this File */ 108 inline int getGroupCount(void) const {return this->groupCount;} 108 inline int getGroupCount(void) const { return this->groupCount; }; 109 110 /** \returns a Pointer to the Vertex-Array, if it was deleted it returns NULL */ 111 inline const GLfloat* getVertexArray(void) const { return this->vertices->getArray(); }; 112 /** \returns the VertexCount of this Model */ 113 inline unsigned int getVertexArrayCount(void) const { return this->vertexCount; }; 114 115 /** \returns a Pointer to the Normals-Array, if it was deleted it returns NULL */ 116 inline const GLfloat* getNormalsArray(void) const { return this->normals->getArray(); }; 117 /** \returns the NormalsCount of this Model */ 118 inline unsigned int getNormalsArrayCount(void) const { return this->normalCount; }; 119 120 /** \returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */ 121 inline const GLfloat* getTexCoordArray(void) const { return this->vTexture->getArray(); }; 122 /** \returns the TexCoord-Count of this Model */ 123 inline unsigned int getTexCoordArrayCount(void) const { return this->texCoordCount; }; 124 109 125 110 126 Material* addMaterial(Material* material); … … 152 168 153 169 private: 154 char* name; //!< This is the name of the Model.155 170 MODEL_TYPE type; //!< A type for the Model 156 171 bool finalized; //!< Sets the Object to be finalized. 157 172 158 intvertexCount; //!< A modelwide Counter for vertices.159 intnormalCount; //!< A modelwide Counter for the normals.160 inttexCoordCount; //!< A modelwide Counter for the texCoord.173 unsigned int vertexCount; //!< A modelwide Counter for vertices. 174 unsigned int normalCount; //!< A modelwide Counter for the normals. 175 unsigned int texCoordCount; //!< A modelwide Counter for the texCoord. 161 176 Array* vertices; //!< The Array that handles the Vertices. 162 177 Array* normals; //!< The Array that handles the Normals.
Note: See TracChangeset
for help on using the changeset viewer.