Do not render viewmobj or skybox viewpoint hitbox

If you are a spectator (or in first person), the hitbox
exists right ontop of you and hitboxes don't render
correctly if they are too close to the viewpoint.
This commit is contained in:
James R 2022-09-11 06:25:08 -07:00
parent 694804cd96
commit 99653de134

View file

@ -253,6 +253,27 @@ boolean R_ThingBoundingBoxVisible(mobj_t *thing)
{
INT32 cvmode = cv_renderhitbox.value;
// Do not render bbox for these
switch (thing->type)
{
default:
// First person / awayviewmobj -- rendering
// a bbox too close to the viewpoint causes
// anomalies and these are exactly on the
// viewpoint!
if (thing != r_viewmobj)
{
break;
}
// FALLTHRU
case MT_SKYBOX:
// Ditto for skybox viewpoint but because they
// are rendered using portals in Software,
// r_viewmobj does not point here.
return false;
}
switch (cvmode)
{
case RENDERHITBOX_OFF: