force hit to be on triangle

This commit is contained in:
mattijs
2009-06-25 23:41:41 +01:00
parent 0ae328eced
commit ddb74a6ea7

View File

@ -607,6 +607,18 @@ inline bool triangle<Point, PointRef>::classify
// system E0, E1
//
//Pout<< "alpha:" << alpha << endl;
//Pout<< "beta:" << beta << endl;
//Pout<< "hit:" << hit << endl;
//Pout<< "tol:" << tol << endl;
if (hit)
{
// alpha,beta might get negative due to precision errors
alpha = max(0.0, min(1.0, alpha));
beta = max(0.0, min(1.0, beta));
}
nearType = NONE;
nearLabel = -1;