diff options
author | Luca Rood <dev@lucarood.com> | 2018-09-11 17:09:45 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2018-09-11 17:09:45 +0300 |
commit | 9ac72ab69d1f91a7200e5eb43f5a6ad9f8547c9a (patch) | |
tree | f121ac42f08b546cb8ca6026f0066ac912eb1bd8 /source/blender/physics/intern/BPH_mass_spring.cpp | |
parent | eaf993ad9472dcd22e005c4a1d4df8920a98aed4 (diff) |
Cloth: Fix mistake in recent angular bending commit (b6f0f8a5b5a)
The angular spring force computation function was being called even in
linear mode, with empty angular springs.
Diffstat (limited to 'source/blender/physics/intern/BPH_mass_spring.cpp')
-rw-r--r-- | source/blender/physics/intern/BPH_mass_spring.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp index 6ea2eeca6f8..9ab688a3670 100644 --- a/source/blender/physics/intern/BPH_mass_spring.cpp +++ b/source/blender/physics/intern/BPH_mass_spring.cpp @@ -341,13 +341,13 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s) Cloth *cloth = clmd->clothObject; ClothSimSettings *parms = clmd->sim_parms; Implicit_Data *data = cloth->implicit; - bool new_compress = parms->bending_model == CLOTH_BENDING_ANGULAR; - bool resist_compress = (parms->flags & CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS) && !new_compress; + bool using_angular = parms->bending_model == CLOTH_BENDING_ANGULAR; + bool resist_compress = (parms->flags & CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS) && !using_angular; s->flags &= ~CLOTH_SPRING_FLAG_NEEDED; /* Calculate force of bending springs. */ - if (s->type & CLOTH_SPRING_TYPE_BENDING) { + if ((s->type & CLOTH_SPRING_TYPE_BENDING) && using_angular) { #ifdef CLOTH_FORCE_SPRING_BEND float k, scaling; @@ -386,7 +386,7 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s) BPH_mass_spring_force_spring_linear(data, s->ij, s->kl, s->restlen, k_tension, parms->tension_damp, k_compression, parms->compression_damp, - resist_compress, new_compress, 0.0f); + resist_compress, using_angular, 0.0f); } #endif } |