- Timestamp:
- 10/02/06 19:09:48 (18 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodStripsLibrary.h
r1526 r1552 185 185 186 186 uint32 GetValidIndexCount(int submeshid) const { return indices_x_submesh[submeshid]; } 187 uint32 GetValidOffset(int submeshid) const { return offsets_x_submesh[submeshid]; }187 // uint32 GetValidOffset(int submeshid) const { return offsets_x_submesh[submeshid]; } 188 188 uint32 GetTotalStripCount(void) const { return mTotalStrips; } 189 189 uint32 GetSubMeshtripCount(int submeshid) const { return mStripsSubmesh[submeshid]; } -
GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodTreeLibrary.h
r1526 r1552 51 51 const IndexData* CurrentLOD_Trunk_Indices(void) const; 52 52 uint32 GetValidTrunkIndexCount(int isubmesh) const { return trunk->GetValidIndexCount(isubmesh); } 53 uint32 GetValidTrunkOffset(int isubmesh) const { return trunk->GetValidOffset(isubmesh); }53 // uint32 GetValidTrunkOffset(int isubmesh) const { return trunk->GetValidOffset(isubmesh); } 54 54 55 55 // uint32 Get_Foliage_VertexCount(void) const; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
r1541 r1552 60 60 } 61 61 62 62 63 update = -1; 63 64 increment = (float)30.0 / increment; … … 148 149 149 150 150 /*151 cDatos.push_back(p0);152 cDatos.push_back(r);153 154 r = 0;155 k = long(cStripsT.size()-r-3);156 */151 152 //cDatos.push_back(p0); 153 //cDatos.push_back(r); 154 155 //r = 0; 156 //k = long(cStripsT.size()-r-3); 157 157 158 long auxp0, auxr; 158 159 //regLOD.strip= t; … … 669 670 upb(percent); 670 671 671 // 6 min.672 672 this->OrdenarModeloVQSLIM(upb); 673 673 … … 677 677 for(i = 0; i < this->TOTALTIRAS; i++) 678 678 { 679 t = long(this->cStrips[i].size()); 680 679 t = long(this->cStrips[i].size()); 681 680 if (t > max) 682 681 max = t; … … 879 878 880 879 num_vert = 0; 881 880 881 // load the strips list 882 882 for (i = 0; i < this->mGeoMesh->mSubMeshCount; i++) 883 883 { … … 891 891 Index *aux = this->mGeoMesh->mSubMesh[i].mStrip[j]; 892 892 893 / *893 // remove strip degenerates (first indices) except for the first (DEG!) 894 894 if (j != 0) 895 895 { 896 896 // La primera tira no empieza por índices repetidos. 897 aux = aux+1; 898 897 aux = aux+1; 899 898 indice_acum++; 900 899 } 901 */ 902 900 903 901 if (j+1 < this->mGeoMesh->mSubMesh[i].mStripCount) 904 902 { … … 915 913 } 916 914 917 //tira.pop_back(); 915 // DEG!: remove strip degenerates (last indices) except for the last strip 916 tira.pop_back(); 918 917 919 918 this->cStrips.push_back(tira); -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r1541 r1552 281 281 } 282 282 283 /* // debug! 284 FILE *f = fopen("lodstrips_lodinfo.txt","wt"); 285 fprintf(f,"mCurrentLOD: %d",mCurrentLod); 286 fprintf(f,"mLods: %d",mLods); 287 for (int i=0; i<mTotalStrips; i++) 288 { 289 fprintf(f,"\nstrip: %d - ",i); 290 for (int j=0; j<mStrips[i].size(); j++) 291 { 292 int ind = mStrips[i][j]; 293 fprintf(f,"%d ",ind); 294 } 295 } 296 fclose(f);*/ 297 283 298 UpdateDataRetrievalInterface(); 284 299 // return return_value; … … 456 471 mStripsChanges[i] = 0; 457 472 } 473 458 474 // dataRetrievalInterface->End(); 459 475 … … 525 541 indexBegin = geoSubMesh->mStrip[strip]; 526 542 527 // If the strips is not the first. 528 529 /* if (strip != 0) 530 { 543 // If the strips is not the first. (DEG!) 544 if (strip != 0) 531 545 indexBegin++; 532 }533 */534 546 535 547 // If is the final strip … … 544 556 indexEnd = geoSubMesh->mStrip[strip + 1]; 545 557 546 // Remove degenerated 547 //indexEnd--;558 // Remove degenerated (DEG!) 559 indexEnd--; 548 560 } 549 561 … … 656 668 void LodStripsLibrary::UpdateDataRetrievalInterface(void) 657 669 { 658 unsigned int ii = 0;659 660 int counter = 0;661 670 int target_submesh = 0; 662 671 size_t strip_count = 0; 663 unsigned int ii_submesh = 0; 664 665 dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh]); 666 667 // dataRetrievalInterface->SetCurrentSubmesh(target_submesh); 668 669 for (unsigned int i = 0; i < mTotalStrips; i++, strip_count++) 672 unsigned int ii_submesh = 0; 673 current_triangle_count = 0; 674 675 // indices_x_submesh is calculated without degenerates, 676 // we must add the degenerate indices added here 677 uint32 numdeg = mGeoMesh->mSubMesh[target_submesh].mStripCount*2 - 2; 678 679 dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh] + numdeg); 680 current_triangle_count += indices_x_submesh[target_submesh] + numdeg; 681 682 for (unsigned int i = 0; i < mTotalStrips; i++, strip_count++) 670 683 { 671 684 if (strip_count >= mGeoMesh->mSubMesh[target_submesh].mStripCount) 672 685 { 673 // indices_x_submesh[target_submesh] = counter;674 675 686 if (target_submesh==0) 676 687 offsets_x_submesh[target_submesh] = 0; … … 678 689 offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1]; 679 690 680 counter = 0;681 691 mStripsSubmesh[target_submesh] = (int)strip_count; 682 692 strip_count = 0; … … 684 694 target_submesh++; 685 695 ii_submesh = 0; 686 // dataRetrievalInterface->SetCurrentSubmesh(target_submesh);687 696 dataRetrievalInterface->End(); 688 dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh]); 697 698 numdeg = mGeoMesh->mSubMesh[target_submesh].mStripCount*2 - 2; 699 dataRetrievalInterface->Begin(target_submesh, indices_x_submesh[target_submesh] + numdeg); 700 current_triangle_count += indices_x_submesh[target_submesh] + numdeg; 689 701 } 690 702 691 703 int lastindex = -1; 692 for (SmallIntVector::iterator it=mStrips[i].begin(); it!=mStrips[i].end(); it++, ii ++, ii_submesh++)704 for (SmallIntVector::iterator it=mStrips[i].begin(); it!=mStrips[i].end(); it++, ii_submesh++) 693 705 { 694 /* // repeat the first index of the strip: degenerate 695 if (lastindex==-1) 706 // repeat the first index of the strip: degenerate (DEG!) 707 // except for the first strip in a mesh 708 if (lastindex==-1 && strip_count>0) 696 709 { 697 710 lastindex=*it; 698 dataRetrievalInterface->SetIndex(ii,*it); 699 counter++; 700 ii++; 701 }*/ 711 dataRetrievalInterface->SetIndex(ii_submesh,*it); 712 ii_submesh++; 713 } 702 714 lastindex=*it; 703 715 dataRetrievalInterface->SetIndex(ii_submesh,*it); 704 counter++;705 716 } 706 717 707 /* // last repeat last vertex of the strip: degenerate 708 dataRetrievalInterface->SetIndex(ii,lastindex); 709 counter++; 710 ii++;*/ 711 712 // dataRetrievalInterface->SetNumValidIndices(ii); 718 // repeat last vertex of the strip: degenerate (DEG!) 719 // except for the last strip in a mesh 720 if (strip_count<mGeoMesh->mSubMesh[target_submesh].mStripCount-1) 721 { 722 dataRetrievalInterface->SetIndex(ii_submesh,lastindex); 723 ii_submesh++; 724 } 713 725 } 714 726 715 727 if (strip_count >= mGeoMesh->mSubMesh[target_submesh].mStripCount) 716 728 { 717 // indices_x_submesh[target_submesh] = counter;718 729 if (target_submesh==0) 719 730 offsets_x_submesh[target_submesh] = 0; … … 721 732 offsets_x_submesh[target_submesh] = indices_x_submesh[target_submesh-1] + offsets_x_submesh[target_submesh-1]; 722 733 723 counter = 0;724 734 mStripsSubmesh[target_submesh] = (int)strip_count; 725 735 strip_count = 0; 726 736 target_submesh++; 727 // dataRetrievalInterface->SetCurrentSubmesh(target_submesh);728 737 } 729 738
Note: See TracChangeset
for help on using the changeset viewer.