Changeset 4798 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 6, 2005, 2:22:11 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r4797 r4798 148 148 this->texCoordCount = 0; 149 149 this->faceCount = 0; 150 this->triangleCount = 0; 151 this->triangles = NULL; 150 152 151 153 this->scaleFactor = 1; … … 303 305 if (this->normals) 304 306 delete this->normals; 307 if (this->triangles) 308 delete this->triangles; 305 309 306 310 this->vertices = NULL; 307 311 this->vTexture = NULL; 308 312 this->normals = NULL; 313 this->triangles = NULL; this->triangleCount = 0; 309 314 } 310 315 … … 819 824 bool Model::buildTriangleList() 820 825 { 826 if( unlikely(this->triangles != NULL)) 827 return true; 821 828 /* make sure, that all the arrays are finalized */ 822 829 if( unlikely(!this->vertices->isFinalized())) … … 836 843 /* count the number of triangles */ 837 844 /* now iterate through all groups and build up the triangle list */ 845 this->triangleCount = 0; 838 846 this->currentGroup = this->firstGroup; 839 847 while( this->currentGroup != NULL) 840 848 { 841 // Putting Faces to GL842 849 tmpFace = this->currentGroup->firstFace; 843 850 while( tmpFace != NULL) 844 851 { 845 tmpElem = tmpFace->firstElem;846 852 847 853 /* if its a triangle just add it to the list */ … … 854 860 this->triangleCount += 2; 855 861 } 862 else if( tmpFace->vertexCount > 4) 863 { 864 PRINTF(0)("NASTY NASTY: More than 4 vertices for a face, there will be errors in the triangles information!\n"); 865 //exit(0); 866 } 867 tmpFace = tmpFace->next; 856 868 } 857 869 this->currentGroup = this->currentGroup->next; 858 870 } 859 871 860 PRINTF(0)("***************************************GOT %i triangles\n", this->triangleCount); 872 PRINTF(0)("***************************************GOT %i triangles, %i vertices\n", this->triangleCount, this->vertexCount); 873 861 874 862 875 /* allocate memory for the new triangle structures */ -
orxonox/trunk/src/lib/graphics/importer/model.h
r4796 r4798 175 175 unsigned int texCoordCount; //!< A modelwide Counter for the texCoord. 176 176 unsigned int faceCount; //!< A modelwide Counter for the faces 177 unsigned int triangleCount; //!< Number of triangles <= faceCount177 unsigned int triangleCount; //!< Number of triangles >= faceCount 178 178 Array<GLfloat>* vertices; //!< The Array that handles the Vertices. 179 179 Array<GLfloat>* normals; //!< The Array that handles the Normals.
Note: See TracChangeset
for help on using the changeset viewer.