Try to fix some cubemap issues.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5332 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-11-04 22:22:18 +00:00
parent e31a485e98
commit 9e98e44500

View file

@ -2638,19 +2638,15 @@ unsigned int Mod_NearestCubeForSurf(msurface_t *surf, denvmap_t *envmap, size_t
VectorCopy(surf->mesh->xyz_array[0], mins);
VectorCopy(surf->mesh->xyz_array[0], maxs);
for (v = 1; v < surf->mesh->numvertexes; v++)
AddPointToBounds(surf->mesh->xyz_array[0], mins, maxs);
AddPointToBounds(surf->mesh->xyz_array[v], mins, maxs);
VectorAvg(mins, maxs, mid);
for (n = 0; n < nenvmap; n++)
{
VectorSubtract(envmap[n].origin, mid, diff);
#if 1
#if 0
//axial distance
dist = fabs(diff[0]);
if (dist > fabs(diff[1]))
dist = fabs(diff[1]);
if (dist > fabs(diff[2]))
dist = fabs(diff[2]);
dist = fabs(diff[0]) + fabs(diff[1]) + fabs(diff[2]);
#else
//radial distance (squared)
dist = DotProduct(diff,diff);