[Bf-blender-cvs] [8377febcb71] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Thu Sep 20 03:54:50 CEST 2018


Commit: 8377febcb710d339a683ab78de0eb795659553bc
Author: Campbell Barton
Date:   Thu Sep 20 12:06:53 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB8377febcb710d339a683ab78de0eb795659553bc

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc source/blender/editors/include/ED_view3d.h
index bb272873aec,0f8cd7260fd..8e9c1736122
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@@ -257,9 -225,11 +257,12 @@@ bool ED_view3d_win_to_ray_clipped
          const struct ARegion *ar, const struct View3D *v3d, const float mval[2],
          float ray_start[3], float ray_normal[3], const bool do_clip);
  bool ED_view3d_win_to_ray_clipped_ex(
 +        struct Depsgraph *depsgraph,
          const struct ARegion *ar, const struct View3D *v3d, const float mval[2],
          float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip);
+ void ED_view3d_win_to_ray(
+         const struct ARegion *ar, const float mval[2],
+         float r_ray_start[3], float r_ray_normal[3]);
  void ED_view3d_global_to_vector(const struct RegionView3D *rv3d, const float coord[3], float vec[3]);
  void ED_view3d_win_to_3d(
          const struct View3D *v3d, const struct ARegion *ar,
diff --cc source/blender/editors/space_view3d/view3d_project.c
index 719530c7293,fa166cbaaab..6e8b7c281ce
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@@ -405,9 -403,27 +405,27 @@@ bool ED_view3d_win_to_ray_clipped
          const ARegion *ar, const View3D *v3d, const float mval[2],
          float r_ray_start[3], float r_ray_normal[3], const bool do_clip_planes)
  {
 -	return ED_view3d_win_to_ray_clipped_ex(ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip_planes);
 +	return ED_view3d_win_to_ray_clipped_ex(depsgraph, ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip_planes);
  }
  
+ /**
+  * Calculate a 3d viewpoint and direction vector from 2d window coordinates.
+  * This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
+  * \param ar The region (used for the window width and height).
+  * \param mval The area relative 2d location (such as event->mval, converted into float[2]).
+  * \param r_ray_start The world-space point where the ray intersects the window plane.
+  * \param r_ray_normal The normalized world-space direction of towards mval.
+  *
+  * \note Ignores view near/far clipping, to take this into account use #ED_view3d_win_to_ray_clipped.
+  */
+ void ED_view3d_win_to_ray(
+         const ARegion *ar, const float mval[2],
+         float r_ray_start[3], float r_ray_normal[3])
+ {
+ 	ED_view3d_win_to_origin(ar, mval, r_ray_start);
+ 	ED_view3d_win_to_vector(ar, mval, r_ray_normal);
+ }
+ 
  /**
   * Calculate a normalized 3d direction vector from the viewpoint towards a global location.
   * In orthographic view the resulting vector will match the view vector.



More information about the Bf-blender-cvs mailing list