Example #1
0
        private void Input_MouseMove(object sender, MouseEventArgs e)
        {
#if WINDOWS_PHONE
            if (e.IsButtonDown(MouseButtons.Left))
#else
            if (e.IsButtonDown(MouseButtons.Right))
#endif
            {
                Position = new Vector2(startPosition.X - (e.X - startMouse.X) / Zoom,
                                       startPosition.Y + (e.Y - startMouse.Y) / Zoom);
            }
        }
Example #2
0
 void Input_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.IsButtonDown(RotateButton))
     {
         EndRotation(e.X, e.Y);
     }
 }
Example #3
0
        void Input_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.IsButtonDown(TranslateButton))
            {
                float dx = e.X - startPoint.X;
                float dz = e.Y - startPoint.Y;

                startPoint.X = e.X;
                startPoint.Y = e.Y;

                lookAt.X += ((float)Math.Cos(Yaw) * dz + (float)Math.Sin(Yaw) * dx) * Speed * 0.04f;
                lookAt.Z += ((float)Math.Sin(Yaw) * dz - (float)Math.Cos(Yaw) * dx) * Speed * 0.04f;
            }
            else if (e.IsButtonDown(RotateButton))
            {
                float dx = e.X - startPoint.X;

                startPoint.X = e.X;

                Yaw += dx * 0.002f * MathHelper.Pi;
            }
        }