All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TouchRotateGesture.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "VectorMath.h"
6 #include "IEmscriptenInputHandler.h"
7 #include "InputEvents.h"
8 
9 namespace Eegeo
10 {
11  namespace Emscripten
12  {
13  namespace Input
14  {
16  {
17  private:
18  IEmscriptenInputHandler* m_pHandler;
19  bool m_rotating;
20  Eegeo::v2 m_lastPointer[2];
21  float m_lastRotationRadians;
22  float m_totalRotation;
23  float m_previousRotationDelta;
24 
25  bool m_needNewBaseline;
26 
27  Eegeo::v2 m_baselineDirection;
28 
29  float m_majorScreenDimension;
30 
31  bool UpdateRotation(const TouchInputEvent& event, int numTouches, bool pointerUp);
32 
33  public:
34  TouchRotateGesture(IEmscriptenInputHandler* pHandler, float screenWidth, float screenHeight);
35 
36  void PointerDown(const TouchInputEvent& event);
37  void PointerUp(const TouchInputEvent& event);
38  void PointerMove(const TouchInputEvent& event);
39 
40  void NotifyScreenPropertiesChanged(int screenWidth, int screenHeight);
41  };
42  }
43  }
44 }