Camera.cs 479 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Collections.Generic;
  4. using Urho.Urho2D;
  5. using Urho.Gui;
  6. using Urho.Resources;
  7. using Urho.IO;
  8. using Urho.Navigation;
  9. using Urho.Network;
  10. namespace Urho
  11. {
  12. partial class Camera
  13. {
  14. public Ray GetScreenRayForMouse()
  15. {
  16. var app = Application.Current;
  17. var cursorPos = app.UI.CursorPosition;
  18. return GetScreenRay((float)cursorPos.X / app.Graphics.Width, (float)cursorPos.Y / app.Graphics.Height);
  19. }
  20. }
  21. }