Polo demanded more accurate bounds for mdl files, to match QSS.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6057 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-09-05 00:35:00 +00:00
parent 051442c041
commit f0fbc813e2

View file

@ -4285,8 +4285,26 @@ static qboolean QDECL Mod_LoadQ1Model (model_t *mod, void *buffer, size_t fsize)
Mod_CompileTriangleNeighbours(mod, galias);
Mod_BuildTextureVectors(galias);
#if 0 //fast (somewhat inaccurate) way. some exporters will bias all geometry weirdly (often ensuring 0 0 0 is in the bounds, resulting in unfortunate biases.)
VectorCopy (pq1inmodel->scale_origin, mod->mins);
VectorMA (mod->mins, 255, pq1inmodel->scale, mod->maxs);
#else
ClearBounds(mod->mins, mod->maxs);
for (i = 0; i < galias->numanimations; i++)
{
galiasanimation_t *a = galias->ofsanimations;
vecV_t *v;
size_t j, k;
for (j = 0; j < a->numposes; j++)
{
v = a->poseofs[j].ofsverts;
for (k = 0; k < galias->numverts; k++)
AddPointToBounds(v[k], mod->mins, mod->maxs);
}
}
if (mod->maxs[0] < mod->mins[0]) //no points? o.O
AddPointToBounds(vec3_origin, mod->mins, mod->maxs);
#endif
mod->type = mod_alias;
Mod_ClampModelSize(mod);