Changeset 6031 in orxonox.OLD for trunk/src/lib/graphics/importer/static_model.h
- Timestamp:
- Dec 10, 2005, 11:18:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/static_model.h
r6022 r6031 16 16 // FORWARD DECLARATION // 17 17 template<class T> class tArray; 18 19 20 //! an enumerator fot the different Model Types.21 /**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.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 stuff25 */26 typedef enum MODEL_TYPE {27 MODEL_DISPLAY_LIST,28 MODEL_VERTEX_ARRAY29 };30 31 18 32 19 // definition of different modes for setting up Faces … … 111 98 { 112 99 public: 113 StaticModel(const char* modelName = NULL , MODEL_TYPE type = MODEL_DISPLAY_LIST);100 StaticModel(const char* modelName = NULL); 114 101 virtual ~StaticModel(); 115 102 … … 120 107 void rebuild(); 121 108 122 /** @returns Count of the Models (Groups) in this File */123 inline int getGroupCount() const { return this->groupCount; };124 125 /** @returns a Pointer to the Vertex-Array, if it was deleted it returns NULL */126 inline const GLfloat* getVertexArray() const { return this->vertices->getArray(); };127 /** @returns the VertexCount of this Model */128 inline unsigned int getVertexCount() const { return this->vertexCount; };129 130 /** @returns a Pointer to the Normals-Array, if it was deleted it returns NULL */131 inline const GLfloat* getNormalsArray() const { return this->normals->getArray(); };132 /** @returns the NormalsCount of this Model */133 inline unsigned int getNormalsCount() const { return this->normalCount; };134 135 /** @returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */136 inline const GLfloat* getTexCoordArray() const { return this->vTexture->getArray(); };137 /** @returns the TexCoord-Count of this Model */138 inline unsigned int getTexCoordCount() const { return this->texCoordCount; };139 140 /** @returns the Count of Faces of this Model */141 inline unsigned int getFaceCount() const { return this->faceCount; };142 143 144 109 Material* addMaterial(Material* material); 145 110 Material* addMaterial(const char* materialName); 146 111 147 112 bool addGroup(const char* groupString); 113 148 114 bool addVertex(const char* vertexString); 149 115 bool addVertex(float x, float y, float z); 116 150 117 bool addFace(const char* faceString); 151 118 bool addFace(int faceElemCount, VERTEX_FORMAT type, ...); 119 152 120 bool addVertexNormal(const char* normalString); 153 121 bool addVertexNormal(float x, float y, float z); 122 154 123 bool addVertexTexture(const char* vTextureString); 155 124 bool addVertexTexture(float u, float v); 125 156 126 bool setMaterial(const char* mtlString); 157 127 bool setMaterial(Material* mtl); 128 158 129 void finalize(); 159 130 … … 163 134 164 135 Material* findMaterialByName(const char* materialName); 165 166 136 167 137 protected: … … 173 143 bool importToDisplayList(); 174 144 bool buildTriangleList(); 145 175 146 bool addGLElement(ModelFaceElement* elem); 176 147 177 bool importToVertexArray();178 179 bool deleteArrays();180 148 bool cleanup(); 181 149 182 150 private: 183 MODEL_TYPE type; //!< A type for the Model184 151 bool finalized; //!< Sets the Object to be finalized. 185 152 186 unsigned int vertexCount; //!< A modelwide Counter for vertices.187 unsigned int normalCount; //!< A modelwide Counter for the normals.188 unsigned int texCoordCount; //!< A modelwide Counter for the texCoord.189 153 unsigned int faceCount; //!< A modelwide Counter for the faces 190 unsigned int triangleCount; //!< Number of triangles >= faceCount 191 tArray<GLfloat>* vertices; //!< The Array that handles the Vertices. 192 tArray<GLfloat>* normals; //!< The Array that handles the Normals. 193 tArray<GLfloat>* vTexture; //!< The Array that handles the VertexTextureCoordinates. 194 sTriangleExt* triangles; //!< The Array of triangles in the model.h style 154 155 tArray<GLfloat> vertices; //!< The Array that handles the Vertices. 156 tArray<GLfloat> normals; //!< The Array that handles the Normals. 157 tArray<GLfloat> vTexture; //!< The Array that handles the VertexTextureCoordinates. 195 158 196 159 ModelGroup* firstGroup; //!< The first of all groups.
Note: See TracChangeset
for help on using the changeset viewer.