diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-02-29 02:12:50 +0300 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-02-29 02:12:50 +0300 |
commit | 6169b29b3a53eca3e342aeee9d33809e61f026c3 (patch) | |
tree | d578098dc7b22963950542786479a2ff46fd37ae /source/blender/blenkernel/intern/implicit.c | |
parent | 8c5a22daecb256652fe1adad575489d700a9e0c0 (diff) |
Cloth: Bugfix for wrong calculated bending springs, Bugfix for selfcollisions (faster + bugfix for explode), Changed: Collision response also put vertices back to surface now
Diffstat (limited to 'source/blender/blenkernel/intern/implicit.c')
-rw-r--r-- | source/blender/blenkernel/intern/implicit.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index bca5b96237e..96c3c33afb8 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1295,7 +1295,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, // Ascher & Boxman, p.21: Damping only during elonglation // something wrong with it... - mul_fvector_S(damping_force, dir, MIN2(1.0, clmd->sim_parms->Cdis) * INPR(vel,dir)); + mul_fvector_S(damping_force, dir, clmd->sim_parms->Cdis * INPR(vel,dir)); VECADD(s->f, s->f, damping_force); /* VERIFIED */ @@ -1330,7 +1330,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s, VECADDS(s->f, s->f, extent, -k); - mul_fvector_S(damping_force, dir, MIN2(1.0, (clmd->sim_parms->goalfrict/100.0)) * INPR(vel,dir)); + mul_fvector_S(damping_force, dir, clmd->sim_parms->goalfrict * 0.01 * INPR(vel,dir)); VECADD(s->f, s->f, damping_force); // HERE IS THE PROBLEM!!!! @@ -1611,13 +1611,8 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase if(result) { - if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) - { - if(verts [i].flags & CLOTH_VERT_FLAG_PINNED) - { - continue; - } - } + if((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) && (verts [i].flags & CLOTH_VERT_FLAG_PINNED)) + continue; VECCOPY(id->Xnew[i], verts[i].tx); VECCOPY(id->Vnew[i], verts[i].tv); |