player movement (to be cont.)
[vrlugburz] / src / player.h
1 #ifndef PLAYER_H_
2 #define PLAYER_H_
3
4 #include "cgmath/cgmath.h"
5 #include "level.h"
6
7 struct player {
8         struct level *lvl;
9
10         int cx, cy;
11         cgm_vec3 cpos;          /* cell position (derived from cx,cy) */
12         float theta, phi;       /* mouselook/VR controller rotation (theta only) */
13         cgm_vec3 vpos;          /* VR position within the cell */
14         cgm_quat vrot;          /* VR orientation */
15
16         int dir;                        /* cardinal direction, clockwise, 0 is west */
17         float height;
18
19         /* view matrix, derived from all of the above by upd_player_xform */
20         float view_xform[16];
21
22         int hp, mp, hp_max, mp_max;
23 };
24
25 void init_player(struct player *p);
26 void upd_player_xform(struct player *p);
27
28 #endif  /* PLAYER_H_ */