make FindPlane much pickier about matching planes

This commit is contained in:
Bill Currie 2003-08-27 01:12:03 +00:00
parent 415fae8d6b
commit 4c52975584

View file

@ -224,8 +224,13 @@ FindPlane (plane_t *dplane, int *side)
dp = planes;
for (i = 0; i < numbrushplanes; i++, dp++) {
vec3_t t;
VectorSubtract (dp->normal, pl.normal, t);
dot = DotProduct (dp->normal, pl.normal);
if (dot > 1.0 - ANGLEEPSILON
&& fabs(t[0]) < DISTEPSILON * DISTEPSILON
&& fabs(t[1]) < DISTEPSILON * DISTEPSILON
&& fabs(t[2]) < DISTEPSILON * DISTEPSILON
&& fabs(dp->dist - pl.dist) < DISTEPSILON) { // regular match
return i;
}