mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 20:11:44 +00:00
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:
parent
051442c041
commit
f0fbc813e2
1 changed files with 18 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue