Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: added tc a library to convert Vertice-Melanges into VertexArrayStrips. Also implemented it partly in the VertexArrayModel-class…. testing

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  VertexArrayModel(const Model& model);
32  virtual ~VertexArrayModel();
33
34  void draw() const;
35
36
37  void newStripe();
38
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);
43
44  void finalize();
45
46  //
47  void planeModel();
48
49 private:
50  void importToVertexArray();
51
52 private:
53  bool                       bFinalized;       //!< Sets the Object to be finalized.
54
55  tArray<GLfloat>            vertices;        //!< The Array that handles the Vertices.
56  tArray<GLfloat>            normals;         //!< The Array that handles the Normals.
57  tArray<GLfloat>            texCoords;       //!< The Array that handles the VertexTextureCoordinates.
58
59  tArray<GLubyte>            indices;         //!< The Array that tells us what Vertex is connected to which other one.
60
61  std::vector<GLuint>        stripes;         //!< A lsit of Stripes of this Model.
62
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.