Changeset 4468 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer
- Timestamp:
- Jun 2, 2005, 1:47:16 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.h
r4106 r4468 28 28 #define NORMAL 1 //!< If Faces are created WITH Normals (otherwise autocalculate) 29 29 #define TEXCOORD 2 //!< If Faces are created WITH TextureCoordinate 30 30 31 //! an enumerator for VERTEX_FORMAT 31 32 typedef enum VERTEX_FORMAT {VERTEX_ONLY = VERTEX, 32 VERTEX_NORMAL = NORMAL,33 VERTEX_TEXCOORD = TEXCOORD,34 VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};33 VERTEX_NORMAL = NORMAL, 34 VERTEX_TEXCOORD = TEXCOORD, 35 VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD}; 35 36 36 37 //////////////////// … … 44 45 ~ModelFaceElement(); 45 46 46 int vertexNumber; //!< The number of the Vertex out of the Array* vertices, this vertex points to. 47 int normalNumber; //!< The number of the Normal out of the Array* normals, this vertex points to. 48 int texCoordNumber; //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to. 49 ModelFaceElement* next; //!< Point to the next FaceElement in this List. 47 int vertexNumber; //!< The number of the Vertex out of the Array* vertices, this vertex points to. 48 int normalNumber; //!< The number of the Normal out of the Array* normals, this vertex points to. 49 int texCoordNumber; //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to. 50 51 ModelFaceElement* next; //!< Point to the next FaceElement in this List. 50 52 }; 51 53 … … 56 58 ModelFace(); 57 59 ~ModelFace(); 58 59 int vertexCount; //!< The Count of vertices this Face has.60 ModelFaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face.61 60 62 Material* material; //!< The Material to use. 61 int vertexCount; //!< The Count of vertices this Face has. 62 ModelFaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face. 63 Material* material; //!< The Material to use. 63 64 64 ModelFace* next;//!< Pointer to the next Face.65 ModelFace* next; //!< Pointer to the next Face. 65 66 }; 66 67 … … 74 75 void cleanup(); 75 76 76 char* name; //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function. 77 char* name; //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function. 78 GLubyte* indices; //!< The indices of the Groups. Needed for vertex-arrays 79 GLuint listNumber; //!< The number of the GL-List this Group gets. 80 ModelFace* firstFace; //!< The first Face in this group. 81 ModelFace* currentFace; //!< The current Face in this Group (the one we are currently working with.) 82 int faceMode; //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material, 3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM... 83 int faceCount; //!< The Number of Faces this Group holds. 77 84 78 GLubyte* indices; //!< The indices of the Groups. Needed for vertex-arrays 79 GLuint listNumber; //!< The number of the GL-List this Group gets. 80 ModelFace* firstFace; //!< The first Face in this group. 81 ModelFace* currentFace; //!< The current Face in this Group (the one we are currently working with.) 82 int faceMode; //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material, 3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM... 83 int faceCount; //!< The Number of Faces this Group holds. 84 85 ModelGroup* next; //!< Pointer to the next Group. 85 ModelGroup* next; //!< Pointer to the next Group. 86 86 }; 87 87 … … 93 93 class Model 94 94 { 95 private:96 97 char* name; //!< This is the name of the Model.98 MODEL_TYPE type; //!< A type for the Model99 bool finalized; //!< Sets the Object to be finalized.100 101 int vertexCount; //!< A modelwide Counter for vertices.102 int normalCount; //!< A modelwide Counter for the normals.103 int texCoordCount; //!< A modelwide Counter for the texCoord.104 Array* vertices; //!< The Array that handles the Vertices.105 Array* normals; //!< The Array that handles the Normals.106 Array* vTexture; //!< The Array that handles the VertexTextureCoordinates.107 108 ModelGroup* firstGroup; //!< The first of all groups.109 ModelGroup* currentGroup; //!< The currentGroup. this is the one we will work with.110 int groupCount; //!< The Count of Groups.111 112 tList<Material>* materialList;//!< A list for all the Materials in this Model113 114 bool buildVertexNormals(void);115 116 bool importToDisplayList(void);117 bool addGLElement(ModelFaceElement* elem);118 119 bool importToVertexArray(void);120 121 bool deleteArrays(void);122 bool cleanup(void);123 124 125 protected:126 float scaleFactor; //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation127 128 Material* findMaterialByName(const char* materialName);129 130 void cubeModel(void);131 132 95 public: 133 96 Model(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST); … … 167 130 /** \returns The number of Texture Coordinates of the Model*/ 168 131 inline int getTexCoordCount(void) const {return this->texCoordCount;} 132 133 protected: 134 float scaleFactor; //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation 135 void cubeModel(void); 136 137 Material* findMaterialByName(const char* materialName); 138 139 private: 140 bool buildVertexNormals(void); 141 142 bool importToDisplayList(void); 143 bool addGLElement(ModelFaceElement* elem); 144 145 bool importToVertexArray(void); 146 147 bool deleteArrays(void); 148 bool cleanup(void); 149 150 private: 151 char* name; //!< This is the name of the Model. 152 MODEL_TYPE type; //!< A type for the Model 153 bool finalized; //!< Sets the Object to be finalized. 154 155 int vertexCount; //!< A modelwide Counter for vertices. 156 int normalCount; //!< A modelwide Counter for the normals. 157 int texCoordCount; //!< A modelwide Counter for the texCoord. 158 Array* vertices; //!< The Array that handles the Vertices. 159 Array* normals; //!< The Array that handles the Normals. 160 Array* vTexture; //!< The Array that handles the VertexTextureCoordinates. 161 162 ModelGroup* firstGroup; //!< The first of all groups. 163 ModelGroup* currentGroup; //!< The currentGroup. this is the one we will work with. 164 int groupCount; //!< The Count of Groups. 165 166 tList<Material>* materialList; //!< A list for all the Materials in this Model 169 167 }; 170 168 -
orxonox/trunk/src/lib/graphics/importer/objModel.h
r4117 r4468 17 17 18 18 private: 19 // Variables20 char* objPath; //!< The Path where the obj and mtl-file are located.21 22 19 ///// readin ///// 23 20 bool importFile (const char* fileName); 24 21 bool readFromObjFile (const char* fileName); 25 22 bool readMtlLib (const char* matFile); 23 24 private: 25 char* objPath; //!< The Path where the obj and mtl-file are located. 26 26 }; 27 27 -
orxonox/trunk/src/lib/graphics/importer/primitive_model.cc
r4112 r4468 36 36 { 37 37 default: 38 case CUBE:38 case PRIM_CUBE: 39 39 this->cubeModel(); 40 40 break; 41 case SPHERE:41 case PRIM_SPHERE: 42 42 this->sphereModel(size, detail); 43 43 break; 44 case CYLINDER:44 case PRIM_CYLINDER: 45 45 this->cylinderModel(); 46 46 break; 47 case CONE:47 case PRIM_CONE: 48 48 this->coneModel(size, detail); 49 49 break; 50 case P LANE:50 case PRIM_PLANE: 51 51 this->planeModel(size, detail); 52 52 break; -
orxonox/trunk/src/lib/graphics/importer/primitive_model.h
r3658 r4468 11 11 12 12 //! Specification of different primitives the Model knows 13 enum PRIMITIVE {CUBE, SPHERE, PLANE, CYLINDER, CONE}; 14 15 // FORWARD DEFINITION \\ 13 enum PRIMITIVE { PRIM_CUBE, 14 PRIM_SPHERE, 15 PRIM_PLANE, 16 PRIM_CYLINDER, 17 PRIM_CONE }; 16 18 17 19 //! A Class to create some default Models
Note: See TracChangeset
for help on using the changeset viewer.