Changeset 2079


Ignore:
Timestamp:
02/05/07 13:14:05 (17 years ago)
Author:
gumbau
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp

    r2078 r2079  
    988988//      Update mesh. 
    989989//--------------------------------------------------------------------------- 
    990 <<<<<<< .mine 
    991 ======= 
    992 void LodStripsConstructor::sortBones() 
    993 { 
    994         VertexBuffer                                    *mesh_vb; 
    995         VertexBuffer                                    *copy_vb; 
    996  
    997         std::vector<VertexBoneAssignment>       *mesh_bones; 
    998         std::vector<VertexBoneAssignment>       *copy_bones; 
    999  
    1000         // After simplifying, the object always is shared vertex 
    1001         // so, the bones must be placed in the GeoMesh 
    1002         mesh_bones      =       &mGeoMesh->mBones; 
    1003         mesh_vb =       mGeoMesh->mVertexBuffer; 
    1004  
    1005         // we assume the original mesh is shared vertex  
    1006         // because before the simplification process 
    1007         // the mesh becomes converted to shared vertex 
    1008         // so, the original bones must be searched in the 
    1009         // Mesh, not in every submesh 
    1010  
    1011         mesh_bones->clear(); 
    1012  
    1013         //      Vertex buffers. 
    1014         copy_vb =       mInitialMesh->mVertexBuffer; 
    1015  
    1016         //      Bones. 
    1017         copy_bones = &mInitialMesh->mBones; 
    1018          
    1019         //      If there are submesh bones. 
    1020         for (int b = 0; b < copy_bones->size(); b++) 
    1021         { 
    1022                 VertexBoneAssignment    assign; 
    1023  
    1024                 int n   =       (*copy_bones)[b].vertexIndex; 
    1025  
    1026                 //      Initialize o. 
    1027                  
    1028                 int o=0; 
    1029                 for (o=0; o<mesh_vb->mVertexCount; o++) 
    1030                 { 
    1031                         if (mesh_vb->mPosition[o].x == copy_vb->mPosition[n].x && 
    1032                                 mesh_vb->mPosition[o].y == copy_vb->mPosition[n].y && 
    1033                                 mesh_vb->mPosition[o].z == copy_vb->mPosition[n].z) 
    1034                         { 
    1035                                 assign.vertexIndex = o; 
    1036                                 assign.boneIndex   = (*copy_bones)[b].boneIndex; 
    1037                                 assign.weight      = 1.0f; 
    1038                                 mesh_bones->push_back(assign); 
    1039                         }                        
    1040                 } 
    1041         } 
    1042 } 
    1043  
    1044 >>>>>>> .r2077 
    1045990void LodStripsConstructor::UpdateMesh(void) 
    1046991{ 
     
    12331178                } 
    12341179        } 
    1235  
    1236         //      Sort submesh bones. 
    1237         this->sortBones(); 
    12381180} 
    12391181 
     
    12811223 
    12821224        //      Copy new vertices. 
    1283         std::vector<VertexBoneAssignment> newbones; 
    12841225        for (unsigned   int     i       =       0;      i < mGeoMeshSQ->mNewVertices.size();    i++) 
    12851226        { 
     
    13061247                        { 
    13071248                                VertexBoneAssignment vba; 
    1308 <<<<<<< .mine 
    13091249 
    13101250                                vba.boneIndex           =       it->boneIndex; 
     
    13141254                                mInitialMesh->mBones.push_back(vba); 
    13151255                                bones_count++; 
    1316 ======= 
    1317                                 vba.boneIndex = it->boneIndex; 
    1318                                 vba.vertexIndex = mGeoMeshSQ->mNewVertices[i].id; 
    1319                                 vba.weight = it->weight; 
    1320                                 newbones.push_back(vba); 
    1321 >>>>>>> .r2077 
    1322                         } 
    1323                 } 
    1324         } 
    1325  
    1326         for (std::vector<VertexBoneAssignment>::iterator it = newbones.begin(); it != newbones.end(); it++) 
    1327                 mGeoMesh->mBones.push_back(*it); 
    1328  
     1256                        } 
     1257                } 
     1258        } 
    13291259 
    13301260        //      For each submesh. 
Note: See TracChangeset for help on using the changeset viewer.