diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-05 17:26:38 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-05 17:26:38 +0300 |
commit | d16547ab73e7086d5358bba67093173827d12afe (patch) | |
tree | cdcc994222129063aaf916f972f8ed3311675266 /source/blender/editors/space_view3d/view3d_view.c | |
parent | 01b762e8463ec6192d43b3bfac7d29b0c24757c0 (diff) |
Alt+B view clipping is now taken into account properly for sculpt, particle
edit and snapping, by clipping the view ray.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 48f3c77091f..c7b62dd7ef4 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -536,6 +536,7 @@ void viewline(ARegion *ar, View3D *v3d, float mval[2], float ray_start[3], float { RegionView3D *rv3d= ar->regiondata; float vec[4]; + int a; if(rv3d->persp != RV3D_ORTHO){ vec[0]= 2.0f * mval[0] / ar->winx - 1; @@ -564,6 +565,11 @@ void viewline(ARegion *ar, View3D *v3d, float mval[2], float ray_start[3], float VECADDFAC(ray_start, vec, rv3d->viewinv[2], 1000.0f); VECADDFAC(ray_end, vec, rv3d->viewinv[2], -1000.0f); } + + /* clipping */ + if(rv3d->rflag & RV3D_CLIPPING) + for(a=0; a<4; a++) + clip_line_plane(ray_start, ray_end, rv3d->clip[a]); } /* create intersection ray in view Z direction at mouse coordinates */ |