Changeset 2079 for GTP/trunk/Lib/Geom
- Timestamp:
- 02/05/07 13:14:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
r2078 r2079 988 988 // Update mesh. 989 989 //--------------------------------------------------------------------------- 990 <<<<<<< .mine991 =======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 vertex1001 // so, the bones must be placed in the GeoMesh1002 mesh_bones = &mGeoMesh->mBones;1003 mesh_vb = mGeoMesh->mVertexBuffer;1004 1005 // we assume the original mesh is shared vertex1006 // because before the simplification process1007 // the mesh becomes converted to shared vertex1008 // so, the original bones must be searched in the1009 // Mesh, not in every submesh1010 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 >>>>>>> .r20771045 990 void LodStripsConstructor::UpdateMesh(void) 1046 991 { … … 1233 1178 } 1234 1179 } 1235 1236 // Sort submesh bones.1237 this->sortBones();1238 1180 } 1239 1181 … … 1281 1223 1282 1224 // Copy new vertices. 1283 std::vector<VertexBoneAssignment> newbones;1284 1225 for (unsigned int i = 0; i < mGeoMeshSQ->mNewVertices.size(); i++) 1285 1226 { … … 1306 1247 { 1307 1248 VertexBoneAssignment vba; 1308 <<<<<<< .mine1309 1249 1310 1250 vba.boneIndex = it->boneIndex; … … 1314 1254 mInitialMesh->mBones.push_back(vba); 1315 1255 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 } 1329 1259 1330 1260 // For each submesh.
Note: See TracChangeset
for help on using the changeset viewer.