diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 10:50:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-24 10:50:15 +0400 |
commit | dfdb2eb9a88b14c0aade5e7e503a160e521f7c63 (patch) | |
tree | 0e5926b9738c1c95c2d11b31dab0248645085f39 /source/blender/blenkernel | |
parent | 8e6ce736c4fcdd83344b0b6e0ba65cec340eec21 (diff) |
fix own error in r56649, caused normal calculation to fail, reported as [#35448], also quiet float/double warning.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 4bf0ed5737e..db0fee54d39 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1951,9 +1951,9 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml, /* Polygon Normal and edge-vector */ /* inline version of #BKE_mesh_calc_poly_normal, also does edge-vectors */ { - float const *v_prev = mvert[ml[nverts - 1].v].co; - float const *v_curr; int i_prev = nverts - 1; + float const *v_prev = mvert[ml[i_prev].v].co; + float const *v_curr; zero_v3(polyno); /* Newell's Method */ @@ -1979,14 +1979,13 @@ static void mesh_calc_normals_poly_accum(MPoly *mp, MLoop *ml, for (i = 0; i < nverts; i++) { const float *cur_edge = edgevecbuf[i]; - unsigned int vindex = ml[i].v; /* calculate angle between the two poly edges incident on * this vertex */ const float fac = saacos(-dot_v3v3(cur_edge, prev_edge)); /* accumulate */ - madd_v3_v3fl(tnorms[vindex], polyno, fac); + madd_v3_v3fl(tnorms[ml[i].v], polyno, fac); prev_edge = cur_edge; } } |