mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 04:11:53 +00:00
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:
parent
119c9c412c
commit
790052a28e
1 changed files with 23 additions and 10 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue