diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-01-13 10:26:11 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-01-13 10:26:11 +0300 |
commit | 219b472920998d763916c165816191bd8ae1f4a1 (patch) | |
tree | d942c83359abf7cb1f0362afbbd543e3f72e38ee /source/blender/editors/mesh/editmesh_mods.c | |
parent | ed12e1978fec2eed33439f5e342cd84ef443d04e (diff) | |
parent | 3b1585b1722efcf06ef9aa8f9d673047e68a7b9d (diff) |
merge with trunk/2.5 at r25907
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 626062b27a1..dd70181884a 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1908,8 +1908,7 @@ void EM_deselect_by_material(EditMesh *em, int index) } /* **************** NORMALS ************** */ -/* XXX value of select is messed up, it means two things */ -void righthandfaces(EditMesh *em, int select) /* makes faces righthand turning */ +void EM_recalc_normal_direction(EditMesh *em, int inside, int select) /* makes faces righthand turning */ { EditEdge *eed, *ed1, *ed2, *ed3, *ed4; EditFace *efa, *startvl; @@ -2001,16 +2000,12 @@ void righthandfaces(EditMesh *em, int select) /* makes faces righthand turning * cent_tri_v3(cent, startvl->v1->co, startvl->v2->co, startvl->v3->co); } /* first normal is oriented this way or the other */ - if(select) { - if(select==2) { - if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipface(em, startvl); - } - else { - if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(em, startvl); - } + if(inside) { + if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipface(em, startvl); + } + else { + if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(em, startvl); } - else if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(em, startvl); - eed= startvl->e1; if(eed->v1==startvl->v1) eed->f2= 1; |