]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/client_player.h
Rename wetness to humidity
[dragonblocks_alpha.git] / src / client / client_player.h
1 #ifndef _CLIENT_PLAYER_H_
2 #define _CLIENT_PLAYER_H_
3
4 #include <pthread.h>
5 #include "client/client.h"
6 #include "client/hud.h"
7 #include "client/object.h"
8 #include "types.h"
9
10 extern struct ClientPlayer
11 {
12         v3f64 pos;                                      // feet position
13         v3f64 velocity;                         // current velocity
14         aabb3f64 box;                           // axis-aligned bounding box (used for collision), with 0, 0, 0 being the feet position
15         f32 yaw, pitch;                         // look direction
16         f64 eye_height;                         // eye height above feet
17         pthread_rwlock_t rwlock;        // used to protect the above properties
18         bool fly;                                       // can the player fly?
19         bool collision;                         // should the player collide with the floor?
20         Object *obj;                            // 3D mesh object (currently always invisible), not thread safe
21         HUDElement *info_hud;           // display position, temperature and humidity on HUD, not thread safe
22 } client_player;
23
24 void client_player_init();                              // ClientPlayer singleton constructor
25 void client_player_deinit();                    // ClientPlayer singleton destructor
26 void client_player_add_to_scene();              // create mesh object and hud display
27 void client_player_jump();                              // jump if possible
28 v3f64 client_player_get_position();             // get position (thread-safe)
29 void client_player_tick(f64 dtime);             // to be called every frame
30 void client_player_update_info();               // update HUD info text
31
32 #endif