Reduce edge count for cloth simulation

master
Jeremy Hu 2020-01-14 22:23:28 +09:30
parent 9f625f07ae
commit 8db7266158
1 changed files with 1 additions and 13 deletions

View File

@ -20,19 +20,7 @@ public:
}
void simulate(ClothMesh *clothMesh) const
{
std::vector<std::vector<size_t>> filteredClothFaces;
for (const auto &it: clothMesh->faces) {
if (4 == it.size()) {
filteredClothFaces.push_back(std::vector<size_t> {
it[0], it[1], it[2]
});
filteredClothFaces.push_back(std::vector<size_t> {
it[2], it[3], it[0]
});
} else if (3 == it.size()) {
filteredClothFaces.push_back(it);
}
}
const auto &filteredClothFaces = clothMesh->faces;
std::map<PositionKey, std::pair<QUuid, QUuid>> positionMap;
std::pair<QUuid, QUuid> defaultSource;
for (const auto &it: *clothMesh->outcomeNodeVertices) {