Increase epsilon in detour common segment polygon intersection test (#612)

It's only used to detect if the segment is parallel to the polygon edge in question, and if so, skip actually doing the intersection test.  This sets the epsilon to 1e-6, which is about 10x the machine epsilon for 32bit floats, so it's low enough to not give false positives but it's large enough to correctly detect segments and polygon edges that are very nearly parallel.
This commit is contained in:
Graham Pentheny 2023-03-20 01:03:27 -04:00 committed by GitHub
parent b921dd16b1
commit 8e9c308afd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ bool dtIntersectSegmentPoly2D(const float* p0, const float* p1,
float& tmin, float& tmax,
int& segMin, int& segMax)
{
static const float EPS = 0.00000001f;
static const float EPS = 0.000001f;
tmin = 0;
tmax = 1;