Changeset 6046 in orxonox.OLD for branches/spaceshipcontrol/src/lib
- Timestamp:
- Dec 11, 2005, 2:42:55 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/lib/graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/lib/graphics/graphics_engine.cc
r6011 r6046 36 36 #include "class_list.h" 37 37 #include "list.h" 38 #include " model.h"38 #include "static_model.h" 39 39 #endif 40 40 using namespace std; … … 283 283 } 284 284 PRINTF(4)("Status: Using GLEW %s\n", glewGetString(GLEW_VERSION)); 285 286 } 285 } 286 287 287 288 288 /** … … 320 320 } 321 321 // REBUILDING MODELS 322 const std::list<BaseObject*>* modelList = ClassList::getList(CL_ MODEL);322 const std::list<BaseObject*>* modelList = ClassList::getList(CL_STATIC_MODEL); 323 323 if (texList != NULL) 324 324 { 325 325 std::list<BaseObject*>::const_iterator reModel; 326 326 for (reModel = modelList->begin(); reModel != modelList->end(); reModel++) 327 dynamic_cast< Model*>(*reModel)->rebuild();327 dynamic_cast<StaticModel*>(*reModel)->rebuild(); 328 328 } 329 329 #endif /* __WIN32__ */ -
branches/spaceshipcontrol/src/lib/graphics/importer/model.cc
r6033 r6046 28 28 Model::Model() 29 29 { 30 // this->setClassID(CL_PROTO_ID, "ProtoClass");30 this->setClassID(CL_MODEL, "Model"); 31 31 this->pModelInfo.numVertices = 0; 32 32 this->pModelInfo.numTriangles = 0; … … 54 54 const GLfloat* pVertices = NULL; 55 55 const GLfloat* pNorm = NULL; 56 56 57 57 glBegin(GL_TRIANGLES); 58 58 for( int i = 0; i < this->pModelInfo.numTriangles; ++i) … … 63 63 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 64 64 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 65 65 66 66 pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[1]]; 67 67 pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[1]]; 68 68 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 69 69 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 70 70 71 71 pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[2]]; 72 72 pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[2]]; 73 73 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 74 74 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 75 75 76 76 } 77 77 glEnd(); -
branches/spaceshipcontrol/src/lib/graphics/importer/objModel.cc
r6022 r6046 34 34 OBJModel::OBJModel(const char* fileName, float scaling) : StaticModel(fileName) 35 35 { 36 this->setClassID(CL_OBJ_MODEL, "OBJModel"); 37 36 38 this->objPath = "./"; 37 39 -
branches/spaceshipcontrol/src/lib/graphics/importer/static_model.cc
r6033 r6046 143 143 StaticModel::StaticModel(const char* modelName) 144 144 { 145 this->setClassID(CL_ MODEL, "Model");145 this->setClassID(CL_STATIC_MODEL, "StaticModel"); 146 146 PRINTF(4)("new 3D-Model is being created\n"); 147 147 this->setName(modelName); … … 547 547 this->currentGroup->currentFace->vertexCount++; 548 548 } 549 549 550 550 this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2; 551 551 this->faceCount += this->currentGroup->currentFace->vertexCount -2; -
branches/spaceshipcontrol/src/lib/graphics/importer/vertex_array_model.cc
r6012 r6046 33 33 VertexArrayModel::VertexArrayModel() 34 34 { 35 this->setClassID(CL_ MODEL, "VertexArrayModel");35 this->setClassID(CL_VERTEX_ARRAY_MODEL, "VertexArrayModel"); 36 36 37 37 this->finalized = false; … … 88 88 glVertexPointer(3, GL_FLOAT, 0, this->vertices.getArray()); 89 89 glNormalPointer(GL_FLOAT, 0, this->normals.getArray()); 90 glTexCoordPointer(2, GL_FLOAT, 0, this->texCoords.getArray()); 90 glTexCoordPointer(2, GL_FLOAT, 0, this->texCoords.getArray()); 91 91 92 92 printf("%d\n", this->indices.getCount()); … … 100 100 /* const GLfloat* pVertices = NULL; 101 101 const GLfloat* pNorm = NULL; 102 102 103 103 glBegin(GL_TRIANGLES); 104 104 for( int i = 0; i < this->triangleCount; ++i) … … 109 109 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 110 110 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 111 111 112 112 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[1]]; 113 113 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[1]]; 114 114 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 115 115 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 116 116 117 117 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[2]]; 118 118 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[2]]; 119 119 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 120 120 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 121 121 122 122 } 123 123 glEnd();
Note: See TracChangeset
for help on using the changeset viewer.