JointOrientation.cs 1.2 KB

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