11 #include <DependencyManager.h>
13 #include <GLMHelpers.h>
15 namespace VirtualPad {
18 virtual bool isBeingTouched();
19 virtual void setBeingTouched(
bool touched);
20 virtual void setFirstTouch(glm::vec2 point);
21 virtual glm::vec2 getFirstTouch();
22 virtual void setCurrentTouch(glm::vec2 point);
23 virtual glm::vec2 getCurrentTouch();
24 virtual bool isShown();
25 virtual void setShown(
bool show);
28 glm::vec2 _firstTouch;
29 glm::vec2 _currentTouch;
33 class Manager :
public QObject,
public Dependency {
37 Manager(
const Manager& other) =
delete;
39 static Manager& instance();
40 Instance* getLeftVirtualPad();
42 void enable(
bool enable);
45 int extraBottomMargin();
46 void setExtraBottomMargin(
int margin);
53 glm::vec2 getButtonPosition(Button button);
54 void setButtonPosition(Button button, glm::vec2 point);
56 void requestHapticFeedback(
int duration);
58 static const float DPI;
59 static const float BASE_DIAMETER_PIXELS;
60 static const float BASE_MARGIN_PIXELS;
61 static const float STICK_RADIUS_PIXELS;
62 static const float BTN_TRIMMED_RADIUS_PIXELS;
63 static const float BTN_FULL_PIXELS;
64 static const float BTN_BOTTOM_MARGIN_PIXELS;
65 static const float BTN_RIGHT_MARGIN_PIXELS;
68 void hapticFeedbackRequested(
int duration);
71 Instance _leftVPadInstance;
72 bool _enabled {
true };
74 int _extraBottomMargin { 0 };
75 std::map<Button, glm::vec2> _buttonsPositions;