CameraSpacePoint.cs 1.2 KB

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