X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrlugburz;a=blobdiff_plain;f=src%2Fplayer.h;fp=src%2Fplayer.h;h=d4d47b3fe01ada9b62617a6810a04cf209bb9013;hp=0000000000000000000000000000000000000000;hb=3c7da38bbf5936211348c5b6c31874364060dca8;hpb=0a754b5aac897ffde09e93027aed78c95b81b99b diff --git a/src/player.h b/src/player.h new file mode 100644 index 0000000..d4d47b3 --- /dev/null +++ b/src/player.h @@ -0,0 +1,27 @@ +#ifndef PLAYER_H_ +#define PLAYER_H_ + +#include "cgmath/cgmath.h" +#include "level.h" + +struct player { + struct level *lvl; + + int cx, cy; + cgm_vec3 cpos; /* cell position (derived from cx,cy) */ + float theta, phi; /* mouselook/VR controller rotation (theta only) */ + cgm_vec3 vpos; /* VR position within the cell */ + cgm_quat vrot; /* VR orientation */ + + float height; + + /* view matrix, derived from all of the above by upd_player_xform */ + float view_xform[16]; + + int hp, mp, hp_max, mp_max; +}; + +void init_player(struct player *p); +void upd_player_xform(struct player *p); + +#endif /* PLAYER_H_ */