Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/object.h @ 2838

Last change on this file since 2838 was 2835, checked in by bensch, 20 years ago

orxonox/trunk/src: added the files again.

File size: 1.2 KB
Line 
1/*!
2 \file object.h
3 \brief Contains the Object Class that handles 3D-Objects
4*/
5
6#ifndef _OBJECT_H
7#define _OBJECT_H
8
9#include <GL/gl.h>
10#include <GL/glu.h>
11
12#include "array.h"
13#include "material.h"
14#include <fstream>
15
16using namespace std;
17
18//! Class that handles 3D-Objects. it can also read them in and display them.
19class Object
20{
21 public:
22  Object ();
23  Object (char* fileName);
24  Object(char* fileName, float scaling);
25  ~Object ();
26 
27  bool importFile (char* fileName);
28  bool initialize (void);
29  bool finalize(void);
30  void draw (void);
31
32  bool readFromObjFile (char* fileName);
33
34
35 private:
36  GLuint listNumber;
37  Array* vertices;
38  int verticesCount;
39  Array* colors;
40  Array* normals;
41  Array* vTexture;
42  char* objFileName;
43  char* mtlFileName;
44  int faceMode;
45  bool readVertices;
46  Material* material;
47  float scaleFactor;
48
49  ifstream* OBJ_FILE;
50  ifstream* MTL_FILE;
51 
52  bool readVertex (char* vertexString);
53  bool readFace (char* faceString);
54  bool readVT (char* vtString);
55  bool readVertexNormal (char* normalString);
56  bool readVertexTexture (char* vTextureString);
57  bool readMtlLib (char* matFile);
58  bool readUseMtl (char* mtlString);
59
60  bool addGLElement (char* elementString);
61
62  void BoxObject (void);
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.