GameObjects
Began to add GameObjects, starting with the player.
This commit is contained in:
43
Player.h
Normal file
43
Player.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#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();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user