diff options
author | Ish Bosamiya <ish_bosamiya> | 2020-03-02 16:52:58 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-03-02 17:02:26 +0300 |
commit | 5afa4b1dc8aacdd17f72a2bcaccd53838107c229 (patch) | |
tree | 5c57184327e0dc9c27b5af0451f0014f9502908d /source/blender/blenlib/intern/BLI_ghash_utils.c | |
parent | 1648a7903672604dca096d49b282cf737dd9e661 (diff) |
Fix T65568: sewing and self collision issue
As explained in T65568 by @LucaRood, the self collision system should exclude triangles that are connected by sewing springs.
Differential Revision: https://developer.blender.org/D6911
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash_utils.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash_utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c index 63559da5bd7..abe5970b9a6 100644 --- a/source/blender/blenlib/intern/BLI_ghash_utils.c +++ b/source/blender/blenlib/intern/BLI_ghash_utils.c @@ -75,6 +75,7 @@ uint BLI_ghashutil_uinthash_v4(const uint key[4]) hash += key[3]; return hash; } + uint BLI_ghashutil_uinthash_v4_murmur(const uint key[4]) { return BLI_hash_mm2((const unsigned char *)key, sizeof(int) * 4 /* sizeof(key) */, 0); @@ -85,6 +86,25 @@ bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b) return (memcmp(a, b, sizeof(uint[4])) != 0); } +uint BLI_ghashutil_uinthash_v2(const uint key[2]) +{ + uint hash; + hash = key[0]; + hash *= 37; + hash += key[1]; + return hash; +} + +uint BLI_ghashutil_uinthash_v2_murmur(const uint key[2]) +{ + return BLI_hash_mm2((const unsigned char *)key, sizeof(int) * 2 /* sizeof(key) */, 0); +} + +bool BLI_ghashutil_uinthash_v2_cmp(const void *a, const void *b) +{ + return (memcmp(a, b, sizeof(uint[2])) != 0); +} + uint BLI_ghashutil_uinthash(uint key) { key += ~(key << 16); |