source:
orxonox.OLD/orxonox/trunk/importer/object.h
@
2848
Last change on this file since 2848 was 2842, checked in by bensch, 20 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[2823] | 1 | /*! |
[2842] | 2 | \file object.h |
3 | \brief Contains the Object Class that handles 3D-Objects | |
[2823] | 4 | */ |
5 | ||
[2776] | 6 | #ifndef _OBJECT_H |
7 | #define _OBJECT_H | |
[2773] | 8 | |
9 | #include <GL/gl.h> | |
10 | #include <GL/glu.h> | |
11 | ||
[2754] | 12 | #include "array.h" |
[2776] | 13 | #include "material.h" |
[2823] | 14 | #include <fstream> |
[2748] | 15 | |
[2823] | 16 | using namespace std; |
[2804] | 17 | |
[2842] | 18 | extern int verbose; //!< fill be removed and added again as a verbose-class |
19 | ||
20 | ||
[2823] | 21 | //! Class that handles 3D-Objects. it can also read them in and display them. |
[2748] | 22 | class Object |
23 | { | |
24 | public: | |
25 | Object (); | |
[2767] | 26 | Object (char* fileName); |
[2833] | 27 | Object(char* fileName, float scaling); |
[2748] | 28 | ~Object (); |
29 | ||
[2767] | 30 | bool importFile (char* fileName); |
31 | bool initialize (void); | |
32 | bool finalize(void); | |
33 | void draw (void); | |
34 | ||
[2754] | 35 | bool readFromObjFile (char* fileName); |
[2748] | 36 | |
37 | ||
38 | private: | |
39 | GLuint listNumber; | |
[2754] | 40 | Array* vertices; |
41 | int verticesCount; | |
42 | Array* colors; | |
[2794] | 43 | Array* normals; |
[2820] | 44 | Array* vTexture; |
[2804] | 45 | char* objFileName; |
46 | char* mtlFileName; | |
[2767] | 47 | int faceMode; |
48 | bool readVertices; | |
[2776] | 49 | Material* material; |
[2833] | 50 | float scaleFactor; |
[2760] | 51 | |
[2765] | 52 | ifstream* OBJ_FILE; |
53 | ifstream* MTL_FILE; | |
[2748] | 54 | |
[2767] | 55 | bool readVertex (char* vertexString); |
56 | bool readFace (char* faceString); | |
57 | bool readVT (char* vtString); | |
[2794] | 58 | bool readVertexNormal (char* normalString); |
[2820] | 59 | bool readVertexTexture (char* vTextureString); |
[2776] | 60 | bool readMtlLib (char* matFile); |
61 | bool readUseMtl (char* mtlString); | |
[2754] | 62 | |
[2768] | 63 | bool addGLElement (char* elementString); |
[2821] | 64 | |
65 | void BoxObject (void); | |
[2748] | 66 | }; |
[2773] | 67 | |
68 | #endif |
Note: See TracBrowser
for help on using the repository browser.