/*! \file object.h \brief Contains the Object Class that handles 3D-Objects */ #ifndef _OBJECT_H #define _OBJECT_H #include #include #include "array.h" #include "material.h" #include using namespace std; extern int verbose; //! Class that handles 3D-Objects. it can also read them in and display them. class Object { public: Object (); Object (char* fileName); Object(char* fileName, float scaling); ~Object (); bool importFile (char* fileName); bool initialize (void); bool finalize(void); void draw (void); bool readFromObjFile (char* fileName); private: GLuint listNumber; Array* vertices; int verticesCount; Array* colors; Array* normals; Array* vTexture; char* objFileName; char* mtlFileName; int faceMode; bool readVertices; Material* material; float scaleFactor; ifstream* OBJ_FILE; ifstream* MTL_FILE; bool readVertex (char* vertexString); bool readFace (char* faceString); bool readVT (char* vtString); bool readVertexNormal (char* normalString); bool readVertexTexture (char* vTextureString); bool readMtlLib (char* matFile); bool readUseMtl (char* mtlString); bool addGLElement (char* elementString); void BoxObject (void); }; #endif