SyndicatQuebecoisdelaConstr.../SQCSim2021/player.h

38 lines
897 B
C
Raw Normal View History

2021-09-27 13:15:57 -04:00
#ifndef _PLAYER_H__
#define _PLAYER_H__
#include "vector3.h"
#include "transformation.h"
2021-12-07 18:59:50 -05:00
#include "audio.h"
2021-10-02 15:00:48 -04:00
#include <cmath>
2021-09-27 13:15:57 -04:00
2021-12-01 21:21:45 -05:00
class World;
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-11-15 20:58:13 -05:00
Vector3f GetInput(bool front, bool back, bool left, bool right, bool jump, bool dash, float elapsedTime);
2021-12-07 18:59:50 -05:00
void ApplyPhysics(Vector3f input, World world, float elapsedTime, Audio* audio);
2021-09-27 13:56:29 -04:00
void ApplyTransformation(Transformation& transformation, bool rel = true) const;
2021-09-27 13:15:57 -04:00
2021-10-25 10:50:08 -04:00
Vector3f GetPosition() const;
2021-10-26 17:28:37 -04:00
Vector3f GetDirection() const;
Vector3f GetVelocity() const;
2021-11-15 20:58:13 -05:00
Vector3f GetPOV() const;
2021-12-03 11:49:59 -05:00
void Teleport(int& x, int& z);
2021-10-25 10:50:08 -04:00
2021-09-27 13:15:57 -04:00
private:
Vector3f m_position;
2021-10-26 17:28:37 -04:00
Vector3f m_velocity;
2021-10-31 00:31:08 -04:00
Vector3f m_direction;
2021-11-15 20:58:13 -05:00
2021-09-27 13:15:57 -04:00
float m_rotX = 0;
float m_rotY = 0;
2021-11-16 20:48:52 -05:00
float m_POV;
2021-11-15 20:58:13 -05:00
bool m_airborne;
2021-09-27 13:15:57 -04:00
};
#endif //_PLAYER_H__