diff options
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_queries.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index a4ddc0cbba4..8a1d513a8fc 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -1720,7 +1720,7 @@ static void bm_mesh_calc_volume_face(BMFace *f, float *r_vol) *r_vol += (1.0f / 6.0f) * dot_v3v3(p1, cross); } } -float BM_mesh_calc_volume(BMesh *bm) +float BM_mesh_calc_volume(BMesh *bm, bool is_signed) { /* warning, calls own tessellation function, may be slow */ float vol = 0.0f; @@ -1731,5 +1731,9 @@ float BM_mesh_calc_volume(BMesh *bm) bm_mesh_calc_volume_face(f, &vol); } - return fabsf(vol); + if (is_signed == false) { + vol = fabsf(vol); + } + + return vol; } |