Changeset 6010 in orxonox.OLD for trunk/src/lib/graphics/importer/vertex_array_model.h
- Timestamp:
- Dec 10, 2005, 5:10:32 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/vertex_array_model.h
r6009 r6010 1 1 /*! 2 \file vertex_list_model.h3 \brief Contains the VertexListModel Class that handles 3D-Models rendered out of VertexArrays4 */2 * @file vertex_array_model.h 3 * @brief Contains the VertexArrayModel Class that handles 3D-Models rendered out of VertexArrays 4 */ 5 5 6 #ifndef _ MODEL_H7 #define _ MODEL_H6 #ifndef _VERTEX_ARRAY_MODEL_H 7 #define _VERTEX_ARRAY_MODEL_H 8 8 9 9 #include "abstract_model.h" … … 14 14 #include <list> 15 15 16 // FORWARD DECLARATION // 17 template<class T> class tArray; 16 /* Forward Declaration */ 17 class Material; 18 18 19 19 20 ///////////// … … 21 22 ///////////// 22 23 //! Class that handles 3D-Models. it can also read them in and display them. 23 class Model : public AbstractModel24 class VertexArrayModel : public AbstractModel 24 25 { 25 26 public: 26 Model();27 virtual ~ Model();27 VertexArrayModel(); 28 virtual ~VertexArrayModel(); 28 29 29 30 void draw() const; 30 31 31 Material* addMaterial(Material* material); 32 Material* addMaterial(const char* materialName); 32 void addVertex(float x, float y, float z); 33 33 34 bool addVertex(float x, float y, float z);34 void addNormal(float x, float y, float z); 35 35 36 bool addVertexNormal(float x, float y, float z);36 void addTexCoor(float u, float v); 37 37 38 bool addVertexTexture(float u, float v); 39 40 bool addFace(int faceElemCount, VERTEX_FORMAT type, ...); 41 42 bool addGroup(const char* groupString); 43 44 bool setMaterial(Material* mtl); 38 void addIndice(GLubyte indice); 45 39 46 40 void finalize(); 47 41 48 42 43 void cubeModel(); 44 49 45 private: 50 bool buildTriangleList();51 52 bool addGLElement(ModelFaceElement* elem);53 54 46 bool importToVertexArray(); 55 47 56 bool deleteArrays();57 48 bool cleanup(); 58 49 … … 62 53 tArray<GLfloat> vertices; //!< The Array that handles the Vertices. 63 54 tArray<GLfloat> normals; //!< The Array that handles the Normals. 64 tArray<GLfloat> tex tures;//!< The Array that handles the VertexTextureCoordinates.55 tArray<GLfloat> texCoords; //!< The Array that handles the VertexTextureCoordinates. 65 56 66 tArray<GLfloat> indices; //!< The Array that tells us what Vertex is connected to which other one. 67 68 std::list<ModelMaterial*> materialList; //!< A list for all the Materials in this Model 57 tArray<GLubyte> indices; //!< The Array that tells us what Vertex is connected to which other one. 69 58 }; 70 59
Note: See TracChangeset
for help on using the changeset viewer.