Touch.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using BBIWARG.Recognition.FingerRecognition;
  2. using BBIWARG.Recognition.PalmRecognition;
  3. using BBIWARG.Recognition.Tracking;
  4. using BBIWARG.Utility;
  5. namespace BBIWARG.Recognition.TouchRecognition
  6. {
  7. /// <summary>
  8. /// Represents a touch (Finger touching a Palm)
  9. /// </summary>
  10. public class Touch : TrackableObject
  11. {
  12. /// <summary>
  13. /// the absolute position of the touch
  14. /// </summary>
  15. public Vector2D AbsolutePosition { get; private set; }
  16. /// <summary>
  17. /// the touching finger
  18. /// </summary>
  19. public Finger Finger { get; private set; }
  20. /// <summary>
  21. /// the touched palm
  22. /// </summary>
  23. public Palm Palm { get; private set; }
  24. /// <summary>
  25. /// the relative position of the touch within the palm quad
  26. /// </summary>
  27. public Vector2D RelativePosition { get; private set; }
  28. /// <summary>
  29. /// Initializes a new instance of the Touch class.
  30. /// </summary>
  31. /// <param name="absolutePosition">The absolute position.</param>
  32. /// <param name="finger">The touching finger.</param>
  33. /// <param name="palm">The touched palm.</param>
  34. public Touch(Vector2D absolutePosition, Finger finger, Palm palm)
  35. {
  36. AbsolutePosition = absolutePosition;
  37. RelativePosition = palm.getRelativePosition(absolutePosition);
  38. Finger = finger;
  39. Palm = palm;
  40. finger.Touch = this;
  41. }
  42. }
  43. }