Changeset 4106 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer/model.cc
- Timestamp:
- May 7, 2005, 4:26:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r4038 r4106 140 140 this->currentGroup = this->firstGroup = new ModelGroup; 141 141 this->groupCount = 0; 142 this->vertexCount = 0; 143 this->normalCount = 0; 144 this->texCoordCount = 0; 142 145 143 146 this->scaleFactor = 1; … … 355 358 Material* Model::addMaterial(const char* materialName) 356 359 { 357 358 360 Material* newMat = new Material(); 359 361 newMat->setName(materialName); … … 424 426 PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3); 425 427 this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 428 this->vertexCount++; 426 429 return true; 427 430 } … … 438 441 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); 439 442 this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor); 443 this->vertexCount++; 440 444 return true; 441 445 } … … 455 459 PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3); 456 460 this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 461 this->normalCount++; 457 462 return true; 458 463 } … … 470 475 PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z); 471 476 this->normals->addEntry(x, y, z); 477 this->normalCount++; 478 return true; 472 479 } 473 480 … … 487 494 this->vTexture->addEntry(subbuffer1); 488 495 this->vTexture->addEntry(subbuffer2); 496 this->texCoordCount++; 489 497 return true; 490 498 } … … 502 510 this->vTexture->addEntry(u); 503 511 this->vTexture->addEntry(v); 512 this->texCoordCount++; 513 return true; 504 514 } 505 515 … … 583 593 for (int i = 0; i < faceElemCount; i++) 584 594 { 585 if (this->currentGroup->currentFace->vertexCount >0)595 if (this->currentGroup->currentFace->vertexCount > 0) 586 596 tmpElem = tmpElem->next = new ModelFaceElement; 587 597 … … 592 602 tmpElem->normalNumber = va_arg(itemlist, int) -1; 593 603 this->currentGroup->currentFace->vertexCount++; 604 605 if (unlikely(tmpElem->vertexNumber > this->vertexCount)) 606 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->vertexNumber, this->vertexCount); 607 if (unlikely(tmpElem->normalNumber > this->normalCount)) 608 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->normalNumber, this->normalCount); 609 if (unlikely(tmpElem->texCoordNumber > this->texCoordCount)) 610 PRINTF(1)("VERTEX %d IS NOT IN THE LIST -> DANGER OF SEGFAULT (max is: %d)\n", tmpElem->texCoordNumber, this->texCoordCount); 594 611 } 595 612 va_end(itemlist);
Note: See TracChangeset
for help on using the changeset viewer.