diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-13 00:24:45 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-13 22:53:07 +0300 |
commit | ec9edd36ca1f8f73373435a7941abff77df53719 (patch) | |
tree | 4f8c7b5bea8b3337fa5ce01991610dfd4c855c46 /source/blender/editors/sculpt_paint/sculpt_intern.h | |
parent | 9722e369cd42532bc41c6ad884c71d88a8f547a9 (diff) |
Sculpt: Use plasticity for softbody influence
Previously the softbody strength property was controlling the strength
of the constraints that pin all vertices to the original location. This
was causing problems when the forces were trying to deform the vertices
too much, like when using gravity or grab brushes.
Now softbody is implemented with plasticity, which creates constraints to
a separate coordinates array. These coordinates are deformed with the
simulation, and the plasticity parameter controls how much the
simulation moves the coordinates (plasticity 0), or the coordinates move
the simulation back to its previous position (plasticity 1).
This creates much better and predictable results and adding softbody
plasticity to the brushes can increase its control and the stability of
the simulation.
Reviewed By: sergey, zeddb
Differential Revision: https://developer.blender.org/D9187
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 84a47ab86ba..a690e426770 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -365,11 +365,13 @@ void SCULPT_do_cloth_brush(struct Sculpt *sd, void SCULPT_cloth_simulation_free(struct SculptClothSimulation *cloth_sim); -struct SculptClothSimulation *SCULPT_cloth_brush_simulation_create(struct SculptSession *ss, - const float cloth_mass, - const float cloth_damping, - const bool use_collisions, - const bool needs_deform_coords); +struct SculptClothSimulation *SCULPT_cloth_brush_simulation_create( + struct SculptSession *ss, + const float cloth_mass, + const float cloth_damping, + const float cloth_softbody_strength, + const bool use_collisions, + const bool needs_deform_coords); void SCULPT_cloth_brush_simulation_init(struct SculptSession *ss, struct SculptClothSimulation *cloth_sim); |