diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-07-06 20:44:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-07-06 20:44:30 +0300 |
commit | 12817083ec615f9d3e3f0261d5d4247b81bfbbf8 (patch) | |
tree | c9fc06e39d36453bb702ceb5cee93e1e05a21629 /source/blender/blenkernel/intern/collision.c | |
parent | a856de700b4274ebc1735aa349f7425c7c23cbfc (diff) |
Cleanup: Use the BLI_edgehash API in the sewing simulation of cloths
Also remove the code in the ghash that is no longer used.
This change simplifies the existing code.
Differential Revision: https://developer.blender.org/D8219
Diffstat (limited to 'source/blender/blenkernel/intern/collision.c')
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index daf1602319f..31d49dd4508 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -32,7 +32,7 @@ #include "DNA_scene_types.h" #include "BLI_blenlib.h" -#include "BLI_ghash.h" +#include "BLI_edgehash.h" #include "BLI_linklist.h" #include "BLI_math.h" #include "BLI_task.h" @@ -1153,17 +1153,7 @@ static bool cloth_bvh_selfcollision_is_active(const Cloth *cloth, } if (sewing_active) { - unsigned int vertex_index_pair[2]; - /* The indices pair are ordered, thus must ensure the same here as well */ - if (tri_a->tri[i] < tri_b->tri[j]) { - vertex_index_pair[0] = tri_a->tri[i]; - vertex_index_pair[1] = tri_b->tri[j]; - } - else { - vertex_index_pair[0] = tri_b->tri[j]; - vertex_index_pair[1] = tri_a->tri[i]; - } - if (BLI_ghash_haskey(cloth->sew_edge_graph, vertex_index_pair)) { + if (BLI_edgeset_haskey(cloth->sew_edge_graph, tri_a->tri[i], tri_b->tri[j])) { return false; } } |