source:
orxonox.OLD/trunk/src/lib/graphics/importer/vertex_array_model.h
@
6308
Last change on this file since 6308 was 6308, checked in by bensch, 18 years ago | |
---|---|
File size: 1.5 KB |
Rev | Line | |
---|---|---|
[2823] | 1 | /*! |
[6010] | 2 | * @file vertex_array_model.h |
3 | * @brief Contains the VertexArrayModel Class that handles 3D-Models rendered out of VertexArrays | |
4 | */ | |
[2823] | 5 | |
[6010] | 6 | #ifndef _VERTEX_ARRAY_MODEL_H |
7 | #define _VERTEX_ARRAY_MODEL_H | |
[2773] | 8 | |
[6022] | 9 | #include "model.h" |
[5701] | 10 | |
[3917] | 11 | #include "glincl.h" |
[6009] | 12 | |
[4577] | 13 | #include "array.h" |
[6037] | 14 | #include <vector> |
[2748] | 15 | |
[6010] | 16 | /* Forward Declaration */ |
17 | class Material; | |
[3427] | 18 | |
[6010] | 19 | |
[4022] | 20 | ///////////// |
21 | /// MODEL /// | |
22 | ///////////// | |
23 | //! Class that handles 3D-Models. it can also read them in and display them. | |
[6037] | 24 | /** |
25 | * this renders models with help of the OpenGL glVertexArray | |
26 | */ | |
[6022] | 27 | class VertexArrayModel : public Model |
[4022] | 28 | { |
[3398] | 29 | public: |
[6010] | 30 | VertexArrayModel(); |
[6308] | 31 | VertexArrayModel(const Model& model); |
[6010] | 32 | virtual ~VertexArrayModel(); |
[3910] | 33 | |
[4746] | 34 | void draw() const; |
[3910] | 35 | |
[6037] | 36 | |
37 | void newStripe(); | |
38 | ||
[6010] | 39 | void addVertex(float x, float y, float z); |
40 | void addNormal(float x, float y, float z); | |
41 | void addTexCoor(float u, float v); | |
42 | void addIndice(GLubyte indice); | |
[4106] | 43 | |
[6010] | 44 | void finalize(); |
[4468] | 45 | |
[6308] | 46 | // |
[6037] | 47 | void planeModel(); |
[4468] | 48 | |
49 | private: | |
[6012] | 50 | void importToVertexArray(); |
[4468] | 51 | |
52 | private: | |
[6037] | 53 | bool bFinalized; //!< Sets the Object to be finalized. |
[4468] | 54 | |
[6008] | 55 | tArray<GLfloat> vertices; //!< The Array that handles the Vertices. |
56 | tArray<GLfloat> normals; //!< The Array that handles the Normals. | |
[6010] | 57 | tArray<GLfloat> texCoords; //!< The Array that handles the VertexTextureCoordinates. |
[4468] | 58 | |
[6010] | 59 | tArray<GLubyte> indices; //!< The Array that tells us what Vertex is connected to which other one. |
[6037] | 60 | |
61 | std::vector<GLuint> stripes; //!< A lsit of Stripes of this Model. | |
62 | ||
[2748] | 63 | }; |
[2773] | 64 | |
65 | #endif |
Note: See TracBrowser
for help on using the repository browser.