[Bf-blender-cvs] [e735eda393] cloth-improvements: Bring back impulse scaled repulses

Luca Rood noreply at git.blender.org
Mon Jan 30 06:55:09 CET 2017


Commit: e735eda393e79370fc897aad8cdc82c83a472ca9
Author: Luca Rood
Date:   Sat Jan 28 02:40:14 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rBe735eda393e79370fc897aad8cdc82c83a472ca9

Bring back impulse scaled repulses

It seems I was a bit too optimistic in thinking that just distance based
repulses could handle contacts nicely. Turns out impulse scaled repulses
really have enough of an influence in making the collision response more
effective, that it is worth keeping it for now, even if at the cost of a
very slight stability reduction and and a bit of an increase in
collision elasticity.

I hope to come up with a better solution, and elliminate this, after
cluster based impulse pruning is implemented.

===================================================================

M	source/blender/blenkernel/intern/collision.c

===================================================================

diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index c9259451e8..6f64d59ada 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -382,6 +382,7 @@ static int cloth_collision_response_static (ClothModifierData *clmd, CollisionMo
 				/* stay on the safe side and clamp repulse */
 				if ( impulse > ALMOST_ZERO )
 					repulse = min_ff( repulse, 5.0*impulse );
+				repulse = max_ff(impulse, repulse);
 
 				/*impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + w3*w3 ); original 2.0 / 0.25 */




More information about the Bf-blender-cvs mailing list