2021-09-27 13:15:57 -04:00
|
|
|
#ifndef _PLAYER_H__
|
|
|
|
#define _PLAYER_H__
|
|
|
|
#include "vector3.h"
|
|
|
|
#include "transformation.h"
|
2021-10-02 15:00:48 -04:00
|
|
|
#include <cmath>
|
2021-09-27 13:15:57 -04:00
|
|
|
|
|
|
|
class Player {
|
|
|
|
public:
|
|
|
|
Player(const Vector3f& position, float rotX = 0, float rotY = 0);
|
|
|
|
void TurnLeftRight(float value);
|
|
|
|
void TurnTopBottom(float value);
|
2021-10-01 10:52:33 -04:00
|
|
|
void Move(bool front, bool back, bool left, bool right, bool jump, float elapsedTime);
|
2021-09-27 13:56:29 -04:00
|
|
|
void ApplyTransformation(Transformation& transformation, bool rel = true) const;
|
2021-09-27 13:15:57 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Vector3f m_position;
|
|
|
|
float m_rotX = 0;
|
|
|
|
float m_rotY = 0;
|
2021-10-01 10:52:33 -04:00
|
|
|
float m_accWS = 0;
|
|
|
|
float m_accAD = 0;
|
|
|
|
float m_accjmp = 0;
|
2021-10-02 15:00:48 -04:00
|
|
|
float m_yrotrad = 0;
|
|
|
|
float m_xrotrad = 0;
|
2021-10-01 10:52:33 -04:00
|
|
|
bool jumped = false;
|
2021-10-02 15:00:48 -04:00
|
|
|
|
|
|
|
float m_topspeed = 20;
|
|
|
|
float m_jumpheight = .4;
|
|
|
|
|
|
|
|
|
2021-09-27 13:15:57 -04:00
|
|
|
};
|
|
|
|
#endif //_PLAYER_H__
|
|
|
|
|