diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2019-12-19 18:14:21 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2019-12-19 18:14:21 +0300 |
commit | 66d773c2e7c595a65454ce1f0ca8f131a03125ed (patch) | |
tree | 4de2423e3d1431c5f6edf9b494f84fca97e4c5e3 /source/blender/physics | |
parent | 7dd6e034f1ca5a9628b40de1c664161d83a3546b (diff) |
Fix cloth triangle area calculation being wrong
Before the area calculated was for the resulting quad, not the triangle.
So just simply divide the result by 2.
Diffstat (limited to 'source/blender/physics')
-rw-r--r-- | source/blender/physics/intern/implicit_blender.c | 2 | ||||
-rw-r--r-- | source/blender/physics/intern/implicit_eigen.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c index 02d7fd50797..fd9903baa41 100644 --- a/source/blender/physics/intern/implicit_blender.c +++ b/source/blender/physics/intern/implicit_blender.c @@ -1455,7 +1455,7 @@ static float calc_nor_area_tri(float nor[3], sub_v3_v3v3(n2, v2, v3); cross_v3_v3v3(nor, n1, n2); - return normalize_v3(nor); + return normalize_v3(nor) / 2.0f; } /* XXX does not support force jacobians yet, since the effector system does not provide them either diff --git a/source/blender/physics/intern/implicit_eigen.cpp b/source/blender/physics/intern/implicit_eigen.cpp index 9e1c03638d7..b801e851b90 100644 --- a/source/blender/physics/intern/implicit_eigen.cpp +++ b/source/blender/physics/intern/implicit_eigen.cpp @@ -830,7 +830,7 @@ static float calc_nor_area_tri(float nor[3], sub_v3_v3v3(n2, v2, v3); cross_v3_v3v3(nor, n1, n2); - return normalize_v3(nor); + return normalize_v3(nor) / 2.0f; } /* XXX does not support force jacobians yet, |