loadmodel->yawmins[0] = loadmodel->yawmins[1] = -(loadmodel->yawmaxs[0] = loadmodel->yawmaxs[1] = modelyawradius);
loadmodel->yawmins[2] = loadmodel->normalmins[2];
loadmodel->yawmaxs[2] = loadmodel->normalmaxs[2];
+ loadmodel->radius = modelradius;
+ loadmodel->radius2 = modelradius * modelradius;
loadmodel->Draw = R_DrawQ1Q2AliasModel;
loadmodel->DrawSky = NULL;
loadmodel->yawmins[0] = loadmodel->yawmins[1] = -(loadmodel->yawmaxs[0] = loadmodel->yawmaxs[1] = modelyawradius);
loadmodel->yawmins[2] = loadmodel->normalmins[2];
loadmodel->yawmaxs[2] = loadmodel->normalmaxs[2];
+ loadmodel->radius = modelradius;
+ loadmodel->radius2 = modelradius * modelradius;
loadmodel->mdlmd2data_triangleneighbors = Mem_Alloc(loadmodel->mempool, loadmodel->numtris * sizeof(int[3]));
Mod_BuildTriangleNeighbors(loadmodel->mdlmd2data_triangleneighbors, loadmodel->mdlmd2data_indices, loadmodel->numtris);
loadmodel->yawmins[0] = loadmodel->yawmins[1] = -loadmodel->yawmaxs[0];
loadmodel->yawmins[2] = loadmodel->normalmins[2];
loadmodel->yawmaxs[2] = loadmodel->normalmaxs[2];
+ loadmodel->radius = modelradius;
+ loadmodel->radius2 = modelradius * modelradius;
loadmodel->Draw = R_DrawZymoticModel;
loadmodel->DrawSky = NULL;
mod->yawmaxs[2] = mod->normalmaxs[2];
mod->rotatedmins[0] = mod->rotatedmins[1] = mod->rotatedmins[2] = -modelradius;
mod->rotatedmaxs[0] = mod->rotatedmaxs[1] = mod->rotatedmaxs[2] = modelradius;
+ mod->radius = modelradius;
+ mod->radius2 = modelradius * modelradius;
// LordHavoc: check for empty submodels (lacrima.bsp has such a glitch)
if (mod->normalmins[0] > mod->normalmaxs[0] || mod->normalmins[1] > mod->normalmaxs[1] || mod->normalmins[2] > mod->normalmaxs[2])
{
VectorClear(mod->yawmaxs);
VectorClear(mod->rotatedmins);
VectorClear(mod->rotatedmaxs);
+ mod->radius = 0;
+ mod->radius2 = 0;
}
mod->numleafs = bm->visleafs;
vec3_t yawmins, yawmaxs;
// bounding box if pitch or roll are used
vec3_t rotatedmins, rotatedmaxs;
- // usable at any angles
-// float modelradius;
+ // sphere radius, usable at any angles
+ float radius;
+ // squared sphere radius for easier comparisons
+ float radius2;
// brush model specific
int firstmodelsurface, nummodelsurfaces;
loadmodel->normalmins[i] = loadmodel->yawmins[i] = loadmodel->rotatedmins[i] = -modelradius;
loadmodel->normalmaxs[i] = loadmodel->yawmaxs[i] = loadmodel->rotatedmaxs[i] = modelradius;
}
+ loadmodel->radius = modelradius;
+ loadmodel->radius2 = modelradius * modelradius;
}
/*