fix to LinePlaneIntersection function

- (u+v)<=1 would only allow an intersection of the triangle p0/p1/p2

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/7/merge
Thorsten Liebig 2013-06-06 15:56:06 +02:00
parent d475091d49
commit 6db63bdd19
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ int LinePlaneIntersection(double* p0, double* p1, double* p2, double* l_start, d
for (int n=0;n<3;++n) for (int n=0;n<3;++n)
is_point[n] = l_start[n]*(1-dist) + l_stop[n]*dist; is_point[n] = l_start[n]*(1-dist) + l_stop[n]*dist;
if ((u<0) || (u>1) || (v<0) || (v>1) || ((u+v)>1)) if ((u<0) || (u>1) || (v<0) || (v>1))
return 1; return 1;
if ((t<0) || (t>1)) if ((t<0) || (t>1))
return 2; return 2;