diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-20 13:14:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-21 14:14:27 +0400 |
commit | 68b0b7c1f1be8bf6d2541f094e5d61b8b2b505d6 (patch) | |
tree | 793a2fa5c2d8a4730b5f7c45ee6242e17afb2fc2 | |
parent | f831e5e291fcbb67a3735712f21cd31ccb582f12 (diff) |
Fix T42264: Negative scale & clipped-select fails
Thanks to mont29 for finding the cause.
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index cbc619f6a94..7d63dc505f0 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -4360,12 +4360,16 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot) /* ********************* set clipping operator ****************** */ -static void calc_clipping_plane(float clip[6][4], const BoundBox *clipbb) +static void calc_clipping_plane(float clip[6][4], const BoundBox *clipbb, const bool is_flip) { int val; for (val = 0; val < 4; val++) { normal_tri_v3(clip[val], clipbb->vec[val], clipbb->vec[val == 3 ? 0 : val + 1], clipbb->vec[val + 4]); + if (UNLIKELY(is_flip)) { + negate_v3(clip[val]); + } + clip[val][3] = -dot_v3v3(clip[val], clipbb->vec[val]); } } @@ -4382,7 +4386,7 @@ static void calc_local_clipping(float clip_local[6][4], BoundBox *clipbb, float mul_v3_m4v3(clipbb_local.vec[i], imat, clipbb->vec[i]); } - calc_clipping_plane(clip_local, &clipbb_local); + calc_clipping_plane(clip_local, &clipbb_local, is_negative_m4(mat)); } void ED_view3d_clipping_local(RegionView3D *rv3d, float mat[4][4]) |