From 8db72661581e1110a19a8fc7dc0861b9239a7f0a Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Tue, 14 Jan 2020 22:23:28 +0930 Subject: [PATCH] Reduce edge count for cloth simulation --- src/simulateclothmeshes.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/simulateclothmeshes.cpp b/src/simulateclothmeshes.cpp index 9b67346d..5e85eb3a 100644 --- a/src/simulateclothmeshes.cpp +++ b/src/simulateclothmeshes.cpp @@ -20,19 +20,7 @@ public: } void simulate(ClothMesh *clothMesh) const { - std::vector> filteredClothFaces; - for (const auto &it: clothMesh->faces) { - if (4 == it.size()) { - filteredClothFaces.push_back(std::vector { - it[0], it[1], it[2] - }); - filteredClothFaces.push_back(std::vector { - it[2], it[3], it[0] - }); - } else if (3 == it.size()) { - filteredClothFaces.push_back(it); - } - } + const auto &filteredClothFaces = clothMesh->faces; std::map> positionMap; std::pair defaultSource; for (const auto &it: *clothMesh->outcomeNodeVertices) {