diff options
Diffstat (limited to 'source/blender/physics/intern/implicit_blender.c')
-rw-r--r-- | source/blender/physics/intern/implicit_blender.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c index 832d516b839..2ad8ee0547f 100644 --- a/source/blender/physics/intern/implicit_blender.c +++ b/source/blender/physics/intern/implicit_blender.c @@ -1586,8 +1586,11 @@ bool BPH_mass_spring_force_spring_linear(Implicit_Data *data, int i, int j, floa // calculate elonglation spring_length(data, i, j, extent, dir, &length, vel); - - if (length > restlen || no_compress) { + + /* This code computes not only the force, but also its derivative. + Zero derivative effectively disables the spring for the implicit solver. + Thus length > restlen makes cloth unconstrained at the start of simulation. */ + if ((length >= restlen && length > 0) || no_compress) { float stretch_force, f[3], dfdx[3][3], dfdv[3][3]; stretch_force = stiffness * (length - restlen); |