UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
g_vis.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 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. */
30 typedef 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
37 
38 #define VIS_PERISH 2
39 
40 #define VIS_STOP 4
41 
42 /* Visibility state -- see G_TestVis */
44 #define VS_CHANGE 1
45 
46 #define VS_YES 2
47 
48 /* A bit mask. Modifiers for the way visibility check are performed. */
49 typedef unsigned int vischeckflags_t;
50 /* possible values are: */
53 #define VT_PERISHCHK 1
54 
55 #define VT_NOFRUSTUM 2
56 
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 
66 bool G_FrustumVis(const Edict* from, const vec3_t point);
67 bool G_SmokeVis (const vec3_t from, const Edict* check);
68 float G_ActorVis(const Edict* ent, const Edict* check, bool full);
69 void G_VisFlagsClear(int team);
70 void G_VisFlagsAdd(Edict& ent, teammask_t teamMask);
71 void G_VisFlagsSwap(Edict& ent, teammask_t teamMask);
72 void G_VisFlagsReset(Edict& ent);
74 void G_CheckVis(Edict* check, const vischeckflags_t visFlags = VT_PERISHCHK);
75 void G_CheckVisPlayer(Player& player, const vischeckflags_t visFlags);
76 int G_CheckVisTeamAll(const int team, const vischeckflags_t visFlags, const Edict* ent);
77 int G_TestVis(const int team, Edict* check, const vischeckflags_t flags);
78 bool G_Vis(const int team, const Edict* from, const Edict* check, const vischeckflags_t flags);
79 int G_VisCheckDist(const Edict* const ent);
void G_VisFlagsReset(Edict &ent)
Definition: g_vis.cpp:438
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_CheckVisPlayer(Player &player, const vischeckflags_t visFlags)
Sets visible edict on player spawn.
Definition: g_vis.cpp:327
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
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
void G_VisFlagsSwap(Edict &ent, teammask_t teamMask)
Definition: g_vis.cpp:443
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
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
int G_VisCheckDist(const Edict *const ent)
Definition: g_vis.cpp:163
bool G_SmokeVis(const vec3_t from, const Edict *check)
tests for smoke interference
Definition: g_vis.cpp:65
float G_ActorVis(const Edict *ent, const Edict *check, bool full)
calculate how much check is "visible" by ent
Definition: g_vis.cpp:100
Local definitions for game module.
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
unsigned int vischeckflags_t
Definition: g_vis.h:49
vec_t vec3_t[3]
Definition: ufotypes.h:39
unsigned int teammask_t
Definition: g_vis.h:30
Definition: g_edict.h:45
void G_VisMakeEverythingVisible(void)
Make everything visible to anyone who can't already see it.
Definition: g_vis.cpp:390