Пример #1
0
        public void OnMouseDrag(MouseDragEventArgs mouseDragEventArgs)
        {
            var startPoint = _guiToRelativeCoordinateTransformer.TransformToRelative(mouseDragEventArgs.StartPosition);
            var endPoint   = _guiToRelativeCoordinateTransformer.TransformToRelative(mouseDragEventArgs.EndPosition);

            Camera.Rotate(startPoint, endPoint);
        }
Пример #2
0
        private void CalculateRelativeMousePosition()
        {
            var mouseDevice = _gameWindow.Mouse;

            var x = mouseDevice.X;
            var y = mouseDevice.Y;
            var absoluteMouseCoordinates = new Vector2d(x, y);

            _previousRelativeMousePosition = _currentRelativeMousePosition;
            _currentRelativeMousePosition  = _guiToRelativeCoordinateTransformer.TransformToRelative(absoluteMouseCoordinates);
        }