From 2bc4dc9c3f056f1b2cc62e4cd8d9306fa3de3e16 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 11 Aug 2024 11:41:36 +0200 Subject: [PATCH] Recast: use the correct epsilon value Seems to generate slightly better results with next to no extra performance cost. --- src/thirdparty/recast/Recast/Source/RecastMeshDetail.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/thirdparty/recast/Recast/Source/RecastMeshDetail.cpp b/src/thirdparty/recast/Recast/Source/RecastMeshDetail.cpp index a545dfd5..96ed3df6 100644 --- a/src/thirdparty/recast/Recast/Source/RecastMeshDetail.cpp +++ b/src/thirdparty/recast/Recast/Source/RecastMeshDetail.cpp @@ -381,8 +381,6 @@ static bool overlapEdges(const float* pts, const int* edges, int nedges, int s1, static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges, int& nedges, const int maxEdges, int& nfaces, int e) { - static const float EPS = 1e-5f; // todo(amos): typo? use RD_EPS (1e-6f)? - int* edge = &edges[e*4]; // Cache s and t. @@ -424,9 +422,9 @@ static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges { if (u == s || u == t) continue; #if 0 - if (vcross2(&pts[t*3], &pts[s*3], &pts[u*3]) > EPS) + if (vcross2(&pts[t*3], &pts[s*3], &pts[u*3]) > RD_EPS) #else - if (vcross2(&pts[s*3], &pts[t*3], &pts[u*3]) > EPS) + if (vcross2(&pts[s*3], &pts[t*3], &pts[u*3]) > RD_EPS) #endif { if (r < 0)