fix mapmodel occlusion when using pitch and roll

may need a bit more work, though
This commit is contained in:
ac-stef
2015-06-05 16:00:03 +02:00
parent fc0c6347f9
commit 3d1f7d9b95
5 changed files with 20 additions and 13 deletions
+6 -1
View File
@@ -612,7 +612,12 @@ void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, fl
if(rad >= 0)
{
if(!rad) rad = m->radius * scale;
if(!rad)
{
rad = m->radius;
if(roll != 0 || pitch != 0) rad = max(m->radius, m->zradius); // FIXME: this assumes worst-case even for small angles and should be eased up (especially for lamp posts)
rad *= scale;
}
if(isoccluded(camera1->o.x, camera1->o.y, o.x-rad, o.y-rad, rad*2)) return;
}