Commit: 0a59c0132e884a08615e2efeb060b2d07006a7dd
Author: Martin Felke
Date:   Sat Nov 8 12:58:48 2014 +0100
Branches: fracture_modifier
https://developer.blender.org/rB0a59c0132e884a08615e2efeb060b2d07006a7dd

Merge remote-tracking branch 'refs/remotes/origin/master' into fracture_modifier

Conflicts:
        source/blender/blenkernel/intern/pointcache.c
        source/blender/blenkernel/intern/rigidbody.c

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



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

diff --cc source/blender/blenkernel/intern/rigidbody.c
index e91f9bd,2f6ac6c..adbcd69
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@@ -1033,26 -483,24 +1033,27 @@@ void BKE_rigidbody_validate_sim_shard_s
                height = size[2];
        }
        else if (rbo->shape == RB_SHAPE_SPHERE) {
-               /* take radius to the the largest dimension to try and 
encompass everything */
-               radius = MAX3(size[0], size[1], size[2]);
++
+               /* take radius to the largest dimension to try and encompass 
everything */
+               radius = max_fff(size[0], size[1], size[2]) * 0.5f;
        }
 -
 -      /* calculate volume as appropriate  */
 +      
 +      /* create new shape */
        switch (rbo->shape) {
                case RB_SHAPE_BOX:
 -                      volume = size[0] * size[1] * size[2];
 +                      new_shape = RB_shape_new_box(size[0], size[1], size[2]);
                        break;
 -
 +      
                case RB_SHAPE_SPHERE:
 -                      volume = 4.0f / 3.0f * (float)M_PI * radius * radius * 
radius;
 +                      new_shape = RB_shape_new_sphere(radius);
                        break;
 -
 -              /* for now, assume that capsule is close enough to a 
cylinder... */
 +      
                case RB_SHAPE_CAPSULE:
 +                      capsule_height = (height - radius) * 2.0f;
 +                      new_shape = RB_shape_new_capsule(radius, 
(capsule_height > 0.0f) ? capsule_height : 0.0f);
 +                      break;
                case RB_SHAPE_CYLINDER:
 -                      volume = (float)M_PI * radius * radius * height;
 +                      new_shape = RB_shape_new_cylinder(radius, height);
                        break;
  
                case RB_SHAPE_CONE:
diff --cc source/blender/makesrna/intern/rna_rigidbody.c
index 590ec47,86a8b16..2c324af
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@@ -975,9 -805,10 +986,9 @@@ static void rna_def_rigidbody_object(Bl
        prop = RNA_def_property(srna, "collision_shape", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "shape");
        RNA_def_property_enum_items(prop, rigidbody_object_shape_items);
 -      RNA_def_property_enum_funcs(prop, NULL, "rna_RigidBodyOb_shape_set", 
NULL);
        RNA_def_property_ui_text(prop, "Collision Shape", "Collision Shape of 
object in Rigid Body Simulations");
        RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-       RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, 
"rna_RigidBodyOb_reset");
+       RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, 
"rna_RigidBodyOb_shape_update");
        
        prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_KINEMATIC);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to