Joint.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using RootSystem = System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace Windows.Kinect
  5. {
  6. //
  7. // Windows.Kinect.Joint
  8. //
  9. [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
  10. public struct Joint
  11. {
  12. public Windows.Kinect.JointType JointType { get; set; }
  13. public Windows.Kinect.CameraSpacePoint Position { get; set; }
  14. public Windows.Kinect.TrackingState TrackingState { get; set; }
  15. public override int GetHashCode()
  16. {
  17. return JointType.GetHashCode() ^ Position.GetHashCode() ^ TrackingState.GetHashCode();
  18. }
  19. public override bool Equals(object obj)
  20. {
  21. if (!(obj is Joint))
  22. {
  23. return false;
  24. }
  25. return this.Equals((Joint)obj);
  26. }
  27. public bool Equals(Joint obj)
  28. {
  29. return JointType.Equals(obj.JointType) && Position.Equals(obj.Position) && TrackingState.Equals(obj.TrackingState);
  30. }
  31. public static bool operator ==(Joint a, Joint b)
  32. {
  33. return a.Equals(b);
  34. }
  35. public static bool operator !=(Joint a, Joint b)
  36. {
  37. return !(a.Equals(b));
  38. }
  39. }
  40. }