[Bf-blender-cvs] [95ae90cab02] fracture_modifier: sphere shape now takes its margin into account too, allow also negative margin now (optionally)

Martin Felke noreply at git.blender.org
Sat Dec 23 15:16:10 CET 2017


Commit: 95ae90cab02be4f3262eed8c970750d6e4a9bfd8
Author: Martin Felke
Date:   Sat Dec 23 15:15:45 2017 +0100
Branches: fracture_modifier
https://developer.blender.org/rB95ae90cab02be4f3262eed8c970750d6e4a9bfd8

sphere shape now takes its margin into account too, allow also negative margin now (optionally)

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

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

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

diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index f769edc6527..2cc9dbc2f55 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -348,7 +348,7 @@ static void rigidbody_validate_sim_shape(Object *ob, bool rebuild)
 			break;
 
 		case RB_SHAPE_SPHERE:
-			new_shape = RB_shape_new_sphere(radius);
+			new_shape = RB_shape_new_sphere(radius + RBO_GET_MARGIN(rbo));
 			break;
 
 		case RB_SHAPE_CAPSULE:
@@ -3331,7 +3331,7 @@ void BKE_rigidbody_validate_sim_shard_shape(MeshIsland *mi, Object *ob, short re
 			break;
 
 		case RB_SHAPE_SPHERE:
-			new_shape = RB_shape_new_sphere(radius);
+			new_shape = RB_shape_new_sphere(radius + RBO_GET_MARGIN(rbo));
 			break;
 
 		case RB_SHAPE_CAPSULE:
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
index 02dee9324a1..2079608cfb1 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -1280,8 +1280,8 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_UNIT_LENGTH);
 	RNA_def_property_float_sdna(prop, NULL, "margin");
-	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
+	RNA_def_property_range(prop, -1.0f, 1.0f);
+	RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.01, 3);
 	RNA_def_property_float_default(prop, 0.04f);
 	RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_collision_margin_set", NULL);
 	RNA_def_property_ui_text(prop, "Collision Margin",



More information about the Bf-blender-cvs mailing list