Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-22 23:39:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-22 23:39:10 +0400
commit556705f84efcb225ec1767e11167537a02553f2a (patch)
tree0bae9ac5ebb960b9845b7428b51a61cea28e4ca4 /source/blender/editors/space_view3d/view3d_project.c
parentbf51e807991b004de079736dfaeae6b642eaae4a (diff)
add clip_segment_v3_plane_n() to clip a line segment to planes (as used for view clipping).
use in ED_view3d_win_to_segment_clip() and fix error, was clipping by only 4 planes rather then 6.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_project.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index ccfbf964d36..bb5e6802473 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -522,21 +522,9 @@ bool ED_view3d_win_to_segment_clip(const ARegion *ar, View3D *v3d, const float m
/* clipping */
if (rv3d->rflag & RV3D_CLIPPING) {
- /* if the ray is totally clipped,
- * restore the original values but return false
- * caller can choose what to do */
- float tray_start[3] = {UNPACK3(ray_start)};
- float tray_end[3] = {UNPACK3(ray_end)};
- int a;
- for (a = 0; a < 4; a++) {
- if (clip_line_plane(tray_start, tray_end, rv3d->clip[a]) == false) {
- return false;
- }
+ if (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6) == false) {
+ return false;
}
-
- /* copy in clipped values */
- copy_v3_v3(ray_start, tray_start);
- copy_v3_v3(ray_end, tray_end);
}
return true;