Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/importer/object.h @ 2823

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

orxonox/trunk/importer: now uses c++ lib <fstream>, and added the OrxOnoX Headers

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;
17extern int verbose;
18
19//! Class that handles 3D-Objects. it can also read them in and display them.
20class Object
21{
22 public:
23  Object ();
24  Object (char* fileName);
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
48  ifstream* OBJ_FILE;
49  ifstream* MTL_FILE;
50 
51  bool readVertex (char* vertexString);
52  bool readFace (char* faceString);
53  bool readVT (char* vtString);
54  bool readVertexNormal (char* normalString);
55  bool readVertexTexture (char* vTextureString);
56  bool readMtlLib (char* matFile);
57  bool readUseMtl (char* mtlString);
58
59  bool addGLElement (char* elementString);
60
61  void BoxObject (void);
62};
63
64#endif
Note: See TracBrowser for help on using the repository browser.