diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 11:08:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 11:10:15 +0300 |
commit | 98ad7c21c0b9c1fe95088fe2443234d665bebcf6 (patch) | |
tree | 1a50837c0454752f64e4a0727b6fbc95d2582330 /source | |
parent | 3debcc8b517ece352aa325cfd61adc0b16cf91da (diff) |
Blender-Internal: avoid redundant area check
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c7170cfa4b4..35878f664ea 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2721,12 +2721,13 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) vlr->v4= NULL; /* to prevent float accuracy issues, we calculate normal in local object space (not world) */ - if (area_tri_v3(co3, co2, co1)>FLT_EPSILON) { - if (negative_scale) - normal_tri_v3(tmp, co1, co2, co3); - else - normal_tri_v3(tmp, co3, co2, co1); - add_v3_v3(n, tmp); + if (normal_tri_v3(tmp, co1, co2, co3) > FLT_EPSILON) { + if (negative_scale == false) { + add_v3_v3(n, tmp); + } + else { + sub_v3_v3(n, tmp); + } } vlr->mat= matar[ dl->col ]; |