[Bf-blender-cvs] [abe36478c69] master: 3D View: add clip argument to win_to_3d_on_plane
Campbell Barton
noreply at git.blender.org
Thu Sep 20 04:32:59 CEST 2018
Commit: abe36478c697a2e71fa7e92dc742704b9d583a16
Author: Campbell Barton
Date: Thu Sep 20 12:42:00 2018 +1000
Branches: master
https://developer.blender.org/rBabe36478c697a2e71fa7e92dc742704b9d583a16
3D View: add clip argument to win_to_3d_on_plane
===================================================================
M source/blender/editors/include/ED_view3d.h
M source/blender/editors/space_view3d/view3d_project.c
===================================================================
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 0f8cd7260fd..c21a6cccb2e 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -241,11 +241,11 @@ void ED_view3d_win_to_3d_int(
float r_out[3]);
bool ED_view3d_win_to_3d_on_plane(
const struct ARegion *ar,
- const float plane[4], const float mval[2],
+ const float plane[4], const float mval[2], const bool do_clip,
float r_out[3]);
bool ED_view3d_win_to_3d_on_plane_int(
const struct ARegion *ar,
- const float plane[4], const int mval[2],
+ const float plane[4], const int mval[2], const bool do_clip,
float r_out[3]);
void ED_view3d_win_to_delta(const struct ARegion *ar, const float mval[2], float out[3], const float zfac);
void ED_view3d_win_to_origin(const struct ARegion *ar, const float mval[2], float out[3]);
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index fa166cbaaab..3cc0857c8a7 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -557,14 +557,14 @@ void ED_view3d_win_to_3d_int(
bool ED_view3d_win_to_3d_on_plane(
const ARegion *ar,
- const float plane[4], const float mval[2],
+ const float plane[4], const float mval[2], const bool do_clip,
float r_out[3])
{
float ray_co[3], ray_no[3];
ED_view3d_win_to_origin(ar, mval, ray_co);
ED_view3d_win_to_vector(ar, mval, ray_no);
float lambda;
- if (isect_ray_plane_v3(ray_co, ray_no, plane, &lambda, false)) {
+ if (isect_ray_plane_v3(ray_co, ray_no, plane, &lambda, do_clip)) {
madd_v3_v3v3fl(r_out, ray_co, ray_no, lambda);
return true;
}
@@ -573,11 +573,11 @@ bool ED_view3d_win_to_3d_on_plane(
bool ED_view3d_win_to_3d_on_plane_int(
const ARegion *ar,
- const float plane[4], const int mval[2],
+ const float plane[4], const int mval[2], const bool do_clip,
float r_out[3])
{
const float mval_fl[2] = {mval[0], mval[1]};
- return ED_view3d_win_to_3d_on_plane(ar, plane, mval_fl, r_out);
+ return ED_view3d_win_to_3d_on_plane(ar, plane, mval_fl, do_clip, r_out);
}
/**
More information about the Bf-blender-cvs
mailing list