/Engine/Game/MouseTracker.cs
C# | 54 lines | 35 code | 3 blank | 16 comment | 2 complexity | 23d0e64a9c6291b88fad69c1c8bf2d2c MD5 | raw file
Possible License(s): Apache-2.0
- using Delta.Engine.Game.Interfaces;
- using Delta.InputSystem;
- using Delta.Utilities.Datatypes;
-
- namespace Delta.Engine.Game
- {
- /// <summary>
- /// Very simple class to provide an IAttachable interface that will always
- /// return the mouse position. Useful for effect testing.
- /// </summary>
- public class MouseTracker : IAttachable
- {
- #region Position (Public)
- /// <summary>
- /// The current position of the attachable.
- /// </summary>
- public Vector Position
- {
- get
- {
- return new Vector(Input.Mouse.Position, 0.0f);
- }
- }
- #endregion
-
- #region Rotation (Public)
- /// <summary>
- /// The current rotation of the attachable.
- /// </summary>
- public float Rotation
- {
- get
- {
- // Unused
- return 0.0f;
- }
- }
- #endregion
-
- #region Constructor
- /// <summary>
- /// Constructor for MouseTracker, just makes sure the input commands are
- /// initialized, which is useful for many tests.
- /// </summary>
- public MouseTracker()
- {
- if (Input.Commands == null)
- {
- // Dummy to initialize the commands
- }
- }
- #endregion
- }
- }