[Bf-blender-cvs] [9aada45e52e] master: fix t53701 minimal changes to get it working right

bjornmose noreply at git.blender.org
Wed Jan 10 01:55:58 CET 2018


Commit: 9aada45e52e88d272c38dc2e47cbc9a6d3d35698
Author: bjornmose
Date:   Wed Jan 10 01:51:04 2018 +0100
Branches: master
https://developer.blender.org/rB9aada45e52e88d272c38dc2e47cbc9a6d3d35698

fix t53701 minimal changes to get it working right

===================================================================

M	source/blender/blenkernel/intern/softbody.c

===================================================================

diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 3052a708137..563148992d9 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -2013,7 +2013,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 */
@@ -2038,13 +2039,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));
 					}
 				}
 			}



More information about the Bf-blender-cvs mailing list