From a6e8cfdf1a512610fbeb6d8bc1de4d879ab1fc22 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 21 Jan 2015 13:32:52 -0700 Subject: [PATCH 1/2] Undo part of cc36d8e that flipped the signs of ON_EPSILON for one of the checks in the TraceLine --- light/trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/light/trace.c b/light/trace.c index e3367c8d..d50533fb 100644 --- a/light/trace.c +++ b/light/trace.c @@ -187,11 +187,11 @@ TraceLine(const dmodel_t *model, const int traceflags, break; } - if (frontdist > ON_EPSILON && backdist > ON_EPSILON) { + if (frontdist > -ON_EPSILON && backdist > -ON_EPSILON) { node = tnode->children[0]; continue; } - if (frontdist < -ON_EPSILON && backdist < -ON_EPSILON) { + if (frontdist < ON_EPSILON && backdist < ON_EPSILON) { node = tnode->children[1]; continue; } From 33fe708dd7566f102680f0d726327b7c4ec8770c Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 20 Jan 2015 16:38:34 -0700 Subject: [PATCH 2/2] trace.c: fix bug in determining hitpoint->point --- light/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/light/trace.c b/light/trace.c index d50533fb..dda24036 100644 --- a/light/trace.c +++ b/light/trace.c @@ -151,7 +151,7 @@ TraceLine(const dmodel_t *model, const int traceflags, if (hitpoint) { hitpoint->dplane = crossnode->plane; hitpoint->side = crossnode->side; - VectorCopy(crossnode->back, hitpoint->point); + VectorCopy(crossnode->front, hitpoint->point); } return tracehit; }