[Bf-blender-cvs] [e52ad1835a6] master: Fix hair collision instability with 'Quality Steps' > 1
Philipp Oeser
noreply at git.blender.org
Wed Sep 4 21:10:27 CEST 2019
Commit: e52ad1835a6aaefab389b173728b9bb7ef2e754a
Author: Philipp Oeser
Date: Wed Sep 4 19:33:26 2019 +0200
Branches: master
https://developer.blender.org/rBe52ad1835a6aaefab389b173728b9bb7ef2e754a
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
===================================================================
M source/blender/physics/intern/BPH_mass_spring.cpp
===================================================================
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);
More information about the Bf-blender-cvs
mailing list