ZEDControllerManager.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //======= Copyright (c) Stereolabs Corporation, All rights reserved. ===============
  2. // ##DEPRECATED
  3. using UnityEngine;
  4. /// <summary>
  5. /// Interface for handling SteamVR and Oculus tracked controllers in the same way.
  6. /// Implemented in ZEDSteamVRControllerManager and ZEDOculusControllerManager.
  7. /// </summary>
  8. public interface ZEDControllerManager
  9. {
  10. /// <summary>
  11. /// Whether controllers have been initialized.
  12. /// </summary>
  13. bool PadsAreInit { get;}
  14. /// <summary>
  15. /// Checks if a button is down.
  16. /// </summary>
  17. /// <param name="button">Button to check.</param>
  18. /// <param name="controllerid">ID of the controller to check.</param>
  19. /// <returns></returns>
  20. bool GetDown(sl.CONTROLS_BUTTON button, int controllerid = -1);
  21. /// <summary>
  22. /// Checks if a trigger is down.
  23. /// </summary>
  24. /// <param name="button">Trigger to check.</param>
  25. /// <param name="controllerID">ID of the controller to check.</param>
  26. /// <returns></returns>
  27. float GetHairTrigger(sl.CONTROLS_AXIS1D button, int controllerID = -1);
  28. /// <summary>
  29. /// Gets the ID of the right controller.
  30. /// </summary>
  31. /// <returns></returns>
  32. int GetRightIndex();
  33. /// <summary>
  34. /// Gets the ID of the left controller.
  35. /// </summary>
  36. /// <returns></returns>
  37. int GetLeftIndex();
  38. /// <summary>
  39. /// Gets the local position of a controller.
  40. /// </summary>
  41. /// <param name="IDPad"></param>
  42. /// <returns></returns>
  43. Vector3 GetPosition(int IDPad);
  44. /// <summary>
  45. /// Loads the index of a controller according to files created from the ZED calibration tool.
  46. /// </summary>
  47. /// <param name="path"></param>
  48. void LoadIndex(string path);
  49. /// <summary>
  50. /// Gets the index of the current ZEDHolder object.
  51. /// </summary>
  52. int ControllerIndexZEDHolder { get; }
  53. }
  54. namespace sl
  55. {
  56. /// <summary>
  57. /// VR controller button press sources.
  58. /// </summary>
  59. public enum CONTROLS_BUTTON
  60. {
  61. THREE,
  62. ONE,
  63. PRIMARY_THUMBSTICK,
  64. SECONDARY_THUMBSTICK
  65. }
  66. /// <summary>
  67. /// VR controller trackpad/analog stick movement sources.
  68. /// </summary>
  69. public enum CONTROLS_AXIS2D
  70. {
  71. PRIMARY_THUBMSTICK,
  72. SECONDARY_THUMBSTICK
  73. }
  74. /// <summary>
  75. /// VR controller trigger movement sources.
  76. /// </summary>
  77. public enum CONTROLS_AXIS1D
  78. {
  79. PRIMARY_INDEX_TRIGGER,
  80. SECONDARY_INDEX_TRIGGER,
  81. PRIMARY_HAND_TRIGGER,
  82. SECONDARY_HAND_TRIGGER
  83. }
  84. }