4 using System.Collections.Generic;
5 using SiliconStudio.Core.Mathematics;
7 namespace SiliconStudio.
Paradox.Input
14 internal readonly
static Queue<PointerEvent> Pool =
new Queue<PointerEvent>();
19 return Pool.Count > 0 ? Pool.Dequeue() :
new PointerEvent();
41 PointerId = pointerId;
43 DeltaPosition = deltaPosition;
44 DeltaTime = deltaTime;
47 IsPrimary = isPrimary;
55 public int PointerId {
get;
internal set; }
61 public Vector2 Position {
get;
internal set; }
67 public Vector2 DeltaPosition {
get;
internal set; }
73 public TimeSpan DeltaTime {
get;
internal set; }
91 public bool IsPrimary {
get;
internal set; }
99 var clone = GetOrCreatePointerEvent();
101 clone.PointerId = PointerId;
102 clone.Position = Position;
103 clone.DeltaPosition = DeltaPosition;
104 clone.DeltaTime = DeltaTime;
107 clone.IsPrimary = IsPrimary;
114 return string.Format(
"PointerId: {0}, Position: {1:0.00}, DeltaPosition: {2:0.00}, DeltaTime: {3:0.000}, State: {4}, PointerType: {5}, IsPrimary: {6}", PointerId, Position, DeltaPosition, DeltaTime.TotalSeconds, State,
PointerType, IsPrimary);
Represents a two dimensional mathematical vector.