Changeset 6021 in orxonox.OLD for branches/newModel/src/lib/graphics/importer/static_model.cc
- Timestamp:
- Dec 10, 2005, 7:52:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newModel/src/lib/graphics/importer/static_model.cc
r6020 r6021 18 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER 19 19 20 #include " model.h"20 #include "static_model.h" 21 21 22 22 #include "stdlibincl.h" … … 141 141 assigns it a Name and a Type 142 142 */ 143 Model::Model(const char* modelName, MODEL_TYPE type)143 StaticModel::StaticModel(const char* modelName, MODEL_TYPE type) 144 144 { 145 145 this->setClassID(CL_MODEL, "Model"); … … 174 174 Looks if any from model allocated space is still in use, and if so deleted it. 175 175 */ 176 Model::~Model()176 StaticModel::~StaticModel() 177 177 { 178 178 PRINTF(4)("Deleting Model "); … … 209 209 * Finalizes an Object. This can be done outside of the Class. 210 210 */ 211 void Model::finalize()211 void StaticModel::finalize() 212 212 { 213 213 // this creates the display List. … … 236 236 * rebuild the Model from the Information we got. 237 237 */ 238 void Model::rebuild()238 void StaticModel::rebuild() 239 239 { 240 240 PRINTF(3)("Rebuilding Model '%s'\n", this->getName()); … … 250 250 It does this by just calling the Lists that must have been created earlier. 251 251 */ 252 void Model::draw () const252 void StaticModel::draw () const 253 253 { 254 254 … … 295 295 It does this by just calling the List that must have been created earlier. 296 296 */ 297 void Model::draw (int groupNumber) const297 void StaticModel::draw (int groupNumber) const 298 298 { 299 299 if (groupNumber >= this->groupCount) … … 327 327 It does this by just calling the List that must have been created earlier. 328 328 */ 329 void Model::draw (char* groupName) const329 void StaticModel::draw (char* groupName) const 330 330 { 331 331 PRINTF(4)("drawing the requested 3D-Models if found.\n"); … … 351 351 * deletes all the arrays 352 352 */ 353 bool Model::deleteArrays()353 bool StaticModel::deleteArrays() 354 354 { 355 355 if (this->vertices) … … 375 375 * This will be applied at the end of the importing Process. 376 376 */ 377 bool Model::cleanup()377 bool StaticModel::cleanup() 378 378 { 379 379 PRINTF(4)("cleaning up the 3D-Model to save Memory.\n"); … … 393 393 * with this option set the Materials will not be deleted with the Model. 394 394 */ 395 Material* Model::addMaterial(Material* material)395 Material* StaticModel::addMaterial(Material* material) 396 396 { 397 397 if (material == NULL) … … 409 409 * @returns the added material 410 410 */ 411 Material* Model::addMaterial(const char* materialName)411 Material* StaticModel::addMaterial(const char* materialName) 412 412 { 413 413 ModelMaterial* modMat = new ModelMaterial; … … 425 425 * @returns the Material if found, NULL otherwise 426 426 */ 427 Material* Model::findMaterialByName(const char* materialName)427 Material* StaticModel::findMaterialByName(const char* materialName) 428 428 { 429 429 list<ModelMaterial*>::iterator modMat; … … 441 441 With it you should be able to create Models with more than one SubModel inside 442 442 */ 443 bool Model::addGroup(const char* groupString)443 bool StaticModel::addGroup(const char* groupString) 444 444 { 445 445 PRINTF(5)("Read Group: %s.\n", groupString); … … 464 464 If a vertex line is found this function will inject it into the vertex-Array 465 465 */ 466 bool Model::addVertex (const char* vertexString)466 bool StaticModel::addVertex (const char* vertexString) 467 467 { 468 468 float subbuffer1; … … 482 482 483 483 */ 484 bool Model::addVertex(float x, float y, float z)484 bool StaticModel::addVertex(float x, float y, float z) 485 485 { 486 486 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); … … 496 496 If a vertexNormal line is found this function will inject it into the vertexNormal-Array 497 497 */ 498 bool Model::addVertexNormal (const char* normalString)498 bool StaticModel::addVertexNormal (const char* normalString) 499 499 { 500 500 float subbuffer1; … … 515 515 If a vertexNormal line is found this function will inject it into the vertexNormal-Array 516 516 */ 517 bool Model::addVertexNormal(float x, float y, float z)517 bool StaticModel::addVertexNormal(float x, float y, float z) 518 518 { 519 519 PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z); … … 532 532 !! WARNING THIS IS DIFFERNT FROM addVervexTexture(float, float); because it changes the second entry to 1-v !! 533 533 */ 534 bool Model::addVertexTexture (const char* vTextureString)534 bool StaticModel::addVertexTexture (const char* vTextureString) 535 535 { 536 536 float subbuffer1; … … 550 550 If a TextureCoordinate line is found this function will inject it into the TextureCoordinate-Array 551 551 */ 552 bool Model::addVertexTexture(float u, float v)552 bool StaticModel::addVertexTexture(float u, float v) 553 553 { 554 554 PRINTF(5)("found vertex-Texture %f, %f\n", u, v); … … 567 567 String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0 568 568 */ 569 bool Model::addFace (const char* faceString)569 bool StaticModel::addFace (const char* faceString) 570 570 { 571 571 if (this->currentGroup->faceCount >0) … … 623 623 * @param type The information Passed with each Vertex 624 624 */ 625 bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)625 bool StaticModel::addFace(int faceElemCount, VERTEX_FORMAT type, ...) 626 626 { 627 627 if (this->currentGroup->faceCount > 0) … … 655 655 * @param matString the Material that will be set. 656 656 */ 657 bool Model::setMaterial(const char* matString)657 bool StaticModel::setMaterial(const char* matString) 658 658 { 659 659 if (this->currentGroup->faceCount > 0) … … 670 670 * @param mtl the Material that will be set. 671 671 */ 672 bool Model::setMaterial(Material* mtl)672 bool StaticModel::setMaterial(Material* mtl) 673 673 { 674 674 if (this->currentGroup->faceCount > 0) … … 690 690 4. It goes through all the normale-Points and calculates the VertexNormale and includes it in the normals-Array. 691 691 */ 692 bool Model::buildVertexNormals ()692 bool StaticModel::buildVertexNormals () 693 693 { 694 694 PRINTF(4)("Normals are being calculated.\n"); … … 763 763 * reads and includes the Faces/Materials into the openGL state Machine 764 764 */ 765 bool Model::importToDisplayList()765 bool StaticModel::importToDisplayList() 766 766 { 767 767 // finalize the Arrays … … 855 855 * reads and includes the Faces/Materials into the openGL state Machine 856 856 */ 857 bool Model::importToVertexArray()857 bool StaticModel::importToVertexArray() 858 858 { 859 859 // finalize the Arrays … … 875 875 * builds an array of triangles, that can later on be used for obb separation and octree separation 876 876 */ 877 bool Model::buildTriangleList()877 bool StaticModel::buildTriangleList() 878 878 { 879 879 if( unlikely(this->triangles != NULL)) … … 1007 1007 merging this information, the face will be drawn. 1008 1008 */ 1009 bool Model::addGLElement (ModelFaceElement* elem)1009 bool StaticModel::addGLElement (ModelFaceElement* elem) 1010 1010 { 1011 1011 PRINTF(5)("importing grafical Element to openGL.\n"); … … 1043 1043 This will inject a Cube, because this is the most basic model. 1044 1044 */ 1045 void Model::cubeModel()1045 void StaticModel::cubeModel() 1046 1046 { 1047 1047 this->addVertex (-0.5, -0.5, 0.5);
Note: See TracChangeset
for help on using the changeset viewer.