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 "AndroidInput.h"
8 #include <vector>
9 
10 namespace Eegeo
11 {
12  namespace Android
13  {
14  namespace Input
15  {
16  class PanGesture
17  {
18  private:
19  IAndroidInputHandler* pHandler;
20  bool panning;
21  std::vector<Eegeo::v2> inputs;
22  Eegeo::v2 panCenter;
23  Eegeo::v2 panAnchor;
24  float majorScreenDimension;
25 
26  Eegeo::v2 GetTouchExtents(const TouchInputEvent& event) const;
27  void PopulatePanData(int numTouches, const v2& touchExtents, AppInterface::PanData& out_panData) const;
28 
29  public:
30  PanGesture(IAndroidInputHandler* pHandler, const float screenWidth, const float screenHeight);
31 
32  void PointerDown(const TouchInputEvent& event);
33  void PointerUp(const TouchInputEvent& event);
34  void PointerMove(const TouchInputEvent& event);
35 
36  void SetScreenDimensions(float screenWidth, float screenHeight);
37  };
38  }
39  }
40 }