/Engine/Game/MouseTracker.cs
C# | 54 lines | 35 code | 3 blank | 16 comment | 2 complexity | 23d0e64a9c6291b88fad69c1c8bf2d2c MD5 | raw file
1using Delta.Engine.Game.Interfaces; 2using Delta.InputSystem; 3using Delta.Utilities.Datatypes; 4 5namespace Delta.Engine.Game 6{ 7 /// <summary> 8 /// Very simple class to provide an IAttachable interface that will always 9 /// return the mouse position. Useful for effect testing. 10 /// </summary> 11 public class MouseTracker : IAttachable 12 { 13 #region Position (Public) 14 /// <summary> 15 /// The current position of the attachable. 16 /// </summary> 17 public Vector Position 18 { 19 get 20 { 21 return new Vector(Input.Mouse.Position, 0.0f); 22 } 23 } 24 #endregion 25 26 #region Rotation (Public) 27 /// <summary> 28 /// The current rotation of the attachable. 29 /// </summary> 30 public float Rotation 31 { 32 get 33 { 34 // Unused 35 return 0.0f; 36 } 37 } 38 #endregion 39 40 #region Constructor 41 /// <summary> 42 /// Constructor for MouseTracker, just makes sure the input commands are 43 /// initialized, which is useful for many tests. 44 /// </summary> 45 public MouseTracker() 46 { 47 if (Input.Commands == null) 48 { 49 // Dummy to initialize the commands 50 } 51 } 52 #endregion 53 } 54}