Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-07-29 10:04:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-29 10:04:09 +0400
commitcdc315a69b52b873f844c4fe80ac86e847995fc2 (patch)
tree81f2e78cbb77e1d9f7f5ed3bc7a0e98cc9c80dcc /source/blender/bmesh/intern/bmesh_polygon.c
parent33a9cb6caa27aff13942fdea5e95cb9ac8ee74df (diff)
bmesh optimization (noted as todo), avoid recalculating normal every time BM_face_legal_splits() runs,
assume normal is valid (assert when its not).
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 297458eb1d6..c7772392c8e 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -1061,7 +1061,7 @@ void BM_face_legal_splits(BMFace *f, BMLoop *(*loops)[2], int len)
{
const int len2 = len * 2;
BMLoop *l;
- float v1[2], v2[2], v3[2] /*, v4[3 */, no[3], mid[2], *p1, *p2, *p3, *p4;
+ float v1[2], v2[2], v3[2], mid[2], *p1, *p2, *p3, *p4;
float out[2] = {-FLT_MAX, -FLT_MAX};
float axis_mat[3][3];
float (*projverts)[2] = BLI_array_alloca(projverts, f->len);
@@ -1069,10 +1069,9 @@ void BM_face_legal_splits(BMFace *f, BMLoop *(*loops)[2], int len)
float fac1 = 1.0000001f, fac2 = 0.9f; //9999f; //0.999f;
int i, j, a = 0, clen;
- /* TODO, the face normal may already be correct */
- BM_face_calc_normal(f, no);
+ BLI_assert(BM_face_is_normal_valid(f));
- axis_dominant_v3_to_m3(axis_mat, no);
+ axis_dominant_v3_to_m3(axis_mat, f->no);
for (i = 0, l = BM_FACE_FIRST_LOOP(f); i < f->len; i++, l = l->next) {
BM_elem_index_set(l, i); /* set_loop */