possible alternate fix for #261
Eric: gmsp3v2.bsp vis: 51.96s -> 18.57s (32 threads)
This commit is contained in:
parent
64daf7ef75
commit
c94d44ae61
25
vis/flow.cc
25
vis/flow.cc
|
|
@ -388,29 +388,42 @@ static void BasePortalThread(size_t portalnum)
|
||||||
if (d < -tw.radius)
|
if (d < -tw.radius)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
int cctp = 0;
|
||||||
size_t j;
|
size_t j;
|
||||||
for (j = 0; j < tw.size(); j++) {
|
for (j = 0; j < tw.size(); j++) {
|
||||||
d = p.plane.distance_to(tw[j]);
|
d = p.plane.distance_to(tw[j]);
|
||||||
if (d > -VIS_ON_EPSILON) // ericw -- changed from > ON_EPSILON for
|
cctp += d > -VIS_ON_EPSILON;
|
||||||
// https://github.com/ericwa/ericw-tools/issues/261
|
if (d > VIS_ON_EPSILON)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (j == tw.size())
|
if (j == tw.size()) {
|
||||||
|
if (cctp != tw.size())
|
||||||
continue; // no points on front
|
continue; // no points on front
|
||||||
|
} else
|
||||||
|
cctp = 0;
|
||||||
|
|
||||||
// Quick test - completely on front?
|
// Quick test - completely on front?
|
||||||
d = tp.plane.distance_to(w.origin);
|
d = tp.plane.distance_to(w.origin);
|
||||||
if (d > w.radius)
|
if (d > w.radius)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
int ccp = 0;
|
||||||
for (j = 0; j < w.size(); j++) {
|
for (j = 0; j < w.size(); j++) {
|
||||||
d = tp.plane.distance_to(w[j]);
|
d = tp.plane.distance_to(w[j]);
|
||||||
if (d < VIS_ON_EPSILON) // ericw -- changed from < -ON_EPSILON for
|
ccp += d < VIS_ON_EPSILON;
|
||||||
// https://github.com/ericwa/ericw-tools/issues/261
|
if (d < -VIS_ON_EPSILON)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (j == w.size())
|
if (j == w.size()) {
|
||||||
|
if (ccp != w.size())
|
||||||
continue; // no points on back
|
continue; // no points on back
|
||||||
|
} else
|
||||||
|
ccp = 0;
|
||||||
|
|
||||||
|
// coplanarity check
|
||||||
|
if (cctp != 0 || ccp != 0)
|
||||||
|
if (qv::dot(p.plane.normal, tp.plane.normal) < -0.99)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (vis_options.visdist.value() > 0) {
|
if (vis_options.visdist.value() > 0) {
|
||||||
if (tp.winding->distFromPortal(p) > vis_options.visdist.value() ||
|
if (tp.winding->distFromPortal(p) > vis_options.visdist.value() ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue