diff options
Diffstat (limited to 'src/sv_world.c')
-rw-r--r-- | src/sv_world.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/sv_world.c b/src/sv_world.c index 47aed67..d03bcf3 100644 --- a/src/sv_world.c +++ b/src/sv_world.c @@ -121,6 +121,31 @@ void SV_ClearWorld(void) } } +/* +=============== +SV_EdictIsVisible + +Checks if edict is potentially visible from the given PVS row. +=============== +*/ +qboolean SV_EdictIsVisible(cm_t *cm, edict_t *ent, byte *mask) +{ + int i; + + if (ent->num_clusters == -1) { + // too many leafs for individual check, go by headnode + return CM_HeadnodeVisible(CM_NodeNum(cm, ent->headnode), mask); + } + + // check individual leafs + for (i = 0; i < ent->num_clusters; i++) { + if (Q_IsBitSet(mask, ent->clusternums[i])) { + return qtrue; + } + } + + return qfalse; // not visible +} /* =============== @@ -465,8 +490,6 @@ int SV_PointContents(vec3_t p) return contents; } - - typedef struct { vec3_t boxmins, boxmaxs;// enclose the test object along entire move vec_t *mins, *maxs; // size of the moving object |