Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
gameplayrunninginput.h
1 #pragma once
2 
3 #include <vector>
4 
5 #include "input/inputmapping.h"
6 
7 #include "ui/actionkeymapping.h"
8 #include "utils/statemachine/trigger.h"
9 
10 #include "property/property.h"
11 
12 
13 class Player;
14 class WorldObject;
15 class InputConfigurator;
16 class GameState;
17 class HUD;
18 class HMD;
19 class Player;
20 
22 public:
24 
25  void resizeEvent(const unsigned int width, const unsigned int height);
26  void keyCallback(int key, int scancode, int action, int mods);
27  void mouseButtonCallback(int button, int action, int mods);
28  void update(float deltaSec);
29 
30 
31 protected:
32  InputConfigurator* m_inputConfigurator;
33  SecondaryInputValues m_secondaryInputValues;
34  std::vector<ActionKeyMapping*> m_actions;
35  bool m_centerCrosshair;
36  glm::vec2 m_lastMousePos;
37 
38  bool m_mouseControl;
39  int m_cursorMaxDistance;
40  int m_lastfocus;
41 
42  void toggleControls();
43 
44  void processUpdate();
45  void processMouseUpdate(float deltaSec);
46  void processHMDUpdate();
47  void applyUpdates();
48 
49  void processFireActions();
50  void processMoveActions();
51  void processRotateActions();
52  void processTargetSelectActions();
53 
54  float getInputValue(ActionKeyMapping* action);
55  float getInputValue(InputMapping mapping);
56 
57  void addActionsToVector();
58  void setupJoystickControls();
59  void retrieveInputValues();
60 
61  float m_currentTimePressed;
62 
63  Property<float> prop_deadzoneMouse;
64  Property<float> prop_deadzoneGamepad;
65 
66  Property<float> prop_maxClickTime;
67 
68  ActionKeyMapping fireAction;
69  ActionKeyMapping rocketAction;
70 
71  ActionKeyMapping moveLeftAction;
72  ActionKeyMapping moveRightAction;
73  ActionKeyMapping moveForwardAction;
74  ActionKeyMapping moveBackwardAction;
75 
76  ActionKeyMapping rotateLeftAction;
77  ActionKeyMapping rotateRightAction;
78  ActionKeyMapping rotateUpAction;
79  ActionKeyMapping rotateDownAction;
80  ActionKeyMapping rotateClockwiseAction;
81  ActionKeyMapping rotateCClockwiseAction;
82 
83  ActionKeyMapping selectNextAction;
84  ActionKeyMapping selectPreviousAction;
85 
86  glm::vec3 m_moveUpdate;
87  glm::vec3 m_rotateUpdate;
88  bool m_fireUpdate;
89  bool m_rocketUpdate;
90 
91  void placeCrossHair(double winX, double winY);
92 };
Definition: worldobject.h:43
Definition: gamestate.h:20
Definition: inputmapping.h:16
Definition: hmd.h:19
Definition: actionkeymapping.h:31
Definition: hud.h:34
Definition: actionkeymapping.h:9
Definition: player.h:22
Definition: gameplayrunninginput.h:21
void update(float deltaSec)
Definition: gameplayrunninginput.cpp:155
Definition: inputconfigurator.h:14