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










