Basic movement and camera management between players and editor

This commit is contained in:
2016-01-22 16:12:51 +01:00
parent 1e3fc1ae2d
commit ca2aab449e
24 changed files with 499 additions and 176 deletions
+13 -5
View File
@@ -1,14 +1,22 @@
#include "Common.h"
#include "GLM.h"
#include "Core/System.h"
#include "Events/EPlayerSpawned.h"
#include "Input/FirstPersonInputController.h"
class PlayerMovementSystem : public PureSystem
class PlayerMovementSystem : public ImpureSystem, PureSystem
{
public:
PlayerMovementSystem(World* world, EventBroker* eventBroker)
: System(world, eventBroker)
, PureSystem("Player")
{ }
PlayerMovementSystem(World* world, EventBroker* eventBroker);
~PlayerMovementSystem();
virtual void Update(double dt) override;
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt);
private:
// State
std::unordered_map<EntityWrapper, FirstPersonInputController<PlayerMovementSystem>*> m_PlayerInputControllers;
EventRelay<PlayerMovementSystem, Events::PlayerSpawned> m_EPlayerSpawned;
bool OnPlayerSpawned(Events::PlayerSpawned& e);
};