recastnavigation / recastnavigation

Industry-standard navigation-mesh toolset for games

Home Page:http://recastnav.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the Epsilon in DetourCommon/dtIntersectSegmentPoly2D

azurepine opened this issue · comments

static const float EPS = 0.00000001f;

0.00000001 seems to be smaller than the typical machine epsilon for 32-bit floating-point numbers,
which is around 1.19 x 10^-7.

Hmm! Yeah it does look like it's an order of magnitude or two too small at least according to wikipedia. Thankfully this is only used as an optimization in the segment-polygon intersection test when the segment is parallel to a polygon edge, so at worst it's only causing minor perf problems. I'll increase the epsilon to something a bit bigger. Thanks for pointing this out!