[Bf-blender-cvs] [ae9d247] fracture_modifier: small fix for compounds, new collision suppression is disabled for them now

Martin Felke noreply at git.blender.org
Thu Dec 15 00:31:05 CET 2016


Commit: ae9d247ea5daebedd60cf95f980751b20b769afd
Author: Martin Felke
Date:   Thu Dec 15 00:30:40 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rBae9d247ea5daebedd60cf95f980751b20b769afd

small fix for compounds, new collision suppression is disabled for them now

it caused wrong behavior - one shard always fell off unintendedly.

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 3d442a5..4be148e 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -2109,9 +2109,9 @@ static void fake_dynamic_collide(Object *ob1, Object *ob2, MeshIsland *mi1, Mesh
 	}
 }
 
-static bool check_constraint_island(MeshIsland *mi1, MeshIsland *mi2)
+static bool check_constraint_island(FractureModifierData* fmd, MeshIsland *mi1, MeshIsland *mi2)
 {
-	if (mi1 && mi2) {
+	if (mi1 && mi2 && !fmd->use_compounds) {
 		return mi1->constraint_index != mi2->constraint_index;
 	}
 
@@ -2215,7 +2215,7 @@ static int filterCallback(void* world, void* island1, void* island2, void *blend
 	fake_dynamic_collide(ob1, ob2, mi1, mi2, rbw);
 	fake_dynamic_collide(ob2, ob1, mi2, mi1, rbw);
 
-	return check_colgroup_ghost(ob1, ob2) && (check_constraint_island(mi1, mi2) && check_constraint_island(mi2, mi1) || (ob1 != ob2));
+	return check_colgroup_ghost(ob1, ob2) && (check_constraint_island(fmd1, mi1, mi2) && check_constraint_island(fmd2, mi2, mi1) || (ob1 != ob2));
 }
 
 static bool can_break(Object* collider, Object* ob, bool limit)




More information about the Bf-blender-cvs mailing list