[Bf-blender-cvs] [929aa7c046] cloth-improvements: Fix plasticity issue with shearing springs
Luca Rood
noreply at git.blender.org
Fri Jan 6 07:49:25 CET 2017
Commit: 929aa7c046241cab156f51ff1033e7dbbca4c5b5
Author: Luca Rood
Date: Fri Jan 6 04:44:13 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rB929aa7c046241cab156f51ff1033e7dbbca4c5b5
Fix plasticity issue with shearing springs
===================================================================
M source/blender/physics/intern/implicit_blender.c
===================================================================
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c
index d91136ba53..42958790e9 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -1635,6 +1635,14 @@ bool BPH_mass_spring_force_spring_linear(Implicit_Data *data, int i, int j, floa
else {
zero_v3(f);
zero_m3(dfdx);
+
+ /* compute plasticity offset factor */
+ /* plasticity has to be computed even for non-compressive springs in a compression condition,
+ * otherwise issues occur where shearing gets unconstrained when cloth undergoes compression */
+ if (length < restlen / yield_fact) {
+ restlen -= (restlen - (length * yield_fact)) * plasticity;
+ *lenfact = restlen / restlenorig;
+ }
}
/* Calculate damping forces */
More information about the Bf-blender-cvs
mailing list