Indépendance!

This commit is contained in:
MarcEricMartel
2023-09-30 14:46:54 -04:00
parent ace555a93e
commit 033365c961
32 changed files with 890 additions and 1204 deletions

View File

@@ -1,33 +1,43 @@
#ifndef _PLAYER_H__
#define _PLAYER_H__
#include "vector3.h"
#ifndef CLI_PLAYER_H__
#define CLI_PLAYER_H__
#include <cmath>
#include "transformation.h"
#include "vector3.h"
class World;
class World;
class Player {
public:
enum Sound { NOSOUND, STEP, FALL };
Player(const Vector3f& position, float rotX = 0, float rotY = 0);
void TurnLeftRight(float value);
void TurnTopBottom(float value);
Vector3f GetInput(bool front, bool back, bool left, bool right, bool jump, bool dash, float elapsedTime);
void ApplyPhysics(Vector3f input, World* world, float elapsedTime);
Sound ApplyPhysics(Vector3f input, World* world, float elapsedTime);
void ApplyTransformation(Transformation& transformation, bool rel = true) const;
Vector3f GetPosition() const;
Vector3f GetDirection() const;
Vector3f GetVelocity() const;
Vector3f GetPOV() const;
std::string GetUsername() const;
float GetHP() const;
void Teleport(int& x, int& z);
protected:
private:
Vector3f m_position;
Vector3f m_velocity;
Vector3f m_direction;
std::string m_username;
float m_rotX = 0;
float m_rotY = 0;
float m_POV;
float m_hp;
bool m_airborne;
};
#endif //_PLAYER_H__