All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PanGesture.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "AppInterface.h"
6 #include "VectorMath.h"
7 #include "IEmscriptenInputHandler.h"
8 #include "InputEvents.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Emscripten
14  {
15  namespace Input
16  {
17  class PanGesture
18  {
19  private:
20  IEmscriptenInputHandler* m_pHandler;
21  bool m_panButtonDown;
22  bool m_panning;
23  v2 m_anchor;
24  v2 m_current;
25  float m_majorScreenDimension;
26  const float m_panStartThresholdPixels;
27 
28  AppInterface::PanData PopulatePanData() const;
29  public:
30  PanGesture(IEmscriptenInputHandler* pHandler, const float screenWidth, const float screenHeight, const float panStartThresholdPixels);
31 
32  void PointerDown(const MouseInputEvent& event);
33  void PointerUp(const MouseInputEvent& event);
34  void PointerMove(const MouseInputEvent& event);
35 
36  void NotifyScreenPropertiesChanged(int screenWidth, int screenHeight);
37  };
38  }
39  }
40 }