Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Rood <LucaRood>2016-08-13 19:40:22 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2016-08-13 19:48:33 +0300
commitda77d9873f1632f2ec4b624e949c0270753fa465 (patch)
treee9574927276b3039807083ea0f029f43386c9f48 /source/blender/blenkernel/intern/cloth.c
parent35a6e540b172cf351da34715b8ad2e0bebc92d44 (diff)
Prevent max stiffness values from going under normal stiffness values in cloth stiffness scaling.
When updating the max values under stiffness scaling, they clip at the normal stiffness values as expected, however when updating stiffness values, you could set them higher than the max values, and the max values weren't updated accordingly. As the stiffness scaling computes using the absolute difference between the max values and the stiffness values, you got higher stiffnesses in scaled areas even though your max is actually lower than the normal stiffness. This diff fixes that behaviour, by updating the max values to be equal to the stiffness whenever you set a higher stiffness than the max value. Also, I have initialized the max values to the same as the stiffnesses, as they were previously just set to zero, and caused the same problem described above. Reviewers: lukastoenne Reviewed By: lukastoenne Tags: #physics Differential Revision: https://developer.blender.org/D2147
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r--source/blender/blenkernel/intern/cloth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 445be5277d8..28ef3f6f248 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -81,8 +81,10 @@ void cloth_init(ClothModifierData *clmd )
clmd->sim_parms->gravity[1] = 0.0;
clmd->sim_parms->gravity[2] = -9.81;
clmd->sim_parms->structural = 15.0;
+ clmd->sim_parms->max_struct = 15.0;
clmd->sim_parms->shear = 15.0;
clmd->sim_parms->bending = 0.5;
+ clmd->sim_parms->max_bend = 0.5;
clmd->sim_parms->bending_damping = 0.5;
clmd->sim_parms->Cdis = 5.0;
clmd->sim_parms->Cvi = 1.0;