diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-05 13:26:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-05 13:26:52 +0300 |
commit | 7853cb3c5a43ee3d4168c3f0291e7ab9e9c3fa10 (patch) | |
tree | be2f633cf7ce534588257166094dee44d53fb1d0 /source/blender | |
parent | a7442bef59b3857e5b0d085ce94193ba9899459c (diff) |
Remove redundant addition in BKE_mesh_calc_volume
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index a334951c772..3bc0492e179 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -2121,8 +2121,7 @@ void BKE_mesh_calc_volume( totvol += vol; } if (r_center) { - /* averaging factor 1/4 is applied in the end */ - madd_v3_v3fl(r_center, center, vol); /* XXX could extract this */ + /* averaging factor 1/3 is applied in the end */ madd_v3_v3fl(r_center, v1->co, vol); madd_v3_v3fl(r_center, v2->co, vol); madd_v3_v3fl(r_center, v3->co, vol); @@ -2137,11 +2136,11 @@ void BKE_mesh_calc_volume( *r_volume = fabsf(totvol); } if (r_center) { - /* Note: Factor 1/4 is applied once for all vertices here. + /* Note: Factor 1/3 is applied once for all vertices here. * This also automatically negates the vector if totvol is negative. */ if (totvol != 0.0f) - mul_v3_fl(r_center, 0.25f / totvol); + mul_v3_fl(r_center, (1.0f / 3.0f) / totvol); } } |