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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-09-04 20:33:26 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-09-04 22:05:54 +0300
commite52ad1835a6aaefab389b173728b9bb7ef2e754a (patch)
tree12ccf1bb5f18adb57789341215e7112e9427fbb0 /source/blender/physics
parent49ff9ca613a43e72c76628a188efc371e5d854c6 (diff)
Fix hair collision instability with 'Quality Steps' > 1
This was removed in rB0666ece2e2f9 because it is handled differently for "real" cloth in cloth_solve_collisions(), but hair still needs this apparently [does its thing in cloth_continuum_step() instead]. And since we have a default 'Quality Steps' setting of 5, it made many simulations unstable. Fixes T65038, T59742 (possibly others) Reviewers: brecht Maniphest Tasks: T65038, T59742 Differential Revision: https://developer.blender.org/D5681
Diffstat (limited to 'source/blender/physics')
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 07cb3370eec..ce0dc1b49e0 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -1111,6 +1111,12 @@ int BPH_cloth_solve(
ImplicitSolverResult result;
if (is_hair) {
+ /* copy velocities for collision */
+ for (i = 0; i < mvert_num; i++) {
+ BPH_mass_spring_get_motion_state(id, i, NULL, verts[i].tv);
+ copy_v3_v3(verts[i].v, verts[i].tv);
+ }
+
/* determine contact points */
if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED) {
cloth_find_point_contacts(depsgraph, ob, clmd, 0.0f, tf, &contacts, &totcolliders);