Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/height_map/src/lib/graphics/importer/vertex_array_model.h @ 6265

Last change on this file since 6265 was 6265, checked in by bensch, 18 years ago

heightMap: drawing works: *fu* GLubyte…

File size: 1.7 KB
Line 
1/*!
2 * @file vertex_array_model.h
3 * @brief Contains the VertexArrayModel Class that handles 3D-Models rendered out of VertexArrays
4 */
5
6#ifndef _VERTEX_ARRAY_MODEL_H
7#define _VERTEX_ARRAY_MODEL_H
8
9#include "model.h"
10
11#include "glincl.h"
12
13#include <vector>
14
15/* Forward Declaration */
16class Material;
17
18
19/////////////
20/// MODEL ///
21/////////////
22//! Class that handles 3D-Models. it can also read them in and display them.
23/**
24 * this renders models with help of the OpenGL glVertexArray
25 */
26class VertexArrayModel : public Model
27{
28 public:
29  VertexArrayModel();
30  virtual ~VertexArrayModel();
31
32  void draw() const;
33
34
35  void newStripe();
36
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);
40  void addColor(float r, float g, float b);
41
42  void addIndice(GLuint indice);
43
44  void finalize();
45
46  //
47  void planeModel();
48  void spiralSphere(const float radius, const unsigned int loops, const unsigned int segmentsPerLoop);
49
50  void debug() const;
51
52 private:
53  void importToVertexArray();
54
55 private:
56  bool                       bFinalized;       //!< Sets the Object to be finalized.
57
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.
62
63  std::vector<GLuint>        indices;         //!< The Array that tells us what Vertex is connected to which other one.
64
65  std::vector<GLuint>        stripes;         //!< A lsit of Stripes of this Model.
66
67};
68
69#endif
Note: See TracBrowser for help on using the repository browser.