tighter bsp model culling.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3923 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-11-09 04:14:38 +00:00
parent 119c9c412c
commit 790052a28e

View file

@ -1939,19 +1939,32 @@ qboolean R_CullEntityBox(entity_t *e, vec3_t modmins, vec3_t modmaxs)
#if 1
float mrad = 0, v;
for (i = 0; i < 3; i++)
static vec3_t identaxis[3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
if (!memcmp(e->axis, identaxis, sizeof(identaxis)))
{
v = fabs(modmins[i]);
if (mrad < v)
mrad = v;
v = fabs(modmaxs[i]);
if (mrad < v)
mrad = v;
for (i = 0; i < 3; i++)
{
wmin[i] = e->origin[i]+modmins[i];
wmax[i] = e->origin[i]+modmaxs[i];
}
}
for (i = 0; i < 3; i++)
else
{
wmin[i] = e->origin[i]-mrad;
wmax[i] = e->origin[i]+mrad;
for (i = 0; i < 3; i++)
{
v = fabs(modmins[i]);
if (mrad < v)
mrad = v;
v = fabs(modmaxs[i]);
if (mrad < v)
mrad = v;
}
for (i = 0; i < 3; i++)
{
wmin[i] = e->origin[i]-mrad;
wmax[i] = e->origin[i]+mrad;
}
}
#else
float fmin, fmax;