Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/importer/vertex_array_model.h @ 6114

Last change on this file since 6114 was 6037, checked in by bensch, 19 years ago

orxonox/trunk: triangle Stripper

File size: 1.5 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 "array.h"
14#include <vector>
15
16/* Forward Declaration */
17class Material;
18
19
20/////////////
21/// MODEL ///
22/////////////
23//! Class that handles 3D-Models. it can also read them in and display them.
24/**
25 * this renders models with help of the OpenGL glVertexArray
26 */
27class VertexArrayModel : public Model
28{
29 public:
30  VertexArrayModel();
31  virtual ~VertexArrayModel();
32
33  void draw() const;
34
35
36  void newStripe();
37
38  void addVertex(float x, float y, float z);
39  void addNormal(float x, float y, float z);
40  void addTexCoor(float u, float v);
41  void addIndice(GLubyte indice);
42
43  void finalize();
44
45  //
46  void planeModel();
47
48 private:
49  void importToVertexArray();
50
51 private:
52  bool                       bFinalized;       //!< Sets the Object to be finalized.
53
54  tArray<GLfloat>            vertices;        //!< The Array that handles the Vertices.
55  tArray<GLfloat>            normals;         //!< The Array that handles the Normals.
56  tArray<GLfloat>            texCoords;       //!< The Array that handles the VertexTextureCoordinates.
57
58  tArray<GLubyte>            indices;         //!< The Array that tells us what Vertex is connected to which other one.
59
60  std::vector<GLuint>        stripes;         //!< A lsit of Stripes of this Model.
61
62};
63
64#endif
Note: See TracBrowser for help on using the repository browser.