#include "g_local.h"
Go to the source code of this file.
Functions | |
qboolean | G_FrustumVis (const edict_t *from, const vec3_t point) |
Checks whether a point is "visible" from the edicts position. | |
static qboolean | G_LineVis (const vec3_t from, const vec3_t to) |
tests the visibility between two points | |
float | G_ActorVis (const vec3_t from, const edict_t *check, qboolean full) |
calculate how much check is "visible" from from | |
float | G_Vis (const int team, const edict_t *from, const edict_t *check, int flags) |
test if check is visible by from | |
int | G_TestVis (const int team, edict_t *check, int flags) |
test if check is visible by team (or if visibility changed?) | |
static qboolean | G_VisShouldStop (const edict_t *ent) |
static int | G_DoTestVis (const int team, edict_t *check, qboolean perish, int playerMask, const edict_t *ent) |
int | G_CheckVisPlayer (player_t *player, qboolean perish) |
Sets visible edict on player spawn. | |
int | G_CheckVisTeam (const int team, edict_t *check, qboolean perish, const edict_t *ent) |
Checks whether an edict appear/perishes for a specific team - also updates the visflags each edict carries. | |
int | G_CheckVisTeamAll (const int team, qboolean perish, const edict_t *ent) |
Do G_CheckVisTeam for all entities. | |
int | G_CheckVis (edict_t *check, qboolean perish) |
Check if the edict appears/perishes for the other teams. If they appear for other teams, the needed information for those clients are also send in G_CheckVisTeam resp. G_AppearPerishEvent . | |
void | G_ClearVisFlags (int team) |
Reset the visflags for all edicts in the global list for the given team - and only for the given team. |
Definition in file g_vis.c.
calculate how much check is "visible" from from
[in] | from | The world coordinate to check from |
[in] | check | The edict to check how good (or if at all) it is visible |
[in] | full | Perform a full check in different directions. If this is false the actor is fully visible if one vis check returned true . With true this function can also return a value != 0.0 and != 1.0. Try to only use true if you really need the full check. Full checks are of course more expensive. |
Definition at line 63 of file g_vis.c.
References ACTOR_VIS_0, ACTOR_VIS_10, ACTOR_VIS_100, ACTOR_VIS_50, G_IsCrouched, G_IsDead, G_LineVis(), i, edict_s::origin, PLAYER_CROUCH, PLAYER_DEAD, PLAYER_MIN, PLAYER_STAND, VectorCopy, VectorMA(), and VectorNormalize().
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), AI_CivilianCalcBestAction(), AI_SearchBestTarget(), AI_SearchDestroyableObject(), AIL_positionshoot(), G_Morale(), G_ReactionFireIsPossible(), G_SplashDamage(), and G_Vis().
Check if the edict appears/perishes for the other teams. If they appear for other teams, the needed information for those clients are also send in G_CheckVisTeam
resp. G_AppearPerishEvent
.
[in] | perish | Also check for perishing events |
[in] | check | The edict that is maybe seen by others. If NULL, all edicts are checked |
Definition at line 334 of file g_vis.c.
References G_CheckVisTeam(), G_CheckVisTeamAll(), level, MAX_TEAMS, and level_locals_t::num_alive.
Referenced by Door_Use(), G_ActorDieOrStun(), G_ActorFall(), G_ActorInvMove(), G_ActorRevitalise(), G_ClientMove(), G_ClientStateChangeUpdate(), G_Damage(), G_InventoryToFloor(), G_SpawnAIPlayer(), G_SpawnItemOnFloor(), and G_SpawnParticle().
Sets visible edict on player spawn.
Definition at line 261 of file g_vis.c.
References G_DoTestVis(), G_EdictsGetNextInUse(), G_PlayerToPM, player_s::pers, and client_persistant_t::team.
Referenced by G_ClientSpawn().
Checks whether an edict appear/perishes for a specific team - also updates the visflags each edict carries.
[in] | team | Team to check the vis for |
[in] | check | The edict that you want to check (and which maybe will appear or perish for the given team). If this is NULL every edict will be checked. |
[in] | perish | Also check whether the edict (the actor) is going to become invisible for the given team |
[in] | ent | The edict that is (maybe) seeing other edicts |
G_AppearPerishEvent
Definition at line 298 of file g_vis.c.
References G_DoTestVis(), G_TeamToPM(), and edict_s::inuse.
Referenced by Destroy_Breakable(), G_CheckVis(), and G_CheckVisTeamAll().
Do G_CheckVisTeam
for all entities.
Definition at line 314 of file g_vis.c.
References G_CheckVisTeam(), and G_EdictsGetNextInUse().
Referenced by Door_Use(), G_ActorDieOrStun(), G_ActorDoTurn(), G_ActorRevitalise(), G_CheckVis(), G_ClientEndRound(), G_ClientMove(), G_ClientShoot(), G_ClientStateChangeUpdate(), and G_Damage().
void G_ClearVisFlags | ( | int | team | ) |
Reset the visflags for all edicts in the global list for the given team - and only for the given team.
Definition at line 355 of file g_vis.c.
References G_EdictsGetNextInUse(), G_TeamToVisMask, and edict_s::visflags.
Referenced by G_ClientSpawn(), and G_SpawnAIPlayer().
static int G_DoTestVis | ( | const int | team, | |
edict_t * | check, | |||
qboolean | perish, | |||
int | playerMask, | |||
const edict_t * | ent | |||
) | [static] |
Definition at line 232 of file g_vis.c.
References G_AppearPerishEvent(), G_TeamToVisMask, G_TestVis(), G_VisShouldStop(), VIS_APPEAR, VIS_CHANGE, VIS_PERISH, VIS_STOP, VIS_YES, edict_s::visflags, and VT_PERISH.
Referenced by G_CheckVisPlayer(), and G_CheckVisTeam().
Checks whether a point is "visible" from the edicts position.
Definition at line 31 of file g_vis.c.
References edict_s::dir, FrustumVis(), and edict_s::origin.
Referenced by AI_CheckCrouch(), AI_CheckUsingDoor(), G_Morale(), G_ReactionFireIsPossible(), G_SplashDamage(), G_TeamPointVis(), and G_Vis().
tests the visibility between two points
[in] | from | The point to check visibility from |
[in] | to | The point to check visibility to |
Definition at line 42 of file g_vis.c.
References G_TestLineWithEnts().
Referenced by G_ActorVis(), and G_Vis().
int G_TestVis | ( | const int | team, | |
edict_t * | check, | |||
int | flags | |||
) |
test if check is visible by team (or if visibility changed?)
[in] | team | the team the edict may become visible for or perish from their view |
[in] | check | the edict we are talking about - which may become visible or perish |
[in] | flags | if you want to check whether the edict may also perish from other players view, you should use the VT_PERISH bits |
VT_PERISH
, no further checks are performed - only the VIS_YES
bits are returned Definition at line 205 of file g_vis.c.
References g_aidebug, G_EdictsGetNextInUse(), G_IsVisibleForTeam, G_Vis(), cvar_s::integer, VIS_YES, and VT_PERISH.
Referenced by AI_FighterCalcBestAction(), AI_FindHidingLocation(), and G_DoTestVis().
test if check is visible by from
[in] | team | Living team members are always visible. If this is a negative number we inverse the team rules (see comments included). In combination with VT_NOFRUSTUM we can check whether there is any edict (that is no in our team) that can see check |
[in] | from | is from team team and must be a living actor |
[in] | check | The edict we want to get the visibility for |
[in] | flags | VT_NOFRUSTUM , ... |
Definition at line 132 of file g_vis.c.
References ACTOR_VIS_0, ACTOR_VIS_100, ET_ACTOR, ET_ACTOR2x2, ET_ITEM, ET_PARTICLE, EYE_CROUCH, EYE_STAND, G_ActorVis(), G_FrustumVis(), G_IsCivilian, G_IsCrouched, G_IsDead, G_IsLivingActor(), G_IsPaniced, G_IsVisibleOnBattlefield, G_LineVis(), edict_s::inuse, MAX_SPOT_DIST, edict_s::origin, edict_s::pos, qfalse, edict_s::team, edict_s::type, VectorCompare, VectorCopy, VectorDistSqr, and VT_NOFRUSTUM.
Referenced by AI_HideNeeded(), AIL_see(), and G_TestVis().
Definition at line 227 of file g_vis.c.
References G_IsCivilian, and G_IsLivingActor().
Referenced by G_DoTestVis().