-
Notifications
You must be signed in to change notification settings - Fork 5
/
Player.h
45 lines (35 loc) · 835 Bytes
/
Player.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef PLAYER_H
#define PLAYER_H
#include <glm/glm.hpp>
class Player {
private:
glm::vec3 pos;
glm::vec3 forward;
glm::vec3 up;
glm::vec3 right;
glm::vec3 vel;
float desiredVel;
glm::vec3 desiredAngle;
const float MAX_VEL = 300.0f;
const float TRANSITION_SPEED = 10.0f;
public:
const float ROT_SPEED = 3.141592/64;
Player();
void setPos(glm::vec3 pos);
glm::vec3 getPos();
void setVel(glm::vec3 vel);
glm::vec3 getVel();
void setForward(glm::vec3 forward);
glm::vec3 getForward();
void setUp(glm::vec3 Up);
glm::vec3 getUp();
glm::vec3 getRight();
glm::vec3 getForwardXZ();
glm::vec3 getRightXZ();
void rotateTowards(glm::vec3 v, float angle);
void rotateRight(float angle);
void rotateUp(float angle);
void moveTowards(glm::vec3 dir);
void step(float dt);
};
#endif