[Bf-blender-cvs] [eebf770] fracture_modifier: fix : set some better default values for Fractal Boolean, so the object / default cube should not explode automatically, but its far from optimal still this way.... (active objects with Mesh Shape cause unstable simulation behavior)

Martin Felke noreply at git.blender.org
Tue Feb 17 22:40:07 CET 2015


Commit: eebf770f1d36494aa5409f58e420543e32770c04
Author: Martin Felke
Date:   Tue Feb 17 22:39:25 2015 +0100
Branches: fracture_modifier
https://developer.blender.org/rBeebf770f1d36494aa5409f58e420543e32770c04

fix : set some better default values for Fractal Boolean, so the object / default cube should not explode automatically, but its far from optimal still this way.... (active objects with Mesh Shape cause unstable simulation behavior)

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

M	source/blender/modifiers/intern/MOD_fracture.c

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

diff --git a/source/blender/modifiers/intern/MOD_fracture.c b/source/blender/modifiers/intern/MOD_fracture.c
index 61f5cbe..fe2fcc2 100644
--- a/source/blender/modifiers/intern/MOD_fracture.c
+++ b/source/blender/modifiers/intern/MOD_fracture.c
@@ -1353,6 +1353,22 @@ static float mesh_separate_tagged(FractureModifierData *rmd, Object *ob, BMVert
 	mi->rigidbody = BKE_rigidbody_create_shard(rmd->modifier.scene, ob, mi);
 	BKE_rigidbody_calc_shard_mass(ob, mi, orig_dm);
 
+	if (rmd->frac_algorithm == MOD_FRACTURE_BOOLEAN_FRACTAL)
+	{
+		/* cant be kept together in other ways */
+		rmd->use_constraints = true;
+		rmd->contact_dist = 2.0f;
+		rmd->breaking_angle = DEG2RADF(1.0f);
+
+		/* this most likely will only work with "Mesh" shape*/
+		mi->rigidbody->shape = RB_SHAPE_TRIMESH;
+		mi->rigidbody->margin = 0.0f;
+
+		/* set values on "handle object" as well */
+		ob->rigidbody_object->shape = RB_SHAPE_TRIMESH;
+		ob->rigidbody_object->margin = 0.0f;
+	}
+
 	mi->start_frame = rmd->modifier.scene->rigidbody_world->pointcache->startframe;
 
 
@@ -2490,6 +2506,23 @@ static DerivedMesh *doSimulate(FractureModifierData *fmd, Object *ob, DerivedMes
 
 					mi->rigidbody = BKE_rigidbody_create_shard(fmd->modifier.scene, ob, mi);
 					BKE_rigidbody_calc_shard_mass(ob, mi, orig_dm);
+
+					if (fmd->frac_algorithm == MOD_FRACTURE_BOOLEAN_FRACTAL)
+					{
+						/* cant be kept together in other ways */
+						fmd->use_constraints = true;
+						fmd->contact_dist = 2.0f;
+						fmd->breaking_angle = DEG2RADF(1.0f);
+
+						/* this most likely will only work with "Mesh" shape*/
+						mi->rigidbody->shape = RB_SHAPE_TRIMESH;
+						mi->rigidbody->margin = 0.0f;
+
+						/* set values on "handle object" as well */
+						ob->rigidbody_object->shape = RB_SHAPE_TRIMESH;
+						ob->rigidbody_object->margin = 0.0f;
+					}
+
 					mi->vertex_indices = NULL;
 					mi->start_frame = fmd->modifier.scene->rigidbody_world->pointcache->startframe;




More information about the Bf-blender-cvs mailing list