[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 | |
---|
[6037] | 13 | #include <vector> |
---|
[2748] | 14 | |
---|
[6010] | 15 | /* Forward Declaration */ |
---|
| 16 | class Material; |
---|
[3427] | 17 | |
---|
[6010] | 18 | |
---|
[4022] | 19 | ///////////// |
---|
| 20 | /// MODEL /// |
---|
| 21 | ///////////// |
---|
| 22 | //! Class that handles 3D-Models. it can also read them in and display them. |
---|
[6037] | 23 | /** |
---|
| 24 | * this renders models with help of the OpenGL glVertexArray |
---|
| 25 | */ |
---|
[6022] | 26 | class VertexArrayModel : public Model |
---|
[4022] | 27 | { |
---|
[3398] | 28 | public: |
---|
[6010] | 29 | VertexArrayModel(); |
---|
| 30 | virtual ~VertexArrayModel(); |
---|
[3910] | 31 | |
---|
[4746] | 32 | void draw() const; |
---|
[3910] | 33 | |
---|
[6037] | 34 | |
---|
| 35 | void newStripe(); |
---|
| 36 | |
---|
[6010] | 37 | void addVertex(float x, float y, float z); |
---|
| 38 | void addNormal(float x, float y, float z); |
---|
| 39 | void addTexCoor(float u, float v); |
---|
[6259] | 40 | void addColor(float r, float g, float b); |
---|
| 41 | |
---|
[6265] | 42 | void addIndice(GLuint indice); |
---|
[4106] | 43 | |
---|
[6010] | 44 | void finalize(); |
---|
[4468] | 45 | |
---|
[6259] | 46 | // |
---|
[6037] | 47 | void planeModel(); |
---|
[6262] | 48 | void spiralSphere(const float radius, const unsigned int loops, const unsigned int segmentsPerLoop); |
---|
[4468] | 49 | |
---|
[6262] | 50 | void debug() const; |
---|
| 51 | |
---|
[4468] | 52 | private: |
---|
[6012] | 53 | void importToVertexArray(); |
---|
[4468] | 54 | |
---|
| 55 | private: |
---|
[6037] | 56 | bool bFinalized; //!< Sets the Object to be finalized. |
---|
[4468] | 57 | |
---|
[6262] | 58 | std::vector<GLfloat> vertices; //!< The Array that handles the Vertices. |
---|
| 59 | std::vector<GLfloat> normals; //!< The Array that handles the Normals. |
---|
| 60 | std::vector<GLfloat> texCoords; //!< The Array that handles the VertexTextureCoordinates. |
---|
| 61 | std::vector<GLfloat> colors; //!< The Array that handles Colors. |
---|
[4468] | 62 | |
---|
[6265] | 63 | std::vector<GLuint> indices; //!< The Array that tells us what Vertex is connected to which other one. |
---|
[6037] | 64 | |
---|
| 65 | std::vector<GLuint> stripes; //!< A lsit of Stripes of this Model. |
---|
| 66 | |
---|
[2748] | 67 | }; |
---|
[2773] | 68 | |
---|
| 69 | #endif |
---|