Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
4.3 KiB

  1. // Fallback Headset|SDK_Fallback|002
  2. namespace VRTK
  3. {
  4. using UnityEngine;
  5. using System.Collections.Generic;
  6. /// <summary>
  7. /// The Fallback Headset SDK script provides a fallback collection of methods that return null or default headset values.
  8. /// </summary>
  9. /// <remarks>
  10. /// This is the fallback class that will just return default values.
  11. /// </remarks>
  12. [SDK_Description(typeof(SDK_FallbackSystem))]
  13. public class SDK_FallbackHeadset : SDK_BaseHeadset
  14. {
  15. /// <summary>
  16. /// The ProcessUpdate method enables an SDK to run logic for every Unity Update
  17. /// </summary>
  18. /// <param name="options">A dictionary of generic options that can be used to within the update.</param>
  19. public override void ProcessUpdate(Dictionary<string, object> options)
  20. {
  21. }
  22. /// <summary>
  23. /// The ProcessFixedUpdate method enables an SDK to run logic for every Unity FixedUpdate
  24. /// </summary>
  25. /// <param name="options">A dictionary of generic options that can be used to within the fixed update.</param>
  26. public override void ProcessFixedUpdate(Dictionary<string, object> options)
  27. {
  28. }
  29. /// <summary>
  30. /// The GetHeadset method returns the Transform of the object that is used to represent the headset in the scene.
  31. /// </summary>
  32. /// <returns>A transform of the object representing the headset in the scene.</returns>
  33. public override Transform GetHeadset()
  34. {
  35. return null;
  36. }
  37. /// <summary>
  38. /// The GetHeadsetCamera method returns the Transform of the object that is used to hold the headset camera in the scene.
  39. /// </summary>
  40. /// <returns>A transform of the object holding the headset camera in the scene.</returns>
  41. public override Transform GetHeadsetCamera()
  42. {
  43. return null;
  44. }
  45. /// <summary>
  46. /// The GetHeadsetType method returns a string representing the type of headset connected.
  47. /// </summary>
  48. /// <returns>The string of the headset connected.</returns>
  49. public override string GetHeadsetType()
  50. {
  51. return CleanPropertyString("");
  52. }
  53. /// <summary>
  54. /// The GetHeadsetVelocity method is used to determine the current velocity of the headset.
  55. /// </summary>
  56. /// <returns>A Vector3 containing the current velocity of the headset.</returns>
  57. public override Vector3 GetHeadsetVelocity()
  58. {
  59. return Vector3.zero;
  60. }
  61. /// <summary>
  62. /// The GetHeadsetAngularVelocity method is used to determine the current angular velocity of the headset.
  63. /// </summary>
  64. /// <returns>A Vector3 containing the current angular velocity of the headset.</returns>
  65. public override Vector3 GetHeadsetAngularVelocity()
  66. {
  67. return Vector3.zero;
  68. }
  69. /// <summary>
  70. /// The HeadsetFade method is used to apply a fade to the headset camera to progressively change the colour.
  71. /// </summary>
  72. /// <param name="color">The colour to fade to.</param>
  73. /// <param name="duration">The amount of time the fade should take to reach the given colour.</param>
  74. /// <param name="fadeOverlay">Determines whether to use an overlay on the fade.</param>
  75. public override void HeadsetFade(Color color, float duration, bool fadeOverlay = false)
  76. {
  77. }
  78. /// <summary>
  79. /// The HasHeadsetFade method checks to see if the given game object (usually the camera) has the ability to fade the viewpoint.
  80. /// </summary>
  81. /// <param name="obj">The Transform to check to see if a camera fade is available on.</param>
  82. /// <returns>Returns true if the headset has fade functionality on it.</returns>
  83. public override bool HasHeadsetFade(Transform obj)
  84. {
  85. return false;
  86. }
  87. /// <summary>
  88. /// The AddHeadsetFade method attempts to add the fade functionality to the game object with the camera on it.
  89. /// </summary>
  90. /// <param name="camera">The Transform to with the camera on to add the fade functionality to.</param>
  91. public override void AddHeadsetFade(Transform camera)
  92. {
  93. }
  94. }
  95. }