From d78175a07a702acba4e201e90e21e87733e87086 Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Mon, 16 Oct 2017 19:46:08 -0400 Subject: [PATCH] fix case where both segments must be infront --- hiddenwire.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hiddenwire.c b/hiddenwire.c index 232959f..150d35e 100644 --- a/hiddenwire.c +++ b/hiddenwire.c @@ -453,6 +453,7 @@ recursive++; // make sure that we're not comparing to our own triangle // or one that shares an edge with us (which might be in // a different order) +/* if (v2_eq(s->src[0].p, t->p[0].p, 0.005) && v2_eq(s->src[1].p, t->p[1].p, 0.005)) continue; @@ -471,6 +472,7 @@ recursive++; if (v2_eq(s->src[0].p, t->p[0].p, 0.005) && v2_eq(s->src[1].p, t->p[2].p, 0.005)) continue; +*/ float z0, z1; int inside0 = tri_find_z(t, &s->p[0], &z0); @@ -481,9 +483,8 @@ recursive++; // otherwies we discard the segment if (inside0 && inside1) { - if (s->p[0].p[2] <= z0) - continue; - if (s->p[1].p[2] <= z1) + if (s->p[0].p[2] <= z0 + && s->p[1].p[2] <= z1) continue; recursive--; return;