code cleanup: view3d_clipping_test was making a vector copy for no reason.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Mar 2013 07:15:09 +0000 (07:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Mar 2013 07:15:09 +0000 (07:15 +0000)
source/blender/editors/include/ED_view3d.h
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_constraints.c

index d89d66d..dfb3b6b 100644 (file)
@@ -219,7 +219,7 @@ void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar,
 
 void ED_view3d_clipping_calc(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, const struct rcti *rect);
 void ED_view3d_clipping_local(struct RegionView3D *rv3d, float mat[4][4]);
-int  ED_view3d_clipping_test(struct RegionView3D *rv3d, const float vec[3], const int is_local);
+int  ED_view3d_clipping_test(struct RegionView3D *rv3d, const float co[3], const bool is_local);
 void ED_view3d_clipping_set(struct RegionView3D *rv3d);
 void ED_view3d_clipping_enable(void);
 void ED_view3d_clipping_disable(void);
index 4aaa333..2a2293c 100644 (file)
@@ -219,15 +219,12 @@ void ED_view3d_clipping_enable(void)
        }
 }
 
-static int view3d_clipping_test(const float vec[3], float clip[6][4])
+static int view3d_clipping_test(const float co[3], float clip[6][4])
 {
-       float view[3];
-       copy_v3_v3(view, vec);
-
-       if (0.0f < clip[0][3] + dot_v3v3(view, clip[0]))
-               if (0.0f < clip[1][3] + dot_v3v3(view, clip[1]))
-                       if (0.0f < clip[2][3] + dot_v3v3(view, clip[2]))
-                               if (0.0f < clip[3][3] + dot_v3v3(view, clip[3]))
+       if (0.0f < clip[0][3] + dot_v3v3(co, clip[0]))
+               if (0.0f < clip[1][3] + dot_v3v3(co, clip[1]))
+                       if (0.0f < clip[2][3] + dot_v3v3(co, clip[2]))
+                               if (0.0f < clip[3][3] + dot_v3v3(co, clip[3]))
                                        return 0;
 
        return 1;
@@ -235,9 +232,9 @@ static int view3d_clipping_test(const float vec[3], float clip[6][4])
 
 /* for 'local' ED_view3d_clipping_local must run first
  * then all comparisons can be done in localspace */
-int ED_view3d_clipping_test(RegionView3D *rv3d, const float vec[3], const int is_local)
+int ED_view3d_clipping_test(RegionView3D *rv3d, const float co[3], const bool is_local)
 {
-       return view3d_clipping_test(vec, is_local ? rv3d->clip_local : rv3d->clip);
+       return view3d_clipping_test(co, is_local ? rv3d->clip_local : rv3d->clip);
 }
 
 /* ********* end custom clipping *********** */
index c4d6147..256ae90 100644 (file)
  *  \ingroup edtransform
  */
 
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
 
 #ifndef WIN32
-#include <unistd.h>
+#  include <unistd.h>
 #else
-#include <io.h>
+#  include <io.h>
 #endif
 
-
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_screen_types.h"
 
 #include "BKE_context.h"
 
-#include "ED_image.h"
-#include "ED_view3d.h"
-
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 #include "BLI_string.h"
 
+#include "ED_image.h"
+#include "ED_view3d.h"
+
 #include "BLF_translation.h"
 
 #include "UI_resources.h"