OpenBF1942-Plus
Refractor 1, rebuilt from scratch
Loading...
Searching...
No Matches
game.h
Go to the documentation of this file.
1// The game layer: vehicles, soldiers, bots, weapons, damage, conquest, AI, the scripted --shot demos and the
2// camera that follows the player. No SDL or GL: renderers read the scene and the soldier views.
3// Rules and their status: docs/formats/vehicles.md, docs/formats/weapons.md.
4#pragma once
5#include <array>
6#include <map>
7#include <memory>
8#include <random>
9#include <string>
10#include <vector>
11
12#include "con.h"
13#include "conquest.h"
14#include "effects.h"
15#include "damage.h"
16#include "hud.h"
17#include "mat.h"
18#include "nav.h"
19#include "physics.h"
20#include "scene.h"
21#include "terrain.h"
22#include "vfs.h"
23
24namespace obf {
25
27 std::string drive; // --drive: a vehicle in front of the camera, driven unless playing
28 std::string play; // --play: team "1" / "2" or a soldier template
29 int kit = 1; // 0 scout, 1 assault, 2 anti-tank, 3 medic, 4 engineer
30 bool fire_ahead = false; // vehicle demo: gun straight ahead, no steering
31 bool shot = false; // --shot: scripted demos, game time is simulated
32};
33
34// One frame of player input (keys and mouse, already mapped).
35struct GameInput {
36 float throttle = 0, yaw = 0, pitch = 0, roll = 0; // vehicles, [-1, 1]
37 float look_x = 0, look_y = 0; // turrets, mouse motion scaled
38 float forward = 0, right = 0; // on foot
39 bool jump = false, slow = false, fire = false, use = false, reload = false;
40 int select = -1; // number key: kit weapon slot (0-based), -1 none
41 bool detonate = false; // explosive packs placed by the player
42 bool crouch = false; // held
43 bool prone = false; // pressed this frame: lie down / get up
44 bool view = false; // pressed this frame: first / third person
45 int radio = -1; // F1..F8 pressed this frame (0-based): radio menu, then message
46 int seat = -1; // number key in a vehicle: move to that seat (0-based)
47};
48
49// The lower / upper body animation states a soldier's skinned parts should play; empty: as loaded.
50// hold != -1: play once from that time and stay on the last frame.
52 size_t first = 0, parts = 0; // its items in the scene
53 std::string lower, upper;
54 float hold = -1;
55 size_t held_first = 0, held_parts = 0; // the weapon in its right hand (items with a bone); the renderer places them
56 bool first_person = false; // play the states' first-person animations
57 float fov = 0; // first person: field of view of the arms (set1pFov), radians
58 float upper_hold = -1; // >= 0: the upper state plays once from this time (reloads)
59 float span = 0; // > 0: those play-once states (upper and weapon) last this long (s)
60 std::string weapon; // state animating the held weapon's skeleton (WeaponReloadThompson)
61 float weapon_hold = -1; // as upper_hold, for the weapon state
62 float lower_hold = -1; // >= 0: the lower state plays once from this time (jumps)
63 std::string muzzle; // first person: the held weapon's muzzle effect (e_MuzzGun)
64 float muzzle_pos[3] = {}; // its place on the weapon (the weapon template's setPosition)
65 float shot = -1; // the last shot's game time: a new one shows the effect
66};
67
68// Rounds in the weapon and spare magazines. numOfMag read as all magazines, the loaded one included (unverified).
69struct Ammo {
70 int rounds = 0, spare = 0;
71 float reload_until = -1; // reloading while game time < this
72 bool unlimited = true;
73 static Ammo full(const WeaponDef& w);
74 bool take(float t); // one round; an empty magazine starts the reload
75 void reload(float t, const WeaponDef& w); // starts one if a spare magazine is left and none is running
76 void tick(float t, const WeaponDef& w); // a finished reload fills the magazine
77 bool reloading(float t) const { return t < reload_until; }
78 float refill = 0; // rounds received from a supply depot towards the next spare magazine
79 bool supply(float rounds, const WeaponDef& w); // adds rounds, as spare magazines up to numOfMag; true: one more
80};
81
82struct Camera {
83 float x = -1, y = 0, z = 0, yaw = 0.6f, pitch = -0.5f; // x < 0: not set (default corner)
84};
85
86class Game {
87public:
88 // scene: the level's draw items (spawner-placed movable vehicles are removed); vehicles and soldiers are appended.
89 Game(const Vfs& vfs, Con& con, const Heightmap& hm, const TerrainInfo& info, std::vector<DrawItem>& scene,
90 const std::vector<SpawnPoint>& spawns, const GameOptions& opt, Camera cam, bool objects);
91
92 void step(float t, float dt, const GameInput& in); // live play: t is the wall clock in seconds
93 void demo(float sim_seconds); // --shot: the scripted run for --play or --drive
94 void pose(); // scene matrices, soldier views, camera
95 std::vector<Sprite> effect_sprites() const { return effects.sprites(); }
96 std::vector<MeshParticle> effect_meshes() const { return effects.meshes(); }
97 bool controls_camera() const { return cur >= 0 || player >= 0; }
98 HudInfo hud_info() const; // what the on-screen HUD shows now
99 void print_weapon() const;
100
101 // The vehicle under control: its template, position and engine load 0..1; "" on foot.
102 struct LoopSound {
103 // vehicle id * 256 + part; 2^40 + shot id (projectiles in flight); 2^41 + ambient object; 2^42 + 2 * character
104 // + patch (falling soldiers)
105 long long key;
106 std::string tmpl; // the part's template (it has its own sound script)
107 float pos[3];
108 float control; // Engine: load 0..1; RotationalBundle: turning speed, degrees / s
109 float speed, accel; // the vehicle's, m/s and m/s2
110 int patch = -1; // one patch of the script (LandingGear: 0 going down, 1 going up); -1 all of it
111 std::string script{}; // set: a soldier sound script ("soldierfallinghigh.ssc"), tmpl the soldier
112 };
113 // Engine, track, turret and wing loops of every intact vehicle with someone in the driver's seat (the player or a
114 // bot), and the in-flight loop of every live projectile whose template has a script; dt: time since the last call
115 // (turning and acceleration rates).
116 std::vector<LoopSound> loop_sounds(float dt);
117 struct SoundPart {
118 std::string tmpl, type; // lower case
119 int occurrence; // Physics::joint's: the how-many-th part of that name in the vehicle
120 };
121 std::map<std::string, std::vector<SoundPart>> sound_parts_; // by vehicle template
122 std::vector<std::pair<std::string, std::array<float, 3>>> ambient_; // map objects' looping parts and positions
123 bool ambient_found_ = false;
124 std::map<long long, Mat4> part_turn_; // last joint matrix of each turret part
125 std::map<int, float> part_speed_; // last speed of each vehicle
126 struct Stride {
127 float pos[3];
128 float next = 0; // time of its next footstep
129 int posture = -1; // last seen; -1 not seen yet
130 unsigned jumps = 0, landings = 0; // physics counts last seen
131 bool chute = false; // parachute open
132 bool swim = false; // swimming
133 bool moving = false; // above 0.5 m/s last frame
134 float landed = -10; // time of its last landing sound
135 float jumped = -10; // time of its last jump
136 bool falling = false; // free fall above 10 m/s, until ground, parachute or water: SoldierFallingHigh
137 bool active = false; // stepped this frame (alive, on foot)
138 std::string tmpl; // its soldier template
139 float voiced = -10; // time of its last hit voice
140 };
141 std::map<int, Stride> strides_; // by character: footsteps
142 void footsteps(float t, float dt);
143 void voice(int ch, const float pos[3], const std::string& tmpl, int source, bool killed);
144 bool motion_states(int ch, float forward, SoldierView& v) const; // swim, ladder, fall, parachute, jump states
145
146 struct SoundEvent {
147 std::string tmpl; // FireArms template; with effect, an EffectBundle (a shot's end effect: explosions)
148 float pos[3];
149 int source = -1; // the shooter: -1 the player, a bot's index, 100000 + 16 * vehicle body + seat
150 bool reload = false;
151 bool effect = false;
152 std::string script; // a soldier sound: the movement script ("soldierrun.ssc"), tmpl the soldier
153 int patch = 0; // its ground patch (0 sand, 1 metal, 2 wood, 3 concrete, 4 grass, 5 gravel)
154 SoundEvent(std::string t, std::array<float, 3> p, int src = -1, bool rel = false, bool fx = false, std::string sc = "", int pa = 0)
155 : tmpl(std::move(t)), pos{p[0], p[1], p[2]}, source(src), reload(rel), effect(fx), script(std::move(sc)), patch(pa) {}
156 };
157 std::vector<SoundEvent> sounds; // since the frontend last cleared it
158 // phys.fire for a weapon's projectile; remembers its end effect for the sound where it ends.
159 int fire(const WeaponDef& w, const float pos[3], const float vel[3], int ignore_vehicle, int ignore_character, int tag);
160 std::map<int, std::string> end_effects; // live shot id -> its projectile's endEffectTemplate
161 std::map<int, std::string> flying_; // live shot id -> its projectile template, if that has a sound script
162 std::map<std::string, bool> has_script_; // template -> it loads a sound script itself
163 std::vector<uint8_t> material_map; // terrain MaterialManager id per cell, row = z (info.material_size per side)
164 int ground_material(float x, float z) const;
165
168 std::map<std::string, std::string> words; // lexicon (lexiconAll.dat), set by the window; empty: keys shown
169 std::vector<SoldierView> soldiers;
170 std::map<std::string, int> skipped;
171
172private:
173 struct Seat {
174 WeaponDef weapon;
175 Mat4 muzzle; // posed FireArms part, for firing
176 bool has_muzzle = false;
177 float next_fire = 0, exit[3] = {-2, 0, 0}, pos[3] = {}; // pos: the SeatObject, vehicle space
178 Mat4 at; // the SeatObject's transform, vehicle space
179 int show = 0; // as SeatDef::show
180 std::string lower, upper; // the seated soldier's animation states
181 int who = -2; // -2 empty, -1 the player, else a bot
182 std::string pco; // its PlayerControlObject template (HUD icons)
183 Ammo ammo; // its weapon's rounds (magSize, numOfMag); empty ones refill at depots that workOnVehicles
184 };
185 struct Veh {
186 int id = -1;
187 std::string name;
188 size_t first = 0, parts = 0;
189 bool plane = false, ship = false;
190 int team = 0; // of its crew; 0 empty
191 float len = 0, throttle = 0, muzzles_at = -1;
192 float hp = 100;
193 int material = 0;
194 bool wrecked = false;
195 size_t wreck_first = 0, wreck_parts = 0; // the wreck detail level, drawn once destroyed
196 std::vector<Seat> seats; // [0] the driver
197 Mat4 start; // where it was placed
198 bool gear_down = true; // aircraft landing gear
199 float gear_moving = 0; // seconds of gear travel left
200 struct ArmorFx { // addArmorEffect <hp> <effect> <pos>: running while hp is below <hp>; 0: on destruction
201 float below = 0;
202 std::string effect;
203 float pos[3] = {};
204 int id = -1;
205 };
206 std::vector<ArmorFx> armor_fx;
207 struct PartFx { // an EffectBundle on a part (wheel dust, exhaust, bow wave): vehicle space at rest
208 std::string effect;
210 int id = -1;
211 };
212 std::vector<PartFx> part_fx;
213 float wrecked_at = 0;
214 };
215 // LandingGear settings of an aircraft (its first LandingGear part), defaults as the Mac client's template;
216 // travel = setMaxRotation / setMaxSpeed (shortcut: the original stops the sound when the rotation stops).
217 struct Gear {
218 bool has = false;
219 float down_height = 30, up_height = 20, down_input = 0.65f, up_input = 0.85f, travel = 1;
220 };
221 std::map<std::string, Gear> gears_; // by vehicle template
222 void landing_gear(float dt);
223
224 struct Depot { // placed SupplyDepot (ammo boxes, medic lockers, airfield and vehicle depots; half-tracks' are not placed)
225 float pos[3] = {}, radius = 0, health = 0;
226 bool soldiers = true, vehicles = false; // workOnSoldiers, workOnVehicles // health: hit points per second (setHealth second value; unverified)
227 int team = 0; // 0: both
228 std::map<int, float> ammo; // ammoType -> rounds per second (addAmmoType third value; unverified)
229 };
230 std::vector<Depot> depots;
231 void supply(float step);
232 int nearest_depot(const float pos[3], int team, const WeaponDef& w) const;
233 struct SpawnPt {
234 float pos[3] = {}, yaw = 0;
235 int group = -1;
236 int veh = -1, team = 0; // on a ship (moves with vehicle `veh`, local offset `local`), owned by `team`
237 float local[3] = {};
238 };
239 void move_spawns(); // spawn points on vehicles follow them
240 struct Bot {
241 int ch = -1, team = 0;
242 std::string tmpl;
243 size_t first = 0, parts = 0;
244 size_t held_first = 0, held_parts = 0; // its primary weapon's draw items
245 float hp = 30, yaw = 0, pos[3] = {};
246 bool dead = false, moving = false;
247 float died_at = 0;
248 WeaponDef weapon;
249 Ammo ammo;
250 int kit = 1, posture = 0; // posture as Physics::set_posture
251 WeaponDef grenade; // the kit's hand grenade, if any
252 Ammo grenades;
253 float next_grenade = 0;
254 WeaponDef sidearm; // the kit's pistol: fired once the primary has no round and no magazine left
255 Ammo side_ammo;
256 size_t side_first = 0, side_parts = 0;
257 WeaponDef mine, pack; // engineers: landmines laid near flags its team holds, packs left by enemy vehicles
258 Ammo mines, packs;
259 float next_mine = 0;
260 float next_fire = 0, seen_at = -1, next_look = 0, last_shot = -10;
261 bool was_reloading = false;
262 int target = -2; // -2 nobody, -1 the player, else a bot
263 float check_at = 0, check_pos[2] = {}, detour_until = 0, detour_side = 1; // getting unstuck
264 int veh = -1, vseat = -1; // the vehicle and seat it sits in
265 float board_at = 0; // next look for a vehicle to board
266 float reverse_until = 0; // driving: backing out of a jam
267 int jams = 0; // stuck checks in a row while driving; gives up the vehicle at 4
268 std::vector<float> path; // waypoints (x, z) to the flag it runs for
269 size_t waypoint = 0;
270 int path_goal = -1; // flag index the path leads to
271 float replan_at = 0;
272 };
273
274 const VehicleDef* def_for(const std::string& name);
275 float ground(float x, float z) const;
276 // Infantry route from pos to (gx, gz); from a blocked cell it first leaves by the nearest free cell in sight.
277 std::vector<float> route(int ch, const float pos[3], float gx, float gz) const;
278 void add_vehicle(const std::string& name, Mat4 world, int team = 0);
279 const ConObject* object_template(const std::string& n) const;
280 float hitpoints(const std::string& n) const;
281 std::string primary(int tm, int kt) const;
282 std::vector<std::string> kit_weapons(int tm, int kt) const; // kit order, those with a projectile and medic packs
283 int spawn_team(const SpawnPt& sp) const;
284 void get_in_out();
285 void walk(float forward, float right, bool jump, bool slow);
286 void fire(float t);
287 float game_time() const { return now; }
288 void player_dies();
289 void apply_hits();
290 void think(float t, float step);
291 void demo_play(float sim_seconds);
292 void demo_vehicle();
293
294 const Vfs& vfs;
295 Con& con;
296 Effects effects{con}; // smoke, fire, explosions, muzzle flashes (visual only)
297 void effect(const std::string& name, const float pos[3], const float dir[3] = nullptr, bool sound = true);
298 void armor_effects();
299 const Heightmap& hm;
300 const TerrainInfo& info;
301 std::vector<DrawItem>& scene;
302 GameOptions opt;
303
304 std::vector<Veh> vehicles;
305 int cur = -1; // the vehicle under control
306 std::map<std::string, std::unique_ptr<VehicleDef>> defs; // by template; null if it cannot move
307
308 int player = -1, team = 2;
309 int seat = 0; // the player's seat in vehicle `cur`
310 void take_seat(int s);
311 size_t sol_first = 0, sol_parts = 0;
312 std::map<int, std::string> team_skins;
313 // setMinimapIcon / setMinimapIconSize of a template: "Minimap/x.tga" as menu/texture/minimap/x; empty: none
314 std::string minimap_icon(const std::string& tmpl, float* size) const;
315 std::map<std::pair<int, int>, std::string> kits;
316 std::string soldier_tmpl, weapon_name = "M1Garand", lower_state = "lb_stand";
317 float move_f = 0, move_r = 0;
318
319 Conquest game;
320 std::vector<SpawnPt> spawn_points;
321 std::vector<Bot> bots;
322 NavGrid nav; // infantry map of the level, 2 m cells; empty: bots run straight
323 NavGrid tank_nav; // tank map, 4 m cells; empty: bot drivers go straight
324 NavGrid boat_nav; // landing craft (else boat) map, 4 m cells; empty: boats go straight
325 bool troop_boat(const Veh& v) const { return v.ship && !v.plane && v.len < 8; } // LCVP, Higgins, Daihatsu
326 void disembark(Veh& v, float t);
327 // Out of rounds and magazines for its primary (not reloading), with a pistol: it fires the pistol.
328 static bool on_sidearm(const Bot& b, float t) {
329 return !b.sidearm.name.empty() && !b.ammo.unlimited && b.ammo.rounds == 0 && b.ammo.spare == 0 && !b.ammo.reloading(t);
330 }
331 void lay_charges(Bot& b, size_t bi, float t);
332 void board(Bot& b, float t);
333 void crew(Bot& b, float t, float step, const float* target, int target_veh);
334 void leave(Bot& b);
335 void refresh_muzzles(Veh& v);
336 void seat_point(const Veh& v, size_t s, float out[3]) const;
337 const Seat* shown_seat(int veh, int s) const; // the seat if its soldier is drawn (seatFlags), else null
338 Mat4 seated(int veh, const Seat& st) const; // where a seated soldier's model goes
339 std::array<int, 3> deaths{0, 0, 0};
340 int detours = 0; // sidesteps taken by stuck bots
341 int grenades_thrown = 0, boardings = 0, wrecks = 0, mines_laid = 0, packs_laid = 0;
342 DamageTable damage;
343 WeaponDef hand; // the weapon in hand, and its ammunition
344 Ammo hand_ammo;
345 std::vector<std::pair<WeaponDef, Ammo>> loadout; // the kit's weapons that fire; the held one's ammo lives in hand_ammo
346 size_t slot = 0;
347 std::vector<std::pair<size_t, size_t>> loadout_items; // per slot: first draw item, count (held weapon models)
348 size_t add_weapon_items(const std::string& weapon); // appends a hand weapon's parts far below; returns the count
349 void select(size_t i);
350 void refill_loadout();
351 bool fire_held = false; // trigger held last step (fireOnce weapons)
352 float last_shot = -10; // the player's, game time
353 bool was_reloading = false;
354 // Upper-body and weapon states for a soldier holding `w`: firing (shot within the last moment), reloading.
355 void arm_states(SoldierView& v, const std::string& w, const WeaponDef& def, const Ammo& ammo, float shot, int pose) const;
356 int posture = 0; // the player's: 0 stand, 1 crouch, 2 prone
357 size_t chute_first = 0, chute_parts = 0; // the parachute's draw items (far below while closed)
358 size_t fp_first = 0, fp_parts = 0; // first-person arms and body (far below in third person)
359 bool first_person = false;
360 float hands[3] = {-0.12f, -1.56f, 0.1f}; // center1pHands: the 1p rig's origin from the camera
361 float chute_k = 0; // setParachuteDrag / mass of the player's soldier
362 float fall_damage(int character, float full); // hit points lost on the last landing
363 bool lying = false; // prone toggled on
364 float eye_height() const { return posture == 2 ? 0.35f : posture == 1 ? 1.0f : 1.5f; }
365 static float body_height(int p) { return p == 2 ? 0.7f : p == 1 ? 1.2f : 1.8f; } // as the physics capsules
366 struct Placed { // mines (go off near a vehicle) and explosive packs (go off on detonate)
367 int shot = -1;
368 float near = 0;
369 int owner = -1; // -1 the player, else the bot that placed it
370 float radius = 0, at = 0; // a bot's pack: its blast radius, when it was left
371 };
372 std::vector<Placed> placed;
373 void placed_charges(bool detonate);
374 float hand_next = 0, player_hp = 30, respawn_at = -1, now = 0;
375 bool player_dead = false;
376 std::vector<std::pair<float, std::string>> feed; // (game time, message): kills, captures, destroyed vehicles
377 void announce(int patch); // a GamePlay.ssc announcement to the player, in its language
378 void heal(float t); // the player's medic pack in use
379 float healed_sound_ = -10;
380 void radio(int key);
381 struct RadioLine {
382 std::string text, extra, shown; // lexicon RADIO_HEADING_<text> / RADIO_<text>; extra: a control point's name
383 // (sent); shown: in the menu instead of extra ("CLOSEST")
384 int radio = -1, voice = -1;
385 };
386 std::vector<RadioLine> radio_items() const; // the open category, by F-key (7); empty text: nothing there
387 std::string word(const std::string& key) const; // lexicon text, else the key
388 int radio_menu_ = -1; // open radio category, -1 closed
389 bool radio_bar_ = true; // the radio category row shown (F8)
390 float radio_until_ = 0, tickets_start_ = 0;
391 void note(std::string m) {
392 while (!feed.empty() && now - feed.front().first > 6) feed.erase(feed.begin());
393 feed.emplace_back(now, std::move(m));
394 }
395 std::mt19937 rng{1942}; // AI aim error; fixed seed: --shot runs repeat
396};
397
398} // namespace obf
Definition con.h:21
std::map< long long, Mat4 > part_turn_
Definition game.h:124
std::vector< MeshParticle > effect_meshes() const
Definition game.h:96
std::vector< LoopSound > loop_sounds(float dt)
Definition game.cpp:888
HudInfo hud_info() const
Definition game.cpp:2042
int ground_material(float x, float z) const
Definition game.cpp:290
std::map< std::string, std::string > words
Definition game.h:168
std::vector< Sprite > effect_sprites() const
Definition game.h:95
void print_weapon() const
Definition game.cpp:235
Camera cam
Definition game.h:167
std::vector< std::pair< std::string, std::array< float, 3 > > > ambient_
Definition game.h:122
bool motion_states(int ch, float forward, SoldierView &v) const
Definition game.cpp:1005
std::map< int, Stride > strides_
Definition game.h:141
void demo(float sim_seconds)
Definition game.cpp:1820
int fire(const WeaponDef &w, const float pos[3], const float vel[3], int ignore_vehicle, int ignore_character, int tag)
Definition game.cpp:298
void footsteps(float t, float dt)
Definition game.cpp:323
std::map< int, std::string > end_effects
Definition game.h:160
void step(float t, float dt, const GameInput &in)
Definition game.cpp:1706
void voice(int ch, const float pos[3], const std::string &tmpl, int source, bool killed)
Definition game.cpp:1046
std::vector< uint8_t > material_map
Definition game.h:163
std::map< std::string, std::vector< SoundPart > > sound_parts_
Definition game.h:121
bool controls_camera() const
Definition game.h:97
bool ambient_found_
Definition game.h:123
Physics phys
Definition game.h:166
std::vector< SoldierView > soldiers
Definition game.h:169
void pose()
Definition game.cpp:1913
Game(const Vfs &vfs, Con &con, const Heightmap &hm, const TerrainInfo &info, std::vector< DrawItem > &scene, const std::vector< SpawnPoint > &spawns, const GameOptions &opt, Camera cam, bool objects)
Definition game.cpp:22
std::vector< SoundEvent > sounds
Definition game.h:157
std::map< int, float > part_speed_
Definition game.h:125
std::map< std::string, int > skipped
Definition game.h:170
std::map< int, std::string > flying_
Definition game.h:161
std::map< std::string, bool > has_script_
Definition game.h:162
Definition physics.h:115
Definition vfs.h:11
Definition con.py:1
Definition anim.cpp:7
std::string lower(std::string s)
Definition con.cpp:10
Definition game.h:69
static Ammo full(const WeaponDef &w)
Definition game.cpp:668
bool unlimited
Definition game.h:72
int rounds
Definition game.h:70
bool supply(float rounds, const WeaponDef &w)
Definition game.cpp:675
float reload_until
Definition game.h:71
float refill
Definition game.h:78
void tick(float t, const WeaponDef &w)
Definition game.cpp:704
bool reloading(float t) const
Definition game.h:77
bool take(float t)
Definition game.cpp:693
void reload(float t, const WeaponDef &w)
Definition game.cpp:700
int spare
Definition game.h:70
Definition game.h:82
float y
Definition game.h:83
float x
Definition game.h:83
float pitch
Definition game.h:83
float z
Definition game.h:83
float yaw
Definition game.h:83
Definition game.h:35
float look_x
Definition game.h:37
int seat
Definition game.h:46
float pitch
Definition game.h:36
bool crouch
Definition game.h:42
int radio
Definition game.h:45
bool prone
Definition game.h:43
bool use
Definition game.h:39
float look_y
Definition game.h:37
bool slow
Definition game.h:39
float throttle
Definition game.h:36
bool fire
Definition game.h:39
float roll
Definition game.h:36
float forward
Definition game.h:38
int select
Definition game.h:40
float yaw
Definition game.h:36
bool detonate
Definition game.h:41
bool view
Definition game.h:44
bool jump
Definition game.h:39
float right
Definition game.h:38
bool reload
Definition game.h:39
Definition game.h:26
int kit
Definition game.h:29
bool shot
Definition game.h:31
std::string drive
Definition game.h:27
std::string play
Definition game.h:28
bool fire_ahead
Definition game.h:30
Definition game.h:102
int patch
Definition game.h:110
float accel
Definition game.h:109
float pos[3]
Definition game.h:107
float control
Definition game.h:108
float speed
Definition game.h:109
long long key
Definition game.h:105
std::string script
Definition game.h:111
std::string tmpl
Definition game.h:106
bool reload
Definition game.h:150
std::string script
Definition game.h:152
std::string tmpl
Definition game.h:147
int source
Definition game.h:149
float pos[3]
Definition game.h:148
SoundEvent(std::string t, std::array< float, 3 > p, int src=-1, bool rel=false, bool fx=false, std::string sc="", int pa=0)
Definition game.h:154
int patch
Definition game.h:153
bool effect
Definition game.h:151
Definition game.h:117
std::string tmpl
Definition game.h:118
std::string type
Definition game.h:118
int occurrence
Definition game.h:119
Definition game.h:126
bool falling
Definition game.h:136
int posture
Definition game.h:129
bool swim
Definition game.h:132
float jumped
Definition game.h:135
bool moving
Definition game.h:133
unsigned landings
Definition game.h:130
float landed
Definition game.h:134
unsigned jumps
Definition game.h:130
bool active
Definition game.h:137
std::string tmpl
Definition game.h:138
float next
Definition game.h:128
float voiced
Definition game.h:139
float pos[3]
Definition game.h:127
bool chute
Definition game.h:131
Definition game.h:200
float pos[3]
Definition game.h:203
float below
Definition game.h:201
std::string effect
Definition game.h:202
Definition game.h:207
std::string effect
Definition game.h:208
Mat4 local
Definition game.h:209
Definition terrain.h:21
Definition hud.h:42
Definition mat.h:8
static Mat4 identity()
Definition mat.h:10
Definition game.h:51
std::string lower
Definition game.h:53
size_t held_parts
Definition game.h:55
bool first_person
Definition game.h:56
float weapon_hold
Definition game.h:61
size_t first
Definition game.h:52
std::string weapon
Definition game.h:60
float shot
Definition game.h:65
float hold
Definition game.h:54
std::string upper
Definition game.h:53
size_t held_first
Definition game.h:55
std::string muzzle
Definition game.h:63
size_t parts
Definition game.h:52
float muzzle_pos[3]
Definition game.h:64
float upper_hold
Definition game.h:58
float span
Definition game.h:59
float lower_hold
Definition game.h:62
float fov
Definition game.h:57
Definition terrain.h:9
Definition physics.h:54