]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/client_player.h
You can now see other players
[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_entity.h"
6 #include "types.h"
7
8 extern struct ClientPlayer {
9         v3f64 velocity; // velocity is changed and read from the same thread, no lock needed
10         ToClientMovement movement;
11         pthread_rwlock_t lock_movement;
12 } client_player;
13
14 void client_player_init();                           // called on startup
15 void client_player_deinit();                         // called on shutdown
16
17 void client_player_gfx_init();
18 void client_player_gfx_deinit();
19
20 ClientEntity *client_player_entity();                // grab and return client entity
21
22 void client_player_jump();                           // jump if possible
23
24 void client_player_update_pos(ClientEntity *entity); // entity needs to be the client entity
25 void client_player_update_rot(ClientEntity *entity); // entity needs to be the client entity
26
27 void client_player_tick(f64 dtime);                  // to be called every frame
28
29 #endif // _CLIENT_PLAYER_H_