All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TouchPanGesture.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 <map>
10 
11 namespace Eegeo
12 {
13  namespace Emscripten
14  {
15  namespace Input
16  {
18  {
19  private:
20  IEmscriptenInputHandler* m_pHandler;
21  bool m_panning;
22  std::map<long, Eegeo::v2> m_inputMap;
23 
24  Eegeo::v2 m_panCenter;
25  Eegeo::v2 m_panAnchor;
26  float m_majorScreenDimension;
27 
28  Eegeo::v2 GetTouchExtents(const TouchInputEvent& event) const;
29  void PopulatePanData(int numTouches, const v2& touchExtents, AppInterface::PanData& out_panData) const;
30 
31  public:
32  TouchPanGesture(IEmscriptenInputHandler* pHandler, const float screenWidth, const float screenHeight);
33 
34  void PointerDown(const TouchInputEvent& event);
35  void PointerUp(const TouchInputEvent& event);
36  void PointerMove(const TouchInputEvent& event);
37 
38  void NotifyScreenPropertiesChanged(int screenWidth, int screenHeight);
39  };
40  }
41  }
42 }