[Bf-blender-cvs] [c4b94f3] fracture_modifier: explaining comment: "need to distinguish between mesh and non-mesh objects for fracture modifier" and quiet some warnings
Martin Felke
noreply at git.blender.org
Thu Oct 9 16:50:33 CEST 2014
Commit: c4b94f3049cd4d328b74443ecb37d4cd577fb454
Author: Martin Felke
Date: Thu Oct 9 16:29:33 2014 +0200
Branches: fracture_modifier
https://developer.blender.org/rBc4b94f3049cd4d328b74443ecb37d4cd577fb454
explaining comment: "need to distinguish between mesh and non-mesh objects for fracture modifier" and quiet some warnings
===================================================================
M source/blender/blenkernel/BKE_rigidbody.h
M source/blender/editors/physics/rigidbody_object.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h
index 89cee57..eef355c 100644
--- a/source/blender/blenkernel/BKE_rigidbody.h
+++ b/source/blender/blenkernel/BKE_rigidbody.h
@@ -42,6 +42,7 @@ struct Scene;
struct Object;
struct Group;
struct MeshIsland;
+struct FractureModifierData;
/* -------------- */
/* Memory Management */
@@ -81,7 +82,7 @@ void BKE_rigidbody_validate_sim_shard(struct RigidBodyWorld *rbw, struct MeshIsl
void BKE_rigidbody_validate_sim_shard_shape(struct MeshIsland *mi, struct Object *ob, short rebuild);
/* move the islands of the visible mesh according to shard rigidbody movement */
-void BKE_rigidbody_update_cell(struct MeshIsland *mi, struct Object* ob, float loc[3], float rot[4], struct FractureModifierData* rmd);
+void BKE_rigidbody_update_cell(struct MeshIsland *mi, struct Object* ob, float loc[3], float rot[4], struct FractureModifierData *rmd);
void BKE_rigidbody_calc_center_of_mass(struct Object *ob, float r_com[3]);
diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c
index 9b1b47e..bdc78f8 100644
--- a/source/blender/editors/physics/rigidbody_object.c
+++ b/source/blender/editors/physics/rigidbody_object.c
@@ -528,7 +528,9 @@ static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op)
}
else {
float dim[3];
- /* else get object boundbox as last resort */
+ /* else get object boundbox as last resort,
+ * because fracture modifier can operate on non-mesh objects too
+ * and there we need a fallback volume of the "whole" object as well*/
BKE_object_dimensions_get(ob, dim);
volume = dim[0] * dim[1] * dim[2];
}
More information about the Bf-blender-cvs
mailing list