[Bf-blender-cvs] [68b0b7c] blender-v2.72-release: Fix T42264: Negative scale & clipped-select fails

Campbell Barton noreply at git.blender.org
Tue Oct 21 12:14:48 CEST 2014


Commit: 68b0b7c1f1be8bf6d2541f094e5d61b8b2b505d6
Author: Campbell Barton
Date:   Mon Oct 20 11:14:02 2014 +0200
Branches: blender-v2.72-release
https://developer.blender.org/rB68b0b7c1f1be8bf6d2541f094e5d61b8b2b505d6

Fix T42264: Negative scale & clipped-select fails

Thanks to mont29 for finding the cause.

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index cbc619f..7d63dc5 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])




More information about the Bf-blender-cvs mailing list