diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-18 18:19:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-18 18:19:12 +0300 |
commit | c46a9d811789706e77db3d0b92f4b943fb86f386 (patch) | |
tree | b6ea007f13bb6cb831281594c4bea59f835544d8 /source/blender/modifiers/intern/MOD_surfacedeform.c | |
parent | 1fb43dcd5a7549f98a96faa41110ca22877003e5 (diff) | |
parent | 344eff9c4804f99b633c8054b888a8667ea24ddc (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/modifiers/intern/MOD_surfacedeform.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_surfacedeform.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index b623293ed5c..2919f169d00 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -314,11 +314,13 @@ BLI_INLINE int isPolyValid(const float coords[][2], const unsigned int nr) copy_v2_v2(prev_co, coords[nr - 1]); sub_v2_v2v2(prev_vec, prev_co, coords[nr - 2]); + normalize_v2(prev_vec); for (int i = 0; i < nr; i++) { sub_v2_v2v2(curr_vec, coords[i], prev_co); - if (len_squared_v2(curr_vec) < FLT_EPSILON) { + const float curr_len = normalize_v2(curr_vec); + if (curr_len < FLT_EPSILON) { return MOD_SDEF_BIND_RESULT_OVERLAP_ERR; } |