[Bf-blender-cvs] [271f64e3588] master: Fix T54293: calculate mass does not take object scale into account
Jacques Lucke
noreply at git.blender.org
Tue Sep 15 12:47:43 CEST 2020
Commit: 271f64e3588b76828e346ab8255e722c981a3d3f
Author: Jacques Lucke
Date: Tue Sep 15 12:43:00 2020 +0200
Branches: master
https://developer.blender.org/rB271f64e3588b76828e346ab8255e722c981a3d3f
Fix T54293: calculate mass does not take object scale into account
===================================================================
M source/blender/blenkernel/intern/rigidbody.c
===================================================================
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 0a31af032d3..6b2b7271c76 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -708,6 +708,8 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol)
if (totvert > 0 && tottri > 0) {
BKE_mesh_calc_volume(mvert, totvert, lt, tottri, mloop, &volume, NULL);
+ const float volume_scale = mat4_to_volume_scale(ob->obmat);
+ volume *= fabsf(volume_scale);
}
}
else {
More information about the Bf-blender-cvs
mailing list