diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-20 05:46:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-20 05:51:16 +0300 |
commit | 9dac8633d6dd7616cfd1beca6079156e95b0f15b (patch) | |
tree | d2bac0731c919d839b56abad1d7183732c3bae29 | |
parent | 66720194840b11bdfb0f26e4191d1f214cdc2e8e (diff) | |
parent | 1cc9022eb51b73abc84d79366a9cf54a561c7520 (diff) |
Merge branch 'master' into blender2.8
5 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index b249af1c8b6..ad128b91c5a 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -202,12 +202,7 @@ static bool stroke_elem_project( /* project to 'location_world' */ if (cdd->project.use_plane) { /* get the view vector to 'location' */ - float ray_origin[3], ray_direction[3]; - ED_view3d_win_to_ray(ar, mval_fl, ray_origin, ray_direction); - - float lambda; - if (isect_ray_plane_v3(ray_origin, ray_direction, cdd->project.plane, &lambda, true)) { - madd_v3_v3v3fl(r_location_world, ray_origin, ray_direction, lambda); + if (ED_view3d_win_to_3d_on_plane(ar, cdd->project.plane, mval_fl, true, r_location_world)) { if (r_normal_world) { zero_v3(r_normal_world); } diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index 6b1a76c47ee..a6252cd55bd 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -222,12 +222,12 @@ static void dial_ghostarc_get_angles( plane_from_point_normal_v3(dial_plane, gz->matrix_basis[3], axis_vec); - if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, inter->init.mval, proj_mval_init_rel)) { + if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, inter->init.mval, false, proj_mval_init_rel)) { goto fail; } sub_v3_v3(proj_mval_init_rel, gz->matrix_basis[3]); - if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, mval, proj_mval_new_rel)) { + if (!ED_view3d_win_to_3d_on_plane(ar, dial_plane, mval, false, proj_mval_new_rel)) { goto fail; } sub_v3_v3(proj_mval_new_rel, gz->matrix_basis[3]); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 8e9c1736122..30daaad3c2c 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -274,11 +274,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/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c index 038a45650bf..e8f29d9a9b2 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c @@ -541,7 +541,7 @@ static void gizmo_mesh_spin_redo_modal_from_setup( const int mval[2] = {event->x - ar->winrct.xmin, event->y - ar->winrct.ymin}; float plane[4]; plane_from_point_normal_v3(plane, plane_co, plane_no); - if (UNLIKELY(!ED_view3d_win_to_3d_on_plane_int(ar, plane, mval, cursor_co))) { + if (UNLIKELY(!ED_view3d_win_to_3d_on_plane_int(ar, plane, mval, false, cursor_co))) { ED_view3d_win_to_3d_int(v3d, ar, plane, mval, cursor_co); } sub_v3_v3v3(ggd->data.orient_axis, cursor_co, plane_co); diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 6e8b7c281ce..116f4af34e5 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -559,14 +559,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; } @@ -575,11 +575,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); } /** |