Changeset 3430 in orxonox.OLD for orxonox/branches/trackManager/src/importer/model.h
- Timestamp:
- Mar 1, 2005, 9:50:30 AM (19 years ago)
- Location:
- orxonox/branches/trackManager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager
- Property svn:externals set to
-
orxonox/branches/trackManager/src/importer/model.h
r3369 r3430 7 7 #define _MODEL_H 8 8 9 #include "../stdincl.h"9 //#include "../stdincl.h" 10 10 11 #include "array.h"12 11 #include "material.h" 13 #include "vector.h" 14 #include <fstream> 12 13 // FORWARD DEFINITION // 14 class Array; 15 class Vector; 15 16 16 17 using namespace std; 17 18 18 19 enum PRIMITIVE {PLANE, CUBE, SPHERE, CYLINDER}; 19 20 20 21 //! Class that handles 3D-Models. it can also read them in and display them. … … 22 23 { 23 24 public: 24 Model (); 25 Model (char* fileName); 26 Model(char* fileName, float scaling); 27 ~Model (); 25 Model(void); 26 Model(PRIMITIVE type); 27 Model(char* modelName); 28 virtual ~Model(void); 29 30 void setName(const char* name); 28 31 29 void draw 30 void draw 31 void draw 32 void draw(void) const; 33 void draw(int groupNumber) const; 34 void draw(char* groupName) const; 32 35 int getGroupCount() const; 33 36 34 private: 37 protected: 38 char* name; //!< This is the name of the Model. 39 bool finalized; //!< Sets the Object to be finalized. 40 35 41 //! This is the placeholder of one Vertex beloning to a Face. 36 struct FaceElement 42 struct FaceElement 37 43 { 38 44 int vertexNumber; //!< The number of the Vertex out of the Array* vertices, this vertex points to. … … 43 49 44 50 //! This is the placeholder of a Face belonging to a Group of Faces. 45 /** 46 \todo take Material to a call for itself. 47 48 This can also be a Material-Change switch. 49 That means if you want to change a Material inside of a group, 50 you can create an empty face and apply a material to it, and the Importer will cahnge Colors 51 */ 52 struct Face 51 struct Face 53 52 { 54 53 int vertexCount; //!< The Count of vertices this Face has. … … 65 64 char* name; //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function. 66 65 67 GLuint listNumber;//!< The number of the GL-List this Group gets.66 unsigned int listNumber;//!< The number of the GL-List this Group gets. 68 67 Face* firstFace; //!< The first Face in this group. 69 68 Face* currentFace; //!< The current Face in this Group (the one we are currently working with.) … … 88 87 float scaleFactor; //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation 89 88 90 char* objPath; //!< The Path wher the obj and mtl-file are located. 91 char* objFileName; //!< The Name of the obj-file. 92 char* mtlFileName; //!< The Name of the mtl-file (parsed out of the obj-file) 93 94 bool initialize (void); 89 bool initialize(void); 95 90 bool initGroup(Group* group); 96 91 bool initFace (Face* face); … … 100 95 bool cleanupFaceElement(FaceElement* faceElem); 101 96 102 ///// readin /// 103 bool importFile (char* fileName); 104 bool readFromObjFile (void); 105 106 bool readGroup (char* groupString); 107 bool readVertex (char* vertexString); 108 bool readFace (char* faceString); 109 bool readVertexNormal (char* normalString); 110 bool readVertexTexture (char* vTextureString); 111 bool readMtlLib (char* matFile); 112 bool readUseMtl (char* mtlString); 97 public: 98 bool addGroup(char* groupString); 99 bool addVertex(char* vertexString); 100 bool addVertex(const float x, const float y, const float z); 101 bool addFace(char* faceString); 102 bool addFace(const float faceElemCount, int type, ...); 103 bool addVertexNormal(char* normalString); 104 bool addVertexNormal(const float x, const float y, const float z); 105 bool addVertexTexture(char* vTextureString); 106 bool addVertexTexture(const float u, const float v); 107 bool addUseMtl(char* mtlString); 108 void finalize(void); 113 109 114 bool importToGL (void); 115 bool addGLElement (FaceElement* elem); 110 protected: 111 bool importToGL(void); 112 bool addGLElement(FaceElement* elem); 116 113 117 bool buildVertexNormals ();114 bool buildVertexNormals(void); 118 115 119 void BoxModel (void); 116 void cubeModel(void); 117 void sphereModel(void); 118 void cylinderModel(void); 120 119 }; 121 120
Note: See TracChangeset
for help on using the changeset viewer.