diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-19 07:49:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-19 07:49:57 +0400 |
commit | 391dbde03da940ec8722f144ec2234b9743ffefc (patch) | |
tree | e576a13e5743f21b54c844d07c165e93023ebc72 /source/blender/blenlib/BLI_math_geom.h | |
parent | c04f9b779c4384f3cc6961b2ed54456bdab14f43 (diff) |
added math function isect_line_plane_v3(), use for window_to_3d rather then having it inline.
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 4a7d749842d..634634f02e5 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -96,6 +96,18 @@ int isect_line_line_strict_v3(const float v1[3], const float v2[3], int isect_ray_plane_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, int clip); +/** + * Intersect line/plane, optionally treat line as directional (like a ray) with the no_flip argument. + * @param out The intersection point. + * @param l1 The first point of the line. + * @param l2 The second point of the line. + * @param plane_co A point on the plane to intersect with. + * @param plane_no The direction of the plane (does not need to be normalized). + * @param no_flip When true, the intersection point will always be from l1 to l2, even if this is not on the plane. + */ +int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], + const float plane_co[3], const float plane_no[3], const short no_flip); + /* line/ray triangle */ int isect_line_tri_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *lambda, float uv[2]); |