diff options
author | Jens Ole Wund <bjornmose@gmx.net> | 2008-07-24 16:27:31 +0400 |
---|---|---|
committer | Jens Ole Wund <bjornmose@gmx.net> | 2008-07-24 16:27:31 +0400 |
commit | b93156a686449e13e84db2bc112fabd3d07f82d1 (patch) | |
tree | fda9a295d5d318ac645d701bdff7abbad3bdc34d /source/blender/blenkernel/intern/softbody.c | |
parent | f9dc77c1c89e2970b2b1f95186dcb58541dfb7f9 (diff) |
soft body bug fix own finding
left overs from new particles
-wind and force did not work if aero or edge collision was activated.
-force field had flipped sign compared to particles
tsk who thinks a attractive force should negative sign? well... i am passionless with that.
-adapted effect of wind and fields on softbodies such that softbody "particles" and particle "particles" behave consistently
note!
effect of wind is 1/25 compared to before
other forces 1/10
Diffstat (limited to 'source/blender/blenkernel/intern/softbody.c')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 9005db1312f..8fe956002a9 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1548,7 +1548,7 @@ void scan_for_ext_spring_forces(Object *ob,float timenow) /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/ if(sb->aeroedge){ float vel[3],sp[3],pr[3],force[3]; - float f,windfactor = 250.0f; + float f,windfactor = 10.0f; /*see if we have wind*/ if(do_effector) { float speed[3]={0.0f,0.0f,0.0f}; @@ -2034,7 +2034,7 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int BodySpring *bs; ListBase *do_effector; float iks, ks, kd, gravity; - float fieldfactor = 1000.0f, windfactor = 250.0f; + float fieldfactor = -100.0f, windfactor = 10.0f; float tune = sb->ballstiff; int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero; @@ -2053,7 +2053,6 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int /* check conditions for various options */ do_deflector= query_external_colliders(ob); - do_effector= pdInitEffectors(ob,NULL); do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); @@ -2061,9 +2060,10 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */ bproot= sb->bpoint; /* need this for proper spring addressing */ - - if (do_springcollision || do_aero) scan_for_ext_spring_forces(ob,timenow); + /* after spring scan because it uses Effoctors too */ + do_effector= pdInitEffectors(ob,NULL); + if (do_deflector) { float defforce[3]; do_deflector = sb_detect_aabb_collisionCached(defforce,ob->lay,ob,timenow); |