44 lines
711 B
C++
44 lines
711 B
C++
#pragma once
|
|
|
|
#include <glad/glad.h>
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
#include <GameObject.h>
|
|
#include <Camera.h>
|
|
|
|
|
|
enum EInputDirection
|
|
{
|
|
FORWARD,
|
|
BACKWARD,
|
|
LEFT,
|
|
RIGHT
|
|
};
|
|
|
|
class Player : public GameObject
|
|
{
|
|
public:
|
|
Player(glm::vec3 Position, glm::vec3 Rotation);
|
|
~Player() = default;
|
|
|
|
void Update();
|
|
|
|
void ProcessKeyboard(EInputDirection Direction, float Delta);
|
|
void ProcessMouseMovement(float XOffset, float YOffset, GLboolean ConstrainPitch = true);
|
|
glm::mat4 GetViewMatrix() const;
|
|
|
|
private:
|
|
Camera* PlayerCamera;
|
|
float Yaw;
|
|
float MouseSensitivity;
|
|
|
|
float WalkSpeed = 5.0f;
|
|
float RunSpeed = 15.0f;
|
|
|
|
bool bIsRunning = false;
|
|
|
|
void UpdatePlayerVectors();
|
|
|
|
};
|
|
|