diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-12 07:23:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-12 07:23:44 +0400 |
commit | 3a0e563feb08233217f937ac7040be66d062a73b (patch) | |
tree | 83a34d236cd8492a2a431e7985fd10d85e03adfe /source/blender/editors | |
parent | 0143a8c6e546eeb63bbe90750fa6b628837e9903 (diff) |
bugfix [#23191] Ctrl-LMB quick extrude problem with non-perpendicular edges/faces.
also remove is_mat4_flipped() from transform_manipulator.c.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 11 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 22 |
2 files changed, 16 insertions, 17 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 7dac8a465fa..90c5314bf3d 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -141,7 +141,16 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) done= 1; } } - if(done) normalize_v3(nor); + if(done) { + float view_vec[3], cross[3]; + + /* correct the normal to be aligned on the view plane */ + copy_v3_v3(view_vec, vc.rv3d->viewinv[2]); + mul_mat3_m4_v3(vc.obedit->imat, view_vec); + cross_v3_v3v3(cross, nor, view_vec); + cross_v3_v3v3(nor, view_vec, cross); + normalize_v3(nor); + } /* center */ add_v3_v3v3(cent, min, max); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 51698c27b37..1d32f893b80 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -101,16 +101,6 @@ #define MAN_GHOST 1 #define MAN_MOVECOL 2 - -static int is_mat4_flipped(float mat[][4]) -{ - float vec[3]; - - cross_v3_v3v3(vec, mat[0], mat[1]); - if( dot_v3v3(vec, mat[2]) < 0.0 ) return 1; - return 0; -} - /* transform widget center calc helper for below */ static void calc_tw_center(Scene *scene, float *co) { @@ -753,7 +743,7 @@ static void preOrthoFront(int ortho, float twmat[][4], int axis) orthogonalize_m4(omat, axis); glPushMatrix(); glMultMatrixf(omat); - glFrontFace( is_mat4_flipped(omat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(omat) ? GL_CW:GL_CCW); } } @@ -850,12 +840,12 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); if (ortho) { glMultMatrixf(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(matt) ? GL_CW:GL_CCW); } } else { if (ortho) { - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); glMultMatrixf(rv3d->twmat); } } @@ -1116,11 +1106,11 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, copy_m4_m4(matt, rv3d->twmat); // to copy the parts outside of [3][3] // XXX mul_m4_m3m4(matt, t->mat, rv3d->twmat); glMultMatrixf(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(matt) ? GL_CW:GL_CCW); } else { glMultMatrixf(rv3d->twmat); - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); } /* axis */ @@ -1327,7 +1317,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov glMultMatrixf(rv3d->twmat); } - glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + glFrontFace(is_negative_m4(rv3d->twmat) ? GL_CW:GL_CCW); /* axis */ if( (G.f & G_PICKSEL)==0 ) { |