summaryrefslogtreecommitdiff
path: root/src/player.h
blob: 3e957e9183200562ad2dadd2e5ffe31a170a835d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef PLAYER_H
#define PLAYER_H

#include <stdbool.h>
#include "common.h"

typedef struct player {
    struct xyz pos, velocity;  // vectors for the player
    float angle, anglesin, anglecos; // angle, and its sine and cosine
    size_t sector; // the sector that the player is in
    float stand_height, duck_height, head_margin, knee_height;  // eyeheights; minimum margin between current height and celling; maximum height objects the player can walk over
    bool moving, ducking;
} player_t;

void player_default(player_t *player);

void player_input(player_t *player, bool *input, int rmouse_x, int rmouse_y);
void player_update(player_t *player);

#endif