-
Notifications
You must be signed in to change notification settings - Fork 0
/
SInputSystem.h
48 lines (39 loc) · 1.08 KB
/
SInputSystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef SINPUTSYSTEM_H
#define SINPUTSYSTEM_H
#include <lf/Lightfeather.h>
#include "entityx.h"
#include "events.h"
#include "components.h"
using namespace lf;
using namespace entityx;
struct SInputSystem : public System<SInputSystem>, Receiver<SInputSystem> ,input::IKeyListener, input::IMouseListener
{
public:
SInputSystem();
virtual ~SInputSystem();
void configure(entityx::ptr<EventManager> event_manager);
void update(entityx::ptr<EntityManager> es, entityx::ptr<EventManager> events, double dt);
virtual void keyPressed(input::CKeyEvent& event);
virtual void keyReleased(input::CKeyEvent& event);
virtual void mousePressed(input::CMouseEvent& event);
bool firstUpdate;
bool left;
bool right;
bool up;
bool down;
bool shift;
f32 yaw;
f32 pitch;
f32 roll;
f32 rotX[3];
f32 rotY[3];
f32 rotXAvg;
f32 rotYAvg;
f32 rotateXSpeed;
f32 rotateYSpeed;
f32 timeDiff;
input::ICursorControl *mouseControl;
render::IRenderWindow *rwin;
entityx::ptr<EventManager> events;
};
#endif // SINPUTSYSTEM_H