Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk/importer: check if mtl exists, vn, vt do not have to be defined. Scaling ablility.

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(char* fileName, float scaling);
26  ~Object ();
27 
28  bool importFile (char* fileName);
29  bool initialize (void);
30  bool finalize(void);
31  void draw (void);
32
33  bool readFromObjFile (char* fileName);
34
35
36 private:
37  GLuint listNumber;
38  Array* vertices;
39  int verticesCount;
40  Array* colors;
41  Array* normals;
42  Array* vTexture;
43  char* objFileName;
44  char* mtlFileName;
45  int faceMode;
46  bool readVertices;
47  Material* material;
48  float scaleFactor;
49
50  ifstream* OBJ_FILE;
51  ifstream* MTL_FILE;
52 
53  bool readVertex (char* vertexString);
54  bool readFace (char* faceString);
55  bool readVT (char* vtString);
56  bool readVertexNormal (char* normalString);
57  bool readVertexTexture (char* vTextureString);
58  bool readMtlLib (char* matFile);
59  bool readUseMtl (char* mtlString);
60
61  bool addGLElement (char* elementString);
62
63  void BoxObject (void);
64};
65
66#endif
Note: See TracBrowser for help on using the repository browser.