public MultiGestureEventArguments(MultiGestureEventArgs args)
 {
     CenterX    = args.CenterX;
     CenterY    = args.CenterY;
     NumFingers = args.NumFingers;
     DTheta     = args.DTheta;
     DDist      = args.DDist;
 }
Beispiel #2
0
        private void Input_MultiGesture(MultiGestureEventArgs obj)
        {
            if (obj.NumFingers >= 2)
            {
                Debug.WriteLine("DDist: {0}", obj.DDist);

                if (obj.NumFingers == 2)
                {
                    MainCamera.OrthoSize -= obj.DDist * PinchFactor;
                }
                else if (obj.NumFingers >= 3)
                {
                    //if(m_PreviousTouchX == -1 && m_PreviousTouchY == -1)
                    //{
                    //    m_PreviousTouchX = obj.CenterX;
                    //    m_PreviousTouchY = obj.CenterY;
                    //}

                    //float deltaX = obj.CenterX - m_PreviousTouchX;
                    //float deltaY = obj.CenterY - m_PreviousTouchY;

                    //float cameraX = -TouchMovementFactor * deltaX * DT;
                    //float cameraY = TouchMovementFactor * deltaY * DT;

                    ////cameraNode.Position = cameraNode.LocalToWorld(new Vector3(cameraX, cameraY, 0f));
                    //cameraNode.Position = new Vector3(cameraNode.Position.X + cameraX, cameraNode.Position.Y + cameraY, cameraNode.Position.Z);

                    //Debug.WriteLine("Camera " + cameraY + " " + cameraX);

                    //m_PreviousTouchX = obj.CenterX;
                    //m_PreviousTouchY = obj.CenterY;
                }

                m_PreviousDDist = obj.DDist;
            }
        }
 private void OnMultiGesture(MultiGestureEventArgs args)
 {
     _multiGesture?.Invoke(this, new MultiGestureEventArguments(args));
 }