Changeset 6009 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Dec 10, 2005, 4:07:04 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/Makefile.am
r5861 r6009 4 4 noinst_LIBRARIES = libORXimporter.a 5 5 6 libORXimporter_a_SOURCES = model.cc \ 6 libORXimporter_a_SOURCES = abstract_model.cc \ 7 model.cc \ 7 8 objModel.cc \ 8 9 primitive_model.cc \ -
trunk/src/lib/graphics/importer/abstract_model.cc
r6006 r6009 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Patrick Boenzli 13 13 co-programmer: ... 14 14 */ 15 15 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MODEL 17 17 18 #include " proto_class.h"18 #include "abstract_model.h" 19 19 20 20 using namespace std; … … 25 25 * @todo this constructor is not jet implemented - do it 26 26 */ 27 ProtoClass::ProtoClass()27 AbstractModel::AbstractModel() 28 28 { 29 this->setClassID(CL_PROTO_ID, "ProtoClass"); 29 // this->setClassID(CL_PROTO_ID, "ProtoClass"); 30 this->pModelInfo.numVertices = 0; 31 this->pModelInfo.numTriangles = 0; 32 this->pModelInfo.numTexCoor = 0; 30 33 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 36 Advanced Topics: 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 the object_manager.h header comments. You will use this most certanly only if you 39 make many objects of your class, like a weapon bullet. 40 */ 34 this->pModelInfo.pVertices = NULL; 35 this->pModelInfo.pTriangles = NULL; 36 this->pModelInfo.pNormals = NULL; 37 this->pModelInfo.pTexCoor = NULL; 41 38 } 42 39 … … 45 42 * standard deconstructor 46 43 */ 47 ProtoClass::~ProtoClass()44 AbstractModel::~AbstractModel() 48 45 { 49 46 // delete what has to be deleted here -
trunk/src/lib/graphics/importer/abstract_model.h
r6008 r6009 128 128 129 129 public: 130 AbstractModel() { }131 virtual ~AbstractModel() { }130 AbstractModel(); 131 virtual ~AbstractModel(); 132 132 133 133 inline const modelInfo* getModelInfo() const { return &this->pModelInfo; } … … 153 153 inline unsigned int getFaceCount() const { return this->pModelInfo.numTriangles; }; 154 154 155 155 156 protected: 156 157 modelInfo pModelInfo; //!< Reference to the modelInfo -
trunk/src/lib/graphics/importer/vertex_array_model.cc
r6008 r6009 27 27 using namespace std; 28 28 29 /**30 * cleans up a ModelGroup31 32 actually does the same as the delete Operator, but does not delete the predecessing group33 */34 void ModelGroup::cleanup()35 {36 PRINTF(5)("Cleaning up group\n");37 if (this->firstFace)38 delete this->firstFace;39 this->firstFace = NULL;40 if (this->next)41 this->next->cleanup();42 }43 44 45 29 ///////////// 46 30 /// MODEL /// … … 60 44 this->finalized = false; 61 45 // setting the start group; 62 this->currentGroup = this->firstGroup = new ModelGroup;63 this->groupCount = 0;64 this->vertexCount = 0;65 this->normalCount = 0;66 this->texCoordCount = 0;67 this->faceCount = 0;68 this->triangleCount = 0;69 this->triangles = NULL;70 this->pModelInfo = NULL;71 46 72 47 this->scaleFactor = 1; -
trunk/src/lib/graphics/importer/vertex_array_model.h
r6008 r6009 1 1 /*! 2 \file model.h3 \brief Contains the Model Class that handles 3D-Models2 \file vertex_list_model.h 3 \brief Contains the VertexListModel Class that handles 3D-Models rendered out of VertexArrays 4 4 */ 5 5 … … 9 9 #include "abstract_model.h" 10 10 11 #include "material.h"12 11 #include "glincl.h" 12 13 13 #include "array.h" 14 14 #include <list> … … 24 24 { 25 25 public: 26 Model( const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST);26 Model(); 27 27 virtual ~Model(); 28 28 29 29 void draw() const; 30 30 31 /** @returns a Pointer to the Vertex-Array, if it was deleted it returns NULL */32 inline const GLfloat* getVertexArray() const { return this->vertices->getArray(); };33 /** @returns the VertexCount of this Model */34 inline unsigned int getVertexCount() const { return this->vertexCount; };35 36 /** @returns a Pointer to the Normals-Array, if it was deleted it returns NULL */37 inline const GLfloat* getNormalsArray() const { return this->normals->getArray(); };38 /** @returns the NormalsCount of this Model */39 inline unsigned int getNormalsCount() const { return this->normalCount; };40 41 /** @returns a Pointer to the TexCoord-Array, if it was deleted it returns NULL */42 inline const GLfloat* getTexCoordArray() const { return this->vTexture->getArray(); };43 /** @returns the TexCoord-Count of this Model */44 inline unsigned int getTexCoordCount() const { return this->texCoordCount; };45 46 /** @returns the Count of Faces of this Model */47 inline unsigned int getFaceCount() const { return this->faceCount; };48 49 50 31 Material* addMaterial(Material* material); 51 32 Material* addMaterial(const char* materialName); 52 53 33 54 34 bool addVertex(float x, float y, float z);
Note: See TracChangeset
for help on using the changeset viewer.