From ff9bb3eab04218c05b0177eeb5e1969547474ff1 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Sun, 23 Jun 2013 14:22:13 +0930 Subject: [PATCH] qbsp: tweak T_EPSILON to be greater than EQUAL_EPSILON The way wedge_t and wvert_t were hashed and compared was resulting in FixFaceEdges being able to get stuck in a loop adding verticies to a face if two consecutive verticies were very close to EQUAL_EPSILON apart. Avoid these problems by tweaking T_EPSILON to be slightly wider than EQUAL_EPSILON. Signed-off-by: Kevin Shanahan --- qbsp/qbsp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h index a0aee281..114b6f2b 100644 --- a/qbsp/qbsp.h +++ b/qbsp/qbsp.h @@ -114,8 +114,9 @@ /* * The quality of the bsp output is highly sensitive to these epsilon values. * Notes: - * - CONTINUOUS_EPSILON needs to be slightly larger than EQUAL_EPSILON, - * otherwise this messes with t-junctions + * - T-junction calculations are sensitive to errors and need the various + * epsilons to be such that EQUAL_EPSILON < T_EPSILON < CONTINUOUS_EPSILON. + * ( TODO: re-check if CONTINUOUS_EPSILON is still directly related ) */ #define NORMAL_EPSILON 0.000001 #define ANGLEEPSILON 0.000001 @@ -123,9 +124,9 @@ #define ZERO_EPSILON 0.0001 #define DISTEPSILON 0.0001 #define POINT_EPSILON 0.0001 -#define T_EPSILON 0.0001 #define ON_EPSILON 0.0001 #define EQUAL_EPSILON 0.0001 +#define T_EPSILON 0.0002 #define CONTINUOUS_EPSILON 0.0005 #define BOGUS_RANGE 18000