added math function isect_line_plane_v3(), use for window_to_3d rather then having it inline.

This commit is contained in:
2011-05-19 03:49:57 +00:00
parent c04f9b779c
commit 391dbde03d
3 changed files with 63 additions and 14 deletions

View File

@@ -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]);