示例#1
0
        public void Update(int pressedButton)
        {
            #region Aim camera

            Pointer position = new Pointer();
            Import.GetCursorPos(ref position);

            int difX = FormMain.FormPos.X + 512 - position.x;
            int difY = FormMain.FormPos.Y + 384 - position.y;

            if (position.y < 384)
            {
                pitch -= rotationSpeed * difY;
            }
            else
                if (position.y > 384)
                {
                    pitch += rotationSpeed * -difY;
                }
            if (position.x < 512)
            {
                yaw += rotationSpeed * -difX;
            }
            else
                if (position.x > 512)
                {
                    yaw -= rotationSpeed * difX;
                }
            UpdateDirVector();
            CenterMouse();
            #endregion
            Look();
        }
示例#2
0
 public static extern void GetCursorPos(ref Pointer point);