diff --git a/qbsp/solidbsp.c b/qbsp/solidbsp.c index 858d7d61..13451a5a 100644 --- a/qbsp/solidbsp.c +++ b/qbsp/solidbsp.c @@ -41,7 +41,7 @@ For BSP hueristic ================== */ static int -FaceSide(face_t *in, plane_t *split) +FaceSide__(face_t *in, plane_t *split) { bool frontcount, backcount; vec_t dot; @@ -87,6 +87,23 @@ FaceSide(face_t *in, plane_t *split) return SIDE_ON; } +static int +FaceSide(face_t *in, plane_t *split) +{ + vec_t dist; + int ret; + + dist = DotProduct(in->origin, split->normal) - split->dist; + if (dist > in->radius) + ret = SIDE_FRONT; + else if (dist < -in->radius) + ret = SIDE_BACK; + else + ret = FaceSide__(in, split); + + return ret; +} + /* * Split a bounding box by a plane; The front and back bounds returned * are such that they completely contain the portion of the input box