LeapDeviceInfo.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. namespace Leap.Unity
  3. {
  4. public struct LeapDeviceInfo
  5. {
  6. public LeapDeviceInfo(LeapDeviceType initialization = LeapDeviceType.Invalid)
  7. {
  8. this.type = initialization;
  9. LeapDeviceType leapDeviceType = this.type;
  10. if (leapDeviceType != LeapDeviceType.Peripheral)
  11. {
  12. if (leapDeviceType != LeapDeviceType.Dragonfly)
  13. {
  14. this.isEmbedded = false;
  15. this.baseline = 0f;
  16. this.focalPlaneOffset = 0f;
  17. this.horizontalViewAngle = 0f;
  18. this.verticalViewAngle = 0f;
  19. this.trackingRange = 0f;
  20. this.serialID = string.Empty;
  21. }
  22. else
  23. {
  24. this.isEmbedded = false;
  25. this.baseline = 0.064f;
  26. this.focalPlaneOffset = 0.08f;
  27. this.horizontalViewAngle = 132.00002f;
  28. this.verticalViewAngle = 115.00002f;
  29. this.trackingRange = 0.47f;
  30. this.serialID = string.Empty;
  31. }
  32. }
  33. else
  34. {
  35. this.isEmbedded = false;
  36. this.baseline = 0.04f;
  37. this.focalPlaneOffset = 0.07f;
  38. this.horizontalViewAngle = 132.00002f;
  39. this.verticalViewAngle = 115.00002f;
  40. this.trackingRange = 0.47f;
  41. this.serialID = string.Empty;
  42. }
  43. }
  44. public LeapDeviceType type;
  45. public bool isEmbedded;
  46. public float baseline;
  47. public float focalPlaneOffset;
  48. public float horizontalViewAngle;
  49. public float verticalViewAngle;
  50. public float trackingRange;
  51. public string serialID;
  52. }
  53. }