diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-10 05:57:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-10 06:01:09 +0300 |
commit | 5ff33ecdf0ed319db2e589926a614f67738531a6 (patch) | |
tree | 75646e8ba2b3520716adb44e9fda7db84be84aa8 /source/blender/blenkernel/intern | |
parent | 5c3dc01f54703e844893e55230ebafb9e4bdcd18 (diff) | |
parent | cacba951eaa266c7fc53cd25be6afc0fb7951425 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index e3af77166a9..3cfa8787f4b 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1991,7 +1991,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo float compare; float bstune = sb->ballstiff; - for (c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) { + /* running in a slice we must not assume anything done with obp neither alter the data of obp */ + for (c=sb->totpoint, obp= sb->bpoint; c>0; c--, obp++) { compare = (obp->colball + bp->colball); sub_v3_v3v3(def, bp->pos, obp->pos); /* rather check the AABBoxes before ever calulating the real distance */ @@ -2016,13 +2017,6 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo madd_v3_v3fl(bp->force, def, f * (1.0f - sb->balldamp)); madd_v3_v3fl(bp->force, dvel, sb->balldamp); - - /* exploit force(a, b) == -force(b, a) part2/2 */ - sub_v3_v3v3(dvel, velcenter, obp->vec); - mul_v3_fl(dvel, _final_mass(ob, bp)); - - madd_v3_v3fl(obp->force, dvel, sb->balldamp); - madd_v3_v3fl(obp->force, def, -f * (1.0f - sb->balldamp)); } } } |