Fix a nice bug in ED_view3d_win_to_vector() - vector returned for an ortho view was negated compared to vector returned for the same view in perspective...

Found while working on snapping issues, confirmed using bisect tool: previous to this commit, inner/outer parts were swapped when switching from otho to persp!
This commit is contained in:
Bastien Montagne 2014-01-30 16:48:29 +01:00
parent 2011156eec
commit f54ed9f5e0
Notes: blender-bot 2023-02-14 06:57:56 +01:00
Referenced by issue #88313, Grease pencil: Reproject strokes bad behavior when used in orthographic free navigation.
1 changed files with 1 additions and 2 deletions

View File

@ -312,7 +312,6 @@ static void view3d_win_to_ray_segment(const ARegion *ar, View3D *v3d, const floa
if (!r_ray_dir) r_ray_dir = _ray_dir;
ED_view3d_win_to_vector(ar, mval, r_ray_dir);
negate_v3(r_ray_dir);
if (rv3d->is_persp) {
copy_v3_v3(r_ray_co, rv3d->viewinv[3]);
@ -558,7 +557,7 @@ void ED_view3d_win_to_vector(const ARegion *ar, const float mval[2], float out[3
sub_v3_v3(out, rv3d->viewinv[3]);
}
else {
copy_v3_v3(out, rv3d->viewinv[2]);
negate_v3_v3(out, rv3d->viewinv[2]);
}
normalize_v3(out);
}