public MouseRotateGesture(IUnityInputHandler handler, float screenWidth, float screenHeight)
 {
     m_handler       = handler;
     m_totalRotation = 0.0f;
     m_rotating      = false;
     m_anchor        = Vector2.zero;
 }
Beispiel #2
0
 public MouseZoomGesture(IUnityInputHandler handler)
 {
     m_handler = handler;
     // m_sensitivity is a unitless scaling value to convert to same units as used by pinch-zoom on touch devices
     // (which is distance pinched in normalized screen coordinates).
     m_sensitivity      = 0.008f;
     m_maxZoomPerSecond = 0.5f;
 }
Beispiel #3
0
 public UnityTouchInputProcessor(IUnityInputHandler handler, float screenWidth, float screenHeight)
 {
     m_pan    = new PanGesture(handler, screenWidth, screenHeight);
     m_pinch  = new PinchGesture(handler, screenWidth, screenHeight);
     m_rotate = new RotateGesture(handler, screenWidth, screenHeight);
     m_touch  = new TouchGesture(handler);
     m_tap    = new TapGesture(handler);
 }
Beispiel #4
0
        public MousePanGesture(IUnityInputHandler handler, float screenWidth, float screenHeight)
        {
            m_handler            = handler;
            m_panning            = false;
            majorScreenDimension = Math.Max(screenWidth, screenHeight);

            m_current = Vector2.zero;
            m_anchor  = Vector2.zero;
        }
 public TapGesture(IUnityInputHandler tapHandler)
 {
     m_tapHandler   = tapHandler;
     m_tapDownCount = 0;
     m_tapUpCount   = 0;
     m_currentPointerTrackingStack = 0;
     m_tapAnchorX = 0.0f;
     m_tapAnchorY = 0.0f;
 }
 public UnityMouseInputProcessor(IUnityInputHandler handler, float screenWidth, float screenHeight)
 {
     m_pan    = new MousePanGesture(handler, screenWidth, screenHeight);
     m_zoom   = new MouseZoomGesture(handler);
     m_rotate = new MouseRotateGesture(handler, screenWidth, screenHeight);
     m_tilt   = new MouseTiltGesture(handler);
     m_touch  = new MouseTouchGesture(handler);
     m_tap    = new MouseTapGesture(handler);
 }
        public RotateGesture(IUnityInputHandler handler, float screenWidth, float screenHeight)
        {
            m_handler               = handler;
            rotating                = false;
            lastRotationRadians     = 0.0f;
            m_totalRotation         = 0.0f;
            m_previousRotationDelta = 0.0f;
            needNewBaseline         = true;
            m_baselineDirection     = Vector2.zero;

            lastPointer = new Vector2[2];
        }
Beispiel #8
0
        public PanGesture(IUnityInputHandler handler, float screenWidth, float screenHeight)
        {
            m_handler            = handler;
            panning              = false;
            majorScreenDimension = Math.Max(screenWidth, screenHeight);

            inputs = new List <Vector2>();

            for (int i = 0; i < MaxPanInputs; ++i)
            {
                inputs.Add(Vector2.zero);
            }

            panCenter = Vector2.zero;
            panAnchor = Vector2.zero;
        }
Beispiel #9
0
 public PinchGesture(IUnityInputHandler handler, float screenWidth, float screenHeight)
 {
     m_handler            = handler;
     pinching             = false;
     majorScreenDimension = Math.Max(screenWidth, screenHeight);
 }
 public MouseZoomGesture(IUnityInputHandler handler)
 {
     m_handler = handler;
     m_sensitivity = 1.0f;
     m_maxZoomDelta = 50.0f;
 }
Beispiel #11
0
 public TouchGesture(IUnityInputHandler handler)
 {
     m_handler = handler;
 }
Beispiel #12
0
 public MouseTiltGesture(IUnityInputHandler handler)
 {
     m_handler = handler;
     m_tilting = false;
     m_previousMousePositionY = 0.0f;
 }