diff options
author | Jens Ole Wund <bjornmose@gmx.net> | 2007-12-28 01:48:30 +0300 |
---|---|---|
committer | Jens Ole Wund <bjornmose@gmx.net> | 2007-12-28 01:48:30 +0300 |
commit | fbc743f3324b63c1b2c6ab0fe2e27fa6b11721dc (patch) | |
tree | eafab7cb03f716ae55ec01a73f5b7521e7732ff0 /source | |
parent | f4015d9fce21a4aa5991e3977a146183b1ea32ba (diff) |
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
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 6 |
1 files 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); |