[PATCH] qbsp: Use fast sphere test in FaceSide
Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
parent
67981816c7
commit
7ce4402dfc
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue