UFO: Alien Invasion
Loading...
Searching...
No Matches
g_vis.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24#pragma once
25
26#include "g_local.h"
27
29/* A bit mask. One bit for each affected team. */
30typedef unsigned int teammask_t;
31/* Bitmask for all teams */
32#define TEAM_ALL 0xFFFFFFFF
33
34/* Visibility changes -- see G_DoTestVis */
36#define VIS_APPEAR 1
38#define VIS_PERISH 2
40#define VIS_STOP 4
41
42/* Visibility state -- see G_TestVis */
44#define VS_CHANGE 1
46#define VS_YES 2
47
48/* A bit mask. Modifiers for the way visibility check are performed. */
49typedef unsigned int vischeckflags_t;
50/* possible values are: */
53#define VT_PERISHCHK 1
55#define VT_NOFRUSTUM 2
58#define VT_NEW 4
59
61#define ACTOR_VIS_100 1.0f
62#define ACTOR_VIS_50 0.5f
63#define ACTOR_VIS_10 0.1f
64#define ACTOR_VIS_0 0.0f
65
66bool G_FrustumVis(const Edict* from, const vec3_t point);
67bool G_SmokeVis (const vec3_t from, const Edict* check);
68float G_ActorVis(const Edict* ent, const Edict* check, bool full);
69void G_VisFlagsClear(int team);
70void G_VisFlagsAdd(Edict& ent, teammask_t teamMask);
71void G_VisFlagsSwap(Edict& ent, teammask_t teamMask);
72void G_VisFlagsReset(Edict& ent);
74void G_CheckVis(Edict* check, const vischeckflags_t visFlags = VT_PERISHCHK);
75void G_CheckVisPlayer(Player& player, const vischeckflags_t visFlags);
76int G_CheckVisTeamAll(const int team, const vischeckflags_t visFlags, const Edict* ent);
77int G_TestVis(const int team, Edict* check, const vischeckflags_t flags);
78bool G_Vis(const int team, const Edict* from, const Edict* check, const vischeckflags_t flags);
79int G_VisCheckDist(const Edict* const ent);
Local definitions for game module.
void G_VisFlagsAdd(Edict &ent, teammask_t teamMask)
Definition g_vis.cpp:433
int G_TestVis(const int team, Edict *check, const vischeckflags_t flags)
test if check is visible by team (or if visibility changed?)
Definition g_vis.cpp:255
bool G_FrustumVis(const Edict *from, const vec3_t point)
Checks whether a point is "visible" from the edicts position.
Definition g_vis.cpp:38
int G_VisCheckDist(const Edict *const ent)
Definition g_vis.cpp:163
void G_CheckVis(Edict *check, const vischeckflags_t visFlags=VT_PERISHCHK)
Check if the edict appears/perishes for the other teams. If they appear for other teams,...
Definition g_vis.cpp:409
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...
Definition g_vis.cpp:424
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.
Definition g_vis.cpp:376
void G_VisFlagsReset(Edict &ent)
Definition g_vis.cpp:438
bool G_Vis(const int team, const Edict *from, const Edict *check, const vischeckflags_t flags)
test if check is visible by from
Definition g_vis.cpp:183
#define VT_PERISHCHK
Definition g_vis.h:53
void G_VisFlagsSwap(Edict &ent, teammask_t teamMask)
Definition g_vis.cpp:443
unsigned int teammask_t
Definition g_vis.h:30
bool G_SmokeVis(const vec3_t from, const Edict *check)
tests for smoke interference
Definition g_vis.cpp:65
void G_VisMakeEverythingVisible(void)
Make everything visible to anyone who can't already see it.
Definition g_vis.cpp:390
void G_CheckVisPlayer(Player &player, const vischeckflags_t visFlags)
Sets visible edict on player spawn.
Definition g_vis.cpp:327
unsigned int vischeckflags_t
Definition g_vis.h:49
float G_ActorVis(const Edict *ent, const Edict *check, bool full)
calculate how much check is "visible" by ent
Definition g_vis.cpp:100
vec_t vec3_t[3]
Definition ufotypes.h:39