123 dir[0] = eyeEnt[1] - check->
origin[1];
124 dir[1] = check->
origin[0] - eyeEnt[0];
131 for (
int i = 0;
i < 3;
i++) {
198 if (team >= 0 && from->
getTeam() != team)
202 if (team < 0 && from->getTeam() == -team)
222 switch (check->
type) {
267 Edict* from =
nullptr;
269 if (
G_Vis(team, from, check, flags))
293 const int vis =
G_TestVis(team, check, visFlags);
299 if (playerMask == 0) {
313 }
else if (vis == 0 && (visFlags &
VT_NEW)) {
329 Edict* ent =
nullptr;
378 Edict* chk =
nullptr;
392 Edict* ent =
nullptr;
411 for (
int team = 0; team <
MAX_TEAMS; team++)
426 Edict* ent =
nullptr;
bool FrustumVis(const vec3_t origin, int dir, const vec3_t point)
Checks whether a point is visible from a given position.
Edict * G_EdictsGetNextInUse(Edict *lastEnt)
Iterate through the entities that are in use.
#define VectorCopy(src, dest)
static int G_DoTestVis(const int team, Edict *check, const vischeckflags_t visFlags, playermask_t playerMask, const Edict *ent)
void VectorMA(const vec3_t veca, const float scale, const vec3_t vecb, vec3_t outVector)
Sets vector_out (vc) to vevtor1 (va) + scale * vector2 (vb)
bool G_SmokeVis(const vec3_t from, const Edict *check)
tests for smoke interference
void G_CheckVis(Edict *check, const vischeckflags_t visFlags)
Check if the edict appears/perishes for the other teams. If they appear for other teams...
Misc utility functions for game module.
void G_VisFlagsSwap(Edict &ent, teammask_t teamMask)
unsigned int playermask_t
void G_SendInventory(playermask_t playerMask, const Edict &ent)
Sends whole inventory through the network buffer.
static bool G_VisShouldStop(const Edict *ent)
#define G_IsCrouched(ent)
void VectorNormalizeFast(vec3_t v)
fast vector normalize routine that does not check to make sure that length != 0, nor does it return l...
void G_AppearPerishEvent(playermask_t playerMask, bool appear, Edict &check, const Edict *ent)
Send the appear or perish event to the affected clients.
void G_VisFlagsClear(int team)
Reset the visflags for all edicts in the global list for the given team - and only for the given team...
bool G_IsLivingActor(const Edict *ent)
Checks whether the given edict is a living actor.
float G_ActorVis(const Edict *ent, const Edict *check, bool full)
calculate how much check is "visible" by ent
camera_edict_data_t camera
#define G_IsActiveCamera(ent)
#define G_IsCivilian(ent)
#define G_PlayerToPM(player)
byte num_alive[MAX_TEAMS]
playermask_t G_VisToPM(teammask_t teamMask)
Converts vis mask to player mask.
static int G_CheckVisTeam(const int team, Edict *check, const vischeckflags_t visFlags, const Edict *ent)
Checks whether an edict appear/perishes for a specific team - also updates the visflags each edict ca...
#define G_IsVisibleOnBattlefield(ent)
void G_VisMakeEverythingVisible(void)
Make everything visible to anyone who can't already see it.
#define VectorCompare(a, b)
#define G_TeamToVisMask(team)
int G_CheckVisTeamAll(const int team, const vischeckflags_t visFlags, const Edict *ent)
Do G_CheckVisTeam for all entities ent is the one that is looking at the others.
int G_TestVis(const int team, Edict *check, const vischeckflags_t flags)
test if check is visible by team (or if visibility changed?)
void G_VisFlagsReset(Edict &ent)
Local definitions for game module.
bool G_FrustumVis(const Edict *from, const vec3_t point)
Checks whether a point is "visible" from the edicts position.
functions to handle the storage and lifecycle of all edicts in the game module.
void G_CheckVisPlayer(Player &player, const vischeckflags_t visFlags)
Sets visible edict on player spawn.
bool G_Vis(const int team, const Edict *from, const Edict *check, const vischeckflags_t flags)
test if check is visible by from
unsigned int vischeckflags_t
void G_EventActorAdd(playermask_t playerMask, const Edict &ent, const bool instant)
bool RayIntersectAABB(const vec3_t start, const vec3_t end, const AABB &aabb)
void G_ActorGetEyeVector(const Edict *actor, vec3_t eye)
Fills a vector with the eye position of a given actor.
#define MAX_SPOT_DIST_CAMERA
#define G_IsVisibleForTeam(ent, team)
bool G_TestLineWithEnts(const vec3_t start, const vec3_t end)
fast version of a line trace including entities
static bool G_LineVis(const vec3_t from, const vec3_t to)
tests the visibility between two points
void G_VisFlagsAdd(Edict &ent, teammask_t teamMask)
#define VectorDistSqr(a, b)
float G_ActorGetInjuryPenalty(const Edict *const ent, const modifier_types_t type)
Returns the penalty to the given stat caused by the actor wounds.
int G_VisCheckDist(const Edict *const ent)
Interface for g_client.cpp.
playermask_t G_TeamToPM(int team)
Generates the player bit mask for a given team.