#ifndef OBJ_H
#define OBJ_H
using namespace std;
/*-----------------------------------------------------------------//
//Here we have our data types our loader class will need and use...//
// */
struct ObjVertex{
float X, Y, Z;
};
struct ObjNormal{
float X, Y, Z;
};
struct ObjTexCoord{
float U, V;
};
struct ObjTriangle{
int Vertex[3];
int Normal[3];
int TexCoord[3];
int Texture;
};
class ObjModel {
public:
ObjModel();
~ObjModel();
ObjModel(const ObjModel& copy);
ObjModel& operator=(const ObjModel& right);
int NumVertex, NumNormal, NumTexCoord, NumTriangle;
ObjVertex *VertexArray;
ObjNormal *NormalArray;
ObjTexCoord *TexCoordArray;
ObjTriangle *TriangleArray;
};
/* //
//-----------------------------------------------------------------*/
/*-----------------------------------------------------------------//
// The meat of the sandwitch, the class to load .obj files //
// */
class ObjLoader {
public:
ObjLoader();
~ObjLoader();
ObjLoader(string file);
void LoadObj(string file);
void FreeObj(void);
ObjModel ReturnObj(void);
protected:
string *fileName;
ObjModel *theObj;
void ReadData(void);
};
/* //
//-----------------------------------------------------------------*/
#endif