Fixed movement on a "player" cube. Very simple system atm

This commit is contained in:
stiffly
2015-12-11 15:00:57 +01:00
parent c2435fda2d
commit 4da33ff4ec
2 changed files with 44 additions and 17 deletions
+10 -1
View File
@@ -10,6 +10,14 @@
#include "Core/EKeyDown.h"
#include "Core/EKeyUp.h"
struct KeyInput
{
bool Forward = false;
bool Left = false;
bool Back = false;
bool Right = false;
};
class PlayerSystem : public System
{
public:
@@ -21,8 +29,9 @@ public:
virtual void Update(World* world, ComponentWrapper& player, double dt) override;
private:
float m_Speed;
float m_Speed = 5;
glm::vec3 m_Direction;
KeyInput input;
EventRelay<PlayerSystem, Events::KeyDown> m_EKeyDown;
bool OnKeyDown(const Events::KeyDown &event);