From fbc743f3324b63c1b2c6ab0fe2e27fa6b11721dc Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Thu, 27 Dec 2007 22:48:30 +0000 Subject: [PATCH] fix .. hum not really a bug but waste of CPU remove 6 multiplications and one square root in core spring calculation .. called for every solver step try --- source/blender/blenkernel/intern/softbody.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index bd9d1cb75ca..fdc03a88230 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -2307,9 +2307,8 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow) } if (( (sb->totpoint-a) == bs->v1) ){ - actspringlen= VecLenf( (bproot+bs->v2)->pos, bp->pos); VecSubf(sd,(bproot+bs->v2)->pos, bp->pos); - Normalize(sd); + actspringlen=Normalize(sd); /* friction stuff V1 */ VecSubf(velgoal,bp->vec,(bproot+bs->v2)->vec); @@ -2330,9 +2329,8 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow) } if (( (sb->totpoint-a) == bs->v2) ){ - actspringlen= VecLenf( (bproot+bs->v1)->pos, bp->pos); VecSubf(sd,bp->pos,(bproot+bs->v1)->pos); - Normalize(sd); + actspringlen=Normalize(sd); /* friction stuff V2 */ VecSubf(velgoal,bp->vec,(bproot+bs->v1)->vec);